From 6959e2ab216aeb1d5d8f07ce73cd8b9894b83006 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 30 Jun 2013 20:57:03 -0400 Subject: Added first version of select extension and new API hooks needed by it. --- ChangeLog | 17 +++++ awk.h | 1 + extension/ChangeLog | 9 +++ extension/Makefile.am | 5 ++ extension/Makefile.in | 19 ++++- extension/configh.in | 6 ++ extension/configure | 6 +- extension/configure.ac | 6 +- extension/select.c | 183 +++++++++++++++++++++++++++++++++++++++++++++++++ gawkapi.c | 84 +++++++++++++++++++++++ gawkapi.h | 29 +++++++- io.c | 34 +++++---- 12 files changed, 379 insertions(+), 20 deletions(-) create mode 100644 extension/select.c diff --git a/ChangeLog b/ChangeLog index 9cdaf0b7..aed9b6fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2013-06-30 Andrew J. Schorr + * awk.h (redirect_string): Declare new function that provides API access + to the redirection mechanism. + * gawkapi.h (GAWK_API_MINOR_VERSION): Bump from 0 to 1 since 2 new + hooks were added to the api. + (gawk_api_t): Add 2 new functions api_lookup_file and api_get_file. + (lookup_file, get_file): New macros to wrap the new API functions. + * gawkapi.c (curfile): Declare this extern, since it is needed + by lookup_file and get_flie. + (api_lookup_file): Find an open file using curfile or getredirect(). + (api_get_file): Find or open a file using curfile or redirect_string(). + (api_impl): Add api_lookup_file and api_get_file. + * io.c (redirect_string): Renamed from redirect and changed arguments + to take a string instead of a 'NODE *'. This allows it to be called + through the API's new get_file hook. + (redirect): Now implemented by calling redirect_string backend function. + 2013-06-27 Arnold D. Robbins * awkgram.y: Minor whitespace cleanup, remove redundant ifdef. diff --git a/awk.h b/awk.h index b9d3a1b0..7ca401a5 100644 --- a/awk.h +++ b/awk.h @@ -1517,6 +1517,7 @@ extern void set_FNR(void); extern void set_NR(void); extern struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg); +extern struct redirect *redirect_string(char *redir_exp_str, size_t redir_exp_len, int not_string_flag, int redirtype, int *errflg); extern NODE *do_close(int nargs); extern int flush_io(void); extern int close_io(bool *stdio_problem); diff --git a/extension/ChangeLog b/extension/ChangeLog index 04159df8..37cfccf2 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,12 @@ +2013-06-30 Andrew J. Schorr + + * Makefile.am (pkgextension_LTLIBRARIES): Add select.la. + (select_la_SOURCES, select_la_LDFLAGS, select_la_LIBADD): Build new + select extension. + * configure.ac (AC_CHECK_HEADERS): Add signal.h. + (AC_CHECK_FUNCS): Add sigaction. + * select.c: Implement the new select extension. + 2013-06-10 Arnold D. Robbins * configure.ac (AC_HEADER_MAJOR): New macro added. diff --git a/extension/Makefile.am b/extension/Makefile.am index 7b52b14b..58fc3df6 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -42,6 +42,7 @@ pkgextension_LTLIBRARIES = \ revoutput.la \ revtwoway.la \ rwarray.la \ + select.la \ testext.la \ time.la @@ -70,6 +71,10 @@ ordchr_la_SOURCES = ordchr.c ordchr_la_LDFLAGS = $(MY_MODULE_FLAGS) ordchr_la_LIBADD = $(MY_LIBS) +select_la_SOURCES = select.c +select_la_LDFLAGS = $(MY_MODULE_FLAGS) +select_la_LIBADD = $(MY_LIBS) + readdir_la_SOURCES = readdir.c gawkdirfd.h readdir_la_LDFLAGS = $(MY_MODULE_FLAGS) readdir_la_LIBADD = $(MY_LIBS) diff --git a/extension/Makefile.in b/extension/Makefile.in index 8d0a2869..97ee41fe 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -203,6 +203,12 @@ 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 $@ +select_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_select_la_OBJECTS = select.lo +select_la_OBJECTS = $(am_select_la_OBJECTS) +select_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(select_la_LDFLAGS) $(LDFLAGS) -o $@ testext_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am_testext_la_OBJECTS = testext.lo testext_la_OBJECTS = $(am_testext_la_OBJECTS) @@ -253,12 +259,14 @@ SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ - $(rwarray_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) + $(rwarray_la_SOURCES) $(select_la_SOURCES) \ + $(testext_la_SOURCES) $(time_la_SOURCES) DIST_SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ - $(rwarray_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) + $(rwarray_la_SOURCES) $(select_la_SOURCES) \ + $(testext_la_SOURCES) $(time_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -497,6 +505,7 @@ pkgextension_LTLIBRARIES = \ revoutput.la \ revtwoway.la \ rwarray.la \ + select.la \ testext.la \ time.la @@ -520,6 +529,9 @@ inplace_la_LIBADD = $(MY_LIBS) ordchr_la_SOURCES = ordchr.c ordchr_la_LDFLAGS = $(MY_MODULE_FLAGS) ordchr_la_LIBADD = $(MY_LIBS) +select_la_SOURCES = select.c +select_la_LDFLAGS = $(MY_MODULE_FLAGS) +select_la_LIBADD = $(MY_LIBS) readdir_la_SOURCES = readdir.c gawkdirfd.h readdir_la_LDFLAGS = $(MY_MODULE_FLAGS) readdir_la_LIBADD = $(MY_LIBS) @@ -664,6 +676,8 @@ revtwoway.la: $(revtwoway_la_OBJECTS) $(revtwoway_la_DEPENDENCIES) $(EXTRA_revtw $(AM_V_CCLD)$(revtwoway_la_LINK) -rpath $(pkgextensiondir) $(revtwoway_la_OBJECTS) $(revtwoway_la_LIBADD) $(LIBS) rwarray.la: $(rwarray_la_OBJECTS) $(rwarray_la_DEPENDENCIES) $(EXTRA_rwarray_la_DEPENDENCIES) $(AM_V_CCLD)$(rwarray_la_LINK) -rpath $(pkgextensiondir) $(rwarray_la_OBJECTS) $(rwarray_la_LIBADD) $(LIBS) +select.la: $(select_la_OBJECTS) $(select_la_DEPENDENCIES) $(EXTRA_select_la_DEPENDENCIES) + $(AM_V_CCLD)$(select_la_LINK) -rpath $(pkgextensiondir) $(select_la_OBJECTS) $(select_la_LIBADD) $(LIBS) testext.la: $(testext_la_OBJECTS) $(testext_la_DEPENDENCIES) $(EXTRA_testext_la_DEPENDENCIES) $(AM_V_CCLD)$(testext_la_LINK) -rpath $(pkgextensiondir) $(testext_la_OBJECTS) $(testext_la_LIBADD) $(LIBS) time.la: $(time_la_OBJECTS) $(time_la_DEPENDENCIES) $(EXTRA_time_la_DEPENDENCIES) @@ -686,6 +700,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revoutput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revtwoway.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rwarray.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@ diff --git a/extension/configh.in b/extension/configh.in index 8571844b..a7212dc1 100644 --- a/extension/configh.in +++ b/extension/configh.in @@ -78,6 +78,12 @@ /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H diff --git a/extension/configure b/extension/configure index f59548c1..02ff3dc8 100755 --- a/extension/configure +++ b/extension/configure @@ -14002,7 +14002,8 @@ fi fi fi -for ac_header in dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h sys/param.h +for ac_header in dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h \ + sys/param.h signal.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -14017,7 +14018,8 @@ done for ac_func in fdopendir fnmatch gettimeofday \ - getdtablesize nanosleep select GetSystemTimeAsFileTime + getdtablesize nanosleep select sigaction \ + GetSystemTimeAsFileTime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/extension/configure.ac b/extension/configure.ac index d819ebfa..5b95f966 100644 --- a/extension/configure.ac +++ b/extension/configure.ac @@ -67,10 +67,12 @@ else fi AC_HEADER_MAJOR -AC_CHECK_HEADERS(dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h sys/param.h) +AC_CHECK_HEADERS(dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h \ + sys/param.h signal.h) AC_CHECK_FUNCS(fdopendir fnmatch gettimeofday \ - getdtablesize nanosleep select GetSystemTimeAsFileTime) + getdtablesize nanosleep select sigaction \ + GetSystemTimeAsFileTime) GAWK_FUNC_DIRFD GAWK_PREREQ_DIRFD diff --git a/extension/select.c b/extension/select.c new file mode 100644 index 00000000..f74ae250 --- /dev/null +++ b/extension/select.c @@ -0,0 +1,183 @@ +/* + * select.c - Builtin functions to provide select I/O multiplexing. + */ + +/* + * Copyright (C) 2013 the Free Software Foundation, Inc. + * + * This file is part of GAWK, the GNU implementation of the + * AWK Programming Language. + * + * GAWK is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * GAWK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "gawkapi.h" + +#include "gettext.h" +#define _(msgid) gettext(msgid) +#define N_(msgid) msgid + +static const gawk_api_t *api; /* for convenience macros to work */ +static awk_ext_id_t *ext_id; +static const char *ext_version = "ordchr extension: version 1.0"; +static awk_bool_t (*init_func)(void) = NULL; + +int plugin_is_GPL_compatible; + +#if defined(HAVE_SELECT) && defined(HAVE_SYS_SELECT_H) +#include +#endif + +#ifdef HAVE_SIGNAL_H +#include +#endif + +/* do_ord --- return numeric value of first char of string */ + +static awk_value_t * +do_select(int nargs, awk_value_t *result) +{ + static const char *argname[] = { "read", "write", "except" }; + struct { + awk_value_t array; + awk_flat_array_t *flat; + fd_set bits; + int *array2fd; + } fds[3]; + awk_value_t timeout_arg; + int i; + struct timeval maxwait; + struct timeval *timeout; + int nfds = 0; + int rc; + + if (do_lint && nargs > 5) + lintwarn(ext_id, _("select: called with too many arguments")); + +#define EL fds[i].flat->elements[j] + for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) { + size_t j; + + if (! get_argument(i, AWK_ARRAY, & fds[i].array)) { + warning(ext_id, _("select: bad array parameter `%s'"), argname[i]); + update_ERRNO_string(_("select: bad array parameter")); + return make_number(-1, result); + } + /* N.B. flatten_array fails for empty arrays, so that's OK */ + FD_ZERO(&fds[i].bits); + if (flatten_array(fds[i].array.array_cookie, &fds[i].flat)) { + emalloc(fds[i].array2fd, int *, fds[i].flat->count*sizeof(int), "select"); + for (j = 0; j < fds[i].flat->count; j++) { + fds[i].array2fd[j] = -1; + switch (EL.index.val_type) { + case AWK_NUMBER: + if (EL.index.num_value >= 0) + fds[i].array2fd[j] = EL.index.num_value; + if (fds[i].array2fd[j] != EL.index.num_value) + fds[i].array2fd[j] = -1; + break; + case AWK_STRING: + if (EL.value.val_type == AWK_STRING) { + const awk_input_buf_t *buf; + if ((buf = get_file(EL.index.str_value.str, EL.index.str_value.len, EL.value.str_value.str, EL.value.str_value.len)) != NULL) + fds[i].array2fd[j] = buf->fd; + } + break; + } + if (fds[i].array2fd[j] < 0) { + warning(ext_id, _("select: get_file failed")); + update_ERRNO_string(_("select: get_file failed")); + if (! release_flattened_array(fds[i].array.array_cookie, fds[i].flat)) + warning(ext_id, _("select: release_flattened_array failed")); + free(fds[i].array2fd); + return make_number(-1, result); + } + FD_SET(fds[i].array2fd[j], &fds[i].bits); + if (nfds <= fds[i].array2fd[j]) + nfds = fds[i].array2fd[j]+1; + } + } + else + fds[i].flat = NULL; + } + if (get_argument(3, AWK_NUMBER, &timeout_arg)) { + double secs = timeout_arg.num_value; + if (secs < 0) { + warning(ext_id, _("select: treating negative timeout as zero")); + secs = 0; + } + maxwait.tv_sec = secs; + maxwait.tv_usec = (secs-(double)maxwait.tv_sec)*1000000.0; + timeout = &maxwait; + } else + timeout = NULL; + rc = select(nfds, &fds[0].bits, &fds[1].bits, &fds[2].bits, timeout); + + if (rc < 0) { + update_ERRNO_int(errno); + /* bit masks are undefined, so delete all array entries */ + for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) { + if (fds[i].flat) { + size_t j; + for (j = 0; j < fds[i].flat->count; j++) + EL.flags |= AWK_ELEMENT_DELETE; + if (! release_flattened_array(fds[i].array.array_cookie, fds[i].flat)) + warning(ext_id, _("select: release_flattened_array failed")); + free(fds[i].array2fd); + } + } + return make_number(rc, result); + } + + for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) { + if (fds[i].flat) { + size_t j; + /* remove array elements not set in the bit mask */ + for (j = 0; j < fds[i].flat->count; j++) { + if (! FD_ISSET(fds[i].array2fd[j], &fds[i].bits)) + EL.flags |= AWK_ELEMENT_DELETE; + } + if (! release_flattened_array(fds[i].array.array_cookie, fds[i].flat)) + warning(ext_id, _("select: release_flattened_array failed")); + free(fds[i].array2fd); + } + } +#undef EL + + /* Set the return value */ + return make_number(rc, result); +} + +static awk_ext_func_t func_table[] = { + { "select", do_select, 5 }, +}; + +/* define the dl_load function using the boilerplate macro */ + +dl_load_func(func_table, select, "") diff --git a/gawkapi.c b/gawkapi.c index 61f91e8c..78d6dbe4 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -25,6 +25,8 @@ #include "awk.h" +extern IOBUF *curfile; /* required by api_lookup_file and api_get_file */ + static awk_bool_t node_to_awk_value(NODE *node, awk_value_t *result, awk_valtype_t wanted); /* @@ -1028,6 +1030,84 @@ api_release_value(awk_ext_id_t id, awk_value_cookie_t value) return true; } +/* api_lookup_file --- return a handle to an open file */ + +static const awk_input_buf_t * +api_lookup_file(awk_ext_id_t id, const char *name, size_t namelen) +{ + const struct redirect *f; + + if ((name == NULL) || (namelen == 0)) { + if (curfile == NULL) + return NULL; + return &curfile->public; + } + if ((f = getredirect(name, namelen)) == NULL) + return NULL; + return &f->iop->public; +} + +/* api_get_file --- return a handle to an existing or newly opened file */ + +static const awk_input_buf_t * +api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, size_t typelen) +{ + const struct redirect *f; + int flag; /* not used, sigh */ + enum redirval redirtype; + + if ((name == NULL) || (namelen == 0)) { + if (curfile == NULL) { + if (nextfile(& curfile, false) <= 0) + return NULL; + /* XXX Fix me! */ + fputs("Bug: need to call BEGINFILE!\n", stderr); + } + return &curfile->public; + } + redirtype = redirect_none; + switch (typelen) { + case 1: + switch (*filetype) { + case '<': + redirtype = redirect_input; + break; + case '>': + redirtype = redirect_output; + break; + } + break; + case 2: + switch (*filetype) { + case '>': + if (filetype[1] == '>') + redirtype = redirect_append; + break; + case '|': + switch (filetype[1]) { + case '>': + redirtype = redirect_pipe; + break; + case '<': + redirtype = redirect_pipein; + break; + case '&': + redirtype = redirect_twoway; + break; + } + break; + } + } + if (redirtype == redirect_none) { + warning(_("cannot open unrecognized file type `%s' for `%s'"), + filetype, name); + return NULL; + } + if ((f = redirect_string(name, namelen, 0, redirtype, &flag)) == NULL) + return NULL; + return &f->iop->public; +} + /* * Register a version string for this extension with gawk. */ @@ -1107,6 +1187,10 @@ gawk_api_t api_impl = { api_clear_array, api_flatten_array, api_release_flattened_array, + + /* Find/get open files */ + api_lookup_file, + api_get_file, }; /* init_ext_api --- init the extension API */ diff --git a/gawkapi.h b/gawkapi.h index cc50bba3..7bb93037 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -264,7 +264,7 @@ typedef struct awk_two_way_processor { /* Current version of the API. */ enum { GAWK_API_MAJOR_VERSION = 1, - GAWK_API_MINOR_VERSION = 0 + GAWK_API_MINOR_VERSION = 1 }; /* A number of typedefs related to different types of values. */ @@ -665,6 +665,27 @@ typedef struct gawk_api { awk_bool_t (*api_release_flattened_array)(awk_ext_id_t id, awk_array_t a_cookie, awk_flat_array_t *data); + + /* + * Look up a currently open file. If the name is NULL, it returns + * data for the currently open input file corresponding to FILENAME. + * If the file is not found, it returns NULL. + */ + const awk_input_buf_t *(*api_lookup_file)(awk_ext_id_t id, + const char *name, + size_t name_len); + /* + * Look up a file. If the name is NULL, it returns + * data for the currently open input file corresponding to FILENAME. + * If the file is not already open, it tries to open it. + * The "filetype" argument should be one of: + * ">", ">>", "<", "|>", "|<", and "|&" + */ + const awk_input_buf_t *(*api_get_file)(awk_ext_id_t id, + const char *name, + size_t name_len, + const char *filetype, + size_t typelen); } gawk_api_t; #ifndef GAWK /* these are not for the gawk code itself! */ @@ -742,6 +763,12 @@ typedef struct gawk_api { #define release_value(value) \ (api->api_release_value(ext_id, value)) +#define lookup_file(name, namelen) \ + (api->api_lookup_file(ext_id, name, namelen)) + +#define get_file(name, namelen, filetype, typelen) \ + (api->api_get_file(ext_id, name, namelen, filetype, typelen)) + #define register_ext_version(version) \ (api->api_register_ext_version(ext_id, version)) diff --git a/io.c b/io.c index dc41aea3..14b8df91 100644 --- a/io.c +++ b/io.c @@ -686,10 +686,9 @@ redflags2str(int flags) /* redirect --- Redirection for printf and print commands */ struct redirect * -redirect(NODE *redir_exp, int redirtype, int *errflg) +redirect_string(char *str, size_t explen, int not_string, int redirtype, int *errflg) { struct redirect *rp; - char *str; int tflag = 0; int outflag = 0; const char *direction = "to"; @@ -736,18 +735,16 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) default: cant_happen(); } - if (do_lint && (redir_exp->flags & STRCUR) == 0) + if (do_lint && not_string) lintwarn(_("expression in `%s' redirection only has numeric value"), what); - redir_exp = force_string(redir_exp); - str = redir_exp->stptr; if (str == NULL || *str == '\0') fatal(_("expression for `%s' redirection has null string value"), what); - if (do_lint && (strncmp(str, "0", redir_exp->stlen) == 0 - || strncmp(str, "1", redir_exp->stlen) == 0)) + if (do_lint && (strncmp(str, "0", explen) == 0 + || strncmp(str, "1", explen) == 0)) lintwarn(_("filename `%s' for `%s' redirection may be result of logical expression"), str, what); @@ -785,8 +782,8 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) #endif /* PIPES_SIMULATED */ /* now check for a match */ - if (strlen(rp->value) == redir_exp->stlen - && memcmp(rp->value, str, redir_exp->stlen) == 0 + if (strlen(rp->value) == explen + && memcmp(rp->value, str, explen) == 0 && ((rp->flag & ~(RED_NOBUF|RED_EOF|RED_PTY)) == tflag || (outflag != 0 && (rp->flag & (RED_FILE|RED_WRITE)) == outflag))) { @@ -797,22 +794,24 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) if (do_lint && rpflag != newflag) lintwarn( _("unnecessary mixing of `>' and `>>' for file `%.*s'"), - (int) redir_exp->stlen, rp->value); + (int) explen, rp->value); break; } } if (rp == NULL) { + char *newstr; new_rp = true; if (save_rp != NULL) { rp = save_rp; efree(rp->value); } else emalloc(rp, struct redirect *, sizeof(struct redirect), "redirect"); - emalloc(str, char *, redir_exp->stlen + 1, "redirect"); - memcpy(str, redir_exp->stptr, redir_exp->stlen); - str[redir_exp->stlen] = '\0'; + emalloc(newstr, char *, explen + 1, "redirect"); + memcpy(newstr, str, explen); + newstr[explen] = '\0'; + str = newstr; rp->value = str; rp->flag = tflag; init_output_wrapper(& rp->output); @@ -998,6 +997,15 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) return rp; } +struct redirect * +redirect(NODE *redir_exp, int redirtype, int *errflg) +{ + int not_string = ((redir_exp->flags & STRCUR) == 0); + redir_exp = force_string(redir_exp); + return redirect_string(redir_exp->stptr, redir_exp->stlen, not_string, + redirtype, errflg); +} + /* getredirect --- find the struct redirect for this file or pipe */ struct redirect * -- cgit v1.2.3 From e3d803ece7400aeb61e9577346e3de93ae2afccb Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 1 Jul 2013 14:09:49 -0400 Subject: Add signal trapping support to the select extension. --- extension/ChangeLog | 10 +++ extension/select.c | 210 +++++++++++++++++++++++++++++++++++++++++++++++++--- extension/siglist.h | 75 +++++++++++++++++++ 3 files changed, 285 insertions(+), 10 deletions(-) create mode 100644 extension/siglist.h diff --git a/extension/ChangeLog b/extension/ChangeLog index 37cfccf2..e4dcf009 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,13 @@ +2013-07-01 Andrew J. Schorr + + * siglist.h: New file copied from glibc to provide a mapping between + signal number and name. + * select.c: Add a new "select_signal" function and provide support + for trapping signals. + (do_select): Add support for a 5th argument to contain an array + of returned signals. Improve the argument processing, and add + better warning messages. + 2013-06-30 Andrew J. Schorr * Makefile.am (pkgextension_LTLIBRARIES): Add select.la. diff --git a/extension/select.c b/extension/select.c index f74ae250..8729a59e 100644 --- a/extension/select.c +++ b/extension/select.c @@ -58,7 +58,138 @@ int plugin_is_GPL_compatible; #include #endif -/* do_ord --- return numeric value of first char of string */ +static const char *const signum2name[] = { +#define init_sig(A, B, C) [A] = B, +#include "siglist.h" +#undef init_sig +}; +#define NUMSIG sizeof(signum2name)/sizeof(signum2name[0]) + +#define MIN_VALID_SIGNAL 1 /* 0 is not allowed! */ +/* + * We would like to use NSIG, but I think this seems to be a BSD'ism that is not + * POSIX-compliant. It is used internally by glibc, but not always + * available. We add a buffer to the maximum number in the provided mapping + * in case the list is not comprehensive: + */ +#define MAX_VALID_SIGNAL (NUMSIG+100) +#define IS_VALID_SIGNAL(X) \ + (((X) >= MIN_VALID_SIGNAL) && ((X) <= MAX_VALID_SIGNAL)) + +static int +signame2num(const char *name) +{ + size_t i; + + if (strncasecmp(name, "sig", 3) == 0) + /* skip "sig" prefix */ + name += 3; + for (i = MIN_VALID_SIGNAL; i < NUMSIG; i++) { + if (signum2name[i] && ! strcasecmp(signum2name[i], name)) + return i; + } + return -1; +} + +static volatile struct { + int flag; + sigset_t mask; +} caught; + +static void +signal_handler(int signum) +{ + /* + * All signals should be blocked, so we do not have to worry about + * whether sigaddset is thread-safe. It is documented to be + * async-signal-safe. + */ + sigaddset(& caught.mask, signum); + caught.flag = 1; +} + +static int +integer_string(const char *s, long *x) +{ + char *endptr; + + *x = strtol(s, & endptr, 10); + return ((endptr != s) && (*endptr == '\0')) ? 0 : -1; +} + +static int +get_signal_number(awk_value_t signame) +{ + int x; + + switch (signame.val_type) { + case AWK_NUMBER: + x = signame.num_value; + if ((x != signame.num_value) || ! IS_VALID_SIGNAL(x)) { + update_ERRNO_string(_("select_signal: invalid signal number")); + return -1; + } + return x; + case AWK_STRING: + if ((x = signame2num(signame.str_value.str)) >= 0) + return x; + { + long z; + if ((integer_string(signame.str_value.str, &z) == 0) && IS_VALID_SIGNAL(z)) + return z; + } + update_ERRNO_string(_("select_signal: invalid signal name")); + return -1; + default: + update_ERRNO_string(_("select_signal: signal name argument must be string or numeric")); + return -1; + } +} + +/* do_signal --- trap signals */ + +static awk_value_t * +do_signal(int nargs, awk_value_t *result) +{ +#ifdef HAVE_SIGACTION + awk_value_t signame, disposition; + int signum; + struct sigaction sa; + + if (! get_argument(0, AWK_UNDEFINED, & signame)) { + update_ERRNO_string(_("select_signal: missing required signal name argument")); + return make_number(-1, result); + } + if ((signum = get_signal_number(signame)) < 0) + return make_number(-1, result); + if (! get_argument(1, AWK_STRING, & disposition)) { + update_ERRNO_string(_("select_signal: missing required signal disposition argument")); + return make_number(-1, result); + } + if (strcasecmp(disposition.str_value.str, "default") == 0) + sa.sa_handler = SIG_DFL; + else if (strcasecmp(disposition.str_value.str, "ignore") == 0) + sa.sa_handler = SIG_IGN; + else if (strcasecmp(disposition.str_value.str, "trap") == 0) + sa.sa_handler = signal_handler; + else { + update_ERRNO_string(_("select_signal: invalid disposition argument")); + return make_number(-1, result); + } + sigfillset(& sa.sa_mask); /* block all signals in handler */ + sa.sa_flags = SA_RESTART; + if (sigaction(signum, &sa, NULL) < 0) { + update_ERRNO_int(errno); + return make_number(-1, result); + } + return make_number(0, result); +#else + update_ERRNO_string(_("select_signal: not supported on this platform")); + return make_number(-1, result); +#endif +} + +/* do_select --- I/O multiplexing */ static awk_value_t * do_select(int nargs, awk_value_t *result) @@ -76,11 +207,23 @@ do_select(int nargs, awk_value_t *result) struct timeval *timeout; int nfds = 0; int rc; + awk_value_t sigarr; + int dosig = 0; if (do_lint && nargs > 5) lintwarn(ext_id, _("select: called with too many arguments")); #define EL fds[i].flat->elements[j] + if (nargs == 5) { + dosig = 1; + if (! get_argument(4, AWK_ARRAY, &sigarr)) { + warning(ext_id, _("select: the signal argument must be an array")); + update_ERRNO_string(_("select: bad signal parameter")); + return make_number(-1, result); + } + clear_array(sigarr.array_cookie); + } + for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) { size_t j; @@ -99,19 +242,33 @@ do_select(int nargs, awk_value_t *result) case AWK_NUMBER: if (EL.index.num_value >= 0) fds[i].array2fd[j] = EL.index.num_value; - if (fds[i].array2fd[j] != EL.index.num_value) + if (fds[i].array2fd[j] != EL.index.num_value) { fds[i].array2fd[j] = -1; + warning(ext_id, _("select: invalid numeric index `%g' in `%s' array (should be a non-negative integer)"), EL.index.num_value, argname[i]); + } break; case AWK_STRING: - if (EL.value.val_type == AWK_STRING) { - const awk_input_buf_t *buf; - if ((buf = get_file(EL.index.str_value.str, EL.index.str_value.len, EL.value.str_value.str, EL.value.str_value.len)) != NULL) - fds[i].array2fd[j] = buf->fd; + { + long x; + + if ((integer_string(EL.index.str_value.str, &x) == 0) && (x >= 0)) + fds[i].array2fd[j] = x; + else if (EL.value.val_type == AWK_STRING) { + const awk_input_buf_t *buf; + if ((buf = get_file(EL.index.str_value.str, EL.index.str_value.len, EL.value.str_value.str, EL.value.str_value.len)) != NULL) + fds[i].array2fd[j] = buf->fd; + else + warning(ext_id, _("select: get_file(`%s', `%s') failed in `%s' array"), EL.index.str_value.str, EL.value.str_value.str, argname[i]); + } + else + warning(ext_id, _("select: command type should be a string for `%s' in `%s' array"), EL.index.str_value.str, argname[i]); } break; + default: + warning(ext_id, _("select: invalid index type in `%s' array (must be a string or a non-negative integer"), argname[i]); + break; } if (fds[i].array2fd[j] < 0) { - warning(ext_id, _("select: get_file failed")); update_ERRNO_string(_("select: get_file failed")); if (! release_flattened_array(fds[i].array.array_cookie, fds[i].flat)) warning(ext_id, _("select: release_flattened_array failed")); @@ -126,7 +283,12 @@ do_select(int nargs, awk_value_t *result) else fds[i].flat = NULL; } - if (get_argument(3, AWK_NUMBER, &timeout_arg)) { + if (dosig && caught.flag) { + /* take a quick poll, but do not block, since signals have been trapped */ + maxwait.tv_sec = maxwait.tv_usec = 0; + timeout = &maxwait; + } + else if (get_argument(3, AWK_NUMBER, &timeout_arg)) { double secs = timeout_arg.num_value; if (secs < 0) { warning(ext_id, _("select: treating negative timeout as zero")); @@ -137,10 +299,37 @@ do_select(int nargs, awk_value_t *result) timeout = &maxwait; } else timeout = NULL; - rc = select(nfds, &fds[0].bits, &fds[1].bits, &fds[2].bits, timeout); - if (rc < 0) { + if ((rc = select(nfds, &fds[0].bits, &fds[1].bits, &fds[2].bits, timeout)) < 0) update_ERRNO_int(errno); + + if (dosig && caught.flag) { + int i; + sigset_t set, oldset, trapped; + sigfillset(& set); + sigprocmask(SIG_SETMASK, &set, &oldset); + trapped = caught.mask; + sigemptyset(& caught.mask); + caught.flag = 0; + sigprocmask(SIG_SETMASK, &oldset, NULL); + /* populate sigarr with trapped signals */ + /* + * XXX this is very inefficient! Note that get_signal_number + * ensures that we trap only signals between MIN_VALID_SIGNAL + * and MAX_VALID_SIGNAL. + */ + for (i = MIN_VALID_SIGNAL; i <= MAX_VALID_SIGNAL; i++) { + if (sigismember(& trapped, i) > 0) { + awk_value_t idx, val; + if ((i < NUMSIG) && signum2name[i]) + set_array_element(sigarr.array_cookie, make_number(i, &idx), make_const_string(signum2name[i], strlen(signum2name[i]), &val)); + else + set_array_element(sigarr.array_cookie, make_number(i, &idx), make_null_string(&val)); + } + } + } + + if (rc < 0) { /* bit masks are undefined, so delete all array entries */ for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) { if (fds[i].flat) { @@ -176,6 +365,7 @@ do_select(int nargs, awk_value_t *result) static awk_ext_func_t func_table[] = { { "select", do_select, 5 }, + { "select_signal", do_signal, 2 }, }; /* define the dl_load function using the boilerplate macro */ diff --git a/extension/siglist.h b/extension/siglist.h new file mode 100644 index 00000000..dacd4a1f --- /dev/null +++ b/extension/siglist.h @@ -0,0 +1,75 @@ +/* Canonical list of all signal names. + Copyright (C) 1996,97,98,99 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* This file should be usable for any platform, since it just associates + the SIG* macros with text names and descriptions. The actual values + come from (via ). For any signal macros do not + exist on every platform, we can use #ifdef tests here and still use + this single common file for all platforms. */ + +/* This file is included multiple times. */ + +/* Standard signals */ + init_sig (SIGHUP, "HUP", N_("Hangup")) + init_sig (SIGINT, "INT", N_("Interrupt")) + init_sig (SIGQUIT, "QUIT", N_("Quit")) + init_sig (SIGILL, "ILL", N_("Illegal instruction")) + init_sig (SIGTRAP, "TRAP", N_("Trace/breakpoint trap")) + init_sig (SIGABRT, "ABRT", N_("Aborted")) + init_sig (SIGFPE, "FPE", N_("Floating point exception")) + init_sig (SIGKILL, "KILL", N_("Killed")) + init_sig (SIGBUS, "BUS", N_("Bus error")) + init_sig (SIGSEGV, "SEGV", N_("Segmentation fault")) + init_sig (SIGPIPE, "PIPE", N_("Broken pipe")) + init_sig (SIGALRM, "ALRM", N_("Alarm clock")) + init_sig (SIGTERM, "TERM", N_("Terminated")) + init_sig (SIGURG, "URG", N_("Urgent I/O condition")) + init_sig (SIGSTOP, "STOP", N_("Stopped (signal)")) + init_sig (SIGTSTP, "TSTP", N_("Stopped")) + init_sig (SIGCONT, "CONT", N_("Continued")) + init_sig (SIGCHLD, "CHLD", N_("Child exited")) + init_sig (SIGTTIN, "TTIN", N_("Stopped (tty input)")) + init_sig (SIGTTOU, "TTOU", N_("Stopped (tty output)")) + init_sig (SIGIO, "IO", N_("I/O possible")) + init_sig (SIGXCPU, "XCPU", N_("CPU time limit exceeded")) + init_sig (SIGXFSZ, "XFSZ", N_("File size limit exceeded")) + init_sig (SIGVTALRM, "VTALRM", N_("Virtual timer expired")) + init_sig (SIGPROF, "PROF", N_("Profiling timer expired")) + init_sig (SIGWINCH, "WINCH", N_("Window changed")) + init_sig (SIGUSR1, "USR1", N_("User defined signal 1")) + init_sig (SIGUSR2, "USR2", N_("User defined signal 2")) + +/* Variations */ +#ifdef SIGEMT + init_sig (SIGEMT, "EMT", N_("EMT trap")) +#endif +#ifdef SIGSYS + init_sig (SIGSYS, "SYS", N_("Bad system call")) +#endif +#ifdef SIGSTKFLT + init_sig (SIGSTKFLT, "STKFLT", N_("Stack fault")) +#endif +#ifdef SIGINFO + init_sig (SIGINFO, "INFO", N_("Information request")) +#elif defined(SIGPWR) && (!defined(SIGLOST) || (SIGPWR != SIGLOST)) + init_sig (SIGPWR, "PWR", N_("Power failure")) +#endif +#ifdef SIGLOST + init_sig (SIGLOST, "LOST", N_("Resource lost")) +#endif -- cgit v1.2.3 From 24a57029937207c4fa2ff4acb5a4e1ae1dc9e54b Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 1 Jul 2013 21:19:30 -0400 Subject: Add PROCINFO["errno"] and errno extension to map between errno and strings. --- ChangeLog | 4 + eval.c | 2 + extension/ChangeLog | 12 ++ extension/Makefile.am | 13 +- extension/Makefile.in | 49 ++++-- extension/errlist.h | 455 ++++++++++++++++++++++++++++++++++++++++++++++++++ extension/errno.c | 145 ++++++++++++++++ extension/select.c | 2 +- extension/siglist.h | 11 +- 9 files changed, 665 insertions(+), 28 deletions(-) create mode 100644 extension/errlist.h create mode 100644 extension/errno.c diff --git a/ChangeLog b/ChangeLog index aed9b6fd..78027810 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-07-01 Andrew J. Schorr + + * eval.c (update_ERRNO_int, unset_ERRNO): Update PROCINFO["errno"]. + 2013-06-30 Andrew J. Schorr * awk.h (redirect_string): Declare new function that provides API access to the redirection mechanism. diff --git a/eval.c b/eval.c index cf2264bf..c1253f57 100644 --- a/eval.c +++ b/eval.c @@ -997,6 +997,7 @@ update_ERRNO_int(int errcode) { char *cp; + update_PROCINFO_num("errno", errcode); if (errcode) { cp = strerror(errcode); cp = gettext(cp); @@ -1020,6 +1021,7 @@ update_ERRNO_string(const char *string) void unset_ERRNO(void) { + update_PROCINFO_num("errno", 0); unref(ERRNO_node->var_value); ERRNO_node->var_value = dupnode(Nnull_string); } diff --git a/extension/ChangeLog b/extension/ChangeLog index e4dcf009..8b3e4bc5 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,15 @@ +2013-07-01 Andrew J. Schorr + + * errlist.h: New file containing a list of all the errno values I could + find. + * errno.c: Implement a new errno extension providing strerror, + errno2name, and name2errno. + * Makefile.am (pkgextension_LTLIBRARIES): Add errno.la. + (errno_la_SOURCES, errno_la_LDFLAGS, errno_la_LIBADD): Build new errno + extension. + * select.c (ext_version): Fix version string. + * siglist.h: Update to newest glibc version. + 2013-07-01 Andrew J. Schorr * siglist.h: New file copied from glibc to provide a mapping between diff --git a/extension/Makefile.am b/extension/Makefile.am index 58fc3df6..1d545227 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -32,6 +32,7 @@ ACLOCAL_AMFLAGS = -I m4 # Note: rwarray does not currently compile. pkgextension_LTLIBRARIES = \ + errno.la \ filefuncs.la \ fnmatch.la \ fork.la \ @@ -50,6 +51,10 @@ MY_MODULE_FLAGS = -module -avoid-version -no-undefined # on Cygwin, gettext requires that we link with -lintl MY_LIBS = $(LTLIBINTL) +errno_la_SOURCES = errno.c +errno_la_LDFLAGS = $(MY_MODULE_FLAGS) +errno_la_LIBADD = $(MY_LIBS) + filefuncs_la_SOURCES = filefuncs.c stack.h stack.c gawkfts.h \ gawkfts.c gawkdirfd.h filefuncs_la_LDFLAGS = $(MY_MODULE_FLAGS) @@ -71,10 +76,6 @@ ordchr_la_SOURCES = ordchr.c ordchr_la_LDFLAGS = $(MY_MODULE_FLAGS) ordchr_la_LIBADD = $(MY_LIBS) -select_la_SOURCES = select.c -select_la_LDFLAGS = $(MY_MODULE_FLAGS) -select_la_LIBADD = $(MY_LIBS) - readdir_la_SOURCES = readdir.c gawkdirfd.h readdir_la_LDFLAGS = $(MY_MODULE_FLAGS) readdir_la_LIBADD = $(MY_LIBS) @@ -95,6 +96,10 @@ rwarray_la_SOURCES = rwarray.c rwarray_la_LDFLAGS = $(MY_MODULE_FLAGS) rwarray_la_LIBADD = $(MY_LIBS) +select_la_SOURCES = select.c +select_la_LDFLAGS = $(MY_MODULE_FLAGS) +select_la_LIBADD = $(MY_LIBS) + time_la_SOURCES = time.c time_la_LDFLAGS = $(MY_MODULE_FLAGS) time_la_LIBADD = $(MY_LIBS) diff --git a/extension/Makefile.in b/extension/Makefile.in index 97ee41fe..5c45b494 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -139,13 +139,19 @@ am__installdirs = "$(DESTDIR)$(pkgextensiondir)" \ LTLIBRARIES = $(pkgextension_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2) -am_filefuncs_la_OBJECTS = filefuncs.lo stack.lo gawkfts.lo -filefuncs_la_OBJECTS = $(am_filefuncs_la_OBJECTS) +errno_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_errno_la_OBJECTS = errno.lo +errno_la_OBJECTS = $(am_errno_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +errno_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(errno_la_LDFLAGS) $(LDFLAGS) -o $@ +filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_filefuncs_la_OBJECTS = filefuncs.lo stack.lo gawkfts.lo +filefuncs_la_OBJECTS = $(am_filefuncs_la_OBJECTS) filefuncs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(filefuncs_la_LDFLAGS) $(LDFLAGS) -o $@ @@ -255,18 +261,18 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ - $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ - $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ - $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ - $(rwarray_la_SOURCES) $(select_la_SOURCES) \ - $(testext_la_SOURCES) $(time_la_SOURCES) -DIST_SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ - $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ - $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ - $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ - $(rwarray_la_SOURCES) $(select_la_SOURCES) \ - $(testext_la_SOURCES) $(time_la_SOURCES) +SOURCES = $(errno_la_SOURCES) $(filefuncs_la_SOURCES) \ + $(fnmatch_la_SOURCES) $(fork_la_SOURCES) $(inplace_la_SOURCES) \ + $(ordchr_la_SOURCES) $(readdir_la_SOURCES) \ + $(readfile_la_SOURCES) $(revoutput_la_SOURCES) \ + $(revtwoway_la_SOURCES) $(rwarray_la_SOURCES) \ + $(select_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) +DIST_SOURCES = $(errno_la_SOURCES) $(filefuncs_la_SOURCES) \ + $(fnmatch_la_SOURCES) $(fork_la_SOURCES) $(inplace_la_SOURCES) \ + $(ordchr_la_SOURCES) $(readdir_la_SOURCES) \ + $(readfile_la_SOURCES) $(revoutput_la_SOURCES) \ + $(revtwoway_la_SOURCES) $(rwarray_la_SOURCES) \ + $(select_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -495,6 +501,7 @@ ACLOCAL_AMFLAGS = -I m4 # Note: rwarray does not currently compile. pkgextension_LTLIBRARIES = \ + errno.la \ filefuncs.la \ fnmatch.la \ fork.la \ @@ -512,6 +519,9 @@ pkgextension_LTLIBRARIES = \ MY_MODULE_FLAGS = -module -avoid-version -no-undefined # on Cygwin, gettext requires that we link with -lintl MY_LIBS = $(LTLIBINTL) +errno_la_SOURCES = errno.c +errno_la_LDFLAGS = $(MY_MODULE_FLAGS) +errno_la_LIBADD = $(MY_LIBS) filefuncs_la_SOURCES = filefuncs.c stack.h stack.c gawkfts.h \ gawkfts.c gawkdirfd.h @@ -529,9 +539,6 @@ inplace_la_LIBADD = $(MY_LIBS) ordchr_la_SOURCES = ordchr.c ordchr_la_LDFLAGS = $(MY_MODULE_FLAGS) ordchr_la_LIBADD = $(MY_LIBS) -select_la_SOURCES = select.c -select_la_LDFLAGS = $(MY_MODULE_FLAGS) -select_la_LIBADD = $(MY_LIBS) readdir_la_SOURCES = readdir.c gawkdirfd.h readdir_la_LDFLAGS = $(MY_MODULE_FLAGS) readdir_la_LIBADD = $(MY_LIBS) @@ -547,6 +554,9 @@ revtwoway_la_LIBADD = $(MY_LIBS) rwarray_la_SOURCES = rwarray.c rwarray_la_LDFLAGS = $(MY_MODULE_FLAGS) rwarray_la_LIBADD = $(MY_LIBS) +select_la_SOURCES = select.c +select_la_LDFLAGS = $(MY_MODULE_FLAGS) +select_la_LIBADD = $(MY_LIBS) time_la_SOURCES = time.c time_la_LDFLAGS = $(MY_MODULE_FLAGS) time_la_LIBADD = $(MY_LIBS) @@ -656,6 +666,8 @@ clean-pkgextensionLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } +errno.la: $(errno_la_OBJECTS) $(errno_la_DEPENDENCIES) $(EXTRA_errno_la_DEPENDENCIES) + $(AM_V_CCLD)$(errno_la_LINK) -rpath $(pkgextensiondir) $(errno_la_OBJECTS) $(errno_la_LIBADD) $(LIBS) filefuncs.la: $(filefuncs_la_OBJECTS) $(filefuncs_la_DEPENDENCIES) $(EXTRA_filefuncs_la_DEPENDENCIES) $(AM_V_CCLD)$(filefuncs_la_LINK) -rpath $(pkgextensiondir) $(filefuncs_la_OBJECTS) $(filefuncs_la_LIBADD) $(LIBS) fnmatch.la: $(fnmatch_la_OBJECTS) $(fnmatch_la_DEPENDENCIES) $(EXTRA_fnmatch_la_DEPENDENCIES) @@ -689,6 +701,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errno.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filefuncs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork.Plo@am__quote@ diff --git a/extension/errlist.h b/extension/errlist.h new file mode 100644 index 00000000..caa6d63b --- /dev/null +++ b/extension/errlist.h @@ -0,0 +1,455 @@ +/* + * errlist.h - List of errno values. + */ + +/* + * Copyright (C) 2013 the Free Software Foundation, Inc. + * + * This file is part of GAWK, the GNU implementation of the + * AWK Programming Language. + * + * GAWK is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * GAWK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef E2BIG +init_errno (E2BIG, "E2BIG") +#endif +#ifdef EACCES +init_errno (EACCES, "EACCES") +#endif +#ifdef EADDRINUSE +init_errno (EADDRINUSE, "EADDRINUSE") +#endif +#ifdef EADDRNOTAVAIL +init_errno (EADDRNOTAVAIL, "EADDRNOTAVAIL") +#endif +#ifdef EADV +init_errno (EADV, "EADV") +#endif +#ifdef EAFNOSUPPORT +init_errno (EAFNOSUPPORT, "EAFNOSUPPORT") +#endif +#ifdef EAGAIN +init_errno (EAGAIN, "EAGAIN") +#endif +#ifdef EALREADY +init_errno (EALREADY, "EALREADY") +#endif +#ifdef EAUTH +init_errno (EAUTH, "EAUTH") +#endif +#ifdef EBADE +init_errno (EBADE, "EBADE") +#endif +#ifdef EBADF +init_errno (EBADF, "EBADF") +#endif +#ifdef EBADFD +init_errno (EBADFD, "EBADFD") +#endif +#ifdef EBADMSG +init_errno (EBADMSG, "EBADMSG") +#endif +#ifdef EBADR +init_errno (EBADR, "EBADR") +#endif +#ifdef EBADRPC +init_errno (EBADRPC, "EBADRPC") +#endif +#ifdef EBADRQC +init_errno (EBADRQC, "EBADRQC") +#endif +#ifdef EBADSLT +init_errno (EBADSLT, "EBADSLT") +#endif +#ifdef EBFONT +init_errno (EBFONT, "EBFONT") +#endif +#ifdef EBUSY +init_errno (EBUSY, "EBUSY") +#endif +#ifdef ECANCELED +init_errno (ECANCELED, "ECANCELED") +#endif +#ifdef ECHILD +init_errno (ECHILD, "ECHILD") +#endif +#ifdef ECHRNG +init_errno (ECHRNG, "ECHRNG") +#endif +#ifdef ECOMM +init_errno (ECOMM, "ECOMM") +#endif +#ifdef ECONNABORTED +init_errno (ECONNABORTED, "ECONNABORTED") +#endif +#ifdef ECONNREFUSED +init_errno (ECONNREFUSED, "ECONNREFUSED") +#endif +#ifdef ECONNRESET +init_errno (ECONNRESET, "ECONNRESET") +#endif +#ifdef EDEADLK +init_errno (EDEADLK, "EDEADLK") +#endif +#ifdef EDEADLOCK +#if !defined(EDEADLK) || (EDEADLK != EDEADLOCK) +init_errno (EDEADLOCK, "EDEADLOCK") +#endif +#endif +#ifdef EDESTADDRREQ +init_errno (EDESTADDRREQ, "EDESTADDRREQ") +#endif +#ifdef EDOM +init_errno (EDOM, "EDOM") +#endif +#ifdef EDOTDOT +init_errno (EDOTDOT, "EDOTDOT") +#endif +#ifdef EDQUOT +init_errno (EDQUOT, "EDQUOT") +#endif +#ifdef EEXIST +init_errno (EEXIST, "EEXIST") +#endif +#ifdef EFAULT +init_errno (EFAULT, "EFAULT") +#endif +#ifdef EFBIG +init_errno (EFBIG, "EFBIG") +#endif +#ifdef EFTYPE +init_errno (EFTYPE, "EFTYPE") +#endif +#ifdef EHOSTDOWN +init_errno (EHOSTDOWN, "EHOSTDOWN") +#endif +#ifdef EHOSTUNREACH +init_errno (EHOSTUNREACH, "EHOSTUNREACH") +#endif +#ifdef EIDRM +init_errno (EIDRM, "EIDRM") +#endif +#ifdef EILSEQ +init_errno (EILSEQ, "EILSEQ") +#endif +#ifdef EINPROGRESS +init_errno (EINPROGRESS, "EINPROGRESS") +#endif +#ifdef EINTR +init_errno (EINTR, "EINTR") +#endif +#ifdef EINVAL +init_errno (EINVAL, "EINVAL") +#endif +#ifdef EIO +init_errno (EIO, "EIO") +#endif +#ifdef EISCONN +init_errno (EISCONN, "EISCONN") +#endif +#ifdef EISDIR +init_errno (EISDIR, "EISDIR") +#endif +#ifdef EISNAM +init_errno (EISNAM, "EISNAM") +#endif +#ifdef EKEYEXPIRED +init_errno (EKEYEXPIRED, "EKEYEXPIRED") +#endif +#ifdef EKEYREJECTED +init_errno (EKEYREJECTED, "EKEYREJECTED") +#endif +#ifdef EKEYREVOKED +init_errno (EKEYREVOKED, "EKEYREVOKED") +#endif +#ifdef EL2HLT +init_errno (EL2HLT, "EL2HLT") +#endif +#ifdef EL2NSYNC +init_errno (EL2NSYNC, "EL2NSYNC") +#endif +#ifdef EL3HLT +init_errno (EL3HLT, "EL3HLT") +#endif +#ifdef EL3RST +init_errno (EL3RST, "EL3RST") +#endif +#ifdef ELAST +init_errno (ELAST, "ELAST") +#endif +#ifdef ELIBACC +init_errno (ELIBACC, "ELIBACC") +#endif +#ifdef ELIBBAD +init_errno (ELIBBAD, "ELIBBAD") +#endif +#ifdef ELIBEXEC +init_errno (ELIBEXEC, "ELIBEXEC") +#endif +#ifdef ELIBMAX +init_errno (ELIBMAX, "ELIBMAX") +#endif +#ifdef ELIBSCN +init_errno (ELIBSCN, "ELIBSCN") +#endif +#ifdef ELNRNG +init_errno (ELNRNG, "ELNRNG") +#endif +#ifdef ELOOP +init_errno (ELOOP, "ELOOP") +#endif +#ifdef EMEDIUMTYPE +init_errno (EMEDIUMTYPE, "EMEDIUMTYPE") +#endif +#ifdef EMFILE +init_errno (EMFILE, "EMFILE") +#endif +#ifdef EMLINK +init_errno (EMLINK, "EMLINK") +#endif +#ifdef EMSGSIZE +init_errno (EMSGSIZE, "EMSGSIZE") +#endif +#ifdef EMULTIHOP +init_errno (EMULTIHOP, "EMULTIHOP") +#endif +#ifdef ENAMETOOLONG +init_errno (ENAMETOOLONG, "ENAMETOOLONG") +#endif +#ifdef ENAVAIL +init_errno (ENAVAIL, "ENAVAIL") +#endif +#ifdef ENEEDAUTH +init_errno (ENEEDAUTH, "ENEEDAUTH") +#endif +#ifdef ENETDOWN +init_errno (ENETDOWN, "ENETDOWN") +#endif +#ifdef ENETRESET +init_errno (ENETRESET, "ENETRESET") +#endif +#ifdef ENETUNREACH +init_errno (ENETUNREACH, "ENETUNREACH") +#endif +#ifdef ENFILE +init_errno (ENFILE, "ENFILE") +#endif +#ifdef ENOANO +init_errno (ENOANO, "ENOANO") +#endif +#ifdef ENOBUFS +init_errno (ENOBUFS, "ENOBUFS") +#endif +#ifdef ENOCSI +init_errno (ENOCSI, "ENOCSI") +#endif +#ifdef ENODATA +init_errno (ENODATA, "ENODATA") +#endif +#ifdef ENODEV +init_errno (ENODEV, "ENODEV") +#endif +#ifdef ENOENT +init_errno (ENOENT, "ENOENT") +#endif +#ifdef ENOEXEC +init_errno (ENOEXEC, "ENOEXEC") +#endif +#ifdef ENOKEY +init_errno (ENOKEY, "ENOKEY") +#endif +#ifdef ENOLCK +init_errno (ENOLCK, "ENOLCK") +#endif +#ifdef ENOLINK +init_errno (ENOLINK, "ENOLINK") +#endif +#ifdef ENOMEDIUM +init_errno (ENOMEDIUM, "ENOMEDIUM") +#endif +#ifdef ENOMEM +init_errno (ENOMEM, "ENOMEM") +#endif +#ifdef ENOMSG +init_errno (ENOMSG, "ENOMSG") +#endif +#ifdef ENONET +init_errno (ENONET, "ENONET") +#endif +#ifdef ENOPKG +init_errno (ENOPKG, "ENOPKG") +#endif +#ifdef ENOPROTOOPT +init_errno (ENOPROTOOPT, "ENOPROTOOPT") +#endif +#ifdef ENOSPC +init_errno (ENOSPC, "ENOSPC") +#endif +#ifdef ENOSR +init_errno (ENOSR, "ENOSR") +#endif +#ifdef ENOSTR +init_errno (ENOSTR, "ENOSTR") +#endif +#ifdef ENOSYS +init_errno (ENOSYS, "ENOSYS") +#endif +#ifdef ENOTBLK +init_errno (ENOTBLK, "ENOTBLK") +#endif +#ifdef ENOTCONN +init_errno (ENOTCONN, "ENOTCONN") +#endif +#ifdef ENOTDIR +init_errno (ENOTDIR, "ENOTDIR") +#endif +#ifdef ENOTEMPTY +init_errno (ENOTEMPTY, "ENOTEMPTY") +#endif +#ifdef ENOTNAM +init_errno (ENOTNAM, "ENOTNAM") +#endif +#ifdef ENOTRECOVERABLE +init_errno (ENOTRECOVERABLE, "ENOTRECOVERABLE") +#endif +#ifdef ENOTSOCK +init_errno (ENOTSOCK, "ENOTSOCK") +#endif +#ifdef ENOTTY +init_errno (ENOTTY, "ENOTTY") +#endif +#ifdef ENOTUNIQ +init_errno (ENOTUNIQ, "ENOTUNIQ") +#endif +#ifdef ENXIO +init_errno (ENXIO, "ENXIO") +#endif +#ifdef EOPNOTSUPP +init_errno (EOPNOTSUPP, "EOPNOTSUPP") +#endif +#ifdef EOVERFLOW +init_errno (EOVERFLOW, "EOVERFLOW") +#endif +#ifdef EOWNERDEAD +init_errno (EOWNERDEAD, "EOWNERDEAD") +#endif +#ifdef EPERM +init_errno (EPERM, "EPERM") +#endif +#ifdef EPFNOSUPPORT +init_errno (EPFNOSUPPORT, "EPFNOSUPPORT") +#endif +#ifdef EPIPE +init_errno (EPIPE, "EPIPE") +#endif +#ifdef EPROCLIM +init_errno (EPROCLIM, "EPROCLIM") +#endif +#ifdef EPROCUNAVAIL +init_errno (EPROCUNAVAIL, "EPROCUNAVAIL") +#endif +#ifdef EPROGMISMATCH +init_errno (EPROGMISMATCH, "EPROGMISMATCH") +#endif +#ifdef EPROGUNAVAIL +init_errno (EPROGUNAVAIL, "EPROGUNAVAIL") +#endif +#ifdef EPROTO +init_errno (EPROTO, "EPROTO") +#endif +#ifdef EPROTONOSUPPORT +init_errno (EPROTONOSUPPORT, "EPROTONOSUPPORT") +#endif +#ifdef EPROTOTYPE +init_errno (EPROTOTYPE, "EPROTOTYPE") +#endif +#ifdef ERANGE +init_errno (ERANGE, "ERANGE") +#endif +#ifdef EREMCHG +init_errno (EREMCHG, "EREMCHG") +#endif +#ifdef EREMOTE +init_errno (EREMOTE, "EREMOTE") +#endif +#ifdef EREMOTEIO +init_errno (EREMOTEIO, "EREMOTEIO") +#endif +#ifdef ERESTART +init_errno (ERESTART, "ERESTART") +#endif +#ifdef ERFKILL +init_errno (ERFKILL, "ERFKILL") +#endif +#ifdef EROFS +init_errno (EROFS, "EROFS") +#endif +#ifdef ERPCMISMATCH +init_errno (ERPCMISMATCH, "ERPCMISMATCH") +#endif +#ifdef ESHUTDOWN +init_errno (ESHUTDOWN, "ESHUTDOWN") +#endif +#ifdef ESOCKTNOSUPPORT +init_errno (ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT") +#endif +#ifdef ESPIPE +init_errno (ESPIPE, "ESPIPE") +#endif +#ifdef ESRCH +init_errno (ESRCH, "ESRCH") +#endif +#ifdef ESRMNT +init_errno (ESRMNT, "ESRMNT") +#endif +#ifdef ESTALE +init_errno (ESTALE, "ESTALE") +#endif +#ifdef ESTRPIPE +init_errno (ESTRPIPE, "ESTRPIPE") +#endif +#ifdef ETIME +init_errno (ETIME, "ETIME") +#endif +#ifdef ETIMEDOUT +init_errno (ETIMEDOUT, "ETIMEDOUT") +#endif +#ifdef ETOOMANYREFS +init_errno (ETOOMANYREFS, "ETOOMANYREFS") +#endif +#ifdef ETXTBSY +init_errno (ETXTBSY, "ETXTBSY") +#endif +#ifdef EUCLEAN +init_errno (EUCLEAN, "EUCLEAN") +#endif +#ifdef EUNATCH +init_errno (EUNATCH, "EUNATCH") +#endif +#ifdef EUSERS +init_errno (EUSERS, "EUSERS") +#endif +#ifdef EWOULDBLOCK +#if !defined(EAGAIN) || (EWOULDBLOCK != EAGAIN) +init_errno (EWOULDBLOCK, "EWOULDBLOCK") +#endif +#endif +#ifdef EXDEV +init_errno (EXDEV, "EXDEV") +#endif +#ifdef EXFULL +init_errno (EXFULL, "EXFULL") +#endif diff --git a/extension/errno.c b/extension/errno.c new file mode 100644 index 00000000..2eafa437 --- /dev/null +++ b/extension/errno.c @@ -0,0 +1,145 @@ +/* + * errno.c - Builtin functions to map errno values. + */ + +/* + * Copyright (C) 2013 the Free Software Foundation, Inc. + * + * This file is part of GAWK, the GNU implementation of the + * AWK Programming Language. + * + * GAWK is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * GAWK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "gawkapi.h" + +#include "gettext.h" +#define _(msgid) gettext(msgid) +#define N_(msgid) msgid + +static const gawk_api_t *api; /* for convenience macros to work */ +static awk_ext_id_t *ext_id; +static const char *ext_version = "errno extension: version 1.0"; +static awk_bool_t (*init_func)(void) = NULL; + +int plugin_is_GPL_compatible; + +static const char *const errno2name[] = { +#define init_errno(A, B) [A] = B, +#include "errlist.h" +#undef init_errno +}; +#define NUMERR sizeof(errno2name)/sizeof(errno2name[0]) + +/* do_strerror --- call strerror */ + +static awk_value_t * +do_strerror(int nargs, awk_value_t *result) +{ + awk_value_t errnum; + + if (do_lint && nargs > 1) + lintwarn(ext_id, _("strerror: called with too many arguments")); + + if (get_argument(0, AWK_NUMBER, & errnum)) { + const char *str = gettext(strerror(errnum.num_value)); + return make_const_string(str, strlen(str), result); + } + if (do_lint) { + if (nargs == 0) + lintwarn(ext_id, _("strerror: called with no arguments")); + else + lintwarn(ext_id, _("strerror: called with inappropriate argument(s)")); + } + return make_null_string(result); +} + +/* do_errno2name --- convert an integer errno value to it's symbolic name */ + +static awk_value_t * +do_errno2name(int nargs, awk_value_t *result) +{ + awk_value_t errnum; + const char *str; + + if (do_lint && nargs > 1) + lintwarn(ext_id, _("errno2name: called with too many arguments")); + + if (get_argument(0, AWK_NUMBER, & errnum)) { + int i = errnum.num_value; + + if ((i == errnum.num_value) && (i >= 0) && ((size_t)i < NUMERR) && errno2name[i]) + return make_const_string(errno2name[i], strlen(errno2name[i]), result); + warning(ext_id, _("errno2name: called with invalid argument")); + } else if (do_lint) { + if (nargs == 0) + lintwarn(ext_id, _("errno2name: called with no arguments")); + else + lintwarn(ext_id, _("errno2name: called with inappropriate argument(s)")); + } + return make_null_string(result); +} + +/* do_name2errno --- convert a symbolic errno name to an integer */ + +static awk_value_t * +do_name2errno(int nargs, awk_value_t *result) +{ + awk_value_t err; + const char *str; + + if (do_lint && nargs > 1) + lintwarn(ext_id, _("name2errno: called with too many arguments")); + + if (get_argument(0, AWK_STRING, & err)) { + size_t i; + + for (i = 0; i < NUMERR; i++) { + if (errno2name[i] && ! strcasecmp(err.str_value.str, errno2name[i])) + return make_number(i, result); + } + warning(ext_id, _("name2errno: called with invalid argument")); + } else if (do_lint) { + if (nargs == 0) + lintwarn(ext_id, _("name2errno: called with no arguments")); + else + lintwarn(ext_id, _("name2errno: called with inappropriate argument(s)")); + } + return make_number(-1, result); +} + +static awk_ext_func_t func_table[] = { + { "strerror", do_strerror, 1 }, + { "errno2name", do_errno2name, 1 }, + { "name2errno", do_name2errno, 1 }, +}; + +/* define the dl_load function using the boilerplate macro */ + +dl_load_func(func_table, errno, "") diff --git a/extension/select.c b/extension/select.c index 8729a59e..62116351 100644 --- a/extension/select.c +++ b/extension/select.c @@ -45,7 +45,7 @@ static const gawk_api_t *api; /* for convenience macros to work */ static awk_ext_id_t *ext_id; -static const char *ext_version = "ordchr extension: version 1.0"; +static const char *ext_version = "select extension: version 1.0"; static awk_bool_t (*init_func)(void) = NULL; int plugin_is_GPL_compatible; diff --git a/extension/siglist.h b/extension/siglist.h index dacd4a1f..7ecb8ab1 100644 --- a/extension/siglist.h +++ b/extension/siglist.h @@ -1,5 +1,5 @@ /* Canonical list of all signal names. - Copyright (C) 1996,97,98,99 Free Software Foundation, Inc. + Copyright (C) 1996-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,9 +13,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + . */ /* This file should be usable for any platform, since it just associates the SIG* macros with text names and descriptions. The actual values @@ -51,7 +50,6 @@ init_sig (SIGXFSZ, "XFSZ", N_("File size limit exceeded")) init_sig (SIGVTALRM, "VTALRM", N_("Virtual timer expired")) init_sig (SIGPROF, "PROF", N_("Profiling timer expired")) - init_sig (SIGWINCH, "WINCH", N_("Window changed")) init_sig (SIGUSR1, "USR1", N_("User defined signal 1")) init_sig (SIGUSR2, "USR2", N_("User defined signal 2")) @@ -73,3 +71,6 @@ #ifdef SIGLOST init_sig (SIGLOST, "LOST", N_("Resource lost")) #endif +#ifdef SIGWINCH + init_sig (SIGWINCH, "WINCH", N_("Window changed")) +#endif -- cgit v1.2.3 From 27e1e910147465ad240a3e4393bbd4312937fed5 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 1 Jul 2013 22:04:03 -0400 Subject: Add set_non_blocking function to the select extension. --- extension/ChangeLog | 6 ++++++ extension/select.c | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 8b3e4bc5..9218c744 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2013-07-01 Andrew J. Schorr + + * select.c (do_set_non_blocking): Implement new set_non_blocking + function. + (func_table): Add set_non_blocking. + 2013-07-01 Andrew J. Schorr * errlist.h: New file containing a list of all the errno values I could diff --git a/extension/select.c b/extension/select.c index 62116351..91898a20 100644 --- a/extension/select.c +++ b/extension/select.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -288,7 +289,7 @@ do_select(int nargs, awk_value_t *result) maxwait.tv_sec = maxwait.tv_usec = 0; timeout = &maxwait; } - else if (get_argument(3, AWK_NUMBER, &timeout_arg)) { + else if (get_argument(3, AWK_NUMBER, &timeout_arg)) { double secs = timeout_arg.num_value; if (secs < 0) { warning(ext_id, _("select: treating negative timeout as zero")); @@ -363,9 +364,39 @@ do_select(int nargs, awk_value_t *result) return make_number(rc, result); } +/* do_set_non_blocking --- Set a file to be non-blocking */ + +static awk_value_t * +do_set_non_blocking(int nargs, awk_value_t *result) +{ + awk_value_t cmd, cmdtype; + + if (do_lint && nargs > 2) + lintwarn(ext_id, _("set_non_blocking: called with too many arguments")); + if (get_argument(0, AWK_STRING, & cmd) && + get_argument(1, AWK_STRING, & cmdtype)) { + const awk_input_buf_t *buf; + if ((buf = get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len)) != NULL) { + int flags = fcntl(buf->fd, F_GETFL); + int rc = fcntl(buf->fd, F_SETFL, (flags|O_NONBLOCK)); + if (rc < 0) + update_ERRNO_int(errno); + return make_number(rc, result); + } else + warning(ext_id, _("set_non_blocking: get_file(`%s', `%s') failed"), cmd.str_value.str, cmdtype.str_value.str); + } else if (do_lint) { + if (nargs < 2) + lintwarn(ext_id, _("set_non_blocking: called with too few arguments")); + else + lintwarn(ext_id, _("set_non_blocking: called with inappropriate argument(s)")); + } + return make_number(-1, result); +} + static awk_ext_func_t func_table[] = { { "select", do_select, 5 }, { "select_signal", do_signal, 2 }, + { "set_non_blocking", do_set_non_blocking, 2 }, }; /* define the dl_load function using the boilerplate macro */ -- cgit v1.2.3 From 1f647aac9fa3e412c63a966535de8ee4fec855f2 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 2 Jul 2013 12:20:56 -0400 Subject: Enhance getline to return -2 when an I/O operation should be retried. --- ChangeLog | 17 +++++++++++++++++ eval.c | 1 + extension/ChangeLog | 6 ++++++ extension/select.c | 28 +++++++++++++++++++--------- io.c | 41 ++++++++++++++++++++++++++++++++++++----- 5 files changed, 79 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78027810..9719effc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2013-07-02 Andrew J. Schorr + + * eval.c (update_ERRNO_string): Set PROCINFO["errno"] to 0. + * io.c (inrec): Since get_a_record may now return -2, be sure + to throw an error in that case as well. + (wait_any): Fix what appears to be a bug. The old logic repeatedly + called wait until it failed. When a process has multiple children, + this causes it to stall until all of them have exited. Instead, + we now exit the function after the first successful wait call. + (do_getline_redir, do_getline): Handle case where get_a_record + returns -2. + (errno_io_retry): New function to decide whether an I/O operation should + be retried. + (get_a_record): When read returns an error, call errno_io_retry to + decide whether the operation should be retried. If so, return -2 + instead of setting the IOP_AT_EOF flag. + 2013-07-01 Andrew J. Schorr * eval.c (update_ERRNO_int, unset_ERRNO): Update PROCINFO["errno"]. diff --git a/eval.c b/eval.c index c1253f57..4ad5afe0 100644 --- a/eval.c +++ b/eval.c @@ -1012,6 +1012,7 @@ update_ERRNO_int(int errcode) void update_ERRNO_string(const char *string) { + update_PROCINFO_num("errno", 0); unref(ERRNO_node->var_value); ERRNO_node->var_value = make_string(string, strlen(string)); } diff --git a/extension/ChangeLog b/extension/ChangeLog index 9218c744..d1ef7b4a 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2013-07-02 Andrew J. Schorr + + * select.c (set_non_blocking): New helper function to call fcntl. + (do_set_non_blocking): Add support for the case where there's a single + integer fd argument. + 2013-07-01 Andrew J. Schorr * select.c (do_set_non_blocking): Implement new set_non_blocking diff --git a/extension/select.c b/extension/select.c index 91898a20..c1b706fc 100644 --- a/extension/select.c +++ b/extension/select.c @@ -364,26 +364,36 @@ do_select(int nargs, awk_value_t *result) return make_number(rc, result); } +static int +set_non_blocking(int fd) +{ + int flags = fcntl(fd, F_GETFL); + int rc = fcntl(fd, F_SETFL, (flags|O_NONBLOCK)); + if (rc < 0) + update_ERRNO_int(errno); + return rc; +} + /* do_set_non_blocking --- Set a file to be non-blocking */ static awk_value_t * do_set_non_blocking(int nargs, awk_value_t *result) { awk_value_t cmd, cmdtype; + int fd; if (do_lint && nargs > 2) lintwarn(ext_id, _("set_non_blocking: called with too many arguments")); - if (get_argument(0, AWK_STRING, & cmd) && + if (get_argument(0, AWK_NUMBER, & cmd) && + (cmd.num_value == (fd = cmd.num_value)) && + ! get_argument(1, AWK_STRING, & cmdtype)) + return make_number(set_non_blocking(fd), result); + else if (get_argument(0, AWK_STRING, & cmd) && get_argument(1, AWK_STRING, & cmdtype)) { const awk_input_buf_t *buf; - if ((buf = get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len)) != NULL) { - int flags = fcntl(buf->fd, F_GETFL); - int rc = fcntl(buf->fd, F_SETFL, (flags|O_NONBLOCK)); - if (rc < 0) - update_ERRNO_int(errno); - return make_number(rc, result); - } else - warning(ext_id, _("set_non_blocking: get_file(`%s', `%s') failed"), cmd.str_value.str, cmdtype.str_value.str); + if ((buf = get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len)) != NULL) + return make_number(set_non_blocking(buf->fd), result); + warning(ext_id, _("set_non_blocking: get_file(`%s', `%s') failed"), cmd.str_value.str, cmdtype.str_value.str); } else if (do_lint) { if (nargs < 2) lintwarn(ext_id, _("set_non_blocking: called with too few arguments")); diff --git a/io.c b/io.c index 14b8df91..0ba36451 100644 --- a/io.c +++ b/io.c @@ -555,7 +555,7 @@ inrec(IOBUF *iop, int *errcode) else cnt = get_a_record(& begin, iop, errcode); - if (cnt == EOF) { + if (cnt < 0) { retval = 1; if (*errcode > 0) update_ERRNO_int(*errcode); @@ -2210,12 +2210,13 @@ wait_any(int interesting) /* pid of interest, if any */ if (pid == redp->pid) { redp->pid = -1; redp->status = status; - break; + goto finished; } } if (pid == -1 && errno == ECHILD) break; } +finished: signal(SIGHUP, hstat); signal(SIGQUIT, qstat); #endif @@ -2439,7 +2440,7 @@ do_getline_redir(int into_variable, enum redirval redirtype) if (errcode != 0) { if (! do_traditional && (errcode != -1)) update_ERRNO_int(errcode); - return make_number((AWKNUM) -1.0); + return make_number((AWKNUM) cnt); } if (cnt == EOF) { @@ -2489,7 +2490,7 @@ do_getline(int into_variable, IOBUF *iop) update_ERRNO_int(errcode); if (into_variable) (void) POP_ADDRESS(); - return make_number((AWKNUM) -1.0); + return make_number((AWKNUM) cnt); } if (cnt == EOF) @@ -3427,6 +3428,32 @@ find_longest_terminator: return REC_OK; } +/* Does the I/O error indicate that the operation should be retried later? */ + +static inline int +errno_io_retry(void) +{ + switch (errno) { +#ifdef EAGAIN + case EAGAIN: +#endif +#ifdef EWOULDBLOCK +#if !defined(EAGAIN) || (EWOULDBLOCK != EAGAIN) + case EWOULDBLOCK: +#endif +#endif +#ifdef EINTR + case EINTR: +#endif +#ifdef ETIMEDOUT + case ETIMEDOUT: +#endif + return 1; + default: + return 0; + } +} + /* * get_a_record --- read a record from IOP into out, * return length of EOF, set RT. @@ -3474,8 +3501,10 @@ get_a_record(char **out, /* pointer to pointer to data */ iop->flag |= IOP_AT_EOF; return EOF; } else if (iop->count == -1) { - iop->flag |= IOP_AT_EOF; *errcode = errno; + if (errno_io_retry()) + return -2; + iop->flag |= IOP_AT_EOF; return EOF; } else { iop->dataend = iop->buf + iop->count; @@ -3540,6 +3569,8 @@ get_a_record(char **out, /* pointer to pointer to data */ iop->count = iop->public.read_func(iop->public.fd, iop->dataend, amt_to_read); if (iop->count == -1) { *errcode = errno; + if (errno_io_retry()) + return -2; iop->flag |= IOP_AT_EOF; break; } else if (iop->count == 0) { -- cgit v1.2.3 From c5d29ade6407adcec3eeef9e61a1474501acc0d3 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 2 Jul 2013 12:50:33 -0400 Subject: Add new extension header files to EXTRA_DIST so they will be in the tarball. --- extension/ChangeLog | 4 ++++ extension/Makefile.am | 4 +++- extension/Makefile.in | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index d1ef7b4a..006ea8e9 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,7 @@ +2013-07-02 Andrew J. Schorr + + * Makefile.am (EXTRA_DIST): Add errlist.h and siglist.h. + 2013-07-02 Andrew J. Schorr * select.c (set_non_blocking): New helper function to call fcntl. diff --git a/extension/Makefile.am b/extension/Makefile.am index 1d545227..ac1b7a29 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -116,8 +116,10 @@ install-data-hook: EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ + errlist.h \ fts.3 \ - README.fts + README.fts \ + siglist.h dist_man_MANS = \ filefuncs.3am fnmatch.3am fork.3am ordchr.3am \ diff --git a/extension/Makefile.in b/extension/Makefile.in index 5c45b494..5def0031 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -566,8 +566,10 @@ testext_la_LIBADD = $(MY_LIBS) EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ + errlist.h \ fts.3 \ - README.fts + README.fts \ + siglist.h dist_man_MANS = \ filefuncs.3am fnmatch.3am fork.3am ordchr.3am \ -- cgit v1.2.3 From a0d911d5920362982fb6a5c1fa6047c69dc26668 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 2 Jul 2013 14:24:13 -0400 Subject: Tighten up some argument checks in the select extension. --- extension/ChangeLog | 5 +++++ extension/select.c | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 006ea8e9..6778e2e6 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2013-07-02 Andrew J. Schorr + + * select.c (do_select): Do not treat a numeric command value as a + file descriptor unless the command type is empty. + 2013-07-02 Andrew J. Schorr * Makefile.am (EXTRA_DIST): Add errlist.h and siglist.h. diff --git a/extension/select.c b/extension/select.c index c1b706fc..be17dcf5 100644 --- a/extension/select.c +++ b/extension/select.c @@ -241,18 +241,22 @@ do_select(int nargs, awk_value_t *result) fds[i].array2fd[j] = -1; switch (EL.index.val_type) { case AWK_NUMBER: - if (EL.index.num_value >= 0) - fds[i].array2fd[j] = EL.index.num_value; - if (fds[i].array2fd[j] != EL.index.num_value) { - fds[i].array2fd[j] = -1; - warning(ext_id, _("select: invalid numeric index `%g' in `%s' array (should be a non-negative integer)"), EL.index.num_value, argname[i]); + if ((EL.value.val_type == AWK_UNDEFINED) || ((EL.value.val_type == AWK_STRING) && ! EL.value.str_value.len)) { + if (EL.index.num_value >= 0) + fds[i].array2fd[j] = EL.index.num_value; + if (fds[i].array2fd[j] != EL.index.num_value) { + fds[i].array2fd[j] = -1; + warning(ext_id, _("select: invalid numeric index `%g' in `%s' array (should be a non-negative integer)"), EL.index.num_value, argname[i]); + } } + else + warning(ext_id, _("select: numeric index `%g' in `%s' array should have an empty command type to be treated as a file descriptor"), EL.index.num_value, argname[i]); break; case AWK_STRING: { long x; - if ((integer_string(EL.index.str_value.str, &x) == 0) && (x >= 0)) + if ((integer_string(EL.index.str_value.str, &x) == 0) && (x >= 0) && ((EL.value.val_type == AWK_UNDEFINED) || ((EL.value.val_type == AWK_STRING) && ! EL.value.str_value.len))) fds[i].array2fd[j] = x; else if (EL.value.val_type == AWK_STRING) { const awk_input_buf_t *buf; -- cgit v1.2.3 From 6ace1b5a655517a41be7d1633ec7592ad940c0e6 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 2 Jul 2013 15:59:15 -0400 Subject: Patch gawkapi flatten_array to pass index values as strings in all cases! --- ChangeLog | 10 ++++++++++ gawkapi.c | 11 ++++++++--- gawkapi.h | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9719effc..23afe3b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-07-02 Andrew J. Schorr + + * gawkapi.h (awk_element_t): Add comment indicating that the array + element index will always be a string! + * gawkapi.c (api_flatten_array): When converting the index to an awk + value, request a string conversion, since we want the indices to + appear as strings to the extensions. This makes the call to + force_string redundant, since node_to_awk_value does that internally + when we request a string. + 2013-07-02 Andrew J. Schorr * eval.c (update_ERRNO_string): Set PROCINFO["errno"] to 0. diff --git a/gawkapi.c b/gawkapi.c index 78d6dbe4..3fc23388 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -936,12 +936,17 @@ api_flatten_array(awk_ext_id_t id, for (i = j = 0; i < 2 * array->table_size; i += 2, j++) { NODE *index, *value; - index = force_string(list[i]); + index = list[i]; value = list[i + 1]; /* number or string or subarray */ - /* convert index and value to ext types */ + /* + * Convert index and value to ext types. Force the + * index to be a string, since indices are always + * conceptually strings, regardless of internal optimizations + * to treat them as integers in some cases. + */ if (! node_to_awk_value(index, - & (*data)->elements[j].index, AWK_UNDEFINED)) { + & (*data)->elements[j].index, AWK_STRING)) { fatal(_("api_flatten_array: could not convert index %d\n"), (int) i); } diff --git a/gawkapi.h b/gawkapi.h index 7bb93037..81217009 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -343,7 +343,7 @@ typedef struct awk_element { AWK_ELEMENT_DELETE = 1 /* set by extension if should be deleted */ } flags; - awk_value_t index; + awk_value_t index; /* guaranteed to be a string! */ awk_value_t value; } awk_element_t; -- cgit v1.2.3 From f0391b8a4db649853ecc47a10b09d7c4b04330cf Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 2 Jul 2013 16:13:43 -0400 Subject: Patch select to remove support for buggy case where the index had a numeric value. --- extension/ChangeLog | 6 ++++++ extension/select.c | 44 ++++++++++++-------------------------------- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 6778e2e6..efb38249 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2013-07-02 Andrew J. Schorr + + * select.c (do_select): Now that the API flatten_array call has been + patched to ensure that the index values are strings, we can remove + the code to check for the AWK_NUMBER case. + 2013-07-02 Andrew J. Schorr * select.c (do_select): Do not treat a numeric command value as a diff --git a/extension/select.c b/extension/select.c index be17dcf5..89dbf6c3 100644 --- a/extension/select.c +++ b/extension/select.c @@ -238,41 +238,21 @@ do_select(int nargs, awk_value_t *result) if (flatten_array(fds[i].array.array_cookie, &fds[i].flat)) { emalloc(fds[i].array2fd, int *, fds[i].flat->count*sizeof(int), "select"); for (j = 0; j < fds[i].flat->count; j++) { + long x; fds[i].array2fd[j] = -1; - switch (EL.index.val_type) { - case AWK_NUMBER: - if ((EL.value.val_type == AWK_UNDEFINED) || ((EL.value.val_type == AWK_STRING) && ! EL.value.str_value.len)) { - if (EL.index.num_value >= 0) - fds[i].array2fd[j] = EL.index.num_value; - if (fds[i].array2fd[j] != EL.index.num_value) { - fds[i].array2fd[j] = -1; - warning(ext_id, _("select: invalid numeric index `%g' in `%s' array (should be a non-negative integer)"), EL.index.num_value, argname[i]); - } - } + /* note: the index is always delivered as a string */ + + if (((EL.value.val_type == AWK_UNDEFINED) || ((EL.value.val_type == AWK_STRING) && ! EL.value.str_value.len)) && (integer_string(EL.index.str_value.str, &x) == 0) && (x >= 0)) + fds[i].array2fd[j] = x; + else if (EL.value.val_type == AWK_STRING) { + const awk_input_buf_t *buf; + if ((buf = get_file(EL.index.str_value.str, EL.index.str_value.len, EL.value.str_value.str, EL.value.str_value.len)) != NULL) + fds[i].array2fd[j] = buf->fd; else - warning(ext_id, _("select: numeric index `%g' in `%s' array should have an empty command type to be treated as a file descriptor"), EL.index.num_value, argname[i]); - break; - case AWK_STRING: - { - long x; - - if ((integer_string(EL.index.str_value.str, &x) == 0) && (x >= 0) && ((EL.value.val_type == AWK_UNDEFINED) || ((EL.value.val_type == AWK_STRING) && ! EL.value.str_value.len))) - fds[i].array2fd[j] = x; - else if (EL.value.val_type == AWK_STRING) { - const awk_input_buf_t *buf; - if ((buf = get_file(EL.index.str_value.str, EL.index.str_value.len, EL.value.str_value.str, EL.value.str_value.len)) != NULL) - fds[i].array2fd[j] = buf->fd; - else - warning(ext_id, _("select: get_file(`%s', `%s') failed in `%s' array"), EL.index.str_value.str, EL.value.str_value.str, argname[i]); - } - else - warning(ext_id, _("select: command type should be a string for `%s' in `%s' array"), EL.index.str_value.str, argname[i]); - } - break; - default: - warning(ext_id, _("select: invalid index type in `%s' array (must be a string or a non-negative integer"), argname[i]); - break; + warning(ext_id, _("select: get_file(`%s', `%s') failed in `%s' array"), EL.index.str_value.str, EL.value.str_value.str, argname[i]); } + else + warning(ext_id, _("select: command type should be a string for `%s' in `%s' array"), EL.index.str_value.str, argname[i]); if (fds[i].array2fd[j] < 0) { update_ERRNO_string(_("select: get_file failed")); if (! release_flattened_array(fds[i].array.array_cookie, fds[i].flat)) -- cgit v1.2.3 From 9ee8aeb59ad3b3873d52f3c9a2ab80b28c4c2c20 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 2 Jul 2013 20:45:46 -0400 Subject: After the gawkapi get_file function opens a file, call the BEGINFILE block. --- ChangeLog | 11 ++ awkgram.c | 385 +++++++++++++++++++++++++++++++------------------------------- awkgram.y | 3 +- gawkapi.c | 26 ++++- 4 files changed, 230 insertions(+), 195 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23afe3b5..c209f335 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2013-07-02 Andrew J. Schorr + + * awkgram.y (main_beginfile): Declare new global INSTRUCTION *. + (parse_program): Set main_beginfile to point to the BEGINFILE + instruction block. + * gawkapi.c (api_get_file): After nextfile starts a new file, + we need to run the BEGINFILE actions. We retrieve the + instruction pointer from main_beginfile and execute it until + we reach the Op_after_beginfile opcode. We then run after_beginfile + manually and restore the value of currule and source. + 2013-07-02 Andrew J. Schorr * gawkapi.h (awk_element_t): Add comment indicating that the array diff --git a/awkgram.c b/awkgram.c index 947f4a30..c6d7aadb 100644 --- a/awkgram.c +++ b/awkgram.c @@ -186,6 +186,7 @@ static INSTRUCTION *ip_atexit = NULL; static INSTRUCTION *ip_end; static INSTRUCTION *ip_endfile; static INSTRUCTION *ip_beginfile; +INSTRUCTION *main_beginfile; static inline INSTRUCTION *list_create(INSTRUCTION *x); static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x); @@ -199,7 +200,7 @@ extern double fmod(double x, double y); #define is_identchar(c) (isalnum(c) || (c) == '_') /* Line 371 of yacc.c */ -#line 203 "awkgram.c" +#line 204 "awkgram.c" # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -368,7 +369,7 @@ int yyparse (); /* Copy the second part of user declarations. */ /* Line 390 of yacc.c */ -#line 372 "awkgram.c" +#line 373 "awkgram.c" #ifdef short # undef short @@ -744,25 +745,25 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 200, 200, 202, 207, 208, 214, 226, 230, 241, - 247, 252, 260, 268, 270, 275, 283, 285, 291, 292, - 294, 320, 331, 342, 348, 357, 367, 369, 371, 377, - 382, 383, 387, 406, 405, 439, 441, 446, 447, 460, - 465, 466, 470, 472, 474, 481, 571, 613, 655, 768, - 775, 782, 792, 801, 810, 819, 830, 846, 845, 869, - 881, 881, 979, 979, 1012, 1042, 1048, 1049, 1055, 1056, - 1063, 1068, 1080, 1094, 1096, 1104, 1109, 1111, 1119, 1121, - 1130, 1131, 1139, 1144, 1144, 1155, 1159, 1167, 1168, 1171, - 1173, 1178, 1179, 1188, 1189, 1194, 1199, 1205, 1207, 1209, - 1216, 1217, 1223, 1224, 1229, 1231, 1236, 1238, 1246, 1251, - 1260, 1267, 1269, 1271, 1287, 1297, 1304, 1306, 1311, 1313, - 1315, 1323, 1325, 1330, 1332, 1337, 1339, 1341, 1391, 1393, - 1395, 1397, 1399, 1401, 1403, 1405, 1428, 1433, 1438, 1463, - 1469, 1471, 1473, 1475, 1477, 1479, 1484, 1488, 1520, 1522, - 1528, 1534, 1547, 1548, 1549, 1554, 1559, 1563, 1567, 1582, - 1595, 1600, 1636, 1654, 1655, 1661, 1662, 1667, 1669, 1676, - 1693, 1710, 1712, 1719, 1724, 1732, 1742, 1754, 1763, 1767, - 1771, 1775, 1779, 1783, 1786, 1788, 1792, 1796, 1800 + 0, 201, 201, 203, 208, 209, 215, 227, 231, 242, + 248, 253, 261, 269, 271, 276, 284, 286, 292, 293, + 295, 321, 332, 343, 349, 358, 368, 370, 372, 378, + 383, 384, 388, 407, 406, 440, 442, 447, 448, 461, + 466, 467, 471, 473, 475, 482, 572, 614, 656, 769, + 776, 783, 793, 802, 811, 820, 831, 847, 846, 870, + 882, 882, 980, 980, 1013, 1043, 1049, 1050, 1056, 1057, + 1064, 1069, 1081, 1095, 1097, 1105, 1110, 1112, 1120, 1122, + 1131, 1132, 1140, 1145, 1145, 1156, 1160, 1168, 1169, 1172, + 1174, 1179, 1180, 1189, 1190, 1195, 1200, 1206, 1208, 1210, + 1217, 1218, 1224, 1225, 1230, 1232, 1237, 1239, 1247, 1252, + 1261, 1268, 1270, 1272, 1288, 1298, 1305, 1307, 1312, 1314, + 1316, 1324, 1326, 1331, 1333, 1338, 1340, 1342, 1392, 1394, + 1396, 1398, 1400, 1402, 1404, 1406, 1429, 1434, 1439, 1464, + 1470, 1472, 1474, 1476, 1478, 1480, 1485, 1489, 1521, 1523, + 1529, 1535, 1548, 1549, 1550, 1555, 1560, 1564, 1568, 1583, + 1596, 1601, 1637, 1655, 1656, 1662, 1663, 1668, 1670, 1677, + 1694, 1711, 1713, 1720, 1725, 1733, 1743, 1755, 1764, 1768, + 1772, 1776, 1780, 1784, 1787, 1789, 1793, 1797, 1801 }; #endif @@ -2049,7 +2050,7 @@ yyreduce: { case 3: /* Line 1787 of yacc.c */ -#line 203 "awkgram.y" +#line 204 "awkgram.y" { rule = 0; yyerrok; @@ -2058,7 +2059,7 @@ yyreduce: case 5: /* Line 1787 of yacc.c */ -#line 209 "awkgram.y" +#line 210 "awkgram.y" { next_sourcefile(); if (sourcefile == srcfiles) @@ -2068,7 +2069,7 @@ yyreduce: case 6: /* Line 1787 of yacc.c */ -#line 215 "awkgram.y" +#line 216 "awkgram.y" { rule = 0; /* @@ -2081,7 +2082,7 @@ yyreduce: case 7: /* Line 1787 of yacc.c */ -#line 227 "awkgram.y" +#line 228 "awkgram.y" { (void) append_rule((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } @@ -2089,7 +2090,7 @@ yyreduce: case 8: /* Line 1787 of yacc.c */ -#line 231 "awkgram.y" +#line 232 "awkgram.y" { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -2104,7 +2105,7 @@ yyreduce: case 9: /* Line 1787 of yacc.c */ -#line 242 "awkgram.y" +#line 243 "awkgram.y" { in_function = NULL; (void) mk_function((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); @@ -2114,7 +2115,7 @@ yyreduce: case 10: /* Line 1787 of yacc.c */ -#line 248 "awkgram.y" +#line 249 "awkgram.y" { want_source = false; yyerrok; @@ -2123,7 +2124,7 @@ yyreduce: case 11: /* Line 1787 of yacc.c */ -#line 253 "awkgram.y" +#line 254 "awkgram.y" { want_source = false; yyerrok; @@ -2132,7 +2133,7 @@ yyreduce: case 12: /* Line 1787 of yacc.c */ -#line 261 "awkgram.y" +#line 262 "awkgram.y" { if (include_source((yyvsp[(1) - (1)])) < 0) YYABORT; @@ -2144,19 +2145,19 @@ yyreduce: case 13: /* Line 1787 of yacc.c */ -#line 269 "awkgram.y" +#line 270 "awkgram.y" { (yyval) = NULL; } break; case 14: /* Line 1787 of yacc.c */ -#line 271 "awkgram.y" +#line 272 "awkgram.y" { (yyval) = NULL; } break; case 15: /* Line 1787 of yacc.c */ -#line 276 "awkgram.y" +#line 277 "awkgram.y" { if (load_library((yyvsp[(1) - (1)])) < 0) YYABORT; @@ -2168,31 +2169,31 @@ yyreduce: case 16: /* Line 1787 of yacc.c */ -#line 284 "awkgram.y" +#line 285 "awkgram.y" { (yyval) = NULL; } break; case 17: /* Line 1787 of yacc.c */ -#line 286 "awkgram.y" +#line 287 "awkgram.y" { (yyval) = NULL; } break; case 18: /* Line 1787 of yacc.c */ -#line 291 "awkgram.y" +#line 292 "awkgram.y" { (yyval) = NULL; rule = Rule; } break; case 19: /* Line 1787 of yacc.c */ -#line 293 "awkgram.y" +#line 294 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); rule = Rule; } break; case 20: /* Line 1787 of yacc.c */ -#line 295 "awkgram.y" +#line 296 "awkgram.y" { INSTRUCTION *tp; @@ -2222,7 +2223,7 @@ yyreduce: case 21: /* Line 1787 of yacc.c */ -#line 321 "awkgram.y" +#line 322 "awkgram.y" { static int begin_seen = 0; if (do_lint_old && ++begin_seen == 2) @@ -2237,7 +2238,7 @@ yyreduce: case 22: /* Line 1787 of yacc.c */ -#line 332 "awkgram.y" +#line 333 "awkgram.y" { static int end_seen = 0; if (do_lint_old && ++end_seen == 2) @@ -2252,7 +2253,7 @@ yyreduce: case 23: /* Line 1787 of yacc.c */ -#line 343 "awkgram.y" +#line 344 "awkgram.y" { (yyvsp[(1) - (1)])->in_rule = rule = BEGINFILE; (yyvsp[(1) - (1)])->source_file = source; @@ -2262,7 +2263,7 @@ yyreduce: case 24: /* Line 1787 of yacc.c */ -#line 349 "awkgram.y" +#line 350 "awkgram.y" { (yyvsp[(1) - (1)])->in_rule = rule = ENDFILE; (yyvsp[(1) - (1)])->source_file = source; @@ -2272,7 +2273,7 @@ yyreduce: case 25: /* Line 1787 of yacc.c */ -#line 358 "awkgram.y" +#line 359 "awkgram.y" { if ((yyvsp[(2) - (5)]) == NULL) (yyval) = list_create(instruction(Op_no_op)); @@ -2283,19 +2284,19 @@ yyreduce: case 26: /* Line 1787 of yacc.c */ -#line 368 "awkgram.y" +#line 369 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 27: /* Line 1787 of yacc.c */ -#line 370 "awkgram.y" +#line 371 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 28: /* Line 1787 of yacc.c */ -#line 372 "awkgram.y" +#line 373 "awkgram.y" { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); @@ -2305,13 +2306,13 @@ yyreduce: case 29: /* Line 1787 of yacc.c */ -#line 378 "awkgram.y" +#line 379 "awkgram.y" { (yyval) = (yyvsp[(2) - (2)]); } break; case 32: /* Line 1787 of yacc.c */ -#line 388 "awkgram.y" +#line 389 "awkgram.y" { (yyvsp[(1) - (6)])->source_file = source; if (install_function((yyvsp[(2) - (6)])->lextok, (yyvsp[(1) - (6)]), (yyvsp[(4) - (6)])) < 0) @@ -2326,13 +2327,13 @@ yyreduce: case 33: /* Line 1787 of yacc.c */ -#line 406 "awkgram.y" +#line 407 "awkgram.y" { want_regexp = true; } break; case 34: /* Line 1787 of yacc.c */ -#line 408 "awkgram.y" +#line 409 "awkgram.y" { NODE *n, *exp; char *re; @@ -2365,19 +2366,19 @@ yyreduce: case 35: /* Line 1787 of yacc.c */ -#line 440 "awkgram.y" +#line 441 "awkgram.y" { bcfree((yyvsp[(1) - (1)])); } break; case 37: /* Line 1787 of yacc.c */ -#line 446 "awkgram.y" +#line 447 "awkgram.y" { (yyval) = NULL; } break; case 38: /* Line 1787 of yacc.c */ -#line 448 "awkgram.y" +#line 449 "awkgram.y" { if ((yyvsp[(2) - (2)]) == NULL) (yyval) = (yyvsp[(1) - (2)]); @@ -2394,25 +2395,25 @@ yyreduce: case 39: /* Line 1787 of yacc.c */ -#line 461 "awkgram.y" +#line 462 "awkgram.y" { (yyval) = NULL; } break; case 42: /* Line 1787 of yacc.c */ -#line 471 "awkgram.y" +#line 472 "awkgram.y" { (yyval) = NULL; } break; case 43: /* Line 1787 of yacc.c */ -#line 473 "awkgram.y" +#line 474 "awkgram.y" { (yyval) = (yyvsp[(2) - (3)]); } break; case 44: /* Line 1787 of yacc.c */ -#line 475 "awkgram.y" +#line 476 "awkgram.y" { if (do_pretty_print) (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count)); @@ -2423,7 +2424,7 @@ yyreduce: case 45: /* Line 1787 of yacc.c */ -#line 482 "awkgram.y" +#line 483 "awkgram.y" { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2517,7 +2518,7 @@ yyreduce: case 46: /* Line 1787 of yacc.c */ -#line 572 "awkgram.y" +#line 573 "awkgram.y" { /* * ----------------- @@ -2563,7 +2564,7 @@ yyreduce: case 47: /* Line 1787 of yacc.c */ -#line 614 "awkgram.y" +#line 615 "awkgram.y" { /* * ----------------- @@ -2609,7 +2610,7 @@ yyreduce: case 48: /* Line 1787 of yacc.c */ -#line 656 "awkgram.y" +#line 657 "awkgram.y" { INSTRUCTION *ip; char *var_name = (yyvsp[(3) - (8)])->lextok; @@ -2726,7 +2727,7 @@ regular_loop: case 49: /* Line 1787 of yacc.c */ -#line 769 "awkgram.y" +#line 770 "awkgram.y" { (yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]), (yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)])); @@ -2737,7 +2738,7 @@ regular_loop: case 50: /* Line 1787 of yacc.c */ -#line 776 "awkgram.y" +#line 777 "awkgram.y" { (yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]), (INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)])); @@ -2748,7 +2749,7 @@ regular_loop: case 51: /* Line 1787 of yacc.c */ -#line 783 "awkgram.y" +#line 784 "awkgram.y" { if (do_pretty_print) (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count)); @@ -2759,7 +2760,7 @@ regular_loop: case 52: /* Line 1787 of yacc.c */ -#line 793 "awkgram.y" +#line 794 "awkgram.y" { if (! break_allowed) error_ln((yyvsp[(1) - (2)])->source_line, @@ -2772,7 +2773,7 @@ regular_loop: case 53: /* Line 1787 of yacc.c */ -#line 802 "awkgram.y" +#line 803 "awkgram.y" { if (! continue_allowed) error_ln((yyvsp[(1) - (2)])->source_line, @@ -2785,7 +2786,7 @@ regular_loop: case 54: /* Line 1787 of yacc.c */ -#line 811 "awkgram.y" +#line 812 "awkgram.y" { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2798,7 +2799,7 @@ regular_loop: case 55: /* Line 1787 of yacc.c */ -#line 820 "awkgram.y" +#line 821 "awkgram.y" { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2813,7 +2814,7 @@ regular_loop: case 56: /* Line 1787 of yacc.c */ -#line 831 "awkgram.y" +#line 832 "awkgram.y" { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2832,7 +2833,7 @@ regular_loop: case 57: /* Line 1787 of yacc.c */ -#line 846 "awkgram.y" +#line 847 "awkgram.y" { if (! in_function) yyerror(_("`return' used outside function context")); @@ -2841,7 +2842,7 @@ regular_loop: case 58: /* Line 1787 of yacc.c */ -#line 849 "awkgram.y" +#line 850 "awkgram.y" { if ((yyvsp[(3) - (4)]) == NULL) { (yyval) = list_create((yyvsp[(1) - (4)])); @@ -2866,13 +2867,13 @@ regular_loop: case 60: /* Line 1787 of yacc.c */ -#line 881 "awkgram.y" +#line 882 "awkgram.y" { in_print = true; in_parens = 0; } break; case 61: /* Line 1787 of yacc.c */ -#line 882 "awkgram.y" +#line 883 "awkgram.y" { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2973,13 +2974,13 @@ regular_print: case 62: /* Line 1787 of yacc.c */ -#line 979 "awkgram.y" +#line 980 "awkgram.y" { sub_counter = 0; } break; case 63: /* Line 1787 of yacc.c */ -#line 980 "awkgram.y" +#line 981 "awkgram.y" { char *arr = (yyvsp[(2) - (4)])->lextok; @@ -3016,7 +3017,7 @@ regular_print: case 64: /* Line 1787 of yacc.c */ -#line 1017 "awkgram.y" +#line 1018 "awkgram.y" { static bool warned = false; char *arr = (yyvsp[(3) - (4)])->lextok; @@ -3046,31 +3047,31 @@ regular_print: case 65: /* Line 1787 of yacc.c */ -#line 1043 "awkgram.y" +#line 1044 "awkgram.y" { (yyval) = optimize_assignment((yyvsp[(1) - (1)])); } break; case 66: /* Line 1787 of yacc.c */ -#line 1048 "awkgram.y" +#line 1049 "awkgram.y" { (yyval) = NULL; } break; case 67: /* Line 1787 of yacc.c */ -#line 1050 "awkgram.y" +#line 1051 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 68: /* Line 1787 of yacc.c */ -#line 1055 "awkgram.y" +#line 1056 "awkgram.y" { (yyval) = NULL; } break; case 69: /* Line 1787 of yacc.c */ -#line 1057 "awkgram.y" +#line 1058 "awkgram.y" { if ((yyvsp[(1) - (2)]) == NULL) (yyval) = list_create((yyvsp[(2) - (2)])); @@ -3081,13 +3082,13 @@ regular_print: case 70: /* Line 1787 of yacc.c */ -#line 1064 "awkgram.y" +#line 1065 "awkgram.y" { (yyval) = NULL; } break; case 71: /* Line 1787 of yacc.c */ -#line 1069 "awkgram.y" +#line 1070 "awkgram.y" { INSTRUCTION *casestmt = (yyvsp[(5) - (5)]); if ((yyvsp[(5) - (5)]) == NULL) @@ -3103,7 +3104,7 @@ regular_print: case 72: /* Line 1787 of yacc.c */ -#line 1081 "awkgram.y" +#line 1082 "awkgram.y" { INSTRUCTION *casestmt = (yyvsp[(4) - (4)]); if ((yyvsp[(4) - (4)]) == NULL) @@ -3118,13 +3119,13 @@ regular_print: case 73: /* Line 1787 of yacc.c */ -#line 1095 "awkgram.y" +#line 1096 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 74: /* Line 1787 of yacc.c */ -#line 1097 "awkgram.y" +#line 1098 "awkgram.y" { NODE *n = (yyvsp[(2) - (2)])->memory; (void) force_number(n); @@ -3136,7 +3137,7 @@ regular_print: case 75: /* Line 1787 of yacc.c */ -#line 1105 "awkgram.y" +#line 1106 "awkgram.y" { bcfree((yyvsp[(1) - (2)])); (yyval) = (yyvsp[(2) - (2)]); @@ -3145,13 +3146,13 @@ regular_print: case 76: /* Line 1787 of yacc.c */ -#line 1110 "awkgram.y" +#line 1111 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 77: /* Line 1787 of yacc.c */ -#line 1112 "awkgram.y" +#line 1113 "awkgram.y" { (yyvsp[(1) - (1)])->opcode = Op_push_re; (yyval) = (yyvsp[(1) - (1)]); @@ -3160,19 +3161,19 @@ regular_print: case 78: /* Line 1787 of yacc.c */ -#line 1120 "awkgram.y" +#line 1121 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 79: /* Line 1787 of yacc.c */ -#line 1122 "awkgram.y" +#line 1123 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 81: /* Line 1787 of yacc.c */ -#line 1132 "awkgram.y" +#line 1133 "awkgram.y" { (yyval) = (yyvsp[(2) - (3)]); } @@ -3180,7 +3181,7 @@ regular_print: case 82: /* Line 1787 of yacc.c */ -#line 1139 "awkgram.y" +#line 1140 "awkgram.y" { in_print = false; in_parens = 0; @@ -3190,13 +3191,13 @@ regular_print: case 83: /* Line 1787 of yacc.c */ -#line 1144 "awkgram.y" +#line 1145 "awkgram.y" { in_print = false; in_parens = 0; } break; case 84: /* Line 1787 of yacc.c */ -#line 1145 "awkgram.y" +#line 1146 "awkgram.y" { if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway && (yyvsp[(3) - (3)])->lasti->opcode == Op_K_getline_redir @@ -3208,7 +3209,7 @@ regular_print: case 85: /* Line 1787 of yacc.c */ -#line 1156 "awkgram.y" +#line 1157 "awkgram.y" { (yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]), (yyvsp[(6) - (6)]), NULL, NULL); } @@ -3216,7 +3217,7 @@ regular_print: case 86: /* Line 1787 of yacc.c */ -#line 1161 "awkgram.y" +#line 1162 "awkgram.y" { (yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]), (yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)])); } @@ -3224,13 +3225,13 @@ regular_print: case 91: /* Line 1787 of yacc.c */ -#line 1178 "awkgram.y" +#line 1179 "awkgram.y" { (yyval) = NULL; } break; case 92: /* Line 1787 of yacc.c */ -#line 1180 "awkgram.y" +#line 1181 "awkgram.y" { bcfree((yyvsp[(1) - (2)])); (yyval) = (yyvsp[(2) - (2)]); @@ -3239,19 +3240,19 @@ regular_print: case 93: /* Line 1787 of yacc.c */ -#line 1188 "awkgram.y" +#line 1189 "awkgram.y" { (yyval) = NULL; } break; case 94: /* Line 1787 of yacc.c */ -#line 1190 "awkgram.y" +#line 1191 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]) ; } break; case 95: /* Line 1787 of yacc.c */ -#line 1195 "awkgram.y" +#line 1196 "awkgram.y" { (yyvsp[(1) - (1)])->param_count = 0; (yyval) = list_create((yyvsp[(1) - (1)])); @@ -3260,7 +3261,7 @@ regular_print: case 96: /* Line 1787 of yacc.c */ -#line 1200 "awkgram.y" +#line 1201 "awkgram.y" { (yyvsp[(3) - (3)])->param_count = (yyvsp[(1) - (3)])->lasti->param_count + 1; (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); @@ -3270,55 +3271,55 @@ regular_print: case 97: /* Line 1787 of yacc.c */ -#line 1206 "awkgram.y" +#line 1207 "awkgram.y" { (yyval) = NULL; } break; case 98: /* Line 1787 of yacc.c */ -#line 1208 "awkgram.y" +#line 1209 "awkgram.y" { (yyval) = (yyvsp[(1) - (2)]); } break; case 99: /* Line 1787 of yacc.c */ -#line 1210 "awkgram.y" +#line 1211 "awkgram.y" { (yyval) = (yyvsp[(1) - (3)]); } break; case 100: /* Line 1787 of yacc.c */ -#line 1216 "awkgram.y" +#line 1217 "awkgram.y" { (yyval) = NULL; } break; case 101: /* Line 1787 of yacc.c */ -#line 1218 "awkgram.y" +#line 1219 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 102: /* Line 1787 of yacc.c */ -#line 1223 "awkgram.y" +#line 1224 "awkgram.y" { (yyval) = NULL; } break; case 103: /* Line 1787 of yacc.c */ -#line 1225 "awkgram.y" +#line 1226 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 104: /* Line 1787 of yacc.c */ -#line 1230 "awkgram.y" +#line 1231 "awkgram.y" { (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); } break; case 105: /* Line 1787 of yacc.c */ -#line 1232 "awkgram.y" +#line 1233 "awkgram.y" { (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); yyerrok; @@ -3327,13 +3328,13 @@ regular_print: case 106: /* Line 1787 of yacc.c */ -#line 1237 "awkgram.y" +#line 1238 "awkgram.y" { (yyval) = NULL; } break; case 107: /* Line 1787 of yacc.c */ -#line 1239 "awkgram.y" +#line 1240 "awkgram.y" { /* * Returning the expression list instead of NULL lets @@ -3345,7 +3346,7 @@ regular_print: case 108: /* Line 1787 of yacc.c */ -#line 1247 "awkgram.y" +#line 1248 "awkgram.y" { /* Ditto */ (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); @@ -3354,7 +3355,7 @@ regular_print: case 109: /* Line 1787 of yacc.c */ -#line 1252 "awkgram.y" +#line 1253 "awkgram.y" { /* Ditto */ (yyval) = (yyvsp[(1) - (3)]); @@ -3363,7 +3364,7 @@ regular_print: case 110: /* Line 1787 of yacc.c */ -#line 1261 "awkgram.y" +#line 1262 "awkgram.y" { if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[(2) - (3)])->source_line, @@ -3374,19 +3375,19 @@ regular_print: case 111: /* Line 1787 of yacc.c */ -#line 1268 "awkgram.y" +#line 1269 "awkgram.y" { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 112: /* Line 1787 of yacc.c */ -#line 1270 "awkgram.y" +#line 1271 "awkgram.y" { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 113: /* Line 1787 of yacc.c */ -#line 1272 "awkgram.y" +#line 1273 "awkgram.y" { if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[(2) - (3)])->source_line, @@ -3406,7 +3407,7 @@ regular_print: case 114: /* Line 1787 of yacc.c */ -#line 1288 "awkgram.y" +#line 1289 "awkgram.y" { if (do_lint_old) warning_ln((yyvsp[(2) - (3)])->source_line, @@ -3420,7 +3421,7 @@ regular_print: case 115: /* Line 1787 of yacc.c */ -#line 1298 "awkgram.y" +#line 1299 "awkgram.y" { if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[(2) - (3)])->source_line, @@ -3431,31 +3432,31 @@ regular_print: case 116: /* Line 1787 of yacc.c */ -#line 1305 "awkgram.y" +#line 1306 "awkgram.y" { (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); } break; case 117: /* Line 1787 of yacc.c */ -#line 1307 "awkgram.y" +#line 1308 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 118: /* Line 1787 of yacc.c */ -#line 1312 "awkgram.y" +#line 1313 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 119: /* Line 1787 of yacc.c */ -#line 1314 "awkgram.y" +#line 1315 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 120: /* Line 1787 of yacc.c */ -#line 1316 "awkgram.y" +#line 1317 "awkgram.y" { (yyvsp[(2) - (2)])->opcode = Op_assign_quotient; (yyval) = (yyvsp[(2) - (2)]); @@ -3464,43 +3465,43 @@ regular_print: case 121: /* Line 1787 of yacc.c */ -#line 1324 "awkgram.y" +#line 1325 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 122: /* Line 1787 of yacc.c */ -#line 1326 "awkgram.y" +#line 1327 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 123: /* Line 1787 of yacc.c */ -#line 1331 "awkgram.y" +#line 1332 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 124: /* Line 1787 of yacc.c */ -#line 1333 "awkgram.y" +#line 1334 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 125: /* Line 1787 of yacc.c */ -#line 1338 "awkgram.y" +#line 1339 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 126: /* Line 1787 of yacc.c */ -#line 1340 "awkgram.y" +#line 1341 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 127: /* Line 1787 of yacc.c */ -#line 1342 "awkgram.y" +#line 1343 "awkgram.y" { int count = 2; bool is_simple_var = false; @@ -3551,43 +3552,43 @@ regular_print: case 129: /* Line 1787 of yacc.c */ -#line 1394 "awkgram.y" +#line 1395 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 130: /* Line 1787 of yacc.c */ -#line 1396 "awkgram.y" +#line 1397 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 131: /* Line 1787 of yacc.c */ -#line 1398 "awkgram.y" +#line 1399 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 132: /* Line 1787 of yacc.c */ -#line 1400 "awkgram.y" +#line 1401 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 133: /* Line 1787 of yacc.c */ -#line 1402 "awkgram.y" +#line 1403 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 134: /* Line 1787 of yacc.c */ -#line 1404 "awkgram.y" +#line 1405 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 135: /* Line 1787 of yacc.c */ -#line 1406 "awkgram.y" +#line 1407 "awkgram.y" { /* * In BEGINFILE/ENDFILE, allow `getline var < file' @@ -3614,7 +3615,7 @@ regular_print: case 136: /* Line 1787 of yacc.c */ -#line 1429 "awkgram.y" +#line 1430 "awkgram.y" { (yyvsp[(2) - (2)])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)])); @@ -3623,7 +3624,7 @@ regular_print: case 137: /* Line 1787 of yacc.c */ -#line 1434 "awkgram.y" +#line 1435 "awkgram.y" { (yyvsp[(2) - (2)])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)])); @@ -3632,7 +3633,7 @@ regular_print: case 138: /* Line 1787 of yacc.c */ -#line 1439 "awkgram.y" +#line 1440 "awkgram.y" { if (do_lint_old) { warning_ln((yyvsp[(4) - (5)])->source_line, @@ -3656,7 +3657,7 @@ regular_print: case 139: /* Line 1787 of yacc.c */ -#line 1464 "awkgram.y" +#line 1465 "awkgram.y" { (yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]), (yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type); bcfree((yyvsp[(2) - (4)])); @@ -3665,43 +3666,43 @@ regular_print: case 140: /* Line 1787 of yacc.c */ -#line 1470 "awkgram.y" +#line 1471 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 141: /* Line 1787 of yacc.c */ -#line 1472 "awkgram.y" +#line 1473 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 142: /* Line 1787 of yacc.c */ -#line 1474 "awkgram.y" +#line 1475 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 143: /* Line 1787 of yacc.c */ -#line 1476 "awkgram.y" +#line 1477 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 144: /* Line 1787 of yacc.c */ -#line 1478 "awkgram.y" +#line 1479 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 145: /* Line 1787 of yacc.c */ -#line 1480 "awkgram.y" +#line 1481 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 146: /* Line 1787 of yacc.c */ -#line 1485 "awkgram.y" +#line 1486 "awkgram.y" { (yyval) = list_create((yyvsp[(1) - (1)])); } @@ -3709,7 +3710,7 @@ regular_print: case 147: /* Line 1787 of yacc.c */ -#line 1489 "awkgram.y" +#line 1490 "awkgram.y" { if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) { (yyvsp[(2) - (2)])->opcode = Op_nomatch; @@ -3745,13 +3746,13 @@ regular_print: case 148: /* Line 1787 of yacc.c */ -#line 1521 "awkgram.y" +#line 1522 "awkgram.y" { (yyval) = (yyvsp[(2) - (3)]); } break; case 149: /* Line 1787 of yacc.c */ -#line 1523 "awkgram.y" +#line 1524 "awkgram.y" { (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); if ((yyval) == NULL) @@ -3761,7 +3762,7 @@ regular_print: case 150: /* Line 1787 of yacc.c */ -#line 1529 "awkgram.y" +#line 1530 "awkgram.y" { (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); if ((yyval) == NULL) @@ -3771,7 +3772,7 @@ regular_print: case 151: /* Line 1787 of yacc.c */ -#line 1535 "awkgram.y" +#line 1536 "awkgram.y" { static bool warned = false; @@ -3788,7 +3789,7 @@ regular_print: case 154: /* Line 1787 of yacc.c */ -#line 1550 "awkgram.y" +#line 1551 "awkgram.y" { (yyvsp[(1) - (2)])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)])); @@ -3797,7 +3798,7 @@ regular_print: case 155: /* Line 1787 of yacc.c */ -#line 1555 "awkgram.y" +#line 1556 "awkgram.y" { (yyvsp[(1) - (2)])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)])); @@ -3806,7 +3807,7 @@ regular_print: case 156: /* Line 1787 of yacc.c */ -#line 1560 "awkgram.y" +#line 1561 "awkgram.y" { (yyval) = list_create((yyvsp[(1) - (1)])); } @@ -3814,7 +3815,7 @@ regular_print: case 157: /* Line 1787 of yacc.c */ -#line 1564 "awkgram.y" +#line 1565 "awkgram.y" { (yyval) = list_create((yyvsp[(1) - (1)])); } @@ -3822,7 +3823,7 @@ regular_print: case 158: /* Line 1787 of yacc.c */ -#line 1568 "awkgram.y" +#line 1569 "awkgram.y" { if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i && ((yyvsp[(2) - (2)])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3841,7 +3842,7 @@ regular_print: case 159: /* Line 1787 of yacc.c */ -#line 1583 "awkgram.y" +#line 1584 "awkgram.y" { /* * was: $$ = $2 @@ -3855,7 +3856,7 @@ regular_print: case 160: /* Line 1787 of yacc.c */ -#line 1596 "awkgram.y" +#line 1597 "awkgram.y" { func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[(1) - (1)]); @@ -3864,7 +3865,7 @@ regular_print: case 161: /* Line 1787 of yacc.c */ -#line 1601 "awkgram.y" +#line 1602 "awkgram.y" { /* indirect function call */ INSTRUCTION *f, *t; @@ -3901,7 +3902,7 @@ regular_print: case 162: /* Line 1787 of yacc.c */ -#line 1637 "awkgram.y" +#line 1638 "awkgram.y" { param_sanity((yyvsp[(3) - (4)])); (yyvsp[(1) - (4)])->opcode = Op_func_call; @@ -3919,37 +3920,37 @@ regular_print: case 163: /* Line 1787 of yacc.c */ -#line 1654 "awkgram.y" +#line 1655 "awkgram.y" { (yyval) = NULL; } break; case 164: /* Line 1787 of yacc.c */ -#line 1656 "awkgram.y" +#line 1657 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 165: /* Line 1787 of yacc.c */ -#line 1661 "awkgram.y" +#line 1662 "awkgram.y" { (yyval) = NULL; } break; case 166: /* Line 1787 of yacc.c */ -#line 1663 "awkgram.y" +#line 1664 "awkgram.y" { (yyval) = (yyvsp[(1) - (2)]); } break; case 167: /* Line 1787 of yacc.c */ -#line 1668 "awkgram.y" +#line 1669 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 168: /* Line 1787 of yacc.c */ -#line 1670 "awkgram.y" +#line 1671 "awkgram.y" { (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } @@ -3957,7 +3958,7 @@ regular_print: case 169: /* Line 1787 of yacc.c */ -#line 1677 "awkgram.y" +#line 1678 "awkgram.y" { INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3975,7 +3976,7 @@ regular_print: case 170: /* Line 1787 of yacc.c */ -#line 1694 "awkgram.y" +#line 1695 "awkgram.y" { INSTRUCTION *t = (yyvsp[(2) - (3)]); if ((yyvsp[(2) - (3)]) == NULL) { @@ -3993,13 +3994,13 @@ regular_print: case 171: /* Line 1787 of yacc.c */ -#line 1711 "awkgram.y" +#line 1712 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 172: /* Line 1787 of yacc.c */ -#line 1713 "awkgram.y" +#line 1714 "awkgram.y" { (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } @@ -4007,13 +4008,13 @@ regular_print: case 173: /* Line 1787 of yacc.c */ -#line 1720 "awkgram.y" +#line 1721 "awkgram.y" { (yyval) = (yyvsp[(1) - (2)]); } break; case 174: /* Line 1787 of yacc.c */ -#line 1725 "awkgram.y" +#line 1726 "awkgram.y" { char *var_name = (yyvsp[(1) - (1)])->lextok; @@ -4025,7 +4026,7 @@ regular_print: case 175: /* Line 1787 of yacc.c */ -#line 1733 "awkgram.y" +#line 1734 "awkgram.y" { char *arr = (yyvsp[(1) - (2)])->lextok; (yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) - (2)])->source_line, arr, Node_var_new); @@ -4036,7 +4037,7 @@ regular_print: case 176: /* Line 1787 of yacc.c */ -#line 1743 "awkgram.y" +#line 1744 "awkgram.y" { INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti; if (ip->opcode == Op_push @@ -4052,7 +4053,7 @@ regular_print: case 177: /* Line 1787 of yacc.c */ -#line 1755 "awkgram.y" +#line 1756 "awkgram.y" { (yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)])); if ((yyvsp[(3) - (3)]) != NULL) @@ -4062,7 +4063,7 @@ regular_print: case 178: /* Line 1787 of yacc.c */ -#line 1764 "awkgram.y" +#line 1765 "awkgram.y" { (yyvsp[(1) - (1)])->opcode = Op_postincrement; } @@ -4070,7 +4071,7 @@ regular_print: case 179: /* Line 1787 of yacc.c */ -#line 1768 "awkgram.y" +#line 1769 "awkgram.y" { (yyvsp[(1) - (1)])->opcode = Op_postdecrement; } @@ -4078,43 +4079,43 @@ regular_print: case 180: /* Line 1787 of yacc.c */ -#line 1771 "awkgram.y" +#line 1772 "awkgram.y" { (yyval) = NULL; } break; case 182: /* Line 1787 of yacc.c */ -#line 1779 "awkgram.y" +#line 1780 "awkgram.y" { yyerrok; } break; case 183: /* Line 1787 of yacc.c */ -#line 1783 "awkgram.y" +#line 1784 "awkgram.y" { yyerrok; } break; case 186: /* Line 1787 of yacc.c */ -#line 1792 "awkgram.y" +#line 1793 "awkgram.y" { yyerrok; } break; case 187: /* Line 1787 of yacc.c */ -#line 1796 "awkgram.y" +#line 1797 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); yyerrok; } break; case 188: /* Line 1787 of yacc.c */ -#line 1800 "awkgram.y" +#line 1801 "awkgram.y" { yyerrok; } break; /* Line 1787 of yacc.c */ -#line 4118 "awkgram.c" +#line 4119 "awkgram.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4346,7 +4347,7 @@ yyreturn: /* Line 2050 of yacc.c */ -#line 1802 "awkgram.y" +#line 1803 "awkgram.y" struct token { @@ -4819,7 +4820,7 @@ parse_program(INSTRUCTION **pcode) ip_newfile = ip_rec = ip_atexit = ip_beginfile = ip_endfile = NULL; else { ip_endfile = instruction(Op_no_op); - ip_beginfile = instruction(Op_no_op); + main_beginfile = ip_beginfile = instruction(Op_no_op); ip_rec = instruction(Op_get_record); /* target for `next', also ip_newfile */ ip_newfile = bcalloc(Op_newfile, 2, 0); /* target for `nextfile' */ ip_newfile->target_jmp = ip_end; diff --git a/awkgram.y b/awkgram.y index f0ff4f0c..ab813543 100644 --- a/awkgram.y +++ b/awkgram.y @@ -145,6 +145,7 @@ static INSTRUCTION *ip_atexit = NULL; static INSTRUCTION *ip_end; static INSTRUCTION *ip_endfile; static INSTRUCTION *ip_beginfile; +INSTRUCTION *main_beginfile; static inline INSTRUCTION *list_create(INSTRUCTION *x); static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x); @@ -2271,7 +2272,7 @@ parse_program(INSTRUCTION **pcode) ip_newfile = ip_rec = ip_atexit = ip_beginfile = ip_endfile = NULL; else { ip_endfile = instruction(Op_no_op); - ip_beginfile = instruction(Op_no_op); + main_beginfile = ip_beginfile = instruction(Op_no_op); ip_rec = instruction(Op_get_record); /* target for `next', also ip_newfile */ ip_newfile = bcalloc(Op_newfile, 2, 0); /* target for `nextfile' */ ip_newfile->target_jmp = ip_end; diff --git a/gawkapi.c b/gawkapi.c index 3fc23388..e12e55d5 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -1054,6 +1054,9 @@ api_lookup_file(awk_ext_id_t id, const char *name, size_t namelen) /* api_get_file --- return a handle to an existing or newly opened file */ +extern INSTRUCTION *main_beginfile; +extern int currule; + static const awk_input_buf_t * api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, size_t typelen) { @@ -1065,8 +1068,27 @@ api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *file if (curfile == NULL) { if (nextfile(& curfile, false) <= 0) return NULL; - /* XXX Fix me! */ - fputs("Bug: need to call BEGINFILE!\n", stderr); + { + INSTRUCTION *pc = main_beginfile; + /* save execution state */ + int save_rule = currule; + char *save_source = source; + + while (1) { + if (!pc) + fatal(_("cannot find end of BEGINFILE rule")); + if (pc->opcode == Op_after_beginfile) + break; + pc = pc->nexti; + } + pc->opcode = Op_stop; + (void) (*interpret)(main_beginfile); + pc->opcode = Op_after_beginfile; + after_beginfile(& curfile); + /* restore execution state */ + currule = save_rule; + source = save_source; + } } return &curfile->public; } -- cgit v1.2.3 From d8bd9f5261761dd4ffca331d9c6055c48a0a332b Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 2 Jul 2013 20:52:25 -0400 Subject: Remove unused api_lookup_file hook. --- ChangeLog | 7 +++++++ gawkapi.c | 28 +++++----------------------- gawkapi.h | 13 +------------ 3 files changed, 13 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index c209f335..5d293bf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-07-02 Andrew J. Schorr + + * gawkapi.h (gawk_api): Remove unused api_lookup_file hook. + (lookup_file): Remove associated macro. + * gawkapi.c (api_lookup_file): Remove unused function. + (api_impl): Remove unused api_lookup_file hook. + 2013-07-02 Andrew J. Schorr * awkgram.y (main_beginfile): Declare new global INSTRUCTION *. diff --git a/gawkapi.c b/gawkapi.c index e12e55d5..ac466249 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -25,7 +25,10 @@ #include "awk.h" -extern IOBUF *curfile; /* required by api_lookup_file and api_get_file */ +/* Declare some globals used by api_get_file: */ +extern IOBUF *curfile; +extern INSTRUCTION *main_beginfile; +extern int currule; static awk_bool_t node_to_awk_value(NODE *node, awk_value_t *result, awk_valtype_t wanted); @@ -1035,28 +1038,8 @@ api_release_value(awk_ext_id_t id, awk_value_cookie_t value) return true; } -/* api_lookup_file --- return a handle to an open file */ - -static const awk_input_buf_t * -api_lookup_file(awk_ext_id_t id, const char *name, size_t namelen) -{ - const struct redirect *f; - - if ((name == NULL) || (namelen == 0)) { - if (curfile == NULL) - return NULL; - return &curfile->public; - } - if ((f = getredirect(name, namelen)) == NULL) - return NULL; - return &f->iop->public; -} - /* api_get_file --- return a handle to an existing or newly opened file */ -extern INSTRUCTION *main_beginfile; -extern int currule; - static const awk_input_buf_t * api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, size_t typelen) { @@ -1215,8 +1198,7 @@ gawk_api_t api_impl = { api_flatten_array, api_release_flattened_array, - /* Find/get open files */ - api_lookup_file, + /* Find/open a file */ api_get_file, }; diff --git a/gawkapi.h b/gawkapi.h index 81217009..687147e3 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -667,15 +667,7 @@ typedef struct gawk_api { awk_flat_array_t *data); /* - * Look up a currently open file. If the name is NULL, it returns - * data for the currently open input file corresponding to FILENAME. - * If the file is not found, it returns NULL. - */ - const awk_input_buf_t *(*api_lookup_file)(awk_ext_id_t id, - const char *name, - size_t name_len); - /* - * Look up a file. If the name is NULL, it returns + * Look up a file. If the name is NULL or name_len is 0, it returns * data for the currently open input file corresponding to FILENAME. * If the file is not already open, it tries to open it. * The "filetype" argument should be one of: @@ -763,9 +755,6 @@ typedef struct gawk_api { #define release_value(value) \ (api->api_release_value(ext_id, value)) -#define lookup_file(name, namelen) \ - (api->api_lookup_file(ext_id, name, namelen)) - #define get_file(name, namelen, filetype, typelen) \ (api->api_get_file(ext_id, name, namelen, filetype, typelen)) -- cgit v1.2.3 From ad5c8d1f818c96579fa9e7f3c691739e9761e1e7 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 4 Jul 2013 16:26:51 -0400 Subject: Revert incorrect patch to wait_any and instead use waitpid to avoid blocking. --- ChangeLog | 10 ++++++++++ configh.in | 3 +++ configure | 2 +- configure.ac | 2 +- io.c | 20 ++++++++++++++++---- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d293bf8..a692e5b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-07-04 Andrew J. Schorr + + * configure.ac (AC_CHECK_FUNCS): Add a check for waitpid. + * io.c (wait_any): Enhance comment to explain why we loop reaping all + exited children when the argument is zero. When available, use waitpid + with WNOHANG to avoid blocking. Remove my previous incorrect patch to + exit after reaping the first child. The function is intended to + wait for all children, since we are not careful about reaping children + as soon as they die. + 2013-07-02 Andrew J. Schorr * gawkapi.h (gawk_api): Remove unused api_lookup_file hook. diff --git a/configh.in b/configh.in index f6540a45..68d5bf76 100644 --- a/configh.in +++ b/configh.in @@ -296,6 +296,9 @@ /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF +/* Define to 1 if you have the `waitpid' function. */ +#undef HAVE_WAITPID + /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H diff --git a/configure b/configure index 0e5a9303..fccfcea0 100755 --- a/configure +++ b/configure @@ -10020,7 +10020,7 @@ for ac_func in atexit btowc fmod getgrent getgroups grantpt \ memcmp memcpy memcpy_ulong memmove memset \ memset_ulong mkstemp posix_openpt setenv setlocale setsid snprintf strchr \ strerror strftime strncasecmp strcoll strtod strtoul \ - system tmpfile towlower towupper tzset usleep wcrtomb \ + system tmpfile towlower towupper tzset usleep waitpid wcrtomb \ wcscoll wctype do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` diff --git a/configure.ac b/configure.ac index b401cb40..ba242c51 100644 --- a/configure.ac +++ b/configure.ac @@ -276,7 +276,7 @@ AC_CHECK_FUNCS(atexit btowc fmod getgrent getgroups grantpt \ memcmp memcpy memcpy_ulong memmove memset \ memset_ulong mkstemp posix_openpt setenv setlocale setsid snprintf strchr \ strerror strftime strncasecmp strcoll strtod strtoul \ - system tmpfile towlower towupper tzset usleep wcrtomb \ + system tmpfile towlower towupper tzset usleep waitpid wcrtomb \ wcscoll wctype) dnl this check is for both mbrtowc and the mbstate_t type, which is good AC_FUNC_MBRTOWC diff --git a/io.c b/io.c index 0ba36451..42c92e47 100644 --- a/io.c +++ b/io.c @@ -2168,7 +2168,16 @@ use_pipes: #ifndef PIPES_SIMULATED /* real pipes */ -/* wait_any --- wait for a child process, close associated pipe */ +/* + * wait_any --- if the argument pid is 0, wait for all child processes that + * have exited. We loop to make sure to reap all children that have exited to + * minimize the risk of running out of process slots. Since we don't process + * SIGCHLD, we do not immediately reap exited children. So when we get here, + * we want to reap any that have piled up. + * + * Note: on platforms that do not support waitpid with WNOHANG, when called with + * a zero argument, this function will hang until all children have exited. + */ static int wait_any(int interesting) /* pid of interest, if any */ @@ -2198,7 +2207,11 @@ wait_any(int interesting) /* pid of interest, if any */ hstat = signal(SIGHUP, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); for (;;) { -# ifdef HAVE_SYS_WAIT_H /* POSIX compatible sys/wait.h */ +# if defined(HAVE_WAITPID) && defined(WNOHANG) + if ((pid = waitpid(-1, & status, WNOHANG)) == 0) + /* No children have exited */ + break; +# elif defined(HAVE_SYS_WAIT_H) /* POSIX compatible sys/wait.h */ pid = wait(& status); # else pid = wait((union wait *) & status); @@ -2210,13 +2223,12 @@ wait_any(int interesting) /* pid of interest, if any */ if (pid == redp->pid) { redp->pid = -1; redp->status = status; - goto finished; + break; } } if (pid == -1 && errno == ECHILD) break; } -finished: signal(SIGHUP, hstat); signal(SIGQUIT, qstat); #endif -- cgit v1.2.3 From 6b5925f4c303d43228ffe5e37b84d9017d2ff5e3 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 5 Jul 2013 11:46:04 -0400 Subject: Add a kill function to the select extension, and check whether sigprocmask is available. --- extension/ChangeLog | 11 +++++++++ extension/configh.in | 6 +++++ extension/configure | 2 +- extension/configure.ac | 2 +- extension/select.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 77 insertions(+), 7 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index efb38249..49c100e4 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,14 @@ +2013-07-05 Andrew J. Schorr + + * configure.ac (AC_CHECK_FUNCS): Add kill and sigprocmask. + * select.c (get_signal_number): Change error messages since now may + be called by "kill" as well as "select_signal". + (do_signal): Add a lint warning if there are more than 2 args. + (do_kill): Add new function to send a signal. + (do_select): Support platforms where sigprocmask is not available. + There will be a race condition on such platforms, but that is not + easily avoided. + 2013-07-02 Andrew J. Schorr * select.c (do_select): Now that the API flatten_array call has been diff --git a/extension/configh.in b/extension/configh.in index a7212dc1..aa5c71e1 100644 --- a/extension/configh.in +++ b/extension/configh.in @@ -66,6 +66,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `kill' function. */ +#undef HAVE_KILL + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H @@ -84,6 +87,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H +/* Define to 1 if you have the `sigprocmask' function. */ +#undef HAVE_SIGPROCMASK + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H diff --git a/extension/configure b/extension/configure index 02ff3dc8..c9cb9a28 100755 --- a/extension/configure +++ b/extension/configure @@ -14018,7 +14018,7 @@ done for ac_func in fdopendir fnmatch gettimeofday \ - getdtablesize nanosleep select sigaction \ + getdtablesize kill nanosleep select sigaction sigprocmask \ GetSystemTimeAsFileTime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` diff --git a/extension/configure.ac b/extension/configure.ac index 5b95f966..aca856a0 100644 --- a/extension/configure.ac +++ b/extension/configure.ac @@ -71,7 +71,7 @@ AC_CHECK_HEADERS(dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h \ sys/param.h signal.h) AC_CHECK_FUNCS(fdopendir fnmatch gettimeofday \ - getdtablesize nanosleep select sigaction \ + getdtablesize kill nanosleep select sigaction sigprocmask \ GetSystemTimeAsFileTime) GAWK_FUNC_DIRFD diff --git a/extension/select.c b/extension/select.c index 89dbf6c3..261d8ebd 100644 --- a/extension/select.c +++ b/extension/select.c @@ -127,7 +127,7 @@ get_signal_number(awk_value_t signame) case AWK_NUMBER: x = signame.num_value; if ((x != signame.num_value) || ! IS_VALID_SIGNAL(x)) { - update_ERRNO_string(_("select_signal: invalid signal number")); + update_ERRNO_string(_("invalid signal number")); return -1; } return x; @@ -139,10 +139,10 @@ get_signal_number(awk_value_t signame) if ((integer_string(signame.str_value.str, &z) == 0) && IS_VALID_SIGNAL(z)) return z; } - update_ERRNO_string(_("select_signal: invalid signal name")); + update_ERRNO_string(_("invalid signal name")); return -1; default: - update_ERRNO_string(_("select_signal: signal name argument must be string or numeric")); + update_ERRNO_string(_("signal name argument must be string or numeric")); return -1; } } @@ -157,6 +157,8 @@ do_signal(int nargs, awk_value_t *result) int signum; struct sigaction sa; + if (do_lint && nargs > 2) + lintwarn(ext_id, _("select_signal: called with too many arguments")); if (! get_argument(0, AWK_UNDEFINED, & signame)) { update_ERRNO_string(_("select_signal: missing required signal name argument")); return make_number(-1, result); @@ -190,6 +192,43 @@ do_signal(int nargs, awk_value_t *result) #endif } +/* do_kill --- send a signal */ + +static awk_value_t * +do_kill(int nargs, awk_value_t *result) +{ +#ifdef HAVE_KILL + awk_value_t pidarg, signame; + pid_t pid; + int signum; + int rc; + + if (do_lint && nargs > 2) + lintwarn(ext_id, _("kill: called with too many arguments")); + if (! get_argument(0, AWK_NUMBER, & pidarg)) { + update_ERRNO_string(_("kill: missing required pid argument")); + return make_number(-1, result); + } + pid = pidarg.num_value; + if (pid != pidarg.num_value) { + update_ERRNO_string(_("kill: pid argument must be an integer")); + return make_number(-1, result); + } + if (! get_argument(1, AWK_UNDEFINED, & signame)) { + update_ERRNO_string(_("kill: missing required signal name argument")); + return make_number(-1, result); + } + if ((signum = get_signal_number(signame)) < 0) + return make_number(-1, result); + if ((rc = kill(pid, signum)) < 0) + update_ERRNO_int(errno); + return make_number(rc, result); +#else + update_ERRNO_string(_("kill: not supported on this platform")); + return make_number(-1, result); +#endif +} + /* do_select --- I/O multiplexing */ static awk_value_t * @@ -290,13 +329,26 @@ do_select(int nargs, awk_value_t *result) if (dosig && caught.flag) { int i; - sigset_t set, oldset, trapped; + sigset_t trapped; +#ifdef HAVE_SIGPROCMASK + /* + * Block signals while we copy and reset the mask to eliminate + * a race condition whereby a signal could be missed. + */ + sigset_t set, oldset; sigfillset(& set); sigprocmask(SIG_SETMASK, &set, &oldset); +#endif + /* + * Reset flag to 0 first. If we don't have sigprocmask, + * that may reduce the chance of missing a signal. + */ + caught.flag = 0; trapped = caught.mask; sigemptyset(& caught.mask); - caught.flag = 0; +#ifdef HAVE_SIGPROCMASK sigprocmask(SIG_SETMASK, &oldset, NULL); +#endif /* populate sigarr with trapped signals */ /* * XXX this is very inefficient! Note that get_signal_number @@ -391,6 +443,7 @@ static awk_ext_func_t func_table[] = { { "select", do_select, 5 }, { "select_signal", do_signal, 2 }, { "set_non_blocking", do_set_non_blocking, 2 }, + { "kill", do_kill, 2 }, }; /* define the dl_load function using the boilerplate macro */ -- cgit v1.2.3 From fe3ad49e37792999b36f1e590974a19a92b7f388 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 5 Jul 2013 17:11:13 -0400 Subject: For select extension signal trapping, fall back to signal if sigaction is unavailable. --- extension/ChangeLog | 5 +++++ extension/select.c | 32 +++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 49c100e4..4108f74c 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2013-07-05 Andrew J. Schorr + + * select.c (do_signal): If sigaction is unavailable, fall back to + signal and hope that it does the right thing. + 2013-07-05 Andrew J. Schorr * configure.ac (AC_CHECK_FUNCS): Add kill and sigprocmask. diff --git a/extension/select.c b/extension/select.c index 261d8ebd..44b60d50 100644 --- a/extension/select.c +++ b/extension/select.c @@ -152,10 +152,9 @@ get_signal_number(awk_value_t signame) static awk_value_t * do_signal(int nargs, awk_value_t *result) { -#ifdef HAVE_SIGACTION awk_value_t signame, disposition; int signum; - struct sigaction sa; + void (*func)(int); if (do_lint && nargs > 2) lintwarn(ext_id, _("select_signal: called with too many arguments")); @@ -170,25 +169,36 @@ do_signal(int nargs, awk_value_t *result) return make_number(-1, result); } if (strcasecmp(disposition.str_value.str, "default") == 0) - sa.sa_handler = SIG_DFL; + func = SIG_DFL; else if (strcasecmp(disposition.str_value.str, "ignore") == 0) - sa.sa_handler = SIG_IGN; + func = SIG_IGN; else if (strcasecmp(disposition.str_value.str, "trap") == 0) - sa.sa_handler = signal_handler; + func = signal_handler; else { update_ERRNO_string(_("select_signal: invalid disposition argument")); return make_number(-1, result); } - sigfillset(& sa.sa_mask); /* block all signals in handler */ - sa.sa_flags = SA_RESTART; - if (sigaction(signum, &sa, NULL) < 0) { +#ifdef HAVE_SIGACTION + { + int rc; + struct sigaction sa; + sa.sa_handler = func; + sigfillset(& sa.sa_mask); /* block all signals in handler */ + sa.sa_flags = SA_RESTART; + if ((rc = sigaction(signum, &sa, NULL)) < 0) + update_ERRNO_int(errno); + return make_number(rc, result); + } +#else + /* + * Fall back to signal; this is available on all platforms. We can + * only hope that it does the right thing. + */ + if (signal(signum, func) == SIG_ERR) { update_ERRNO_int(errno); return make_number(-1, result); } return make_number(0, result); -#else - update_ERRNO_string(_("select_signal: not supported on this platform")); - return make_number(-1, result); #endif } -- cgit v1.2.3 From 633bbb9f481cd72edb7c419941a366d0efbf88b6 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 5 Jul 2013 20:44:49 -0400 Subject: Patch the select extension set_non_blocking function to work with a single "" argument. --- ChangeLog | 5 +++++ extension/ChangeLog | 6 ++++++ extension/select.c | 20 +++++++++++++++----- gawkapi.h | 4 +++- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a692e5b1..8fc992d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-07-05 Andrew J. Schorr + + * gawkapi.h (gawk_api): Document that the api_get_file function will not + access the file type and length arguments if the file name is empty. + 2013-07-04 Andrew J. Schorr * configure.ac (AC_CHECK_FUNCS): Add a check for waitpid. diff --git a/extension/ChangeLog b/extension/ChangeLog index 4108f74c..68ba6fe2 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2013-07-05 Andrew J. Schorr + + * select.c (set_non_blocking): Do not attempt F_SETFL if F_GETFL fails. + (do_set_non_blocking): Add support for case when called with a single + "" argument. + 2013-07-05 Andrew J. Schorr * select.c (do_signal): If sigaction is unavailable, fall back to diff --git a/extension/select.c b/extension/select.c index 44b60d50..4d28457d 100644 --- a/extension/select.c +++ b/extension/select.c @@ -413,11 +413,14 @@ do_select(int nargs, awk_value_t *result) static int set_non_blocking(int fd) { - int flags = fcntl(fd, F_GETFL); - int rc = fcntl(fd, F_SETFL, (flags|O_NONBLOCK)); - if (rc < 0) + int flags; + + if (((flags = fcntl(fd, F_GETFL)) == -1) || + (fcntl(fd, F_SETFL, (flags|O_NONBLOCK)) == -1)) { update_ERRNO_int(errno); - return rc; + return -1; + } + return 0; } /* do_set_non_blocking --- Set a file to be non-blocking */ @@ -430,12 +433,19 @@ do_set_non_blocking(int nargs, awk_value_t *result) if (do_lint && nargs > 2) lintwarn(ext_id, _("set_non_blocking: called with too many arguments")); + /* + * N.B. If called with a single "" arg, we want it to work! In that + * case, the 1st arg is an empty string, and get_argument fails on the + * 2nd arg. Note that API get_file promises not to access the type + * argument if the name argument is an empty string. + */ if (get_argument(0, AWK_NUMBER, & cmd) && (cmd.num_value == (fd = cmd.num_value)) && ! get_argument(1, AWK_STRING, & cmdtype)) return make_number(set_non_blocking(fd), result); else if (get_argument(0, AWK_STRING, & cmd) && - get_argument(1, AWK_STRING, & cmdtype)) { + (get_argument(1, AWK_STRING, & cmdtype) || + (! cmd.str_value.len && (nargs == 1)))) { const awk_input_buf_t *buf; if ((buf = get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len)) != NULL) return make_number(set_non_blocking(buf->fd), result); diff --git a/gawkapi.h b/gawkapi.h index 687147e3..51374d9f 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -668,7 +668,9 @@ typedef struct gawk_api { /* * Look up a file. If the name is NULL or name_len is 0, it returns - * data for the currently open input file corresponding to FILENAME. + * data for the currently open input file corresponding to FILENAME + * (and it will not access the filetype or typelen arguments, so those + * may be undefined). * If the file is not already open, it tries to open it. * The "filetype" argument should be one of: * ">", ">>", "<", "|>", "|<", and "|&" -- cgit v1.2.3 From 88b8c03a11e229b29cd985cabe51cb2ed3c24b55 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 5 Jul 2013 21:41:07 -0400 Subject: Enhance select signal function to return info about previous handler and decide whether to override when it is unknown. --- extension/ChangeLog | 10 ++++++ extension/select.c | 89 ++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 84 insertions(+), 15 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 68ba6fe2..4bfc64d4 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,13 @@ +2013-07-05 Andrew J. Schorr + + * select.c (signal_result): New function to set result string from + signal function and detect when we need to roll back. + (do_signal): Now takes an optional 3rd override argument. Instead + of returning -1 or 0, we now return information about the previously + installed signal handler: default, ignore, trap, or unknown. An + empty string is returned on error. If it is an unknown handler, + and override is not non-zero, we roll back the handler and return "". + 2013-07-05 Andrew J. Schorr * select.c (set_non_blocking): Do not attempt F_SETFL if F_GETFL fails. diff --git a/extension/select.c b/extension/select.c index 4d28457d..3bcef166 100644 --- a/extension/select.c +++ b/extension/select.c @@ -147,6 +147,25 @@ get_signal_number(awk_value_t signame) } } +static awk_value_t * +signal_result(awk_value_t *result, void (*func)(int)) +{ + awk_value_t override; + + if (func == SIG_DFL) + return make_const_string("default", 7, result); + if (func == SIG_IGN) + return make_const_string("ignore", 6, result); + if (func == signal_handler) + return make_const_string("trap", 4, result); + if (get_argument(2, AWK_NUMBER, & override) && override.num_value) + return make_const_string("unknown", 7, result); + /* need to roll it back! */ + update_ERRNO_string(_("select_signal: override not requested for unknown signal handler")); + make_null_string(result); + return NULL; +} + /* do_signal --- trap signals */ static awk_value_t * @@ -156,17 +175,17 @@ do_signal(int nargs, awk_value_t *result) int signum; void (*func)(int); - if (do_lint && nargs > 2) + if (do_lint && nargs > 3) lintwarn(ext_id, _("select_signal: called with too many arguments")); if (! get_argument(0, AWK_UNDEFINED, & signame)) { update_ERRNO_string(_("select_signal: missing required signal name argument")); - return make_number(-1, result); + return make_null_string(result); } if ((signum = get_signal_number(signame)) < 0) - return make_number(-1, result); + return make_null_string(result); if (! get_argument(1, AWK_STRING, & disposition)) { update_ERRNO_string(_("select_signal: missing required signal disposition argument")); - return make_number(-1, result); + return make_null_string(result); } if (strcasecmp(disposition.str_value.str, "default") == 0) func = SIG_DFL; @@ -176,29 +195,69 @@ do_signal(int nargs, awk_value_t *result) func = signal_handler; else { update_ERRNO_string(_("select_signal: invalid disposition argument")); - return make_number(-1, result); + return make_null_string(result); } + +#ifdef HAVE_SIGPROCMASK +/* Temporarily block this signal in case we need to roll back the handler! */ +#define PROTECT \ + sigset_t set, oldset; \ + sigemptyset(& set); \ + sigaddset(& set, signum); \ + sigprocmask(SIG_BLOCK, &set, &oldset); +#define RELEASE sigprocmask(SIG_SETMASK, &oldset, NULL); +#else +/* Brain-damaged platform, so we will have to live with the race condition. */ +#define PROTECT +#define RELEASE +#endif + #ifdef HAVE_SIGACTION { - int rc; - struct sigaction sa; + awk_value_t override; + struct sigaction sa, prev; sa.sa_handler = func; sigfillset(& sa.sa_mask); /* block all signals in handler */ sa.sa_flags = SA_RESTART; - if ((rc = sigaction(signum, &sa, NULL)) < 0) - update_ERRNO_int(errno); - return make_number(rc, result); + { + PROTECT + if (sigaction(signum, &sa, &prev) < 0) { + update_ERRNO_int(errno); + RELEASE + return make_null_string(result); + } + if (signal_result(result, prev.sa_handler)) { + RELEASE + return result; + } + /* roll it back! */ + sigaction(signum, &prev, NULL); + RELEASE + return result; + } } #else /* * Fall back to signal; this is available on all platforms. We can * only hope that it does the right thing. */ - if (signal(signum, func) == SIG_ERR) { - update_ERRNO_int(errno); - return make_number(-1, result); + { + void (*prev)(int); + PROTECT + if ((prev = signal(signum, func)) == SIG_ERR) { + update_ERRNO_int(errno); + RELEASE + return make_null_string(result); + } + if (signal_result(result, prev)) { + RELEASE + return result; + } + /* roll it back! */ + signal(signum, prev); + RELEASE + return result; } - return make_number(0, result); #endif } @@ -461,7 +520,7 @@ do_set_non_blocking(int nargs, awk_value_t *result) static awk_ext_func_t func_table[] = { { "select", do_select, 5 }, - { "select_signal", do_signal, 2 }, + { "select_signal", do_signal, 3 }, { "set_non_blocking", do_set_non_blocking, 2 }, { "kill", do_kill, 2 }, }; -- cgit v1.2.3 From 2376c18714fe197fbf56a19f8271e5f256ec7caf Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 7 Jul 2013 08:58:10 -0400 Subject: In select extension, if lacking sigaction, reset signal handler each time a signal is trapped. --- extension/ChangeLog | 6 ++++++ extension/select.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/extension/ChangeLog b/extension/ChangeLog index 4bfc64d4..244940ec 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2013-07-07 Andrew J. Schorr + + * select.c (signal_handler): On platforms lacking sigaction, reset + the signal handler each time a signal is trapped to protect in case + the system resets it to default. + 2013-07-05 Andrew J. Schorr * select.c (signal_result): New function to set result string from diff --git a/extension/select.c b/extension/select.c index 3bcef166..072a562f 100644 --- a/extension/select.c +++ b/extension/select.c @@ -107,6 +107,15 @@ signal_handler(int signum) */ sigaddset(& caught.mask, signum); caught.flag = 1; +#ifndef HAVE_SIGACTION + /* + * On platforms without sigaction, we do not know how the legacy + * signal API will behave. There does not appear to be an autoconf + * test for whether the signal handler is reset to default each time + * a signal is trapped, so we do this to be safe. + */ + signal(signum, signal_handler); +#endif } static int -- cgit v1.2.3 From faf3affc19f760a330153b22a8e56fc9a13a0cb6 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 7 Jul 2013 12:57:40 -0400 Subject: In io.c:wait_any, use sigprocmask if available. --- ChangeLog | 6 ++++++ configh.in | 3 +++ configure | 3 ++- configure.ac | 3 ++- io.c | 27 ++++++++++++++++++++++++++- 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8fc992d3..9bdbf836 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-07-07 Andrew J. Schorr + + * configure.ac (AC_CHECK_FUNCS): Check for sigprocmask. + * io.c (wait_any): If sigprocmask is available, block signals instead + of ignoring them temporarily. + 2013-07-05 Andrew J. Schorr * gawkapi.h (gawk_api): Document that the api_get_file function will not diff --git a/configh.in b/configh.in index 68d5bf76..999e5db5 100644 --- a/configh.in +++ b/configh.in @@ -171,6 +171,9 @@ /* Define to 1 if you have the `setsid' function. */ #undef HAVE_SETSID +/* Define to 1 if you have the `sigprocmask' function. */ +#undef HAVE_SIGPROCMASK + /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF diff --git a/configure b/configure index fccfcea0..62f0413d 100755 --- a/configure +++ b/configure @@ -10018,7 +10018,8 @@ esac for ac_func in atexit btowc fmod getgrent getgroups grantpt \ isascii iswctype iswlower iswupper mbrlen \ memcmp memcpy memcpy_ulong memmove memset \ - memset_ulong mkstemp posix_openpt setenv setlocale setsid snprintf strchr \ + memset_ulong mkstemp posix_openpt setenv setlocale setsid sigprocmask \ + snprintf strchr \ strerror strftime strncasecmp strcoll strtod strtoul \ system tmpfile towlower towupper tzset usleep waitpid wcrtomb \ wcscoll wctype diff --git a/configure.ac b/configure.ac index ba242c51..9f2878b0 100644 --- a/configure.ac +++ b/configure.ac @@ -274,7 +274,8 @@ esac AC_CHECK_FUNCS(atexit btowc fmod getgrent getgroups grantpt \ isascii iswctype iswlower iswupper mbrlen \ memcmp memcpy memcpy_ulong memmove memset \ - memset_ulong mkstemp posix_openpt setenv setlocale setsid snprintf strchr \ + memset_ulong mkstemp posix_openpt setenv setlocale setsid sigprocmask \ + snprintf strchr \ strerror strftime strncasecmp strcoll strtod strtoul \ system tmpfile towlower towupper tzset usleep waitpid wcrtomb \ wcscoll wctype) diff --git a/io.c b/io.c index 42c92e47..01dc7cbe 100644 --- a/io.c +++ b/io.c @@ -2177,17 +2177,34 @@ use_pipes: * * Note: on platforms that do not support waitpid with WNOHANG, when called with * a zero argument, this function will hang until all children have exited. + * + * AJS, 2013-07-07: I do not see why we need to ignore signals during this + * function. This function just waits and updates the pid and status fields. + * I don't see why that should interfere with any signal handlers. But I am + * reluctant to remove this protection. So I changed to use sigprocmask to + * block signals instead to avoid interfering with installed signal handlers. */ static int wait_any(int interesting) /* pid of interest, if any */ { - RETSIGTYPE (*hstat)(int), (*istat)(int), (*qstat)(int); int pid; int status = 0; struct redirect *redp; +#ifdef HAVE_SIGPROCMASK + sigset_t set, oldset; + + /* I have no idea why we are blocking signals during this function... */ + sigemptyset(& set); + sigaddset(& set, SIGINT); + sigaddset(& set, SIGHUP); + sigaddset(& set, SIGQUIT); + sigprocmask(SIG_BLOCK, & set, & oldset); +#else + RETSIGTYPE (*hstat)(int), (*istat)(int), (*qstat)(int); istat = signal(SIGINT, SIG_IGN); +#endif #ifdef __MINGW32__ if (interesting < 0) { status = -1; @@ -2204,8 +2221,10 @@ wait_any(int interesting) /* pid of interest, if any */ } } #else +#ifndef HAVE_SIGPROCMASK hstat = signal(SIGHUP, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); +#endif for (;;) { # if defined(HAVE_WAITPID) && defined(WNOHANG) if ((pid = waitpid(-1, & status, WNOHANG)) == 0) @@ -2229,10 +2248,16 @@ wait_any(int interesting) /* pid of interest, if any */ if (pid == -1 && errno == ECHILD) break; } +#ifndef HAVE_SIGPROCMASK signal(SIGHUP, hstat); signal(SIGQUIT, qstat); #endif +#endif +#ifndef HAVE_SIGPROCMASK signal(SIGINT, istat); +#else + sigprocmask(SIG_SETMASK, & oldset, NULL); +#endif return status; } -- cgit v1.2.3 From 69b59a73db108ede65e4dfce90fcfb10723e1feb Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 7 Jul 2013 13:18:41 -0400 Subject: Patch the select extension's set_non_blocking function to check that fcntl and O_NONBLOCK are available. --- extension/ChangeLog | 6 ++++++ extension/configh.in | 3 +++ extension/configure | 2 +- extension/configure.ac | 2 +- extension/select.c | 5 +++++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 244940ec..76427971 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2013-07-07 Andrew J. Schorr + + * configure.ac (AC_CHECK_FUNCS): Check for fcntl. + * select.c (set_non_blocking): Check that fcntl and O_NONBLOCK are + available. + 2013-07-07 Andrew J. Schorr * select.c (signal_handler): On platforms lacking sigaction, reset diff --git a/extension/configh.in b/extension/configh.in index aa5c71e1..847a5193 100644 --- a/extension/configh.in +++ b/extension/configh.in @@ -39,6 +39,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `fcntl' function. */ +#undef HAVE_FCNTL + /* Define to 1 if you have the `fdopendir' function. */ #undef HAVE_FDOPENDIR diff --git a/extension/configure b/extension/configure index c9cb9a28..efae5568 100755 --- a/extension/configure +++ b/extension/configure @@ -14017,7 +14017,7 @@ fi done -for ac_func in fdopendir fnmatch gettimeofday \ +for ac_func in fcntl fdopendir fnmatch gettimeofday \ getdtablesize kill nanosleep select sigaction sigprocmask \ GetSystemTimeAsFileTime do : diff --git a/extension/configure.ac b/extension/configure.ac index aca856a0..9571f8db 100644 --- a/extension/configure.ac +++ b/extension/configure.ac @@ -70,7 +70,7 @@ AC_HEADER_MAJOR AC_CHECK_HEADERS(dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h \ sys/param.h signal.h) -AC_CHECK_FUNCS(fdopendir fnmatch gettimeofday \ +AC_CHECK_FUNCS(fcntl fdopendir fnmatch gettimeofday \ getdtablesize kill nanosleep select sigaction sigprocmask \ GetSystemTimeAsFileTime) diff --git a/extension/select.c b/extension/select.c index 072a562f..9aefaeac 100644 --- a/extension/select.c +++ b/extension/select.c @@ -481,6 +481,7 @@ do_select(int nargs, awk_value_t *result) static int set_non_blocking(int fd) { +#if defined(HAVE_FCNTL) && defined(O_NONBLOCK) int flags; if (((flags = fcntl(fd, F_GETFL)) == -1) || @@ -489,6 +490,10 @@ set_non_blocking(int fd) return -1; } return 0; +#else + update_ERRNO_string(_("set_non_blocking: not supported on this platform")); + return -1; +#endif } /* do_set_non_blocking --- Set a file to be non-blocking */ -- cgit v1.2.3 From cb9faa8c276efc4e2b24378bdb941d007523fc22 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 14 Oct 2014 21:45:21 +0300 Subject: Add new Foreword from Mike Brennan. --- doc/ChangeLog | 4 + doc/gawk.info | 1155 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 59 ++- doc/gawktexi.in | 59 ++- 4 files changed, 712 insertions(+), 565 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index e6c864d7..da2b7cc0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-10-14 Arnold D. Robbins + + * gawktexi.in: Add new Foreword from Mike Brennan. + 2014-10-13 Arnold D. Robbins * gawktexi.in: Fix example outputs in chapter 2. diff --git a/doc/gawk.info b/doc/gawk.info index 94170939..fd3e19db 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -29,7 +29,7 @@ entitled "GNU Free Documentation License". modify this GNU manual."  -File: gawk.info, Node: Top, Next: Foreword, Up: (dir) +File: gawk.info, Node: Top, Next: Foreword3, Up: (dir) General Introduction ******************** @@ -58,8 +58,9 @@ entitled "GNU Free Documentation License". * Menu: -* Foreword:: Some nice words about this +* Foreword3:: Some nice words about this Info file. +* Foreword4:: More nice words. * Preface:: What this Info file is about; brief history and acknowledgments. * Getting Started:: A basic introduction to using @@ -679,10 +680,10 @@ your life together with me. lives in innumerable ways.  -File: gawk.info, Node: Foreword, Next: Preface, Prev: Top, Up: Top +File: gawk.info, Node: Foreword3, Next: Foreword4, Prev: Top, Up: Top -Foreword -******** +Foreword to the Third Edition +***************************** Arnold Robbins and I are good friends. We were introduced in 1990 by circumstances--and our favorite programming language, AWK. The @@ -766,7 +767,41 @@ want to learn how, then read this book. March, 2001  -File: gawk.info, Node: Preface, Next: Getting Started, Prev: Foreword, Up: Top +File: gawk.info, Node: Foreword4, Next: Preface, Prev: Foreword3, Up: Top + +Foreword to the Fourth Edition +****************************** + +Some things don't change. Thirteen years ago I wrote: "If you use AWK +or want to learn how, then read this book." True then and still true +today. + + Learning to use a programming language is more than mastering the +syntax. One needs to acquire an understanding of how to use the +features of the language to solve practical programming problems. A +focus of this book is many examples that show how to use AWK. + + Some things do change. Our computers are much faster and have more +memory. Consequently, speed and storage inefficiencies of a high level +language matter less. Prototyping in AWK and then rewriting in C for +performance reasons happens less, because more often the prototype is +fast enough. + + Of course, there are computing operations that are best done in C or +C++. With `gawk' 4.1 and later, you do not have to choose between +writing your program in AWK or in C/C++. You can write most of your +program in AWK and the aspects that require C/C++ capabilities can be +written in C/C++ and then the pieces glued together when the `gawk' +module loads the C/C++ module as a dynamic plug-in. *note Dynamic +Extensions::, has all the details, and as expected, many examples to +help you learn the ins and outs. + + Michael Brennan + Author of `mawk' + October, 2014 + + +File: gawk.info, Node: Preface, Next: Getting Started, Prev: Foreword4, Up: Top Preface ******* @@ -31786,7 +31821,8 @@ Index * Brennan, Michael <2>: Simple Sed. (line 25) * Brennan, Michael <3>: Delete. (line 56) * Brennan, Michael <4>: Acknowledgments. (line 78) -* Brennan, Michael: Foreword. (line 83) +* Brennan, Michael <5>: Foreword4. (line 30) +* Brennan, Michael: Foreword3. (line 83) * 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 491) @@ -34232,557 +34268,558 @@ Index  Tag Table: Node: Top1204 -Node: Foreword42103 -Node: Preface46450 -Ref: Preface-Footnote-149320 -Ref: Preface-Footnote-249427 -Ref: Preface-Footnote-349660 -Node: History49802 -Node: Names52150 -Ref: Names-Footnote-153244 -Node: This Manual53390 -Ref: This Manual-Footnote-159219 -Node: Conventions59319 -Node: Manual History61659 -Ref: Manual History-Footnote-164650 -Ref: Manual History-Footnote-264691 -Node: How To Contribute64765 -Node: Acknowledgments66004 -Node: Getting Started70812 -Node: Running gawk73246 -Node: One-shot74436 -Node: Read Terminal75661 -Node: Long77688 -Node: Executable Scripts79204 -Ref: Executable Scripts-Footnote-181993 -Node: Comments82095 -Node: Quoting84568 -Node: DOS Quoting90074 -Node: Sample Data Files90749 -Node: Very Simple93342 -Node: Two Rules98233 -Node: More Complex100119 -Node: Statements/Lines102981 -Ref: Statements/Lines-Footnote-1107437 -Node: Other Features107702 -Node: When108633 -Ref: When-Footnote-1110389 -Node: Intro Summary110454 -Node: Invoking Gawk111337 -Node: Command Line112852 -Node: Options113643 -Ref: Options-Footnote-1129538 -Node: Other Arguments129563 -Node: Naming Standard Input132524 -Node: Environment Variables133617 -Node: AWKPATH Variable134175 -Ref: AWKPATH Variable-Footnote-1137027 -Ref: AWKPATH Variable-Footnote-2137072 -Node: AWKLIBPATH Variable137332 -Node: Other Environment Variables138091 -Node: Exit Status141811 -Node: Include Files142486 -Node: Loading Shared Libraries146074 -Node: Obsolete147501 -Node: Undocumented148198 -Node: Invoking Summary148465 -Node: Regexp150131 -Node: Regexp Usage151590 -Node: Escape Sequences153623 -Node: Regexp Operators159640 -Ref: Regexp Operators-Footnote-1167074 -Ref: Regexp Operators-Footnote-2167221 -Node: Bracket Expressions167319 -Ref: table-char-classes169336 -Node: Leftmost Longest172276 -Node: Computed Regexps173578 -Node: GNU Regexp Operators176975 -Node: Case-sensitivity180677 -Ref: Case-sensitivity-Footnote-1183567 -Ref: Case-sensitivity-Footnote-2183802 -Node: Regexp Summary183910 -Node: Reading Files185379 -Node: Records187473 -Node: awk split records188205 -Node: gawk split records193119 -Ref: gawk split records-Footnote-1197658 -Node: Fields197695 -Ref: Fields-Footnote-1200493 -Node: Nonconstant Fields200579 -Ref: Nonconstant Fields-Footnote-1202815 -Node: Changing Fields203017 -Node: Field Separators208949 -Node: Default Field Splitting211653 -Node: Regexp Field Splitting212770 -Node: Single Character Fields216120 -Node: Command Line Field Separator217179 -Node: Full Line Fields220391 -Ref: Full Line Fields-Footnote-1220899 -Node: Field Splitting Summary220945 -Ref: Field Splitting Summary-Footnote-1224076 -Node: Constant Size224177 -Node: Splitting By Content228783 -Ref: Splitting By Content-Footnote-1232856 -Node: Multiple Line232896 -Ref: Multiple Line-Footnote-1238785 -Node: Getline238964 -Node: Plain Getline241175 -Node: Getline/Variable243815 -Node: Getline/File244962 -Node: Getline/Variable/File246346 -Ref: Getline/Variable/File-Footnote-1247947 -Node: Getline/Pipe248034 -Node: Getline/Variable/Pipe250717 -Node: Getline/Coprocess251848 -Node: Getline/Variable/Coprocess253100 -Node: Getline Notes253839 -Node: Getline Summary256631 -Ref: table-getline-variants257043 -Node: Read Timeout257872 -Ref: Read Timeout-Footnote-1261686 -Node: Command-line directories261744 -Node: Input Summary262648 -Node: Input Exercises265900 -Node: Printing266628 -Node: Print268405 -Node: Print Examples269862 -Node: Output Separators272641 -Node: OFMT274659 -Node: Printf276013 -Node: Basic Printf276798 -Node: Control Letters278369 -Node: Format Modifiers282353 -Node: Printf Examples288360 -Node: Redirection290842 -Node: Special FD297681 -Ref: Special FD-Footnote-1300838 -Node: Special Files300912 -Node: Other Inherited Files301528 -Node: Special Network302528 -Node: Special Caveats303389 -Node: Close Files And Pipes304340 -Ref: Close Files And Pipes-Footnote-1311519 -Ref: Close Files And Pipes-Footnote-2311667 -Node: Output Summary311817 -Node: Output Exercises312813 -Node: Expressions313493 -Node: Values314678 -Node: Constants315354 -Node: Scalar Constants316034 -Ref: Scalar Constants-Footnote-1316893 -Node: Nondecimal-numbers317143 -Node: Regexp Constants320143 -Node: Using Constant Regexps320668 -Node: Variables323806 -Node: Using Variables324461 -Node: Assignment Options326371 -Node: Conversion328246 -Node: Strings And Numbers328770 -Ref: Strings And Numbers-Footnote-1331834 -Node: Locale influences conversions331943 -Ref: table-locale-affects334688 -Node: All Operators335276 -Node: Arithmetic Ops335906 -Node: Concatenation338411 -Ref: Concatenation-Footnote-1341230 -Node: Assignment Ops341336 -Ref: table-assign-ops346319 -Node: Increment Ops347597 -Node: Truth Values and Conditions351035 -Node: Truth Values352118 -Node: Typing and Comparison353167 -Node: Variable Typing353960 -Node: Comparison Operators357612 -Ref: table-relational-ops358022 -Node: POSIX String Comparison361537 -Ref: POSIX String Comparison-Footnote-1362609 -Node: Boolean Ops362747 -Ref: Boolean Ops-Footnote-1367226 -Node: Conditional Exp367317 -Node: Function Calls369044 -Node: Precedence372924 -Node: Locales376592 -Node: Expressions Summary378223 -Node: Patterns and Actions380797 -Node: Pattern Overview381917 -Node: Regexp Patterns383596 -Node: Expression Patterns384139 -Node: Ranges387919 -Node: BEGIN/END391025 -Node: Using BEGIN/END391787 -Ref: Using BEGIN/END-Footnote-1394524 -Node: I/O And BEGIN/END394630 -Node: BEGINFILE/ENDFILE396944 -Node: Empty399845 -Node: Using Shell Variables400162 -Node: Action Overview402438 -Node: Statements404765 -Node: If Statement406613 -Node: While Statement408111 -Node: Do Statement410139 -Node: For Statement411281 -Node: Switch Statement414436 -Node: Break Statement416824 -Node: Continue Statement418865 -Node: Next Statement420690 -Node: Nextfile Statement423070 -Node: Exit Statement425700 -Node: Built-in Variables428103 -Node: User-modified429236 -Ref: User-modified-Footnote-1436916 -Node: Auto-set436978 -Ref: Auto-set-Footnote-1450008 -Ref: Auto-set-Footnote-2450213 -Node: ARGC and ARGV450269 -Node: Pattern Action Summary454473 -Node: Arrays456900 -Node: Array Basics458229 -Node: Array Intro459073 -Ref: figure-array-elements461037 -Ref: Array Intro-Footnote-1463561 -Node: Reference to Elements463689 -Node: Assigning Elements466139 -Node: Array Example466630 -Node: Scanning an Array468388 -Node: Controlling Scanning471404 -Ref: Controlling Scanning-Footnote-1476593 -Node: Numeric Array Subscripts476909 -Node: Uninitialized Subscripts479094 -Node: Delete480711 -Ref: Delete-Footnote-1483455 -Node: Multidimensional483512 -Node: Multiscanning486607 -Node: Arrays of Arrays488196 -Node: Arrays Summary492957 -Node: Functions495062 -Node: Built-in495935 -Node: Calling Built-in497013 -Node: Numeric Functions499001 -Ref: Numeric Functions-Footnote-1503023 -Ref: Numeric Functions-Footnote-2503380 -Ref: Numeric Functions-Footnote-3503428 -Node: String Functions503697 -Ref: String Functions-Footnote-1527169 -Ref: String Functions-Footnote-2527298 -Ref: String Functions-Footnote-3527546 -Node: Gory Details527633 -Ref: table-sub-escapes529414 -Ref: table-sub-proposed530934 -Ref: table-posix-sub532298 -Ref: table-gensub-escapes533838 -Ref: Gory Details-Footnote-1534670 -Node: I/O Functions534821 -Ref: I/O Functions-Footnote-1541922 -Node: Time Functions542069 -Ref: Time Functions-Footnote-1552538 -Ref: Time Functions-Footnote-2552606 -Ref: Time Functions-Footnote-3552764 -Ref: Time Functions-Footnote-4552875 -Ref: Time Functions-Footnote-5552987 -Ref: Time Functions-Footnote-6553214 -Node: Bitwise Functions553480 -Ref: table-bitwise-ops554042 -Ref: Bitwise Functions-Footnote-1558350 -Node: Type Functions558519 -Node: I18N Functions559668 -Node: User-defined561313 -Node: Definition Syntax562117 -Ref: Definition Syntax-Footnote-1567523 -Node: Function Example567592 -Ref: Function Example-Footnote-1570509 -Node: Function Caveats570531 -Node: Calling A Function571049 -Node: Variable Scope572004 -Node: Pass By Value/Reference574992 -Node: Return Statement578502 -Node: Dynamic Typing581486 -Node: Indirect Calls582415 -Ref: Indirect Calls-Footnote-1593719 -Node: Functions Summary593847 -Node: Library Functions596546 -Ref: Library Functions-Footnote-1600164 -Ref: Library Functions-Footnote-2600307 -Node: Library Names600478 -Ref: Library Names-Footnote-1603938 -Ref: Library Names-Footnote-2604158 -Node: General Functions604244 -Node: Strtonum Function605347 -Node: Assert Function608367 -Node: Round Function611691 -Node: Cliff Random Function613232 -Node: Ordinal Functions614248 -Ref: Ordinal Functions-Footnote-1617313 -Ref: Ordinal Functions-Footnote-2617565 -Node: Join Function617776 -Ref: Join Function-Footnote-1619547 -Node: Getlocaltime Function619747 -Node: Readfile Function623488 -Node: Shell Quoting625458 -Node: Data File Management626859 -Node: Filetrans Function627491 -Node: Rewind Function631550 -Node: File Checking632935 -Ref: File Checking-Footnote-1634263 -Node: Empty Files634464 -Node: Ignoring Assigns636443 -Node: Getopt Function637994 -Ref: Getopt Function-Footnote-1649454 -Node: Passwd Functions649657 -Ref: Passwd Functions-Footnote-1658508 -Node: Group Functions658596 -Ref: Group Functions-Footnote-1666499 -Node: Walking Arrays666712 -Node: Library Functions Summary668315 -Node: Library Exercises669716 -Node: Sample Programs670996 -Node: Running Examples671766 -Node: Clones672494 -Node: Cut Program673718 -Node: Egrep Program683448 -Ref: Egrep Program-Footnote-1690952 -Node: Id Program691062 -Node: Split Program694706 -Ref: Split Program-Footnote-1698152 -Node: Tee Program698280 -Node: Uniq Program701067 -Node: Wc Program708488 -Ref: Wc Program-Footnote-1712736 -Node: Miscellaneous Programs712828 -Node: Dupword Program714041 -Node: Alarm Program716072 -Node: Translate Program720876 -Ref: Translate Program-Footnote-1725440 -Node: Labels Program725710 -Ref: Labels Program-Footnote-1729059 -Node: Word Sorting729143 -Node: History Sorting733213 -Node: Extract Program735049 -Node: Simple Sed742581 -Node: Igawk Program745643 -Ref: Igawk Program-Footnote-1759969 -Ref: Igawk Program-Footnote-2760170 -Ref: Igawk Program-Footnote-3760292 -Node: Anagram Program760407 -Node: Signature Program763469 -Node: Programs Summary764716 -Node: Programs Exercises765909 -Ref: Programs Exercises-Footnote-1770040 -Node: Advanced Features770131 -Node: Nondecimal Data772079 -Node: Array Sorting773669 -Node: Controlling Array Traversal774366 -Ref: Controlling Array Traversal-Footnote-1782697 -Node: Array Sorting Functions782815 -Ref: Array Sorting Functions-Footnote-1786707 -Node: Two-way I/O786901 -Ref: Two-way I/O-Footnote-1791845 -Ref: Two-way I/O-Footnote-2792031 -Node: TCP/IP Networking792113 -Node: Profiling794985 -Node: Advanced Features Summary802529 -Node: Internationalization804462 -Node: I18N and L10N805942 -Node: Explaining gettext806628 -Ref: Explaining gettext-Footnote-1811657 -Ref: Explaining gettext-Footnote-2811841 -Node: Programmer i18n812006 -Ref: Programmer i18n-Footnote-1816872 -Node: Translator i18n816921 -Node: String Extraction817715 -Ref: String Extraction-Footnote-1818846 -Node: Printf Ordering818932 -Ref: Printf Ordering-Footnote-1821718 -Node: I18N Portability821782 -Ref: I18N Portability-Footnote-1824231 -Node: I18N Example824294 -Ref: I18N Example-Footnote-1827094 -Node: Gawk I18N827166 -Node: I18N Summary827804 -Node: Debugger829143 -Node: Debugging830165 -Node: Debugging Concepts830606 -Node: Debugging Terms832463 -Node: Awk Debugging835038 -Node: Sample Debugging Session835930 -Node: Debugger Invocation836450 -Node: Finding The Bug837834 -Node: List of Debugger Commands844309 -Node: Breakpoint Control845641 -Node: Debugger Execution Control849333 -Node: Viewing And Changing Data852697 -Node: Execution Stack856062 -Node: Debugger Info857700 -Node: Miscellaneous Debugger Commands861717 -Node: Readline Support866909 -Node: Limitations867801 -Node: Debugging Summary869898 -Node: Arbitrary Precision Arithmetic871066 -Node: Computer Arithmetic872482 -Ref: table-numeric-ranges876083 -Ref: Computer Arithmetic-Footnote-1876942 -Node: Math Definitions876999 -Ref: table-ieee-formats880286 -Ref: Math Definitions-Footnote-1880890 -Node: MPFR features880995 -Node: FP Math Caution882666 -Ref: FP Math Caution-Footnote-1883716 -Node: Inexactness of computations884085 -Node: Inexact representation885033 -Node: Comparing FP Values886388 -Node: Errors accumulate887461 -Node: Getting Accuracy888894 -Node: Try To Round891553 -Node: Setting precision892452 -Ref: table-predefined-precision-strings893136 -Node: Setting the rounding mode894930 -Ref: table-gawk-rounding-modes895294 -Ref: Setting the rounding mode-Footnote-1898748 -Node: Arbitrary Precision Integers898927 -Ref: Arbitrary Precision Integers-Footnote-1901918 -Node: POSIX Floating Point Problems902067 -Ref: POSIX Floating Point Problems-Footnote-1905943 -Node: Floating point summary905981 -Node: Dynamic Extensions908173 -Node: Extension Intro909725 -Node: Plugin License910991 -Node: Extension Mechanism Outline911788 -Ref: figure-load-extension912216 -Ref: figure-register-new-function913696 -Ref: figure-call-new-function914700 -Node: Extension API Description916686 -Node: Extension API Functions Introduction918136 -Node: General Data Types922972 -Ref: General Data Types-Footnote-1928659 -Node: Memory Allocation Functions928958 -Ref: Memory Allocation Functions-Footnote-1931788 -Node: Constructor Functions931884 -Node: Registration Functions933618 -Node: Extension Functions934303 -Node: Exit Callback Functions936599 -Node: Extension Version String937847 -Node: Input Parsers938497 -Node: Output Wrappers948312 -Node: Two-way processors952828 -Node: Printing Messages955032 -Ref: Printing Messages-Footnote-1956109 -Node: Updating `ERRNO'956261 -Node: Requesting Values957001 -Ref: table-value-types-returned957729 -Node: Accessing Parameters958687 -Node: Symbol Table Access959918 -Node: Symbol table by name960432 -Node: Symbol table by cookie962412 -Ref: Symbol table by cookie-Footnote-1966551 -Node: Cached values966614 -Ref: Cached values-Footnote-1970118 -Node: Array Manipulation970209 -Ref: Array Manipulation-Footnote-1971307 -Node: Array Data Types971346 -Ref: Array Data Types-Footnote-1974003 -Node: Array Functions974095 -Node: Flattening Arrays977949 -Node: Creating Arrays984836 -Node: Extension API Variables989603 -Node: Extension Versioning990239 -Node: Extension API Informational Variables992140 -Node: Extension API Boilerplate993228 -Node: Finding Extensions997044 -Node: Extension Example997604 -Node: Internal File Description998376 -Node: Internal File Ops1002443 -Ref: Internal File Ops-Footnote-11014101 -Node: Using Internal File Ops1014241 -Ref: Using Internal File Ops-Footnote-11016624 -Node: Extension Samples1016897 -Node: Extension Sample File Functions1018421 -Node: Extension Sample Fnmatch1026023 -Node: Extension Sample Fork1027505 -Node: Extension Sample Inplace1028718 -Node: Extension Sample Ord1030393 -Node: Extension Sample Readdir1031229 -Ref: table-readdir-file-types1032085 -Node: Extension Sample Revout1032896 -Node: Extension Sample Rev2way1033487 -Node: Extension Sample Read write array1034228 -Node: Extension Sample Readfile1036167 -Node: Extension Sample Time1037262 -Node: Extension Sample API Tests1038611 -Node: gawkextlib1039102 -Node: Extension summary1041752 -Node: Extension Exercises1045434 -Node: Language History1046156 -Node: V7/SVR3.11047813 -Node: SVR41049994 -Node: POSIX1051439 -Node: BTL1052828 -Node: POSIX/GNU1053562 -Node: Feature History1059131 -Node: Common Extensions1072222 -Node: Ranges and Locales1073546 -Ref: Ranges and Locales-Footnote-11078185 -Ref: Ranges and Locales-Footnote-21078212 -Ref: Ranges and Locales-Footnote-31078446 -Node: Contributors1078667 -Node: History summary1084207 -Node: Installation1085576 -Node: Gawk Distribution1086532 -Node: Getting1087016 -Node: Extracting1087840 -Node: Distribution contents1089482 -Node: Unix Installation1095199 -Node: Quick Installation1095816 -Node: Additional Configuration Options1098247 -Node: Configuration Philosophy1099987 -Node: Non-Unix Installation1102338 -Node: PC Installation1102796 -Node: PC Binary Installation1104122 -Node: PC Compiling1105970 -Ref: PC Compiling-Footnote-11108991 -Node: PC Testing1109096 -Node: PC Using1110272 -Node: Cygwin1114387 -Node: MSYS1115210 -Node: VMS Installation1115708 -Node: VMS Compilation1116500 -Ref: VMS Compilation-Footnote-11117722 -Node: VMS Dynamic Extensions1117780 -Node: VMS Installation Details1119464 -Node: VMS Running1121716 -Node: VMS GNV1124557 -Node: VMS Old Gawk1125291 -Node: Bugs1125761 -Node: Other Versions1129665 -Node: Installation summary1135878 -Node: Notes1136934 -Node: Compatibility Mode1137799 -Node: Additions1138581 -Node: Accessing The Source1139506 -Node: Adding Code1140942 -Node: New Ports1147114 -Node: Derived Files1151596 -Ref: Derived Files-Footnote-11157071 -Ref: Derived Files-Footnote-21157105 -Ref: Derived Files-Footnote-31157701 -Node: Future Extensions1157815 -Node: Implementation Limitations1158421 -Node: Extension Design1159669 -Node: Old Extension Problems1160823 -Ref: Old Extension Problems-Footnote-11162340 -Node: Extension New Mechanism Goals1162397 -Ref: Extension New Mechanism Goals-Footnote-11165757 -Node: Extension Other Design Decisions1165946 -Node: Extension Future Growth1168054 -Node: Old Extension Mechanism1168890 -Node: Notes summary1170652 -Node: Basic Concepts1171838 -Node: Basic High Level1172519 -Ref: figure-general-flow1172791 -Ref: figure-process-flow1173390 -Ref: Basic High Level-Footnote-11176619 -Node: Basic Data Typing1176804 -Node: Glossary1180132 -Node: Copying1205290 -Node: GNU Free Documentation License1242846 -Node: Index1267982 +Node: Foreword342156 +Node: Foreword446548 +Node: Preface47982 +Ref: Preface-Footnote-150853 +Ref: Preface-Footnote-250960 +Ref: Preface-Footnote-351193 +Node: History51335 +Node: Names53683 +Ref: Names-Footnote-154777 +Node: This Manual54923 +Ref: This Manual-Footnote-160752 +Node: Conventions60852 +Node: Manual History63192 +Ref: Manual History-Footnote-166183 +Ref: Manual History-Footnote-266224 +Node: How To Contribute66298 +Node: Acknowledgments67537 +Node: Getting Started72345 +Node: Running gawk74779 +Node: One-shot75969 +Node: Read Terminal77194 +Node: Long79221 +Node: Executable Scripts80737 +Ref: Executable Scripts-Footnote-183526 +Node: Comments83628 +Node: Quoting86101 +Node: DOS Quoting91607 +Node: Sample Data Files92282 +Node: Very Simple94875 +Node: Two Rules99766 +Node: More Complex101652 +Node: Statements/Lines104514 +Ref: Statements/Lines-Footnote-1108970 +Node: Other Features109235 +Node: When110166 +Ref: When-Footnote-1111922 +Node: Intro Summary111987 +Node: Invoking Gawk112870 +Node: Command Line114385 +Node: Options115176 +Ref: Options-Footnote-1131071 +Node: Other Arguments131096 +Node: Naming Standard Input134057 +Node: Environment Variables135150 +Node: AWKPATH Variable135708 +Ref: AWKPATH Variable-Footnote-1138560 +Ref: AWKPATH Variable-Footnote-2138605 +Node: AWKLIBPATH Variable138865 +Node: Other Environment Variables139624 +Node: Exit Status143344 +Node: Include Files144019 +Node: Loading Shared Libraries147607 +Node: Obsolete149034 +Node: Undocumented149731 +Node: Invoking Summary149998 +Node: Regexp151664 +Node: Regexp Usage153123 +Node: Escape Sequences155156 +Node: Regexp Operators161173 +Ref: Regexp Operators-Footnote-1168607 +Ref: Regexp Operators-Footnote-2168754 +Node: Bracket Expressions168852 +Ref: table-char-classes170869 +Node: Leftmost Longest173809 +Node: Computed Regexps175111 +Node: GNU Regexp Operators178508 +Node: Case-sensitivity182210 +Ref: Case-sensitivity-Footnote-1185100 +Ref: Case-sensitivity-Footnote-2185335 +Node: Regexp Summary185443 +Node: Reading Files186912 +Node: Records189006 +Node: awk split records189738 +Node: gawk split records194652 +Ref: gawk split records-Footnote-1199191 +Node: Fields199228 +Ref: Fields-Footnote-1202026 +Node: Nonconstant Fields202112 +Ref: Nonconstant Fields-Footnote-1204348 +Node: Changing Fields204550 +Node: Field Separators210482 +Node: Default Field Splitting213186 +Node: Regexp Field Splitting214303 +Node: Single Character Fields217653 +Node: Command Line Field Separator218712 +Node: Full Line Fields221924 +Ref: Full Line Fields-Footnote-1222432 +Node: Field Splitting Summary222478 +Ref: Field Splitting Summary-Footnote-1225609 +Node: Constant Size225710 +Node: Splitting By Content230316 +Ref: Splitting By Content-Footnote-1234389 +Node: Multiple Line234429 +Ref: Multiple Line-Footnote-1240318 +Node: Getline240497 +Node: Plain Getline242708 +Node: Getline/Variable245348 +Node: Getline/File246495 +Node: Getline/Variable/File247879 +Ref: Getline/Variable/File-Footnote-1249480 +Node: Getline/Pipe249567 +Node: Getline/Variable/Pipe252250 +Node: Getline/Coprocess253381 +Node: Getline/Variable/Coprocess254633 +Node: Getline Notes255372 +Node: Getline Summary258164 +Ref: table-getline-variants258576 +Node: Read Timeout259405 +Ref: Read Timeout-Footnote-1263219 +Node: Command-line directories263277 +Node: Input Summary264181 +Node: Input Exercises267433 +Node: Printing268161 +Node: Print269938 +Node: Print Examples271395 +Node: Output Separators274174 +Node: OFMT276192 +Node: Printf277546 +Node: Basic Printf278331 +Node: Control Letters279902 +Node: Format Modifiers283886 +Node: Printf Examples289893 +Node: Redirection292375 +Node: Special FD299214 +Ref: Special FD-Footnote-1302371 +Node: Special Files302445 +Node: Other Inherited Files303061 +Node: Special Network304061 +Node: Special Caveats304922 +Node: Close Files And Pipes305873 +Ref: Close Files And Pipes-Footnote-1313052 +Ref: Close Files And Pipes-Footnote-2313200 +Node: Output Summary313350 +Node: Output Exercises314346 +Node: Expressions315026 +Node: Values316211 +Node: Constants316887 +Node: Scalar Constants317567 +Ref: Scalar Constants-Footnote-1318426 +Node: Nondecimal-numbers318676 +Node: Regexp Constants321676 +Node: Using Constant Regexps322201 +Node: Variables325339 +Node: Using Variables325994 +Node: Assignment Options327904 +Node: Conversion329779 +Node: Strings And Numbers330303 +Ref: Strings And Numbers-Footnote-1333367 +Node: Locale influences conversions333476 +Ref: table-locale-affects336221 +Node: All Operators336809 +Node: Arithmetic Ops337439 +Node: Concatenation339944 +Ref: Concatenation-Footnote-1342763 +Node: Assignment Ops342869 +Ref: table-assign-ops347852 +Node: Increment Ops349130 +Node: Truth Values and Conditions352568 +Node: Truth Values353651 +Node: Typing and Comparison354700 +Node: Variable Typing355493 +Node: Comparison Operators359145 +Ref: table-relational-ops359555 +Node: POSIX String Comparison363070 +Ref: POSIX String Comparison-Footnote-1364142 +Node: Boolean Ops364280 +Ref: Boolean Ops-Footnote-1368759 +Node: Conditional Exp368850 +Node: Function Calls370577 +Node: Precedence374457 +Node: Locales378125 +Node: Expressions Summary379756 +Node: Patterns and Actions382330 +Node: Pattern Overview383450 +Node: Regexp Patterns385129 +Node: Expression Patterns385672 +Node: Ranges389452 +Node: BEGIN/END392558 +Node: Using BEGIN/END393320 +Ref: Using BEGIN/END-Footnote-1396057 +Node: I/O And BEGIN/END396163 +Node: BEGINFILE/ENDFILE398477 +Node: Empty401378 +Node: Using Shell Variables401695 +Node: Action Overview403971 +Node: Statements406298 +Node: If Statement408146 +Node: While Statement409644 +Node: Do Statement411672 +Node: For Statement412814 +Node: Switch Statement415969 +Node: Break Statement418357 +Node: Continue Statement420398 +Node: Next Statement422223 +Node: Nextfile Statement424603 +Node: Exit Statement427233 +Node: Built-in Variables429636 +Node: User-modified430769 +Ref: User-modified-Footnote-1438449 +Node: Auto-set438511 +Ref: Auto-set-Footnote-1451541 +Ref: Auto-set-Footnote-2451746 +Node: ARGC and ARGV451802 +Node: Pattern Action Summary456006 +Node: Arrays458433 +Node: Array Basics459762 +Node: Array Intro460606 +Ref: figure-array-elements462570 +Ref: Array Intro-Footnote-1465094 +Node: Reference to Elements465222 +Node: Assigning Elements467672 +Node: Array Example468163 +Node: Scanning an Array469921 +Node: Controlling Scanning472937 +Ref: Controlling Scanning-Footnote-1478126 +Node: Numeric Array Subscripts478442 +Node: Uninitialized Subscripts480627 +Node: Delete482244 +Ref: Delete-Footnote-1484988 +Node: Multidimensional485045 +Node: Multiscanning488140 +Node: Arrays of Arrays489729 +Node: Arrays Summary494490 +Node: Functions496595 +Node: Built-in497468 +Node: Calling Built-in498546 +Node: Numeric Functions500534 +Ref: Numeric Functions-Footnote-1504556 +Ref: Numeric Functions-Footnote-2504913 +Ref: Numeric Functions-Footnote-3504961 +Node: String Functions505230 +Ref: String Functions-Footnote-1528702 +Ref: String Functions-Footnote-2528831 +Ref: String Functions-Footnote-3529079 +Node: Gory Details529166 +Ref: table-sub-escapes530947 +Ref: table-sub-proposed532467 +Ref: table-posix-sub533831 +Ref: table-gensub-escapes535371 +Ref: Gory Details-Footnote-1536203 +Node: I/O Functions536354 +Ref: I/O Functions-Footnote-1543455 +Node: Time Functions543602 +Ref: Time Functions-Footnote-1554071 +Ref: Time Functions-Footnote-2554139 +Ref: Time Functions-Footnote-3554297 +Ref: Time Functions-Footnote-4554408 +Ref: Time Functions-Footnote-5554520 +Ref: Time Functions-Footnote-6554747 +Node: Bitwise Functions555013 +Ref: table-bitwise-ops555575 +Ref: Bitwise Functions-Footnote-1559883 +Node: Type Functions560052 +Node: I18N Functions561201 +Node: User-defined562846 +Node: Definition Syntax563650 +Ref: Definition Syntax-Footnote-1569056 +Node: Function Example569125 +Ref: Function Example-Footnote-1572042 +Node: Function Caveats572064 +Node: Calling A Function572582 +Node: Variable Scope573537 +Node: Pass By Value/Reference576525 +Node: Return Statement580035 +Node: Dynamic Typing583019 +Node: Indirect Calls583948 +Ref: Indirect Calls-Footnote-1595252 +Node: Functions Summary595380 +Node: Library Functions598079 +Ref: Library Functions-Footnote-1601697 +Ref: Library Functions-Footnote-2601840 +Node: Library Names602011 +Ref: Library Names-Footnote-1605471 +Ref: Library Names-Footnote-2605691 +Node: General Functions605777 +Node: Strtonum Function606880 +Node: Assert Function609900 +Node: Round Function613224 +Node: Cliff Random Function614765 +Node: Ordinal Functions615781 +Ref: Ordinal Functions-Footnote-1618846 +Ref: Ordinal Functions-Footnote-2619098 +Node: Join Function619309 +Ref: Join Function-Footnote-1621080 +Node: Getlocaltime Function621280 +Node: Readfile Function625021 +Node: Shell Quoting626991 +Node: Data File Management628392 +Node: Filetrans Function629024 +Node: Rewind Function633083 +Node: File Checking634468 +Ref: File Checking-Footnote-1635796 +Node: Empty Files635997 +Node: Ignoring Assigns637976 +Node: Getopt Function639527 +Ref: Getopt Function-Footnote-1650987 +Node: Passwd Functions651190 +Ref: Passwd Functions-Footnote-1660041 +Node: Group Functions660129 +Ref: Group Functions-Footnote-1668032 +Node: Walking Arrays668245 +Node: Library Functions Summary669848 +Node: Library Exercises671249 +Node: Sample Programs672529 +Node: Running Examples673299 +Node: Clones674027 +Node: Cut Program675251 +Node: Egrep Program684981 +Ref: Egrep Program-Footnote-1692485 +Node: Id Program692595 +Node: Split Program696239 +Ref: Split Program-Footnote-1699685 +Node: Tee Program699813 +Node: Uniq Program702600 +Node: Wc Program710021 +Ref: Wc Program-Footnote-1714269 +Node: Miscellaneous Programs714361 +Node: Dupword Program715574 +Node: Alarm Program717605 +Node: Translate Program722409 +Ref: Translate Program-Footnote-1726973 +Node: Labels Program727243 +Ref: Labels Program-Footnote-1730592 +Node: Word Sorting730676 +Node: History Sorting734746 +Node: Extract Program736582 +Node: Simple Sed744114 +Node: Igawk Program747176 +Ref: Igawk Program-Footnote-1761502 +Ref: Igawk Program-Footnote-2761703 +Ref: Igawk Program-Footnote-3761825 +Node: Anagram Program761940 +Node: Signature Program765002 +Node: Programs Summary766249 +Node: Programs Exercises767442 +Ref: Programs Exercises-Footnote-1771573 +Node: Advanced Features771664 +Node: Nondecimal Data773612 +Node: Array Sorting775202 +Node: Controlling Array Traversal775899 +Ref: Controlling Array Traversal-Footnote-1784230 +Node: Array Sorting Functions784348 +Ref: Array Sorting Functions-Footnote-1788240 +Node: Two-way I/O788434 +Ref: Two-way I/O-Footnote-1793378 +Ref: Two-way I/O-Footnote-2793564 +Node: TCP/IP Networking793646 +Node: Profiling796518 +Node: Advanced Features Summary804062 +Node: Internationalization805995 +Node: I18N and L10N807475 +Node: Explaining gettext808161 +Ref: Explaining gettext-Footnote-1813190 +Ref: Explaining gettext-Footnote-2813374 +Node: Programmer i18n813539 +Ref: Programmer i18n-Footnote-1818405 +Node: Translator i18n818454 +Node: String Extraction819248 +Ref: String Extraction-Footnote-1820379 +Node: Printf Ordering820465 +Ref: Printf Ordering-Footnote-1823251 +Node: I18N Portability823315 +Ref: I18N Portability-Footnote-1825764 +Node: I18N Example825827 +Ref: I18N Example-Footnote-1828627 +Node: Gawk I18N828699 +Node: I18N Summary829337 +Node: Debugger830676 +Node: Debugging831698 +Node: Debugging Concepts832139 +Node: Debugging Terms833996 +Node: Awk Debugging836571 +Node: Sample Debugging Session837463 +Node: Debugger Invocation837983 +Node: Finding The Bug839367 +Node: List of Debugger Commands845842 +Node: Breakpoint Control847174 +Node: Debugger Execution Control850866 +Node: Viewing And Changing Data854230 +Node: Execution Stack857595 +Node: Debugger Info859233 +Node: Miscellaneous Debugger Commands863250 +Node: Readline Support868442 +Node: Limitations869334 +Node: Debugging Summary871431 +Node: Arbitrary Precision Arithmetic872599 +Node: Computer Arithmetic874015 +Ref: table-numeric-ranges877616 +Ref: Computer Arithmetic-Footnote-1878475 +Node: Math Definitions878532 +Ref: table-ieee-formats881819 +Ref: Math Definitions-Footnote-1882423 +Node: MPFR features882528 +Node: FP Math Caution884199 +Ref: FP Math Caution-Footnote-1885249 +Node: Inexactness of computations885618 +Node: Inexact representation886566 +Node: Comparing FP Values887921 +Node: Errors accumulate888994 +Node: Getting Accuracy890427 +Node: Try To Round893086 +Node: Setting precision893985 +Ref: table-predefined-precision-strings894669 +Node: Setting the rounding mode896463 +Ref: table-gawk-rounding-modes896827 +Ref: Setting the rounding mode-Footnote-1900281 +Node: Arbitrary Precision Integers900460 +Ref: Arbitrary Precision Integers-Footnote-1903451 +Node: POSIX Floating Point Problems903600 +Ref: POSIX Floating Point Problems-Footnote-1907476 +Node: Floating point summary907514 +Node: Dynamic Extensions909706 +Node: Extension Intro911258 +Node: Plugin License912524 +Node: Extension Mechanism Outline913321 +Ref: figure-load-extension913749 +Ref: figure-register-new-function915229 +Ref: figure-call-new-function916233 +Node: Extension API Description918219 +Node: Extension API Functions Introduction919669 +Node: General Data Types924505 +Ref: General Data Types-Footnote-1930192 +Node: Memory Allocation Functions930491 +Ref: Memory Allocation Functions-Footnote-1933321 +Node: Constructor Functions933417 +Node: Registration Functions935151 +Node: Extension Functions935836 +Node: Exit Callback Functions938132 +Node: Extension Version String939380 +Node: Input Parsers940030 +Node: Output Wrappers949845 +Node: Two-way processors954361 +Node: Printing Messages956565 +Ref: Printing Messages-Footnote-1957642 +Node: Updating `ERRNO'957794 +Node: Requesting Values958534 +Ref: table-value-types-returned959262 +Node: Accessing Parameters960220 +Node: Symbol Table Access961451 +Node: Symbol table by name961965 +Node: Symbol table by cookie963945 +Ref: Symbol table by cookie-Footnote-1968084 +Node: Cached values968147 +Ref: Cached values-Footnote-1971651 +Node: Array Manipulation971742 +Ref: Array Manipulation-Footnote-1972840 +Node: Array Data Types972879 +Ref: Array Data Types-Footnote-1975536 +Node: Array Functions975628 +Node: Flattening Arrays979482 +Node: Creating Arrays986369 +Node: Extension API Variables991136 +Node: Extension Versioning991772 +Node: Extension API Informational Variables993673 +Node: Extension API Boilerplate994761 +Node: Finding Extensions998577 +Node: Extension Example999137 +Node: Internal File Description999909 +Node: Internal File Ops1003976 +Ref: Internal File Ops-Footnote-11015634 +Node: Using Internal File Ops1015774 +Ref: Using Internal File Ops-Footnote-11018157 +Node: Extension Samples1018430 +Node: Extension Sample File Functions1019954 +Node: Extension Sample Fnmatch1027556 +Node: Extension Sample Fork1029038 +Node: Extension Sample Inplace1030251 +Node: Extension Sample Ord1031926 +Node: Extension Sample Readdir1032762 +Ref: table-readdir-file-types1033618 +Node: Extension Sample Revout1034429 +Node: Extension Sample Rev2way1035020 +Node: Extension Sample Read write array1035761 +Node: Extension Sample Readfile1037700 +Node: Extension Sample Time1038795 +Node: Extension Sample API Tests1040144 +Node: gawkextlib1040635 +Node: Extension summary1043285 +Node: Extension Exercises1046967 +Node: Language History1047689 +Node: V7/SVR3.11049346 +Node: SVR41051527 +Node: POSIX1052972 +Node: BTL1054361 +Node: POSIX/GNU1055095 +Node: Feature History1060664 +Node: Common Extensions1073755 +Node: Ranges and Locales1075079 +Ref: Ranges and Locales-Footnote-11079718 +Ref: Ranges and Locales-Footnote-21079745 +Ref: Ranges and Locales-Footnote-31079979 +Node: Contributors1080200 +Node: History summary1085740 +Node: Installation1087109 +Node: Gawk Distribution1088065 +Node: Getting1088549 +Node: Extracting1089373 +Node: Distribution contents1091015 +Node: Unix Installation1096732 +Node: Quick Installation1097349 +Node: Additional Configuration Options1099780 +Node: Configuration Philosophy1101520 +Node: Non-Unix Installation1103871 +Node: PC Installation1104329 +Node: PC Binary Installation1105655 +Node: PC Compiling1107503 +Ref: PC Compiling-Footnote-11110524 +Node: PC Testing1110629 +Node: PC Using1111805 +Node: Cygwin1115920 +Node: MSYS1116743 +Node: VMS Installation1117241 +Node: VMS Compilation1118033 +Ref: VMS Compilation-Footnote-11119255 +Node: VMS Dynamic Extensions1119313 +Node: VMS Installation Details1120997 +Node: VMS Running1123249 +Node: VMS GNV1126090 +Node: VMS Old Gawk1126824 +Node: Bugs1127294 +Node: Other Versions1131198 +Node: Installation summary1137411 +Node: Notes1138467 +Node: Compatibility Mode1139332 +Node: Additions1140114 +Node: Accessing The Source1141039 +Node: Adding Code1142475 +Node: New Ports1148647 +Node: Derived Files1153129 +Ref: Derived Files-Footnote-11158604 +Ref: Derived Files-Footnote-21158638 +Ref: Derived Files-Footnote-31159234 +Node: Future Extensions1159348 +Node: Implementation Limitations1159954 +Node: Extension Design1161202 +Node: Old Extension Problems1162356 +Ref: Old Extension Problems-Footnote-11163873 +Node: Extension New Mechanism Goals1163930 +Ref: Extension New Mechanism Goals-Footnote-11167290 +Node: Extension Other Design Decisions1167479 +Node: Extension Future Growth1169587 +Node: Old Extension Mechanism1170423 +Node: Notes summary1172185 +Node: Basic Concepts1173371 +Node: Basic High Level1174052 +Ref: figure-general-flow1174324 +Ref: figure-process-flow1174923 +Ref: Basic High Level-Footnote-11178152 +Node: Basic Data Typing1178337 +Node: Glossary1181665 +Node: Copying1206823 +Node: GNU Free Documentation License1244379 +Node: Index1269515  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index e8e9b4c0..4cb6a781 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -433,8 +433,9 @@ particular records in a file and perform operations upon them. @end ifnottex @menu -* Foreword:: Some nice words about this +* Foreword3:: Some nice words about this @value{DOCUMENT}. +* Foreword4:: More nice words. * Preface:: What this @value{DOCUMENT} is about; brief history and acknowledgments. * Getting Started:: A basic introduction to using @@ -1062,8 +1063,8 @@ for enrichening our lives in innumerable ways. @summarycontents @contents -@node Foreword -@unnumbered Foreword +@node Foreword3 +@unnumbered Foreword to the Third Edition @c This bit is post-processed by a script which turns the chapter @c tag into a preface tag, and moves this stuff to before the title. @@ -1213,6 +1214,58 @@ March, 2001 @end display @end ifnotdocbook +@node Foreword4 +@unnumbered Foreword to the Fourth Edition + +@c This bit is post-processed by a script which turns the chapter +@c tag into a preface tag, and moves this stuff to before the title. +@c Bleah. +@docbook + + + Michael + Brennan + + Author of mawk + + March, 2001 + +@end docbook + +Some things don't change. Thirteen years ago I wrote: +``If you use AWK or want to learn how, then read this book.'' +True then and still true today. + +Learning to use a programming language is more than mastering the +syntax. One needs to acquire an understanding of how to use the +features of the language to solve practical programming problems. +A focus of this book is many examples that show how to use AWK. + +Some things do change. Our computers are much faster and have more memory. +Consequently, speed and storage inefficiencies of a high level language +matter less. Prototyping in AWK and then rewriting in C for performance +reasons happens less, because more often the prototype is fast enough. + +Of course, there are computing operations that are best done in C or C++. +With @command{gawk} 4.1 and later, you do not have to choose between writing +your program in AWK or in C/C++. You can write most of your +program in AWK and the aspects that require C/C++ capabilities can be written +in C/C++ and then the pieces glued together when the @command{gawk} module loads +the C/C++ module as a dynamic plug-in. +@c Chapter 16 +@ref{Dynamic Extensions}, +has all the +details, and as expected, many examples to help you learn the ins and outs. + +@ifnotdocbook +@cindex Brennan, Michael +@display +Michael Brennan +Author of @command{mawk} +October, 2014 +@end display +@end ifnotdocbook + @node Preface @unnumbered Preface @c I saw a comment somewhere that the preface should describe the book itself, diff --git a/doc/gawktexi.in b/doc/gawktexi.in index f9aea67e..001dd8b7 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -428,8 +428,9 @@ particular records in a file and perform operations upon them. @end ifnottex @menu -* Foreword:: Some nice words about this +* Foreword3:: Some nice words about this @value{DOCUMENT}. +* Foreword4:: More nice words. * Preface:: What this @value{DOCUMENT} is about; brief history and acknowledgments. * Getting Started:: A basic introduction to using @@ -1057,8 +1058,8 @@ for enrichening our lives in innumerable ways. @summarycontents @contents -@node Foreword -@unnumbered Foreword +@node Foreword3 +@unnumbered Foreword to the Third Edition @c This bit is post-processed by a script which turns the chapter @c tag into a preface tag, and moves this stuff to before the title. @@ -1208,6 +1209,58 @@ March, 2001 @end display @end ifnotdocbook +@node Foreword4 +@unnumbered Foreword to the Fourth Edition + +@c This bit is post-processed by a script which turns the chapter +@c tag into a preface tag, and moves this stuff to before the title. +@c Bleah. +@docbook + + + Michael + Brennan + + Author of mawk + + March, 2001 + +@end docbook + +Some things don't change. Thirteen years ago I wrote: +``If you use AWK or want to learn how, then read this book.'' +True then and still true today. + +Learning to use a programming language is more than mastering the +syntax. One needs to acquire an understanding of how to use the +features of the language to solve practical programming problems. +A focus of this book is many examples that show how to use AWK. + +Some things do change. Our computers are much faster and have more memory. +Consequently, speed and storage inefficiencies of a high level language +matter less. Prototyping in AWK and then rewriting in C for performance +reasons happens less, because more often the prototype is fast enough. + +Of course, there are computing operations that are best done in C or C++. +With @command{gawk} 4.1 and later, you do not have to choose between writing +your program in AWK or in C/C++. You can write most of your +program in AWK and the aspects that require C/C++ capabilities can be written +in C/C++ and then the pieces glued together when the @command{gawk} module loads +the C/C++ module as a dynamic plug-in. +@c Chapter 16 +@ref{Dynamic Extensions}, +has all the +details, and as expected, many examples to help you learn the ins and outs. + +@ifnotdocbook +@cindex Brennan, Michael +@display +Michael Brennan +Author of @command{mawk} +October, 2014 +@end display +@end ifnotdocbook + @node Preface @unnumbered Preface @c I saw a comment somewhere that the preface should describe the book itself, -- cgit v1.2.3 From 74ee0dcab17240a1626b77ed998b07f0f6560a48 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 15 Oct 2014 11:40:12 +0300 Subject: Sanitize handling of AWKPATH / AWKLIBPATH. --- ChangeLog | 16 + doc/ChangeLog | 5 + doc/gawk.1 | 2 +- doc/gawk.info | 1071 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 74 ++-- doc/gawktexi.in | 74 ++-- io.c | 45 --- main.c | 28 +- 8 files changed, 674 insertions(+), 641 deletions(-) diff --git a/ChangeLog b/ChangeLog index 777eb5be..56fbd066 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2014-10-15 Arnold D. Robbins + + Make sane the handling of AWKPATH and AWKLIBPATH: + + 1. Don't explicitly search "."; it must be in the path either + physically or as null element a la the shell's $PATH + 2. If environment's value was empty, use built-in default value. + 3. Set ENVIRON["AWK*PATH"] to the path used. + + * io.c (path_info): Remove try_cwd member. + (get_cwd): Removed, not needed anymore. + (do_find_source): Don't do explicit check in current directory. + It must come from the AWKPATH or AWKLIBPATH variable. + * main.c (path_environ): If value from environment was empty, + set it to the default. This is how gawk has behaved since 2.10. + 2014-10-13 Arnold D. Robbins * regcomp.c (__re_error_msgid): Make error message for REG_EBRACK diff --git a/doc/ChangeLog b/doc/ChangeLog index da2b7cc0..fe9bea7e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-15 Arnold D. Robbins + + * gawk.1: Fix default value for AWKLIBPATH. + * gawktexi.in: Revised text for AWKPATH and AWKLIBPATH. + 2014-10-14 Arnold D. Robbins * gawktexi.in: Add new Foreword from Mike Brennan. diff --git a/doc/gawk.1 b/doc/gawk.1 index c35ebf00..df31a5f2 100644 --- a/doc/gawk.1 +++ b/doc/gawk.1 @@ -626,7 +626,7 @@ specifies a search path to use when finding source files named with the .B \-l option. If this variable does not exist, the default path is -\fB".:/usr/local/lib/gawk"\fR. +\fB"/usr/local/lib/gawk"\fR. (The actual directory may vary, depending upon how .I gawk was built and installed.) diff --git a/doc/gawk.info b/doc/gawk.info index fd3e19db..00a8adcb 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -2874,17 +2874,17 @@ File: gawk.info, Node: AWKPATH Variable, Next: AWKLIBPATH Variable, Up: Envir The previous minor node described how `awk' program files can be named on the command line with the `-f' option. In most `awk' -implementations, you must supply a precise path name for each program -file, unless the file is in the current directory. But in `gawk', if +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 specified name. The search path is a string consisting of directory names separated by -colons(1). `gawk' gets its search path from the `AWKPATH' environment -variable. If that variable does not exist, `gawk' uses a default path, -`.:/usr/local/share/awk'.(2) +colons.(1) `gawk' gets its search path from the `AWKPATH' environment +variable. If that variable does not exist, or if it has an empty value, +`gawk' uses a default path (described shortly). The search path feature is particularly helpful for building libraries of useful `awk' functions. The library files can be placed @@ -2892,15 +2892,13 @@ in a standard directory in the default path and then specified on the command line with a short file name. Otherwise, you would have to type the full file name for each file. - By using the `-i' option, or the `-e' and `-f' options, your -command-line `awk' programs can use facilities in `awk' library files -(*note Library Functions::). Path searching is not done if `gawk' is -in compatibility mode. This is true for both `--traditional' and -`--posix'. *Note Options::. + By using the `-i' or `-f' options, your command-line `awk' programs +can use facilities in `awk' library files (*note Library Functions::). +Path searching is not done if `gawk' is in compatibility mode. This is +true for both `--traditional' and `--posix'. *Note Options::. If the source code file is not found after the initial search, the -path is searched again after adding the default `.awk' suffix to the -file name. +path is searched again after adding the suffix `.awk' to the file name. `gawk''s path search mechanism is similar to the shell's. (See `The Bourne-Again SHell manual' (http://www.gnu.org/software/bash/manual/).) @@ -2908,15 +2906,23 @@ It treats a null entry in the path as indicating the current directory. (A null entry is indicated by starting or ending the path with a colon or by placing two colons next to each other [`::'].) - NOTE: `gawk' always looks in the current directory _before_ - searching `AWKPATH'. Thus, while you can include the current - directory in the search path, either explicitly or with a null - entry, there is no real reason to do so. + NOTE: To include the current directory in the path, either place + `.' as an entry in the path or write a null entry in the path. - If `AWKPATH' is not defined in the environment, `gawk' places its -default search path into `ENVIRON["AWKPATH"]'. This makes it easy to -determine the actual search path that `gawk' used from within an `awk' -program. + 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. + + The default value for `AWKPATH' is `.:/usr/local/share/awk'.(2) +Since `.' is included at the beginning, `gawk' searches first in the +current directory and then in `/usr/local/share/awk'. In practice, +this means that you will rarely need to change the value of `AWKPATH'. + + `gawk' places the value of the search path that it used into +`ENVIRON["AWKPATH"]'. This provides access to the actual search path +value from within an `awk' program. While you can change `ENVIRON["AWKPATH"]' within your `awk' program, this has no effect on the running program's behavior. This makes @@ -2948,6 +2954,15 @@ platform. For example, on GNU/Linux systems, the suffix `.so' is used. The search path specified is also used for extensions loaded via the `@load' keyword (*note Loading Shared Libraries::). + If `AWKLIBPATH' does not exist in the environment, or if it has an +empty value, `gawk' uses a default path; this is typically +`/usr/local/lib/gawk', although it can vary depending upon how `gawk' +was built. + + `gawk' places the value of the search path that it used into +`ENVIRON["AWKLIBPATH"]'. This provides access to the actual search path +value from within an `awk' program. +  File: gawk.info, Node: Other Environment Variables, Prev: AWKLIBPATH Variable, Up: Environment Variables @@ -34313,513 +34328,513 @@ Node: Other Arguments131096 Node: Naming Standard Input134057 Node: Environment Variables135150 Node: AWKPATH Variable135708 -Ref: AWKPATH Variable-Footnote-1138560 -Ref: AWKPATH Variable-Footnote-2138605 -Node: AWKLIBPATH Variable138865 -Node: Other Environment Variables139624 -Node: Exit Status143344 -Node: Include Files144019 -Node: Loading Shared Libraries147607 -Node: Obsolete149034 -Node: Undocumented149731 -Node: Invoking Summary149998 -Node: Regexp151664 -Node: Regexp Usage153123 -Node: Escape Sequences155156 -Node: Regexp Operators161173 -Ref: Regexp Operators-Footnote-1168607 -Ref: Regexp Operators-Footnote-2168754 -Node: Bracket Expressions168852 -Ref: table-char-classes170869 -Node: Leftmost Longest173809 -Node: Computed Regexps175111 -Node: GNU Regexp Operators178508 -Node: Case-sensitivity182210 -Ref: Case-sensitivity-Footnote-1185100 -Ref: Case-sensitivity-Footnote-2185335 -Node: Regexp Summary185443 -Node: Reading Files186912 -Node: Records189006 -Node: awk split records189738 -Node: gawk split records194652 -Ref: gawk split records-Footnote-1199191 -Node: Fields199228 -Ref: Fields-Footnote-1202026 -Node: Nonconstant Fields202112 -Ref: Nonconstant Fields-Footnote-1204348 -Node: Changing Fields204550 -Node: Field Separators210482 -Node: Default Field Splitting213186 -Node: Regexp Field Splitting214303 -Node: Single Character Fields217653 -Node: Command Line Field Separator218712 -Node: Full Line Fields221924 -Ref: Full Line Fields-Footnote-1222432 -Node: Field Splitting Summary222478 -Ref: Field Splitting Summary-Footnote-1225609 -Node: Constant Size225710 -Node: Splitting By Content230316 -Ref: Splitting By Content-Footnote-1234389 -Node: Multiple Line234429 -Ref: Multiple Line-Footnote-1240318 -Node: Getline240497 -Node: Plain Getline242708 -Node: Getline/Variable245348 -Node: Getline/File246495 -Node: Getline/Variable/File247879 -Ref: Getline/Variable/File-Footnote-1249480 -Node: Getline/Pipe249567 -Node: Getline/Variable/Pipe252250 -Node: Getline/Coprocess253381 -Node: Getline/Variable/Coprocess254633 -Node: Getline Notes255372 -Node: Getline Summary258164 -Ref: table-getline-variants258576 -Node: Read Timeout259405 -Ref: Read Timeout-Footnote-1263219 -Node: Command-line directories263277 -Node: Input Summary264181 -Node: Input Exercises267433 -Node: Printing268161 -Node: Print269938 -Node: Print Examples271395 -Node: Output Separators274174 -Node: OFMT276192 -Node: Printf277546 -Node: Basic Printf278331 -Node: Control Letters279902 -Node: Format Modifiers283886 -Node: Printf Examples289893 -Node: Redirection292375 -Node: Special FD299214 -Ref: Special FD-Footnote-1302371 -Node: Special Files302445 -Node: Other Inherited Files303061 -Node: Special Network304061 -Node: Special Caveats304922 -Node: Close Files And Pipes305873 -Ref: Close Files And Pipes-Footnote-1313052 -Ref: Close Files And Pipes-Footnote-2313200 -Node: Output Summary313350 -Node: Output Exercises314346 -Node: Expressions315026 -Node: Values316211 -Node: Constants316887 -Node: Scalar Constants317567 -Ref: Scalar Constants-Footnote-1318426 -Node: Nondecimal-numbers318676 -Node: Regexp Constants321676 -Node: Using Constant Regexps322201 -Node: Variables325339 -Node: Using Variables325994 -Node: Assignment Options327904 -Node: Conversion329779 -Node: Strings And Numbers330303 -Ref: Strings And Numbers-Footnote-1333367 -Node: Locale influences conversions333476 -Ref: table-locale-affects336221 -Node: All Operators336809 -Node: Arithmetic Ops337439 -Node: Concatenation339944 -Ref: Concatenation-Footnote-1342763 -Node: Assignment Ops342869 -Ref: table-assign-ops347852 -Node: Increment Ops349130 -Node: Truth Values and Conditions352568 -Node: Truth Values353651 -Node: Typing and Comparison354700 -Node: Variable Typing355493 -Node: Comparison Operators359145 -Ref: table-relational-ops359555 -Node: POSIX String Comparison363070 -Ref: POSIX String Comparison-Footnote-1364142 -Node: Boolean Ops364280 -Ref: Boolean Ops-Footnote-1368759 -Node: Conditional Exp368850 -Node: Function Calls370577 -Node: Precedence374457 -Node: Locales378125 -Node: Expressions Summary379756 -Node: Patterns and Actions382330 -Node: Pattern Overview383450 -Node: Regexp Patterns385129 -Node: Expression Patterns385672 -Node: Ranges389452 -Node: BEGIN/END392558 -Node: Using BEGIN/END393320 -Ref: Using BEGIN/END-Footnote-1396057 -Node: I/O And BEGIN/END396163 -Node: BEGINFILE/ENDFILE398477 -Node: Empty401378 -Node: Using Shell Variables401695 -Node: Action Overview403971 -Node: Statements406298 -Node: If Statement408146 -Node: While Statement409644 -Node: Do Statement411672 -Node: For Statement412814 -Node: Switch Statement415969 -Node: Break Statement418357 -Node: Continue Statement420398 -Node: Next Statement422223 -Node: Nextfile Statement424603 -Node: Exit Statement427233 -Node: Built-in Variables429636 -Node: User-modified430769 -Ref: User-modified-Footnote-1438449 -Node: Auto-set438511 -Ref: Auto-set-Footnote-1451541 -Ref: Auto-set-Footnote-2451746 -Node: ARGC and ARGV451802 -Node: Pattern Action Summary456006 -Node: Arrays458433 -Node: Array Basics459762 -Node: Array Intro460606 -Ref: figure-array-elements462570 -Ref: Array Intro-Footnote-1465094 -Node: Reference to Elements465222 -Node: Assigning Elements467672 -Node: Array Example468163 -Node: Scanning an Array469921 -Node: Controlling Scanning472937 -Ref: Controlling Scanning-Footnote-1478126 -Node: Numeric Array Subscripts478442 -Node: Uninitialized Subscripts480627 -Node: Delete482244 -Ref: Delete-Footnote-1484988 -Node: Multidimensional485045 -Node: Multiscanning488140 -Node: Arrays of Arrays489729 -Node: Arrays Summary494490 -Node: Functions496595 -Node: Built-in497468 -Node: Calling Built-in498546 -Node: Numeric Functions500534 -Ref: Numeric Functions-Footnote-1504556 -Ref: Numeric Functions-Footnote-2504913 -Ref: Numeric Functions-Footnote-3504961 -Node: String Functions505230 -Ref: String Functions-Footnote-1528702 -Ref: String Functions-Footnote-2528831 -Ref: String Functions-Footnote-3529079 -Node: Gory Details529166 -Ref: table-sub-escapes530947 -Ref: table-sub-proposed532467 -Ref: table-posix-sub533831 -Ref: table-gensub-escapes535371 -Ref: Gory Details-Footnote-1536203 -Node: I/O Functions536354 -Ref: I/O Functions-Footnote-1543455 -Node: Time Functions543602 -Ref: Time Functions-Footnote-1554071 -Ref: Time Functions-Footnote-2554139 -Ref: Time Functions-Footnote-3554297 -Ref: Time Functions-Footnote-4554408 -Ref: Time Functions-Footnote-5554520 -Ref: Time Functions-Footnote-6554747 -Node: Bitwise Functions555013 -Ref: table-bitwise-ops555575 -Ref: Bitwise Functions-Footnote-1559883 -Node: Type Functions560052 -Node: I18N Functions561201 -Node: User-defined562846 -Node: Definition Syntax563650 -Ref: Definition Syntax-Footnote-1569056 -Node: Function Example569125 -Ref: Function Example-Footnote-1572042 -Node: Function Caveats572064 -Node: Calling A Function572582 -Node: Variable Scope573537 -Node: Pass By Value/Reference576525 -Node: Return Statement580035 -Node: Dynamic Typing583019 -Node: Indirect Calls583948 -Ref: Indirect Calls-Footnote-1595252 -Node: Functions Summary595380 -Node: Library Functions598079 -Ref: Library Functions-Footnote-1601697 -Ref: Library Functions-Footnote-2601840 -Node: Library Names602011 -Ref: Library Names-Footnote-1605471 -Ref: Library Names-Footnote-2605691 -Node: General Functions605777 -Node: Strtonum Function606880 -Node: Assert Function609900 -Node: Round Function613224 -Node: Cliff Random Function614765 -Node: Ordinal Functions615781 -Ref: Ordinal Functions-Footnote-1618846 -Ref: Ordinal Functions-Footnote-2619098 -Node: Join Function619309 -Ref: Join Function-Footnote-1621080 -Node: Getlocaltime Function621280 -Node: Readfile Function625021 -Node: Shell Quoting626991 -Node: Data File Management628392 -Node: Filetrans Function629024 -Node: Rewind Function633083 -Node: File Checking634468 -Ref: File Checking-Footnote-1635796 -Node: Empty Files635997 -Node: Ignoring Assigns637976 -Node: Getopt Function639527 -Ref: Getopt Function-Footnote-1650987 -Node: Passwd Functions651190 -Ref: Passwd Functions-Footnote-1660041 -Node: Group Functions660129 -Ref: Group Functions-Footnote-1668032 -Node: Walking Arrays668245 -Node: Library Functions Summary669848 -Node: Library Exercises671249 -Node: Sample Programs672529 -Node: Running Examples673299 -Node: Clones674027 -Node: Cut Program675251 -Node: Egrep Program684981 -Ref: Egrep Program-Footnote-1692485 -Node: Id Program692595 -Node: Split Program696239 -Ref: Split Program-Footnote-1699685 -Node: Tee Program699813 -Node: Uniq Program702600 -Node: Wc Program710021 -Ref: Wc Program-Footnote-1714269 -Node: Miscellaneous Programs714361 -Node: Dupword Program715574 -Node: Alarm Program717605 -Node: Translate Program722409 -Ref: Translate Program-Footnote-1726973 -Node: Labels Program727243 -Ref: Labels Program-Footnote-1730592 -Node: Word Sorting730676 -Node: History Sorting734746 -Node: Extract Program736582 -Node: Simple Sed744114 -Node: Igawk Program747176 -Ref: Igawk Program-Footnote-1761502 -Ref: Igawk Program-Footnote-2761703 -Ref: Igawk Program-Footnote-3761825 -Node: Anagram Program761940 -Node: Signature Program765002 -Node: Programs Summary766249 -Node: Programs Exercises767442 -Ref: Programs Exercises-Footnote-1771573 -Node: Advanced Features771664 -Node: Nondecimal Data773612 -Node: Array Sorting775202 -Node: Controlling Array Traversal775899 -Ref: Controlling Array Traversal-Footnote-1784230 -Node: Array Sorting Functions784348 -Ref: Array Sorting Functions-Footnote-1788240 -Node: Two-way I/O788434 -Ref: Two-way I/O-Footnote-1793378 -Ref: Two-way I/O-Footnote-2793564 -Node: TCP/IP Networking793646 -Node: Profiling796518 -Node: Advanced Features Summary804062 -Node: Internationalization805995 -Node: I18N and L10N807475 -Node: Explaining gettext808161 -Ref: Explaining gettext-Footnote-1813190 -Ref: Explaining gettext-Footnote-2813374 -Node: Programmer i18n813539 -Ref: Programmer i18n-Footnote-1818405 -Node: Translator i18n818454 -Node: String Extraction819248 -Ref: String Extraction-Footnote-1820379 -Node: Printf Ordering820465 -Ref: Printf Ordering-Footnote-1823251 -Node: I18N Portability823315 -Ref: I18N Portability-Footnote-1825764 -Node: I18N Example825827 -Ref: I18N Example-Footnote-1828627 -Node: Gawk I18N828699 -Node: I18N Summary829337 -Node: Debugger830676 -Node: Debugging831698 -Node: Debugging Concepts832139 -Node: Debugging Terms833996 -Node: Awk Debugging836571 -Node: Sample Debugging Session837463 -Node: Debugger Invocation837983 -Node: Finding The Bug839367 -Node: List of Debugger Commands845842 -Node: Breakpoint Control847174 -Node: Debugger Execution Control850866 -Node: Viewing And Changing Data854230 -Node: Execution Stack857595 -Node: Debugger Info859233 -Node: Miscellaneous Debugger Commands863250 -Node: Readline Support868442 -Node: Limitations869334 -Node: Debugging Summary871431 -Node: Arbitrary Precision Arithmetic872599 -Node: Computer Arithmetic874015 -Ref: table-numeric-ranges877616 -Ref: Computer Arithmetic-Footnote-1878475 -Node: Math Definitions878532 -Ref: table-ieee-formats881819 -Ref: Math Definitions-Footnote-1882423 -Node: MPFR features882528 -Node: FP Math Caution884199 -Ref: FP Math Caution-Footnote-1885249 -Node: Inexactness of computations885618 -Node: Inexact representation886566 -Node: Comparing FP Values887921 -Node: Errors accumulate888994 -Node: Getting Accuracy890427 -Node: Try To Round893086 -Node: Setting precision893985 -Ref: table-predefined-precision-strings894669 -Node: Setting the rounding mode896463 -Ref: table-gawk-rounding-modes896827 -Ref: Setting the rounding mode-Footnote-1900281 -Node: Arbitrary Precision Integers900460 -Ref: Arbitrary Precision Integers-Footnote-1903451 -Node: POSIX Floating Point Problems903600 -Ref: POSIX Floating Point Problems-Footnote-1907476 -Node: Floating point summary907514 -Node: Dynamic Extensions909706 -Node: Extension Intro911258 -Node: Plugin License912524 -Node: Extension Mechanism Outline913321 -Ref: figure-load-extension913749 -Ref: figure-register-new-function915229 -Ref: figure-call-new-function916233 -Node: Extension API Description918219 -Node: Extension API Functions Introduction919669 -Node: General Data Types924505 -Ref: General Data Types-Footnote-1930192 -Node: Memory Allocation Functions930491 -Ref: Memory Allocation Functions-Footnote-1933321 -Node: Constructor Functions933417 -Node: Registration Functions935151 -Node: Extension Functions935836 -Node: Exit Callback Functions938132 -Node: Extension Version String939380 -Node: Input Parsers940030 -Node: Output Wrappers949845 -Node: Two-way processors954361 -Node: Printing Messages956565 -Ref: Printing Messages-Footnote-1957642 -Node: Updating `ERRNO'957794 -Node: Requesting Values958534 -Ref: table-value-types-returned959262 -Node: Accessing Parameters960220 -Node: Symbol Table Access961451 -Node: Symbol table by name961965 -Node: Symbol table by cookie963945 -Ref: Symbol table by cookie-Footnote-1968084 -Node: Cached values968147 -Ref: Cached values-Footnote-1971651 -Node: Array Manipulation971742 -Ref: Array Manipulation-Footnote-1972840 -Node: Array Data Types972879 -Ref: Array Data Types-Footnote-1975536 -Node: Array Functions975628 -Node: Flattening Arrays979482 -Node: Creating Arrays986369 -Node: Extension API Variables991136 -Node: Extension Versioning991772 -Node: Extension API Informational Variables993673 -Node: Extension API Boilerplate994761 -Node: Finding Extensions998577 -Node: Extension Example999137 -Node: Internal File Description999909 -Node: Internal File Ops1003976 -Ref: Internal File Ops-Footnote-11015634 -Node: Using Internal File Ops1015774 -Ref: Using Internal File Ops-Footnote-11018157 -Node: Extension Samples1018430 -Node: Extension Sample File Functions1019954 -Node: Extension Sample Fnmatch1027556 -Node: Extension Sample Fork1029038 -Node: Extension Sample Inplace1030251 -Node: Extension Sample Ord1031926 -Node: Extension Sample Readdir1032762 -Ref: table-readdir-file-types1033618 -Node: Extension Sample Revout1034429 -Node: Extension Sample Rev2way1035020 -Node: Extension Sample Read write array1035761 -Node: Extension Sample Readfile1037700 -Node: Extension Sample Time1038795 -Node: Extension Sample API Tests1040144 -Node: gawkextlib1040635 -Node: Extension summary1043285 -Node: Extension Exercises1046967 -Node: Language History1047689 -Node: V7/SVR3.11049346 -Node: SVR41051527 -Node: POSIX1052972 -Node: BTL1054361 -Node: POSIX/GNU1055095 -Node: Feature History1060664 -Node: Common Extensions1073755 -Node: Ranges and Locales1075079 -Ref: Ranges and Locales-Footnote-11079718 -Ref: Ranges and Locales-Footnote-21079745 -Ref: Ranges and Locales-Footnote-31079979 -Node: Contributors1080200 -Node: History summary1085740 -Node: Installation1087109 -Node: Gawk Distribution1088065 -Node: Getting1088549 -Node: Extracting1089373 -Node: Distribution contents1091015 -Node: Unix Installation1096732 -Node: Quick Installation1097349 -Node: Additional Configuration Options1099780 -Node: Configuration Philosophy1101520 -Node: Non-Unix Installation1103871 -Node: PC Installation1104329 -Node: PC Binary Installation1105655 -Node: PC Compiling1107503 -Ref: PC Compiling-Footnote-11110524 -Node: PC Testing1110629 -Node: PC Using1111805 -Node: Cygwin1115920 -Node: MSYS1116743 -Node: VMS Installation1117241 -Node: VMS Compilation1118033 -Ref: VMS Compilation-Footnote-11119255 -Node: VMS Dynamic Extensions1119313 -Node: VMS Installation Details1120997 -Node: VMS Running1123249 -Node: VMS GNV1126090 -Node: VMS Old Gawk1126824 -Node: Bugs1127294 -Node: Other Versions1131198 -Node: Installation summary1137411 -Node: Notes1138467 -Node: Compatibility Mode1139332 -Node: Additions1140114 -Node: Accessing The Source1141039 -Node: Adding Code1142475 -Node: New Ports1148647 -Node: Derived Files1153129 -Ref: Derived Files-Footnote-11158604 -Ref: Derived Files-Footnote-21158638 -Ref: Derived Files-Footnote-31159234 -Node: Future Extensions1159348 -Node: Implementation Limitations1159954 -Node: Extension Design1161202 -Node: Old Extension Problems1162356 -Ref: Old Extension Problems-Footnote-11163873 -Node: Extension New Mechanism Goals1163930 -Ref: Extension New Mechanism Goals-Footnote-11167290 -Node: Extension Other Design Decisions1167479 -Node: Extension Future Growth1169587 -Node: Old Extension Mechanism1170423 -Node: Notes summary1172185 -Node: Basic Concepts1173371 -Node: Basic High Level1174052 -Ref: figure-general-flow1174324 -Ref: figure-process-flow1174923 -Ref: Basic High Level-Footnote-11178152 -Node: Basic Data Typing1178337 -Node: Glossary1181665 -Node: Copying1206823 -Node: GNU Free Documentation License1244379 -Node: Index1269515 +Ref: AWKPATH Variable-Footnote-1139008 +Ref: AWKPATH Variable-Footnote-2139053 +Node: AWKLIBPATH Variable139313 +Node: Other Environment Variables140456 +Node: Exit Status144176 +Node: Include Files144851 +Node: Loading Shared Libraries148439 +Node: Obsolete149866 +Node: Undocumented150563 +Node: Invoking Summary150830 +Node: Regexp152496 +Node: Regexp Usage153955 +Node: Escape Sequences155988 +Node: Regexp Operators162005 +Ref: Regexp Operators-Footnote-1169439 +Ref: Regexp Operators-Footnote-2169586 +Node: Bracket Expressions169684 +Ref: table-char-classes171701 +Node: Leftmost Longest174641 +Node: Computed Regexps175943 +Node: GNU Regexp Operators179340 +Node: Case-sensitivity183042 +Ref: Case-sensitivity-Footnote-1185932 +Ref: Case-sensitivity-Footnote-2186167 +Node: Regexp Summary186275 +Node: Reading Files187744 +Node: Records189838 +Node: awk split records190570 +Node: gawk split records195484 +Ref: gawk split records-Footnote-1200023 +Node: Fields200060 +Ref: Fields-Footnote-1202858 +Node: Nonconstant Fields202944 +Ref: Nonconstant Fields-Footnote-1205180 +Node: Changing Fields205382 +Node: Field Separators211314 +Node: Default Field Splitting214018 +Node: Regexp Field Splitting215135 +Node: Single Character Fields218485 +Node: Command Line Field Separator219544 +Node: Full Line Fields222756 +Ref: Full Line Fields-Footnote-1223264 +Node: Field Splitting Summary223310 +Ref: Field Splitting Summary-Footnote-1226441 +Node: Constant Size226542 +Node: Splitting By Content231148 +Ref: Splitting By Content-Footnote-1235221 +Node: Multiple Line235261 +Ref: Multiple Line-Footnote-1241150 +Node: Getline241329 +Node: Plain Getline243540 +Node: Getline/Variable246180 +Node: Getline/File247327 +Node: Getline/Variable/File248711 +Ref: Getline/Variable/File-Footnote-1250312 +Node: Getline/Pipe250399 +Node: Getline/Variable/Pipe253082 +Node: Getline/Coprocess254213 +Node: Getline/Variable/Coprocess255465 +Node: Getline Notes256204 +Node: Getline Summary258996 +Ref: table-getline-variants259408 +Node: Read Timeout260237 +Ref: Read Timeout-Footnote-1264051 +Node: Command-line directories264109 +Node: Input Summary265013 +Node: Input Exercises268265 +Node: Printing268993 +Node: Print270770 +Node: Print Examples272227 +Node: Output Separators275006 +Node: OFMT277024 +Node: Printf278378 +Node: Basic Printf279163 +Node: Control Letters280734 +Node: Format Modifiers284718 +Node: Printf Examples290725 +Node: Redirection293207 +Node: Special FD300046 +Ref: Special FD-Footnote-1303203 +Node: Special Files303277 +Node: Other Inherited Files303893 +Node: Special Network304893 +Node: Special Caveats305754 +Node: Close Files And Pipes306705 +Ref: Close Files And Pipes-Footnote-1313884 +Ref: Close Files And Pipes-Footnote-2314032 +Node: Output Summary314182 +Node: Output Exercises315178 +Node: Expressions315858 +Node: Values317043 +Node: Constants317719 +Node: Scalar Constants318399 +Ref: Scalar Constants-Footnote-1319258 +Node: Nondecimal-numbers319508 +Node: Regexp Constants322508 +Node: Using Constant Regexps323033 +Node: Variables326171 +Node: Using Variables326826 +Node: Assignment Options328736 +Node: Conversion330611 +Node: Strings And Numbers331135 +Ref: Strings And Numbers-Footnote-1334199 +Node: Locale influences conversions334308 +Ref: table-locale-affects337053 +Node: All Operators337641 +Node: Arithmetic Ops338271 +Node: Concatenation340776 +Ref: Concatenation-Footnote-1343595 +Node: Assignment Ops343701 +Ref: table-assign-ops348684 +Node: Increment Ops349962 +Node: Truth Values and Conditions353400 +Node: Truth Values354483 +Node: Typing and Comparison355532 +Node: Variable Typing356325 +Node: Comparison Operators359977 +Ref: table-relational-ops360387 +Node: POSIX String Comparison363902 +Ref: POSIX String Comparison-Footnote-1364974 +Node: Boolean Ops365112 +Ref: Boolean Ops-Footnote-1369591 +Node: Conditional Exp369682 +Node: Function Calls371409 +Node: Precedence375289 +Node: Locales378957 +Node: Expressions Summary380588 +Node: Patterns and Actions383162 +Node: Pattern Overview384282 +Node: Regexp Patterns385961 +Node: Expression Patterns386504 +Node: Ranges390284 +Node: BEGIN/END393390 +Node: Using BEGIN/END394152 +Ref: Using BEGIN/END-Footnote-1396889 +Node: I/O And BEGIN/END396995 +Node: BEGINFILE/ENDFILE399309 +Node: Empty402210 +Node: Using Shell Variables402527 +Node: Action Overview404803 +Node: Statements407130 +Node: If Statement408978 +Node: While Statement410476 +Node: Do Statement412504 +Node: For Statement413646 +Node: Switch Statement416801 +Node: Break Statement419189 +Node: Continue Statement421230 +Node: Next Statement423055 +Node: Nextfile Statement425435 +Node: Exit Statement428065 +Node: Built-in Variables430468 +Node: User-modified431601 +Ref: User-modified-Footnote-1439281 +Node: Auto-set439343 +Ref: Auto-set-Footnote-1452373 +Ref: Auto-set-Footnote-2452578 +Node: ARGC and ARGV452634 +Node: Pattern Action Summary456838 +Node: Arrays459265 +Node: Array Basics460594 +Node: Array Intro461438 +Ref: figure-array-elements463402 +Ref: Array Intro-Footnote-1465926 +Node: Reference to Elements466054 +Node: Assigning Elements468504 +Node: Array Example468995 +Node: Scanning an Array470753 +Node: Controlling Scanning473769 +Ref: Controlling Scanning-Footnote-1478958 +Node: Numeric Array Subscripts479274 +Node: Uninitialized Subscripts481459 +Node: Delete483076 +Ref: Delete-Footnote-1485820 +Node: Multidimensional485877 +Node: Multiscanning488972 +Node: Arrays of Arrays490561 +Node: Arrays Summary495322 +Node: Functions497427 +Node: Built-in498300 +Node: Calling Built-in499378 +Node: Numeric Functions501366 +Ref: Numeric Functions-Footnote-1505388 +Ref: Numeric Functions-Footnote-2505745 +Ref: Numeric Functions-Footnote-3505793 +Node: String Functions506062 +Ref: String Functions-Footnote-1529534 +Ref: String Functions-Footnote-2529663 +Ref: String Functions-Footnote-3529911 +Node: Gory Details529998 +Ref: table-sub-escapes531779 +Ref: table-sub-proposed533299 +Ref: table-posix-sub534663 +Ref: table-gensub-escapes536203 +Ref: Gory Details-Footnote-1537035 +Node: I/O Functions537186 +Ref: I/O Functions-Footnote-1544287 +Node: Time Functions544434 +Ref: Time Functions-Footnote-1554903 +Ref: Time Functions-Footnote-2554971 +Ref: Time Functions-Footnote-3555129 +Ref: Time Functions-Footnote-4555240 +Ref: Time Functions-Footnote-5555352 +Ref: Time Functions-Footnote-6555579 +Node: Bitwise Functions555845 +Ref: table-bitwise-ops556407 +Ref: Bitwise Functions-Footnote-1560715 +Node: Type Functions560884 +Node: I18N Functions562033 +Node: User-defined563678 +Node: Definition Syntax564482 +Ref: Definition Syntax-Footnote-1569888 +Node: Function Example569957 +Ref: Function Example-Footnote-1572874 +Node: Function Caveats572896 +Node: Calling A Function573414 +Node: Variable Scope574369 +Node: Pass By Value/Reference577357 +Node: Return Statement580867 +Node: Dynamic Typing583851 +Node: Indirect Calls584780 +Ref: Indirect Calls-Footnote-1596084 +Node: Functions Summary596212 +Node: Library Functions598911 +Ref: Library Functions-Footnote-1602529 +Ref: Library Functions-Footnote-2602672 +Node: Library Names602843 +Ref: Library Names-Footnote-1606303 +Ref: Library Names-Footnote-2606523 +Node: General Functions606609 +Node: Strtonum Function607712 +Node: Assert Function610732 +Node: Round Function614056 +Node: Cliff Random Function615597 +Node: Ordinal Functions616613 +Ref: Ordinal Functions-Footnote-1619678 +Ref: Ordinal Functions-Footnote-2619930 +Node: Join Function620141 +Ref: Join Function-Footnote-1621912 +Node: Getlocaltime Function622112 +Node: Readfile Function625853 +Node: Shell Quoting627823 +Node: Data File Management629224 +Node: Filetrans Function629856 +Node: Rewind Function633915 +Node: File Checking635300 +Ref: File Checking-Footnote-1636628 +Node: Empty Files636829 +Node: Ignoring Assigns638808 +Node: Getopt Function640359 +Ref: Getopt Function-Footnote-1651819 +Node: Passwd Functions652022 +Ref: Passwd Functions-Footnote-1660873 +Node: Group Functions660961 +Ref: Group Functions-Footnote-1668864 +Node: Walking Arrays669077 +Node: Library Functions Summary670680 +Node: Library Exercises672081 +Node: Sample Programs673361 +Node: Running Examples674131 +Node: Clones674859 +Node: Cut Program676083 +Node: Egrep Program685813 +Ref: Egrep Program-Footnote-1693317 +Node: Id Program693427 +Node: Split Program697071 +Ref: Split Program-Footnote-1700517 +Node: Tee Program700645 +Node: Uniq Program703432 +Node: Wc Program710853 +Ref: Wc Program-Footnote-1715101 +Node: Miscellaneous Programs715193 +Node: Dupword Program716406 +Node: Alarm Program718437 +Node: Translate Program723241 +Ref: Translate Program-Footnote-1727805 +Node: Labels Program728075 +Ref: Labels Program-Footnote-1731424 +Node: Word Sorting731508 +Node: History Sorting735578 +Node: Extract Program737414 +Node: Simple Sed744946 +Node: Igawk Program748008 +Ref: Igawk Program-Footnote-1762334 +Ref: Igawk Program-Footnote-2762535 +Ref: Igawk Program-Footnote-3762657 +Node: Anagram Program762772 +Node: Signature Program765834 +Node: Programs Summary767081 +Node: Programs Exercises768274 +Ref: Programs Exercises-Footnote-1772405 +Node: Advanced Features772496 +Node: Nondecimal Data774444 +Node: Array Sorting776034 +Node: Controlling Array Traversal776731 +Ref: Controlling Array Traversal-Footnote-1785062 +Node: Array Sorting Functions785180 +Ref: Array Sorting Functions-Footnote-1789072 +Node: Two-way I/O789266 +Ref: Two-way I/O-Footnote-1794210 +Ref: Two-way I/O-Footnote-2794396 +Node: TCP/IP Networking794478 +Node: Profiling797350 +Node: Advanced Features Summary804894 +Node: Internationalization806827 +Node: I18N and L10N808307 +Node: Explaining gettext808993 +Ref: Explaining gettext-Footnote-1814022 +Ref: Explaining gettext-Footnote-2814206 +Node: Programmer i18n814371 +Ref: Programmer i18n-Footnote-1819237 +Node: Translator i18n819286 +Node: String Extraction820080 +Ref: String Extraction-Footnote-1821211 +Node: Printf Ordering821297 +Ref: Printf Ordering-Footnote-1824083 +Node: I18N Portability824147 +Ref: I18N Portability-Footnote-1826596 +Node: I18N Example826659 +Ref: I18N Example-Footnote-1829459 +Node: Gawk I18N829531 +Node: I18N Summary830169 +Node: Debugger831508 +Node: Debugging832530 +Node: Debugging Concepts832971 +Node: Debugging Terms834828 +Node: Awk Debugging837403 +Node: Sample Debugging Session838295 +Node: Debugger Invocation838815 +Node: Finding The Bug840199 +Node: List of Debugger Commands846674 +Node: Breakpoint Control848006 +Node: Debugger Execution Control851698 +Node: Viewing And Changing Data855062 +Node: Execution Stack858427 +Node: Debugger Info860065 +Node: Miscellaneous Debugger Commands864082 +Node: Readline Support869274 +Node: Limitations870166 +Node: Debugging Summary872263 +Node: Arbitrary Precision Arithmetic873431 +Node: Computer Arithmetic874847 +Ref: table-numeric-ranges878448 +Ref: Computer Arithmetic-Footnote-1879307 +Node: Math Definitions879364 +Ref: table-ieee-formats882651 +Ref: Math Definitions-Footnote-1883255 +Node: MPFR features883360 +Node: FP Math Caution885031 +Ref: FP Math Caution-Footnote-1886081 +Node: Inexactness of computations886450 +Node: Inexact representation887398 +Node: Comparing FP Values888753 +Node: Errors accumulate889826 +Node: Getting Accuracy891259 +Node: Try To Round893918 +Node: Setting precision894817 +Ref: table-predefined-precision-strings895501 +Node: Setting the rounding mode897295 +Ref: table-gawk-rounding-modes897659 +Ref: Setting the rounding mode-Footnote-1901113 +Node: Arbitrary Precision Integers901292 +Ref: Arbitrary Precision Integers-Footnote-1904283 +Node: POSIX Floating Point Problems904432 +Ref: POSIX Floating Point Problems-Footnote-1908308 +Node: Floating point summary908346 +Node: Dynamic Extensions910538 +Node: Extension Intro912090 +Node: Plugin License913356 +Node: Extension Mechanism Outline914153 +Ref: figure-load-extension914581 +Ref: figure-register-new-function916061 +Ref: figure-call-new-function917065 +Node: Extension API Description919051 +Node: Extension API Functions Introduction920501 +Node: General Data Types925337 +Ref: General Data Types-Footnote-1931024 +Node: Memory Allocation Functions931323 +Ref: Memory Allocation Functions-Footnote-1934153 +Node: Constructor Functions934249 +Node: Registration Functions935983 +Node: Extension Functions936668 +Node: Exit Callback Functions938964 +Node: Extension Version String940212 +Node: Input Parsers940862 +Node: Output Wrappers950677 +Node: Two-way processors955193 +Node: Printing Messages957397 +Ref: Printing Messages-Footnote-1958474 +Node: Updating `ERRNO'958626 +Node: Requesting Values959366 +Ref: table-value-types-returned960094 +Node: Accessing Parameters961052 +Node: Symbol Table Access962283 +Node: Symbol table by name962797 +Node: Symbol table by cookie964777 +Ref: Symbol table by cookie-Footnote-1968916 +Node: Cached values968979 +Ref: Cached values-Footnote-1972483 +Node: Array Manipulation972574 +Ref: Array Manipulation-Footnote-1973672 +Node: Array Data Types973711 +Ref: Array Data Types-Footnote-1976368 +Node: Array Functions976460 +Node: Flattening Arrays980314 +Node: Creating Arrays987201 +Node: Extension API Variables991968 +Node: Extension Versioning992604 +Node: Extension API Informational Variables994505 +Node: Extension API Boilerplate995593 +Node: Finding Extensions999409 +Node: Extension Example999969 +Node: Internal File Description1000741 +Node: Internal File Ops1004808 +Ref: Internal File Ops-Footnote-11016466 +Node: Using Internal File Ops1016606 +Ref: Using Internal File Ops-Footnote-11018989 +Node: Extension Samples1019262 +Node: Extension Sample File Functions1020786 +Node: Extension Sample Fnmatch1028388 +Node: Extension Sample Fork1029870 +Node: Extension Sample Inplace1031083 +Node: Extension Sample Ord1032758 +Node: Extension Sample Readdir1033594 +Ref: table-readdir-file-types1034450 +Node: Extension Sample Revout1035261 +Node: Extension Sample Rev2way1035852 +Node: Extension Sample Read write array1036593 +Node: Extension Sample Readfile1038532 +Node: Extension Sample Time1039627 +Node: Extension Sample API Tests1040976 +Node: gawkextlib1041467 +Node: Extension summary1044117 +Node: Extension Exercises1047799 +Node: Language History1048521 +Node: V7/SVR3.11050178 +Node: SVR41052359 +Node: POSIX1053804 +Node: BTL1055193 +Node: POSIX/GNU1055927 +Node: Feature History1061496 +Node: Common Extensions1074587 +Node: Ranges and Locales1075911 +Ref: Ranges and Locales-Footnote-11080550 +Ref: Ranges and Locales-Footnote-21080577 +Ref: Ranges and Locales-Footnote-31080811 +Node: Contributors1081032 +Node: History summary1086572 +Node: Installation1087941 +Node: Gawk Distribution1088897 +Node: Getting1089381 +Node: Extracting1090205 +Node: Distribution contents1091847 +Node: Unix Installation1097564 +Node: Quick Installation1098181 +Node: Additional Configuration Options1100612 +Node: Configuration Philosophy1102352 +Node: Non-Unix Installation1104703 +Node: PC Installation1105161 +Node: PC Binary Installation1106487 +Node: PC Compiling1108335 +Ref: PC Compiling-Footnote-11111356 +Node: PC Testing1111461 +Node: PC Using1112637 +Node: Cygwin1116752 +Node: MSYS1117575 +Node: VMS Installation1118073 +Node: VMS Compilation1118865 +Ref: VMS Compilation-Footnote-11120087 +Node: VMS Dynamic Extensions1120145 +Node: VMS Installation Details1121829 +Node: VMS Running1124081 +Node: VMS GNV1126922 +Node: VMS Old Gawk1127656 +Node: Bugs1128126 +Node: Other Versions1132030 +Node: Installation summary1138243 +Node: Notes1139299 +Node: Compatibility Mode1140164 +Node: Additions1140946 +Node: Accessing The Source1141871 +Node: Adding Code1143307 +Node: New Ports1149479 +Node: Derived Files1153961 +Ref: Derived Files-Footnote-11159436 +Ref: Derived Files-Footnote-21159470 +Ref: Derived Files-Footnote-31160066 +Node: Future Extensions1160180 +Node: Implementation Limitations1160786 +Node: Extension Design1162034 +Node: Old Extension Problems1163188 +Ref: Old Extension Problems-Footnote-11164705 +Node: Extension New Mechanism Goals1164762 +Ref: Extension New Mechanism Goals-Footnote-11168122 +Node: Extension Other Design Decisions1168311 +Node: Extension Future Growth1170419 +Node: Old Extension Mechanism1171255 +Node: Notes summary1173017 +Node: Basic Concepts1174203 +Node: Basic High Level1174884 +Ref: figure-general-flow1175156 +Ref: figure-process-flow1175755 +Ref: Basic High Level-Footnote-11178984 +Node: Basic Data Typing1179169 +Node: Glossary1182497 +Node: Copying1207655 +Node: GNU Free Documentation License1245211 +Node: Index1270347  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 4cb6a781..543c9bba 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -4335,30 +4335,26 @@ behaves. @cindex @env{AWKPATH} environment variable @cindex directories, searching for source files @cindex search paths, for source files -@cindex differences in @command{awk} and @command{gawk}, @code{AWKPATH} environment variable +@cindex differences in @command{awk} and @command{gawk}, @env{AWKPATH} environment variable @ifinfo The previous @value{SECTION} described how @command{awk} program files can be named on the command line with the @option{-f} option. @end ifinfo In most @command{awk} -implementations, you must supply a precise path name for each program +implementations, you must supply a precise pathname for each program file, unless the file is in the current directory. -But in @command{gawk}, if the @value{FN} supplied to the @option{-f} +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 file with the specified name. The search path is a string consisting of directory names -separated by colons@footnote{Semicolons on MS-Windows and MS-DOS.}. @command{gawk} gets its search path from the +separated by colons.@footnote{Semicolons on MS-Windows and MS-DOS.} +@command{gawk} gets its search path from the @env{AWKPATH} environment variable. If that variable does not exist, -@command{gawk} uses a default path, -@samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk} -may use a different directory; it -will depend upon how @command{gawk} was built and installed. The actual -directory is the value of @code{$(datadir)} generated when -@command{gawk} was configured. You probably don't need to worry about this, -though.} +or if it has an empty value, +@command{gawk} uses a default path (described shortly). The search path feature is particularly helpful for building libraries of useful @command{awk} functions. The library files can be placed in a @@ -4366,7 +4362,7 @@ standard directory in the default path and then specified on the command line with a short @value{FN}. Otherwise, you would have to type the full @value{FN} for each file. -By using the @option{-i} option, or the @option{-e} and @option{-f} options, your command-line +By using the @option{-i} or @option{-f} options, your command-line @command{awk} programs can use facilities in @command{awk} library files (@pxref{Library Functions}). Path searching is not done if @command{gawk} is in compatibility mode. @@ -4374,7 +4370,7 @@ This is true for both @option{--traditional} and @option{--posix}. @xref{Options}. If the source code file is not found after the initial search, the path is searched -again after adding the default @samp{.awk} suffix to the @value{FN}. +again after adding the suffix @samp{.awk} to the @value{FN}. @command{gawk}'s path search mechanism is similar to the shell's. @@ -4386,19 +4382,30 @@ directory. colon or by placing two colons next to each other [@samp{::}].) @quotation NOTE -@command{gawk} always looks in the current directory @emph{before} -searching @env{AWKPATH}. Thus, while you can include the current directory -in the search path, either explicitly or with a null entry, there is no -real reason to do so. -@c Prior to 4.0, gawk searched the current directory after the -@c path search, but it's not worth documenting it. +To include the current directory in the path, either place @file{.} +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 +in the current directory, you must include @file{.} either as a separate +entry, or as a null entry in the search path. @end quotation -If @env{AWKPATH} is not defined in the -environment, @command{gawk} places its default search path into -@code{ENVIRON["AWKPATH"]}. This makes it easy to determine -the actual search path that @command{gawk} used -from within an @command{awk} program. +The default value for @env{AWKPATH} is +@samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk} +may use a different directory; it +will depend upon how @command{gawk} was built and installed. The actual +directory is the value of @code{$(datadir)} generated when +@command{gawk} was configured. You probably don't need to worry about this, +though.} Since @file{.} is included at the beginning, @command{gawk} +searches first in the current directory and then in @file{/usr/local/share/awk}. +In practice, this means that you will rarely need to change the +value of @env{AWKPATH}. + +@command{gawk} places the value of the search path that it used into +@code{ENVIRON["AWKPATH"]}. This provides access to the actual search +path value from within an @command{awk} program. While you can change @code{ENVIRON["AWKPATH"]} within your @command{awk} program, this has no effect on the running program's behavior. This makes @@ -4422,6 +4429,15 @@ the platform. For example, on GNU/Linux systems, the suffix @samp{.so} is used. The search path specified is also used for extensions loaded via the @code{@@load} keyword (@pxref{Loading Shared Libraries}). +If @env{AWKLIBPATH} does not exist in the environment, or if it has +an empty value, @command{gawk} uses a default path; this +is typically @samp{/usr/local/lib/gawk}, although it can vary depending +upon how @command{gawk} was built. + +@command{gawk} places the value of the search path that it used into +@code{ENVIRON["AWKLIBPATH"]}. This provides access to the actual search +path value from within an @command{awk} program. + @node Other Environment Variables @subsection Other Environment Variables @@ -4634,9 +4650,9 @@ or: @end example @noindent -are valid. The @code{AWKPATH} environment variable can be of great +are valid. The @env{AWKPATH} environment variable can be of great value when using @code{@@include}. The same rules for the use -of the @code{AWKPATH} variable in command-line file searches +of the @env{AWKPATH} variable in command-line file searches (@pxref{AWKPATH Variable}) apply to @code{@@include} also. @@ -4644,7 +4660,7 @@ 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 @code{AWKPATH} +either 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 @@ -37638,8 +37654,8 @@ EMX (OS/2 only) supports at least the @samp{|&} operator. @cindex search paths, for source files @cindex @command{gawk}, MS-DOS version of @cindex @command{gawk}, MS-Windows version of -@cindex @code{;} (semicolon), @code{AWKPATH} variable and -@cindex semicolon (@code{;}), @code{AWKPATH} variable and +@cindex @code{;} (semicolon), @env{AWKPATH} variable and +@cindex semicolon (@code{;}), @env{AWKPATH} variable and @cindex @env{AWKPATH} environment variable The MS-DOS and MS-Windows versions of @command{gawk} search for program files as described in @ref{AWKPATH Variable}. However, diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 001dd8b7..2e037a8f 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -4246,30 +4246,26 @@ behaves. @cindex @env{AWKPATH} environment variable @cindex directories, searching for source files @cindex search paths, for source files -@cindex differences in @command{awk} and @command{gawk}, @code{AWKPATH} environment variable +@cindex differences in @command{awk} and @command{gawk}, @env{AWKPATH} environment variable @ifinfo The previous @value{SECTION} described how @command{awk} program files can be named on the command line with the @option{-f} option. @end ifinfo In most @command{awk} -implementations, you must supply a precise path name for each program +implementations, you must supply a precise pathname for each program file, unless the file is in the current directory. -But in @command{gawk}, if the @value{FN} supplied to the @option{-f} +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 file with the specified name. The search path is a string consisting of directory names -separated by colons@footnote{Semicolons on MS-Windows and MS-DOS.}. @command{gawk} gets its search path from the +separated by colons.@footnote{Semicolons on MS-Windows and MS-DOS.} +@command{gawk} gets its search path from the @env{AWKPATH} environment variable. If that variable does not exist, -@command{gawk} uses a default path, -@samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk} -may use a different directory; it -will depend upon how @command{gawk} was built and installed. The actual -directory is the value of @code{$(datadir)} generated when -@command{gawk} was configured. You probably don't need to worry about this, -though.} +or if it has an empty value, +@command{gawk} uses a default path (described shortly). The search path feature is particularly helpful for building libraries of useful @command{awk} functions. The library files can be placed in a @@ -4277,7 +4273,7 @@ standard directory in the default path and then specified on the command line with a short @value{FN}. Otherwise, you would have to type the full @value{FN} for each file. -By using the @option{-i} option, or the @option{-e} and @option{-f} options, your command-line +By using the @option{-i} or @option{-f} options, your command-line @command{awk} programs can use facilities in @command{awk} library files (@pxref{Library Functions}). Path searching is not done if @command{gawk} is in compatibility mode. @@ -4285,7 +4281,7 @@ This is true for both @option{--traditional} and @option{--posix}. @xref{Options}. If the source code file is not found after the initial search, the path is searched -again after adding the default @samp{.awk} suffix to the @value{FN}. +again after adding the suffix @samp{.awk} to the @value{FN}. @command{gawk}'s path search mechanism is similar to the shell's. @@ -4297,19 +4293,30 @@ directory. colon or by placing two colons next to each other [@samp{::}].) @quotation NOTE -@command{gawk} always looks in the current directory @emph{before} -searching @env{AWKPATH}. Thus, while you can include the current directory -in the search path, either explicitly or with a null entry, there is no -real reason to do so. -@c Prior to 4.0, gawk searched the current directory after the -@c path search, but it's not worth documenting it. +To include the current directory in the path, either place @file{.} +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 +in the current directory, you must include @file{.} either as a separate +entry, or as a null entry in the search path. @end quotation -If @env{AWKPATH} is not defined in the -environment, @command{gawk} places its default search path into -@code{ENVIRON["AWKPATH"]}. This makes it easy to determine -the actual search path that @command{gawk} used -from within an @command{awk} program. +The default value for @env{AWKPATH} is +@samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk} +may use a different directory; it +will depend upon how @command{gawk} was built and installed. The actual +directory is the value of @code{$(datadir)} generated when +@command{gawk} was configured. You probably don't need to worry about this, +though.} Since @file{.} is included at the beginning, @command{gawk} +searches first in the current directory and then in @file{/usr/local/share/awk}. +In practice, this means that you will rarely need to change the +value of @env{AWKPATH}. + +@command{gawk} places the value of the search path that it used into +@code{ENVIRON["AWKPATH"]}. This provides access to the actual search +path value from within an @command{awk} program. While you can change @code{ENVIRON["AWKPATH"]} within your @command{awk} program, this has no effect on the running program's behavior. This makes @@ -4333,6 +4340,15 @@ the platform. For example, on GNU/Linux systems, the suffix @samp{.so} is used. The search path specified is also used for extensions loaded via the @code{@@load} keyword (@pxref{Loading Shared Libraries}). +If @env{AWKLIBPATH} does not exist in the environment, or if it has +an empty value, @command{gawk} uses a default path; this +is typically @samp{/usr/local/lib/gawk}, although it can vary depending +upon how @command{gawk} was built. + +@command{gawk} places the value of the search path that it used into +@code{ENVIRON["AWKLIBPATH"]}. This provides access to the actual search +path value from within an @command{awk} program. + @node Other Environment Variables @subsection Other Environment Variables @@ -4545,9 +4561,9 @@ or: @end example @noindent -are valid. The @code{AWKPATH} environment variable can be of great +are valid. The @env{AWKPATH} environment variable can be of great value when using @code{@@include}. The same rules for the use -of the @code{AWKPATH} variable in command-line file searches +of the @env{AWKPATH} variable in command-line file searches (@pxref{AWKPATH Variable}) apply to @code{@@include} also. @@ -4555,7 +4571,7 @@ 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 @code{AWKPATH} +either 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 @@ -36732,8 +36748,8 @@ EMX (OS/2 only) supports at least the @samp{|&} operator. @cindex search paths, for source files @cindex @command{gawk}, MS-DOS version of @cindex @command{gawk}, MS-Windows version of -@cindex @code{;} (semicolon), @code{AWKPATH} variable and -@cindex semicolon (@code{;}), @code{AWKPATH} variable and +@cindex @code{;} (semicolon), @env{AWKPATH} variable and +@cindex semicolon (@code{;}), @env{AWKPATH} variable and @cindex @env{AWKPATH} environment variable The MS-DOS and MS-Windows versions of @command{gawk} search for program files as described in @ref{AWKPATH Variable}. However, diff --git a/io.c b/io.c index 7154a710..32caadfb 100644 --- a/io.c +++ b/io.c @@ -2505,7 +2505,6 @@ do_getline(int into_variable, IOBUF *iop) typedef struct { const char *envname; char **dfltp; /* pointer to address of default path */ - char try_cwd; /* always search current directory? */ char **awkpath; /* array containing library search paths */ int max_pathlen; /* length of the longest item in awkpath */ } path_info; @@ -2513,13 +2512,11 @@ typedef struct { static path_info pi_awkpath = { /* envname */ "AWKPATH", /* dfltp */ & defpath, - /* try_cwd */ true, }; static path_info pi_awklibpath = { /* envname */ "AWKLIBPATH", /* dfltp */ & deflibpath, - /* try_cwd */ false, }; /* init_awkpath --- split path(=$AWKPATH) into components */ @@ -2577,30 +2574,6 @@ init_awkpath(path_info *pi) #undef INC_PATH } -/* get_cwd -- get current working directory */ - -static char * -get_cwd () -{ -#define BSIZE 100 - char *buf; - size_t bsize = BSIZE; - - emalloc(buf, char *, bsize * sizeof(char), "get_cwd"); - while (true) { - if (getcwd(buf, bsize) == buf) - return buf; - if (errno != ERANGE) { - efree(buf); - return NULL; - } - bsize *= 2; - erealloc(buf, char *, bsize * sizeof(char), "get_cwd"); - } -#undef BSIZE -} - - /* do_find_source --- search $AWKPATH for file, return NULL if not found */ static char * @@ -2622,24 +2595,6 @@ do_find_source(const char *src, struct stat *stb, int *errcode, path_info *pi) return NULL; } - /* try current directory before $AWKPATH search */ - if (pi->try_cwd && stat(src, stb) == 0) { - path = get_cwd(); - if (path == NULL) { - *errcode = errno; - return NULL; - } - erealloc(path, char *, strlen(path) + strlen(src) + 2, "do_find_source"); -#ifdef VMS - if (strcspn(path,">]:") == strlen(path)) - strcat(path, "/"); -#else - strcat(path, "/"); -#endif - strcat(path, src); - return path; - } - if (pi->awkpath == NULL) init_awkpath(pi); diff --git a/main.c b/main.c index 03decbb8..3bee0488 100644 --- a/main.c +++ b/main.c @@ -1078,18 +1078,23 @@ path_environ(const char *pname, const char *dflt) NODE *tmp; tmp = make_string(pname, strlen(pname)); - if (! in_array(ENVIRON_node, tmp)) { - /* - * On VMS, environ[] only holds a subset of what getenv() can - * find, so look AWKPATH up before resorting to default path. - */ - val = getenv(pname); - if (val == NULL) - val = dflt; - aptr = assoc_lookup(ENVIRON_node, tmp); + /* + * On VMS, environ[] only holds a subset of what getenv() can + * find, so look AWKPATH up before resorting to default path. + */ + val = getenv(pname); + if (val == NULL || *val == '\0') + val = dflt; + aptr = assoc_lookup(ENVIRON_node, tmp); + /* + * If original value was the empty string, set it to + * the default value. + */ + if ((*aptr)->stlen == 0) { unref(*aptr); *aptr = make_string(val, strlen(val)); } + unref(tmp); } @@ -1136,6 +1141,11 @@ load_environ() /* * Put AWKPATH and AWKLIBPATH into ENVIRON if not already there. * This allows querying it from within awk programs. + * + * October 2014: + * If their values are "", override with the default values; + * since 2.10 AWKPATH used default value if environment's + * value was "". */ path_environ("AWKPATH", defpath); path_environ("AWKLIBPATH", deflibpath); -- cgit v1.2.3 From 98ba9765f8e6b0cd22e94e226a21a46b1b6eaf9b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 17 Oct 2014 09:59:33 +0300 Subject: Fix assumptions about AWKPATH in awklib and test. --- awklib/ChangeLog | 5 +++++ awklib/Makefile.am | 2 +- awklib/Makefile.in | 2 +- test/ChangeLog | 5 +++++ test/Makefile.am | 4 ++-- test/Makefile.in | 4 ++-- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/awklib/ChangeLog b/awklib/ChangeLog index 6ef0bbde..13d6b090 100644 --- a/awklib/ChangeLog +++ b/awklib/ChangeLog @@ -1,3 +1,8 @@ +2014-10-17 Andrew J. Schorr + + * Makefile.am (stamp-eg): Use explicit ./extract.awk to avoid + assumptions about AWKPATH in the environment. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff --git a/awklib/Makefile.am b/awklib/Makefile.am index 6ffbea81..82b7e07f 100644 --- a/awklib/Makefile.am +++ b/awklib/Makefile.am @@ -68,7 +68,7 @@ $(srcdir)/stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi cd $(srcdir) && \ rm -fr eg && \ rm -fr stamp-eg && \ - $(AWKPROG) -f extract.awk ../doc/gawk.texi ../doc/gawkinet.texi + $(AWKPROG) -f ./extract.awk ../doc/gawk.texi ../doc/gawkinet.texi @echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg diff --git a/awklib/Makefile.in b/awklib/Makefile.in index d32ae04a..4c9a0552 100644 --- a/awklib/Makefile.in +++ b/awklib/Makefile.in @@ -721,7 +721,7 @@ $(srcdir)/stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi cd $(srcdir) && \ rm -fr eg && \ rm -fr stamp-eg && \ - $(AWKPROG) -f extract.awk ../doc/gawk.texi ../doc/gawkinet.texi + $(AWKPROG) -f ./extract.awk ../doc/gawk.texi ../doc/gawkinet.texi @echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg diff --git a/test/ChangeLog b/test/ChangeLog index 4868f374..f85de800 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-10-17 Andrew J. Schorr + + * Makefile.am (profile1, testext): Use explicit ./foo.awk to avoid + assumptions about AWKPATH in the environment. + 2014-10-12 Arnold D. Robbins * Makefile.am (charset-msg-start): Add a list of needed locales. diff --git a/test/Makefile.am b/test/Makefile.am index 9b3ede51..f0965d77 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1670,7 +1670,7 @@ dumpvars:: profile1: @echo $@ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 - @$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out + @$(AWK) -f ./ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out @$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \ cp "$(srcdir)"/dtdgport.awk > $@.ok ; } @@ -1861,7 +1861,7 @@ inplace3:: testext:: @echo $@ @$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk - @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk readdir: diff --git a/test/Makefile.in b/test/Makefile.in index 2b8a4a16..3df34522 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2095,7 +2095,7 @@ dumpvars:: profile1: @echo $@ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 - @$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out + @$(AWK) -f ./ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out @$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \ cp "$(srcdir)"/dtdgport.awk > $@.ok ; } @@ -2285,7 +2285,7 @@ inplace3:: testext:: @echo $@ @$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk - @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk readdir: -- cgit v1.2.3 From 92b1be4a48425e584f29e223a56b261dddb4cdd5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 17 Oct 2014 09:59:58 +0300 Subject: Doc updates. --- doc/ChangeLog | 6 ++++++ doc/gawk.info | 4 ++-- doc/gawk.texi | 6 +++--- doc/gawktexi.in | 6 +++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index fe9bea7e..850616da 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-17 Arnold D. Robbins + + * gawktexi.in: Fix date in docbook attribution for new Foreword; + thanks to Antonio Columbo for the catch. Update latest version + of gettext. + 2014-10-15 Arnold D. Robbins * gawk.1: Fix default value for AWKLIBPATH. diff --git a/doc/gawk.info b/doc/gawk.info index 00a8adcb..f0b336bc 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -20551,8 +20551,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.2 -(ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.2.tar.gz). +writing, the latest version of GNU `gettext' is version 0.19.3 +(ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.3.tar.gz). If a translation of `gawk''s messages exists, then `gawk' produces usage messages, warnings, and fatal errors in the local language. diff --git a/doc/gawk.texi b/doc/gawk.texi index 543c9bba..be754e94 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -1228,7 +1228,7 @@ March, 2001 Author of mawk - March, 2001 + October, 2014 @end docbook @@ -28828,8 +28828,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.2.tar.gz, -@value{PVERSION} 0.19.2}. +@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.3.tar.gz, +@value{PVERSION} 0.19.3}. If a translation of @command{gawk}'s messages exists, then @command{gawk} produces usage messages, warnings, diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 2e037a8f..43aab088 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -1223,7 +1223,7 @@ March, 2001 Author of mawk - March, 2001 + October, 2014 @end docbook @@ -27922,8 +27922,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.2.tar.gz, -@value{PVERSION} 0.19.2}. +@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.3.tar.gz, +@value{PVERSION} 0.19.3}. If a translation of @command{gawk}'s messages exists, then @command{gawk} produces usage messages, warnings, -- cgit v1.2.3 From 49a291d1713912ffb6801ced6f0c517e430a9a71 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 17 Oct 2014 12:17:37 +0300 Subject: VMS build fixes. --- ChangeLog | 6 ++++++ ext.c | 3 +++ vms/ChangeLog | 11 +++++++++++ vms/config_h.com | 2 +- vms/vmsbuild.com | 6 +++--- vms/vmstest.com | 3 +++ 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56fbd066..a7b9f36e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-10-17 John E. Malmberg + + * ext.c (close_extensions): Test for null pointer since + since this can be called by signal handler before the + pointers are initialized. + 2014-10-15 Arnold D. Robbins Make sane the handling of AWKPATH and AWKLIBPATH: diff --git a/ext.c b/ext.c index afb8d715..cf813674 100644 --- a/ext.c +++ b/ext.c @@ -397,6 +397,9 @@ close_extensions() { SRCFILE *s; + if (srcfiles == NULL) + return; + for (s = srcfiles->next; s != srcfiles; s = s->next) if (s->stype == SRC_EXTLIB && s->fini_func) (*s->fini_func)(); diff --git a/vms/ChangeLog b/vms/ChangeLog index 9e055cf4..c7dd4233 100644 --- a/vms/ChangeLog +++ b/vms/ChangeLog @@ -1,3 +1,14 @@ +2014-10-17 John E. Malmberg + + * config_h.com: Use sys$disk: instead of prj_root: for + copying the configure file. + * gawk_alias_setup.com: Fix removal of out of date aliases. + * vmsbuild.com: Fix a typo for symbol CNAME and a case sensitive + test for "VAX" .eq. "vax" that failed. Also disable verify + while looking up the actual version. + * vmstest.com: Make sure that the test directory exists when + using a search list. + 2014-04-18 John E. Malmberg * gawk_alias_setup.com: Fix problem with file links on Vax/VMS. diff --git a/vms/config_h.com b/vms/config_h.com index c1d3becf..0074a65a 100644 --- a/vms/config_h.com +++ b/vms/config_h.com @@ -104,7 +104,7 @@ $! On some platforms, DCL search has problems with searching a file $! on a NFS mounted volume. So copy it to sys$scratch: $! $if f$search(configure_script) .nes. "" then delete 'configure_script';* -$copy PRJ_ROOT:configure 'configure_script' +$copy sys$disk:configure 'configure_script' $! $! $! Write out the header diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com index c13e4b57..a46cc2ca 100644 --- a/vms/vmsbuild.com +++ b/vms/vmsbuild.com @@ -48,7 +48,7 @@ $ CFLAGS = "/Incl=[]/Obj=[]/Opt=noInline/Def=(''CDEFS')''CCFLAGS'" $ LIBS = "sys$share:vaxcrtl.exe/Shareable" $ else !!VAXC $! neither GNUC nor VAXC, assume DECC (same for either VAX or Alpha) -$ if arch_name .eqs. "vax" +$ if arch_name .eqs. "VAX" $ then $ CFLOAT = "" $ else @@ -58,7 +58,7 @@ $ CC = "cc/DECC/Prefix=All" $ CNAME = "/NAME=(AS_IS,SHORT) $ CINC = "/NESTED_INCLUDE=NONE" $ CFLAGS = "/Incl=([],[.vms])/Obj=[]/Def=(''CDEFS')''CINC'''CCFLAGS'" -$ CFLAGS = CNAMES + CFLOAT + CFLAGS +$ CFLAGS = CNAME + CFLOAT + CFLAGS $ LIBS = "" ! DECC$SHR instead of VAXCRTL, no special link option needed $ endif !VAXC $ endif !GNUC @@ -147,8 +147,8 @@ psect_attr=environ,noshr !extern [noshare] char ** stack=48 !preallocate more pages (default is 20) iosegment=128 !ditto (default is 32) $! -$ v1 = f$verify(1) $ @[.vms]gawk_ident.com +$ v1 = f$verify(1) $ open/append Fopt gawk.opt $ write Fopt libs $ close Fopt diff --git a/vms/vmstest.com b/vms/vmstest.com index 30bdbf22..a2ab9bff 100644 --- a/vms/vmstest.com +++ b/vms/vmstest.com @@ -27,6 +27,9 @@ $ gawk = "$sys$disk:[-]gawk" $ AWKPATH_srcdir = "define/User AWKPATH sys$disk:[]" $ AWKLIBPATH_dir = "define/User AWKLIBPATH sys$disk:[-]" $ +$! Make sure that the default directory exists on a search list. +$ def_dir = f$environment("default") +$ create/dir 'def_dir' $ listdepth = 0 $ pipeok = 0 $ floatmode = -1 ! 0: D_float, 1: G_float, 2: IEEE T_float -- cgit v1.2.3 From 2c84999804e28517cf467a6ed6788aea06e146c0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 17 Oct 2014 13:55:12 +0300 Subject: More minor doc updates. --- NEWS | 6 ++++++ doc/gawk.info | 2 ++ doc/gawk.texi | 4 ++-- doc/gawktexi.in | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index f6fab602..8791de31 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,12 @@ Changes from 4.1.1 to 4.1.2 7. The "where" command has been added to the debugger as an alias for "backtrace". This will make life easier for long-time GDB users. +8. Gawk no longer explicitly checks the current directory after doing + a path search of AWKPATH. The default value continues to have "." at + the front, so most people should not be affected. If you have your own + AWKPATH setting, be sure to put "." in it somewhere. The documentation + has been updated and clarified. + XX. A number of bugs have been fixed. See the ChangeLog. Changes from 4.1.0 to 4.1.1 diff --git a/doc/gawk.info b/doc/gawk.info index f0b336bc..4919b2fe 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -32095,6 +32095,8 @@ Index * dark corner, multiline records: Multiple Line. (line 35) * dark corner, NF variable, decrementing: Changing Fields. (line 107) * dark corner, OFMT variable: OFMT. (line 27) +* dark corner, regexp as second argument to index(): String Functions. + (line 164) * dark corner, regexp constants: Using Constant Regexps. (line 6) * dark corner, regexp constants, /= operator and: Assignment Ops. diff --git a/doc/gawk.texi b/doc/gawk.texi index be754e94..134bf356 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -17245,6 +17245,7 @@ $ @kbd{awk 'BEGIN @{ print index("peanut", "an") @}'} @noindent If @var{find} is not found, @code{index()} returns zero. +@cindex dark corner, regexp as second argument to @code{index()} 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 @@ -38289,8 +38290,6 @@ Date: Wed, 4 Sep 1996 08:11:48 -0700 (PDT) @end docbook - - There are a number of other freely available @command{awk} implementations. This @value{SECTION} briefly describes where to get them: @@ -41926,3 +41925,4 @@ But to use it you have to say which sorta sucks. TODO: +Check that all dark corners are indexed properly. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 43aab088..a5f696ab 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -16529,6 +16529,7 @@ $ @kbd{awk 'BEGIN @{ print index("peanut", "an") @}'} @noindent If @var{find} is not found, @code{index()} returns zero. +@cindex dark corner, regexp as second argument to @code{index()} 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 @@ -37383,8 +37384,6 @@ Date: Wed, 4 Sep 1996 08:11:48 -0700 (PDT) @end docbook - - There are a number of other freely available @command{awk} implementations. This @value{SECTION} briefly describes where to get them: @@ -41020,3 +41019,4 @@ But to use it you have to say which sorta sucks. TODO: +Check that all dark corners are indexed properly. -- cgit v1.2.3 From cbecf843696d2574accb198b84d9386eef15341c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 25 Oct 2014 20:15:24 +0300 Subject: Sync dfa.c with grep. --- ChangeLog | 6 +++++- dfa.c | 33 ++++++++++++--------------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7b9f36e..533ee9c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-10-25 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. + 2014-10-17 John E. Malmberg * ext.c (close_extensions): Test for null pointer since @@ -32,7 +36,7 @@ 2014-10-08 Arnold D. Robbins - * dfa.c: Sync wit GNU grep. + * dfa.c: Sync with GNU grep. 2014-10-05 Arnold D. Robbins diff --git a/dfa.c b/dfa.c index a53aed01..9c3901a6 100644 --- a/dfa.c +++ b/dfa.c @@ -3082,17 +3082,7 @@ match_mb_charset (struct dfa *d, state_num s, position pos, int context; /* Check syntax bits. */ - if (wc == (wchar_t) eolbyte) - { - if (!(syntax_bits & RE_DOT_NEWLINE)) - return 0; - } - else if (wc == (wchar_t) '\0') - { - if (syntax_bits & RE_DOT_NOT_NULL) - return 0; - } - else if (wc == WEOF) + if (wc == WEOF) return 0; context = wchar_context (wc); @@ -3422,20 +3412,20 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, continue; } - /* Falling back to the glibc matcher in this case gives - better performance (up to 25% better on [a-z], for - example) and enables support for collating symbols and - equivalence classes. */ - if (d->states[s].has_mbcset && backref) - { - *backref = 1; - goto done; - } - /* The following code is used twice. Use a macro to avoid the risk that they diverge. */ #define State_transition() \ do { \ + /* Falling back to the glibc matcher in this case gives \ + better performance (up to 25% better on [a-z], for \ + example) and enables support for collating symbols and \ + equivalence classes. */ \ + if (d->states[s].has_mbcset && backref) \ + { \ + *backref = 1; \ + goto done; \ + } \ + \ /* Can match with a multibyte character (and multi-character \ collating element). Transition table might be updated. */ \ s = transit_state (d, s, &p, (unsigned char *) end); \ @@ -3472,6 +3462,7 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, { while (t[*p] == 0) p++; + s1 = 0; s = t[*p++]; } -- cgit v1.2.3 From 50f8512202d7a52effe43422323e2f0c7184afe0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 25 Oct 2014 20:16:06 +0300 Subject: Typo fixes in the doc. --- doc/ChangeLog | 4 ++ doc/gawk.info | 174 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 6 +- doc/gawktexi.in | 6 +- 4 files changed, 97 insertions(+), 93 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 850616da..d97f31ca 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-10-25 Arnold D. Robbins + + * gawktexi.in: Minor typo fixes. + 2014-10-17 Arnold D. Robbins * gawktexi.in: Fix date in docbook attribution for new Foreword; diff --git a/doc/gawk.info b/doc/gawk.info index 4919b2fe..0583554f 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -25688,8 +25688,8 @@ returned as a record. number and the file name, separated by a forward slash character. On systems where the directory entry contains the file type, the record has a third field (also separated by a slash) which is a single letter -indicating the type of the file. The letters are file types are shown -in *note table-readdir-file-types::. +indicating the type of the file. The letters and their corresponding +file types are shown in *note table-readdir-file-types::. Letter File Type -------------------------------------------------------------------------- @@ -26791,7 +26791,7 @@ in POSIX `awk', in the order they were added to `gawk'. - The `-M' and `--bignum' options enable MPFR. - - The `-o' only does pretty-printing. + - The `-o' option only does pretty-printing. - The `-p' option is used for profiling. @@ -34754,89 +34754,89 @@ Node: Extension Sample Fork1029870 Node: Extension Sample Inplace1031083 Node: Extension Sample Ord1032758 Node: Extension Sample Readdir1033594 -Ref: table-readdir-file-types1034450 -Node: Extension Sample Revout1035261 -Node: Extension Sample Rev2way1035852 -Node: Extension Sample Read write array1036593 -Node: Extension Sample Readfile1038532 -Node: Extension Sample Time1039627 -Node: Extension Sample API Tests1040976 -Node: gawkextlib1041467 -Node: Extension summary1044117 -Node: Extension Exercises1047799 -Node: Language History1048521 -Node: V7/SVR3.11050178 -Node: SVR41052359 -Node: POSIX1053804 -Node: BTL1055193 -Node: POSIX/GNU1055927 -Node: Feature History1061496 -Node: Common Extensions1074587 -Node: Ranges and Locales1075911 -Ref: Ranges and Locales-Footnote-11080550 -Ref: Ranges and Locales-Footnote-21080577 -Ref: Ranges and Locales-Footnote-31080811 -Node: Contributors1081032 -Node: History summary1086572 -Node: Installation1087941 -Node: Gawk Distribution1088897 -Node: Getting1089381 -Node: Extracting1090205 -Node: Distribution contents1091847 -Node: Unix Installation1097564 -Node: Quick Installation1098181 -Node: Additional Configuration Options1100612 -Node: Configuration Philosophy1102352 -Node: Non-Unix Installation1104703 -Node: PC Installation1105161 -Node: PC Binary Installation1106487 -Node: PC Compiling1108335 -Ref: PC Compiling-Footnote-11111356 -Node: PC Testing1111461 -Node: PC Using1112637 -Node: Cygwin1116752 -Node: MSYS1117575 -Node: VMS Installation1118073 -Node: VMS Compilation1118865 -Ref: VMS Compilation-Footnote-11120087 -Node: VMS Dynamic Extensions1120145 -Node: VMS Installation Details1121829 -Node: VMS Running1124081 -Node: VMS GNV1126922 -Node: VMS Old Gawk1127656 -Node: Bugs1128126 -Node: Other Versions1132030 -Node: Installation summary1138243 -Node: Notes1139299 -Node: Compatibility Mode1140164 -Node: Additions1140946 -Node: Accessing The Source1141871 -Node: Adding Code1143307 -Node: New Ports1149479 -Node: Derived Files1153961 -Ref: Derived Files-Footnote-11159436 -Ref: Derived Files-Footnote-21159470 -Ref: Derived Files-Footnote-31160066 -Node: Future Extensions1160180 -Node: Implementation Limitations1160786 -Node: Extension Design1162034 -Node: Old Extension Problems1163188 -Ref: Old Extension Problems-Footnote-11164705 -Node: Extension New Mechanism Goals1164762 -Ref: Extension New Mechanism Goals-Footnote-11168122 -Node: Extension Other Design Decisions1168311 -Node: Extension Future Growth1170419 -Node: Old Extension Mechanism1171255 -Node: Notes summary1173017 -Node: Basic Concepts1174203 -Node: Basic High Level1174884 -Ref: figure-general-flow1175156 -Ref: figure-process-flow1175755 -Ref: Basic High Level-Footnote-11178984 -Node: Basic Data Typing1179169 -Node: Glossary1182497 -Node: Copying1207655 -Node: GNU Free Documentation License1245211 -Node: Index1270347 +Ref: table-readdir-file-types1034470 +Node: Extension Sample Revout1035281 +Node: Extension Sample Rev2way1035872 +Node: Extension Sample Read write array1036613 +Node: Extension Sample Readfile1038552 +Node: Extension Sample Time1039647 +Node: Extension Sample API Tests1040996 +Node: gawkextlib1041487 +Node: Extension summary1044137 +Node: Extension Exercises1047819 +Node: Language History1048541 +Node: V7/SVR3.11050198 +Node: SVR41052379 +Node: POSIX1053824 +Node: BTL1055213 +Node: POSIX/GNU1055947 +Node: Feature History1061516 +Node: Common Extensions1074614 +Node: Ranges and Locales1075938 +Ref: Ranges and Locales-Footnote-11080577 +Ref: Ranges and Locales-Footnote-21080604 +Ref: Ranges and Locales-Footnote-31080838 +Node: Contributors1081059 +Node: History summary1086599 +Node: Installation1087968 +Node: Gawk Distribution1088924 +Node: Getting1089408 +Node: Extracting1090232 +Node: Distribution contents1091874 +Node: Unix Installation1097591 +Node: Quick Installation1098208 +Node: Additional Configuration Options1100639 +Node: Configuration Philosophy1102379 +Node: Non-Unix Installation1104730 +Node: PC Installation1105188 +Node: PC Binary Installation1106514 +Node: PC Compiling1108362 +Ref: PC Compiling-Footnote-11111383 +Node: PC Testing1111488 +Node: PC Using1112664 +Node: Cygwin1116779 +Node: MSYS1117602 +Node: VMS Installation1118100 +Node: VMS Compilation1118892 +Ref: VMS Compilation-Footnote-11120114 +Node: VMS Dynamic Extensions1120172 +Node: VMS Installation Details1121856 +Node: VMS Running1124108 +Node: VMS GNV1126949 +Node: VMS Old Gawk1127683 +Node: Bugs1128153 +Node: Other Versions1132057 +Node: Installation summary1138270 +Node: Notes1139326 +Node: Compatibility Mode1140191 +Node: Additions1140973 +Node: Accessing The Source1141898 +Node: Adding Code1143334 +Node: New Ports1149506 +Node: Derived Files1153988 +Ref: Derived Files-Footnote-11159463 +Ref: Derived Files-Footnote-21159497 +Ref: Derived Files-Footnote-31160093 +Node: Future Extensions1160207 +Node: Implementation Limitations1160813 +Node: Extension Design1162061 +Node: Old Extension Problems1163215 +Ref: Old Extension Problems-Footnote-11164732 +Node: Extension New Mechanism Goals1164789 +Ref: Extension New Mechanism Goals-Footnote-11168149 +Node: Extension Other Design Decisions1168338 +Node: Extension Future Growth1170446 +Node: Old Extension Mechanism1171282 +Node: Notes summary1173044 +Node: Basic Concepts1174230 +Node: Basic High Level1174911 +Ref: figure-general-flow1175183 +Ref: figure-process-flow1175782 +Ref: Basic High Level-Footnote-11179011 +Node: Basic Data Typing1179196 +Node: Glossary1182524 +Node: Copying1207682 +Node: GNU Free Documentation License1245238 +Node: Index1270374  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 134bf356..1389079d 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -34767,8 +34767,8 @@ The record consists of three fields. The first two are the inode number and the @value{FN}, separated by a forward slash character. On systems where the directory entry contains the file type, the record has a third field (also separated by a slash) which is a single letter -indicating the type of the file. The letters are file types are shown -in @ref{table-readdir-file-types}. +indicating the type of the file. The letters and their corresponding file +types are shown in @ref{table-readdir-file-types}. @float Table,table-readdir-file-types @caption{File Types Returned By The @code{readdir} Extension} @@ -36445,7 +36445,7 @@ The @option{-l} and @option{--load} options load compiled dynamic extensions. The @option{-M} and @option{--bignum} options enable MPFR. @item -The @option{-o} only does pretty-printing. +The @option{-o} option only does pretty-printing. @item The @option{-p} option is used for profiling. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index a5f696ab..6d212f80 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -33861,8 +33861,8 @@ The record consists of three fields. The first two are the inode number and the @value{FN}, separated by a forward slash character. On systems where the directory entry contains the file type, the record has a third field (also separated by a slash) which is a single letter -indicating the type of the file. The letters are file types are shown -in @ref{table-readdir-file-types}. +indicating the type of the file. The letters and their corresponding file +types are shown in @ref{table-readdir-file-types}. @float Table,table-readdir-file-types @caption{File Types Returned By The @code{readdir} Extension} @@ -35539,7 +35539,7 @@ The @option{-l} and @option{--load} options load compiled dynamic extensions. The @option{-M} and @option{--bignum} options enable MPFR. @item -The @option{-o} only does pretty-printing. +The @option{-o} option only does pretty-printing. @item The @option{-p} option is used for profiling. -- cgit v1.2.3 From 8554673ddcb41cad3634eeced649d3ad53b99ee8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 25 Oct 2014 20:19:52 +0300 Subject: Additional doc fix. --- doc/ChangeLog | 1 + doc/gawk.info | 1082 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 26 +- doc/gawktexi.in | 6 +- 4 files changed, 578 insertions(+), 537 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 58e62c36..3ca49d9a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2014-10-25 Arnold D. Robbins * gawktexi.in: Minor typo fixes. + Fix discussion of \x, per note from Antonio Colombo. 2014-10-17 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index ee73b940..d574aa8b 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -3422,14 +3422,15 @@ sequences apply to both string constants and regexp constants: hexadecimal digits (`0'-`9', and either `A'-`F' or `a'-`f'). A maximum of two digts are allowed after the `\x'. Any further hexadecimal digits are treated as simple letters or numbers. - (c.e.) + (c.e.) (The `\x' escape sequence is not allowed in POSIX awk.) CAUTION: In ISO C, the escape sequence continues until the first nonhexadecimal digit is seen. For many years, `gawk' would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. However, using more than two hexadecimal - digits produces + digits produced undefined results. As of version *FIXME:* + 4.3.0, only two digits are processed. `\/' A literal slash (necessary for regexp constants only). This @@ -19868,8 +19869,7 @@ output. They are as follows: you typed when you wrote it. This is because `gawk' creates the profiled version by "pretty printing" its internal representation of the program. The advantage to this is that `gawk' can produce a -standard representation. The disadvantage is that all source-code -comments are lost. Also, things such as: +standard representation. Also, things such as: /foo/ @@ -19931,6 +19931,22 @@ without any execution counts. NOTE: Once upon a time, the `--pretty-print' option would also run your program. This is is no longer the case. + There is a significant difference between the output created when +profiling, and that created when pretty-printing. Pretty-printed output +preserves the original comments that were in the program, although their +placement may not correspond exactly to their original locations in the +source code. + + However, as a deliberate design decision, profiling output _omits_ +the original program's comments. This allows you to focus on the +execution count data and helps you avoid the temptation to use the +profiler for pretty-printing. + + Additionally, pretty-printed output does not have the leading +indentation 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. +  File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanced Features @@ -31509,10 +31525,10 @@ Index (line 8) * [] (square brackets), regexp operator: Regexp Operators. (line 56) * \ (backslash): Comments. (line 50) -* \ (backslash), \" escape sequence: Escape Sequences. (line 84) +* \ (backslash), \" escape sequence: Escape Sequences. (line 85) * \ (backslash), \' operator (gawk): GNU Regexp Operators. (line 56) -* \ (backslash), \/ escape sequence: Escape Sequences. (line 75) +* \ (backslash), \/ escape sequence: Escape Sequences. (line 76) * \ (backslash), \< operator (gawk): GNU Regexp Operators. (line 30) * \ (backslash), \> operator (gawk): GNU Regexp Operators. @@ -31552,7 +31568,7 @@ Index * \ (backslash), in bracket expressions: Bracket Expressions. (line 17) * \ (backslash), in escape sequences: Escape Sequences. (line 6) * \ (backslash), in escape sequences, POSIX and: Escape Sequences. - (line 120) + (line 121) * \ (backslash), in regexp constants: Computed Regexps. (line 29) * \ (backslash), in shell commands: Quoting. (line 48) * \ (backslash), regexp operator: Regexp Operators. (line 18) @@ -31778,10 +31794,10 @@ Index * awkvars.out file: Options. (line 93) * b debugger command (alias for break): Breakpoint Control. (line 11) * backslash (\): Comments. (line 50) -* backslash (\), \" escape sequence: Escape Sequences. (line 84) +* backslash (\), \" escape sequence: Escape Sequences. (line 85) * backslash (\), \' operator (gawk): GNU Regexp Operators. (line 56) -* backslash (\), \/ escape sequence: Escape Sequences. (line 75) +* backslash (\), \/ escape sequence: Escape Sequences. (line 76) * backslash (\), \< operator (gawk): GNU Regexp Operators. (line 30) * backslash (\), \> operator (gawk): GNU Regexp Operators. @@ -31821,7 +31837,7 @@ Index * backslash (\), in bracket expressions: Bracket Expressions. (line 17) * backslash (\), in escape sequences: Escape Sequences. (line 6) * backslash (\), in escape sequences, POSIX and: Escape Sequences. - (line 120) + (line 121) * backslash (\), in regexp constants: Computed Regexps. (line 29) * backslash (\), in shell commands: Quoting. (line 48) * backslash (\), regexp operator: Regexp Operators. (line 18) @@ -31927,7 +31943,7 @@ Index (line 67) * Brian Kernighan's awk <12>: GNU Regexp Operators. (line 83) -* Brian Kernighan's awk <13>: Escape Sequences. (line 124) +* Brian Kernighan's awk <13>: Escape Sequences. (line 125) * Brian Kernighan's awk: When. (line 21) * Brian Kernighan's awk, extensions: BTL. (line 6) * Brian Kernighan's awk, source code: Other Versions. (line 13) @@ -32152,7 +32168,7 @@ Index * dark corner, CONVFMT variable: Strings And Numbers. (line 40) * dark corner, escape sequences: Other Arguments. (line 38) * dark corner, escape sequences, for metacharacters: Escape Sequences. - (line 142) + (line 143) * dark corner, exit statement: Exit Statement. (line 30) * dark corner, field separators: Field Splitting Summary. (line 46) @@ -32430,7 +32446,7 @@ Index * dump debugger command: Miscellaneous Debugger Commands. (line 9) * dupword.awk program: Dupword Program. (line 31) -* dynamic profiling: Profiling. (line 179) +* dynamic profiling: Profiling. (line 178) * dynamically loaded extensions: Dynamic Extensions. (line 6) * e debugger command (alias for enable): Breakpoint Control. (line 73) * EBCDIC: Ordinal Functions. (line 45) @@ -32801,7 +32817,7 @@ Index (line 44) * G-d: Acknowledgments. (line 94) * Garfinkle, Scott: Contributors. (line 34) -* gawk program, dynamic profiling: Profiling. (line 179) +* gawk program, dynamic profiling: Profiling. (line 178) * gawk version: Auto-set. (line 214) * gawk, ARGIND variable in: Other Arguments. (line 15) * gawk, awk and <1>: This Manual. (line 14) @@ -32825,7 +32841,7 @@ Index * gawk, ERRNO variable in <4>: Close Files And Pipes. (line 140) * gawk, ERRNO variable in: Getline. (line 19) -* gawk, escape sequences: Escape Sequences. (line 132) +* gawk, escape sequences: Escape Sequences. (line 133) * gawk, extensions, disabling: Options. (line 254) * gawk, features, adding: Adding Code. (line 6) * gawk, features, advanced: Advanced Features. (line 6) @@ -32992,7 +33008,7 @@ Index * history expansion, in debugger: Readline Support. (line 6) * histsort.awk program: History Sorting. (line 25) * Hughes, Phil: Acknowledgments. (line 43) -* HUP signal, for dynamic profiling: Profiling. (line 211) +* HUP signal, for dynamic profiling: Profiling. (line 210) * hyphen (-), - operator: Precedence. (line 52) * hyphen (-), -- operator <1>: Precedence. (line 46) * hyphen (-), -- operator: Increment Ops. (line 48) @@ -33072,7 +33088,7 @@ Index * installing gawk: Installation. (line 6) * instruction tracing, in debugger: Debugger Info. (line 89) * int: Numeric Functions. (line 38) -* INT signal (MS-Windows): Profiling. (line 214) +* INT signal (MS-Windows): Profiling. (line 213) * integer array indices: Numeric Array Subscripts. (line 31) * integers, arbitrary precision: Arbitrary Precision Integers. @@ -33128,7 +33144,7 @@ Index * Kernighan, Brian <9>: Acknowledgments. (line 78) * Kernighan, Brian <10>: Conventions. (line 38) * Kernighan, Brian: History. (line 17) -* kill command, dynamic profiling: Profiling. (line 188) +* kill command, dynamic profiling: Profiling. (line 187) * Knights, jedi: Undocumented. (line 6) * Kwok, Conrad: Contributors. (line 34) * l debugger command (alias for list): Miscellaneous Debugger Commands. @@ -33264,7 +33280,7 @@ Index * 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 132) +* mawk utility: Escape Sequences. (line 133) * maximum precision supported by MPFR library: Auto-set. (line 228) * McIlroy, Doug: Glossary. (line 149) * McPhee, Patrick: Contributors. (line 100) @@ -33277,7 +33293,7 @@ Index (line 54) * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) -* metacharacters, escape sequences for: Escape Sequences. (line 138) +* metacharacters, escape sequences for: Escape Sequences. (line 139) * minimum precision supported by MPFR library: Auto-set. (line 231) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) @@ -33494,14 +33510,14 @@ Index * plus sign (+), += operator: Assignment Ops. (line 82) * plus sign (+), regexp operator: Regexp Operators. (line 105) * pointers to functions: Indirect Calls. (line 6) -* portability: Escape Sequences. (line 102) +* portability: Escape Sequences. (line 103) * portability, #! (executable scripts): Executable Scripts. (line 33) * portability, ** operator and: Arithmetic Ops. (line 81) * portability, **= operator and: Assignment Ops. (line 143) * portability, ARGV variable: Executable Scripts. (line 59) * portability, backslash continuation and: Statements/Lines. (line 30) * portability, backslash in escape sequences: Escape Sequences. - (line 120) + (line 121) * portability, close() function and: Close Files And Pipes. (line 81) * portability, data files as single record: gawk split records. @@ -33540,7 +33556,7 @@ Index * POSIX awk, < operator and: Getline/File. (line 26) * POSIX awk, arithmetic operators and: Arithmetic Ops. (line 30) * POSIX awk, backslashes in string constants: Escape Sequences. - (line 120) + (line 121) * POSIX awk, BEGIN/END patterns: I/O And BEGIN/END. (line 16) * POSIX awk, bracket expressions and: Bracket Expressions. (line 26) * POSIX awk, bracket expressions and, character classes: Bracket Expressions. @@ -33635,7 +33651,7 @@ Index * PROCINFO, values of sorted_in: Controlling Scanning. (line 26) * profiling awk programs: Profiling. (line 6) -* profiling awk programs, dynamically: Profiling. (line 179) +* profiling awk programs, dynamically: Profiling. (line 178) * program identifiers: Auto-set. (line 155) * program, definition of: Getting Started. (line 21) * programming conventions, --non-decimal-data option: Nondecimal Data. @@ -33671,7 +33687,7 @@ Index * QuikTrim Awk: Other Versions. (line 135) * quit debugger command: Miscellaneous Debugger Commands. (line 99) -* QUIT signal (MS-Windows): Profiling. (line 214) +* QUIT signal (MS-Windows): Profiling. (line 213) * quoting in gawk command lines: Long. (line 26) * quoting in gawk command lines, tricks for: Quoting. (line 91) * quoting, for small awk programs: Comments. (line 27) @@ -33923,14 +33939,14 @@ Index * sidebar, A Constant's Base Does Not Affect Its Value: Nondecimal-numbers. (line 64) * sidebar, Backslash Before Regular Characters: Escape Sequences. - (line 118) + (line 119) * sidebar, Changing FS Does Not Affect the Fields: Field Splitting Summary. (line 38) * sidebar, Changing NR and FNR: Auto-set. (line 319) * sidebar, Controlling Output Buffering with system(): I/O Functions. (line 137) * sidebar, Escape Sequences for Metacharacters: Escape Sequences. - (line 136) + (line 137) * sidebar, FS and IGNORECASE: Field Splitting Summary. (line 64) * sidebar, Interactive Versus Noninteractive Buffering: I/O Functions. @@ -33952,15 +33968,15 @@ Index (line 57) * sidebar, Using close()'s Return Value: Close Files And Pipes. (line 130) -* SIGHUP signal, for dynamic profiling: Profiling. (line 211) -* SIGINT signal (MS-Windows): Profiling. (line 214) -* signals, HUP/SIGHUP, for profiling: Profiling. (line 211) -* signals, INT/SIGINT (MS-Windows): Profiling. (line 214) -* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 214) -* signals, USR1/SIGUSR1, for profiling: Profiling. (line 188) +* SIGHUP signal, for dynamic profiling: Profiling. (line 210) +* SIGINT signal (MS-Windows): Profiling. (line 213) +* signals, HUP/SIGHUP, for profiling: Profiling. (line 210) +* signals, INT/SIGINT (MS-Windows): Profiling. (line 213) +* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 213) +* signals, USR1/SIGUSR1, for profiling: Profiling. (line 187) * signature program: Signature Program. (line 6) -* SIGQUIT signal (MS-Windows): Profiling. (line 214) -* SIGUSR1 signal, for dynamic profiling: Profiling. (line 188) +* SIGQUIT signal (MS-Windows): Profiling. (line 213) +* SIGUSR1 signal, for dynamic profiling: Profiling. (line 187) * silent debugger command: Debugger Execution Control. (line 10) * sin: Numeric Functions. (line 91) @@ -34158,7 +34174,7 @@ Index (line 37) * troubleshooting, awk uses FS not IFS: Field Separators. (line 30) * troubleshooting, backslash before nonspecial character: Escape Sequences. - (line 120) + (line 121) * troubleshooting, division: Arithmetic Ops. (line 44) * troubleshooting, fatal errors, field widths, specifying: Constant Size. (line 23) @@ -34214,7 +34230,7 @@ Index * uniq.awk program: Uniq Program. (line 65) * Unix: Glossary. (line 611) * Unix awk, backslashes in escape sequences: Escape Sequences. - (line 132) + (line 133) * Unix awk, close() function and: Close Files And Pipes. (line 132) * Unix awk, password files, field separators and: Command Line Field Separator. @@ -34234,7 +34250,7 @@ Index * user-modifiable variables: User-modified. (line 6) * users, information about, printing: Id Program. (line 6) * users, information about, retrieving: Passwd Functions. (line 16) -* USR1 signal, for dynamic profiling: Profiling. (line 188) +* USR1 signal, for dynamic profiling: Profiling. (line 187) * values, numeric: Basic Data Typing. (line 13) * values, string: Basic Data Typing. (line 13) * variable assignments and input files: Other Arguments. (line 26) @@ -34419,500 +34435,500 @@ Node: Invoking Summary150472 Node: Regexp152138 Node: Regexp Usage153597 Node: Escape Sequences155630 -Node: Regexp Operators161730 -Ref: Regexp Operators-Footnote-1169164 -Ref: Regexp Operators-Footnote-2169311 -Node: Bracket Expressions169409 -Ref: table-char-classes171426 -Node: Leftmost Longest174366 -Node: Computed Regexps175668 -Node: GNU Regexp Operators179065 -Node: Case-sensitivity182767 -Ref: Case-sensitivity-Footnote-1185657 -Ref: Case-sensitivity-Footnote-2185892 -Node: Regexp Summary186000 -Node: Reading Files187469 -Node: Records189563 -Node: awk split records190295 -Node: gawk split records195209 -Ref: gawk split records-Footnote-1199748 -Node: Fields199785 -Ref: Fields-Footnote-1202583 -Node: Nonconstant Fields202669 -Ref: Nonconstant Fields-Footnote-1204905 -Node: Changing Fields205107 -Node: Field Separators211039 -Node: Default Field Splitting213743 -Node: Regexp Field Splitting214860 -Node: Single Character Fields218210 -Node: Command Line Field Separator219269 -Node: Full Line Fields222481 -Ref: Full Line Fields-Footnote-1222989 -Node: Field Splitting Summary223035 -Ref: Field Splitting Summary-Footnote-1226166 -Node: Constant Size226267 -Node: Splitting By Content230873 -Ref: Splitting By Content-Footnote-1234946 -Node: Multiple Line234986 -Ref: Multiple Line-Footnote-1240875 -Node: Getline241054 -Node: Plain Getline243265 -Node: Getline/Variable245905 -Node: Getline/File247052 -Node: Getline/Variable/File248436 -Ref: Getline/Variable/File-Footnote-1250037 -Node: Getline/Pipe250124 -Node: Getline/Variable/Pipe252807 -Node: Getline/Coprocess253938 -Node: Getline/Variable/Coprocess255190 -Node: Getline Notes255929 -Node: Getline Summary258721 -Ref: table-getline-variants259133 -Node: Read Timeout259962 -Ref: Read Timeout-Footnote-1263776 -Node: Command-line directories263834 -Node: Input Summary264738 -Node: Input Exercises267990 -Node: Printing268718 -Node: Print270495 -Node: Print Examples271952 -Node: Output Separators274731 -Node: OFMT276749 -Node: Printf278103 -Node: Basic Printf278888 -Node: Control Letters280459 -Node: Format Modifiers284443 -Node: Printf Examples290450 -Node: Redirection292932 -Node: Special FD299771 -Ref: Special FD-Footnote-1302928 -Node: Special Files303002 -Node: Other Inherited Files303618 -Node: Special Network304618 -Node: Special Caveats305479 -Node: Close Files And Pipes306430 -Ref: Close Files And Pipes-Footnote-1313609 -Ref: Close Files And Pipes-Footnote-2313757 -Node: Output Summary313907 -Node: Output Exercises314903 -Node: Expressions315583 -Node: Values316768 -Node: Constants317444 -Node: Scalar Constants318124 -Ref: Scalar Constants-Footnote-1318983 -Node: Nondecimal-numbers319233 -Node: Regexp Constants322233 -Node: Using Constant Regexps322758 -Node: Variables325896 -Node: Using Variables326551 -Node: Assignment Options328461 -Node: Conversion330336 -Node: Strings And Numbers330860 -Ref: Strings And Numbers-Footnote-1333924 -Node: Locale influences conversions334033 -Ref: table-locale-affects336778 -Node: All Operators337366 -Node: Arithmetic Ops337996 -Node: Concatenation340501 -Ref: Concatenation-Footnote-1343320 -Node: Assignment Ops343426 -Ref: table-assign-ops348409 -Node: Increment Ops349687 -Node: Truth Values and Conditions353125 -Node: Truth Values354208 -Node: Typing and Comparison355257 -Node: Variable Typing356050 -Node: Comparison Operators359702 -Ref: table-relational-ops360112 -Node: POSIX String Comparison363627 -Ref: POSIX String Comparison-Footnote-1364699 -Node: Boolean Ops364837 -Ref: Boolean Ops-Footnote-1369316 -Node: Conditional Exp369407 -Node: Function Calls371134 -Node: Precedence375014 -Node: Locales378682 -Node: Expressions Summary380313 -Node: Patterns and Actions382887 -Node: Pattern Overview384007 -Node: Regexp Patterns385686 -Node: Expression Patterns386229 -Node: Ranges390009 -Node: BEGIN/END393115 -Node: Using BEGIN/END393877 -Ref: Using BEGIN/END-Footnote-1396614 -Node: I/O And BEGIN/END396720 -Node: BEGINFILE/ENDFILE399034 -Node: Empty401935 -Node: Using Shell Variables402252 -Node: Action Overview404528 -Node: Statements406855 -Node: If Statement408703 -Node: While Statement410201 -Node: Do Statement412229 -Node: For Statement413371 -Node: Switch Statement416526 -Node: Break Statement418914 -Node: Continue Statement420955 -Node: Next Statement422780 -Node: Nextfile Statement425160 -Node: Exit Statement427790 -Node: Built-in Variables430193 -Node: User-modified431326 -Ref: User-modified-Footnote-1439006 -Node: Auto-set439068 -Ref: Auto-set-Footnote-1452435 -Ref: Auto-set-Footnote-2452640 -Node: ARGC and ARGV452696 -Node: Pattern Action Summary456900 -Node: Arrays459327 -Node: Array Basics460656 -Node: Array Intro461500 -Ref: figure-array-elements463464 -Ref: Array Intro-Footnote-1465988 -Node: Reference to Elements466116 -Node: Assigning Elements468566 -Node: Array Example469057 -Node: Scanning an Array470815 -Node: Controlling Scanning473831 -Ref: Controlling Scanning-Footnote-1479020 -Node: Numeric Array Subscripts479336 -Node: Uninitialized Subscripts481521 -Node: Delete483138 -Ref: Delete-Footnote-1485882 -Node: Multidimensional485939 -Node: Multiscanning489034 -Node: Arrays of Arrays490623 -Node: Arrays Summary495384 -Node: Functions497489 -Node: Built-in498362 -Node: Calling Built-in499440 -Node: Numeric Functions501428 -Ref: Numeric Functions-Footnote-1506252 -Ref: Numeric Functions-Footnote-2506609 -Ref: Numeric Functions-Footnote-3506657 -Node: String Functions506926 -Ref: String Functions-Footnote-1530398 -Ref: String Functions-Footnote-2530527 -Ref: String Functions-Footnote-3530775 -Node: Gory Details530862 -Ref: table-sub-escapes532643 -Ref: table-sub-proposed534163 -Ref: table-posix-sub535527 -Ref: table-gensub-escapes537067 -Ref: Gory Details-Footnote-1537899 -Node: I/O Functions538050 -Ref: I/O Functions-Footnote-1545151 -Node: Time Functions545298 -Ref: Time Functions-Footnote-1555767 -Ref: Time Functions-Footnote-2555835 -Ref: Time Functions-Footnote-3555993 -Ref: Time Functions-Footnote-4556104 -Ref: Time Functions-Footnote-5556216 -Ref: Time Functions-Footnote-6556443 -Node: Bitwise Functions556709 -Ref: table-bitwise-ops557271 -Ref: Bitwise Functions-Footnote-1561579 -Node: Type Functions561748 -Node: I18N Functions562897 -Node: User-defined564542 -Node: Definition Syntax565346 -Ref: Definition Syntax-Footnote-1570752 -Node: Function Example570821 -Ref: Function Example-Footnote-1573738 -Node: Function Caveats573760 -Node: Calling A Function574278 -Node: Variable Scope575233 -Node: Pass By Value/Reference578221 -Node: Return Statement581731 -Node: Dynamic Typing584715 -Node: Indirect Calls585644 -Ref: Indirect Calls-Footnote-1596948 -Node: Functions Summary597076 -Node: Library Functions599775 -Ref: Library Functions-Footnote-1603393 -Ref: Library Functions-Footnote-2603536 -Node: Library Names603707 -Ref: Library Names-Footnote-1607167 -Ref: Library Names-Footnote-2607387 -Node: General Functions607473 -Node: Strtonum Function608576 -Node: Assert Function611596 -Node: Round Function614920 -Node: Cliff Random Function616461 -Node: Ordinal Functions617477 -Ref: Ordinal Functions-Footnote-1620542 -Ref: Ordinal Functions-Footnote-2620794 -Node: Join Function621005 -Ref: Join Function-Footnote-1622776 -Node: Getlocaltime Function622976 -Node: Readfile Function626717 -Node: Shell Quoting628687 -Node: Data File Management630088 -Node: Filetrans Function630720 -Node: Rewind Function634779 -Node: File Checking636164 -Ref: File Checking-Footnote-1637492 -Node: Empty Files637693 -Node: Ignoring Assigns639672 -Node: Getopt Function641223 -Ref: Getopt Function-Footnote-1652683 -Node: Passwd Functions652886 -Ref: Passwd Functions-Footnote-1661737 -Node: Group Functions661825 -Ref: Group Functions-Footnote-1669728 -Node: Walking Arrays669941 -Node: Library Functions Summary671544 -Node: Library Exercises672945 -Node: Sample Programs674225 -Node: Running Examples674995 -Node: Clones675723 -Node: Cut Program676947 -Node: Egrep Program686677 -Ref: Egrep Program-Footnote-1694181 -Node: Id Program694291 -Node: Split Program697935 -Ref: Split Program-Footnote-1701381 -Node: Tee Program701509 -Node: Uniq Program704296 -Node: Wc Program711717 -Ref: Wc Program-Footnote-1715965 -Node: Miscellaneous Programs716057 -Node: Dupword Program717270 -Node: Alarm Program719301 -Node: Translate Program724105 -Ref: Translate Program-Footnote-1728669 -Node: Labels Program728939 -Ref: Labels Program-Footnote-1732288 -Node: Word Sorting732372 -Node: History Sorting736442 -Node: Extract Program738278 -Node: Simple Sed745810 -Node: Igawk Program748872 -Ref: Igawk Program-Footnote-1763198 -Ref: Igawk Program-Footnote-2763399 -Ref: Igawk Program-Footnote-3763521 -Node: Anagram Program763636 -Node: Signature Program766698 -Node: Programs Summary767945 -Node: Programs Exercises769138 -Ref: Programs Exercises-Footnote-1773269 -Node: Advanced Features773360 -Node: Nondecimal Data775308 -Node: Array Sorting776898 -Node: Controlling Array Traversal777595 -Ref: Controlling Array Traversal-Footnote-1785926 -Node: Array Sorting Functions786044 -Ref: Array Sorting Functions-Footnote-1789936 -Node: Two-way I/O790130 -Ref: Two-way I/O-Footnote-1795074 -Ref: Two-way I/O-Footnote-2795260 -Node: TCP/IP Networking795342 -Node: Profiling798214 -Node: Advanced Features Summary805767 -Node: Internationalization807700 -Node: I18N and L10N809180 -Node: Explaining gettext809866 -Ref: Explaining gettext-Footnote-1814895 -Ref: Explaining gettext-Footnote-2815079 -Node: Programmer i18n815244 -Ref: Programmer i18n-Footnote-1820110 -Node: Translator i18n820159 -Node: String Extraction820953 -Ref: String Extraction-Footnote-1822084 -Node: Printf Ordering822170 -Ref: Printf Ordering-Footnote-1824956 -Node: I18N Portability825020 -Ref: I18N Portability-Footnote-1827469 -Node: I18N Example827532 -Ref: I18N Example-Footnote-1830332 -Node: Gawk I18N830404 -Node: I18N Summary831042 -Node: Debugger832381 -Node: Debugging833403 -Node: Debugging Concepts833844 -Node: Debugging Terms835701 -Node: Awk Debugging838276 -Node: Sample Debugging Session839168 -Node: Debugger Invocation839688 -Node: Finding The Bug841072 -Node: List of Debugger Commands847547 -Node: Breakpoint Control848879 -Node: Debugger Execution Control852571 -Node: Viewing And Changing Data855935 -Node: Execution Stack859300 -Node: Debugger Info860938 -Node: Miscellaneous Debugger Commands864955 -Node: Readline Support870147 -Node: Limitations871039 -Node: Debugging Summary873136 -Node: Arbitrary Precision Arithmetic874304 -Node: Computer Arithmetic875720 -Ref: table-numeric-ranges879321 -Ref: Computer Arithmetic-Footnote-1880180 -Node: Math Definitions880237 -Ref: table-ieee-formats883524 -Ref: Math Definitions-Footnote-1884128 -Node: MPFR features884233 -Node: FP Math Caution885904 -Ref: FP Math Caution-Footnote-1886954 -Node: Inexactness of computations887323 -Node: Inexact representation888271 -Node: Comparing FP Values889626 -Node: Errors accumulate890699 -Node: Getting Accuracy892132 -Node: Try To Round894791 -Node: Setting precision895690 -Ref: table-predefined-precision-strings896374 -Node: Setting the rounding mode898168 -Ref: table-gawk-rounding-modes898532 -Ref: Setting the rounding mode-Footnote-1901986 -Node: Arbitrary Precision Integers902165 -Ref: Arbitrary Precision Integers-Footnote-1907069 -Node: POSIX Floating Point Problems907218 -Ref: POSIX Floating Point Problems-Footnote-1911094 -Node: Floating point summary911132 -Node: Dynamic Extensions913324 -Node: Extension Intro914876 -Node: Plugin License916142 -Node: Extension Mechanism Outline916939 -Ref: figure-load-extension917367 -Ref: figure-register-new-function918847 -Ref: figure-call-new-function919851 -Node: Extension API Description921837 -Node: Extension API Functions Introduction923287 -Node: General Data Types928123 -Ref: General Data Types-Footnote-1933810 -Node: Memory Allocation Functions934109 -Ref: Memory Allocation Functions-Footnote-1936939 -Node: Constructor Functions937035 -Node: Registration Functions938769 -Node: Extension Functions939454 -Node: Exit Callback Functions941750 -Node: Extension Version String942998 -Node: Input Parsers943648 -Node: Output Wrappers953463 -Node: Two-way processors957979 -Node: Printing Messages960183 -Ref: Printing Messages-Footnote-1961260 -Node: Updating `ERRNO'961412 -Node: Requesting Values962152 -Ref: table-value-types-returned962880 -Node: Accessing Parameters963838 -Node: Symbol Table Access965069 -Node: Symbol table by name965583 -Node: Symbol table by cookie967563 -Ref: Symbol table by cookie-Footnote-1971702 -Node: Cached values971765 -Ref: Cached values-Footnote-1975269 -Node: Array Manipulation975360 -Ref: Array Manipulation-Footnote-1976458 -Node: Array Data Types976497 -Ref: Array Data Types-Footnote-1979154 -Node: Array Functions979246 -Node: Flattening Arrays983100 -Node: Creating Arrays989987 -Node: Extension API Variables994754 -Node: Extension Versioning995390 -Node: Extension API Informational Variables997291 -Node: Extension API Boilerplate998379 -Node: Finding Extensions1002195 -Node: Extension Example1002755 -Node: Internal File Description1003527 -Node: Internal File Ops1007594 -Ref: Internal File Ops-Footnote-11019252 -Node: Using Internal File Ops1019392 -Ref: Using Internal File Ops-Footnote-11021775 -Node: Extension Samples1022048 -Node: Extension Sample File Functions1023572 -Node: Extension Sample Fnmatch1031174 -Node: Extension Sample Fork1032656 -Node: Extension Sample Inplace1033869 -Node: Extension Sample Ord1035544 -Node: Extension Sample Readdir1036380 -Ref: table-readdir-file-types1037256 -Node: Extension Sample Revout1038067 -Node: Extension Sample Rev2way1038658 -Node: Extension Sample Read write array1039399 -Node: Extension Sample Readfile1041338 -Node: Extension Sample Time1042433 -Node: Extension Sample API Tests1043782 -Node: gawkextlib1044273 -Node: Extension summary1046923 -Node: Extension Exercises1050605 -Node: Language History1051327 -Node: V7/SVR3.11052984 -Node: SVR41055165 -Node: POSIX1056610 -Node: BTL1057999 -Node: POSIX/GNU1058733 -Node: Feature History1064362 -Node: Common Extensions1077460 -Node: Ranges and Locales1078784 -Ref: Ranges and Locales-Footnote-11083423 -Ref: Ranges and Locales-Footnote-21083450 -Ref: Ranges and Locales-Footnote-31083684 -Node: Contributors1083905 -Node: History summary1089445 -Node: Installation1090814 -Node: Gawk Distribution1091770 -Node: Getting1092254 -Node: Extracting1093078 -Node: Distribution contents1094720 -Node: Unix Installation1100490 -Node: Quick Installation1101107 -Node: Additional Configuration Options1103538 -Node: Configuration Philosophy1105278 -Node: Non-Unix Installation1107629 -Node: PC Installation1108087 -Node: PC Binary Installation1109413 -Node: PC Compiling1111261 -Ref: PC Compiling-Footnote-11114282 -Node: PC Testing1114387 -Node: PC Using1115563 -Node: Cygwin1119678 -Node: MSYS1120501 -Node: VMS Installation1120999 -Node: VMS Compilation1121791 -Ref: VMS Compilation-Footnote-11123013 -Node: VMS Dynamic Extensions1123071 -Node: VMS Installation Details1124755 -Node: VMS Running1127007 -Node: VMS GNV1129848 -Node: VMS Old Gawk1130582 -Node: Bugs1131052 -Node: Other Versions1134956 -Node: Installation summary1141169 -Node: Notes1142225 -Node: Compatibility Mode1143090 -Node: Additions1143872 -Node: Accessing The Source1144797 -Node: Adding Code1146233 -Node: New Ports1152405 -Node: Derived Files1156887 -Ref: Derived Files-Footnote-11162362 -Ref: Derived Files-Footnote-21162396 -Ref: Derived Files-Footnote-31162992 -Node: Future Extensions1163106 -Node: Implementation Limitations1163712 -Node: Extension Design1164960 -Node: Old Extension Problems1166114 -Ref: Old Extension Problems-Footnote-11167631 -Node: Extension New Mechanism Goals1167688 -Ref: Extension New Mechanism Goals-Footnote-11171048 -Node: Extension Other Design Decisions1171237 -Node: Extension Future Growth1173345 -Node: Old Extension Mechanism1174181 -Node: Notes summary1175943 -Node: Basic Concepts1177129 -Node: Basic High Level1177810 -Ref: figure-general-flow1178082 -Ref: figure-process-flow1178681 -Ref: Basic High Level-Footnote-11181910 -Node: Basic Data Typing1182095 -Node: Glossary1185423 -Node: Copying1210581 -Node: GNU Free Documentation License1248137 -Node: Index1273273 +Node: Regexp Operators161878 +Ref: Regexp Operators-Footnote-1169312 +Ref: Regexp Operators-Footnote-2169459 +Node: Bracket Expressions169557 +Ref: table-char-classes171574 +Node: Leftmost Longest174514 +Node: Computed Regexps175816 +Node: GNU Regexp Operators179213 +Node: Case-sensitivity182915 +Ref: Case-sensitivity-Footnote-1185805 +Ref: Case-sensitivity-Footnote-2186040 +Node: Regexp Summary186148 +Node: Reading Files187617 +Node: Records189711 +Node: awk split records190443 +Node: gawk split records195357 +Ref: gawk split records-Footnote-1199896 +Node: Fields199933 +Ref: Fields-Footnote-1202731 +Node: Nonconstant Fields202817 +Ref: Nonconstant Fields-Footnote-1205053 +Node: Changing Fields205255 +Node: Field Separators211187 +Node: Default Field Splitting213891 +Node: Regexp Field Splitting215008 +Node: Single Character Fields218358 +Node: Command Line Field Separator219417 +Node: Full Line Fields222629 +Ref: Full Line Fields-Footnote-1223137 +Node: Field Splitting Summary223183 +Ref: Field Splitting Summary-Footnote-1226314 +Node: Constant Size226415 +Node: Splitting By Content231021 +Ref: Splitting By Content-Footnote-1235094 +Node: Multiple Line235134 +Ref: Multiple Line-Footnote-1241023 +Node: Getline241202 +Node: Plain Getline243413 +Node: Getline/Variable246053 +Node: Getline/File247200 +Node: Getline/Variable/File248584 +Ref: Getline/Variable/File-Footnote-1250185 +Node: Getline/Pipe250272 +Node: Getline/Variable/Pipe252955 +Node: Getline/Coprocess254086 +Node: Getline/Variable/Coprocess255338 +Node: Getline Notes256077 +Node: Getline Summary258869 +Ref: table-getline-variants259281 +Node: Read Timeout260110 +Ref: Read Timeout-Footnote-1263924 +Node: Command-line directories263982 +Node: Input Summary264886 +Node: Input Exercises268138 +Node: Printing268866 +Node: Print270643 +Node: Print Examples272100 +Node: Output Separators274879 +Node: OFMT276897 +Node: Printf278251 +Node: Basic Printf279036 +Node: Control Letters280607 +Node: Format Modifiers284591 +Node: Printf Examples290598 +Node: Redirection293080 +Node: Special FD299919 +Ref: Special FD-Footnote-1303076 +Node: Special Files303150 +Node: Other Inherited Files303766 +Node: Special Network304766 +Node: Special Caveats305627 +Node: Close Files And Pipes306578 +Ref: Close Files And Pipes-Footnote-1313757 +Ref: Close Files And Pipes-Footnote-2313905 +Node: Output Summary314055 +Node: Output Exercises315051 +Node: Expressions315731 +Node: Values316916 +Node: Constants317592 +Node: Scalar Constants318272 +Ref: Scalar Constants-Footnote-1319131 +Node: Nondecimal-numbers319381 +Node: Regexp Constants322381 +Node: Using Constant Regexps322906 +Node: Variables326044 +Node: Using Variables326699 +Node: Assignment Options328609 +Node: Conversion330484 +Node: Strings And Numbers331008 +Ref: Strings And Numbers-Footnote-1334072 +Node: Locale influences conversions334181 +Ref: table-locale-affects336926 +Node: All Operators337514 +Node: Arithmetic Ops338144 +Node: Concatenation340649 +Ref: Concatenation-Footnote-1343468 +Node: Assignment Ops343574 +Ref: table-assign-ops348557 +Node: Increment Ops349835 +Node: Truth Values and Conditions353273 +Node: Truth Values354356 +Node: Typing and Comparison355405 +Node: Variable Typing356198 +Node: Comparison Operators359850 +Ref: table-relational-ops360260 +Node: POSIX String Comparison363775 +Ref: POSIX String Comparison-Footnote-1364847 +Node: Boolean Ops364985 +Ref: Boolean Ops-Footnote-1369464 +Node: Conditional Exp369555 +Node: Function Calls371282 +Node: Precedence375162 +Node: Locales378830 +Node: Expressions Summary380461 +Node: Patterns and Actions383035 +Node: Pattern Overview384155 +Node: Regexp Patterns385834 +Node: Expression Patterns386377 +Node: Ranges390157 +Node: BEGIN/END393263 +Node: Using BEGIN/END394025 +Ref: Using BEGIN/END-Footnote-1396762 +Node: I/O And BEGIN/END396868 +Node: BEGINFILE/ENDFILE399182 +Node: Empty402083 +Node: Using Shell Variables402400 +Node: Action Overview404676 +Node: Statements407003 +Node: If Statement408851 +Node: While Statement410349 +Node: Do Statement412377 +Node: For Statement413519 +Node: Switch Statement416674 +Node: Break Statement419062 +Node: Continue Statement421103 +Node: Next Statement422928 +Node: Nextfile Statement425308 +Node: Exit Statement427938 +Node: Built-in Variables430341 +Node: User-modified431474 +Ref: User-modified-Footnote-1439154 +Node: Auto-set439216 +Ref: Auto-set-Footnote-1452583 +Ref: Auto-set-Footnote-2452788 +Node: ARGC and ARGV452844 +Node: Pattern Action Summary457048 +Node: Arrays459475 +Node: Array Basics460804 +Node: Array Intro461648 +Ref: figure-array-elements463612 +Ref: Array Intro-Footnote-1466136 +Node: Reference to Elements466264 +Node: Assigning Elements468714 +Node: Array Example469205 +Node: Scanning an Array470963 +Node: Controlling Scanning473979 +Ref: Controlling Scanning-Footnote-1479168 +Node: Numeric Array Subscripts479484 +Node: Uninitialized Subscripts481669 +Node: Delete483286 +Ref: Delete-Footnote-1486030 +Node: Multidimensional486087 +Node: Multiscanning489182 +Node: Arrays of Arrays490771 +Node: Arrays Summary495532 +Node: Functions497637 +Node: Built-in498510 +Node: Calling Built-in499588 +Node: Numeric Functions501576 +Ref: Numeric Functions-Footnote-1506400 +Ref: Numeric Functions-Footnote-2506757 +Ref: Numeric Functions-Footnote-3506805 +Node: String Functions507074 +Ref: String Functions-Footnote-1530546 +Ref: String Functions-Footnote-2530675 +Ref: String Functions-Footnote-3530923 +Node: Gory Details531010 +Ref: table-sub-escapes532791 +Ref: table-sub-proposed534311 +Ref: table-posix-sub535675 +Ref: table-gensub-escapes537215 +Ref: Gory Details-Footnote-1538047 +Node: I/O Functions538198 +Ref: I/O Functions-Footnote-1545299 +Node: Time Functions545446 +Ref: Time Functions-Footnote-1555915 +Ref: Time Functions-Footnote-2555983 +Ref: Time Functions-Footnote-3556141 +Ref: Time Functions-Footnote-4556252 +Ref: Time Functions-Footnote-5556364 +Ref: Time Functions-Footnote-6556591 +Node: Bitwise Functions556857 +Ref: table-bitwise-ops557419 +Ref: Bitwise Functions-Footnote-1561727 +Node: Type Functions561896 +Node: I18N Functions563045 +Node: User-defined564690 +Node: Definition Syntax565494 +Ref: Definition Syntax-Footnote-1570900 +Node: Function Example570969 +Ref: Function Example-Footnote-1573886 +Node: Function Caveats573908 +Node: Calling A Function574426 +Node: Variable Scope575381 +Node: Pass By Value/Reference578369 +Node: Return Statement581879 +Node: Dynamic Typing584863 +Node: Indirect Calls585792 +Ref: Indirect Calls-Footnote-1597096 +Node: Functions Summary597224 +Node: Library Functions599923 +Ref: Library Functions-Footnote-1603541 +Ref: Library Functions-Footnote-2603684 +Node: Library Names603855 +Ref: Library Names-Footnote-1607315 +Ref: Library Names-Footnote-2607535 +Node: General Functions607621 +Node: Strtonum Function608724 +Node: Assert Function611744 +Node: Round Function615068 +Node: Cliff Random Function616609 +Node: Ordinal Functions617625 +Ref: Ordinal Functions-Footnote-1620690 +Ref: Ordinal Functions-Footnote-2620942 +Node: Join Function621153 +Ref: Join Function-Footnote-1622924 +Node: Getlocaltime Function623124 +Node: Readfile Function626865 +Node: Shell Quoting628835 +Node: Data File Management630236 +Node: Filetrans Function630868 +Node: Rewind Function634927 +Node: File Checking636312 +Ref: File Checking-Footnote-1637640 +Node: Empty Files637841 +Node: Ignoring Assigns639820 +Node: Getopt Function641371 +Ref: Getopt Function-Footnote-1652831 +Node: Passwd Functions653034 +Ref: Passwd Functions-Footnote-1661885 +Node: Group Functions661973 +Ref: Group Functions-Footnote-1669876 +Node: Walking Arrays670089 +Node: Library Functions Summary671692 +Node: Library Exercises673093 +Node: Sample Programs674373 +Node: Running Examples675143 +Node: Clones675871 +Node: Cut Program677095 +Node: Egrep Program686825 +Ref: Egrep Program-Footnote-1694329 +Node: Id Program694439 +Node: Split Program698083 +Ref: Split Program-Footnote-1701529 +Node: Tee Program701657 +Node: Uniq Program704444 +Node: Wc Program711865 +Ref: Wc Program-Footnote-1716113 +Node: Miscellaneous Programs716205 +Node: Dupword Program717418 +Node: Alarm Program719449 +Node: Translate Program724253 +Ref: Translate Program-Footnote-1728817 +Node: Labels Program729087 +Ref: Labels Program-Footnote-1732436 +Node: Word Sorting732520 +Node: History Sorting736590 +Node: Extract Program738426 +Node: Simple Sed745958 +Node: Igawk Program749020 +Ref: Igawk Program-Footnote-1763346 +Ref: Igawk Program-Footnote-2763547 +Ref: Igawk Program-Footnote-3763669 +Node: Anagram Program763784 +Node: Signature Program766846 +Node: Programs Summary768093 +Node: Programs Exercises769286 +Ref: Programs Exercises-Footnote-1773417 +Node: Advanced Features773508 +Node: Nondecimal Data775456 +Node: Array Sorting777046 +Node: Controlling Array Traversal777743 +Ref: Controlling Array Traversal-Footnote-1786074 +Node: Array Sorting Functions786192 +Ref: Array Sorting Functions-Footnote-1790084 +Node: Two-way I/O790278 +Ref: Two-way I/O-Footnote-1795222 +Ref: Two-way I/O-Footnote-2795408 +Node: TCP/IP Networking795490 +Node: Profiling798362 +Node: Advanced Features Summary806636 +Node: Internationalization808569 +Node: I18N and L10N810049 +Node: Explaining gettext810735 +Ref: Explaining gettext-Footnote-1815764 +Ref: Explaining gettext-Footnote-2815948 +Node: Programmer i18n816113 +Ref: Programmer i18n-Footnote-1820979 +Node: Translator i18n821028 +Node: String Extraction821822 +Ref: String Extraction-Footnote-1822953 +Node: Printf Ordering823039 +Ref: Printf Ordering-Footnote-1825825 +Node: I18N Portability825889 +Ref: I18N Portability-Footnote-1828338 +Node: I18N Example828401 +Ref: I18N Example-Footnote-1831201 +Node: Gawk I18N831273 +Node: I18N Summary831911 +Node: Debugger833250 +Node: Debugging834272 +Node: Debugging Concepts834713 +Node: Debugging Terms836570 +Node: Awk Debugging839145 +Node: Sample Debugging Session840037 +Node: Debugger Invocation840557 +Node: Finding The Bug841941 +Node: List of Debugger Commands848416 +Node: Breakpoint Control849748 +Node: Debugger Execution Control853440 +Node: Viewing And Changing Data856804 +Node: Execution Stack860169 +Node: Debugger Info861807 +Node: Miscellaneous Debugger Commands865824 +Node: Readline Support871016 +Node: Limitations871908 +Node: Debugging Summary874005 +Node: Arbitrary Precision Arithmetic875173 +Node: Computer Arithmetic876589 +Ref: table-numeric-ranges880190 +Ref: Computer Arithmetic-Footnote-1881049 +Node: Math Definitions881106 +Ref: table-ieee-formats884393 +Ref: Math Definitions-Footnote-1884997 +Node: MPFR features885102 +Node: FP Math Caution886773 +Ref: FP Math Caution-Footnote-1887823 +Node: Inexactness of computations888192 +Node: Inexact representation889140 +Node: Comparing FP Values890495 +Node: Errors accumulate891568 +Node: Getting Accuracy893001 +Node: Try To Round895660 +Node: Setting precision896559 +Ref: table-predefined-precision-strings897243 +Node: Setting the rounding mode899037 +Ref: table-gawk-rounding-modes899401 +Ref: Setting the rounding mode-Footnote-1902855 +Node: Arbitrary Precision Integers903034 +Ref: Arbitrary Precision Integers-Footnote-1907938 +Node: POSIX Floating Point Problems908087 +Ref: POSIX Floating Point Problems-Footnote-1911963 +Node: Floating point summary912001 +Node: Dynamic Extensions914193 +Node: Extension Intro915745 +Node: Plugin License917011 +Node: Extension Mechanism Outline917808 +Ref: figure-load-extension918236 +Ref: figure-register-new-function919716 +Ref: figure-call-new-function920720 +Node: Extension API Description922706 +Node: Extension API Functions Introduction924156 +Node: General Data Types928992 +Ref: General Data Types-Footnote-1934679 +Node: Memory Allocation Functions934978 +Ref: Memory Allocation Functions-Footnote-1937808 +Node: Constructor Functions937904 +Node: Registration Functions939638 +Node: Extension Functions940323 +Node: Exit Callback Functions942619 +Node: Extension Version String943867 +Node: Input Parsers944517 +Node: Output Wrappers954332 +Node: Two-way processors958848 +Node: Printing Messages961052 +Ref: Printing Messages-Footnote-1962129 +Node: Updating `ERRNO'962281 +Node: Requesting Values963021 +Ref: table-value-types-returned963749 +Node: Accessing Parameters964707 +Node: Symbol Table Access965938 +Node: Symbol table by name966452 +Node: Symbol table by cookie968432 +Ref: Symbol table by cookie-Footnote-1972571 +Node: Cached values972634 +Ref: Cached values-Footnote-1976138 +Node: Array Manipulation976229 +Ref: Array Manipulation-Footnote-1977327 +Node: Array Data Types977366 +Ref: Array Data Types-Footnote-1980023 +Node: Array Functions980115 +Node: Flattening Arrays983969 +Node: Creating Arrays990856 +Node: Extension API Variables995623 +Node: Extension Versioning996259 +Node: Extension API Informational Variables998160 +Node: Extension API Boilerplate999248 +Node: Finding Extensions1003064 +Node: Extension Example1003624 +Node: Internal File Description1004396 +Node: Internal File Ops1008463 +Ref: Internal File Ops-Footnote-11020121 +Node: Using Internal File Ops1020261 +Ref: Using Internal File Ops-Footnote-11022644 +Node: Extension Samples1022917 +Node: Extension Sample File Functions1024441 +Node: Extension Sample Fnmatch1032043 +Node: Extension Sample Fork1033525 +Node: Extension Sample Inplace1034738 +Node: Extension Sample Ord1036413 +Node: Extension Sample Readdir1037249 +Ref: table-readdir-file-types1038125 +Node: Extension Sample Revout1038936 +Node: Extension Sample Rev2way1039527 +Node: Extension Sample Read write array1040268 +Node: Extension Sample Readfile1042207 +Node: Extension Sample Time1043302 +Node: Extension Sample API Tests1044651 +Node: gawkextlib1045142 +Node: Extension summary1047792 +Node: Extension Exercises1051474 +Node: Language History1052196 +Node: V7/SVR3.11053853 +Node: SVR41056034 +Node: POSIX1057479 +Node: BTL1058868 +Node: POSIX/GNU1059602 +Node: Feature History1065231 +Node: Common Extensions1078329 +Node: Ranges and Locales1079653 +Ref: Ranges and Locales-Footnote-11084292 +Ref: Ranges and Locales-Footnote-21084319 +Ref: Ranges and Locales-Footnote-31084553 +Node: Contributors1084774 +Node: History summary1090314 +Node: Installation1091683 +Node: Gawk Distribution1092639 +Node: Getting1093123 +Node: Extracting1093947 +Node: Distribution contents1095589 +Node: Unix Installation1101359 +Node: Quick Installation1101976 +Node: Additional Configuration Options1104407 +Node: Configuration Philosophy1106147 +Node: Non-Unix Installation1108498 +Node: PC Installation1108956 +Node: PC Binary Installation1110282 +Node: PC Compiling1112130 +Ref: PC Compiling-Footnote-11115151 +Node: PC Testing1115256 +Node: PC Using1116432 +Node: Cygwin1120547 +Node: MSYS1121370 +Node: VMS Installation1121868 +Node: VMS Compilation1122660 +Ref: VMS Compilation-Footnote-11123882 +Node: VMS Dynamic Extensions1123940 +Node: VMS Installation Details1125624 +Node: VMS Running1127876 +Node: VMS GNV1130717 +Node: VMS Old Gawk1131451 +Node: Bugs1131921 +Node: Other Versions1135825 +Node: Installation summary1142038 +Node: Notes1143094 +Node: Compatibility Mode1143959 +Node: Additions1144741 +Node: Accessing The Source1145666 +Node: Adding Code1147102 +Node: New Ports1153274 +Node: Derived Files1157756 +Ref: Derived Files-Footnote-11163231 +Ref: Derived Files-Footnote-21163265 +Ref: Derived Files-Footnote-31163861 +Node: Future Extensions1163975 +Node: Implementation Limitations1164581 +Node: Extension Design1165829 +Node: Old Extension Problems1166983 +Ref: Old Extension Problems-Footnote-11168500 +Node: Extension New Mechanism Goals1168557 +Ref: Extension New Mechanism Goals-Footnote-11171917 +Node: Extension Other Design Decisions1172106 +Node: Extension Future Growth1174214 +Node: Old Extension Mechanism1175050 +Node: Notes summary1176812 +Node: Basic Concepts1177998 +Node: Basic High Level1178679 +Ref: figure-general-flow1178951 +Ref: figure-process-flow1179550 +Ref: Basic High Level-Footnote-11182779 +Node: Basic Data Typing1182964 +Node: Glossary1186292 +Node: Copying1211450 +Node: GNU Free Documentation License1249006 +Node: Index1274142  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index e43415dc..328c1782 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -5091,6 +5091,7 @@ of hexadecimal digits (@samp{0}--@samp{9}, and either @samp{A}--@samp{F} or @samp{a}--@samp{f}). A maximum of two digts are allowed after the @samp{\x}. Any further hexadecimal digits are treated as simple letters or numbers. @value{COMMONEXT} +(The @samp{\x} escape sequence is not allowed in POSIX awk.) @quotation CAUTION In ISO C, the escape sequence continues until the first nonhexadecimal @@ -5099,7 +5100,10 @@ digit is seen. For many years, @command{gawk} would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. -However, using more than two hexadecimal digits produces +However, using more than two hexadecimal digits produced +undefined results. +As of @value{PVERSION} @strong{FIXME:} 4.3.0, only two digits +are processed. @end quotation @cindex @code{\} (backslash), @code{\/} escape sequence @@ -27882,8 +27886,7 @@ The profiled version of your program may not look exactly like what you typed when you wrote it. This is because @command{gawk} creates the profiled version by ``pretty printing'' its internal representation of the program. The advantage to this is that @command{gawk} can produce -a standard representation. The disadvantage is that all source-code -comments are lost. +a standard representation. Also, things such as: @example @@ -27980,6 +27983,23 @@ When called this way, @command{gawk} ``pretty prints'' the program into Once upon a time, the @option{--pretty-print} option would also run your program. This is is no longer the case. @end quotation + +There is a significant difference between the output created when +profiling, and that created when pretty-printing. Pretty-printed output +preserves the original comments that were in the program, although their +placement may not correspond exactly to their original locations in the +source code. + +However, as a deliberate design decision, profiling output @emph{omits} +the original program's comments. This allows you to focus on the +execution count data and helps you avoid the temptation to use the +profiler for pretty-printing. + +Additionally, pretty-printed output does not have the leading indentation +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 diff --git a/doc/gawktexi.in b/doc/gawktexi.in index e2e2a034..2ed967fb 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -5002,6 +5002,7 @@ of hexadecimal digits (@samp{0}--@samp{9}, and either @samp{A}--@samp{F} or @samp{a}--@samp{f}). A maximum of two digts are allowed after the @samp{\x}. Any further hexadecimal digits are treated as simple letters or numbers. @value{COMMONEXT} +(The @samp{\x} escape sequence is not allowed in POSIX awk.) @quotation CAUTION In ISO C, the escape sequence continues until the first nonhexadecimal @@ -5010,7 +5011,10 @@ digit is seen. For many years, @command{gawk} would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. -However, using more than two hexadecimal digits produces +However, using more than two hexadecimal digits produced +undefined results. +As of @value{PVERSION} @strong{FIXME:} 4.3.0, only two digits +are processed. @end quotation @cindex @code{\} (backslash), @code{\/} escape sequence -- cgit v1.2.3 From ab0f848957a4b9d891e7e793cd232cc4a8e61fac Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 25 Oct 2014 20:22:02 +0300 Subject: New de.po file. --- po/de.po | 1653 +++++++++++++++++++++++++------------------------------------- 1 file changed, 662 insertions(+), 991 deletions(-) diff --git a/po/de.po b/po/de.po index f92c3bb7..ca6d5475 100644 --- a/po/de.po +++ b/po/de.po @@ -2,14 +2,14 @@ # Copyright (C) 2000 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # -# Philipp Thomas , 2011 2012 +# Philipp Thomas , 2011, 2012, 2014 # msgid "" msgstr "" -"Project-Id-Version: gawk 4.0.0h\n" +"Project-Id-Version: gawk 4.1.0b\n" "Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2012-01-30 16:21+0100\n" +"POT-Creation-Date: 2014-01-14 22:23+0200\n" +"PO-Revision-Date: 2014-10-23 17:31+0200\n" "Last-Translator: Philipp Thomas \n" "Language-Team: German \n" "Language: de\n" @@ -36,8 +36,8 @@ msgstr "Es wird versucht, den skalaren Parameter »%s« als Feld zu verwenden" msgid "attempt to use scalar `%s' as an array" msgstr "Es wird versucht, den Skalar »%s« als Array zu verwenden" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1599 builtin.c:1645 +#: builtin.c:1658 builtin.c:2086 builtin.c:2100 eval.c:1122 eval.c:1126 #: eval.c:1531 #, c-format msgid "attempt to use array `%s' in a scalar context" @@ -54,9 +54,8 @@ msgid "attempt to use scalar `%s[\"%.*s\"]' as an array" msgstr "Es wird versucht, den Skalar »%s[\"%.*s\"]« als Feld zu verwenden" #: array.c:776 -#, fuzzy msgid "adump: first argument not an array" -msgstr "adump: Das Argument ist kein Feld" +msgstr "adump: Das erste Argument ist kein Feld" #: array.c:815 msgid "asort: second argument not an array" @@ -76,27 +75,19 @@ msgstr "asorti: Das erste Argument ist kein Feld" #: array.c:831 msgid "asort: cannot use a subarray of first arg for second arg" -msgstr "" -"asort: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites " -"Argument verwendet werden" +msgstr "asort: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites Argument verwendet werden" #: array.c:832 msgid "asorti: cannot use a subarray of first arg for second arg" -msgstr "" -"asorti: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites " -"Argument verwendet werden" +msgstr "asorti: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites Argument verwendet werden" #: array.c:837 msgid "asort: cannot use a subarray of second arg for first arg" -msgstr "" -"asort: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes " -"Argument verwendet werden" +msgstr "asort: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes Argument verwendet werden" #: array.c:838 msgid "asorti: cannot use a subarray of second arg for first arg" -msgstr "" -"asorti: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes " -"Argument verwendet werden" +msgstr "asorti: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes Argument verwendet werden" #: array.c:1314 #, c-format @@ -128,16 +119,12 @@ msgstr "»%s« ist eine eingebaute Funktion und kann nicht umdefiniert werden" #: awkgram.y:419 msgid "regexp constant `//' looks like a C++ comment, but is not" -msgstr "" -"Die Regulärer-Ausdruck-Konstante »//« sieht wie ein C-Kommentar aus, ist " -"aber keiner" +msgstr "Die Regulärer-Ausdruck-Konstante »//« sieht wie ein C-Kommentar aus, ist aber keiner" #: awkgram.y:423 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" -msgstr "" -"Die Regulärer-Ausdruck-Konstante »/%s/« sieht wie ein C-Kommentar aus, ist " -"aber keiner" +msgstr "Die Regulärer-Ausdruck-Konstante »/%s/« sieht wie ein C-Kommentar aus, ist aber keiner" #: awkgram.y:515 #, c-format @@ -148,12 +135,11 @@ msgstr "doppelte Case-Werte im Switch-Block: %s" msgid "duplicate `default' detected in switch body" msgstr "doppeltes »default« im Switch-Block gefunden" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:796 awkgram.y:3699 msgid "`break' is not allowed outside a loop or switch" -msgstr "" -"»break« ist außerhalb einer Schleife oder eines Switch-Blocks nicht zulässig" +msgstr "»break« ist außerhalb einer Schleife oder eines Switch-Blocks nicht zulässig" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:805 awkgram.y:3691 msgid "`continue' is not allowed outside a loop" msgstr "»continue« ist außerhalb einer Schleife nicht zulässig" @@ -173,16 +159,15 @@ msgstr "»return« wird außerhalb einer Funktion verwendet" #: awkgram.y:922 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" -msgstr "" -"Einfaches »print« in BEGIN- oder END-Regel soll vermutlich »print \"\"« sein" +msgstr "Einfaches »print« in BEGIN- oder END-Regel soll vermutlich »print \"\"« sein" #: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with SYMTAB" -msgstr "" +msgstr "»delete« ist in Zusammenhang mit SYMTAB nicht zulässig" #: awkgram.y:990 awkgram.y:1039 msgid "`delete' is not allowed with FUNCTAB" -msgstr "" +msgstr "»delete« ist in Zusammenhang mit FUNCTAB nicht zulässig" #: awkgram.y:1024 awkgram.y:1028 msgid "`delete(array)' is a non-portable tawk extension" @@ -220,8 +205,7 @@ msgstr "»getline« ist ungültig innerhalb der »%s«-Regel" #: awkgram.y:1425 msgid "non-redirected `getline' undefined inside END action" -msgstr "" -"Nicht-umgelenktes »getline« ist innerhalb der END-Aktion nicht definiert" +msgstr "Nicht-umgelenktes »getline« ist innerhalb der END-Aktion nicht definiert" #: awkgram.y:1444 msgid "old awk does not support multidimensional arrays" @@ -238,287 +222,274 @@ msgstr "indirekte Funktionsaufrufe sind eine gawk-Erweiterung" #: awkgram.y:1620 #, c-format msgid "can not use special variable `%s' for indirect function call" -msgstr "" -"die besondere Variable »%s« kann nicht für den indirekten Funktionsaufruf " -"verwendet werden" +msgstr "die besondere Variable »%s« kann nicht für den indirekten Funktionsaufruf verwendet werden" #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "Ungültiger Index-Ausdruck" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2024 awkgram.y:2044 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "Warnung: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2042 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "Fatal: " -#: awkgram.y:2116 +#: awkgram.y:2092 msgid "unexpected newline or end of string" msgstr "Unerwarteter Zeilenumbruch oder Ende der Zeichenkette" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2359 awkgram.y:2435 awkgram.y:2658 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "Quelldatei »%s« kann nicht zum Lesen geöffnet werden (%s)" -#: awkgram.y:2384 awkgram.y:2509 -#, fuzzy, c-format +#: awkgram.y:2360 awkgram.y:2485 +#, c-format msgid "can't open shared library `%s' for reading (%s)" -msgstr "Quelldatei »%s« kann nicht zum Lesen geöffnet werden (%s)" +msgstr "Die dynamische Bibliothek »%s« kann nicht zum Lesen geöffnet werden (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2362 awkgram.y:2436 awkgram.y:2486 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "Unbekannte Ursache" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2371 awkgram.y:2395 #, c-format msgid "can't include `%s' and use it as a program file" -msgstr "" +msgstr "»%s« kann nicht eingebunden und als Programmdatei verwendet werden" -#: awkgram.y:2408 +#: awkgram.y:2384 #, c-format msgid "already included source file `%s'" msgstr "Quelldatei »%s« wurde bereits eingebunden" -#: awkgram.y:2409 -#, fuzzy, c-format +#: awkgram.y:2385 +#, c-format msgid "already loaded shared library `%s'" -msgstr "Quelldatei »%s« wurde bereits eingebunden" +msgstr "Die dynamische Bibliothek »%s« wurde bereits eingebunden" -#: awkgram.y:2444 +#: awkgram.y:2420 msgid "@include is a gawk extension" msgstr "»@include« ist eine gawk-Erweiterung" -#: awkgram.y:2450 +#: awkgram.y:2426 msgid "empty filename after @include" msgstr "leerer Dateiname nach @include" -#: awkgram.y:2494 -#, fuzzy +#: awkgram.y:2470 msgid "@load is a gawk extension" -msgstr "»@include« ist eine gawk-Erweiterung" +msgstr "»@load« ist eine Gawk-Erweiterung" -#: awkgram.y:2500 -#, fuzzy +#: awkgram.y:2476 msgid "empty filename after @load" -msgstr "leerer Dateiname nach @include" +msgstr "leerer Dateiname nach @load" -#: awkgram.y:2634 +#: awkgram.y:2610 msgid "empty program text on command line" msgstr "Kein Programmtext auf der Kommandozeile" -#: awkgram.y:2749 +#: awkgram.y:2725 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)" -#: awkgram.y:2760 +#: awkgram.y:2736 #, c-format msgid "source file `%s' is empty" msgstr "Die Quelldatei »%s« ist leer" -#: awkgram.y:2937 +#: awkgram.y:2913 msgid "source file does not end in newline" msgstr "Die Quelldatei hört nicht mit einem Zeilenende auf" -#: awkgram.y:3042 +#: awkgram.y:3018 msgid "unterminated regexp ends with `\\' at end of file" -msgstr "" -"Nicht beendeter regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei" +msgstr "Nicht beendeter regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei" -#: awkgram.y:3066 +#: awkgram.y:3042 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" -msgstr "" -"%s: %d: der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert " -"nicht in gawk" +msgstr "%s: %d: der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert nicht in gawk" -#: awkgram.y:3070 +#: awkgram.y:3046 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" -msgstr "" -"Der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert nicht in " -"gawk" +msgstr "Der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert nicht in gawk" -#: awkgram.y:3077 +#: awkgram.y:3053 msgid "unterminated regexp" msgstr "Nicht beendeter regulärer Ausdruck" -#: awkgram.y:3081 +#: awkgram.y:3057 msgid "unterminated regexp at end of file" msgstr "Nicht beendeter regulärer Ausdruck am Dateiende" -#: awkgram.y:3140 +#: awkgram.y:3116 msgid "use of `\\ #...' line continuation is not portable" -msgstr "" -"Die Verwendung von »\\#...« zur Fortsetzung von Zeilen ist nicht portabel" +msgstr "Die Verwendung von »\\#...« zur Fortsetzung von Zeilen ist nicht portabel" -#: awkgram.y:3156 +#: awkgram.y:3132 msgid "backslash not last character on line" msgstr "das letzte Zeichen auf der Zeile ist kein Backslash (»\\«)" -#: awkgram.y:3217 +#: awkgram.y:3193 msgid "POSIX does not allow operator `**='" msgstr "POSIX erlaubt den Operator »**=« nicht" -#: awkgram.y:3219 +#: awkgram.y:3195 msgid "old awk does not support operator `**='" msgstr "Das alte awk unterstützt den Operator »**=« nicht" -#: awkgram.y:3228 +#: awkgram.y:3204 msgid "POSIX does not allow operator `**'" msgstr "POSIX erlaubt den Operator »**« nicht" -#: awkgram.y:3230 +#: awkgram.y:3206 msgid "old awk does not support operator `**'" msgstr "Das alte awk unterstützt den Operator »**« nicht" -#: awkgram.y:3265 +#: awkgram.y:3241 msgid "operator `^=' is not supported in old awk" msgstr "Das alte awk unterstützt den Operator »^=« nicht" -#: awkgram.y:3273 +#: awkgram.y:3249 msgid "operator `^' is not supported in old awk" msgstr "Das alte awk unterstützt den Operator »^« nicht" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3342 awkgram.y:3358 command.y:1178 msgid "unterminated string" msgstr "Nicht beendete Zeichenkette" -#: awkgram.y:3603 +#: awkgram.y:3579 #, c-format msgid "invalid char '%c' in expression" msgstr "Ungültiges Zeichen »%c« in einem Ausdruck" -#: awkgram.y:3650 +#: awkgram.y:3626 #, c-format msgid "`%s' is a gawk extension" msgstr "»%s« ist eine gawk-Erweiterung" -#: awkgram.y:3655 +#: awkgram.y:3631 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX erlaubt »%s« nicht" -#: awkgram.y:3663 +#: awkgram.y:3639 #, c-format msgid "`%s' is not supported in old awk" msgstr "»%s« wird im alten awk nicht unterstützt" -#: awkgram.y:3753 +#: awkgram.y:3729 msgid "`goto' considered harmful!\n" msgstr "»goto« gilt als schlechter Stil!\n" -#: awkgram.y:3787 +#: awkgram.y:3763 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "Unzulässige Argumentzahl %d für %s" -#: awkgram.y:3822 +#: awkgram.y:3798 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: Ein String als letztes Argument von substitute hat keinen Effekt" -#: awkgram.y:3827 +#: awkgram.y:3803 #, c-format msgid "%s third parameter is not a changeable object" msgstr "Der dritte Parameter von %s ist ein unveränderliches Objekt" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3886 awkgram.y:3889 msgid "match: third argument is a gawk extension" msgstr "match: Das dritte Argument ist eine gawk-Erweiterung" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3943 awkgram.y:3946 msgid "close: second argument is a gawk extension" msgstr "close: Das zweite Argument ist eine gawk-Erweiterung" -#: awkgram.y:3982 +#: awkgram.y:3958 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "Fehlerhafte Verwendung von dcgettext(_\"...\"): \n" "Entfernen Sie den führenden Unterstrich" -#: awkgram.y:3997 +#: awkgram.y:3973 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "Fehlerhafte Verwendung von dcngettext(_\"...\"): \n" "Entfernen Sie den führenden Unterstrich" -#: awkgram.y:4016 -#, fuzzy +#: awkgram.y:3992 msgid "index: regexp constant as second argument is not allowed" -msgstr "index: Zweites Argument ist kein string" +msgstr "index: eine Regexp-Konstante als zweites Argument ist unzulässig" -#: awkgram.y:4069 +#: awkgram.y:4045 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "Funktion »%s«: Parameter »%s« verdeckt eine globale Variable" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4102 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "»%s« kann nicht zum Schreiben geöffne werden(%s)" -#: awkgram.y:4127 +#: awkgram.y:4103 msgid "sending variable list to standard error" msgstr "Die Liste der Variablen wird auf der Standardfehlerausgabe ausgegeben" -#: awkgram.y:4135 +#: awkgram.y:4111 #, c-format msgid "%s: close failed (%s)" msgstr "%s: close ist gescheitert (%s)" -#: awkgram.y:4160 +#: awkgram.y:4136 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() zweimal aufgerufen!" -#: awkgram.y:4168 +#: awkgram.y:4144 msgid "there were shadowed variables." msgstr "es sind verdeckte Variablen vorhanden" -#: awkgram.y:4239 +#: awkgram.y:4215 #, c-format msgid "function name `%s' previously defined" msgstr "Funktion »%s« wurde bereits definiert" -#: awkgram.y:4285 +#: awkgram.y:4261 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "Funktion »%s«: Funktionsnamen können nicht als Parameternamen benutzen" -#: awkgram.y:4288 +#: awkgram.y:4264 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" -msgstr "" -"Funktion »%s«: die spezielle Variable »%s« kann nicht als Parameter " -"verwendet werden" +msgstr "Funktion »%s«: die spezielle Variable »%s« kann nicht als Parameter verwendet werden" -#: awkgram.y:4296 +#: awkgram.y:4272 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "Funktion »%s«: Parameter #%d, »%s« wiederholt Parameter #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4359 awkgram.y:4365 #, c-format msgid "function `%s' called but never defined" msgstr "Aufgerufene Funktion »%s« ist nirgends definiert" -#: awkgram.y:4393 +#: awkgram.y:4369 #, c-format msgid "function `%s' defined but never called directly" msgstr "Funktion »%s« wurde definiert aber nirgends aufgerufen" -#: awkgram.y:4425 +#: awkgram.y:4401 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "Regulärer-Ausdruck-Konstante für Parameter #%d ergibt einen \n" "logischen Wert" -#: awkgram.y:4484 +#: awkgram.y:4460 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -527,24 +498,23 @@ msgstr "" "Funktion »%s« wird mit Leerzeichen zwischen Name und »(« aufgerufen, \n" "oder als Variable oder Feld verwendet" -#: awkgram.y:4720 +#: awkgram.y:4696 msgid "division by zero attempted" msgstr "Division durch Null wurde versucht" -#: awkgram.y:4729 +#: awkgram.y:4705 #, c-format msgid "division by zero attempted in `%%'" msgstr "Division durch Null versucht in »%%«" -#: awkgram.y:5049 -msgid "" -"cannot assign a value to the result of a field post-increment expression" -msgstr "" +#: awkgram.y:5025 +msgid "cannot assign a value to the result of a field post-increment expression" +msgstr "dem Ergebnis eines Feld-Postinkrementausdruck kann kein Wert zugewiesen werden" -#: awkgram.y:5052 -#, fuzzy, c-format +#: awkgram.y:5028 +#, c-format msgid "invalid target of assignment (opcode %s)" -msgstr "Unzulässige Argumentzahl %d für %s" +msgstr "Unzulässiges Ziel für eine Zuweisung (Opcode %s)" #: builtin.c:133 #, c-format @@ -567,15 +537,12 @@ msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" #: builtin.c:229 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" -msgstr "" -"fflush: Leeren der Puffer nicht möglich, Pipe »%s« ist nur zum Lesen geöffnet" +msgstr "fflush: Leeren der Puffer nicht möglich, Pipe »%s« ist nur zum Lesen geöffnet" #: builtin.c:232 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" -msgstr "" -"fflush: Leeren der Puffer nicht möglich, Datei »%s« ist nur zum Lesen " -"geöffnet" +msgstr "fflush: Leeren der Puffer nicht möglich, Datei »%s« ist nur zum Lesen geöffnet" #: builtin.c:244 #, c-format @@ -645,9 +612,7 @@ msgstr "Fatal: die Anzahl der Argumen bei »$« muss > 0 sein" #: builtin.c:919 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" -msgstr "" -"Fatal: Argumentenanzahl %ld ist größer als die Gesamtzahl angegebener " -"Argumente" +msgstr "Fatal: Argumentenanzahl %ld ist größer als die Gesamtzahl angegebener Argumente" #: builtin.c:923 msgid "fatal: `$' not permitted after period in format" @@ -658,315 +623,297 @@ msgid "fatal: no `$' supplied for positional field width or precision" msgstr "Fatal: »$« fehlt in positionsabhängiger Feldbreite oder Genauigkeit" # -#: builtin.c:1009 +#: builtin.c:1011 msgid "`l' is meaningless in awk formats; ignored" msgstr "»l« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1013 +#: builtin.c:1015 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "Fatal: »l« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1026 +#: builtin.c:1028 msgid "`L' is meaningless in awk formats; ignored" msgstr "»L« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1030 +#: builtin.c:1032 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "Fatal: »L« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1043 +#: builtin.c:1045 msgid "`h' is meaningless in awk formats; ignored" msgstr "»h« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1047 +#: builtin.c:1049 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "Fatal: »h« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1463 +#: builtin.c:1447 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: Wert %g ist außerhalb des Bereichs für Format »%%%c«" -#: builtin.c:1561 +#: builtin.c:1545 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" -msgstr "" -"das unbekannte Zeichen »%c« in der Formatspezifikation wird ignoriert: keine " -"Argumente umgewandelt" +msgstr "das unbekannte Zeichen »%c« in der Formatspezifikation wird ignoriert: keine Argumente umgewandelt" -#: builtin.c:1566 +#: builtin.c:1550 msgid "fatal: not enough arguments to satisfy format string" msgstr "Fatal: Nicht genügend Argumente für die Formatangabe" -#: builtin.c:1568 +#: builtin.c:1552 msgid "^ ran out for this one" msgstr "^ hierfür fehlte es" -#: builtin.c:1575 +#: builtin.c:1559 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: Format-Spezifikation hat keinen Controlcode" -#: builtin.c:1578 +#: builtin.c:1562 msgid "too many arguments supplied for format string" msgstr "Zu viele Argumente für den Formatstring" -#: builtin.c:1634 -#, fuzzy +#: builtin.c:1618 msgid "sprintf: no arguments" -msgstr "printf: Keine Argumente" +msgstr "sprintf: Keine Argumente" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1641 builtin.c:1652 msgid "printf: no arguments" msgstr "printf: Keine Argumente" -#: builtin.c:1711 +#: builtin.c:1695 msgid "sqrt: received non-numeric argument" msgstr "sqrt: das Argument ist keine Zahl" -#: builtin.c:1715 +#: builtin.c:1699 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: das Argument %g ist negativ" -#: builtin.c:1746 +#: builtin.c:1730 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: Länge %g ist nicht >= 1" -#: builtin.c:1748 +#: builtin.c:1732 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: Länge %g ist nicht >= 0" -#: builtin.c:1755 +#: builtin.c:1739 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: Nicht ganzzahlige Länge %g wird abgeschnitten" -#: builtin.c:1760 +#: builtin.c:1744 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" -msgstr "" -"substr: Länge %g ist zu groß für Stringindizierung, wird auf %g gekürzt" +msgstr "substr: Länge %g ist zu groß für Stringindizierung, wird auf %g gekürzt" -#: builtin.c:1772 +#: builtin.c:1756 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: Start-Index %g ist ungültig, 1 wird verwendet" -#: builtin.c:1777 +#: builtin.c:1761 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: Nicht ganzzahliger Start-Wert %g wird abgeschnitten" -#: builtin.c:1802 +#: builtin.c:1786 msgid "substr: source string is zero length" msgstr "substr: Quellstring ist leer" -#: builtin.c:1818 +#: builtin.c:1802 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: Start-Wert %g liegt hinter dem Ende des Strings" -#: builtin.c:1826 +#: builtin.c:1810 #, c-format -msgid "" -"substr: length %g at start index %g exceeds length of first argument (%lu)" -msgstr "" -"substr: Länge %g am Start-Wert %g überschreitet die Länge des ersten " -"Arguments (%lu)" +msgid "substr: length %g at start index %g exceeds length of first argument (%lu)" +msgstr "substr: Länge %g am Start-Wert %g überschreitet die Länge des ersten Arguments (%lu)" -#: builtin.c:1900 +#: builtin.c:1884 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: Formatwert in PROCINFO[\"strftime\"] ist numerischen Typs" -#: builtin.c:1923 +#: builtin.c:1907 msgid "strftime: received non-numeric second argument" msgstr "strftime: Das zweite Argument ist keine Zahl" -#: builtin.c:1927 +#: builtin.c:1911 msgid "strftime: second argument less than 0 or too big for time_t" -msgstr "" -"strftime: das zweite Argument ist kleiner als 0 oder zu groß für time_t" +msgstr "strftime: das zweite Argument ist kleiner als 0 oder zu groß für time_t" -#: builtin.c:1934 +#: builtin.c:1918 msgid "strftime: received non-string first argument" msgstr "strftime: Das erste Argument ist kein String" -#: builtin.c:1941 +#: builtin.c:1925 msgid "strftime: received empty format string" msgstr "strftime: Der Format-String ist leer" -#: builtin.c:2007 +#: builtin.c:1991 msgid "mktime: received non-string argument" msgstr "mktime: Das Argument ist kein String" -#: builtin.c:2024 +#: builtin.c:2008 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: mindestens einer der Werte ist außerhalb des normalen Bereichs" -#: builtin.c:2059 +#: builtin.c:2043 msgid "'system' function not allowed in sandbox mode" msgstr "Die Funktion »system« ist im Sandbox-Modus nicht erlaubt" -#: builtin.c:2064 +#: builtin.c:2048 msgid "system: received non-string argument" msgstr "system: Das Argument ist kein String" -#: builtin.c:2184 +#: builtin.c:2168 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "Referenz auf das nicht initialisierte Feld »$%d«" -#: builtin.c:2271 +#: builtin.c:2255 msgid "tolower: received non-string argument" msgstr "tolower: das Argument ist kein String" -#: builtin.c:2305 +#: builtin.c:2289 msgid "toupper: received non-string argument" msgstr "toupper: das Argument ist kein String" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2325 mpfr.c:672 msgid "atan2: received non-numeric first argument" msgstr "atan2: das erste Argument ist keine Zahl" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2327 mpfr.c:674 msgid "atan2: received non-numeric second argument" msgstr "atan2: das zweite Argument ist keine Zahl" -#: builtin.c:2362 +#: builtin.c:2346 msgid "sin: received non-numeric argument" msgstr "sin: das Argument ist keine Zahl" -#: builtin.c:2378 +#: builtin.c:2362 msgid "cos: received non-numeric argument" msgstr "cos: das Argument ist keine Zahl" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2415 mpfr.c:1156 msgid "srand: received non-numeric argument" msgstr "srand: das Argument ist keine Zahl" -#: builtin.c:2462 +#: builtin.c:2446 msgid "match: third argument is not an array" msgstr "match: das dritte Argument ist kein Array" -#: builtin.c:2734 +#: builtin.c:2718 msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: 0 als drittes Argument wird als 1 interpretiert" -#: builtin.c:3030 +#: builtin.c:3014 msgid "lshift: received non-numeric first argument" msgstr "lshift: das erste Argument ist keine Zahl" -#: builtin.c:3032 +#: builtin.c:3016 msgid "lshift: received non-numeric second argument" msgstr "lshift: das zweite Argument ist keine Zahl" -#: builtin.c:3038 -#, fuzzy, c-format +#: builtin.c:3022 +#, c-format msgid "lshift(%f, %f): negative values will give strange results" -msgstr "" -"lshift(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "lshift(%f, %f): Negative Werte werden zu merkwürdigen Ergebnissen führen" -#: builtin.c:3040 -#, fuzzy, c-format +#: builtin.c:3024 +#, c-format msgid "lshift(%f, %f): fractional values will be truncated" -msgstr "lshift(%lf, %lf): Dezimalteil wird abgeschnitten" +msgstr "lshift(%f, %f): Dezimalteil wird abgeschnitten" -#: builtin.c:3042 -#, fuzzy, c-format +#: builtin.c:3026 +#, c-format msgid "lshift(%f, %f): too large shift value will give strange results" -msgstr "" -"lshift(%lf, %lf): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen " -"führen" +msgstr "lshift(%f, %f): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen führen" -#: builtin.c:3067 +#: builtin.c:3051 msgid "rshift: received non-numeric first argument" msgstr "rshift: das erste Argument ist keine Zahl" -#: builtin.c:3069 +#: builtin.c:3053 msgid "rshift: received non-numeric second argument" msgstr "rshift: das zweite Argument ist keine Zahl" -#: builtin.c:3075 -#, fuzzy, c-format +#: builtin.c:3059 +#, c-format msgid "rshift(%f, %f): negative values will give strange results" -msgstr "" -"rshift (%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "rshift (%f, %f): Negative Werte werden zu merkwürdigen Ergebnissen führen" -#: builtin.c:3077 -#, fuzzy, c-format +#: builtin.c:3061 +#, c-format msgid "rshift(%f, %f): fractional values will be truncated" -msgstr "rshift(%lf, %lf): Dezimalteil wird abgeschnitten" +msgstr "rshift(%f, %f): Dezimalteil wird abgeschnitten" -#: builtin.c:3079 -#, fuzzy, c-format +#: builtin.c:3063 +#, c-format msgid "rshift(%f, %f): too large shift value will give strange results" -msgstr "" -"rshift(%lf, %lf): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen " -"führen" +msgstr "rshift(%f, %f): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen führen" -#: builtin.c:3104 mpfr.c:968 -#, fuzzy +#: builtin.c:3088 mpfr.c:968 msgid "and: called with less than two arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "and: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3109 -#, fuzzy, c-format +#: builtin.c:3093 +#, c-format msgid "and: argument %d is non-numeric" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "and: das Argument %d ist nicht numerisch" -#: builtin.c:3113 -#, fuzzy, c-format +#: builtin.c:3097 +#, c-format msgid "and: argument %d negative value %g will give strange results" -msgstr "" -"and(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "and: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen Ergebnissen führen" -#: builtin.c:3136 mpfr.c:1000 -#, fuzzy +#: builtin.c:3120 mpfr.c:1000 msgid "or: called with less than two arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "or: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3141 -#, fuzzy, c-format +#: builtin.c:3125 +#, c-format msgid "or: argument %d is non-numeric" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "or: das Argument %d ist nicht numerisch" -#: builtin.c:3145 -#, fuzzy, c-format +#: builtin.c:3129 +#, c-format msgid "or: argument %d negative value %g will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "or: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen Ergebnissen führen" -#: builtin.c:3167 mpfr.c:1031 -#, fuzzy +#: builtin.c:3151 mpfr.c:1031 msgid "xor: called with less than two arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "xor: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3173 -#, fuzzy, c-format +#: builtin.c:3157 +#, c-format msgid "xor: argument %d is non-numeric" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "xor: das Argument %d ist nicht numerisch" -#: builtin.c:3177 -#, fuzzy, c-format +#: builtin.c:3161 +#, c-format msgid "xor: argument %d negative value %g will give strange results" -msgstr "xor(%lf, %lf: Negative Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "xor: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen Ergebnissen führen" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3186 mpfr.c:787 msgid "compl: received non-numeric argument" msgstr "compl: das erste Argument ist keine Zahl" -#: builtin.c:3208 -#, fuzzy, c-format +#: builtin.c:3192 +#, c-format msgid "compl(%f): negative value will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "compl(%f): Der negative Wert wird zu merkwürdigen Ergebnissen führen" -#: builtin.c:3210 -#, fuzzy, c-format +#: builtin.c:3194 +#, c-format msgid "compl(%f): fractional value will be truncated" -msgstr "compl(%lf): Dezimalteil wird abgeschnitten" +msgstr "compl(%f): der Dezimalteil wird abgeschnitten" -#: builtin.c:3379 +#: builtin.c:3363 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: »%s« ist keine gültige Locale-Kategorie" @@ -974,279 +921,266 @@ msgstr "dcgettext: »%s« ist keine gültige Locale-Kategorie" #: command.y:225 #, c-format msgid "Type (g)awk statement(s). End with the command \"end\"\n" -msgstr "" +msgstr "Geben Sie »(g)awk Ausdrücke« und zum Abschluss \"end\" ein\n" #: command.y:289 -#, fuzzy, c-format +#, c-format msgid "invalid frame number: %d" -msgstr "Ungültiges Bereichsende" +msgstr "Ungültige Frame-Nummer: %d" #: command.y:295 -#, fuzzy, c-format +#, c-format msgid "info: invalid option - \"%s\"" -msgstr "%s: Ungültige Option -- »%c«\n" +msgstr "info: Ungültige Option - »%s«" #: command.y:321 #, c-format msgid "source \"%s\": already sourced." -msgstr "" +msgstr "Quelle »%s«: wurde bereits eingelesen." #: command.y:326 #, c-format msgid "save \"%s\": command not permitted." -msgstr "" +msgstr "save »%s«: Der Befehl ist nicht zulässig." #: command.y:339 msgid "Can't use command `commands' for breakpoint/watchpoint commands" -msgstr "" +msgstr "Der Befehl »commands« kann nicht für Break- bzw. Watchpoints verwendet werden" #: command.y:341 msgid "no breakpoint/watchpoint has been set yet" -msgstr "" +msgstr "es wurden noch keine Break-/Watchpoints gesetzt" #: command.y:343 msgid "invalid breakpoint/watchpoint number" -msgstr "" +msgstr "ungültige Break-/Watchpoint/Nummer" #: command.y:348 #, c-format msgid "Type commands for when %s %d is hit, one per line.\n" -msgstr "" +msgstr "Befehle eingeben, die bei Erreichen von %s %d ausgeführt werden sollen, einer pro Zeile.\n" #: command.y:350 #, c-format msgid "End with the command \"end\"\n" -msgstr "" +msgstr "Abschließen mit dem Befehl »end«\n" #: command.y:357 msgid "`end' valid only in command `commands' or `eval'" -msgstr "" +msgstr "»end« ist nur innerhalb der Befehle »commands« oder »eval« zulässig" #: command.y:367 msgid "`silent' valid only in command `commands'" -msgstr "" +msgstr "»silent« ist nur innerhalb des Befehls »commands« zuzlässig" #: command.y:373 -#, fuzzy, c-format +#, c-format msgid "trace: invalid option - \"%s\"" -msgstr "%s: Ungültige Option -- »%c«\n" +msgstr "trace: Ungültige Option - »%s«" #: command.y:387 msgid "condition: invalid breakpoint/watchpoint number" -msgstr "" +msgstr "condition: Unzulässige Break-/Watchpoint-Nummer" #: command.y:449 -#, fuzzy msgid "argument not a string" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "Das Argument ist keine Zeichenkette" #: command.y:459 command.y:464 #, c-format msgid "option: invalid parameter - \"%s\"" -msgstr "" +msgstr "option: ungültiger Parameter - »%s«" #: command.y:474 #, c-format msgid "no such function - \"%s\"" -msgstr "" +msgstr "Unbekannte Funktion - »%s«" #: command.y:531 -#, fuzzy, c-format +#, c-format msgid "enable: invalid option - \"%s\"" -msgstr "%s: Ungültige Option -- »%c«\n" +msgstr "enable: Ungültige Option - »%s«" #: command.y:597 -#, fuzzy, c-format +#, c-format msgid "invalid range specification: %d - %d" -msgstr "Ungültiges Bereichsende" +msgstr "Ungültige Bereichsangabe: %d - %d" #: command.y:659 -#, fuzzy msgid "non-numeric value for field number" -msgstr "unbekannter Wert für eine Feldangabe: %d\n" +msgstr "nichtnumerischer Wert als Feldnummer" #: command.y:680 command.y:687 msgid "non-numeric value found, numeric expected" -msgstr "" +msgstr "nichtnumerischer Wert wo ein numerischer erwartet wurde" #: command.y:712 command.y:718 msgid "non-zero integer value" -msgstr "" +msgstr "ganyzahliger Wert ungleich Null" #: command.y:817 -msgid "" -"backtrace [N] - print trace of all or N innermost (outermost if N < 0) " -"frames." -msgstr "" +msgid "backtrace [N] - print trace of all or N innermost (outermost if N < 0) frames." +msgstr "backtrace [N] - log von allen oder den N innersten (äußersten wenn N < 0) Rahmen." #: command.y:819 -msgid "" -"break [[filename:]N|function] - set breakpoint at the specified location." -msgstr "" +msgid "break [[filename:]N|function] - set breakpoint at the specified location." +msgstr "break [[Dateiname:]N|funktion - Breakpoint an der angegebenen Stelle setzen.]" #: command.y:821 msgid "clear [[filename:]N|function] - delete breakpoints previously set." -msgstr "" +msgstr "clear [[Dateiname:]N|Funktion - zuvor gesetzte Breakpoints löschen." #: command.y:823 -msgid "" -"commands [num] - starts a list of commands to be executed at a " -"breakpoint(watchpoint) hit." -msgstr "" +msgid "commands [num] - starts a list of commands to be executed at a breakpoint(watchpoint) hit." +msgstr "commands [Nr] - startet eine Liste von Befehlen, die bei Erreichen eines Break- bzw. Watchpoints ausgeführt werden." #: command.y:825 msgid "condition num [expr] - set or clear breakpoint or watchpoint condition." -msgstr "" +msgstr "condition Nr [Ausdruck] - Bedingungen für einen Break-/Watchpoint setzen oder löschen." #: command.y:827 msgid "continue [COUNT] - continue program being debugged." -msgstr "" +msgstr "continue [ANZAHL] - zu debuggendes Programm fortsetzen." #: command.y:829 msgid "delete [breakpoints] [range] - delete specified breakpoints." -msgstr "" +msgstr "delete [Breakpoints] [Bereich] - angegebene Breakpoints entfernen." #: command.y:831 msgid "disable [breakpoints] [range] - disable specified breakpoints." -msgstr "" +msgstr "disable [Breakpoints] [Bereich] - angegebene Breakpoints deaktivieren." #: command.y:833 msgid "display [var] - print value of variable each time the program stops." -msgstr "" +msgstr "display [Var] - den Wert der Variablen bei jedem Programmstop ausgeben." #: command.y:835 msgid "down [N] - move N frames down the stack." -msgstr "" +msgstr "down [N] - N Rahmen nach unten im Stack gehen." #: command.y:837 msgid "dump [filename] - dump instructions to file or stdout." -msgstr "" +msgstr "dump [Dateiname] - Befehle in eine Datei oder auf der Standardausgabe ausgeben" #: command.y:839 msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints." -msgstr "" +msgstr "enable [once|del] [Breakpoints] [Bereich] - die angegebenen Breakpoints aktivieren." #: command.y:841 msgid "end - end a list of commands or awk statements." -msgstr "" +msgstr "end - beendet eine Liste von Befehlen oder AWK/Ausdrücken." #: command.y:843 msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)." -msgstr "" +msgstr "eval stmt[p1, p2, ...] - Awk-Ausdrücke auswerten." #: command.y:845 msgid "finish - execute until selected stack frame returns." -msgstr "" +msgstr "finish - mit Ausführung fortfahren bis auisgewählter Rahmen verlassen wird." #: command.y:847 msgid "frame [N] - select and print stack frame number N." -msgstr "" +msgstr "frame [N] - den Stackrahmen Nummer N auswählen und ausgeben." #: command.y:849 msgid "help [command] - print list of commands or explanation of command." -msgstr "" +msgstr "help [Befehl] - gibt eine Liste der Befehle oder die Beschreibung eines einzelnen Befehls aus." #: command.y:851 msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT." -msgstr "" +msgstr "ignore N ZÄHLER - setzt den Ignorieren-Zähler von Breakpoint N auf ZÄHLER" #: command.y:853 -msgid "" -"info topic - source|sources|variables|functions|break|frame|args|locals|" -"display|watch." -msgstr "" +msgid "info topic - source|sources|variables|functions|break|frame|args|locals|display|watch." +msgstr "info Thema - source|sources|variables|functions|break|frame|args|locals|display|watch." #: command.y:855 msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)." -msgstr "" +msgstr "list [-|+|[Dateiname:]Zeilennr|Funktion|Breich] - die angegebenen Zeilen ausgeben" #: command.y:857 msgid "next [COUNT] - step program, proceeding through subroutine calls." -msgstr "" +msgstr "next [ZÄHLER] - Programm schrittweise ausführen aber Subroutinen in einem Rutsch ausführen" #: command.y:859 -msgid "" -"nexti [COUNT] - step one instruction, but proceed through subroutine calls." -msgstr "" +msgid "nexti [COUNT] - step one instruction, but proceed through subroutine calls." +msgstr "nexti [ZÄHLER] - einen Befehl abarbeiten. aber Subroutinen in einem Rutsch ausführen" #: command.y:861 msgid "option [name[=value]] - set or display debugger option(s)." -msgstr "" +msgstr "option [Name[=Wer]] - Debuggeroptionen setzen oder anzeigen." #: command.y:863 msgid "print var [var] - print value of a variable or array." -msgstr "" +msgstr "print Var [Var] - den Wert einer Variablen oder eines Feldes ausgeben." #: command.y:865 msgid "printf format, [arg], ... - formatted output." -msgstr "" +msgstr "printf Format, [Arg], ... - formatierte Ausgabe." #: command.y:867 msgid "quit - exit debugger." -msgstr "" +msgstr "quit - Debugger verlassen" #: command.y:869 msgid "return [value] - make selected stack frame return to its caller." -msgstr "" +msgstr "return [Wert] - den ausgewählten Stapelrahmen yu seinem Aufrufer zurück kehren lassen" #: command.y:871 msgid "run - start or restart executing program." -msgstr "" +msgstr "run - startet die (erneute) Ausführung des Programms." #: command.y:874 msgid "save filename - save commands from the session to file." -msgstr "" +msgstr "save Dateineme - sichert die Befehle der Sitzung in einer Datei." #: command.y:877 msgid "set var = value - assign value to a scalar variable." -msgstr "" +msgstr "set Var = Wert - einer skalaren Variablen einen Wert zuweisen" #: command.y:879 -msgid "" -"silent - suspends usual message when stopped at a breakpoint/watchpoint." -msgstr "" +msgid "silent - suspends usual message when stopped at a breakpoint/watchpoint." +msgstr "silent - unterdrückt die übliche Nachricht, wenn ein Break- bzw. Watchpoint erreicht wird." #: command.y:881 msgid "source file - execute commands from file." -msgstr "" +msgstr "source Datei - die Befehle in Datei ausführen" #: command.y:883 msgid "step [COUNT] - step program until it reaches a different source line." -msgstr "" +msgstr "step [ZÄHLER - Programm schrittweise ausführen bis es eine andere Quellzeile erricht." #: command.y:885 msgid "stepi [COUNT] - step one instruction exactly." -msgstr "" +msgstr "stepi [ZÄHLER - genau eine Instruktion ausführen" #: command.y:887 msgid "tbreak [[filename:]N|function] - set a temporary breakpoint." -msgstr "" +msgstr "tbreak [[Dateinem:]N|Funktion] - einen temporären Breakpoint setzen." #: command.y:889 msgid "trace on|off - print instruction before executing." -msgstr "" +msgstr "trace on|off - Instruktionen vor der Ausführung ausgeben." #: command.y:891 msgid "undisplay [N] - remove variable(s) from automatic display list." -msgstr "" +msgstr "undisplay [N] - Variablen von der Liste der automatisch Anzuzeigenden entfernen." #: command.y:893 -msgid "" -"until [[filename:]N|function] - execute until program reaches a different " -"line or line N within current frame." -msgstr "" +msgid "until [[filename:]N|function] - execute until program reaches a different line or line N within current frame." +msgstr "until [[Dateiname:]N|Funktion - Ausführen bis das Programm eine andere Zeile erreicht oder N Zeilen im aktuellen Rahmen." #: command.y:895 msgid "unwatch [N] - remove variable(s) from watch list." -msgstr "" +msgstr "unwatch [N} - Variablen von der Beobachtungsliste löschen" #: command.y:897 msgid "up [N] - move N frames up the stack." -msgstr "" +msgstr "up [N] - N Rahmen im Kellerspeicher nach oben gehen." #: command.y:899 msgid "watch var - set a watchpoint for a variable." -msgstr "" +msgstr "watch Var - einen Watchpoint für eine Variable setzen." #: command.y:1011 debug.c:401 msg.c:135 #, c-format @@ -1254,594 +1188,596 @@ msgid "error: " msgstr "Fehler: " #: command.y:1051 -#, fuzzy, c-format +#, c-format msgid "can't read command (%s)\n" -msgstr "Von »%s« kann nicht umgelenkt werden (%s)" +msgstr "der Befehl kann nicht gelesen werden (»%s«)\n" #: command.y:1065 -#, fuzzy, c-format +#, c-format msgid "can't read command (%s)" -msgstr "Von »%s« kann nicht umgelenkt werden (%s)" +msgstr "der Befehl kann nicht gelesen werden (»%s«)" #: command.y:1116 -#, fuzzy msgid "invalid character in command" -msgstr "Ungültiger Name für eine Zeichenklasse" +msgstr "Ungültiges Zeichen im Befehl" #: command.y:1152 #, c-format msgid "unknown command - \"%.*s\", try help" -msgstr "" +msgstr "unbekannter Befehl - »%.*s«, versuchen Sie es mit help" #: command.y:1222 #, c-format msgid "%s" -msgstr "" +msgstr "%s" #: command.y:1284 -#, fuzzy msgid "invalid character" msgstr "Ungültiges Zeichen" #: command.y:1455 #, c-format msgid "undefined command: %s\n" -msgstr "" +msgstr "undefinierter Befehl: %s\n" #: debug.c:252 msgid "set or show the number of lines to keep in history file." -msgstr "" +msgstr "die Anzahl von Zeilen setzen oder anzeigen, die in der Historydatei gespeichert werden sollen." #: debug.c:254 msgid "set or show the list command window size." -msgstr "" +msgstr "die Größe des Fensters für den Befehl list setzen oder anzeigen." #: debug.c:256 msgid "set or show gawk output file." -msgstr "" +msgstr "die gawk Ausgabedatei setzen oder anzeigen." #: debug.c:258 msgid "set or show debugger prompt." -msgstr "" +msgstr "das Debugger-Prompt setzen oder anzeigen." #: debug.c:260 msgid "(un)set or show saving of command history (value=on|off)." -msgstr "" +msgstr "(rück)setzen des Sicherns der Befehlshistorie (on oder off)." #: debug.c:262 msgid "(un)set or show saving of options (value=on|off)." -msgstr "" +msgstr "(rück)setzen des Sicherns von Optionen (on oder off)." #: debug.c:264 msgid "(un)set or show instruction tracing (value=on|off)." -msgstr "" +msgstr "(rück)setzen des Verfolgens von Instruktionen (on oder off)." #: debug.c:345 msgid "program not running." -msgstr "" +msgstr "Das Programm läuft nicht." #: debug.c:448 debug.c:606 -#, fuzzy, c-format +#, c-format msgid "can't read source file `%s' (%s)" msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)" #: debug.c:453 -#, fuzzy, c-format +#, c-format msgid "source file `%s' is empty.\n" -msgstr "Die Quelldatei »%s« ist leer" +msgstr "Die Quelldatei »%s« ist leer.\n" #: debug.c:480 msgid "no current source file." -msgstr "" +msgstr "keine aktuelle Quelldatei" #: debug.c:505 -#, fuzzy, c-format +#, c-format msgid "cannot find source file named `%s' (%s)" -msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)" +msgstr "Die Quelldatei »%s« kann nicht gefunden werden (%s)" #: debug.c:529 #, c-format msgid "WARNING: source file `%s' modified since program compilation.\n" -msgstr "" +msgstr "WARNUNG: Quelldatei »%s« wurde seit der Programmübersetzung verändert.\n" #: debug.c:551 #, c-format msgid "line number %d out of range; `%s' has %d lines" -msgstr "" +msgstr "die Zeilennummer %d ist außerhalb des gültigen Bereichs: »%s« hat %d Zeilen" #: debug.c:611 -#, fuzzy, c-format +#, c-format msgid "unexpected eof while reading file `%s', line %d" -msgstr "Unerwarteter Zeilenumbruch oder Ende der Zeichenkette" +msgstr "Unerwartetes Dateiende beim Lesen von Datei »%s<<, Zeile %d" #: debug.c:620 #, c-format msgid "source file `%s' modified since start of program execution" -msgstr "" +msgstr "Quelldatei »%s« wurde seit dem Start des Programmes verändert" #: debug.c:732 -#, fuzzy, c-format +#, c-format msgid "Current source file: %s\n" -msgstr "Quelldatei »%s« wurde bereits eingebunden" +msgstr "Derzeitige Quelldatei: %s\n" #: debug.c:733 #, c-format msgid "Number of lines: %d\n" -msgstr "" +msgstr "Anzahl von Zeilen: %d\n" #: debug.c:740 #, c-format msgid "Source file (lines): %s (%d)\n" -msgstr "" +msgstr "Quelldatei (Zeilen): %s (%d)\n" #: debug.c:754 msgid "" "Number Disp Enabled Location\n" "\n" msgstr "" +"Nummer Anz. Aktiv Ort\n" +"\n" #: debug.c:765 #, c-format msgid "\tno of hits = %ld\n" -msgstr "" +msgstr "\tAnzahl Treffer = %ld\n" #: debug.c:767 #, c-format msgid "\tignore next %ld hit(s)\n" -msgstr "" +msgstr "\tdie nächsten %ld Treffer\n" #: debug.c:769 debug.c:909 #, c-format msgid "\tstop condition: %s\n" -msgstr "" +msgstr "\tStopbedingung: %s\n" #: debug.c:771 debug.c:911 msgid "\tcommands:\n" -msgstr "" +msgstr "\tBefehle:\n" #: debug.c:793 #, c-format msgid "Current frame: " -msgstr "" +msgstr "Derzeitiger Stapelrahmen" #: debug.c:796 #, c-format msgid "Called by frame: " -msgstr "" +msgstr "Aufgerufen aus Rahmen: " #: debug.c:800 #, c-format msgid "Caller of frame: " -msgstr "" +msgstr "Aufrufer des Rahmens: " #: debug.c:818 #, c-format msgid "None in main().\n" -msgstr "" +msgstr "Keine in main().\n" #: debug.c:848 -#, fuzzy msgid "No arguments.\n" -msgstr "printf: Keine Argumente" +msgstr "Keine Argumente.\n" #: debug.c:849 msgid "No locals.\n" -msgstr "" +msgstr "Keine lokalen.\n" #: debug.c:857 msgid "" "All defined variables:\n" "\n" msgstr "" +"Alle definierten Variablen:\n" +"\n" #: debug.c:867 msgid "" "All defined functions:\n" "\n" msgstr "" +"Alle definierten Funktionen:\n" +"\n" #: debug.c:886 msgid "" "Auto-display variables:\n" "\n" msgstr "" +"Auto-display-Variablen:\n" +"\n" #: debug.c:889 msgid "" "Watch variables:\n" "\n" msgstr "" +"Yu überwachende Variablen:\n" +"\n" #: debug.c:1029 -#, fuzzy, c-format +#, c-format msgid "no symbol `%s' in current context\n" -msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden" +msgstr "im aktuellen Kontext gibt es kein Symbol mit Namen »%s«\n" #: debug.c:1041 debug.c:1427 -#, fuzzy, c-format +#, c-format msgid "`%s' is not an array\n" -msgstr "»%s« ist kein gültiger Variablenname" +msgstr "»%s« ist kein Feld\n" #: debug.c:1055 -#, fuzzy, c-format +#, c-format msgid "$%ld = uninitialized field\n" -msgstr "Referenz auf das nicht initialisierte Feld »$%d«" +msgstr "$%ld = nicht initialisiertes Feld\n" #: debug.c:1076 -#, fuzzy, c-format +#, c-format msgid "array `%s' is empty\n" -msgstr "Die Datei »%s« ist leer" +msgstr "Das Feld »%s« ist leer\n" #: debug.c:1119 debug.c:1171 -#, fuzzy, c-format +#, c-format msgid "[\"%s\"] not in array `%s'\n" -msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden" +msgstr "[\"%s\"] ist in Feld »%s« nicht vorhanden\n" #: debug.c:1175 #, c-format msgid "`%s[\"%s\"]' is not an array\n" -msgstr "" +msgstr "»%s[\"%s\"]« ist kein Feld\n" #: debug.c:1236 debug.c:4964 -#, fuzzy, c-format +#, c-format msgid "`%s' is not a scalar variable" -msgstr "»%s« ist kein gültiger Variablenname" +msgstr "»%s« ist keine skalare Variable" #: debug.c:1258 debug.c:4994 -#, fuzzy, c-format +#, c-format msgid "attempt to use array `%s[\"%s\"]' in a scalar context" -msgstr "" -"Es wird versucht, das Feld »%s[\"%.*s\"]« in einem Skalarkontext zu verwenden" +msgstr "Es wird versucht, das Feld »%s[\"%s\"]« in einem Skalarkontext zu verwenden" #: debug.c:1280 debug.c:5005 -#, fuzzy, c-format +#, c-format msgid "attempt to use scalar `%s[\"%s\"]' as array" -msgstr "Es wird versucht, den Skalar »%s[\"%.*s\"]« als Feld zu verwenden" +msgstr "Es wird versucht, den Skalar »%s[\"%s\"]« als Feld zu verwenden" #: debug.c:1423 -#, fuzzy, c-format +#, c-format msgid "`%s' is a function" -msgstr "»%s« ist ein unzulässiger Funktionsname" +msgstr "»%s« ist eine Funktion" #: debug.c:1465 #, c-format msgid "watchpoint %d is unconditional\n" -msgstr "" +msgstr "Watchpoint %d ist bedingungslos\n" #: debug.c:1499 #, c-format msgid "No display item numbered %ld" -msgstr "" +msgstr "Kein anzuzeigendes Element mit Nummer %ld" #: debug.c:1502 #, c-format msgid "No watch item numbered %ld" -msgstr "" +msgstr "Kein zu beobachtendes Element mit Nummer %ld" #: debug.c:1528 -#, fuzzy, c-format +#, c-format msgid "%d: [\"%s\"] not in array `%s'\n" -msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden" +msgstr "%d: [\"%s\"] ist in Feld »%s« nicht vorhanden\n" #: debug.c:1767 -#, fuzzy msgid "attempt to use scalar value as array" msgstr "Es wird versucht, einen Skalar als Feld zu verwenden" #: debug.c:1856 #, c-format msgid "Watchpoint %d deleted because parameter is out of scope.\n" -msgstr "" +msgstr "Watchpoint %d wurde gelöscht, weil der Parameter außerhalb des Gültigkeitsbereichs ist.\n" #: debug.c:1867 #, c-format msgid "Display %d deleted because parameter is out of scope.\n" -msgstr "" +msgstr "Anzuzeigendes Element %d wurde gelöscht, weil der Parameter außerhalb des Gültigkeitsbereichs ist.\n" #: debug.c:1900 #, c-format msgid " in file `%s', line %d\n" -msgstr "" +msgstr " in Datei »%s«, Zeile %d\n" #: debug.c:1921 #, c-format msgid " at `%s':%d" -msgstr "" +msgstr " bei »%s«:%d" #: debug.c:1937 debug.c:2000 #, c-format msgid "#%ld\tin " -msgstr "" +msgstr "#%ld\tin " #: debug.c:1974 #, c-format msgid "More stack frames follow ...\n" -msgstr "" +msgstr "Weitere Stapelrahmen folgen ...\n" #: debug.c:2017 -#, fuzzy msgid "invalid frame number" -msgstr "Ungültiges Bereichsende" +msgstr "Ungültige Rahmennummer" #: debug.c:2200 #, c-format msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d" -msgstr "" +msgstr "Hinweis: Breakpont %d (aktiv, ignoriert für die nächsten %ld Treffer) wird auch an %s:%d gesetzt" #: debug.c:2207 #, c-format msgid "Note: breakpoint %d (enabled), also set at %s:%d" -msgstr "" +msgstr "Hinweis: Breakpont %d (aktiv) wird auch an %s:%d gesetzt" #: debug.c:2214 #, c-format msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d" -msgstr "" +msgstr "Hinweis: Breakpont %d (inaktiv, ignoriert für die nächsten %ld Treffer) wird auch von %s:%d gesetzt" #: debug.c:2221 #, c-format msgid "Note: breakpoint %d (disabled), also set at %s:%d" -msgstr "" +msgstr "Hinweis: Breakpont %d (inaktiv) wird auch an %s:%d gesetzt" #: debug.c:2238 #, c-format msgid "Breakpoint %d set at file `%s', line %d\n" -msgstr "" +msgstr "Breakpont %d wird auf Datei %s, Zeile %d gesetzt\n" #: debug.c:2340 #, c-format msgid "Can't set breakpoint in file `%s'\n" -msgstr "" +msgstr "In Datei »%s« kann kein Breakpoint gesetzt werden\n" #: debug.c:2369 debug.c:2492 debug.c:3350 -#, fuzzy, c-format +#, c-format msgid "line number %d in file `%s' out of range" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "Zeile Nummer %d in Datei »%s« liegt außerhalb des gültigen Bereichs" #: debug.c:2373 #, c-format msgid "Can't find rule!!!\n" -msgstr "" +msgstr "Die Regel kann nicht gefunden werden!!!\n" #: debug.c:2375 #, c-format msgid "Can't set breakpoint at `%s':%d\n" -msgstr "" +msgstr "In »%s«:%d kann kein Breakpoint gesetzt werden\n" #: debug.c:2387 #, c-format msgid "Can't set breakpoint in function `%s'\n" -msgstr "" +msgstr "In Funktion »%s« kann kein Breakpoint gesetzt werden\n" #: debug.c:2403 #, c-format msgid "breakpoint %d set at file `%s', line %d is unconditional\n" -msgstr "" +msgstr "Breakpoint %d gestzt auf Datei »%s« Zeile %d ist bedingungslos\n" #: debug.c:2508 debug.c:2530 #, c-format msgid "Deleted breakpoint %d" -msgstr "" +msgstr "Breakpoint %d wurde gelöscht" #: debug.c:2514 #, c-format msgid "No breakpoint(s) at entry to function `%s'\n" -msgstr "" +msgstr "Am Beginn von Funktion »%s« gibt es keine Breakpoints\n" #: debug.c:2541 -#, fuzzy, c-format +#, c-format msgid "No breakpoint at file `%s', line #%d\n" -msgstr "Fehler beim Lesen der Eingabedatei »%s«: %s" +msgstr "Bei Datei »%s« Zeile %d gibt es keine Breakpoints\n" #: debug.c:2596 debug.c:2637 debug.c:2657 debug.c:2700 msgid "invalid breakpoint number" -msgstr "" +msgstr "Ungtige Breakpoint/Nummer" #: debug.c:2612 msgid "Delete all breakpoints? (y or n) " -msgstr "" +msgstr "Alle Breakpoints löschen? (j oder n) " #: debug.c:2613 debug.c:2923 debug.c:2976 msgid "y" -msgstr "" +msgstr "j" #: debug.c:2662 #, c-format msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n" -msgstr "" +msgstr "die nächsten %ld Überschreitungen von Breakpoint %d werden ignoriert.\n" #: debug.c:2666 #, c-format msgid "Will stop next time breakpoint %d is reached.\n" -msgstr "" +msgstr "wenn Breakpoint %d das nächste mal erreicht wird, wird angehalten\n" #: debug.c:2783 #, c-format msgid "Can only debug programs provided with the `-f' option.\n" -msgstr "" +msgstr "Es können nur Programme untersucht werden, die mittels der Option »-f« übergeben wurden.\n" #: debug.c:2908 #, c-format msgid "Failed to restart debugger" -msgstr "" +msgstr "Der Debugger konnte nicht neu gestartet werden" #: debug.c:2922 msgid "Program already running. Restart from beginning (y/n)? " -msgstr "" +msgstr "das Programm läfut bereits. Neu starten (j/n}? " #: debug.c:2926 #, c-format msgid "Program not restarted\n" -msgstr "" +msgstr "Das Programm wurde nicht neu gestartet\n" #: debug.c:2936 #, c-format msgid "error: cannot restart, operation not allowed\n" -msgstr "" +msgstr "Fehler: Neustart nicht möglich da die Operation verboten ist\n" #: debug.c:2942 #, c-format msgid "error (%s): cannot restart, ignoring rest of the commands\n" -msgstr "" +msgstr "Fehler (%s): Neustart nicht möglich, der Rest der Befehle wird ignoriert\n" #: debug.c:2950 #, c-format msgid "Starting program: \n" -msgstr "" +msgstr "Das Programm wird gestartet: \n" #: debug.c:2959 #, c-format msgid "Program exited %s with exit value: %d\n" -msgstr "" +msgstr "Das Programm verließ %s mit einem Rückgabewert: %d\n" #: debug.c:2975 msgid "The program is running. Exit anyway (y/n)? " -msgstr "" +msgstr "Das Prgramm läuft. Trotzdem beenden (j/n) " #: debug.c:3010 #, c-format msgid "Not stopped at any breakpoint; argument ignored.\n" -msgstr "" +msgstr "Es wird an keinem Breakpoint gestoppt; das Argument wird ignoriert.\n" #: debug.c:3015 #, c-format msgid "invalid breakpoint number %d." -msgstr "" +msgstr "ungültige Breakpointnummer %d." #: debug.c:3020 #, c-format msgid "Will ignore next %ld crossings of breakpoint %d.\n" -msgstr "" +msgstr "Die nächsten %ld Überschreitungen von Breakpoint %d werden ignoriert.\n" #: debug.c:3207 #, c-format msgid "'finish' not meaningful in the outermost frame main()\n" -msgstr "" +msgstr "»finish« hat in main() des äußersten Rahmens keine Bedeutung\n" #: debug.c:3212 #, c-format msgid "Run till return from " -msgstr "" +msgstr "Laufen bis zur Rückkehr von " #: debug.c:3255 #, c-format msgid "'return' not meaningful in the outermost frame main()\n" -msgstr "" +msgstr "»return« hat in main() des äußersten Rahmens keine Bedeutung\n" #: debug.c:3369 #, c-format msgid "Can't find specified location in function `%s'\n" -msgstr "" +msgstr "Die angegebene Position in Funktion »%s« kann nicht gefunden werden\n" #: debug.c:3377 -#, fuzzy, c-format +#, c-format msgid "invalid source line %d in file `%s'" -msgstr "Quelldatei »%s« wurde bereits eingebunden" +msgstr "ungültige Quellzeilennummer %d in Datei »%s«" #: debug.c:3392 #, c-format msgid "Can't find specified location %d in file `%s'\n" -msgstr "" +msgstr "Der Zielpunkt %d in Datei »%s« ist nicht auffindbar\n" #: debug.c:3424 -#, fuzzy, c-format +#, c-format msgid "element not in array\n" -msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden" +msgstr "Das Element ist kein Feld\n" #: debug.c:3424 #, c-format msgid "untyped variable\n" -msgstr "" +msgstr "untypisierte Variable\n" #: debug.c:3466 #, c-format msgid "Stopping in %s ...\n" -msgstr "" +msgstr "Stopp in %s ...\n" #: debug.c:3543 #, c-format msgid "'finish' not meaningful with non-local jump '%s'\n" -msgstr "" +msgstr "»finish« hat bei dem nichtlokalen Sprung »%s« keine Bedeutung\n" #: debug.c:3550 #, c-format msgid "'until' not meaningful with non-local jump '%s'\n" -msgstr "" +msgstr "»finish« hat bei dem nichtlokalen Sprung »%s« keine Bedeutung\n" #: debug.c:4185 msgid "\t------[Enter] to continue or q [Enter] to quit------" -msgstr "" +msgstr "\t-[Eingabe] um fort zu fahren oder b [Eingabe] für geenden -" #: debug.c:4186 msgid "q" -msgstr "" +msgstr "b" #: debug.c:5001 -#, fuzzy, c-format +#, c-format msgid "[\"%s\"] not in array `%s'" -msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden" +msgstr "[\"%s\"] ist in Feld »%s« nicht vorhanden" #: debug.c:5207 #, c-format msgid "sending output to stdout\n" -msgstr "" +msgstr "Ausgabe wird an die Standardausgabe geschickt\n" #: debug.c:5247 msgid "invalid number" -msgstr "" +msgstr "ungültige Zahl" #: debug.c:5381 -#, fuzzy, c-format +#, c-format msgid "`%s' not allowed in current context; statement ignored" -msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden" +msgstr "»%s« ist im aktuellen Kontext nicht zulässig; der Ausdruck wird ignoriert" #: debug.c:5389 -#, fuzzy msgid "`return' not allowed in current context; statement ignored" -msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden" +msgstr "»reeturn« ist im aktuellen Kontext nicht zulässig; der Ausdruck wird ignoriert" #: debug.c:5590 #, c-format msgid "No symbol `%s' in current context" -msgstr "" +msgstr "Im aktuelln Kontext gibt es kein Symbol »%s«" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:998 dfa.c:1001 dfa.c:1021 dfa.c:1031 dfa.c:1043 dfa.c:1094 dfa.c:1103 +#: dfa.c:1106 dfa.c:1111 dfa.c:1124 dfa.c:1191 msgid "unbalanced [" -msgstr "" +msgstr "nicht geschlossene [" -#: dfa.c:1174 -#, fuzzy +#: dfa.c:1052 msgid "invalid character class" -msgstr "Ungültiger Name für eine Zeichenklasse" +msgstr "ungültige Zeichenklasse" -#: dfa.c:1316 +#: dfa.c:1228 msgid "character class syntax is [[:space:]], not [:space:]" -msgstr "" +msgstr "Die Syntax für Zeichenklassen ist [[:space:]], nicht [:space:]" -#: dfa.c:1366 +#: dfa.c:1280 msgid "unfinished \\ escape" -msgstr "" +msgstr "nicht beendetes \\ Escape" -#: dfa.c:1513 regcomp.c:161 +#: dfa.c:1427 regcomp.c:161 msgid "Invalid content of \\{\\}" msgstr "Ungültiger Inhalt von \\{\\}" -#: dfa.c:1516 regcomp.c:176 +#: dfa.c:1430 regcomp.c:176 msgid "Regular expression too big" msgstr "Regulärer Ausdruck ist zu groß" -#: dfa.c:1936 +#: dfa.c:1847 msgid "unbalanced (" -msgstr "" +msgstr "nicht geschlossene (" -#: dfa.c:2062 +#: dfa.c:1973 msgid "no syntax specified" -msgstr "" +msgstr "keine Syntax angegeben" -#: dfa.c:2070 +#: dfa.c:1981 msgid "unbalanced )" -msgstr "" +msgstr "nicht geöffnete )" #: eval.c:394 #, c-format @@ -1947,38 +1883,32 @@ msgid "extensions are not allowed in sandbox mode" msgstr "Erweiterungen sind im Sandbox-Modus nicht erlaubt" #: ext.c:92 -#, fuzzy msgid "-l / @load are gawk extensions" -msgstr "»@include« ist eine gawk-Erweiterung" +msgstr "-l / @load sind gawk-Erweiterungen" #: ext.c:95 msgid "load_ext: received NULL lib_name" -msgstr "" +msgstr "load_ext: NULL lib_name erhalten" #: ext.c:98 -#, fuzzy, c-format +#, c-format msgid "load_ext: cannot open library `%s' (%s)\n" -msgstr "Fatal: extension: »%s« kann nicht geöffnet werden (%s)\n" +msgstr "load_ext: Bibliothek »%s« kann nicht geöffnet werden (%s)\n" #: ext.c:104 -#, fuzzy, c-format -msgid "" -"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" -msgstr "" -"Fatal: Erweiterung: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« " -"nicht (%s)\n" +#, c-format +msgid "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" +msgstr "load_ext: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« nicht (%s)\n" #: ext.c:110 -#, fuzzy, c-format +#, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" -msgstr "" -"Fatal: Erweiterung: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen " -"werden (%s)\n" +msgstr "load_ext: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen werden (%s)\n" #: ext.c:114 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" -msgstr "" +msgstr "load_ext: die Initialisierungsroutine %2$s von Bibliothek »%1$s« ist gescheitert\n" #: ext.c:174 msgid "`extension' is a gawk extension" @@ -1986,54 +1916,46 @@ msgstr "»extension« ist eine gawk-Erweiterung" #: ext.c:177 msgid "extension: received NULL lib_name" -msgstr "" +msgstr "extension: NULL lib_name erhalten" #: ext.c:180 -#, fuzzy, c-format +#, c-format msgid "extension: cannot open library `%s' (%s)" -msgstr "Fatal: extension: »%s« kann nicht geöffnet werden (%s)\n" +msgstr "extension: Bibliothek »%s« kann nicht geöffnet werden (%s)" #: ext.c:186 -#, fuzzy, c-format -msgid "" -"extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" -msgstr "" -"Fatal: Erweiterung: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« " -"nicht (%s)\n" +#, c-format +msgid "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" +msgstr "extension: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« nicht (%s)" #: ext.c:190 -#, fuzzy, c-format +#, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" -msgstr "" -"Fatal: Erweiterung: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen " -"werden (%s)\n" +msgstr "extension: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen werden (%s)" #: ext.c:221 -#, fuzzy msgid "make_builtin: missing function name" -msgstr "Erweiterung: Funktionsname fehlt" +msgstr "make_builtin: Funktionsname fehlt" #: ext.c:236 -#, fuzzy, c-format +#, c-format msgid "make_builtin: can't redefine function `%s'" -msgstr "Erweiterung: Funktion »%s« kann nicht neu definiert werden" +msgstr "make_builtin: Funktion »%s« kann nicht neu definiert werden" #: ext.c:240 -#, fuzzy, c-format +#, c-format msgid "make_builtin: function `%s' already defined" -msgstr "Erweiterung: Funktion »%s« wurde bereits definiert" +msgstr "make_builtin: Funktion »%s« wurde bereits definiert" #: ext.c:244 -#, fuzzy, c-format +#, c-format msgid "make_builtin: function name `%s' previously defined" -msgstr "Erweiterung: Funktion »%s« wurde bereits vorher definiert" +msgstr "make_builtin: Funktion »%s« wurde bereits vorher definiert" #: ext.c:246 -#, fuzzy, c-format +#, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" -msgstr "" -"Erweiterung: die eingebaute Funktion »%s« kann nicht als Funktionsname " -"verwendet werden" +msgstr "make_builtin: die in gawk eingebaute Funktion »%s« kann nicht als Funktionsname verwendet werden" #: ext.c:249 ext.c:304 #, c-format @@ -2041,43 +1963,38 @@ msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negative Anzahl von Argumenten für Funktion »%s«" #: ext.c:276 -#, fuzzy msgid "extension: missing function name" msgstr "Erweiterung: Funktionsname fehlt" #: ext.c:279 ext.c:283 -#, fuzzy, c-format +#, c-format msgid "extension: illegal character `%c' in function name `%s'" -msgstr "Erweiterung: unzulässiges Zeichen »%c« in Funktionsname »%s«" +msgstr "extension: unzulässiges Zeichen »%c« in Funktionsname »%s«" #: ext.c:291 -#, fuzzy, c-format +#, c-format msgid "extension: can't redefine function `%s'" -msgstr "Erweiterung: Funktion »%s« kann nicht neu definiert werden" +msgstr "extension: Funktion »%s« kann nicht neu definiert werden" #: ext.c:295 -#, fuzzy, c-format +#, c-format msgid "extension: function `%s' already defined" -msgstr "Erweiterung: Funktion »%s« wurde bereits definiert" +msgstr "extension: Funktion »%s« wurde bereits definiert" #: ext.c:299 -#, fuzzy, c-format +#, c-format msgid "extension: function name `%s' previously defined" -msgstr "Funktion »%s« wurde bereits definiert" +msgstr "extension: Funktion »%s« wurde bereits vorher definiert" #: ext.c:301 -#, fuzzy, c-format +#, c-format msgid "extension: can't use gawk built-in `%s' as function name" -msgstr "" -"Erweiterung: die eingebaute Funktion »%s« kann nicht als Funktionsname " -"verwendet werden" +msgstr "extension: die eingebaute Funktion »%s« kann nicht als Funktionsname verwendet werden" #: ext.c:375 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" -msgstr "" -"Funktion »%s« wird als Funktion definiert, die nie mehr als %d Argument(e) " -"akzeptiert" +msgstr "Funktion »%s« wird als Funktion definiert, die nie mehr als %d Argument(e) akzeptiert" #: ext.c:378 #, c-format @@ -2087,384 +2004,347 @@ msgstr "Funktion »%s«: fehlendes Argument #%d" #: ext.c:395 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" -msgstr "" -"Funktion »%s«: Argument #%d: Es wird versucht, einen Skalar als Feld zu " -"verwenden" +msgstr "Funktion »%s«: Argument #%d: Es wird versucht, einen Skalar als Feld zu verwenden" #: ext.c:399 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" -msgstr "" -"Funktion »%s«: Argument #%d: Es wird versucht, ein Feld als Skalar zu " -"verwenden" +msgstr "Funktion »%s«: Argument #%d: Es wird versucht, ein Feld als Skalar zu verwenden" #: ext.c:413 msgid "dynamic loading of library not supported" -msgstr "" +msgstr "das dynamische Laden von Bibliotheken wird nicht unterstützt" #: extension/filefuncs.c:159 -#, fuzzy msgid "chdir: called with incorrect number of arguments, expecting 1" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "chdir: Aufgruf mit einer ungültigen Anzahl von Argumenten, 1 wird erwartet" #: extension/filefuncs.c:439 #, c-format msgid "stat: unable to read symbolic link `%s'" -msgstr "" +msgstr "stst: die symbolische Verknüpfung »%s« kann nicht gelesenb werden" #: extension/filefuncs.c:472 -#, fuzzy msgid "stat: called with wrong number of arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "stat: Aufruf mit falscher Anzahl Argumenten" #: extension/filefuncs.c:479 -#, fuzzy msgid "stat: bad parameters" -msgstr "%s: ist ein Parameter\n" +msgstr "stat: ungültige Parameter" #: extension/filefuncs.c:533 -#, fuzzy, c-format +#, c-format msgid "fts init: could not create variable %s" -msgstr "index: Zweites Argument ist kein string" +msgstr "fts_init: Variable %s konnte nicht angelegt werden" #: extension/filefuncs.c:554 -#, fuzzy msgid "fts is not supported on this system" -msgstr "»%s« wird im alten awk nicht unterstützt" +msgstr "fts wird auf diesem System nicht unterstützt" #: extension/filefuncs.c:573 msgid "fill_stat_element: could not create array" -msgstr "" +msgstr "fill_stat_element: das Feld konnte nicht angelegt werden" #: extension/filefuncs.c:582 msgid "fill_stat_element: could not set element" -msgstr "" +msgstr "fill_stat_element: das Element konnte nicht gesetzt werden" #: extension/filefuncs.c:597 -#, fuzzy msgid "fill_path_element: could not set element" -msgstr "index: Zweites Argument ist kein string" +msgstr "fill_path_element: das Element konnte nicht gesetzt werden" #: extension/filefuncs.c:613 msgid "fill_error_element: could not set element" -msgstr "" +msgstr "fill_error_element: das Element konnte nicht gesetzt werden" #: extension/filefuncs.c:660 extension/filefuncs.c:707 msgid "fts-process: could not create array" -msgstr "" +msgstr "fts-process: das Feld konnte nicht anglegt werden" #: extension/filefuncs.c:670 extension/filefuncs.c:717 #: extension/filefuncs.c:735 -#, fuzzy msgid "fts-process: could not set element" -msgstr "index: Zweites Argument ist kein string" +msgstr "fts-process: das Element konnte nicht gesetzt werden" #: extension/filefuncs.c:784 -#, fuzzy msgid "fts: called with incorrect number of arguments, expecting 3" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "fts: Aufruf mit falscher Anzahl an Argumenten, es werden 3 erwartet" #: extension/filefuncs.c:787 -#, fuzzy msgid "fts: bad first parameter" -msgstr "%s: ist ein Parameter\n" +msgstr "fts: ungültiger Parameter" #: extension/filefuncs.c:793 -#, fuzzy msgid "fts: bad second parameter" -msgstr "%s: ist ein Parameter\n" +msgstr "fts: ungültiger zweiter Parameter" #: extension/filefuncs.c:799 -#, fuzzy msgid "fts: bad third parameter" -msgstr "%s: ist ein Parameter\n" +msgstr "%s: ist ein Parameter" #: extension/filefuncs.c:806 -#, fuzzy msgid "fts: could not flatten array\n" -msgstr "»%s« ist kein gültiger Variablenname" +msgstr "fts: ungültiger dritter Parameter\n" #: extension/filefuncs.c:824 msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah." -msgstr "" +msgstr "fts: die heimtückische Kennung FTS_NOSTAT wird ignoriert, ätsch bätsch." #: extension/filefuncs.c:841 msgid "fts: clear_array() failed\n" -msgstr "" +msgstr "fts: clear_array() ist gescheitert\n" #: extension/fnmatch.c:112 -#, fuzzy msgid "fnmatch: called with less than three arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "fnmatch: Aufruf mit weniger als drei Argumenten" #: extension/fnmatch.c:115 -#, fuzzy msgid "fnmatch: called with more than three arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "fnmatch: Aufruf mit mehr als drei Argumenten" #: extension/fnmatch.c:118 -#, fuzzy msgid "fnmatch: could not get first argument" -msgstr "strftime: Das erste Argument ist kein String" +msgstr "fnmatch: Das erste Argument konnte nicht gelesen werden" #: extension/fnmatch.c:123 -#, fuzzy msgid "fnmatch: could not get second argument" -msgstr "index: Zweites Argument ist kein string" +msgstr "fnmatch: Das zweite Argument konnte nicht gelesen werden" #: extension/fnmatch.c:128 msgid "fnmatch: could not get third argument" -msgstr "" +msgstr "fnmatch: Das dritte Argument konnte nicht gelesen werden" #: extension/fnmatch.c:141 msgid "fnmatch is not implemented on this system\n" -msgstr "" +msgstr "fnmatch ist auf diesem System nicht implementiert\n" #: extension/fnmatch.c:173 msgid "fnmatch init: could not add FNM_NOMATCH variable" -msgstr "" +msgstr "fnmatch_init: eine FNM_NOMATCH-Variable konnte nicht hinzu gefügt werden" #: extension/fnmatch.c:183 #, c-format msgid "fnmatch init: could not set array element %s" -msgstr "" +msgstr "fnmatch_init: das Feldelement %s konnte nicht initialisiert werden" #: extension/fnmatch.c:193 msgid "fnmatch init: could not install FNM array" -msgstr "" +msgstr "fnmatch_init: das FNM-Feld konnte nicht gesetzt werden." #: extension/fork.c:81 -#, fuzzy msgid "fork: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "fork: Aufruf mit zu vielen Argumenten" #: extension/fork.c:94 msgid "fork: PROCINFO is not an array!" -msgstr "" +msgstr "fork: PROCINFO ist kein Feld!" #: extension/fork.c:118 -#, fuzzy msgid "waitpid: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "waitpid: Aufruf mit zu vielen Argumenten" #: extension/fork.c:126 -#, fuzzy msgid "wait: called with no arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "wait: Aufruf ohne Argumente" #: extension/fork.c:143 -#, fuzzy msgid "wait: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "wait: Aufruf mit zu vielen Argumenten" #: extension/inplace.c:130 msgid "inplace_begin: in-place editing already active" -msgstr "" +msgstr "inplace_begin: direktes Editieren ist bereits aktiv" #: extension/inplace.c:133 extension/inplace.c:207 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" -msgstr "" +msgstr "inplace_begin: erwartet 2 Argumente aber wurde aufgerufen mit %d" #: extension/inplace.c:136 msgid "inplace_begin: cannot retrieve 1st argument as a string filename" -msgstr "" +msgstr "inplace_begin: das erste Argument ist kein Dateiname" #: extension/inplace.c:144 #, c-format msgid "inplace_begin: disabling in-place editing for invalid FILENAME `%s'" -msgstr "" +msgstr "inplace_begin: direktes Editieren wird deaktiviert wegen des ungültigen Dateinamens »%s«" #: extension/inplace.c:151 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: Cannot stat `%s' (%s)" -msgstr "Fatal: extension: »%s« kann nicht geöffnet werden (%s)\n" +msgstr "inplace_begin: Status von »%s« kann nicht ermittelt werden (%s)" #: extension/inplace.c:158 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: `%s' is not a regular file" -msgstr "»%s« ist kein gültiger Variablenname" +msgstr "inplace_begin: »%s« ist keine reguläre Datei" #: extension/inplace.c:169 #, c-format msgid "inplace_begin: mkstemp(`%s') failed (%s)" -msgstr "" +msgstr "inplace_begin: mkstemp(»%s«) ist gescheitert (%s)" #: extension/inplace.c:178 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: chmod failed (%s)" -msgstr "%s: close ist gescheitert (%s)" +msgstr "inplace_begin:: chmod ist gescheitert (%s)" #: extension/inplace.c:185 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" -msgstr "" +msgstr "inplace_begin: dup(stdout) ist gescheitert (%s)" #: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" -msgstr "" +msgstr "inplace_begin: dup2(%d, stdout) ist gescheitert (%s)" #: extension/inplace.c:191 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: close(%d) failed (%s)" -msgstr "%s: close ist gescheitert (%s)" +msgstr "inplace_begin: close(%d) ist gescheitert (%s)" #: extension/inplace.c:210 msgid "inplace_end: cannot retrieve 1st argument as a string filename" -msgstr "" +msgstr "inplace_end: das erste Argument ist kein Dateiname" #: extension/inplace.c:217 msgid "inplace_end: in-place editing not active" -msgstr "" +msgstr "inplace_end: direktes Editieren ist nicht aktiv" #: extension/inplace.c:223 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" -msgstr "" +msgstr "inplace_end: dup2(%d, stdout) ist gescheitert (%s)" #: extension/inplace.c:226 -#, fuzzy, c-format +#, c-format msgid "inplace_end: close(%d) failed (%s)" -msgstr "%s: close ist gescheitert (%s)" +msgstr "inplace_end: close(%d) ist gescheitert (%s)" #: extension/inplace.c:230 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" -msgstr "" +msgstr "inplace_end: fsetpos(stdout) ist gescheitert (%s)" #: extension/inplace.c:243 -#, fuzzy, c-format +#, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" -msgstr "Das Leeren der Pipe »%s« ist gescheitert (%s)" +msgstr "inplace_end: link(»%s«, »%s«) ist gescheitert (%s)" #: extension/inplace.c:253 -#, fuzzy, c-format +#, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" -msgstr "Das Schließen des Dateideskriptors %d (»%s«) ist gescheitert (%s)" +msgstr "inplace_end: rename(»%s«, »%s«) ist gescheitert (%s)" #: extension/ordchr.c:69 -#, fuzzy msgid "ord: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "ord: Aufruf mit yu vielen Argumenten" #: extension/ordchr.c:75 -#, fuzzy msgid "ord: called with no arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "ord: Aufruf ohne Argumente" #: extension/ordchr.c:77 -#, fuzzy msgid "ord: called with inappropriate argument(s)" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "ord: Aufruf mit ungeeigneten Argumenten" #: extension/ordchr.c:99 -#, fuzzy msgid "chr: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "chr: Aufruf mit zu vielen Argumenten" #: extension/ordchr.c:109 -#, fuzzy msgid "chr: called with no arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "chr: Aufruf ohne Argumente" #: extension/ordchr.c:111 -#, fuzzy msgid "chr: called with inappropriate argument(s)" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "chr: Aufruf mit ungeeigneten Argumenten" -#: extension/readdir.c:281 +#: extension/readdir.c:277 #, c-format msgid "dir_take_control_of: opendir/fdopendir failed: %s" -msgstr "" +msgstr "dir_take_control_of: opendir/fdopendir ist gescheitert: %s" -#: extension/readfile.c:113 -#, fuzzy +#: extension/readfile.c:84 msgid "readfile: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "readfile: Aufruf mit zu vielen Argumenten" -#: extension/readfile.c:137 -#, fuzzy +#: extension/readfile.c:118 msgid "readfile: called with no arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "readfile: Aufruf ohen Argumente" #: extension/rwarray.c:124 -#, fuzzy msgid "writea: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "writea: Aufruf mit zu vielen Argumenten" #: extension/rwarray.c:131 -#, fuzzy, c-format +#, c-format msgid "do_writea: argument 0 is not a string\n" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "do_writea: das Argument 0 ist keine Zeichenkette\n" #: extension/rwarray.c:137 -#, fuzzy, c-format +#, c-format msgid "do_writea: argument 1 is not an array\n" -msgstr "split: das vierte Argument ist kein Feld" +msgstr "do_writea: das Argument 1 ist kein Feld\n" #: extension/rwarray.c:184 #, c-format msgid "write_array: could not flatten array\n" -msgstr "" +msgstr "write_array: das Feld konnte nicht niveliert werden\n" #: extension/rwarray.c:198 #, c-format msgid "write_array: could not release flattened array\n" -msgstr "" +msgstr "write_array: das nivelierte Feld konnte nicht frei gegeben werden\n" #: extension/rwarray.c:280 -#, fuzzy msgid "reada: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "reada: Aufruf mit zu vielen Argumenten" #: extension/rwarray.c:287 -#, fuzzy, c-format +#, c-format msgid "do_reada: argument 0 is not a string\n" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "do_reada: Argument 0 ist keine Zeichenkette\n" #: extension/rwarray.c:293 -#, fuzzy, c-format +#, c-format msgid "do_reada: argument 1 is not an array\n" -msgstr "match: das dritte Argument ist kein Array" +msgstr "do_reada: Argument 1 ist kein Feld\n" #: extension/rwarray.c:337 #, c-format msgid "do_reada: clear_array failed\n" -msgstr "" +msgstr "do_reada: clear_array ist gescheitert\n" #: extension/rwarray.c:374 #, c-format msgid "read_array: set_array_element failed\n" -msgstr "" +msgstr "read_array: set_array_element ist gescheitert\n" -#: extension/time.c:113 -#, fuzzy +#: extension/time.c:106 msgid "gettimeofday: ignoring arguments" -msgstr "mktime: Das Argument ist kein String" +msgstr "gettimeofday: die Argumente werden ignoriert" -#: extension/time.c:144 +#: extension/time.c:137 msgid "gettimeofday: not supported on this platform" -msgstr "" +msgstr "gettimeofday: wird auf dieser Plattform nicht unterstützt" -#: extension/time.c:165 -#, fuzzy +#: extension/time.c:158 msgid "sleep: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "sleep: Aufruf mit zu vielen Argumenten" -#: extension/time.c:168 -#, fuzzy +#: extension/time.c:161 msgid "sleep: missing required numeric argument" -msgstr "exp: das Argument ist keine Zahl" +msgstr "sleep: das erforderliche numerische Argument fehlt" -#: extension/time.c:174 -#, fuzzy +#: extension/time.c:167 msgid "sleep: argument is negative" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "sleep: das Argument ist negativ" -#: extension/time.c:208 +#: extension/time.c:201 msgid "sleep: not supported on this platform" -msgstr "" +msgstr "sleep: wird auf dieser Plattform nicht unterstützt" #: field.c:345 msgid "NF set to negative value" @@ -2484,21 +2364,15 @@ msgstr "split: das zweite Argument ist kein Feld" #: field.c:993 msgid "split: cannot use the same array for second and fourth args" -msgstr "" -"split: als zweites und viertes Argument kann nicht das gleiche Feld " -"verwendet werden" +msgstr "split: als zweites und viertes Argument kann nicht das gleiche Feld verwendet werden" #: field.c:998 msgid "split: cannot use a subarray of second arg for fourth arg" -msgstr "" -"split: Ein untergeordnetes Feld des zweiten Arguments kann nicht als viertes " -"Argument verwendet werden" +msgstr "split: Ein untergeordnetes Feld des zweiten Arguments kann nicht als viertes Argument verwendet werden" #: field.c:1001 msgid "split: cannot use a subarray of fourth arg for second arg" -msgstr "" -"split: Ein untergeordnetes Feld des vierten Arguments kann nicht als zweites " -"Argument verwendet werden" +msgstr "split: Ein untergeordnetes Feld des vierten Arguments kann nicht als zweites Argument verwendet werden" #: field.c:1032 msgid "split: null string for third arg is a gawk extension" @@ -2518,21 +2392,15 @@ msgstr "patsplit: Das dritte Argument darf nicht Null sein" #: field.c:1087 msgid "patsplit: cannot use the same array for second and fourth args" -msgstr "" -"patsplit: als zweites und viertes Argument kann nicht das gleiche Feld " -"verwendet werden" +msgstr "patsplit: als zweites und viertes Argument kann nicht das gleiche Feld verwendet werden" #: field.c:1092 msgid "patsplit: cannot use a subarray of second arg for fourth arg" -msgstr "" -"patsplit: Ein untergeordnetes Feld des zweiten Arguments kann nicht als " -"viertes Argument verwendet werden" +msgstr "patsplit: Ein untergeordnetes Feld des zweiten Arguments kann nicht als viertes Argument verwendet werden" #: field.c:1095 msgid "patsplit: cannot use a subarray of fourth arg for second arg" -msgstr "" -"patsplit: Ein untergeordnetes Feld des vierten Arguments kann nicht als " -"zweites Argument verwendet werden" +msgstr "patsplit: Ein untergeordnetes Feld des vierten Arguments kann nicht als zweites Argument verwendet werden" #: field.c:1133 msgid "`FIELDWIDTHS' is a gawk extension" @@ -2557,39 +2425,38 @@ msgstr "»FPAT« ist eine gawk-Erweiterung" #: gawkapi.c:146 msgid "awk_value_to_node: received null retval" -msgstr "" +msgstr "awk_value_to_node: Rückgabewert Null erhalten" #: gawkapi.c:384 msgid "node_to_awk_value: received null node" -msgstr "" +msgstr "node_to_awk_value: Null-Knoten erhalten" #: gawkapi.c:387 msgid "node_to_awk_value: received null val" -msgstr "" +msgstr "node_to_awk_value: Null-Wert erhalten" -#: gawkapi.c:807 -#, fuzzy +#: gawkapi.c:808 msgid "remove_element: received null array" -msgstr "length: Argument ist ein Feld" +msgstr "remove_element: Null-Feld erhalten" -#: gawkapi.c:810 +#: gawkapi.c:811 msgid "remove_element: received null subscript" -msgstr "" +msgstr "remove_element: Null-Index erhalten" -#: gawkapi.c:947 +#: gawkapi.c:948 #, c-format msgid "api_flatten_array: could not convert index %d\n" -msgstr "" +msgstr "api_flatten_array: Index %d konnte nicht umgewandelt werden\n" -#: gawkapi.c:952 +#: gawkapi.c:953 #, c-format msgid "api_flatten_array: could not convert value %d\n" -msgstr "" +msgstr "api_flatten_array: Wert %d konnte nicht umgewandelt werden\n" #: getopt.c:604 getopt.c:633 -#, fuzzy, c-format +#, c-format msgid "%s: option '%s' is ambiguous; possibilities:" -msgstr "%s: Option »%s« ist mehrdeutig\n" +msgstr "%s: Option »%s« ist mehrdeutig; Mögliche Bedautung:" #: getopt.c:679 getopt.c:683 #, c-format @@ -2644,8 +2511,7 @@ msgstr "%s: Die Option »-W %s« erfordert ein Argument\n" #: io.c:392 #, c-format msgid "command line argument `%s' is a directory: skipped" -msgstr "" -"das Kommandozeilen-Argument »%s« ist ein Verzeichnis: wird übersprungen" +msgstr "das Kommandozeilen-Argument »%s« ist ein Verzeichnis: wird übersprungen" #: io.c:395 io.c:513 #, c-format @@ -2664,8 +2530,7 @@ msgstr "Umlenkungen sind im Sandbox-Modus nicht erlaubt" #: io.c:750 #, c-format msgid "expression in `%s' redirection only has numeric value" -msgstr "" -"Der Ausdruck in einer Umlenkung mittels »%s« hat nur einen numerischen Wert" +msgstr "Der Ausdruck in einer Umlenkung mittels »%s« hat nur einen numerischen Wert" #: io.c:756 #, c-format @@ -2675,9 +2540,7 @@ msgstr "Der Ausdruck für eine Umlenkung mittels »%s« ist ein leerer String" #: io.c:761 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" -msgstr "" -"Der Dateiname »%s« für eine Umlenkung mittels »%s« kann das Ergebnis eines " -"logischen Ausdrucks sein" +msgstr "Der Dateiname »%s« für eine Umlenkung mittels »%s« kann das Ergebnis eines logischen Ausdrucks sein" #: io.c:809 #, c-format @@ -2697,9 +2560,7 @@ msgstr "Die Pipe »%s« kann nicht für die Eingabe geöffnet werden (%s)" #: io.c:904 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" -msgstr "" -"Die bidirektionale Pipe »%s« kann nicht für die Ein-/Ausgabe geöffnet werden " -"(%s)" +msgstr "Die bidirektionale Pipe »%s« kann nicht für die Ein-/Ausgabe geöffnet werden (%s)" #: io.c:986 #, c-format @@ -2712,11 +2573,8 @@ msgid "can't redirect to `%s' (%s)" msgstr "Zu »%s« kann nicht umgelenkt werden (%s)" #: io.c:1040 -msgid "" -"reached system limit for open files: starting to multiplex file descriptors" -msgstr "" -"Die Systemgrenze offener Dateien ist erreicht, daher werden nun " -"Dateideskriptoren mehrfach verwendet" +msgid "reached system limit for open files: starting to multiplex file descriptors" +msgstr "Die Systemgrenze offener Dateien ist erreicht, daher werden nun Dateideskriptoren mehrfach verwendet" #: io.c:1056 #, c-format @@ -2743,9 +2601,7 @@ msgstr "»close« für eine Umlenkung, die nie geöffnet wurde" #: io.c:1205 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" -msgstr "" -"close: Umlenkung »%s« wurde nicht mit »[&« geöffnet, das zweite Argument " -"wird ignoriert" +msgstr "close: Umlenkung »%s« wurde nicht mit »[&« geöffnet, das zweite Argument wird ignoriert" #: io.c:1222 #, c-format @@ -2842,8 +2698,7 @@ msgstr "»%s« konnte nicht geöffnet werden, Modus »%s«" #: io.c:1917 #, c-format msgid "close of master pty failed (%s)" -msgstr "" -"Das Schließen der übergeordneten Terminal-Gerätedatei ist gescheitert (%s)" +msgstr "Das Schließen der übergeordneten Terminal-Gerätedatei ist gescheitert (%s)" #: io.c:1919 io.c:2105 io.c:2305 #, c-format @@ -2853,9 +2708,7 @@ msgstr "Das Schließen der Standardausgabe im Kindprozess ist gescheitert (%s)" #: io.c:1922 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" -msgstr "" -"Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardausgabe " -"im Kindprozess ist gescheitert (dup: %s)" +msgstr "Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardausgabe im Kindprozess ist gescheitert (dup: %s)" #: io.c:1924 io.c:2110 #, c-format @@ -2865,39 +2718,30 @@ msgstr "Schließen von stdin im Kindprozess gescheitert (%s)" #: io.c:1927 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" -msgstr "" -"Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardeingabe " -"im Kindprozess ist gescheitert (dup: %s)" +msgstr "Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardeingabe im Kindprozess ist gescheitert (dup: %s)" #: io.c:1929 io.c:1951 #, c-format msgid "close of slave pty failed (%s)" -msgstr "" -"Das Schließen der untergeordneten Terminal-Gerätedatei ist gescheitert (%s)" +msgstr "Das Schließen der untergeordneten Terminal-Gerätedatei ist gescheitert (%s)" #: io.c:2040 io.c:2108 io.c:2276 io.c:2308 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" -msgstr "" -"Das Verschieben der Pipe zur Standardausgabe im Kindprozess ist gescheitert " -"(dup: %s)" +msgstr "Das Verschieben der Pipe zur Standardausgabe im Kindprozess ist gescheitert (dup: %s)" #: io.c:2047 io.c:2113 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" -msgstr "" -"Das Verschieben der Pipe zur Standardeingabe im Kindprozess ist gescheitert " -"(dup: %s)" +msgstr "Das Verschieben der Pipe zur Standardeingabe im Kindprozess ist gescheitert (dup: %s)" #: io.c:2073 io.c:2298 msgid "restoring stdout in parent process failed\n" -msgstr "" -"Das Wiederherstellen der Standardausgabe im Elternprozess ist gescheitert\n" +msgstr "Das Wiederherstellen der Standardausgabe im Elternprozess ist gescheitert\n" #: io.c:2081 msgid "restoring stdin in parent process failed\n" -msgstr "" -"Das Wiederherstellen der Standardeingabe im Elternprozess ist gescheitert\n" +msgstr "Das Wiederherstellen der Standardeingabe im Elternprozess ist gescheitert\n" #: io.c:2116 io.c:2310 io.c:2324 #, c-format @@ -2920,48 +2764,45 @@ msgstr "Kindprozess für »%s« kann nicht erzeugt werden (fork: %s)" #: io.c:2790 msgid "register_input_parser: received NULL pointer" -msgstr "" +msgstr "register_input_parser: NULL-Zeiger erhalten" #: io.c:2818 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" -msgstr "" +msgstr "Eingabeparser »%s« steht im Konflikt mit dem vorher installierten Eingabeparser »%s«" #: io.c:2825 #, c-format msgid "input parser `%s' failed to open `%s'" -msgstr "" +msgstr "Eingabeparser »%s« konnte »%s« nicht öffnen" #: io.c:2845 msgid "register_output_wrapper: received NULL pointer" -msgstr "" +msgstr "register_output_wrapper: NULL-Zeiger erhalten" #: io.c:2873 #, c-format -msgid "" -"output wrapper `%s' conflicts with previously installed output wrapper `%s'" -msgstr "" +msgid "output wrapper `%s' conflicts with previously installed output wrapper `%s'" +msgstr "Ausgabeverpackung »%s« steht im Konflikt mit Ausgabeverpackung »%s«" #: io.c:2880 #, c-format msgid "output wrapper `%s' failed to open `%s'" -msgstr "" +msgstr "Ausgabeverpackung »%s« konnte »%s« nicht öffnen" #: io.c:2901 msgid "register_output_processor: received NULL pointer" -msgstr "" +msgstr "register_output_processor: NULL-Zeiger erhalten" #: io.c:2930 #, c-format -msgid "" -"two-way processor `%s' conflicts with previously installed two-way processor " -"`%s'" -msgstr "" +msgid "two-way processor `%s' conflicts with previously installed two-way processor `%s'" +msgstr "Zweiwegeprozessor »%s« steht im Konflikt mit Zweiwegeprozessor »%s«" #: io.c:2939 #, c-format msgid "two way processor `%s' failed to open `%s'" -msgstr "" +msgstr "Zweiwegeprozessor »%s« konnte »%s« nicht öffnen" #: io.c:3064 #, c-format @@ -2996,9 +2837,7 @@ msgstr "%s: Die Option %c erfordert ein Argument\n" #: main.c:562 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" -msgstr "" -"Die Umgebungsvariable »POSIXLY_CORRECT« ist gesetzt: »--posix« wird " -"eingeschaltet" +msgstr "Die Umgebungsvariable »POSIXLY_CORRECT« ist gesetzt: »--posix« wird eingeschaltet" #: main.c:568 msgid "`--posix' overrides `--traditional'" @@ -3014,28 +2853,23 @@ msgid "running %s setuid root may be a security problem" msgstr "%s als setuid root auszuführen kann zu Sicherheitsproblemen führen" #: main.c:588 -#, fuzzy msgid "`--posix' overrides `--characters-as-bytes'" -msgstr "»--posix« hat Vorrang vor »--binary«" +msgstr "»--posix« hat Vorrang vor »--characters-as-bytes«" #: main.c:647 #, c-format msgid "can't set binary mode on stdin (%s)" -msgstr "" -"Das Setzen des Binärermodus für die Standardeingabe ist nicht möglich (%s)" +msgstr "Das Setzen des Binärermodus für die Standardeingabe ist nicht möglich (%s)" #: main.c:650 #, c-format msgid "can't set binary mode on stdout (%s)" -msgstr "" -"Das Setzen des Binärermodus für die Standardausgabe ist nicht möglich (%s)" +msgstr "Das Setzen des Binärermodus für die Standardausgabe ist nicht möglich (%s)" #: main.c:652 #, c-format msgid "can't set binary mode on stderr (%s)" -msgstr "" -"Das Setzen des Binärermodus für die Standardfehlerausgabe ist nicht möglich " -"(%s)" +msgstr "Das Setzen des Binärermodus für die Standardfehlerausgabe ist nicht möglich (%s)" #: main.c:710 msgid "no program text at all!" @@ -3088,9 +2922,8 @@ msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d [Datei]\t\t--dump-variables[=Datei]\n" #: main.c:815 -#, fuzzy msgid "\t-D[file]\t\t--debug[=file]\n" -msgstr "\t-p [Datei]\t\t--profile[=Datei]\n" +msgstr "\t-D[Datei]\t\t--debug[=Datei]\n" #: main.c:816 msgid "\t-e 'program-text'\t--source='program-text'\n" @@ -3110,11 +2943,11 @@ msgstr "\t-h\t\t\t--help\n" #: main.c:820 msgid "\t-i includefile\t\t--include=includefile\n" -msgstr "" +msgstr "\t-i einzubindende_datei\t\t--include=einzubindende_datei\n" #: main.c:821 msgid "\t-l library\t\t--load=library\n" -msgstr "" +msgstr "\t-l Bibliothek\t\t--load=Bibliothek\n" #: main.c:822 msgid "\t-L [fatal]\t\t--lint[=fatal]\n" @@ -3125,18 +2958,16 @@ msgid "\t-n\t\t\t--non-decimal-data\n" msgstr "\t-n\t\t\t--non-decimal-data\n" #: main.c:824 -#, fuzzy msgid "\t-M\t\t\t--bignum\n" -msgstr "\t-g\t\t\t--gen-pot\n" +msgstr "\t-M\t\t\t--bignum\n" #: main.c:825 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" #: main.c:826 -#, fuzzy msgid "\t-o[file]\t\t--pretty-print[=file]\n" -msgstr "\t-p [Datei]\t\t--profile[=Datei]\n" +msgstr "\t-o[Datei]\t\t--pretty-print[=Datei]\n" #: main.c:827 msgid "\t-O\t\t\t--optimize\n" @@ -3191,8 +3022,8 @@ msgstr "" "in »gawk.info«, den Sie als Kapitel »Reporting Problems and Bugs«\n" "in der gedruckten Version finden.\n" "\n" -"Fehler in der Übersetzuung senden Sie bitte als E-Mail an\n" -"an translation-team-de@lists.sourceforge.net\n" +"Fehler in der Übersetzung senden Sie bitte als E-Mail an\n" +"translation-team-de@lists.sourceforge.net\n" "\n" #: main.c:851 @@ -3289,8 +3120,7 @@ msgstr "»%s« ist kein Variablenname, es wird nach der Datei »%s=%s« gesucht" #: main.c:1339 #, c-format msgid "cannot use gawk builtin `%s' as variable name" -msgstr "" -"die eingebaute Funktion »%s« kann nicht als Variablenname verwendet werden" +msgstr "die eingebaute Funktion »%s« kann nicht als Variablenname verwendet werden" # c-format #: main.c:1344 @@ -3325,58 +3155,54 @@ msgid "could not pre-open /dev/null for fd %d" msgstr "/dev/null konnte nicht für Dateideskriptor %d geöffnet werden" #: mpfr.c:550 -#, fuzzy, c-format +#, c-format msgid "PREC value `%.*s' is invalid" -msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt" +msgstr "PREC Wert »%.*s« ist ungültig" #: mpfr.c:608 -#, fuzzy, c-format +#, c-format msgid "RNDMODE value `%.*s' is invalid" -msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt" +msgstr "BINMODE Wert »%.*s« ist ungültig" #: mpfr.c:698 -#, fuzzy, c-format +#, c-format msgid "%s: received non-numeric argument" -msgstr "cos: das Argument ist keine Zahl" +msgstr "%s: das Argument ist keine Zahl" #: mpfr.c:800 -#, fuzzy msgid "compl(%Rg): negative value will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "compl(%Rg): ein negativer Wert wird zu merkwürdigen Ergebnissen führen" #: mpfr.c:804 -#, fuzzy msgid "comp(%Rg): fractional value will be truncated" -msgstr "compl(%lf): Dezimalteil wird abgeschnitten" +msgstr "compl(%Rg): Dezimalteil wird abgeschnitten" #: mpfr.c:816 -#, fuzzy, c-format +#, c-format msgid "cmpl(%Zd): negative values will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "cmpl(%Zd): Negative Werte führen zu merkwürdigen Ergebnissen" #: mpfr.c:835 -#, fuzzy, c-format +#, c-format msgid "%s: received non-numeric argument #%d" -msgstr "cos: das Argument ist keine Zahl" +msgstr "%s: das Argument Nr. %d ist keine Zahl" #: mpfr.c:845 msgid "%s: argument #%d has invalid value %Rg, using 0" -msgstr "" +msgstr "%s: Argument Nr. %d hat den ungültigen Wert %Rg, es wird stattdessen 0 verwendet" #: mpfr.c:857 -#, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "%s: der negative Wert %2$Rg in Argument Nr. %1$d wird zu merkwürdigen Ergebnissen führen" #: mpfr.c:863 -#, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" -msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten" +msgstr "%s: der Nachkommateil %2$Rg in Argument Nr. %1$d wird abgeschnitten" #: mpfr.c:878 -#, fuzzy, c-format +#, c-format msgid "%s: argument #%d negative value %Zd will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "%1$s: der negative Wert %3$Zd in Argument Nr. %2$d wird zu merkwürdigen Ergebnissen führen" #: msg.c:68 #, c-format @@ -3390,7 +3216,7 @@ msgstr "Backslash am Ende der Zeichenkette" #: node.c:500 #, c-format msgid "old awk does not support the `\\%c' escape sequence" -msgstr "Das alte awk unterstützt die Fluchsequenz »\\%c« nicht" +msgstr "Das alte awk unterstützt die Escapesequenz »\\%c« nicht" #: node.c:551 msgid "POSIX does not allow `\\x' escapes" @@ -3402,12 +3228,8 @@ msgstr "In der »\\x«-Fluchtsequenz sind keine hexadezimalen Zahlen" #: node.c:579 #, c-format -msgid "" -"hex escape \\x%.*s of %d characters probably not interpreted the way you " -"expect" -msgstr "" -"Die Hex-Sequenz \\x%.*s aus %d Zeichen wird wahrscheinlich nicht wie " -"gewünscht interpretiert" +msgid "hex escape \\x%.*s of %d characters probably not interpreted the way you expect" +msgstr "Die Hex-Sequenz \\x%.*s aus %d Zeichen wird wahrscheinlich nicht wie gewünscht interpretiert" #: node.c:594 #, c-format @@ -3415,25 +3237,18 @@ msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "Fluchtsequenz »\\%c« wird wie ein normales »%c« behandelt" #: node.c:739 -msgid "" -"Invalid multibyte data detected. There may be a mismatch between your data " -"and your locale." -msgstr "" -"Es wurden unbekannte Multibyte-Daten gefunden. Ihre Daten entsprechen " -"neventuell nicht der gesetzten Locale" +msgid "Invalid multibyte data detected. There may be a mismatch between your data and your locale." +msgstr "Es wurden unbekannte Multibyte-Daten gefunden. Ihre Daten entsprechen neventuell nicht der gesetzten Locale" #: posix/gawkmisc.c:177 #, c-format msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)" -msgstr "" -"%s %s »%s«: Die Kennungen des Dateideskriptors konnten nicht abgefragt " -"werden: (fcntl F_GETFD: %s)" +msgstr "%s %s »%s«: Die Kennungen des Dateideskriptors konnten nicht abgefragt werden: (fcntl F_GETFD: %s)" #: posix/gawkmisc.c:189 #, c-format msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" -msgstr "" -"%s %s »%s«: close-on-exec konnte nicht gesetzt werden: (fcntl F_SETFD: %s)" +msgstr "%s %s »%s«: close-on-exec konnte nicht gesetzt werden: (fcntl F_SETFD: %s)" #: profile.c:71 #, c-format @@ -3468,9 +3283,8 @@ msgid "internal error: %s with null vname" msgstr "Interner Fehler: %s mit null vname" #: profile.c:537 -#, fuzzy msgid "internal error: builtin with null fname" -msgstr "Interner Fehler: %s mit null vname" +msgstr "Interner Fehler: eingebaute Fuktion mit leerem fname" #: profile.c:949 #, c-format @@ -3478,6 +3292,8 @@ msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" +"\t# Erweiterungen geladen (-l und/oder @load)\n" +"\n" #: profile.c:972 #, c-format @@ -3501,8 +3317,7 @@ msgstr "redir2str: unbekannter Umlenkungstyp %d" #: re.c:607 #, c-format msgid "regexp component `%.*s' should probably be `[%.*s]'" -msgstr "" -"Regulärer-Ausdruck-Komponente »%.*s« sollte wahrscheinlich »[%.*s]« sein" +msgstr "Regulärer-Ausdruck-Komponente »%.*s« sollte wahrscheinlich »[%.*s]« sein" #: regcomp.c:131 msgid "Success" @@ -3570,148 +3385,4 @@ msgstr "Kein vorangehender regulärer Ausdruck" #: symbol.c:741 msgid "can not pop main context" -msgstr "" - -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "" -#~ "Ein Bereich in der Form »[%c-%c]« ist abhängig von der gesetzten Locale" - -#, fuzzy -#~ msgid "[s]printf called with no arguments" -#~ msgstr "sqrt: das Argument %g ist negativ" - -#~ msgid "`-m[fr]' option irrelevant in gawk" -#~ msgstr "Die Option »-m[fr]« ist in gawk bedeutungslos" - -#~ msgid "-m option usage: `-m[fr] nnn'" -#~ msgstr "Anwendung der Option -m: »-m[fr] nnn«" - -#, fuzzy -#~ msgid "%s: received non-numeric first argument" -#~ msgstr "or: das erste Argument ist keine Zahl" - -#, fuzzy -#~ msgid "%s: received non-numeric second argument" -#~ msgstr "or: das zweite Argument ist keine Zahl" - -#, fuzzy -#~ msgid "%s(%Rg, ..): negative values will give strange results" -#~ msgstr "" -#~ "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" - -#, fuzzy -#~ msgid "%s(%Rg, ..): fractional values will be truncated" -#~ msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten" - -#, fuzzy -#~ msgid "%s(%Zd, ..): negative values will give strange results" -#~ msgstr "" -#~ "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" - -#, fuzzy -#~ msgid "%s(.., %Rg): negative values will give strange results" -#~ msgstr "" -#~ "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" - -#, fuzzy -#~ msgid "%s(.., %Zd): negative values will give strange results" -#~ msgstr "" -#~ "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" - -#~ msgid "`%s' is a Bell Labs extension" -#~ msgstr "»%s« ist eine Erweiterung der Bell Labs" - -#~ msgid "`nextfile' is a gawk extension" -#~ msgstr "»nextfile« ist eine gawk-Erweiterung" - -#~ msgid "`delete array' is a gawk extension" -#~ msgstr "»delete array« ist eine gawk-Erweiterung" - -#~ msgid "and: received non-numeric first argument" -#~ msgstr "and: das erste Argument ist keine Zahl" - -#~ msgid "and: received non-numeric second argument" -#~ msgstr "and: das zweite Argument ist keine Zahl" - -#~ msgid "and(%lf, %lf): fractional values will be truncated" -#~ msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten" - -#~ msgid "xor: received non-numeric first argument" -#~ msgstr "xor: das erste Argument ist keine Zahl" - -#~ msgid "xor: received non-numeric second argument" -#~ msgstr "xor: das zweite Argument ist keine Zahl" - -#~ msgid "xor(%lf, %lf): fractional values will be truncated" -#~ msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten" - -#~ msgid "Operation Not Supported" -#~ msgstr "Die Operation wird nicht unterstützt" - -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "Es wird versucht, die Funktion »%s« als Feld zu verwenden" - -#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" -#~ msgstr "Bezug auf ein nicht initialisiertes Element »%s[\"%.*s\"]«" - -#~ msgid "subscript of array `%s' is null string" -#~ msgstr "Der Index von Feld »%s« ist ein Nullstring" - -#~ msgid "%s: empty (null)\n" -#~ msgstr "%s: leer (Null)\n" - -#~ msgid "%s: empty (zero)\n" -#~ msgstr "%s: leer (0)\n" - -#~ msgid "%s: table_size = %d, array_size = %d\n" -#~ msgstr "%s: Tabellengröße = %d, Feldgröße = %d\n" - -#~ msgid "%s: array_ref to %s\n" -#~ msgstr "%s: Feld-Referenz auf %s\n" - -#~ msgid "use of non-array as array" -#~ msgstr "Verwendung eines Nicht-Feldes als Feld" - -#~ msgid "can't use function name `%s' as variable or array" -#~ msgstr "Funktion »%s« kann nicht als Variable oder Feld verwendet werden" - -#~ msgid "assignment used in conditional context" -#~ msgstr "Zuweisung in einer Bedingung" - -#~ msgid "statement has no effect" -#~ msgstr "Anweisung hat keinen Effekt" - -#~ msgid "" -#~ "for loop: array `%s' changed size from %ld to %ld during loop execution" -#~ msgstr "" -#~ "for-Schleife: Feld »%s« ändert seine Größe von %ld innerhalb der Schleife " -#~ "zu %ld" - -#~ msgid "function called indirectly through `%s' does not exist" -#~ msgstr "die durch »%s« indirekt aufgerufene Funktion existiert nicht" - -#~ msgid "function `%s' not defined" -#~ msgstr "Funktion »%s« ist nicht definiert" - -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "Nicht umgelenktes »getline« ist innerhalb der »%s«-Aktion unzuässig" - -#~ msgid "`nextfile' cannot be called from a `%s' rule" -#~ msgstr "»nextfile« kann nicht aus einer »«%s-Regel aufgerufen werden" - -#~ msgid "`next' cannot be called from a `%s' rule" -#~ msgstr "»next« kann nicht in einer »%s«-Regel verwendet werden" - -#~ msgid "Sorry, don't know how to interpret `%s'" -#~ msgstr "" -#~ "Entschuldigung, aber es ist unbekannt, wie »%s« zu interpretieren ist" - -#~ msgid "\t-R file\t\t\t--command=file\n" -#~ msgstr "\t-R Datei\t\t\t--command=Datei\n" - -#~ msgid "could not find groups: %s" -#~ msgstr "Die Gruppen konnten nicht gefunden werden: %s" - -#~ msgid "assignment is not allowed to result of builtin function" -#~ msgstr "" -#~ "Zuweisungen an das Ergebnis einer eingebauten Funktion sind nicht erlaubt" +msgstr "der Hauptkontext kann nicht entfernt werden" -- cgit v1.2.3 From 393460d20fcc982c3d71749ca3ef4192cb01defb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 28 Oct 2014 20:32:17 +0200 Subject: Sync dfa.c with grep. --- ChangeLog | 4 ++++ dfa.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 66 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 533ee9c3..178e45fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-10-28 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. Again. + 2014-10-25 Arnold D. Robbins * dfa.c: Sync with GNU grep. diff --git a/dfa.c b/dfa.c index 9c3901a6..c299da1e 100644 --- a/dfa.c +++ b/dfa.c @@ -440,6 +440,10 @@ struct dfa slots so far, not counting trans[-1]. */ int trcount; /* Number of transition tables that have actually been built. */ + int min_trcount; /* Minimum of number of transition tables. + Always keep the number, even after freeing + the transition tables. It is also the + number of initial states. */ state_num **trans; /* Transition tables for states that can never accept. If the transitions for a state have not yet been computed, or the @@ -458,6 +462,8 @@ struct dfa newline is stored separately and handled as a special case. Newline is also used as a sentinel at the end of the buffer. */ + state_num initstate_letter; /* Initial state for letter context. */ + state_num initstate_others; /* Initial state for other contexts. */ struct dfamust *musts; /* List of strings, at least one of which is known to appear in any r.e. matching the dfa. */ @@ -2600,9 +2606,16 @@ dfaanalyze (struct dfa *d, int searchflag) /* Build the initial state. */ separate_contexts = state_separate_contexts (&merged); - state_index (d, &merged, - (separate_contexts & CTX_NEWLINE - ? CTX_NEWLINE : separate_contexts ^ CTX_ANY)); + if (separate_contexts & CTX_NEWLINE) + state_index (d, &merged, CTX_NEWLINE); + d->initstate_others = d->min_trcount + = state_index (d, &merged, separate_contexts ^ CTX_ANY); + if (separate_contexts & CTX_LETTER) + d->initstate_letter = d->min_trcount + = state_index (d, &merged, CTX_LETTER); + else + d->initstate_letter = d->initstate_others; + d->min_trcount++; free (posalloc); free (stkalloc); @@ -2939,17 +2952,17 @@ build_state (state_num s, struct dfa *d) /* Set an upper limit on the number of transition tables that will ever exist at once. 1024 is arbitrary. The idea is that the frequently used transition tables will be quickly rebuilt, whereas the ones that - were only needed once or twice will be cleared away. However, do - not clear the initial state, as it's always used. */ + were only needed once or twice will be cleared away. However, do not + clear the initial D->min_trcount states, since they are always used. */ if (d->trcount >= 1024) { - for (i = 1; i < d->tralloc; ++i) + for (i = d->min_trcount; i < d->tralloc; ++i) { free (d->trans[i]); free (d->fails[i]); d->trans[i] = d->fails[i] = NULL; } - d->trcount = 1; + d->trcount = d->min_trcount; } ++d->trcount; @@ -3320,15 +3333,22 @@ transit_state (struct dfa *d, state_num s, unsigned char const **pp, expression "\\" accepts the codepoint 0x5c, but should not accept the second byte of the codepoint 0x815c. Then the initial state must skip the bytes that are not a single byte character nor the first byte of a multibyte - character. */ + character. + + Given DFA state d, use mbs_to_wchar to advance MBP until it reaches or + exceeds P. If WCP is non-NULL, set *WCP to the final wide character + processed, or if no wide character is processed, set it to WEOF. + Both P and MBP must be no larger than END. */ static unsigned char const * skip_remains_mb (struct dfa *d, unsigned char const *p, - unsigned char const *mbp, char const *end) + unsigned char const *mbp, char const *end, wint_t *wcp) { - wint_t wc; + wint_t wc = WEOF; while (mbp < p) mbp += mbs_to_wchar (&wc, (char const *) mbp, end - (char const *) mbp, d); + if (wcp != NULL) + *wcp = wc; return mbp; } @@ -3390,20 +3410,44 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, { s1 = s; - if (s == 0) + if (s < d->min_trcount) { - if (d->states[s].mbps.nelem == 0) + if (d->min_trcount == 1) { - do + if (d->states[s].mbps.nelem == 0) { - while (t[*p] == 0) - p++; - p = mbp = skip_remains_mb (d, p, mbp, end); + do + { + while (t[*p] == 0) + p++; + p = mbp = skip_remains_mb (d, p, mbp, end, NULL); + } + while (t[*p] == 0); } - while (t[*p] == 0); + else + p = mbp = skip_remains_mb (d, p, mbp, end, NULL); } else - p = mbp = skip_remains_mb (d, p, mbp, end); + { + wint_t wc; + mbp = skip_remains_mb (d, p, mbp, end, &wc); + + /* If d->min_trcount is greater than 1, maybe + transit to another initial state after skip. */ + if (p < mbp) + { + int context = wchar_context (wc); + if (context == CTX_LETTER) + s = d->initstate_letter; + else + /* It's CTX_NONE. CTX_NEWLINE cannot happen, + as we assume that a newline is always a + single byte character. */ + s = d->initstate_others; + p = mbp; + s1 = s; + } + } } if (d->states[s].mbps.nelem == 0) -- cgit v1.2.3 From 0d487f23486bae6721650e37b746fdb1d1a67977 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 28 Oct 2014 20:32:33 +0200 Subject: Doc fixes. --- doc/ChangeLog | 6 + doc/gawk.1 | 3 +- doc/gawk.info | 1042 +++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 13 +- doc/gawktexi.in | 13 +- 5 files changed, 543 insertions(+), 534 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d97f31ca..c651be7c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-28 Arnold D. Robbins + + * gawk.1: Clarification that debugger reads stdin. + * gawktexi.in: Ditto, and correctly place the "Braces" entry in + the Glossary. Thanks to Antonio Colombo for that. + 2014-10-25 Arnold D. Robbins * gawktexi.in: Minor typo fixes. diff --git a/doc/gawk.1 b/doc/gawk.1 index df31a5f2..0a37d5a8 100644 --- a/doc/gawk.1 +++ b/doc/gawk.1 @@ -231,7 +231,8 @@ and so on.) .PD \fB\-\^\-debug\fR[\fB=\fIfile\fR] Enable debugging of \*(AK programs. -By default, the debugger reads commands interactively from the terminal. +By default, the debugger reads commands interactively from the keyboard +(standard input). The optional .IR file argument specifies a file with a list diff --git a/doc/gawk.info b/doc/gawk.info index 0583554f..6b851441 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -2501,10 +2501,10 @@ The following list describes options mandated by the POSIX standard: `--debug'[`='FILE] Enable debugging of `awk' programs (*note Debugging::). By default, the debugger reads commands interactively from the - keyboard. 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' and FILE, - if FILE is supplied. + 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' + and FILE, if FILE is supplied. `-e' PROGRAM-TEXT `--source' PROGRAM-TEXT @@ -29479,6 +29479,10 @@ Bourne Shell shells (Bash, `ksh', `pdksh', `zsh') are generally upwardly compatible with the Bourne shell. +Braces + The characters `{' and `}'. Braces are used in `awk' for + delimiting actions, compound statements, and function bodies. + Built-in Function The `awk' language provides built-in functions that perform various numerical, I/O-related, and string computations. Examples are @@ -29497,10 +29501,6 @@ Built-in Variable them affects `awk''s running environment. (*Note Built-in Variables::.) -Braces - The characters `{' and `}'. Braces are used in `awk' for - delimiting actions, compound statements, and function bodies. - C The system programming language that most GNU software is written in. The `awk' programming language has C-like syntax, and this @@ -34325,518 +34325,518 @@ Node: Intro Summary111987 Node: Invoking Gawk112870 Node: Command Line114385 Node: Options115176 -Ref: Options-Footnote-1131071 -Node: Other Arguments131096 -Node: Naming Standard Input134057 -Node: Environment Variables135150 -Node: AWKPATH Variable135708 -Ref: AWKPATH Variable-Footnote-1139008 -Ref: AWKPATH Variable-Footnote-2139053 -Node: AWKLIBPATH Variable139313 -Node: Other Environment Variables140456 -Node: Exit Status144176 -Node: Include Files144851 -Node: Loading Shared Libraries148439 -Node: Obsolete149866 -Node: Undocumented150563 -Node: Invoking Summary150830 -Node: Regexp152496 -Node: Regexp Usage153955 -Node: Escape Sequences155988 -Node: Regexp Operators162005 -Ref: Regexp Operators-Footnote-1169439 -Ref: Regexp Operators-Footnote-2169586 -Node: Bracket Expressions169684 -Ref: table-char-classes171701 -Node: Leftmost Longest174641 -Node: Computed Regexps175943 -Node: GNU Regexp Operators179340 -Node: Case-sensitivity183042 -Ref: Case-sensitivity-Footnote-1185932 -Ref: Case-sensitivity-Footnote-2186167 -Node: Regexp Summary186275 -Node: Reading Files187744 -Node: Records189838 -Node: awk split records190570 -Node: gawk split records195484 -Ref: gawk split records-Footnote-1200023 -Node: Fields200060 -Ref: Fields-Footnote-1202858 -Node: Nonconstant Fields202944 -Ref: Nonconstant Fields-Footnote-1205180 -Node: Changing Fields205382 -Node: Field Separators211314 -Node: Default Field Splitting214018 -Node: Regexp Field Splitting215135 -Node: Single Character Fields218485 -Node: Command Line Field Separator219544 -Node: Full Line Fields222756 -Ref: Full Line Fields-Footnote-1223264 -Node: Field Splitting Summary223310 -Ref: Field Splitting Summary-Footnote-1226441 -Node: Constant Size226542 -Node: Splitting By Content231148 -Ref: Splitting By Content-Footnote-1235221 -Node: Multiple Line235261 -Ref: Multiple Line-Footnote-1241150 -Node: Getline241329 -Node: Plain Getline243540 -Node: Getline/Variable246180 -Node: Getline/File247327 -Node: Getline/Variable/File248711 -Ref: Getline/Variable/File-Footnote-1250312 -Node: Getline/Pipe250399 -Node: Getline/Variable/Pipe253082 -Node: Getline/Coprocess254213 -Node: Getline/Variable/Coprocess255465 -Node: Getline Notes256204 -Node: Getline Summary258996 -Ref: table-getline-variants259408 -Node: Read Timeout260237 -Ref: Read Timeout-Footnote-1264051 -Node: Command-line directories264109 -Node: Input Summary265013 -Node: Input Exercises268265 -Node: Printing268993 -Node: Print270770 -Node: Print Examples272227 -Node: Output Separators275006 -Node: OFMT277024 -Node: Printf278378 -Node: Basic Printf279163 -Node: Control Letters280734 -Node: Format Modifiers284718 -Node: Printf Examples290725 -Node: Redirection293207 -Node: Special FD300046 -Ref: Special FD-Footnote-1303203 -Node: Special Files303277 -Node: Other Inherited Files303893 -Node: Special Network304893 -Node: Special Caveats305754 -Node: Close Files And Pipes306705 -Ref: Close Files And Pipes-Footnote-1313884 -Ref: Close Files And Pipes-Footnote-2314032 -Node: Output Summary314182 -Node: Output Exercises315178 -Node: Expressions315858 -Node: Values317043 -Node: Constants317719 -Node: Scalar Constants318399 -Ref: Scalar Constants-Footnote-1319258 -Node: Nondecimal-numbers319508 -Node: Regexp Constants322508 -Node: Using Constant Regexps323033 -Node: Variables326171 -Node: Using Variables326826 -Node: Assignment Options328736 -Node: Conversion330611 -Node: Strings And Numbers331135 -Ref: Strings And Numbers-Footnote-1334199 -Node: Locale influences conversions334308 -Ref: table-locale-affects337053 -Node: All Operators337641 -Node: Arithmetic Ops338271 -Node: Concatenation340776 -Ref: Concatenation-Footnote-1343595 -Node: Assignment Ops343701 -Ref: table-assign-ops348684 -Node: Increment Ops349962 -Node: Truth Values and Conditions353400 -Node: Truth Values354483 -Node: Typing and Comparison355532 -Node: Variable Typing356325 -Node: Comparison Operators359977 -Ref: table-relational-ops360387 -Node: POSIX String Comparison363902 -Ref: POSIX String Comparison-Footnote-1364974 -Node: Boolean Ops365112 -Ref: Boolean Ops-Footnote-1369591 -Node: Conditional Exp369682 -Node: Function Calls371409 -Node: Precedence375289 -Node: Locales378957 -Node: Expressions Summary380588 -Node: Patterns and Actions383162 -Node: Pattern Overview384282 -Node: Regexp Patterns385961 -Node: Expression Patterns386504 -Node: Ranges390284 -Node: BEGIN/END393390 -Node: Using BEGIN/END394152 -Ref: Using BEGIN/END-Footnote-1396889 -Node: I/O And BEGIN/END396995 -Node: BEGINFILE/ENDFILE399309 -Node: Empty402210 -Node: Using Shell Variables402527 -Node: Action Overview404803 -Node: Statements407130 -Node: If Statement408978 -Node: While Statement410476 -Node: Do Statement412504 -Node: For Statement413646 -Node: Switch Statement416801 -Node: Break Statement419189 -Node: Continue Statement421230 -Node: Next Statement423055 -Node: Nextfile Statement425435 -Node: Exit Statement428065 -Node: Built-in Variables430468 -Node: User-modified431601 -Ref: User-modified-Footnote-1439281 -Node: Auto-set439343 -Ref: Auto-set-Footnote-1452373 -Ref: Auto-set-Footnote-2452578 -Node: ARGC and ARGV452634 -Node: Pattern Action Summary456838 -Node: Arrays459265 -Node: Array Basics460594 -Node: Array Intro461438 -Ref: figure-array-elements463402 -Ref: Array Intro-Footnote-1465926 -Node: Reference to Elements466054 -Node: Assigning Elements468504 -Node: Array Example468995 -Node: Scanning an Array470753 -Node: Controlling Scanning473769 -Ref: Controlling Scanning-Footnote-1478958 -Node: Numeric Array Subscripts479274 -Node: Uninitialized Subscripts481459 -Node: Delete483076 -Ref: Delete-Footnote-1485820 -Node: Multidimensional485877 -Node: Multiscanning488972 -Node: Arrays of Arrays490561 -Node: Arrays Summary495322 -Node: Functions497427 -Node: Built-in498300 -Node: Calling Built-in499378 -Node: Numeric Functions501366 -Ref: Numeric Functions-Footnote-1505388 -Ref: Numeric Functions-Footnote-2505745 -Ref: Numeric Functions-Footnote-3505793 -Node: String Functions506062 -Ref: String Functions-Footnote-1529534 -Ref: String Functions-Footnote-2529663 -Ref: String Functions-Footnote-3529911 -Node: Gory Details529998 -Ref: table-sub-escapes531779 -Ref: table-sub-proposed533299 -Ref: table-posix-sub534663 -Ref: table-gensub-escapes536203 -Ref: Gory Details-Footnote-1537035 -Node: I/O Functions537186 -Ref: I/O Functions-Footnote-1544287 -Node: Time Functions544434 -Ref: Time Functions-Footnote-1554903 -Ref: Time Functions-Footnote-2554971 -Ref: Time Functions-Footnote-3555129 -Ref: Time Functions-Footnote-4555240 -Ref: Time Functions-Footnote-5555352 -Ref: Time Functions-Footnote-6555579 -Node: Bitwise Functions555845 -Ref: table-bitwise-ops556407 -Ref: Bitwise Functions-Footnote-1560715 -Node: Type Functions560884 -Node: I18N Functions562033 -Node: User-defined563678 -Node: Definition Syntax564482 -Ref: Definition Syntax-Footnote-1569888 -Node: Function Example569957 -Ref: Function Example-Footnote-1572874 -Node: Function Caveats572896 -Node: Calling A Function573414 -Node: Variable Scope574369 -Node: Pass By Value/Reference577357 -Node: Return Statement580867 -Node: Dynamic Typing583851 -Node: Indirect Calls584780 -Ref: Indirect Calls-Footnote-1596084 -Node: Functions Summary596212 -Node: Library Functions598911 -Ref: Library Functions-Footnote-1602529 -Ref: Library Functions-Footnote-2602672 -Node: Library Names602843 -Ref: Library Names-Footnote-1606303 -Ref: Library Names-Footnote-2606523 -Node: General Functions606609 -Node: Strtonum Function607712 -Node: Assert Function610732 -Node: Round Function614056 -Node: Cliff Random Function615597 -Node: Ordinal Functions616613 -Ref: Ordinal Functions-Footnote-1619678 -Ref: Ordinal Functions-Footnote-2619930 -Node: Join Function620141 -Ref: Join Function-Footnote-1621912 -Node: Getlocaltime Function622112 -Node: Readfile Function625853 -Node: Shell Quoting627823 -Node: Data File Management629224 -Node: Filetrans Function629856 -Node: Rewind Function633915 -Node: File Checking635300 -Ref: File Checking-Footnote-1636628 -Node: Empty Files636829 -Node: Ignoring Assigns638808 -Node: Getopt Function640359 -Ref: Getopt Function-Footnote-1651819 -Node: Passwd Functions652022 -Ref: Passwd Functions-Footnote-1660873 -Node: Group Functions660961 -Ref: Group Functions-Footnote-1668864 -Node: Walking Arrays669077 -Node: Library Functions Summary670680 -Node: Library Exercises672081 -Node: Sample Programs673361 -Node: Running Examples674131 -Node: Clones674859 -Node: Cut Program676083 -Node: Egrep Program685813 -Ref: Egrep Program-Footnote-1693317 -Node: Id Program693427 -Node: Split Program697071 -Ref: Split Program-Footnote-1700517 -Node: Tee Program700645 -Node: Uniq Program703432 -Node: Wc Program710853 -Ref: Wc Program-Footnote-1715101 -Node: Miscellaneous Programs715193 -Node: Dupword Program716406 -Node: Alarm Program718437 -Node: Translate Program723241 -Ref: Translate Program-Footnote-1727805 -Node: Labels Program728075 -Ref: Labels Program-Footnote-1731424 -Node: Word Sorting731508 -Node: History Sorting735578 -Node: Extract Program737414 -Node: Simple Sed744946 -Node: Igawk Program748008 -Ref: Igawk Program-Footnote-1762334 -Ref: Igawk Program-Footnote-2762535 -Ref: Igawk Program-Footnote-3762657 -Node: Anagram Program762772 -Node: Signature Program765834 -Node: Programs Summary767081 -Node: Programs Exercises768274 -Ref: Programs Exercises-Footnote-1772405 -Node: Advanced Features772496 -Node: Nondecimal Data774444 -Node: Array Sorting776034 -Node: Controlling Array Traversal776731 -Ref: Controlling Array Traversal-Footnote-1785062 -Node: Array Sorting Functions785180 -Ref: Array Sorting Functions-Footnote-1789072 -Node: Two-way I/O789266 -Ref: Two-way I/O-Footnote-1794210 -Ref: Two-way I/O-Footnote-2794396 -Node: TCP/IP Networking794478 -Node: Profiling797350 -Node: Advanced Features Summary804894 -Node: Internationalization806827 -Node: I18N and L10N808307 -Node: Explaining gettext808993 -Ref: Explaining gettext-Footnote-1814022 -Ref: Explaining gettext-Footnote-2814206 -Node: Programmer i18n814371 -Ref: Programmer i18n-Footnote-1819237 -Node: Translator i18n819286 -Node: String Extraction820080 -Ref: String Extraction-Footnote-1821211 -Node: Printf Ordering821297 -Ref: Printf Ordering-Footnote-1824083 -Node: I18N Portability824147 -Ref: I18N Portability-Footnote-1826596 -Node: I18N Example826659 -Ref: I18N Example-Footnote-1829459 -Node: Gawk I18N829531 -Node: I18N Summary830169 -Node: Debugger831508 -Node: Debugging832530 -Node: Debugging Concepts832971 -Node: Debugging Terms834828 -Node: Awk Debugging837403 -Node: Sample Debugging Session838295 -Node: Debugger Invocation838815 -Node: Finding The Bug840199 -Node: List of Debugger Commands846674 -Node: Breakpoint Control848006 -Node: Debugger Execution Control851698 -Node: Viewing And Changing Data855062 -Node: Execution Stack858427 -Node: Debugger Info860065 -Node: Miscellaneous Debugger Commands864082 -Node: Readline Support869274 -Node: Limitations870166 -Node: Debugging Summary872263 -Node: Arbitrary Precision Arithmetic873431 -Node: Computer Arithmetic874847 -Ref: table-numeric-ranges878448 -Ref: Computer Arithmetic-Footnote-1879307 -Node: Math Definitions879364 -Ref: table-ieee-formats882651 -Ref: Math Definitions-Footnote-1883255 -Node: MPFR features883360 -Node: FP Math Caution885031 -Ref: FP Math Caution-Footnote-1886081 -Node: Inexactness of computations886450 -Node: Inexact representation887398 -Node: Comparing FP Values888753 -Node: Errors accumulate889826 -Node: Getting Accuracy891259 -Node: Try To Round893918 -Node: Setting precision894817 -Ref: table-predefined-precision-strings895501 -Node: Setting the rounding mode897295 -Ref: table-gawk-rounding-modes897659 -Ref: Setting the rounding mode-Footnote-1901113 -Node: Arbitrary Precision Integers901292 -Ref: Arbitrary Precision Integers-Footnote-1904283 -Node: POSIX Floating Point Problems904432 -Ref: POSIX Floating Point Problems-Footnote-1908308 -Node: Floating point summary908346 -Node: Dynamic Extensions910538 -Node: Extension Intro912090 -Node: Plugin License913356 -Node: Extension Mechanism Outline914153 -Ref: figure-load-extension914581 -Ref: figure-register-new-function916061 -Ref: figure-call-new-function917065 -Node: Extension API Description919051 -Node: Extension API Functions Introduction920501 -Node: General Data Types925337 -Ref: General Data Types-Footnote-1931024 -Node: Memory Allocation Functions931323 -Ref: Memory Allocation Functions-Footnote-1934153 -Node: Constructor Functions934249 -Node: Registration Functions935983 -Node: Extension Functions936668 -Node: Exit Callback Functions938964 -Node: Extension Version String940212 -Node: Input Parsers940862 -Node: Output Wrappers950677 -Node: Two-way processors955193 -Node: Printing Messages957397 -Ref: Printing Messages-Footnote-1958474 -Node: Updating `ERRNO'958626 -Node: Requesting Values959366 -Ref: table-value-types-returned960094 -Node: Accessing Parameters961052 -Node: Symbol Table Access962283 -Node: Symbol table by name962797 -Node: Symbol table by cookie964777 -Ref: Symbol table by cookie-Footnote-1968916 -Node: Cached values968979 -Ref: Cached values-Footnote-1972483 -Node: Array Manipulation972574 -Ref: Array Manipulation-Footnote-1973672 -Node: Array Data Types973711 -Ref: Array Data Types-Footnote-1976368 -Node: Array Functions976460 -Node: Flattening Arrays980314 -Node: Creating Arrays987201 -Node: Extension API Variables991968 -Node: Extension Versioning992604 -Node: Extension API Informational Variables994505 -Node: Extension API Boilerplate995593 -Node: Finding Extensions999409 -Node: Extension Example999969 -Node: Internal File Description1000741 -Node: Internal File Ops1004808 -Ref: Internal File Ops-Footnote-11016466 -Node: Using Internal File Ops1016606 -Ref: Using Internal File Ops-Footnote-11018989 -Node: Extension Samples1019262 -Node: Extension Sample File Functions1020786 -Node: Extension Sample Fnmatch1028388 -Node: Extension Sample Fork1029870 -Node: Extension Sample Inplace1031083 -Node: Extension Sample Ord1032758 -Node: Extension Sample Readdir1033594 -Ref: table-readdir-file-types1034470 -Node: Extension Sample Revout1035281 -Node: Extension Sample Rev2way1035872 -Node: Extension Sample Read write array1036613 -Node: Extension Sample Readfile1038552 -Node: Extension Sample Time1039647 -Node: Extension Sample API Tests1040996 -Node: gawkextlib1041487 -Node: Extension summary1044137 -Node: Extension Exercises1047819 -Node: Language History1048541 -Node: V7/SVR3.11050198 -Node: SVR41052379 -Node: POSIX1053824 -Node: BTL1055213 -Node: POSIX/GNU1055947 -Node: Feature History1061516 -Node: Common Extensions1074614 -Node: Ranges and Locales1075938 -Ref: Ranges and Locales-Footnote-11080577 -Ref: Ranges and Locales-Footnote-21080604 -Ref: Ranges and Locales-Footnote-31080838 -Node: Contributors1081059 -Node: History summary1086599 -Node: Installation1087968 -Node: Gawk Distribution1088924 -Node: Getting1089408 -Node: Extracting1090232 -Node: Distribution contents1091874 -Node: Unix Installation1097591 -Node: Quick Installation1098208 -Node: Additional Configuration Options1100639 -Node: Configuration Philosophy1102379 -Node: Non-Unix Installation1104730 -Node: PC Installation1105188 -Node: PC Binary Installation1106514 -Node: PC Compiling1108362 -Ref: PC Compiling-Footnote-11111383 -Node: PC Testing1111488 -Node: PC Using1112664 -Node: Cygwin1116779 -Node: MSYS1117602 -Node: VMS Installation1118100 -Node: VMS Compilation1118892 -Ref: VMS Compilation-Footnote-11120114 -Node: VMS Dynamic Extensions1120172 -Node: VMS Installation Details1121856 -Node: VMS Running1124108 -Node: VMS GNV1126949 -Node: VMS Old Gawk1127683 -Node: Bugs1128153 -Node: Other Versions1132057 -Node: Installation summary1138270 -Node: Notes1139326 -Node: Compatibility Mode1140191 -Node: Additions1140973 -Node: Accessing The Source1141898 -Node: Adding Code1143334 -Node: New Ports1149506 -Node: Derived Files1153988 -Ref: Derived Files-Footnote-11159463 -Ref: Derived Files-Footnote-21159497 -Ref: Derived Files-Footnote-31160093 -Node: Future Extensions1160207 -Node: Implementation Limitations1160813 -Node: Extension Design1162061 -Node: Old Extension Problems1163215 -Ref: Old Extension Problems-Footnote-11164732 -Node: Extension New Mechanism Goals1164789 -Ref: Extension New Mechanism Goals-Footnote-11168149 -Node: Extension Other Design Decisions1168338 -Node: Extension Future Growth1170446 -Node: Old Extension Mechanism1171282 -Node: Notes summary1173044 -Node: Basic Concepts1174230 -Node: Basic High Level1174911 -Ref: figure-general-flow1175183 -Ref: figure-process-flow1175782 -Ref: Basic High Level-Footnote-11179011 -Node: Basic Data Typing1179196 -Node: Glossary1182524 -Node: Copying1207682 -Node: GNU Free Documentation License1245238 -Node: Index1270374 +Ref: Options-Footnote-1131088 +Node: Other Arguments131113 +Node: Naming Standard Input134074 +Node: Environment Variables135167 +Node: AWKPATH Variable135725 +Ref: AWKPATH Variable-Footnote-1139025 +Ref: AWKPATH Variable-Footnote-2139070 +Node: AWKLIBPATH Variable139330 +Node: Other Environment Variables140473 +Node: Exit Status144193 +Node: Include Files144868 +Node: Loading Shared Libraries148456 +Node: Obsolete149883 +Node: Undocumented150580 +Node: Invoking Summary150847 +Node: Regexp152513 +Node: Regexp Usage153972 +Node: Escape Sequences156005 +Node: Regexp Operators162022 +Ref: Regexp Operators-Footnote-1169456 +Ref: Regexp Operators-Footnote-2169603 +Node: Bracket Expressions169701 +Ref: table-char-classes171718 +Node: Leftmost Longest174658 +Node: Computed Regexps175960 +Node: GNU Regexp Operators179357 +Node: Case-sensitivity183059 +Ref: Case-sensitivity-Footnote-1185949 +Ref: Case-sensitivity-Footnote-2186184 +Node: Regexp Summary186292 +Node: Reading Files187761 +Node: Records189855 +Node: awk split records190587 +Node: gawk split records195501 +Ref: gawk split records-Footnote-1200040 +Node: Fields200077 +Ref: Fields-Footnote-1202875 +Node: Nonconstant Fields202961 +Ref: Nonconstant Fields-Footnote-1205197 +Node: Changing Fields205399 +Node: Field Separators211331 +Node: Default Field Splitting214035 +Node: Regexp Field Splitting215152 +Node: Single Character Fields218502 +Node: Command Line Field Separator219561 +Node: Full Line Fields222773 +Ref: Full Line Fields-Footnote-1223281 +Node: Field Splitting Summary223327 +Ref: Field Splitting Summary-Footnote-1226458 +Node: Constant Size226559 +Node: Splitting By Content231165 +Ref: Splitting By Content-Footnote-1235238 +Node: Multiple Line235278 +Ref: Multiple Line-Footnote-1241167 +Node: Getline241346 +Node: Plain Getline243557 +Node: Getline/Variable246197 +Node: Getline/File247344 +Node: Getline/Variable/File248728 +Ref: Getline/Variable/File-Footnote-1250329 +Node: Getline/Pipe250416 +Node: Getline/Variable/Pipe253099 +Node: Getline/Coprocess254230 +Node: Getline/Variable/Coprocess255482 +Node: Getline Notes256221 +Node: Getline Summary259013 +Ref: table-getline-variants259425 +Node: Read Timeout260254 +Ref: Read Timeout-Footnote-1264068 +Node: Command-line directories264126 +Node: Input Summary265030 +Node: Input Exercises268282 +Node: Printing269010 +Node: Print270787 +Node: Print Examples272244 +Node: Output Separators275023 +Node: OFMT277041 +Node: Printf278395 +Node: Basic Printf279180 +Node: Control Letters280751 +Node: Format Modifiers284735 +Node: Printf Examples290742 +Node: Redirection293224 +Node: Special FD300063 +Ref: Special FD-Footnote-1303220 +Node: Special Files303294 +Node: Other Inherited Files303910 +Node: Special Network304910 +Node: Special Caveats305771 +Node: Close Files And Pipes306722 +Ref: Close Files And Pipes-Footnote-1313901 +Ref: Close Files And Pipes-Footnote-2314049 +Node: Output Summary314199 +Node: Output Exercises315195 +Node: Expressions315875 +Node: Values317060 +Node: Constants317736 +Node: Scalar Constants318416 +Ref: Scalar Constants-Footnote-1319275 +Node: Nondecimal-numbers319525 +Node: Regexp Constants322525 +Node: Using Constant Regexps323050 +Node: Variables326188 +Node: Using Variables326843 +Node: Assignment Options328753 +Node: Conversion330628 +Node: Strings And Numbers331152 +Ref: Strings And Numbers-Footnote-1334216 +Node: Locale influences conversions334325 +Ref: table-locale-affects337070 +Node: All Operators337658 +Node: Arithmetic Ops338288 +Node: Concatenation340793 +Ref: Concatenation-Footnote-1343612 +Node: Assignment Ops343718 +Ref: table-assign-ops348701 +Node: Increment Ops349979 +Node: Truth Values and Conditions353417 +Node: Truth Values354500 +Node: Typing and Comparison355549 +Node: Variable Typing356342 +Node: Comparison Operators359994 +Ref: table-relational-ops360404 +Node: POSIX String Comparison363919 +Ref: POSIX String Comparison-Footnote-1364991 +Node: Boolean Ops365129 +Ref: Boolean Ops-Footnote-1369608 +Node: Conditional Exp369699 +Node: Function Calls371426 +Node: Precedence375306 +Node: Locales378974 +Node: Expressions Summary380605 +Node: Patterns and Actions383179 +Node: Pattern Overview384299 +Node: Regexp Patterns385978 +Node: Expression Patterns386521 +Node: Ranges390301 +Node: BEGIN/END393407 +Node: Using BEGIN/END394169 +Ref: Using BEGIN/END-Footnote-1396906 +Node: I/O And BEGIN/END397012 +Node: BEGINFILE/ENDFILE399326 +Node: Empty402227 +Node: Using Shell Variables402544 +Node: Action Overview404820 +Node: Statements407147 +Node: If Statement408995 +Node: While Statement410493 +Node: Do Statement412521 +Node: For Statement413663 +Node: Switch Statement416818 +Node: Break Statement419206 +Node: Continue Statement421247 +Node: Next Statement423072 +Node: Nextfile Statement425452 +Node: Exit Statement428082 +Node: Built-in Variables430485 +Node: User-modified431618 +Ref: User-modified-Footnote-1439298 +Node: Auto-set439360 +Ref: Auto-set-Footnote-1452390 +Ref: Auto-set-Footnote-2452595 +Node: ARGC and ARGV452651 +Node: Pattern Action Summary456855 +Node: Arrays459282 +Node: Array Basics460611 +Node: Array Intro461455 +Ref: figure-array-elements463419 +Ref: Array Intro-Footnote-1465943 +Node: Reference to Elements466071 +Node: Assigning Elements468521 +Node: Array Example469012 +Node: Scanning an Array470770 +Node: Controlling Scanning473786 +Ref: Controlling Scanning-Footnote-1478975 +Node: Numeric Array Subscripts479291 +Node: Uninitialized Subscripts481476 +Node: Delete483093 +Ref: Delete-Footnote-1485837 +Node: Multidimensional485894 +Node: Multiscanning488989 +Node: Arrays of Arrays490578 +Node: Arrays Summary495339 +Node: Functions497444 +Node: Built-in498317 +Node: Calling Built-in499395 +Node: Numeric Functions501383 +Ref: Numeric Functions-Footnote-1505405 +Ref: Numeric Functions-Footnote-2505762 +Ref: Numeric Functions-Footnote-3505810 +Node: String Functions506079 +Ref: String Functions-Footnote-1529551 +Ref: String Functions-Footnote-2529680 +Ref: String Functions-Footnote-3529928 +Node: Gory Details530015 +Ref: table-sub-escapes531796 +Ref: table-sub-proposed533316 +Ref: table-posix-sub534680 +Ref: table-gensub-escapes536220 +Ref: Gory Details-Footnote-1537052 +Node: I/O Functions537203 +Ref: I/O Functions-Footnote-1544304 +Node: Time Functions544451 +Ref: Time Functions-Footnote-1554920 +Ref: Time Functions-Footnote-2554988 +Ref: Time Functions-Footnote-3555146 +Ref: Time Functions-Footnote-4555257 +Ref: Time Functions-Footnote-5555369 +Ref: Time Functions-Footnote-6555596 +Node: Bitwise Functions555862 +Ref: table-bitwise-ops556424 +Ref: Bitwise Functions-Footnote-1560732 +Node: Type Functions560901 +Node: I18N Functions562050 +Node: User-defined563695 +Node: Definition Syntax564499 +Ref: Definition Syntax-Footnote-1569905 +Node: Function Example569974 +Ref: Function Example-Footnote-1572891 +Node: Function Caveats572913 +Node: Calling A Function573431 +Node: Variable Scope574386 +Node: Pass By Value/Reference577374 +Node: Return Statement580884 +Node: Dynamic Typing583868 +Node: Indirect Calls584797 +Ref: Indirect Calls-Footnote-1596101 +Node: Functions Summary596229 +Node: Library Functions598928 +Ref: Library Functions-Footnote-1602546 +Ref: Library Functions-Footnote-2602689 +Node: Library Names602860 +Ref: Library Names-Footnote-1606320 +Ref: Library Names-Footnote-2606540 +Node: General Functions606626 +Node: Strtonum Function607729 +Node: Assert Function610749 +Node: Round Function614073 +Node: Cliff Random Function615614 +Node: Ordinal Functions616630 +Ref: Ordinal Functions-Footnote-1619695 +Ref: Ordinal Functions-Footnote-2619947 +Node: Join Function620158 +Ref: Join Function-Footnote-1621929 +Node: Getlocaltime Function622129 +Node: Readfile Function625870 +Node: Shell Quoting627840 +Node: Data File Management629241 +Node: Filetrans Function629873 +Node: Rewind Function633932 +Node: File Checking635317 +Ref: File Checking-Footnote-1636645 +Node: Empty Files636846 +Node: Ignoring Assigns638825 +Node: Getopt Function640376 +Ref: Getopt Function-Footnote-1651836 +Node: Passwd Functions652039 +Ref: Passwd Functions-Footnote-1660890 +Node: Group Functions660978 +Ref: Group Functions-Footnote-1668881 +Node: Walking Arrays669094 +Node: Library Functions Summary670697 +Node: Library Exercises672098 +Node: Sample Programs673378 +Node: Running Examples674148 +Node: Clones674876 +Node: Cut Program676100 +Node: Egrep Program685830 +Ref: Egrep Program-Footnote-1693334 +Node: Id Program693444 +Node: Split Program697088 +Ref: Split Program-Footnote-1700534 +Node: Tee Program700662 +Node: Uniq Program703449 +Node: Wc Program710870 +Ref: Wc Program-Footnote-1715118 +Node: Miscellaneous Programs715210 +Node: Dupword Program716423 +Node: Alarm Program718454 +Node: Translate Program723258 +Ref: Translate Program-Footnote-1727822 +Node: Labels Program728092 +Ref: Labels Program-Footnote-1731441 +Node: Word Sorting731525 +Node: History Sorting735595 +Node: Extract Program737431 +Node: Simple Sed744963 +Node: Igawk Program748025 +Ref: Igawk Program-Footnote-1762351 +Ref: Igawk Program-Footnote-2762552 +Ref: Igawk Program-Footnote-3762674 +Node: Anagram Program762789 +Node: Signature Program765851 +Node: Programs Summary767098 +Node: Programs Exercises768291 +Ref: Programs Exercises-Footnote-1772422 +Node: Advanced Features772513 +Node: Nondecimal Data774461 +Node: Array Sorting776051 +Node: Controlling Array Traversal776748 +Ref: Controlling Array Traversal-Footnote-1785079 +Node: Array Sorting Functions785197 +Ref: Array Sorting Functions-Footnote-1789089 +Node: Two-way I/O789283 +Ref: Two-way I/O-Footnote-1794227 +Ref: Two-way I/O-Footnote-2794413 +Node: TCP/IP Networking794495 +Node: Profiling797367 +Node: Advanced Features Summary804911 +Node: Internationalization806844 +Node: I18N and L10N808324 +Node: Explaining gettext809010 +Ref: Explaining gettext-Footnote-1814039 +Ref: Explaining gettext-Footnote-2814223 +Node: Programmer i18n814388 +Ref: Programmer i18n-Footnote-1819254 +Node: Translator i18n819303 +Node: String Extraction820097 +Ref: String Extraction-Footnote-1821228 +Node: Printf Ordering821314 +Ref: Printf Ordering-Footnote-1824100 +Node: I18N Portability824164 +Ref: I18N Portability-Footnote-1826613 +Node: I18N Example826676 +Ref: I18N Example-Footnote-1829476 +Node: Gawk I18N829548 +Node: I18N Summary830186 +Node: Debugger831525 +Node: Debugging832547 +Node: Debugging Concepts832988 +Node: Debugging Terms834845 +Node: Awk Debugging837420 +Node: Sample Debugging Session838312 +Node: Debugger Invocation838832 +Node: Finding The Bug840216 +Node: List of Debugger Commands846691 +Node: Breakpoint Control848023 +Node: Debugger Execution Control851715 +Node: Viewing And Changing Data855079 +Node: Execution Stack858444 +Node: Debugger Info860082 +Node: Miscellaneous Debugger Commands864099 +Node: Readline Support869291 +Node: Limitations870183 +Node: Debugging Summary872280 +Node: Arbitrary Precision Arithmetic873448 +Node: Computer Arithmetic874864 +Ref: table-numeric-ranges878465 +Ref: Computer Arithmetic-Footnote-1879324 +Node: Math Definitions879381 +Ref: table-ieee-formats882668 +Ref: Math Definitions-Footnote-1883272 +Node: MPFR features883377 +Node: FP Math Caution885048 +Ref: FP Math Caution-Footnote-1886098 +Node: Inexactness of computations886467 +Node: Inexact representation887415 +Node: Comparing FP Values888770 +Node: Errors accumulate889843 +Node: Getting Accuracy891276 +Node: Try To Round893935 +Node: Setting precision894834 +Ref: table-predefined-precision-strings895518 +Node: Setting the rounding mode897312 +Ref: table-gawk-rounding-modes897676 +Ref: Setting the rounding mode-Footnote-1901130 +Node: Arbitrary Precision Integers901309 +Ref: Arbitrary Precision Integers-Footnote-1904300 +Node: POSIX Floating Point Problems904449 +Ref: POSIX Floating Point Problems-Footnote-1908325 +Node: Floating point summary908363 +Node: Dynamic Extensions910555 +Node: Extension Intro912107 +Node: Plugin License913373 +Node: Extension Mechanism Outline914170 +Ref: figure-load-extension914598 +Ref: figure-register-new-function916078 +Ref: figure-call-new-function917082 +Node: Extension API Description919068 +Node: Extension API Functions Introduction920518 +Node: General Data Types925354 +Ref: General Data Types-Footnote-1931041 +Node: Memory Allocation Functions931340 +Ref: Memory Allocation Functions-Footnote-1934170 +Node: Constructor Functions934266 +Node: Registration Functions936000 +Node: Extension Functions936685 +Node: Exit Callback Functions938981 +Node: Extension Version String940229 +Node: Input Parsers940879 +Node: Output Wrappers950694 +Node: Two-way processors955210 +Node: Printing Messages957414 +Ref: Printing Messages-Footnote-1958491 +Node: Updating `ERRNO'958643 +Node: Requesting Values959383 +Ref: table-value-types-returned960111 +Node: Accessing Parameters961069 +Node: Symbol Table Access962300 +Node: Symbol table by name962814 +Node: Symbol table by cookie964794 +Ref: Symbol table by cookie-Footnote-1968933 +Node: Cached values968996 +Ref: Cached values-Footnote-1972500 +Node: Array Manipulation972591 +Ref: Array Manipulation-Footnote-1973689 +Node: Array Data Types973728 +Ref: Array Data Types-Footnote-1976385 +Node: Array Functions976477 +Node: Flattening Arrays980331 +Node: Creating Arrays987218 +Node: Extension API Variables991985 +Node: Extension Versioning992621 +Node: Extension API Informational Variables994522 +Node: Extension API Boilerplate995610 +Node: Finding Extensions999426 +Node: Extension Example999986 +Node: Internal File Description1000758 +Node: Internal File Ops1004825 +Ref: Internal File Ops-Footnote-11016483 +Node: Using Internal File Ops1016623 +Ref: Using Internal File Ops-Footnote-11019006 +Node: Extension Samples1019279 +Node: Extension Sample File Functions1020803 +Node: Extension Sample Fnmatch1028405 +Node: Extension Sample Fork1029887 +Node: Extension Sample Inplace1031100 +Node: Extension Sample Ord1032775 +Node: Extension Sample Readdir1033611 +Ref: table-readdir-file-types1034487 +Node: Extension Sample Revout1035298 +Node: Extension Sample Rev2way1035889 +Node: Extension Sample Read write array1036630 +Node: Extension Sample Readfile1038569 +Node: Extension Sample Time1039664 +Node: Extension Sample API Tests1041013 +Node: gawkextlib1041504 +Node: Extension summary1044154 +Node: Extension Exercises1047836 +Node: Language History1048558 +Node: V7/SVR3.11050215 +Node: SVR41052396 +Node: POSIX1053841 +Node: BTL1055230 +Node: POSIX/GNU1055964 +Node: Feature History1061533 +Node: Common Extensions1074631 +Node: Ranges and Locales1075955 +Ref: Ranges and Locales-Footnote-11080594 +Ref: Ranges and Locales-Footnote-21080621 +Ref: Ranges and Locales-Footnote-31080855 +Node: Contributors1081076 +Node: History summary1086616 +Node: Installation1087985 +Node: Gawk Distribution1088941 +Node: Getting1089425 +Node: Extracting1090249 +Node: Distribution contents1091891 +Node: Unix Installation1097608 +Node: Quick Installation1098225 +Node: Additional Configuration Options1100656 +Node: Configuration Philosophy1102396 +Node: Non-Unix Installation1104747 +Node: PC Installation1105205 +Node: PC Binary Installation1106531 +Node: PC Compiling1108379 +Ref: PC Compiling-Footnote-11111400 +Node: PC Testing1111505 +Node: PC Using1112681 +Node: Cygwin1116796 +Node: MSYS1117619 +Node: VMS Installation1118117 +Node: VMS Compilation1118909 +Ref: VMS Compilation-Footnote-11120131 +Node: VMS Dynamic Extensions1120189 +Node: VMS Installation Details1121873 +Node: VMS Running1124125 +Node: VMS GNV1126966 +Node: VMS Old Gawk1127700 +Node: Bugs1128170 +Node: Other Versions1132074 +Node: Installation summary1138287 +Node: Notes1139343 +Node: Compatibility Mode1140208 +Node: Additions1140990 +Node: Accessing The Source1141915 +Node: Adding Code1143351 +Node: New Ports1149523 +Node: Derived Files1154005 +Ref: Derived Files-Footnote-11159480 +Ref: Derived Files-Footnote-21159514 +Ref: Derived Files-Footnote-31160110 +Node: Future Extensions1160224 +Node: Implementation Limitations1160830 +Node: Extension Design1162078 +Node: Old Extension Problems1163232 +Ref: Old Extension Problems-Footnote-11164749 +Node: Extension New Mechanism Goals1164806 +Ref: Extension New Mechanism Goals-Footnote-11168166 +Node: Extension Other Design Decisions1168355 +Node: Extension Future Growth1170463 +Node: Old Extension Mechanism1171299 +Node: Notes summary1173061 +Node: Basic Concepts1174247 +Node: Basic High Level1174928 +Ref: figure-general-flow1175200 +Ref: figure-process-flow1175799 +Ref: Basic High Level-Footnote-11179028 +Node: Basic Data Typing1179213 +Node: Glossary1182541 +Node: Copying1207699 +Node: GNU Free Documentation License1245255 +Node: Index1270391  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 1389079d..ba56ddef 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -3824,7 +3824,8 @@ names like @code{i}, @code{j}, etc.) @cindex @command{awk} debugging, enabling Enable debugging of @command{awk} programs (@pxref{Debugging}). -By default, the debugger reads commands interactively from the keyboard. +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. No space is allowed between the @option{-D} and @var{file}, if @@ -39871,6 +39872,11 @@ originally written by Steven R.@: Bourne at Bell Laboratories. Many shells (Bash, @command{ksh}, @command{pdksh}, @command{zsh}) are generally upwardly compatible with the Bourne shell. +@item Braces +The characters @samp{@{} and @samp{@}}. Braces are used in +@command{awk} for delimiting actions, compound statements, and function +bodies. + @item Built-in Function The @command{awk} language provides built-in functions that perform various numerical, I/O-related, and string computations. Examples are @@ -39916,11 +39922,6 @@ are the variables that have special meaning to @command{gawk}. Changing some of them affects @command{awk}'s running environment. (@xref{Built-in Variables}.) -@item Braces -The characters @samp{@{} and @samp{@}}. Braces are used in -@command{awk} for delimiting actions, compound statements, and function -bodies. - @item C The system programming language that most GNU software is written in. The @command{awk} programming language has C-like syntax, and this @value{DOCUMENT} diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 6d212f80..d8995415 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -3735,7 +3735,8 @@ names like @code{i}, @code{j}, etc.) @cindex @command{awk} debugging, enabling Enable debugging of @command{awk} programs (@pxref{Debugging}). -By default, the debugger reads commands interactively from the keyboard. +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. No space is allowed between the @option{-D} and @var{file}, if @@ -38965,6 +38966,11 @@ originally written by Steven R.@: Bourne at Bell Laboratories. Many shells (Bash, @command{ksh}, @command{pdksh}, @command{zsh}) are generally upwardly compatible with the Bourne shell. +@item Braces +The characters @samp{@{} and @samp{@}}. Braces are used in +@command{awk} for delimiting actions, compound statements, and function +bodies. + @item Built-in Function The @command{awk} language provides built-in functions that perform various numerical, I/O-related, and string computations. Examples are @@ -39010,11 +39016,6 @@ are the variables that have special meaning to @command{gawk}. Changing some of them affects @command{awk}'s running environment. (@xref{Built-in Variables}.) -@item Braces -The characters @samp{@{} and @samp{@}}. Braces are used in -@command{awk} for delimiting actions, compound statements, and function -bodies. - @item C The system programming language that most GNU software is written in. The @command{awk} programming language has C-like syntax, and this @value{DOCUMENT} -- cgit v1.2.3 From d8018f6f8957cb67920904f08377608a7cc78307 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 28 Oct 2014 21:28:21 +0200 Subject: Restore use of @sc in doc. --- doc/ChangeLog | 4 ++++ doc/gawk.texi | 38 ++++++++++++++++++-------------------- doc/gawktexi.in | 26 ++++++++++++-------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index c651be7c..8460104e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -4,6 +4,10 @@ * gawktexi.in: Ditto, and correctly place the "Braces" entry in the Glossary. Thanks to Antonio Colombo for that. + Unrelated: + + * gawktexi.in: Restore use of @sc. Karl fixed makeinfo. :-) + 2014-10-25 Arnold D. Robbins * gawktexi.in: Minor typo fixes. diff --git a/doc/gawk.texi b/doc/gawk.texi index ba56ddef..9e3d63d0 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -37,13 +37,11 @@ @ifnotdocbook @set BULLET @bullet{} @set MINUS @minus{} -@set NUL @sc{nul} @end ifnotdocbook @ifdocbook @set BULLET @set MINUS -@set NUL NUL @end ifdocbook @set xref-automatic-section-title @@ -5387,10 +5385,10 @@ with @samp{A}. @cindex POSIX @command{awk}, period (@code{.})@comma{} using In strict POSIX mode (@pxref{Options}), -@samp{.} does not match the @value{NUL} +@samp{.} does not match the @sc{nul} character, which is a character with all bits equal to zero. -Otherwise, @value{NUL} is just another character. Other versions of @command{awk} -may not be able to match the @value{NUL} character. +Otherwise, @sc{nul} is just another character. Other versions of @command{awk} +may not be able to match the @sc{nul} character. @cindex @code{[]} (square brackets), regexp operator @cindex square brackets (@code{[]}), regexp operator @@ -6540,7 +6538,7 @@ a value that you know doesn't occur in the input file. This is hard to do in a general way, such that a program always works for arbitrary input files. -You might think that for text files, the @value{NUL} character, which +You might think that for text files, the @sc{nul} character, which consists of a character with all bits equal to zero, is a good value to use for @code{RS} in this case: @@ -6549,23 +6547,23 @@ BEGIN @{ RS = "\0" @} # whole file becomes one record? @end example @cindex differences in @command{awk} and @command{gawk}, strings, storing -@command{gawk} in fact accepts this, and uses the @value{NUL} +@command{gawk} in fact accepts this, and uses the @sc{nul} character for the record separator. This works for certain special files, such as @file{/proc/environ} on -GNU/Linux systems, where the @value{NUL} character is in fact the record separator. +GNU/Linux systems, where the @sc{nul} character is in fact the record separator. However, this usage is @emph{not} portable to most other @command{awk} implementations. @cindex dark corner, strings, storing Almost all other @command{awk} implementations@footnote{At least that we know about.} store strings internally as C-style strings. C strings use the -@value{NUL} character as the string terminator. In effect, this means that +@sc{nul} character as the string terminator. In effect, this means that @samp{RS = "\0"} is the same as @samp{RS = ""}. @value{DARKCORNER} -It happens that recent versions of @command{mawk} can use the @value{NUL} +It happens that recent versions of @command{mawk} can use the @sc{nul} character as a record separator. However, this is a special case: -@command{mawk} does not allow embedded @value{NUL} characters in strings. +@command{mawk} does not allow embedded @sc{nul} characters in strings. (This may change in a future version of @command{mawk}.) @cindex records, treating files as @@ -6591,7 +6589,7 @@ a value that you know doesn't occur in the input file. This is hard to do in a general way, such that a program always works for arbitrary input files. -You might think that for text files, the @value{NUL} character, which +You might think that for text files, the @sc{nul} character, which consists of a character with all bits equal to zero, is a good value to use for @code{RS} in this case: @@ -6600,23 +6598,23 @@ BEGIN @{ RS = "\0" @} # whole file becomes one record? @end example @cindex differences in @command{awk} and @command{gawk}, strings, storing -@command{gawk} in fact accepts this, and uses the @value{NUL} +@command{gawk} in fact accepts this, and uses the @sc{nul} character for the record separator. This works for certain special files, such as @file{/proc/environ} on -GNU/Linux systems, where the @value{NUL} character is in fact the record separator. +GNU/Linux systems, where the @sc{nul} character is in fact the record separator. However, this usage is @emph{not} portable to most other @command{awk} implementations. @cindex dark corner, strings, storing Almost all other @command{awk} implementations@footnote{At least that we know about.} store strings internally as C-style strings. C strings use the -@value{NUL} character as the string terminator. In effect, this means that +@sc{nul} character as the string terminator. In effect, this means that @samp{RS = "\0"} is the same as @samp{RS = ""}. @value{DARKCORNER} -It happens that recent versions of @command{mawk} can use the @value{NUL} +It happens that recent versions of @command{mawk} can use the @sc{nul} character as a record separator. However, this is a special case: -@command{mawk} does not allow embedded @value{NUL} characters in strings. +@command{mawk} does not allow embedded @sc{nul} characters in strings. (This may change in a future version of @command{mawk}.) @cindex records, treating files as @@ -10563,7 +10561,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 @value{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. @@ -31570,7 +31568,7 @@ and is managed by @command{gawk} from then on. The API defines several simple @code{struct}s that map values as seen from @command{awk}. A value can be a @code{double}, a string, or an array (as in multidimensional arrays, or when creating a new array). -String values maintain both pointer and length since embedded @value{NUL} +String values maintain both pointer and length since embedded @sc{nul} characters are allowed. @quotation NOTE @@ -31702,7 +31700,7 @@ Scalar values in @command{awk} are either numbers or strings. The indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings -require more work. Since @command{gawk} allows embedded @value{NUL} bytes +require more work. Since @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a data-pointer and length. This is the @code{awk_string_t} type. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index d8995415..2599b8ca 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -32,13 +32,11 @@ @ifnotdocbook @set BULLET @bullet{} @set MINUS @minus{} -@set NUL @sc{nul} @end ifnotdocbook @ifdocbook @set BULLET @set MINUS -@set NUL NUL @end ifdocbook @set xref-automatic-section-title @@ -5215,10 +5213,10 @@ with @samp{A}. @cindex POSIX @command{awk}, period (@code{.})@comma{} using In strict POSIX mode (@pxref{Options}), -@samp{.} does not match the @value{NUL} +@samp{.} does not match the @sc{nul} character, which is a character with all bits equal to zero. -Otherwise, @value{NUL} is just another character. Other versions of @command{awk} -may not be able to match the @value{NUL} character. +Otherwise, @sc{nul} is just another character. Other versions of @command{awk} +may not be able to match the @sc{nul} character. @cindex @code{[]} (square brackets), regexp operator @cindex square brackets (@code{[]}), regexp operator @@ -6319,7 +6317,7 @@ a value that you know doesn't occur in the input file. This is hard to do in a general way, such that a program always works for arbitrary input files. -You might think that for text files, the @value{NUL} character, which +You might think that for text files, the @sc{nul} character, which consists of a character with all bits equal to zero, is a good value to use for @code{RS} in this case: @@ -6328,23 +6326,23 @@ BEGIN @{ RS = "\0" @} # whole file becomes one record? @end example @cindex differences in @command{awk} and @command{gawk}, strings, storing -@command{gawk} in fact accepts this, and uses the @value{NUL} +@command{gawk} in fact accepts this, and uses the @sc{nul} character for the record separator. This works for certain special files, such as @file{/proc/environ} on -GNU/Linux systems, where the @value{NUL} character is in fact the record separator. +GNU/Linux systems, where the @sc{nul} character is in fact the record separator. However, this usage is @emph{not} portable to most other @command{awk} implementations. @cindex dark corner, strings, storing Almost all other @command{awk} implementations@footnote{At least that we know about.} store strings internally as C-style strings. C strings use the -@value{NUL} character as the string terminator. In effect, this means that +@sc{nul} character as the string terminator. In effect, this means that @samp{RS = "\0"} is the same as @samp{RS = ""}. @value{DARKCORNER} -It happens that recent versions of @command{mawk} can use the @value{NUL} +It happens that recent versions of @command{mawk} can use the @sc{nul} character as a record separator. However, this is a special case: -@command{mawk} does not allow embedded @value{NUL} characters in strings. +@command{mawk} does not allow embedded @sc{nul} characters in strings. (This may change in a future version of @command{mawk}.) @cindex records, treating files as @@ -10061,7 +10059,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 @value{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. @@ -30664,7 +30662,7 @@ and is managed by @command{gawk} from then on. The API defines several simple @code{struct}s that map values as seen from @command{awk}. A value can be a @code{double}, a string, or an array (as in multidimensional arrays, or when creating a new array). -String values maintain both pointer and length since embedded @value{NUL} +String values maintain both pointer and length since embedded @sc{nul} characters are allowed. @quotation NOTE @@ -30796,7 +30794,7 @@ Scalar values in @command{awk} are either numbers or strings. The indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings -require more work. Since @command{gawk} allows embedded @value{NUL} bytes +require more work. Since @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a data-pointer and length. This is the @code{awk_string_t} type. -- cgit v1.2.3 From 3b13df110f42b26417de73151eb4a03657e85de4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 29 Oct 2014 21:14:17 +0200 Subject: Sync dfa with grep. --- ChangeLog | 4 ++++ dfa.c | 61 ++++++++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 178e45fc..34554e22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-10-29 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. Again, again. + 2014-10-28 Arnold D. Robbins * dfa.c: Sync with GNU grep. Again. diff --git a/dfa.c b/dfa.c index c299da1e..e658ad8a 100644 --- a/dfa.c +++ b/dfa.c @@ -1317,6 +1317,20 @@ parse_bracket_exp (void) return CSET + charclass_index (ccl); } +#define PUSH_LEX_STATE(s) \ + do \ + { \ + char const *lexptr_saved = lexptr; \ + size_t lexleft_saved = lexleft; \ + lexptr = (s); \ + lexleft = strlen (lexptr) + +#define POP_LEX_STATE() \ + lexptr = lexptr_saved; \ + lexleft = lexleft_saved; \ + } \ + while (0) + static token lex (void) { @@ -1564,20 +1578,6 @@ lex (void) return lasttok = CSET + charclass_index (ccl); } -#define PUSH_LEX_STATE(s) \ - do \ - { \ - char const *lexptr_saved = lexptr; \ - size_t lexleft_saved = lexleft; \ - lexptr = (s); \ - lexleft = strlen (lexptr) - -#define POP_LEX_STATE() \ - lexptr = lexptr_saved; \ - lexleft = lexleft_saved; \ - } \ - while (0) - /* FIXME: see if optimizing this, as is done with ANYCHAR and add_utf8_anychar, makes sense. */ @@ -1597,14 +1597,33 @@ lex (void) case 'W': if (!backslash || (syntax_bits & RE_NO_GNU_OPS)) goto normal_char; - zeroset (ccl); - for (c2 = 0; c2 < NOTCHAR; ++c2) - if (IS_WORD_CONSTITUENT (c2)) - setbit (c2, ccl); - if (c == 'W') - notset (ccl); + + if (!dfa->multibyte) + { + zeroset (ccl); + for (c2 = 0; c2 < NOTCHAR; ++c2) + if (IS_WORD_CONSTITUENT (c2)) + setbit (c2, ccl); + if (c == 'W') + notset (ccl); + laststart = false; + return lasttok = CSET + charclass_index (ccl); + } + + /* FIXME: see if optimizing this, as is done with ANYCHAR and + add_utf8_anychar, makes sense. */ + + /* \w and \W are documented to be equivalent to [_[:alnum:]] and + [^_[:alnum:]] respectively, so tell the lexer to process those + strings, each minus its "already processed" '['. */ + PUSH_LEX_STATE (c == 'w' ? "_[:alnum:]]" : "^_[:alnum:]]"); + + lasttok = parse_bracket_exp (); + + POP_LEX_STATE (); + laststart = false; - return lasttok = CSET + charclass_index (ccl); + return lasttok; case '[': if (backslash) -- cgit v1.2.3 From 22e694149f4ffb9118de16127169ca80b26137d3 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Wed, 29 Oct 2014 21:52:41 -0400 Subject: Add extras directory with shell startup files containing path manipulation functions. --- ChangeLog | 6 + Makefile.am | 1 + Makefile.in | 1 + configure | 3 +- configure.ac | 1 + doc/gawk.info | 1170 +++++++++++++++++++++++++++------------------------- doc/gawk.texi | 52 +++ doc/gawktexi.in | 52 +++ extras/ChangeLog | 3 + extras/Makefile.am | 29 ++ extras/Makefile.in | 515 +++++++++++++++++++++++ extras/gawk.csh | 11 + extras/gawk.sh | 31 ++ 13 files changed, 1317 insertions(+), 558 deletions(-) create mode 100644 extras/ChangeLog create mode 100644 extras/Makefile.am create mode 100644 extras/Makefile.in create mode 100644 extras/gawk.csh create mode 100644 extras/gawk.sh diff --git a/ChangeLog b/ChangeLog index c0bafc15..8ea3992b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-10-29 Andrew J. Schorr + + * configure.ac (AC_CONFIG_FILES): Add extras/Makefile. + * Makefile.am (SUBDIRS): Add extras. + * extras: Add new subdirectory. + 2014-10-29 Arnold D. Robbins * dfa.c: Sync with GNU grep. Again, again. diff --git a/Makefile.am b/Makefile.am index 3d1c8837..afe617ed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,6 +69,7 @@ SUBDIRS = \ awklib \ po \ extension \ + extras \ test # what to make and install diff --git a/Makefile.in b/Makefile.in index 5c2a7f11..16d19b02 100644 --- a/Makefile.in +++ b/Makefile.in @@ -475,6 +475,7 @@ SUBDIRS = \ awklib \ po \ extension \ + extras \ test include_HEADERS = gawkapi.h diff --git a/configure b/configure index cb2e6ba7..fcda0c11 100755 --- a/configure +++ b/configure @@ -10965,7 +10965,7 @@ dylib) GAWKLIBEXT=so ;; # MacOS uses .dylib for shared libraries, but libtool us esac -ac_config_files="$ac_config_files Makefile awklib/Makefile doc/Makefile po/Makefile.in test/Makefile" +ac_config_files="$ac_config_files Makefile awklib/Makefile doc/Makefile extras/Makefile po/Makefile.in test/Makefile" if test "x$enable_extensions" = "xyes"; then @@ -11721,6 +11721,7 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "awklib/Makefile") CONFIG_FILES="$CONFIG_FILES awklib/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "extras/Makefile") CONFIG_FILES="$CONFIG_FILES extras/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; diff --git a/configure.ac b/configure.ac index 6122ee07..a8711c5a 100644 --- a/configure.ac +++ b/configure.ac @@ -402,6 +402,7 @@ AC_SUBST(GAWKLIBEXT) AC_CONFIG_FILES(Makefile awklib/Makefile doc/Makefile + extras/Makefile po/Makefile.in test/Makefile) if test "x$enable_extensions" = "xyes"; then diff --git a/doc/gawk.info b/doc/gawk.info index 2be2c24f..ae3c6f8c 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -615,6 +615,7 @@ entitled "GNU Free Documentation License". * Unix Installation:: Installing `gawk' under various versions of Unix. * Quick Installation:: Compiling `gawk' under Unix. +* Shell Startup Files:: Shell convenience functions. * Additional Configuration Options:: Other compile-time options. * Configuration Philosophy:: How it's all supposed to work. * Non-Unix Installation:: Installation on Other Operating @@ -2918,6 +2919,9 @@ Since `.' is included at the beginning, `gawk' searches first in the current directory and then in `/usr/local/share/awk'. In practice, this means that you will rarely need to change the value of `AWKPATH'. + *Note Shell Startup Files::, for information on functions that help +to manipulate the `AWKPATH' variable. + `gawk' places the value of the search path that it used into `ENVIRON["AWKPATH"]'. This provides access to the actual search path value from within an `awk' program. @@ -2957,6 +2961,9 @@ empty value, `gawk' uses a default path; this is typically `/usr/local/lib/gawk', although it can vary depending upon how `gawk' was built. + *Note Shell Startup Files::, for information on functions that help +to manipulate the `AWKLIBPATH' variable. + `gawk' places the value of the search path that it used into `ENVIRON["AWKLIBPATH"]'. This provides access to the actual search path value from within an `awk' program. @@ -27468,6 +27475,13 @@ Various `.c', `.y', and `.h' files sample extensions included with `gawk'. *Note Dynamic Extensions::, for more information. +`extras/*' + Additional non-essential files. Currently, this directory + contains some shell startup files to be installed in + `/etc/profile.d' to aid in manipulating the `AWKPATH' and + `AWKLIBPATH' environment variables. *Note Shell Startup Files::, + for more information. + `posix/*' Files needed for building `gawk' on POSIX-compliant systems. @@ -27498,11 +27512,12 @@ configure `gawk' for your system yourself. * Menu: * Quick Installation:: Compiling `gawk' under Unix. +* Shell Startup Files:: Shell convenience functions. * Additional Configuration Options:: Other compile-time options. * Configuration Philosophy:: How it's all supposed to work.  -File: gawk.info, Node: Quick Installation, Next: Additional Configuration Options, Up: Unix Installation +File: gawk.info, Node: Quick Installation, Next: Shell Startup Files, Up: Unix Installation B.2.1 Compiling `gawk' for Unix-like Systems -------------------------------------------- @@ -27559,9 +27574,43 @@ will be asked for your password, and you will have to have been set up previously as a user who is allowed to run the `sudo' command.  -File: gawk.info, Node: Additional Configuration Options, Next: Configuration Philosophy, Prev: Quick Installation, Up: Unix Installation +File: gawk.info, Node: Shell Startup Files, Next: Additional Configuration Options, Prev: Quick Installation, Up: Unix Installation + +B.2.2 Shell Startup Files +------------------------- + +The distribution contains shell startup files `gawk.sh' and `gawk.csh' +containing functions to aid in manipulating the `AWKPATH' and +`AWKLIBPATH' environment variables. On a Fedora system, these files +should be installed in `/etc/profile.d'; on other platforms, the +appropriate location may be different. + +`gawkpath_default' + Reset the `AWKPATH' environment variable to its default value. + +`gawkpath_prepend' + Add the argument to the front of the `AWKPATH' environment + variable. + +`gawkpath_append' + Add the argument to the end of the `AWKPATH' environment variable. + +`gawklibpath_default' + Reset the `AWKLIBPATH' environment variable to its default value. + +`gawklibpath_prepend' + Add the argument to the front of the `AWKLIBPATH' environment + variable. + +`gawklibpath_append' + Add the argument to the end of the `AWKLIBPATH' environment + variable. + + + +File: gawk.info, Node: Additional Configuration Options, Next: Configuration Philosophy, Prev: Shell Startup Files, Up: Unix Installation -B.2.2 Additional Configuration Options +B.2.3 Additional Configuration Options -------------------------------------- There are several additional options you may use on the `configure' @@ -27603,7 +27652,7 @@ that `configure' supplies.  File: gawk.info, Node: Configuration Philosophy, Prev: Additional Configuration Options, Up: Unix Installation -B.2.3 The Configuration Process +B.2.4 The Configuration Process ------------------------------- This minor node is of interest only if you know something about using @@ -32910,6 +32959,12 @@ Index (line 63) * gawkextlib: gawkextlib. (line 6) * gawkextlib project: gawkextlib. (line 6) +* gawklibpath_append shell function: Shell Startup Files. (line 29) +* gawklibpath_default shell function: Shell Startup Files. (line 22) +* gawklibpath_prepend shell function: Shell Startup Files. (line 25) +* 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, See GPL: Manual History. (line 11) * generate time values: Time Functions. (line 25) @@ -34377,558 +34432,559 @@ Index  Tag Table: Node: Top1204 -Node: Foreword342156 -Node: Foreword446548 -Node: Preface47982 -Ref: Preface-Footnote-150853 -Ref: Preface-Footnote-250960 -Ref: Preface-Footnote-351193 -Node: History51335 -Node: Names53683 -Ref: Names-Footnote-154777 -Node: This Manual54923 -Ref: This Manual-Footnote-160752 -Node: Conventions60852 -Node: Manual History63192 -Ref: Manual History-Footnote-166183 -Ref: Manual History-Footnote-266224 -Node: How To Contribute66298 -Node: Acknowledgments67537 -Node: Getting Started72345 -Node: Running gawk74779 -Node: One-shot75969 -Node: Read Terminal77194 -Node: Long79221 -Node: Executable Scripts80737 -Ref: Executable Scripts-Footnote-183526 -Node: Comments83628 -Node: Quoting86101 -Node: DOS Quoting91607 -Node: Sample Data Files92282 -Node: Very Simple94875 -Node: Two Rules99766 -Node: More Complex101652 -Node: Statements/Lines104514 -Ref: Statements/Lines-Footnote-1108970 -Node: Other Features109235 -Node: When110166 -Ref: When-Footnote-1111922 -Node: Intro Summary111987 -Node: Invoking Gawk112870 -Node: Command Line114385 -Node: Options115176 -Ref: Options-Footnote-1130959 -Node: Other Arguments130984 -Node: Naming Standard Input133945 -Node: Environment Variables135038 -Node: AWKPATH Variable135596 -Ref: AWKPATH Variable-Footnote-1138896 -Ref: AWKPATH Variable-Footnote-2138941 -Node: AWKLIBPATH Variable139201 -Node: Other Environment Variables140344 -Node: Exit Status143835 -Node: Include Files144510 -Node: Loading Shared Libraries148098 -Node: Obsolete149525 -Node: Undocumented150222 -Node: Invoking Summary150489 -Node: Regexp152155 -Node: Regexp Usage153614 -Node: Escape Sequences155647 -Node: Regexp Operators161895 -Ref: Regexp Operators-Footnote-1169329 -Ref: Regexp Operators-Footnote-2169476 -Node: Bracket Expressions169574 -Ref: table-char-classes171591 -Node: Leftmost Longest174531 -Node: Computed Regexps175833 -Node: GNU Regexp Operators179230 -Node: Case-sensitivity182932 -Ref: Case-sensitivity-Footnote-1185822 -Ref: Case-sensitivity-Footnote-2186057 -Node: Regexp Summary186165 -Node: Reading Files187634 -Node: Records189728 -Node: awk split records190460 -Node: gawk split records195374 -Ref: gawk split records-Footnote-1199913 -Node: Fields199950 -Ref: Fields-Footnote-1202748 -Node: Nonconstant Fields202834 -Ref: Nonconstant Fields-Footnote-1205070 -Node: Changing Fields205272 -Node: Field Separators211204 -Node: Default Field Splitting213908 -Node: Regexp Field Splitting215025 -Node: Single Character Fields218375 -Node: Command Line Field Separator219434 -Node: Full Line Fields222646 -Ref: Full Line Fields-Footnote-1223154 -Node: Field Splitting Summary223200 -Ref: Field Splitting Summary-Footnote-1226331 -Node: Constant Size226432 -Node: Splitting By Content231038 -Ref: Splitting By Content-Footnote-1235111 -Node: Multiple Line235151 -Ref: Multiple Line-Footnote-1241040 -Node: Getline241219 -Node: Plain Getline243430 -Node: Getline/Variable246070 -Node: Getline/File247217 -Node: Getline/Variable/File248601 -Ref: Getline/Variable/File-Footnote-1250202 -Node: Getline/Pipe250289 -Node: Getline/Variable/Pipe252972 -Node: Getline/Coprocess254103 -Node: Getline/Variable/Coprocess255355 -Node: Getline Notes256094 -Node: Getline Summary258886 -Ref: table-getline-variants259298 -Node: Read Timeout260127 -Ref: Read Timeout-Footnote-1263941 -Node: Command-line directories263999 -Node: Input Summary264903 -Node: Input Exercises268155 -Node: Printing268883 -Node: Print270660 -Node: Print Examples272117 -Node: Output Separators274896 -Node: OFMT276914 -Node: Printf278268 -Node: Basic Printf279053 -Node: Control Letters280624 -Node: Format Modifiers284608 -Node: Printf Examples290615 -Node: Redirection293097 -Node: Special FD299936 -Ref: Special FD-Footnote-1303093 -Node: Special Files303167 -Node: Other Inherited Files303783 -Node: Special Network304783 -Node: Special Caveats305644 -Node: Close Files And Pipes306595 -Ref: Close Files And Pipes-Footnote-1313774 -Ref: Close Files And Pipes-Footnote-2313922 -Node: Output Summary314072 -Node: Output Exercises315068 -Node: Expressions315748 -Node: Values316933 -Node: Constants317609 -Node: Scalar Constants318289 -Ref: Scalar Constants-Footnote-1319148 -Node: Nondecimal-numbers319398 -Node: Regexp Constants322398 -Node: Using Constant Regexps322923 -Node: Variables326061 -Node: Using Variables326716 -Node: Assignment Options328626 -Node: Conversion330501 -Node: Strings And Numbers331025 -Ref: Strings And Numbers-Footnote-1334089 -Node: Locale influences conversions334198 -Ref: table-locale-affects336943 -Node: All Operators337531 -Node: Arithmetic Ops338161 -Node: Concatenation340666 -Ref: Concatenation-Footnote-1343485 -Node: Assignment Ops343591 -Ref: table-assign-ops348574 -Node: Increment Ops349852 -Node: Truth Values and Conditions353290 -Node: Truth Values354373 -Node: Typing and Comparison355422 -Node: Variable Typing356215 -Node: Comparison Operators359867 -Ref: table-relational-ops360277 -Node: POSIX String Comparison363792 -Ref: POSIX String Comparison-Footnote-1364864 -Node: Boolean Ops365002 -Ref: Boolean Ops-Footnote-1369481 -Node: Conditional Exp369572 -Node: Function Calls371299 -Node: Precedence375179 -Node: Locales378847 -Node: Expressions Summary380478 -Node: Patterns and Actions383052 -Node: Pattern Overview384172 -Node: Regexp Patterns385851 -Node: Expression Patterns386394 -Node: Ranges390174 -Node: BEGIN/END393280 -Node: Using BEGIN/END394042 -Ref: Using BEGIN/END-Footnote-1396779 -Node: I/O And BEGIN/END396885 -Node: BEGINFILE/ENDFILE399199 -Node: Empty402100 -Node: Using Shell Variables402417 -Node: Action Overview404693 -Node: Statements407020 -Node: If Statement408868 -Node: While Statement410366 -Node: Do Statement412394 -Node: For Statement413536 -Node: Switch Statement416691 -Node: Break Statement419079 -Node: Continue Statement421120 -Node: Next Statement422945 -Node: Nextfile Statement425325 -Node: Exit Statement427955 -Node: Built-in Variables430358 -Node: User-modified431491 -Ref: User-modified-Footnote-1439171 -Node: Auto-set439233 -Ref: Auto-set-Footnote-1452600 -Ref: Auto-set-Footnote-2452805 -Node: ARGC and ARGV452861 -Node: Pattern Action Summary457065 -Node: Arrays459492 -Node: Array Basics460821 -Node: Array Intro461665 -Ref: figure-array-elements463629 -Ref: Array Intro-Footnote-1466153 -Node: Reference to Elements466281 -Node: Assigning Elements468731 -Node: Array Example469222 -Node: Scanning an Array470980 -Node: Controlling Scanning473996 -Ref: Controlling Scanning-Footnote-1479185 -Node: Numeric Array Subscripts479501 -Node: Uninitialized Subscripts481686 -Node: Delete483303 -Ref: Delete-Footnote-1486047 -Node: Multidimensional486104 -Node: Multiscanning489199 -Node: Arrays of Arrays490788 -Node: Arrays Summary495549 -Node: Functions497654 -Node: Built-in498527 -Node: Calling Built-in499605 -Node: Numeric Functions501593 -Ref: Numeric Functions-Footnote-1506417 -Ref: Numeric Functions-Footnote-2506774 -Ref: Numeric Functions-Footnote-3506822 -Node: String Functions507091 -Ref: String Functions-Footnote-1530563 -Ref: String Functions-Footnote-2530692 -Ref: String Functions-Footnote-3530940 -Node: Gory Details531027 -Ref: table-sub-escapes532808 -Ref: table-sub-proposed534328 -Ref: table-posix-sub535692 -Ref: table-gensub-escapes537232 -Ref: Gory Details-Footnote-1538064 -Node: I/O Functions538215 -Ref: I/O Functions-Footnote-1545316 -Node: Time Functions545463 -Ref: Time Functions-Footnote-1555932 -Ref: Time Functions-Footnote-2556000 -Ref: Time Functions-Footnote-3556158 -Ref: Time Functions-Footnote-4556269 -Ref: Time Functions-Footnote-5556381 -Ref: Time Functions-Footnote-6556608 -Node: Bitwise Functions556874 -Ref: table-bitwise-ops557436 -Ref: Bitwise Functions-Footnote-1561744 -Node: Type Functions561913 -Node: I18N Functions563062 -Node: User-defined564707 -Node: Definition Syntax565511 -Ref: Definition Syntax-Footnote-1570917 -Node: Function Example570986 -Ref: Function Example-Footnote-1573903 -Node: Function Caveats573925 -Node: Calling A Function574443 -Node: Variable Scope575398 -Node: Pass By Value/Reference578386 -Node: Return Statement581896 -Node: Dynamic Typing584880 -Node: Indirect Calls585809 -Ref: Indirect Calls-Footnote-1597113 -Node: Functions Summary597241 -Node: Library Functions599940 -Ref: Library Functions-Footnote-1603558 -Ref: Library Functions-Footnote-2603701 -Node: Library Names603872 -Ref: Library Names-Footnote-1607332 -Ref: Library Names-Footnote-2607552 -Node: General Functions607638 -Node: Strtonum Function608741 -Node: Assert Function611761 -Node: Round Function615085 -Node: Cliff Random Function616626 -Node: Ordinal Functions617642 -Ref: Ordinal Functions-Footnote-1620707 -Ref: Ordinal Functions-Footnote-2620959 -Node: Join Function621170 -Ref: Join Function-Footnote-1622941 -Node: Getlocaltime Function623141 -Node: Readfile Function626882 -Node: Shell Quoting628852 -Node: Data File Management630253 -Node: Filetrans Function630885 -Node: Rewind Function634944 -Node: File Checking636329 -Ref: File Checking-Footnote-1637657 -Node: Empty Files637858 -Node: Ignoring Assigns639837 -Node: Getopt Function641388 -Ref: Getopt Function-Footnote-1652848 -Node: Passwd Functions653051 -Ref: Passwd Functions-Footnote-1661902 -Node: Group Functions661990 -Ref: Group Functions-Footnote-1669893 -Node: Walking Arrays670106 -Node: Library Functions Summary671709 -Node: Library Exercises673110 -Node: Sample Programs674390 -Node: Running Examples675160 -Node: Clones675888 -Node: Cut Program677112 -Node: Egrep Program686842 -Ref: Egrep Program-Footnote-1694346 -Node: Id Program694456 -Node: Split Program698100 -Ref: Split Program-Footnote-1701546 -Node: Tee Program701674 -Node: Uniq Program704461 -Node: Wc Program711882 -Ref: Wc Program-Footnote-1716130 -Node: Miscellaneous Programs716222 -Node: Dupword Program717435 -Node: Alarm Program719466 -Node: Translate Program724270 -Ref: Translate Program-Footnote-1728834 -Node: Labels Program729104 -Ref: Labels Program-Footnote-1732453 -Node: Word Sorting732537 -Node: History Sorting736607 -Node: Extract Program738443 -Node: Simple Sed745975 -Node: Igawk Program749037 -Ref: Igawk Program-Footnote-1763363 -Ref: Igawk Program-Footnote-2763564 -Ref: Igawk Program-Footnote-3763686 -Node: Anagram Program763801 -Node: Signature Program766863 -Node: Programs Summary768110 -Node: Programs Exercises769303 -Ref: Programs Exercises-Footnote-1773434 -Node: Advanced Features773525 -Node: Nondecimal Data775473 -Node: Array Sorting777063 -Node: Controlling Array Traversal777760 -Ref: Controlling Array Traversal-Footnote-1786091 -Node: Array Sorting Functions786209 -Ref: Array Sorting Functions-Footnote-1790101 -Node: Two-way I/O790295 -Ref: Two-way I/O-Footnote-1795239 -Ref: Two-way I/O-Footnote-2795425 -Node: TCP/IP Networking795507 -Node: Profiling798379 -Node: Advanced Features Summary806653 -Node: Internationalization808586 -Node: I18N and L10N810066 -Node: Explaining gettext810752 -Ref: Explaining gettext-Footnote-1815781 -Ref: Explaining gettext-Footnote-2815965 -Node: Programmer i18n816130 -Ref: Programmer i18n-Footnote-1820996 -Node: Translator i18n821045 -Node: String Extraction821839 -Ref: String Extraction-Footnote-1822970 -Node: Printf Ordering823056 -Ref: Printf Ordering-Footnote-1825842 -Node: I18N Portability825906 -Ref: I18N Portability-Footnote-1828355 -Node: I18N Example828418 -Ref: I18N Example-Footnote-1831218 -Node: Gawk I18N831290 -Node: I18N Summary831928 -Node: Debugger833267 -Node: Debugging834289 -Node: Debugging Concepts834730 -Node: Debugging Terms836587 -Node: Awk Debugging839162 -Node: Sample Debugging Session840054 -Node: Debugger Invocation840574 -Node: Finding The Bug841958 -Node: List of Debugger Commands848433 -Node: Breakpoint Control849765 -Node: Debugger Execution Control853457 -Node: Viewing And Changing Data856821 -Node: Execution Stack860186 -Node: Debugger Info861824 -Node: Miscellaneous Debugger Commands865841 -Node: Readline Support871033 -Node: Limitations871925 -Node: Debugging Summary874022 -Node: Arbitrary Precision Arithmetic875190 -Node: Computer Arithmetic876606 -Ref: table-numeric-ranges880207 -Ref: Computer Arithmetic-Footnote-1881066 -Node: Math Definitions881123 -Ref: table-ieee-formats884410 -Ref: Math Definitions-Footnote-1885014 -Node: MPFR features885119 -Node: FP Math Caution886790 -Ref: FP Math Caution-Footnote-1887840 -Node: Inexactness of computations888209 -Node: Inexact representation889157 -Node: Comparing FP Values890512 -Node: Errors accumulate891585 -Node: Getting Accuracy893018 -Node: Try To Round895677 -Node: Setting precision896576 -Ref: table-predefined-precision-strings897260 -Node: Setting the rounding mode899054 -Ref: table-gawk-rounding-modes899418 -Ref: Setting the rounding mode-Footnote-1902872 -Node: Arbitrary Precision Integers903051 -Ref: Arbitrary Precision Integers-Footnote-1907955 -Node: POSIX Floating Point Problems908104 -Ref: POSIX Floating Point Problems-Footnote-1911980 -Node: Floating point summary912018 -Node: Dynamic Extensions914210 -Node: Extension Intro915762 -Node: Plugin License917028 -Node: Extension Mechanism Outline917825 -Ref: figure-load-extension918253 -Ref: figure-register-new-function919733 -Ref: figure-call-new-function920737 -Node: Extension API Description922723 -Node: Extension API Functions Introduction924173 -Node: General Data Types929009 -Ref: General Data Types-Footnote-1934696 -Node: Memory Allocation Functions934995 -Ref: Memory Allocation Functions-Footnote-1937825 -Node: Constructor Functions937921 -Node: Registration Functions939655 -Node: Extension Functions940340 -Node: Exit Callback Functions942636 -Node: Extension Version String943884 -Node: Input Parsers944534 -Node: Output Wrappers954349 -Node: Two-way processors958865 -Node: Printing Messages961069 -Ref: Printing Messages-Footnote-1962146 -Node: Updating `ERRNO'962298 -Node: Requesting Values963038 -Ref: table-value-types-returned963766 -Node: Accessing Parameters964724 -Node: Symbol Table Access965955 -Node: Symbol table by name966469 -Node: Symbol table by cookie968449 -Ref: Symbol table by cookie-Footnote-1972588 -Node: Cached values972651 -Ref: Cached values-Footnote-1976155 -Node: Array Manipulation976246 -Ref: Array Manipulation-Footnote-1977344 -Node: Array Data Types977383 -Ref: Array Data Types-Footnote-1980040 -Node: Array Functions980132 -Node: Flattening Arrays983986 -Node: Creating Arrays990873 -Node: Extension API Variables995640 -Node: Extension Versioning996276 -Node: Extension API Informational Variables998177 -Node: Extension API Boilerplate999265 -Node: Finding Extensions1003081 -Node: Extension Example1003641 -Node: Internal File Description1004413 -Node: Internal File Ops1008480 -Ref: Internal File Ops-Footnote-11020138 -Node: Using Internal File Ops1020278 -Ref: Using Internal File Ops-Footnote-11022661 -Node: Extension Samples1022934 -Node: Extension Sample File Functions1024458 -Node: Extension Sample Fnmatch1032060 -Node: Extension Sample Fork1033542 -Node: Extension Sample Inplace1034755 -Node: Extension Sample Ord1036430 -Node: Extension Sample Readdir1037266 -Ref: table-readdir-file-types1038142 -Node: Extension Sample Revout1038953 -Node: Extension Sample Rev2way1039544 -Node: Extension Sample Read write array1040285 -Node: Extension Sample Readfile1042224 -Node: Extension Sample Time1043319 -Node: Extension Sample API Tests1044668 -Node: gawkextlib1045159 -Node: Extension summary1047809 -Node: Extension Exercises1051491 -Node: Language History1052213 -Node: V7/SVR3.11053870 -Node: SVR41056051 -Node: POSIX1057496 -Node: BTL1058885 -Node: POSIX/GNU1059619 -Node: Feature History1065248 -Node: Common Extensions1078346 -Node: Ranges and Locales1079670 -Ref: Ranges and Locales-Footnote-11084309 -Ref: Ranges and Locales-Footnote-21084336 -Ref: Ranges and Locales-Footnote-31084570 -Node: Contributors1084791 -Node: History summary1090331 -Node: Installation1091700 -Node: Gawk Distribution1092656 -Node: Getting1093140 -Node: Extracting1093964 -Node: Distribution contents1095606 -Node: Unix Installation1101376 -Node: Quick Installation1101993 -Node: Additional Configuration Options1104424 -Node: Configuration Philosophy1106164 -Node: Non-Unix Installation1108515 -Node: PC Installation1108973 -Node: PC Binary Installation1110299 -Node: PC Compiling1112147 -Ref: PC Compiling-Footnote-11115168 -Node: PC Testing1115273 -Node: PC Using1116449 -Node: Cygwin1120564 -Node: MSYS1121387 -Node: VMS Installation1121885 -Node: VMS Compilation1122677 -Ref: VMS Compilation-Footnote-11123899 -Node: VMS Dynamic Extensions1123957 -Node: VMS Installation Details1125641 -Node: VMS Running1127893 -Node: VMS GNV1130734 -Node: VMS Old Gawk1131468 -Node: Bugs1131938 -Node: Other Versions1135842 -Node: Installation summary1142055 -Node: Notes1143111 -Node: Compatibility Mode1143976 -Node: Additions1144758 -Node: Accessing The Source1145683 -Node: Adding Code1147119 -Node: New Ports1153291 -Node: Derived Files1157773 -Ref: Derived Files-Footnote-11163248 -Ref: Derived Files-Footnote-21163282 -Ref: Derived Files-Footnote-31163878 -Node: Future Extensions1163992 -Node: Implementation Limitations1164598 -Node: Extension Design1165846 -Node: Old Extension Problems1167000 -Ref: Old Extension Problems-Footnote-11168517 -Node: Extension New Mechanism Goals1168574 -Ref: Extension New Mechanism Goals-Footnote-11171934 -Node: Extension Other Design Decisions1172123 -Node: Extension Future Growth1174231 -Node: Old Extension Mechanism1175067 -Node: Notes summary1176829 -Node: Basic Concepts1178015 -Node: Basic High Level1178696 -Ref: figure-general-flow1178968 -Ref: figure-process-flow1179567 -Ref: Basic High Level-Footnote-11182796 -Node: Basic Data Typing1182981 -Node: Glossary1186309 -Node: Copying1211467 -Node: GNU Free Documentation License1249023 -Node: Index1274159 +Node: Foreword342225 +Node: Foreword446617 +Node: Preface48051 +Ref: Preface-Footnote-150922 +Ref: Preface-Footnote-251029 +Ref: Preface-Footnote-351262 +Node: History51404 +Node: Names53752 +Ref: Names-Footnote-154846 +Node: This Manual54992 +Ref: This Manual-Footnote-160821 +Node: Conventions60921 +Node: Manual History63261 +Ref: Manual History-Footnote-166252 +Ref: Manual History-Footnote-266293 +Node: How To Contribute66367 +Node: Acknowledgments67606 +Node: Getting Started72414 +Node: Running gawk74848 +Node: One-shot76038 +Node: Read Terminal77263 +Node: Long79290 +Node: Executable Scripts80806 +Ref: Executable Scripts-Footnote-183595 +Node: Comments83697 +Node: Quoting86170 +Node: DOS Quoting91676 +Node: Sample Data Files92351 +Node: Very Simple94944 +Node: Two Rules99835 +Node: More Complex101721 +Node: Statements/Lines104583 +Ref: Statements/Lines-Footnote-1109039 +Node: Other Features109304 +Node: When110235 +Ref: When-Footnote-1111991 +Node: Intro Summary112056 +Node: Invoking Gawk112939 +Node: Command Line114454 +Node: Options115245 +Ref: Options-Footnote-1131028 +Node: Other Arguments131053 +Node: Naming Standard Input134014 +Node: Environment Variables135107 +Node: AWKPATH Variable135665 +Ref: AWKPATH Variable-Footnote-1139075 +Ref: AWKPATH Variable-Footnote-2139120 +Node: AWKLIBPATH Variable139380 +Node: Other Environment Variables140636 +Node: Exit Status144127 +Node: Include Files144802 +Node: Loading Shared Libraries148390 +Node: Obsolete149817 +Node: Undocumented150514 +Node: Invoking Summary150781 +Node: Regexp152447 +Node: Regexp Usage153906 +Node: Escape Sequences155939 +Node: Regexp Operators162187 +Ref: Regexp Operators-Footnote-1169621 +Ref: Regexp Operators-Footnote-2169768 +Node: Bracket Expressions169866 +Ref: table-char-classes171883 +Node: Leftmost Longest174823 +Node: Computed Regexps176125 +Node: GNU Regexp Operators179522 +Node: Case-sensitivity183224 +Ref: Case-sensitivity-Footnote-1186114 +Ref: Case-sensitivity-Footnote-2186349 +Node: Regexp Summary186457 +Node: Reading Files187926 +Node: Records190020 +Node: awk split records190752 +Node: gawk split records195666 +Ref: gawk split records-Footnote-1200205 +Node: Fields200242 +Ref: Fields-Footnote-1203040 +Node: Nonconstant Fields203126 +Ref: Nonconstant Fields-Footnote-1205362 +Node: Changing Fields205564 +Node: Field Separators211496 +Node: Default Field Splitting214200 +Node: Regexp Field Splitting215317 +Node: Single Character Fields218667 +Node: Command Line Field Separator219726 +Node: Full Line Fields222938 +Ref: Full Line Fields-Footnote-1223446 +Node: Field Splitting Summary223492 +Ref: Field Splitting Summary-Footnote-1226623 +Node: Constant Size226724 +Node: Splitting By Content231330 +Ref: Splitting By Content-Footnote-1235403 +Node: Multiple Line235443 +Ref: Multiple Line-Footnote-1241332 +Node: Getline241511 +Node: Plain Getline243722 +Node: Getline/Variable246362 +Node: Getline/File247509 +Node: Getline/Variable/File248893 +Ref: Getline/Variable/File-Footnote-1250494 +Node: Getline/Pipe250581 +Node: Getline/Variable/Pipe253264 +Node: Getline/Coprocess254395 +Node: Getline/Variable/Coprocess255647 +Node: Getline Notes256386 +Node: Getline Summary259178 +Ref: table-getline-variants259590 +Node: Read Timeout260419 +Ref: Read Timeout-Footnote-1264233 +Node: Command-line directories264291 +Node: Input Summary265195 +Node: Input Exercises268447 +Node: Printing269175 +Node: Print270952 +Node: Print Examples272409 +Node: Output Separators275188 +Node: OFMT277206 +Node: Printf278560 +Node: Basic Printf279345 +Node: Control Letters280916 +Node: Format Modifiers284900 +Node: Printf Examples290907 +Node: Redirection293389 +Node: Special FD300228 +Ref: Special FD-Footnote-1303385 +Node: Special Files303459 +Node: Other Inherited Files304075 +Node: Special Network305075 +Node: Special Caveats305936 +Node: Close Files And Pipes306887 +Ref: Close Files And Pipes-Footnote-1314066 +Ref: Close Files And Pipes-Footnote-2314214 +Node: Output Summary314364 +Node: Output Exercises315360 +Node: Expressions316040 +Node: Values317225 +Node: Constants317901 +Node: Scalar Constants318581 +Ref: Scalar Constants-Footnote-1319440 +Node: Nondecimal-numbers319690 +Node: Regexp Constants322690 +Node: Using Constant Regexps323215 +Node: Variables326353 +Node: Using Variables327008 +Node: Assignment Options328918 +Node: Conversion330793 +Node: Strings And Numbers331317 +Ref: Strings And Numbers-Footnote-1334381 +Node: Locale influences conversions334490 +Ref: table-locale-affects337235 +Node: All Operators337823 +Node: Arithmetic Ops338453 +Node: Concatenation340958 +Ref: Concatenation-Footnote-1343777 +Node: Assignment Ops343883 +Ref: table-assign-ops348866 +Node: Increment Ops350144 +Node: Truth Values and Conditions353582 +Node: Truth Values354665 +Node: Typing and Comparison355714 +Node: Variable Typing356507 +Node: Comparison Operators360159 +Ref: table-relational-ops360569 +Node: POSIX String Comparison364084 +Ref: POSIX String Comparison-Footnote-1365156 +Node: Boolean Ops365294 +Ref: Boolean Ops-Footnote-1369773 +Node: Conditional Exp369864 +Node: Function Calls371591 +Node: Precedence375471 +Node: Locales379139 +Node: Expressions Summary380770 +Node: Patterns and Actions383344 +Node: Pattern Overview384464 +Node: Regexp Patterns386143 +Node: Expression Patterns386686 +Node: Ranges390466 +Node: BEGIN/END393572 +Node: Using BEGIN/END394334 +Ref: Using BEGIN/END-Footnote-1397071 +Node: I/O And BEGIN/END397177 +Node: BEGINFILE/ENDFILE399491 +Node: Empty402392 +Node: Using Shell Variables402709 +Node: Action Overview404985 +Node: Statements407312 +Node: If Statement409160 +Node: While Statement410658 +Node: Do Statement412686 +Node: For Statement413828 +Node: Switch Statement416983 +Node: Break Statement419371 +Node: Continue Statement421412 +Node: Next Statement423237 +Node: Nextfile Statement425617 +Node: Exit Statement428247 +Node: Built-in Variables430650 +Node: User-modified431783 +Ref: User-modified-Footnote-1439463 +Node: Auto-set439525 +Ref: Auto-set-Footnote-1452892 +Ref: Auto-set-Footnote-2453097 +Node: ARGC and ARGV453153 +Node: Pattern Action Summary457357 +Node: Arrays459784 +Node: Array Basics461113 +Node: Array Intro461957 +Ref: figure-array-elements463921 +Ref: Array Intro-Footnote-1466445 +Node: Reference to Elements466573 +Node: Assigning Elements469023 +Node: Array Example469514 +Node: Scanning an Array471272 +Node: Controlling Scanning474288 +Ref: Controlling Scanning-Footnote-1479477 +Node: Numeric Array Subscripts479793 +Node: Uninitialized Subscripts481978 +Node: Delete483595 +Ref: Delete-Footnote-1486339 +Node: Multidimensional486396 +Node: Multiscanning489491 +Node: Arrays of Arrays491080 +Node: Arrays Summary495841 +Node: Functions497946 +Node: Built-in498819 +Node: Calling Built-in499897 +Node: Numeric Functions501885 +Ref: Numeric Functions-Footnote-1506709 +Ref: Numeric Functions-Footnote-2507066 +Ref: Numeric Functions-Footnote-3507114 +Node: String Functions507383 +Ref: String Functions-Footnote-1530855 +Ref: String Functions-Footnote-2530984 +Ref: String Functions-Footnote-3531232 +Node: Gory Details531319 +Ref: table-sub-escapes533100 +Ref: table-sub-proposed534620 +Ref: table-posix-sub535984 +Ref: table-gensub-escapes537524 +Ref: Gory Details-Footnote-1538356 +Node: I/O Functions538507 +Ref: I/O Functions-Footnote-1545608 +Node: Time Functions545755 +Ref: Time Functions-Footnote-1556224 +Ref: Time Functions-Footnote-2556292 +Ref: Time Functions-Footnote-3556450 +Ref: Time Functions-Footnote-4556561 +Ref: Time Functions-Footnote-5556673 +Ref: Time Functions-Footnote-6556900 +Node: Bitwise Functions557166 +Ref: table-bitwise-ops557728 +Ref: Bitwise Functions-Footnote-1562036 +Node: Type Functions562205 +Node: I18N Functions563354 +Node: User-defined564999 +Node: Definition Syntax565803 +Ref: Definition Syntax-Footnote-1571209 +Node: Function Example571278 +Ref: Function Example-Footnote-1574195 +Node: Function Caveats574217 +Node: Calling A Function574735 +Node: Variable Scope575690 +Node: Pass By Value/Reference578678 +Node: Return Statement582188 +Node: Dynamic Typing585172 +Node: Indirect Calls586101 +Ref: Indirect Calls-Footnote-1597405 +Node: Functions Summary597533 +Node: Library Functions600232 +Ref: Library Functions-Footnote-1603850 +Ref: Library Functions-Footnote-2603993 +Node: Library Names604164 +Ref: Library Names-Footnote-1607624 +Ref: Library Names-Footnote-2607844 +Node: General Functions607930 +Node: Strtonum Function609033 +Node: Assert Function612053 +Node: Round Function615377 +Node: Cliff Random Function616918 +Node: Ordinal Functions617934 +Ref: Ordinal Functions-Footnote-1620999 +Ref: Ordinal Functions-Footnote-2621251 +Node: Join Function621462 +Ref: Join Function-Footnote-1623233 +Node: Getlocaltime Function623433 +Node: Readfile Function627174 +Node: Shell Quoting629144 +Node: Data File Management630545 +Node: Filetrans Function631177 +Node: Rewind Function635236 +Node: File Checking636621 +Ref: File Checking-Footnote-1637949 +Node: Empty Files638150 +Node: Ignoring Assigns640129 +Node: Getopt Function641680 +Ref: Getopt Function-Footnote-1653140 +Node: Passwd Functions653343 +Ref: Passwd Functions-Footnote-1662194 +Node: Group Functions662282 +Ref: Group Functions-Footnote-1670185 +Node: Walking Arrays670398 +Node: Library Functions Summary672001 +Node: Library Exercises673402 +Node: Sample Programs674682 +Node: Running Examples675452 +Node: Clones676180 +Node: Cut Program677404 +Node: Egrep Program687134 +Ref: Egrep Program-Footnote-1694638 +Node: Id Program694748 +Node: Split Program698392 +Ref: Split Program-Footnote-1701838 +Node: Tee Program701966 +Node: Uniq Program704753 +Node: Wc Program712174 +Ref: Wc Program-Footnote-1716422 +Node: Miscellaneous Programs716514 +Node: Dupword Program717727 +Node: Alarm Program719758 +Node: Translate Program724562 +Ref: Translate Program-Footnote-1729126 +Node: Labels Program729396 +Ref: Labels Program-Footnote-1732745 +Node: Word Sorting732829 +Node: History Sorting736899 +Node: Extract Program738735 +Node: Simple Sed746267 +Node: Igawk Program749329 +Ref: Igawk Program-Footnote-1763655 +Ref: Igawk Program-Footnote-2763856 +Ref: Igawk Program-Footnote-3763978 +Node: Anagram Program764093 +Node: Signature Program767155 +Node: Programs Summary768402 +Node: Programs Exercises769595 +Ref: Programs Exercises-Footnote-1773726 +Node: Advanced Features773817 +Node: Nondecimal Data775765 +Node: Array Sorting777355 +Node: Controlling Array Traversal778052 +Ref: Controlling Array Traversal-Footnote-1786383 +Node: Array Sorting Functions786501 +Ref: Array Sorting Functions-Footnote-1790393 +Node: Two-way I/O790587 +Ref: Two-way I/O-Footnote-1795531 +Ref: Two-way I/O-Footnote-2795717 +Node: TCP/IP Networking795799 +Node: Profiling798671 +Node: Advanced Features Summary806945 +Node: Internationalization808878 +Node: I18N and L10N810358 +Node: Explaining gettext811044 +Ref: Explaining gettext-Footnote-1816073 +Ref: Explaining gettext-Footnote-2816257 +Node: Programmer i18n816422 +Ref: Programmer i18n-Footnote-1821288 +Node: Translator i18n821337 +Node: String Extraction822131 +Ref: String Extraction-Footnote-1823262 +Node: Printf Ordering823348 +Ref: Printf Ordering-Footnote-1826134 +Node: I18N Portability826198 +Ref: I18N Portability-Footnote-1828647 +Node: I18N Example828710 +Ref: I18N Example-Footnote-1831510 +Node: Gawk I18N831582 +Node: I18N Summary832220 +Node: Debugger833559 +Node: Debugging834581 +Node: Debugging Concepts835022 +Node: Debugging Terms836879 +Node: Awk Debugging839454 +Node: Sample Debugging Session840346 +Node: Debugger Invocation840866 +Node: Finding The Bug842250 +Node: List of Debugger Commands848725 +Node: Breakpoint Control850057 +Node: Debugger Execution Control853749 +Node: Viewing And Changing Data857113 +Node: Execution Stack860478 +Node: Debugger Info862116 +Node: Miscellaneous Debugger Commands866133 +Node: Readline Support871325 +Node: Limitations872217 +Node: Debugging Summary874314 +Node: Arbitrary Precision Arithmetic875482 +Node: Computer Arithmetic876898 +Ref: table-numeric-ranges880499 +Ref: Computer Arithmetic-Footnote-1881358 +Node: Math Definitions881415 +Ref: table-ieee-formats884702 +Ref: Math Definitions-Footnote-1885306 +Node: MPFR features885411 +Node: FP Math Caution887082 +Ref: FP Math Caution-Footnote-1888132 +Node: Inexactness of computations888501 +Node: Inexact representation889449 +Node: Comparing FP Values890804 +Node: Errors accumulate891877 +Node: Getting Accuracy893310 +Node: Try To Round895969 +Node: Setting precision896868 +Ref: table-predefined-precision-strings897552 +Node: Setting the rounding mode899346 +Ref: table-gawk-rounding-modes899710 +Ref: Setting the rounding mode-Footnote-1903164 +Node: Arbitrary Precision Integers903343 +Ref: Arbitrary Precision Integers-Footnote-1908247 +Node: POSIX Floating Point Problems908396 +Ref: POSIX Floating Point Problems-Footnote-1912272 +Node: Floating point summary912310 +Node: Dynamic Extensions914502 +Node: Extension Intro916054 +Node: Plugin License917320 +Node: Extension Mechanism Outline918117 +Ref: figure-load-extension918545 +Ref: figure-register-new-function920025 +Ref: figure-call-new-function921029 +Node: Extension API Description923015 +Node: Extension API Functions Introduction924465 +Node: General Data Types929301 +Ref: General Data Types-Footnote-1934988 +Node: Memory Allocation Functions935287 +Ref: Memory Allocation Functions-Footnote-1938117 +Node: Constructor Functions938213 +Node: Registration Functions939947 +Node: Extension Functions940632 +Node: Exit Callback Functions942928 +Node: Extension Version String944176 +Node: Input Parsers944826 +Node: Output Wrappers954641 +Node: Two-way processors959157 +Node: Printing Messages961361 +Ref: Printing Messages-Footnote-1962438 +Node: Updating `ERRNO'962590 +Node: Requesting Values963330 +Ref: table-value-types-returned964058 +Node: Accessing Parameters965016 +Node: Symbol Table Access966247 +Node: Symbol table by name966761 +Node: Symbol table by cookie968741 +Ref: Symbol table by cookie-Footnote-1972880 +Node: Cached values972943 +Ref: Cached values-Footnote-1976447 +Node: Array Manipulation976538 +Ref: Array Manipulation-Footnote-1977636 +Node: Array Data Types977675 +Ref: Array Data Types-Footnote-1980332 +Node: Array Functions980424 +Node: Flattening Arrays984278 +Node: Creating Arrays991165 +Node: Extension API Variables995932 +Node: Extension Versioning996568 +Node: Extension API Informational Variables998469 +Node: Extension API Boilerplate999557 +Node: Finding Extensions1003373 +Node: Extension Example1003933 +Node: Internal File Description1004705 +Node: Internal File Ops1008772 +Ref: Internal File Ops-Footnote-11020430 +Node: Using Internal File Ops1020570 +Ref: Using Internal File Ops-Footnote-11022953 +Node: Extension Samples1023226 +Node: Extension Sample File Functions1024750 +Node: Extension Sample Fnmatch1032352 +Node: Extension Sample Fork1033834 +Node: Extension Sample Inplace1035047 +Node: Extension Sample Ord1036722 +Node: Extension Sample Readdir1037558 +Ref: table-readdir-file-types1038434 +Node: Extension Sample Revout1039245 +Node: Extension Sample Rev2way1039836 +Node: Extension Sample Read write array1040577 +Node: Extension Sample Readfile1042516 +Node: Extension Sample Time1043611 +Node: Extension Sample API Tests1044960 +Node: gawkextlib1045451 +Node: Extension summary1048101 +Node: Extension Exercises1051783 +Node: Language History1052505 +Node: V7/SVR3.11054162 +Node: SVR41056343 +Node: POSIX1057788 +Node: BTL1059177 +Node: POSIX/GNU1059911 +Node: Feature History1065540 +Node: Common Extensions1078638 +Node: Ranges and Locales1079962 +Ref: Ranges and Locales-Footnote-11084601 +Ref: Ranges and Locales-Footnote-21084628 +Ref: Ranges and Locales-Footnote-31084862 +Node: Contributors1085083 +Node: History summary1090623 +Node: Installation1091992 +Node: Gawk Distribution1092948 +Node: Getting1093432 +Node: Extracting1094256 +Node: Distribution contents1095898 +Node: Unix Installation1101963 +Node: Quick Installation1102646 +Node: Shell Startup Files1105064 +Node: Additional Configuration Options1106143 +Node: Configuration Philosophy1107884 +Node: Non-Unix Installation1110235 +Node: PC Installation1110693 +Node: PC Binary Installation1112019 +Node: PC Compiling1113867 +Ref: PC Compiling-Footnote-11116888 +Node: PC Testing1116993 +Node: PC Using1118169 +Node: Cygwin1122284 +Node: MSYS1123107 +Node: VMS Installation1123605 +Node: VMS Compilation1124397 +Ref: VMS Compilation-Footnote-11125619 +Node: VMS Dynamic Extensions1125677 +Node: VMS Installation Details1127361 +Node: VMS Running1129613 +Node: VMS GNV1132454 +Node: VMS Old Gawk1133188 +Node: Bugs1133658 +Node: Other Versions1137562 +Node: Installation summary1143775 +Node: Notes1144831 +Node: Compatibility Mode1145696 +Node: Additions1146478 +Node: Accessing The Source1147403 +Node: Adding Code1148839 +Node: New Ports1155011 +Node: Derived Files1159493 +Ref: Derived Files-Footnote-11164968 +Ref: Derived Files-Footnote-21165002 +Ref: Derived Files-Footnote-31165598 +Node: Future Extensions1165712 +Node: Implementation Limitations1166318 +Node: Extension Design1167566 +Node: Old Extension Problems1168720 +Ref: Old Extension Problems-Footnote-11170237 +Node: Extension New Mechanism Goals1170294 +Ref: Extension New Mechanism Goals-Footnote-11173654 +Node: Extension Other Design Decisions1173843 +Node: Extension Future Growth1175951 +Node: Old Extension Mechanism1176787 +Node: Notes summary1178549 +Node: Basic Concepts1179735 +Node: Basic High Level1180416 +Ref: figure-general-flow1180688 +Ref: figure-process-flow1181287 +Ref: Basic High Level-Footnote-11184516 +Node: Basic Data Typing1184701 +Node: Glossary1188029 +Node: Copying1213187 +Node: GNU Free Documentation License1250743 +Node: Index1275879  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index a67689fd..3e3976f7 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -989,6 +989,7 @@ particular records in a file and perform operations upon them. * Unix Installation:: Installing @command{gawk} under various versions of Unix. * Quick Installation:: Compiling @command{gawk} under Unix. +* Shell Startup Files:: Shell convenience functions. * Additional Configuration Options:: Other compile-time options. * Configuration Philosophy:: How it's all supposed to work. * Non-Unix Installation:: Installation on Other Operating @@ -4400,6 +4401,9 @@ searches first in the current directory and then in @file{/usr/local/share/awk}. In practice, this means that you will rarely need to change the value of @env{AWKPATH}. +@xref{Shell Startup Files}, for information on functions that help to +manipulate the @env{AWKPATH} variable. + @command{gawk} places the value of the search path that it used into @code{ENVIRON["AWKPATH"]}. This provides access to the actual search path value from within an @command{awk} program. @@ -4431,6 +4435,9 @@ an empty value, @command{gawk} uses a default path; this is typically @samp{/usr/local/lib/gawk}, although it can vary depending upon how @command{gawk} was built. +@xref{Shell Startup Files}, for information on functions that help to +manipulate the @env{AWKLIBPATH} variable. + @command{gawk} places the value of the search path that it used into @code{ENVIRON["AWKLIBPATH"]}. This provides access to the actual search path value from within an @command{awk} program. @@ -37344,6 +37351,12 @@ The source code, manual pages, and infrastructure files for the sample extensions included with @command{gawk}. @xref{Dynamic Extensions}, for more information. +@item extras/* +Additional non-essential files. Currently, this directory contains some shell +startup files to be installed in @file{/etc/profile.d} to aid in manipulating +the @env{AWKPATH} and @env{AWKLIBPATH} environment variables. +@xref{Shell Startup Files}, for more information. + @item posix/* Files needed for building @command{gawk} on POSIX-compliant systems. @@ -37376,6 +37389,7 @@ to configure @command{gawk} for your system yourself. @menu * Quick Installation:: Compiling @command{gawk} under Unix. +* Shell Startup Files:: Shell convenience functions. * Additional Configuration Options:: Other compile-time options. * Configuration Philosophy:: How it's all supposed to work. @end menu @@ -37456,6 +37470,44 @@ is likely that you will be asked for your password, and you will have to have been set up previously as a user who is allowed to run the @command{sudo} command. +@node Shell Startup Files +@appendixsubsec Shell Startup Files + +The distribution contains shell startup files @file{gawk.sh} and +@file{gawk.csh} containing functions to aid in manipulating +the @env{AWKPATH} and @env{AWKLIBPATH} environment variables. +On a Fedora system, these files should be installed in @file{/etc/profile.d}; +on other platforms, the appropriate location may be different. + +@table @command + +@cindex @command{gawkpath_default} shell function +@item gawkpath_default +Reset the @env{AWKPATH} environment variable to its default value. + +@cindex @command{gawkpath_prepend} shell function +@item gawkpath_prepend +Add the argument to the front of the @env{AWKPATH} environment variable. + +@cindex @command{gawkpath_append} shell function +@item gawkpath_append +Add the argument to the end of the @env{AWKPATH} environment variable. + +@cindex @command{gawklibpath_default} shell function +@item gawklibpath_default +Reset the @env{AWKLIBPATH} environment variable to its default value. + +@cindex @command{gawklibpath_prepend} shell function +@item gawklibpath_prepend +Add the argument to the front of the @env{AWKLIBPATH} environment variable. + +@cindex @command{gawklibpath_append} shell function +@item gawklibpath_append +Add the argument to the end of the @env{AWKLIBPATH} environment variable. + +@end table + + @node Additional Configuration Options @appendixsubsec Additional Configuration Options @cindex @command{gawk}, configuring, options diff --git a/doc/gawktexi.in b/doc/gawktexi.in index f0d8e0b2..a9811763 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -984,6 +984,7 @@ particular records in a file and perform operations upon them. * Unix Installation:: Installing @command{gawk} under various versions of Unix. * Quick Installation:: Compiling @command{gawk} under Unix. +* Shell Startup Files:: Shell convenience functions. * Additional Configuration Options:: Other compile-time options. * Configuration Philosophy:: How it's all supposed to work. * Non-Unix Installation:: Installation on Other Operating @@ -4311,6 +4312,9 @@ searches first in the current directory and then in @file{/usr/local/share/awk}. In practice, this means that you will rarely need to change the value of @env{AWKPATH}. +@xref{Shell Startup Files}, for information on functions that help to +manipulate the @env{AWKPATH} variable. + @command{gawk} places the value of the search path that it used into @code{ENVIRON["AWKPATH"]}. This provides access to the actual search path value from within an @command{awk} program. @@ -4342,6 +4346,9 @@ an empty value, @command{gawk} uses a default path; this is typically @samp{/usr/local/lib/gawk}, although it can vary depending upon how @command{gawk} was built. +@xref{Shell Startup Files}, for information on functions that help to +manipulate the @env{AWKLIBPATH} variable. + @command{gawk} places the value of the search path that it used into @code{ENVIRON["AWKLIBPATH"]}. This provides access to the actual search path value from within an @command{awk} program. @@ -36438,6 +36445,12 @@ The source code, manual pages, and infrastructure files for the sample extensions included with @command{gawk}. @xref{Dynamic Extensions}, for more information. +@item extras/* +Additional non-essential files. Currently, this directory contains some shell +startup files to be installed in @file{/etc/profile.d} to aid in manipulating +the @env{AWKPATH} and @env{AWKLIBPATH} environment variables. +@xref{Shell Startup Files}, for more information. + @item posix/* Files needed for building @command{gawk} on POSIX-compliant systems. @@ -36470,6 +36483,7 @@ to configure @command{gawk} for your system yourself. @menu * Quick Installation:: Compiling @command{gawk} under Unix. +* Shell Startup Files:: Shell convenience functions. * Additional Configuration Options:: Other compile-time options. * Configuration Philosophy:: How it's all supposed to work. @end menu @@ -36550,6 +36564,44 @@ is likely that you will be asked for your password, and you will have to have been set up previously as a user who is allowed to run the @command{sudo} command. +@node Shell Startup Files +@appendixsubsec Shell Startup Files + +The distribution contains shell startup files @file{gawk.sh} and +@file{gawk.csh} containing functions to aid in manipulating +the @env{AWKPATH} and @env{AWKLIBPATH} environment variables. +On a Fedora system, these files should be installed in @file{/etc/profile.d}; +on other platforms, the appropriate location may be different. + +@table @command + +@cindex @command{gawkpath_default} shell function +@item gawkpath_default +Reset the @env{AWKPATH} environment variable to its default value. + +@cindex @command{gawkpath_prepend} shell function +@item gawkpath_prepend +Add the argument to the front of the @env{AWKPATH} environment variable. + +@cindex @command{gawkpath_append} shell function +@item gawkpath_append +Add the argument to the end of the @env{AWKPATH} environment variable. + +@cindex @command{gawklibpath_default} shell function +@item gawklibpath_default +Reset the @env{AWKLIBPATH} environment variable to its default value. + +@cindex @command{gawklibpath_prepend} shell function +@item gawklibpath_prepend +Add the argument to the front of the @env{AWKLIBPATH} environment variable. + +@cindex @command{gawklibpath_append} shell function +@item gawklibpath_append +Add the argument to the end of the @env{AWKLIBPATH} environment variable. + +@end table + + @node Additional Configuration Options @appendixsubsec Additional Configuration Options @cindex @command{gawk}, configuring, options diff --git a/extras/ChangeLog b/extras/ChangeLog new file mode 100644 index 00000000..5f7d33ad --- /dev/null +++ b/extras/ChangeLog @@ -0,0 +1,3 @@ +2014-10-29 Andrew J. Schorr + + * Makefile.am, gawk.sh, gawk.csh: New files. diff --git a/extras/Makefile.am b/extras/Makefile.am new file mode 100644 index 00000000..6a33ae04 --- /dev/null +++ b/extras/Makefile.am @@ -0,0 +1,29 @@ +# +# extras/Makefile.am --- automake input file for gawk +# +# Copyright (C) 2014 the Free Software Foundation, Inc. +# +# This file is part of GAWK, the GNU implementation of the +# AWK Programming Language. +# +# GAWK is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# GAWK is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# + +## Process this file with automake to produce Makefile.in. + +profiledir = $(sysconfdir)/profile.d +profile_DATA = gawk.sh gawk.csh + +EXTRA_DIST = $(profile_DATA) diff --git a/extras/Makefile.in b/extras/Makefile.in new file mode 100644 index 00000000..d447dc73 --- /dev/null +++ b/extras/Makefile.in @@ -0,0 +1,515 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# extras/Makefile.am --- automake input file for gawk +# +# Copyright (C) 2014 the Free Software Foundation, Inc. +# +# This file is part of GAWK, the GNU implementation of the +# AWK Programming Language. +# +# GAWK is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# GAWK is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# 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__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = extras +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/mkinstalldirs +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 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \ + $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(profiledir)" +DATA = $(profile_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GAWKLIBEXT = @GAWKLIBEXT@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@ +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@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMPFR = @LIBMPFR@ +LIBOBJS = @LIBOBJS@ +LIBREADLINE = @LIBREADLINE@ +LIBS = @LIBS@ +LIBSIGSEGV = @LIBSIGSEGV@ +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSIGSEGV = @LTLIBSIGSEGV@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +acl_shlibext = @acl_shlibext@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgextensiondir = @pkgextensiondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +profiledir = $(sysconfdir)/profile.d +profile_DATA = gawk.sh gawk.csh +EXTRA_DIST = $(profile_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + 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*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-profileDATA: $(profile_DATA) + @$(NORMAL_INSTALL) + @list='$(profile_DATA)'; test -n "$(profiledir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(profiledir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(profiledir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(profiledir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(profiledir)" || exit $$?; \ + done + +uninstall-profileDATA: + @$(NORMAL_UNINSTALL) + @list='$(profile_DATA)'; test -n "$(profiledir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(profiledir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(profiledir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-profileDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-profileDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-profileDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-profileDATA + + +# 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. +.NOEXPORT: diff --git a/extras/gawk.csh b/extras/gawk.csh new file mode 100644 index 00000000..583d5bcd --- /dev/null +++ b/extras/gawk.csh @@ -0,0 +1,11 @@ +alias gawkpath_default 'unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`' + +alias gawkpath_prepend 'if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH == "") then; unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKPATH "\!*"":$AWKPATH"' + +alias gawkpath_append 'if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH == "") then; unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKPATH "$AWKPATH"":\!*"' + +alias gawklibpath_default 'unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`' + +alias gawklibpath_prepend 'if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH == "") then; unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKLIBPATH "\!*"":$AWKLIBPATH"' + +alias gawklibpath_append 'if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH == "") then; unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKLIBPATH "$AWKLIBPATH"":\!*"' diff --git a/extras/gawk.sh b/extras/gawk.sh new file mode 100644 index 00000000..c35471fa --- /dev/null +++ b/extras/gawk.sh @@ -0,0 +1,31 @@ +gawkpath_default () { + unset AWKPATH + export AWKPATH=`gawk 'BEGIN {print ENVIRON["AWKPATH"]}'` +} + +gawkpath_prepend () { + [ -z "$AWKPATH" ] && AWKPATH=`gawk 'BEGIN {print ENVIRON["AWKPATH"]}'` + export AWKPATH="$*:$AWKPATH" +} + +gawkpath_append () { + [ -z "$AWKPATH" ] && AWKPATH=`gawk 'BEGIN {print ENVIRON["AWKPATH"]}'` + export AWKPATH="$AWKPATH:$*" +} + +gawklibpath_default () { + unset AWKLIBPATH + export AWKLIBPATH=`gawk 'BEGIN {print ENVIRON["AWKLIBPATH"]}'` +} + +gawklibpath_prepend () { + [ -z "$AWKLIBPATH" ] && \ + AWKLIBPATH=`gawk 'BEGIN {print ENVIRON["AWKLIBPATH"]}'` + export AWKLIBPATH="$*:$AWKLIBPATH" +} + +gawklibpath_append () { + [ -z "$AWKLIBPATH" ] && \ + AWKLIBPATH=`gawk 'BEGIN {print ENVIRON["AWKLIBPATH"]}'` + export AWKLIBPATH="$AWKLIBPATH:$*" +} -- cgit v1.2.3 From ac0717b3ca30f7b250db4d526e98ed3eb8de9953 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 30 Oct 2014 08:49:20 -0400 Subject: Patch doc/ChangeLog to reflect changes in previous patch regarding shell startup files. --- doc/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0c13b31a..7725061b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-29 Andrew J. Schorr + + * gawktexi.in: Document new extras directory containing shell startup + files to manipulate AWKPATH and AWKLIBPATH environment variables. + 2014-10-28 Arnold D. Robbins * gawk.1: Clarification that debugger reads stdin. -- cgit v1.2.3 From b75a0f281598a38f64a5b2bc3da40ff2cdac20ca Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 30 Oct 2014 09:05:26 -0400 Subject: Update NEWS file to document new shell startup files. --- ChangeLog | 4 ++++ NEWS | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8ea3992b..b3655698 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-10-30 Andrew J. Schorr + + * NEWS: Mention installation of /etc/profile.d/gawk.{csh,sh}. + 2014-10-29 Andrew J. Schorr * configure.ac (AC_CONFIG_FILES): Add extras/Makefile. diff --git a/NEWS b/NEWS index a70354c6..bbefc180 100644 --- a/NEWS +++ b/NEWS @@ -37,6 +37,12 @@ Changes from 4.1.x to 4.2.0 9. Pretty printing now preserves comments and places them into the pretty-printed file. +10. `make install' now installs shell startup files + $sysconfdir/profile.d/gawk.{csh,sh} containing shell functions to + manipulate the AWKPATH and AWKLIBPATH environment variables. On a Fedora + system, these files belong in /etc/profile.d, but the appropriate location + may be different on other platforms. + Changes from 4.1.1 to 4.1.2 --------------------------- -- cgit v1.2.3 From e982e87ced45d48d23ffc86fa0b6cf6fabfbef8d Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 30 Oct 2014 20:49:19 +0200 Subject: Enable cross-compiling for readline during configuring. --- ChangeLog | 4 ++++ configure | 34 +++++++++++++++++++++++++++++++++- m4/ChangeLog | 6 ++++++ m4/readline.m4 | 23 ++++++++++++++++++++++- 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34554e22..8f4657a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-10-30 Arnold D. Robbins + + * configure: Regenerated after fix to m4/readline.m4. + 2014-10-29 Arnold D. Robbins * dfa.c: Sync with GNU grep. Again, again. diff --git a/configure b/configure index 44b420ba..d98aeb10 100755 --- a/configure +++ b/configure @@ -10439,7 +10439,39 @@ fi $as_echo_n "checking whether readline via \"$_combo\" is present and sane... " >&6; } if test "$cross_compiling" = yes; then : - _found_readline=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +int +main () +{ + + int fd; + char *line; + + close(0); + close(1); + fd = open("/dev/null", 2); /* should get fd 0 */ + dup(fd); + line = readline("giveittome> "); + + /* some printfs don't handle NULL for %s */ + printf("got <%s>\n", line ? line : "(NULL)"); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + _found_readline=yes +else + _found_readline=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext diff --git a/m4/ChangeLog b/m4/ChangeLog index 81fdcec0..17c482cb 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2014-10-30 Arnold D. Robbins + + * readline.m4: Enable cross compiling. Thanks to + Christer Solskogen for + motivating and testing. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff --git a/m4/readline.m4 b/m4/readline.m4 index 77ed8b25..740b9c7b 100644 --- a/m4/readline.m4 +++ b/m4/readline.m4 @@ -62,7 +62,28 @@ dnl action if true: dnl action if false: [_found_readline=no], dnl action if cross compiling: - [_found_readline=no] + AC_TRY_LINK([#include +#include +#include ], dnl includes + dnl function body + [ + int fd; + char *line; + + close(0); + close(1); + fd = open("/dev/null", 2); /* should get fd 0 */ + dup(fd); + line = readline("giveittome> "); + + /* some printfs don't handle NULL for %s */ + printf("got <%s>\n", line ? line : "(NULL)"); +], +dnl action if found: + [_found_readline=yes], +dnl action if not found: + [_found_readline=no] + ) ) AC_MSG_RESULT([$_found_readline]) -- cgit v1.2.3 From c2cda8d3736b59738f579fce748e94ca109ccc58 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 30 Oct 2014 21:33:59 +0200 Subject: Fixes in pretty-printer. --- ChangeLog | 9 +++++++++ profile.c | 46 +++++++++++++++++++++++++++++++--------------- test/ChangeLog | 5 +++++ test/Makefile.am | 10 +++++++++- test/Makefile.in | 10 +++++++++- test/profile6.awk | 7 +++++++ test/profile6.ok | 10 ++++++++++ 7 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 test/profile6.awk create mode 100644 test/profile6.ok diff --git a/ChangeLog b/ChangeLog index 8f4657a8..a74dadd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,15 @@ * configure: Regenerated after fix to m4/readline.m4. + Unrelated; fixes to profiling. Thanks to Hermann Peifer and + Manuel Collado for pointing out problems: + + * profile.c (pprint): For Op_unary_minus, parenthesize -(-x) + correctly. + (prec_level): Get the levels right (checked the grammar). + (is_unary_minus): New function. + (pp_concat): Add checks for unary minus; needs to be parenthesized. + 2014-10-29 Arnold D. Robbins * dfa.c: Sync with GNU grep. Again, again. diff --git a/profile.c b/profile.c index a5ed381b..ed17e62b 100644 --- a/profile.c +++ b/profile.c @@ -395,7 +395,8 @@ cleanup: case Op_unary_minus: case Op_not: t1 = pp_pop(); - if (is_binary(t1->type)) + if (is_binary(t1->type) + || (((OPCODE) t1->type) == pc->opcode && pc->opcode == Op_unary_minus)) pp_parenthesize(t1); /* optypes table (eval.c) includes space after ! */ @@ -1000,25 +1001,25 @@ prec_level(int type) case Op_func_call: case Op_K_delete_loop: case Op_builtin: - return 15; + return 16; case Op_field_spec: case Op_field_spec_lhs: - return 14; - - case Op_exp: - case Op_exp_i: - return 13; + return 15; case Op_preincrement: case Op_predecrement: case Op_postincrement: case Op_postdecrement: - return 12; + return 14; + + case Op_exp: + case Op_exp_i: + return 13; case Op_unary_minus: case Op_not: - return 11; + return 12; case Op_times: case Op_times_i: @@ -1026,23 +1027,26 @@ prec_level(int type) case Op_quotient_i: case Op_mod: case Op_mod_i: - return 10; + return 11; case Op_plus: case Op_plus_i: case Op_minus: case Op_minus_i: - return 9; + return 10; case Op_concat: case Op_assign_concat: - return 8; + return 9; case Op_equal: case Op_notequal: case Op_greater: + case Op_less: case Op_leq: case Op_geq: + return 8; + case Op_match: case Op_nomatch: return 7; @@ -1051,7 +1055,6 @@ prec_level(int type) case Op_K_getline_redir: return 6; - case Op_less: case Op_in_array: return 5; @@ -1360,6 +1363,14 @@ pp_list(int nargs, const char *paren, const char *delim) return str; } +/* is_unary_minus --- return true if string starts with unary minus */ + +static bool +is_unary_minus(const char *str) +{ + return str[0] == '-' && str[1] != '-'; +} + /* pp_concat --- handle concatenation and correct parenthesizing of expressions */ static char * @@ -1401,7 +1412,12 @@ pp_concat(int nargs) pl_l = prec_level(pp_args[i]->type); pl_r = prec_level(pp_args[i+1]->type); - if (is_scalar(pp_args[i]->type) && is_scalar(pp_args[i+1]->type)) { + if (i >= 2 && is_unary_minus(r->pp_str)) { + *s++ = '('; + memcpy(s, r->pp_str, r->pp_len); + s += r->pp_len; + *s++ = ')'; + } else if (is_scalar(pp_args[i]->type) && is_scalar(pp_args[i+1]->type)) { memcpy(s, r->pp_str, r->pp_len); s += r->pp_len; } else if (pl_l <= pl_r || is_scalar(pp_args[i+1]->type)) { @@ -1423,7 +1439,7 @@ pp_concat(int nargs) pl_l = prec_level(pp_args[nargs-1]->type); pl_r = prec_level(pp_args[nargs]->type); r = pp_args[nargs]; - if (pl_l >= pl_r && ! is_scalar(pp_args[nargs]->type)) { + if (is_unary_minus(r->pp_str) || ((pl_l >= pl_r && ! is_scalar(pp_args[nargs]->type)))) { *s++ = '('; memcpy(s, r->pp_str, r->pp_len); s += r->pp_len; diff --git a/test/ChangeLog b/test/ChangeLog index f85de800..c9fe4a27 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-10-30 Arnold D. Robbins + + * Makefile.am (profile6): New test. + * profile6.awk, profile6.ok: New files. + 2014-10-17 Andrew J. Schorr * Makefile.am (profile1, testext): Use explicit ./foo.awk to avoid diff --git a/test/Makefile.am b/test/Makefile.am index f0965d77..15539504 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -706,6 +706,8 @@ EXTRA_DIST = \ profile4.ok \ profile5.awk \ profile5.ok \ + profile6.awk \ + profile6.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -1017,7 +1019,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 pty1 \ + profile1 profile2 profile3 profile4 profile5 profile6 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -1699,6 +1701,12 @@ profile5: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile6: + @echo $@ + @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 diff --git a/test/Makefile.in b/test/Makefile.in index 3df34522..9e56dbf3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -952,6 +952,8 @@ EXTRA_DIST = \ profile4.ok \ profile5.awk \ profile5.ok \ + profile6.awk \ + profile6.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -1262,7 +1264,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 pty1 \ + profile1 profile2 profile3 profile4 profile5 profile6 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -2123,6 +2125,12 @@ profile5: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile6: + @echo $@ + @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 diff --git a/test/profile6.awk b/test/profile6.awk new file mode 100644 index 00000000..754f8ae6 --- /dev/null +++ b/test/profile6.awk @@ -0,0 +1,7 @@ +BEGIN { + x = 3 + print -(-x) + Q = "|" + print -3 Q (-4) + print -3 Q (-4) (-5) +} diff --git a/test/profile6.ok b/test/profile6.ok new file mode 100644 index 00000000..86ff68a6 --- /dev/null +++ b/test/profile6.ok @@ -0,0 +1,10 @@ + # BEGIN rule(s) + + BEGIN { + x = 3 + print -(-x) + Q = "|" + print -3 Q (-4) + print -3 Q (-4) (-5) + } + -- cgit v1.2.3 From 2f19ce406c3c350dcf6de6454d5c7e1bd7755c24 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 1 Nov 2014 21:35:43 +0200 Subject: Fix profile6 test. --- test/ChangeLog | 6 ++++++ test/Makefile.am | 2 +- test/Makefile.in | 2 +- test/profile6.ok | 10 +++++----- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index c9fe4a27..7899db9b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2014-11-01 Arnold D. Robbins + + * Makefile.am (profile6): Actually run profiling. Should make test + output consistent with what's in master. + * profile6.ok: Updated. + 2014-10-30 Arnold D. Robbins * Makefile.am (profile6): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 15539504..fe8806a1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1703,7 +1703,7 @@ profile5: profile6: @echo $@ - @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ diff --git a/test/Makefile.in b/test/Makefile.in index 9e56dbf3..48e9d9bf 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2127,7 +2127,7 @@ profile5: profile6: @echo $@ - @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ diff --git a/test/profile6.ok b/test/profile6.ok index 86ff68a6..0c9486c7 100644 --- a/test/profile6.ok +++ b/test/profile6.ok @@ -1,10 +1,10 @@ # BEGIN rule(s) BEGIN { - x = 3 - print -(-x) - Q = "|" - print -3 Q (-4) - print -3 Q (-4) (-5) + 1 x = 3 + 1 print -(-x) + 1 Q = "|" + 1 print -3 Q (-4) + 1 print -3 Q (-4) (-5) } -- cgit v1.2.3 From 99d0b82fbf3ff42019fadef5fbb396551aa20070 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 1 Nov 2014 21:37:54 +0200 Subject: Rebuild extras/Makefile.in. --- extras/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/Makefile.in b/extras/Makefile.in index d447dc73..86a10745 100644 --- a/extras/Makefile.in +++ b/extras/Makefile.in @@ -103,7 +103,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = extras DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/mkinstalldirs + $(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 \ -- cgit v1.2.3 From bae708045f36e3a000acd9de74084e48471bf389 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 2 Nov 2014 21:28:38 +0200 Subject: Doc fix w.r.t. awk.info domain. --- doc/ChangeLog | 5 + doc/gawk.info | 1077 +++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 2 + doc/gawktexi.in | 2 + 4 files changed, 546 insertions(+), 540 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8460104e..ae3a25cd 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2014-11-02 Arnold D. Robbins + + * gawktexi.in: Comment out that I need an owner for awk.info. + I may have found one or two people. + 2014-10-28 Arnold D. Robbins * gawk.1: Clarification that debugger reads stdin. diff --git a/doc/gawk.info b/doc/gawk.info index 6b851441..32d86905 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -1258,9 +1258,6 @@ for several years. world, please see `http://awk.info/?contribute' for how to contribute it to the web site. - As of this writing, this website is in search of a maintainer; please -contact me if you are interested. -  File: gawk.info, Node: Acknowledgments, Prev: How To Contribute, Up: Preface @@ -34301,542 +34298,542 @@ Node: Manual History63192 Ref: Manual History-Footnote-166183 Ref: Manual History-Footnote-266224 Node: How To Contribute66298 -Node: Acknowledgments67537 -Node: Getting Started72345 -Node: Running gawk74779 -Node: One-shot75969 -Node: Read Terminal77194 -Node: Long79221 -Node: Executable Scripts80737 -Ref: Executable Scripts-Footnote-183526 -Node: Comments83628 -Node: Quoting86101 -Node: DOS Quoting91607 -Node: Sample Data Files92282 -Node: Very Simple94875 -Node: Two Rules99766 -Node: More Complex101652 -Node: Statements/Lines104514 -Ref: Statements/Lines-Footnote-1108970 -Node: Other Features109235 -Node: When110166 -Ref: When-Footnote-1111922 -Node: Intro Summary111987 -Node: Invoking Gawk112870 -Node: Command Line114385 -Node: Options115176 -Ref: Options-Footnote-1131088 -Node: Other Arguments131113 -Node: Naming Standard Input134074 -Node: Environment Variables135167 -Node: AWKPATH Variable135725 -Ref: AWKPATH Variable-Footnote-1139025 -Ref: AWKPATH Variable-Footnote-2139070 -Node: AWKLIBPATH Variable139330 -Node: Other Environment Variables140473 -Node: Exit Status144193 -Node: Include Files144868 -Node: Loading Shared Libraries148456 -Node: Obsolete149883 -Node: Undocumented150580 -Node: Invoking Summary150847 -Node: Regexp152513 -Node: Regexp Usage153972 -Node: Escape Sequences156005 -Node: Regexp Operators162022 -Ref: Regexp Operators-Footnote-1169456 -Ref: Regexp Operators-Footnote-2169603 -Node: Bracket Expressions169701 -Ref: table-char-classes171718 -Node: Leftmost Longest174658 -Node: Computed Regexps175960 -Node: GNU Regexp Operators179357 -Node: Case-sensitivity183059 -Ref: Case-sensitivity-Footnote-1185949 -Ref: Case-sensitivity-Footnote-2186184 -Node: Regexp Summary186292 -Node: Reading Files187761 -Node: Records189855 -Node: awk split records190587 -Node: gawk split records195501 -Ref: gawk split records-Footnote-1200040 -Node: Fields200077 -Ref: Fields-Footnote-1202875 -Node: Nonconstant Fields202961 -Ref: Nonconstant Fields-Footnote-1205197 -Node: Changing Fields205399 -Node: Field Separators211331 -Node: Default Field Splitting214035 -Node: Regexp Field Splitting215152 -Node: Single Character Fields218502 -Node: Command Line Field Separator219561 -Node: Full Line Fields222773 -Ref: Full Line Fields-Footnote-1223281 -Node: Field Splitting Summary223327 -Ref: Field Splitting Summary-Footnote-1226458 -Node: Constant Size226559 -Node: Splitting By Content231165 -Ref: Splitting By Content-Footnote-1235238 -Node: Multiple Line235278 -Ref: Multiple Line-Footnote-1241167 -Node: Getline241346 -Node: Plain Getline243557 -Node: Getline/Variable246197 -Node: Getline/File247344 -Node: Getline/Variable/File248728 -Ref: Getline/Variable/File-Footnote-1250329 -Node: Getline/Pipe250416 -Node: Getline/Variable/Pipe253099 -Node: Getline/Coprocess254230 -Node: Getline/Variable/Coprocess255482 -Node: Getline Notes256221 -Node: Getline Summary259013 -Ref: table-getline-variants259425 -Node: Read Timeout260254 -Ref: Read Timeout-Footnote-1264068 -Node: Command-line directories264126 -Node: Input Summary265030 -Node: Input Exercises268282 -Node: Printing269010 -Node: Print270787 -Node: Print Examples272244 -Node: Output Separators275023 -Node: OFMT277041 -Node: Printf278395 -Node: Basic Printf279180 -Node: Control Letters280751 -Node: Format Modifiers284735 -Node: Printf Examples290742 -Node: Redirection293224 -Node: Special FD300063 -Ref: Special FD-Footnote-1303220 -Node: Special Files303294 -Node: Other Inherited Files303910 -Node: Special Network304910 -Node: Special Caveats305771 -Node: Close Files And Pipes306722 -Ref: Close Files And Pipes-Footnote-1313901 -Ref: Close Files And Pipes-Footnote-2314049 -Node: Output Summary314199 -Node: Output Exercises315195 -Node: Expressions315875 -Node: Values317060 -Node: Constants317736 -Node: Scalar Constants318416 -Ref: Scalar Constants-Footnote-1319275 -Node: Nondecimal-numbers319525 -Node: Regexp Constants322525 -Node: Using Constant Regexps323050 -Node: Variables326188 -Node: Using Variables326843 -Node: Assignment Options328753 -Node: Conversion330628 -Node: Strings And Numbers331152 -Ref: Strings And Numbers-Footnote-1334216 -Node: Locale influences conversions334325 -Ref: table-locale-affects337070 -Node: All Operators337658 -Node: Arithmetic Ops338288 -Node: Concatenation340793 -Ref: Concatenation-Footnote-1343612 -Node: Assignment Ops343718 -Ref: table-assign-ops348701 -Node: Increment Ops349979 -Node: Truth Values and Conditions353417 -Node: Truth Values354500 -Node: Typing and Comparison355549 -Node: Variable Typing356342 -Node: Comparison Operators359994 -Ref: table-relational-ops360404 -Node: POSIX String Comparison363919 -Ref: POSIX String Comparison-Footnote-1364991 -Node: Boolean Ops365129 -Ref: Boolean Ops-Footnote-1369608 -Node: Conditional Exp369699 -Node: Function Calls371426 -Node: Precedence375306 -Node: Locales378974 -Node: Expressions Summary380605 -Node: Patterns and Actions383179 -Node: Pattern Overview384299 -Node: Regexp Patterns385978 -Node: Expression Patterns386521 -Node: Ranges390301 -Node: BEGIN/END393407 -Node: Using BEGIN/END394169 -Ref: Using BEGIN/END-Footnote-1396906 -Node: I/O And BEGIN/END397012 -Node: BEGINFILE/ENDFILE399326 -Node: Empty402227 -Node: Using Shell Variables402544 -Node: Action Overview404820 -Node: Statements407147 -Node: If Statement408995 -Node: While Statement410493 -Node: Do Statement412521 -Node: For Statement413663 -Node: Switch Statement416818 -Node: Break Statement419206 -Node: Continue Statement421247 -Node: Next Statement423072 -Node: Nextfile Statement425452 -Node: Exit Statement428082 -Node: Built-in Variables430485 -Node: User-modified431618 -Ref: User-modified-Footnote-1439298 -Node: Auto-set439360 -Ref: Auto-set-Footnote-1452390 -Ref: Auto-set-Footnote-2452595 -Node: ARGC and ARGV452651 -Node: Pattern Action Summary456855 -Node: Arrays459282 -Node: Array Basics460611 -Node: Array Intro461455 -Ref: figure-array-elements463419 -Ref: Array Intro-Footnote-1465943 -Node: Reference to Elements466071 -Node: Assigning Elements468521 -Node: Array Example469012 -Node: Scanning an Array470770 -Node: Controlling Scanning473786 -Ref: Controlling Scanning-Footnote-1478975 -Node: Numeric Array Subscripts479291 -Node: Uninitialized Subscripts481476 -Node: Delete483093 -Ref: Delete-Footnote-1485837 -Node: Multidimensional485894 -Node: Multiscanning488989 -Node: Arrays of Arrays490578 -Node: Arrays Summary495339 -Node: Functions497444 -Node: Built-in498317 -Node: Calling Built-in499395 -Node: Numeric Functions501383 -Ref: Numeric Functions-Footnote-1505405 -Ref: Numeric Functions-Footnote-2505762 -Ref: Numeric Functions-Footnote-3505810 -Node: String Functions506079 -Ref: String Functions-Footnote-1529551 -Ref: String Functions-Footnote-2529680 -Ref: String Functions-Footnote-3529928 -Node: Gory Details530015 -Ref: table-sub-escapes531796 -Ref: table-sub-proposed533316 -Ref: table-posix-sub534680 -Ref: table-gensub-escapes536220 -Ref: Gory Details-Footnote-1537052 -Node: I/O Functions537203 -Ref: I/O Functions-Footnote-1544304 -Node: Time Functions544451 -Ref: Time Functions-Footnote-1554920 -Ref: Time Functions-Footnote-2554988 -Ref: Time Functions-Footnote-3555146 -Ref: Time Functions-Footnote-4555257 -Ref: Time Functions-Footnote-5555369 -Ref: Time Functions-Footnote-6555596 -Node: Bitwise Functions555862 -Ref: table-bitwise-ops556424 -Ref: Bitwise Functions-Footnote-1560732 -Node: Type Functions560901 -Node: I18N Functions562050 -Node: User-defined563695 -Node: Definition Syntax564499 -Ref: Definition Syntax-Footnote-1569905 -Node: Function Example569974 -Ref: Function Example-Footnote-1572891 -Node: Function Caveats572913 -Node: Calling A Function573431 -Node: Variable Scope574386 -Node: Pass By Value/Reference577374 -Node: Return Statement580884 -Node: Dynamic Typing583868 -Node: Indirect Calls584797 -Ref: Indirect Calls-Footnote-1596101 -Node: Functions Summary596229 -Node: Library Functions598928 -Ref: Library Functions-Footnote-1602546 -Ref: Library Functions-Footnote-2602689 -Node: Library Names602860 -Ref: Library Names-Footnote-1606320 -Ref: Library Names-Footnote-2606540 -Node: General Functions606626 -Node: Strtonum Function607729 -Node: Assert Function610749 -Node: Round Function614073 -Node: Cliff Random Function615614 -Node: Ordinal Functions616630 -Ref: Ordinal Functions-Footnote-1619695 -Ref: Ordinal Functions-Footnote-2619947 -Node: Join Function620158 -Ref: Join Function-Footnote-1621929 -Node: Getlocaltime Function622129 -Node: Readfile Function625870 -Node: Shell Quoting627840 -Node: Data File Management629241 -Node: Filetrans Function629873 -Node: Rewind Function633932 -Node: File Checking635317 -Ref: File Checking-Footnote-1636645 -Node: Empty Files636846 -Node: Ignoring Assigns638825 -Node: Getopt Function640376 -Ref: Getopt Function-Footnote-1651836 -Node: Passwd Functions652039 -Ref: Passwd Functions-Footnote-1660890 -Node: Group Functions660978 -Ref: Group Functions-Footnote-1668881 -Node: Walking Arrays669094 -Node: Library Functions Summary670697 -Node: Library Exercises672098 -Node: Sample Programs673378 -Node: Running Examples674148 -Node: Clones674876 -Node: Cut Program676100 -Node: Egrep Program685830 -Ref: Egrep Program-Footnote-1693334 -Node: Id Program693444 -Node: Split Program697088 -Ref: Split Program-Footnote-1700534 -Node: Tee Program700662 -Node: Uniq Program703449 -Node: Wc Program710870 -Ref: Wc Program-Footnote-1715118 -Node: Miscellaneous Programs715210 -Node: Dupword Program716423 -Node: Alarm Program718454 -Node: Translate Program723258 -Ref: Translate Program-Footnote-1727822 -Node: Labels Program728092 -Ref: Labels Program-Footnote-1731441 -Node: Word Sorting731525 -Node: History Sorting735595 -Node: Extract Program737431 -Node: Simple Sed744963 -Node: Igawk Program748025 -Ref: Igawk Program-Footnote-1762351 -Ref: Igawk Program-Footnote-2762552 -Ref: Igawk Program-Footnote-3762674 -Node: Anagram Program762789 -Node: Signature Program765851 -Node: Programs Summary767098 -Node: Programs Exercises768291 -Ref: Programs Exercises-Footnote-1772422 -Node: Advanced Features772513 -Node: Nondecimal Data774461 -Node: Array Sorting776051 -Node: Controlling Array Traversal776748 -Ref: Controlling Array Traversal-Footnote-1785079 -Node: Array Sorting Functions785197 -Ref: Array Sorting Functions-Footnote-1789089 -Node: Two-way I/O789283 -Ref: Two-way I/O-Footnote-1794227 -Ref: Two-way I/O-Footnote-2794413 -Node: TCP/IP Networking794495 -Node: Profiling797367 -Node: Advanced Features Summary804911 -Node: Internationalization806844 -Node: I18N and L10N808324 -Node: Explaining gettext809010 -Ref: Explaining gettext-Footnote-1814039 -Ref: Explaining gettext-Footnote-2814223 -Node: Programmer i18n814388 -Ref: Programmer i18n-Footnote-1819254 -Node: Translator i18n819303 -Node: String Extraction820097 -Ref: String Extraction-Footnote-1821228 -Node: Printf Ordering821314 -Ref: Printf Ordering-Footnote-1824100 -Node: I18N Portability824164 -Ref: I18N Portability-Footnote-1826613 -Node: I18N Example826676 -Ref: I18N Example-Footnote-1829476 -Node: Gawk I18N829548 -Node: I18N Summary830186 -Node: Debugger831525 -Node: Debugging832547 -Node: Debugging Concepts832988 -Node: Debugging Terms834845 -Node: Awk Debugging837420 -Node: Sample Debugging Session838312 -Node: Debugger Invocation838832 -Node: Finding The Bug840216 -Node: List of Debugger Commands846691 -Node: Breakpoint Control848023 -Node: Debugger Execution Control851715 -Node: Viewing And Changing Data855079 -Node: Execution Stack858444 -Node: Debugger Info860082 -Node: Miscellaneous Debugger Commands864099 -Node: Readline Support869291 -Node: Limitations870183 -Node: Debugging Summary872280 -Node: Arbitrary Precision Arithmetic873448 -Node: Computer Arithmetic874864 -Ref: table-numeric-ranges878465 -Ref: Computer Arithmetic-Footnote-1879324 -Node: Math Definitions879381 -Ref: table-ieee-formats882668 -Ref: Math Definitions-Footnote-1883272 -Node: MPFR features883377 -Node: FP Math Caution885048 -Ref: FP Math Caution-Footnote-1886098 -Node: Inexactness of computations886467 -Node: Inexact representation887415 -Node: Comparing FP Values888770 -Node: Errors accumulate889843 -Node: Getting Accuracy891276 -Node: Try To Round893935 -Node: Setting precision894834 -Ref: table-predefined-precision-strings895518 -Node: Setting the rounding mode897312 -Ref: table-gawk-rounding-modes897676 -Ref: Setting the rounding mode-Footnote-1901130 -Node: Arbitrary Precision Integers901309 -Ref: Arbitrary Precision Integers-Footnote-1904300 -Node: POSIX Floating Point Problems904449 -Ref: POSIX Floating Point Problems-Footnote-1908325 -Node: Floating point summary908363 -Node: Dynamic Extensions910555 -Node: Extension Intro912107 -Node: Plugin License913373 -Node: Extension Mechanism Outline914170 -Ref: figure-load-extension914598 -Ref: figure-register-new-function916078 -Ref: figure-call-new-function917082 -Node: Extension API Description919068 -Node: Extension API Functions Introduction920518 -Node: General Data Types925354 -Ref: General Data Types-Footnote-1931041 -Node: Memory Allocation Functions931340 -Ref: Memory Allocation Functions-Footnote-1934170 -Node: Constructor Functions934266 -Node: Registration Functions936000 -Node: Extension Functions936685 -Node: Exit Callback Functions938981 -Node: Extension Version String940229 -Node: Input Parsers940879 -Node: Output Wrappers950694 -Node: Two-way processors955210 -Node: Printing Messages957414 -Ref: Printing Messages-Footnote-1958491 -Node: Updating `ERRNO'958643 -Node: Requesting Values959383 -Ref: table-value-types-returned960111 -Node: Accessing Parameters961069 -Node: Symbol Table Access962300 -Node: Symbol table by name962814 -Node: Symbol table by cookie964794 -Ref: Symbol table by cookie-Footnote-1968933 -Node: Cached values968996 -Ref: Cached values-Footnote-1972500 -Node: Array Manipulation972591 -Ref: Array Manipulation-Footnote-1973689 -Node: Array Data Types973728 -Ref: Array Data Types-Footnote-1976385 -Node: Array Functions976477 -Node: Flattening Arrays980331 -Node: Creating Arrays987218 -Node: Extension API Variables991985 -Node: Extension Versioning992621 -Node: Extension API Informational Variables994522 -Node: Extension API Boilerplate995610 -Node: Finding Extensions999426 -Node: Extension Example999986 -Node: Internal File Description1000758 -Node: Internal File Ops1004825 -Ref: Internal File Ops-Footnote-11016483 -Node: Using Internal File Ops1016623 -Ref: Using Internal File Ops-Footnote-11019006 -Node: Extension Samples1019279 -Node: Extension Sample File Functions1020803 -Node: Extension Sample Fnmatch1028405 -Node: Extension Sample Fork1029887 -Node: Extension Sample Inplace1031100 -Node: Extension Sample Ord1032775 -Node: Extension Sample Readdir1033611 -Ref: table-readdir-file-types1034487 -Node: Extension Sample Revout1035298 -Node: Extension Sample Rev2way1035889 -Node: Extension Sample Read write array1036630 -Node: Extension Sample Readfile1038569 -Node: Extension Sample Time1039664 -Node: Extension Sample API Tests1041013 -Node: gawkextlib1041504 -Node: Extension summary1044154 -Node: Extension Exercises1047836 -Node: Language History1048558 -Node: V7/SVR3.11050215 -Node: SVR41052396 -Node: POSIX1053841 -Node: BTL1055230 -Node: POSIX/GNU1055964 -Node: Feature History1061533 -Node: Common Extensions1074631 -Node: Ranges and Locales1075955 -Ref: Ranges and Locales-Footnote-11080594 -Ref: Ranges and Locales-Footnote-21080621 -Ref: Ranges and Locales-Footnote-31080855 -Node: Contributors1081076 -Node: History summary1086616 -Node: Installation1087985 -Node: Gawk Distribution1088941 -Node: Getting1089425 -Node: Extracting1090249 -Node: Distribution contents1091891 -Node: Unix Installation1097608 -Node: Quick Installation1098225 -Node: Additional Configuration Options1100656 -Node: Configuration Philosophy1102396 -Node: Non-Unix Installation1104747 -Node: PC Installation1105205 -Node: PC Binary Installation1106531 -Node: PC Compiling1108379 -Ref: PC Compiling-Footnote-11111400 -Node: PC Testing1111505 -Node: PC Using1112681 -Node: Cygwin1116796 -Node: MSYS1117619 -Node: VMS Installation1118117 -Node: VMS Compilation1118909 -Ref: VMS Compilation-Footnote-11120131 -Node: VMS Dynamic Extensions1120189 -Node: VMS Installation Details1121873 -Node: VMS Running1124125 -Node: VMS GNV1126966 -Node: VMS Old Gawk1127700 -Node: Bugs1128170 -Node: Other Versions1132074 -Node: Installation summary1138287 -Node: Notes1139343 -Node: Compatibility Mode1140208 -Node: Additions1140990 -Node: Accessing The Source1141915 -Node: Adding Code1143351 -Node: New Ports1149523 -Node: Derived Files1154005 -Ref: Derived Files-Footnote-11159480 -Ref: Derived Files-Footnote-21159514 -Ref: Derived Files-Footnote-31160110 -Node: Future Extensions1160224 -Node: Implementation Limitations1160830 -Node: Extension Design1162078 -Node: Old Extension Problems1163232 -Ref: Old Extension Problems-Footnote-11164749 -Node: Extension New Mechanism Goals1164806 -Ref: Extension New Mechanism Goals-Footnote-11168166 -Node: Extension Other Design Decisions1168355 -Node: Extension Future Growth1170463 -Node: Old Extension Mechanism1171299 -Node: Notes summary1173061 -Node: Basic Concepts1174247 -Node: Basic High Level1174928 -Ref: figure-general-flow1175200 -Ref: figure-process-flow1175799 -Ref: Basic High Level-Footnote-11179028 -Node: Basic Data Typing1179213 -Node: Glossary1182541 -Node: Copying1207699 -Node: GNU Free Documentation License1245255 -Node: Index1270391 +Node: Acknowledgments67429 +Node: Getting Started72237 +Node: Running gawk74671 +Node: One-shot75861 +Node: Read Terminal77086 +Node: Long79113 +Node: Executable Scripts80629 +Ref: Executable Scripts-Footnote-183418 +Node: Comments83520 +Node: Quoting85993 +Node: DOS Quoting91499 +Node: Sample Data Files92174 +Node: Very Simple94767 +Node: Two Rules99658 +Node: More Complex101544 +Node: Statements/Lines104406 +Ref: Statements/Lines-Footnote-1108862 +Node: Other Features109127 +Node: When110058 +Ref: When-Footnote-1111814 +Node: Intro Summary111879 +Node: Invoking Gawk112762 +Node: Command Line114277 +Node: Options115068 +Ref: Options-Footnote-1130980 +Node: Other Arguments131005 +Node: Naming Standard Input133966 +Node: Environment Variables135059 +Node: AWKPATH Variable135617 +Ref: AWKPATH Variable-Footnote-1138917 +Ref: AWKPATH Variable-Footnote-2138962 +Node: AWKLIBPATH Variable139222 +Node: Other Environment Variables140365 +Node: Exit Status144085 +Node: Include Files144760 +Node: Loading Shared Libraries148348 +Node: Obsolete149775 +Node: Undocumented150472 +Node: Invoking Summary150739 +Node: Regexp152405 +Node: Regexp Usage153864 +Node: Escape Sequences155897 +Node: Regexp Operators161914 +Ref: Regexp Operators-Footnote-1169348 +Ref: Regexp Operators-Footnote-2169495 +Node: Bracket Expressions169593 +Ref: table-char-classes171610 +Node: Leftmost Longest174550 +Node: Computed Regexps175852 +Node: GNU Regexp Operators179249 +Node: Case-sensitivity182951 +Ref: Case-sensitivity-Footnote-1185841 +Ref: Case-sensitivity-Footnote-2186076 +Node: Regexp Summary186184 +Node: Reading Files187653 +Node: Records189747 +Node: awk split records190479 +Node: gawk split records195393 +Ref: gawk split records-Footnote-1199932 +Node: Fields199969 +Ref: Fields-Footnote-1202767 +Node: Nonconstant Fields202853 +Ref: Nonconstant Fields-Footnote-1205089 +Node: Changing Fields205291 +Node: Field Separators211223 +Node: Default Field Splitting213927 +Node: Regexp Field Splitting215044 +Node: Single Character Fields218394 +Node: Command Line Field Separator219453 +Node: Full Line Fields222665 +Ref: Full Line Fields-Footnote-1223173 +Node: Field Splitting Summary223219 +Ref: Field Splitting Summary-Footnote-1226350 +Node: Constant Size226451 +Node: Splitting By Content231057 +Ref: Splitting By Content-Footnote-1235130 +Node: Multiple Line235170 +Ref: Multiple Line-Footnote-1241059 +Node: Getline241238 +Node: Plain Getline243449 +Node: Getline/Variable246089 +Node: Getline/File247236 +Node: Getline/Variable/File248620 +Ref: Getline/Variable/File-Footnote-1250221 +Node: Getline/Pipe250308 +Node: Getline/Variable/Pipe252991 +Node: Getline/Coprocess254122 +Node: Getline/Variable/Coprocess255374 +Node: Getline Notes256113 +Node: Getline Summary258905 +Ref: table-getline-variants259317 +Node: Read Timeout260146 +Ref: Read Timeout-Footnote-1263960 +Node: Command-line directories264018 +Node: Input Summary264922 +Node: Input Exercises268174 +Node: Printing268902 +Node: Print270679 +Node: Print Examples272136 +Node: Output Separators274915 +Node: OFMT276933 +Node: Printf278287 +Node: Basic Printf279072 +Node: Control Letters280643 +Node: Format Modifiers284627 +Node: Printf Examples290634 +Node: Redirection293116 +Node: Special FD299955 +Ref: Special FD-Footnote-1303112 +Node: Special Files303186 +Node: Other Inherited Files303802 +Node: Special Network304802 +Node: Special Caveats305663 +Node: Close Files And Pipes306614 +Ref: Close Files And Pipes-Footnote-1313793 +Ref: Close Files And Pipes-Footnote-2313941 +Node: Output Summary314091 +Node: Output Exercises315087 +Node: Expressions315767 +Node: Values316952 +Node: Constants317628 +Node: Scalar Constants318308 +Ref: Scalar Constants-Footnote-1319167 +Node: Nondecimal-numbers319417 +Node: Regexp Constants322417 +Node: Using Constant Regexps322942 +Node: Variables326080 +Node: Using Variables326735 +Node: Assignment Options328645 +Node: Conversion330520 +Node: Strings And Numbers331044 +Ref: Strings And Numbers-Footnote-1334108 +Node: Locale influences conversions334217 +Ref: table-locale-affects336962 +Node: All Operators337550 +Node: Arithmetic Ops338180 +Node: Concatenation340685 +Ref: Concatenation-Footnote-1343504 +Node: Assignment Ops343610 +Ref: table-assign-ops348593 +Node: Increment Ops349871 +Node: Truth Values and Conditions353309 +Node: Truth Values354392 +Node: Typing and Comparison355441 +Node: Variable Typing356234 +Node: Comparison Operators359886 +Ref: table-relational-ops360296 +Node: POSIX String Comparison363811 +Ref: POSIX String Comparison-Footnote-1364883 +Node: Boolean Ops365021 +Ref: Boolean Ops-Footnote-1369500 +Node: Conditional Exp369591 +Node: Function Calls371318 +Node: Precedence375198 +Node: Locales378866 +Node: Expressions Summary380497 +Node: Patterns and Actions383071 +Node: Pattern Overview384191 +Node: Regexp Patterns385870 +Node: Expression Patterns386413 +Node: Ranges390193 +Node: BEGIN/END393299 +Node: Using BEGIN/END394061 +Ref: Using BEGIN/END-Footnote-1396798 +Node: I/O And BEGIN/END396904 +Node: BEGINFILE/ENDFILE399218 +Node: Empty402119 +Node: Using Shell Variables402436 +Node: Action Overview404712 +Node: Statements407039 +Node: If Statement408887 +Node: While Statement410385 +Node: Do Statement412413 +Node: For Statement413555 +Node: Switch Statement416710 +Node: Break Statement419098 +Node: Continue Statement421139 +Node: Next Statement422964 +Node: Nextfile Statement425344 +Node: Exit Statement427974 +Node: Built-in Variables430377 +Node: User-modified431510 +Ref: User-modified-Footnote-1439190 +Node: Auto-set439252 +Ref: Auto-set-Footnote-1452282 +Ref: Auto-set-Footnote-2452487 +Node: ARGC and ARGV452543 +Node: Pattern Action Summary456747 +Node: Arrays459174 +Node: Array Basics460503 +Node: Array Intro461347 +Ref: figure-array-elements463311 +Ref: Array Intro-Footnote-1465835 +Node: Reference to Elements465963 +Node: Assigning Elements468413 +Node: Array Example468904 +Node: Scanning an Array470662 +Node: Controlling Scanning473678 +Ref: Controlling Scanning-Footnote-1478867 +Node: Numeric Array Subscripts479183 +Node: Uninitialized Subscripts481368 +Node: Delete482985 +Ref: Delete-Footnote-1485729 +Node: Multidimensional485786 +Node: Multiscanning488881 +Node: Arrays of Arrays490470 +Node: Arrays Summary495231 +Node: Functions497336 +Node: Built-in498209 +Node: Calling Built-in499287 +Node: Numeric Functions501275 +Ref: Numeric Functions-Footnote-1505297 +Ref: Numeric Functions-Footnote-2505654 +Ref: Numeric Functions-Footnote-3505702 +Node: String Functions505971 +Ref: String Functions-Footnote-1529443 +Ref: String Functions-Footnote-2529572 +Ref: String Functions-Footnote-3529820 +Node: Gory Details529907 +Ref: table-sub-escapes531688 +Ref: table-sub-proposed533208 +Ref: table-posix-sub534572 +Ref: table-gensub-escapes536112 +Ref: Gory Details-Footnote-1536944 +Node: I/O Functions537095 +Ref: I/O Functions-Footnote-1544196 +Node: Time Functions544343 +Ref: Time Functions-Footnote-1554812 +Ref: Time Functions-Footnote-2554880 +Ref: Time Functions-Footnote-3555038 +Ref: Time Functions-Footnote-4555149 +Ref: Time Functions-Footnote-5555261 +Ref: Time Functions-Footnote-6555488 +Node: Bitwise Functions555754 +Ref: table-bitwise-ops556316 +Ref: Bitwise Functions-Footnote-1560624 +Node: Type Functions560793 +Node: I18N Functions561942 +Node: User-defined563587 +Node: Definition Syntax564391 +Ref: Definition Syntax-Footnote-1569797 +Node: Function Example569866 +Ref: Function Example-Footnote-1572783 +Node: Function Caveats572805 +Node: Calling A Function573323 +Node: Variable Scope574278 +Node: Pass By Value/Reference577266 +Node: Return Statement580776 +Node: Dynamic Typing583760 +Node: Indirect Calls584689 +Ref: Indirect Calls-Footnote-1595993 +Node: Functions Summary596121 +Node: Library Functions598820 +Ref: Library Functions-Footnote-1602438 +Ref: Library Functions-Footnote-2602581 +Node: Library Names602752 +Ref: Library Names-Footnote-1606212 +Ref: Library Names-Footnote-2606432 +Node: General Functions606518 +Node: Strtonum Function607621 +Node: Assert Function610641 +Node: Round Function613965 +Node: Cliff Random Function615506 +Node: Ordinal Functions616522 +Ref: Ordinal Functions-Footnote-1619587 +Ref: Ordinal Functions-Footnote-2619839 +Node: Join Function620050 +Ref: Join Function-Footnote-1621821 +Node: Getlocaltime Function622021 +Node: Readfile Function625762 +Node: Shell Quoting627732 +Node: Data File Management629133 +Node: Filetrans Function629765 +Node: Rewind Function633824 +Node: File Checking635209 +Ref: File Checking-Footnote-1636537 +Node: Empty Files636738 +Node: Ignoring Assigns638717 +Node: Getopt Function640268 +Ref: Getopt Function-Footnote-1651728 +Node: Passwd Functions651931 +Ref: Passwd Functions-Footnote-1660782 +Node: Group Functions660870 +Ref: Group Functions-Footnote-1668773 +Node: Walking Arrays668986 +Node: Library Functions Summary670589 +Node: Library Exercises671990 +Node: Sample Programs673270 +Node: Running Examples674040 +Node: Clones674768 +Node: Cut Program675992 +Node: Egrep Program685722 +Ref: Egrep Program-Footnote-1693226 +Node: Id Program693336 +Node: Split Program696980 +Ref: Split Program-Footnote-1700426 +Node: Tee Program700554 +Node: Uniq Program703341 +Node: Wc Program710762 +Ref: Wc Program-Footnote-1715010 +Node: Miscellaneous Programs715102 +Node: Dupword Program716315 +Node: Alarm Program718346 +Node: Translate Program723150 +Ref: Translate Program-Footnote-1727714 +Node: Labels Program727984 +Ref: Labels Program-Footnote-1731333 +Node: Word Sorting731417 +Node: History Sorting735487 +Node: Extract Program737323 +Node: Simple Sed744855 +Node: Igawk Program747917 +Ref: Igawk Program-Footnote-1762243 +Ref: Igawk Program-Footnote-2762444 +Ref: Igawk Program-Footnote-3762566 +Node: Anagram Program762681 +Node: Signature Program765743 +Node: Programs Summary766990 +Node: Programs Exercises768183 +Ref: Programs Exercises-Footnote-1772314 +Node: Advanced Features772405 +Node: Nondecimal Data774353 +Node: Array Sorting775943 +Node: Controlling Array Traversal776640 +Ref: Controlling Array Traversal-Footnote-1784971 +Node: Array Sorting Functions785089 +Ref: Array Sorting Functions-Footnote-1788981 +Node: Two-way I/O789175 +Ref: Two-way I/O-Footnote-1794119 +Ref: Two-way I/O-Footnote-2794305 +Node: TCP/IP Networking794387 +Node: Profiling797259 +Node: Advanced Features Summary804803 +Node: Internationalization806736 +Node: I18N and L10N808216 +Node: Explaining gettext808902 +Ref: Explaining gettext-Footnote-1813931 +Ref: Explaining gettext-Footnote-2814115 +Node: Programmer i18n814280 +Ref: Programmer i18n-Footnote-1819146 +Node: Translator i18n819195 +Node: String Extraction819989 +Ref: String Extraction-Footnote-1821120 +Node: Printf Ordering821206 +Ref: Printf Ordering-Footnote-1823992 +Node: I18N Portability824056 +Ref: I18N Portability-Footnote-1826505 +Node: I18N Example826568 +Ref: I18N Example-Footnote-1829368 +Node: Gawk I18N829440 +Node: I18N Summary830078 +Node: Debugger831417 +Node: Debugging832439 +Node: Debugging Concepts832880 +Node: Debugging Terms834737 +Node: Awk Debugging837312 +Node: Sample Debugging Session838204 +Node: Debugger Invocation838724 +Node: Finding The Bug840108 +Node: List of Debugger Commands846583 +Node: Breakpoint Control847915 +Node: Debugger Execution Control851607 +Node: Viewing And Changing Data854971 +Node: Execution Stack858336 +Node: Debugger Info859974 +Node: Miscellaneous Debugger Commands863991 +Node: Readline Support869183 +Node: Limitations870075 +Node: Debugging Summary872172 +Node: Arbitrary Precision Arithmetic873340 +Node: Computer Arithmetic874756 +Ref: table-numeric-ranges878357 +Ref: Computer Arithmetic-Footnote-1879216 +Node: Math Definitions879273 +Ref: table-ieee-formats882560 +Ref: Math Definitions-Footnote-1883164 +Node: MPFR features883269 +Node: FP Math Caution884940 +Ref: FP Math Caution-Footnote-1885990 +Node: Inexactness of computations886359 +Node: Inexact representation887307 +Node: Comparing FP Values888662 +Node: Errors accumulate889735 +Node: Getting Accuracy891168 +Node: Try To Round893827 +Node: Setting precision894726 +Ref: table-predefined-precision-strings895410 +Node: Setting the rounding mode897204 +Ref: table-gawk-rounding-modes897568 +Ref: Setting the rounding mode-Footnote-1901022 +Node: Arbitrary Precision Integers901201 +Ref: Arbitrary Precision Integers-Footnote-1904192 +Node: POSIX Floating Point Problems904341 +Ref: POSIX Floating Point Problems-Footnote-1908217 +Node: Floating point summary908255 +Node: Dynamic Extensions910447 +Node: Extension Intro911999 +Node: Plugin License913265 +Node: Extension Mechanism Outline914062 +Ref: figure-load-extension914490 +Ref: figure-register-new-function915970 +Ref: figure-call-new-function916974 +Node: Extension API Description918960 +Node: Extension API Functions Introduction920410 +Node: General Data Types925246 +Ref: General Data Types-Footnote-1930933 +Node: Memory Allocation Functions931232 +Ref: Memory Allocation Functions-Footnote-1934062 +Node: Constructor Functions934158 +Node: Registration Functions935892 +Node: Extension Functions936577 +Node: Exit Callback Functions938873 +Node: Extension Version String940121 +Node: Input Parsers940771 +Node: Output Wrappers950586 +Node: Two-way processors955102 +Node: Printing Messages957306 +Ref: Printing Messages-Footnote-1958383 +Node: Updating `ERRNO'958535 +Node: Requesting Values959275 +Ref: table-value-types-returned960003 +Node: Accessing Parameters960961 +Node: Symbol Table Access962192 +Node: Symbol table by name962706 +Node: Symbol table by cookie964686 +Ref: Symbol table by cookie-Footnote-1968825 +Node: Cached values968888 +Ref: Cached values-Footnote-1972392 +Node: Array Manipulation972483 +Ref: Array Manipulation-Footnote-1973581 +Node: Array Data Types973620 +Ref: Array Data Types-Footnote-1976277 +Node: Array Functions976369 +Node: Flattening Arrays980223 +Node: Creating Arrays987110 +Node: Extension API Variables991877 +Node: Extension Versioning992513 +Node: Extension API Informational Variables994414 +Node: Extension API Boilerplate995502 +Node: Finding Extensions999318 +Node: Extension Example999878 +Node: Internal File Description1000650 +Node: Internal File Ops1004717 +Ref: Internal File Ops-Footnote-11016375 +Node: Using Internal File Ops1016515 +Ref: Using Internal File Ops-Footnote-11018898 +Node: Extension Samples1019171 +Node: Extension Sample File Functions1020695 +Node: Extension Sample Fnmatch1028297 +Node: Extension Sample Fork1029779 +Node: Extension Sample Inplace1030992 +Node: Extension Sample Ord1032667 +Node: Extension Sample Readdir1033503 +Ref: table-readdir-file-types1034379 +Node: Extension Sample Revout1035190 +Node: Extension Sample Rev2way1035781 +Node: Extension Sample Read write array1036522 +Node: Extension Sample Readfile1038461 +Node: Extension Sample Time1039556 +Node: Extension Sample API Tests1040905 +Node: gawkextlib1041396 +Node: Extension summary1044046 +Node: Extension Exercises1047728 +Node: Language History1048450 +Node: V7/SVR3.11050107 +Node: SVR41052288 +Node: POSIX1053733 +Node: BTL1055122 +Node: POSIX/GNU1055856 +Node: Feature History1061425 +Node: Common Extensions1074523 +Node: Ranges and Locales1075847 +Ref: Ranges and Locales-Footnote-11080486 +Ref: Ranges and Locales-Footnote-21080513 +Ref: Ranges and Locales-Footnote-31080747 +Node: Contributors1080968 +Node: History summary1086508 +Node: Installation1087877 +Node: Gawk Distribution1088833 +Node: Getting1089317 +Node: Extracting1090141 +Node: Distribution contents1091783 +Node: Unix Installation1097500 +Node: Quick Installation1098117 +Node: Additional Configuration Options1100548 +Node: Configuration Philosophy1102288 +Node: Non-Unix Installation1104639 +Node: PC Installation1105097 +Node: PC Binary Installation1106423 +Node: PC Compiling1108271 +Ref: PC Compiling-Footnote-11111292 +Node: PC Testing1111397 +Node: PC Using1112573 +Node: Cygwin1116688 +Node: MSYS1117511 +Node: VMS Installation1118009 +Node: VMS Compilation1118801 +Ref: VMS Compilation-Footnote-11120023 +Node: VMS Dynamic Extensions1120081 +Node: VMS Installation Details1121765 +Node: VMS Running1124017 +Node: VMS GNV1126858 +Node: VMS Old Gawk1127592 +Node: Bugs1128062 +Node: Other Versions1131966 +Node: Installation summary1138179 +Node: Notes1139235 +Node: Compatibility Mode1140100 +Node: Additions1140882 +Node: Accessing The Source1141807 +Node: Adding Code1143243 +Node: New Ports1149415 +Node: Derived Files1153897 +Ref: Derived Files-Footnote-11159372 +Ref: Derived Files-Footnote-21159406 +Ref: Derived Files-Footnote-31160002 +Node: Future Extensions1160116 +Node: Implementation Limitations1160722 +Node: Extension Design1161970 +Node: Old Extension Problems1163124 +Ref: Old Extension Problems-Footnote-11164641 +Node: Extension New Mechanism Goals1164698 +Ref: Extension New Mechanism Goals-Footnote-11168058 +Node: Extension Other Design Decisions1168247 +Node: Extension Future Growth1170355 +Node: Old Extension Mechanism1171191 +Node: Notes summary1172953 +Node: Basic Concepts1174139 +Node: Basic High Level1174820 +Ref: figure-general-flow1175092 +Ref: figure-process-flow1175691 +Ref: Basic High Level-Footnote-11178920 +Node: Basic Data Typing1179105 +Node: Glossary1182433 +Node: Copying1207591 +Node: GNU Free Documentation License1245147 +Node: Index1270283  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 9e3d63d0..52fd2003 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -2014,8 +2014,10 @@ a @command{gawk} extension that you would like to share with the rest of the world, please see @uref{http://awk.info/?contribute} for how to contribute it to the web site. +@ignore As of this writing, this website is in search of a maintainer; please contact me if you are interested. +@end ignore @ignore Other links: diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 2599b8ca..6a66f8c4 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -1981,8 +1981,10 @@ a @command{gawk} extension that you would like to share with the rest of the world, please see @uref{http://awk.info/?contribute} for how to contribute it to the web site. +@ignore As of this writing, this website is in search of a maintainer; please contact me if you are interested. +@end ignore @ignore Other links: -- cgit v1.2.3 From c5227d1685aa158e63d4b6a6289063ae985673c1 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 2 Nov 2014 21:29:20 +0200 Subject: Additional profiling fix. --- ChangeLog | 5 +++++ profile.c | 26 ++++++++++++++++++++++++-- test/ChangeLog | 6 ++++++ test/Makefile.am | 12 ++++++++++-- test/Makefile.in | 12 ++++++++++-- test/profile7.awk | 12 ++++++++++++ test/profile7.ok | 15 +++++++++++++++ 7 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 test/profile7.awk create mode 100644 test/profile7.ok diff --git a/ChangeLog b/ChangeLog index a74dadd9..dd3a494a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-02 Arnold D. Robbins + + * profile.c (div_on_left_mul_on_right): New function. + (parenthesize): Call it. + 2014-10-30 Arnold D. Robbins * configure: Regenerated after fix to m4/readline.m4. diff --git a/profile.c b/profile.c index ed17e62b..316ba393 100644 --- a/profile.c +++ b/profile.c @@ -1180,6 +1180,26 @@ pp_parenthesize(NODE *sp) sp->flags |= CAN_FREE; } +/* div_on_left_mul_on_right --- have / or % on left and * on right */ + +static bool +div_on_left_mul_on_right(int o1, int o2) +{ + OPCODE op1 = (OPCODE) o1; + OPCODE op2 = (OPCODE) o2; + + switch (op1) { + case Op_quotient: + case Op_quotient_i: + case Op_mod: + case Op_mod_i: + return (op2 == Op_times || op2 == Op_times_i); + + default: + return false; + } +} + /* parenthesize --- parenthesize two nodes relative to parent node type */ static void @@ -1189,9 +1209,11 @@ parenthesize(int type, NODE *left, NODE *right) int lprec = prec_level(left->type); int prec = prec_level(type); - if (lprec < prec) + if (lprec < prec + || (lprec == prec && div_on_left_mul_on_right(left->type, type))) pp_parenthesize(left); - if (rprec < prec) + if (rprec < prec + || (rprec == prec && div_on_left_mul_on_right(type, right->type))) pp_parenthesize(right); } diff --git a/test/ChangeLog b/test/ChangeLog index 7899db9b..ab6c9431 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2014-11-02 Arnold D. Robbins + + * Makefile.am (profile7): New test. + (profile6): Add missing @ in front of gawk run. + * profile7.awk, profile7.ok: New files. + 2014-11-01 Arnold D. Robbins * Makefile.am (profile6): Actually run profiling. Should make test diff --git a/test/Makefile.am b/test/Makefile.am index fe8806a1..f8db2833 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -708,6 +708,8 @@ EXTRA_DIST = \ profile5.ok \ profile6.awk \ profile6.ok \ + profile7.awk \ + profile7.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -1019,7 +1021,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 pty1 \ + profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -1703,7 +1705,13 @@ profile5: profile6: @echo $@ - $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile7: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ diff --git a/test/Makefile.in b/test/Makefile.in index 48e9d9bf..a337288b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -954,6 +954,8 @@ EXTRA_DIST = \ profile5.ok \ profile6.awk \ profile6.ok \ + profile7.awk \ + profile7.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -1264,7 +1266,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 pty1 \ + profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -2127,7 +2129,13 @@ profile5: profile6: @echo $@ - $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile7: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ diff --git a/test/profile7.awk b/test/profile7.awk new file mode 100644 index 00000000..454694f9 --- /dev/null +++ b/test/profile7.awk @@ -0,0 +1,12 @@ +BEGIN { + print 1 / 10 * 10 + print 1 / (10 * 10) + print 1 % 10 * 10 + print 1 % (10 * 10) + print (10 * 5) / 2 + print 10 * (5 / 2) + a = 5 + b = 3 + print a - 1 - b + print a + 1 - b +} diff --git a/test/profile7.ok b/test/profile7.ok new file mode 100644 index 00000000..d65afa86 --- /dev/null +++ b/test/profile7.ok @@ -0,0 +1,15 @@ + # BEGIN rule(s) + + BEGIN { + 1 print 1 / 10 * 10 + 1 print 1 / (10 * 10) + 1 print 1 % 10 * 10 + 1 print 1 % (10 * 10) + 1 print 10 * 5 / 2 + 1 print 10 * 5 / 2 + 1 a = 5 + 1 b = 3 + 1 print a - 1 - b + 1 print a + 1 - b + } + -- cgit v1.2.3 From c9936ef0d4d7a7f263831bead31c5ffcf8b0a8d3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 3 Nov 2014 20:34:25 +0200 Subject: Use dfa superset to speed up matching. --- ChangeLog | 4 ++++ re.c | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd3a494a..a7b66969 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-11-03 Norihiro Tanaka + + * re.c (research): Use dfa superset to improve matching speed. + 2014-11-02 Arnold D. Robbins * profile.c (div_on_left_mul_on_right): New function. diff --git a/re.c b/re.c index 9118129e..12c212a6 100644 --- a/re.c +++ b/re.c @@ -284,13 +284,18 @@ research(Regexp *rp, char *str, int start, if (rp->dfa && ! no_bol && ! need_start) { char save; size_t count = 0; + struct dfa *superset = dfasuperset(rp->dfareg); /* * dfa likes to stick a '\n' right after the matched * text. So we just save and restore the character. */ save = str[start+len]; - ret = dfaexec(rp->dfareg, str+start, str+start+len, true, - &count, &try_backref); + if (superset) + ret = dfaexec(superset, str+start, str+start+len, + true, NULL, NULL); + if (ret) + ret = dfaexec(rp->dfareg, str+start, str+start+len, + true, &count, &try_backref); str[start+len] = save; } -- cgit v1.2.3 From 46a457244070dac0ff575293348748f1d8db4352 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 5 Nov 2014 05:34:04 +0200 Subject: Small build fix in awklib. --- awklib/ChangeLog | 5 +++++ awklib/Makefile.am | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/awklib/ChangeLog b/awklib/ChangeLog index 13d6b090..bede4234 100644 --- a/awklib/ChangeLog +++ b/awklib/ChangeLog @@ -1,3 +1,8 @@ +2014-11-05 Juergen Kahrs + + * Makefile.am (AWKPROG): Add quotes around the name in case the + build dir has spaces in it. + 2014-10-17 Andrew J. Schorr * Makefile.am (stamp-eg): Use explicit ./extract.awk to avoid diff --git a/awklib/Makefile.am b/awklib/Makefile.am index 82b7e07f..2e1adaf1 100644 --- a/awklib/Makefile.am +++ b/awklib/Makefile.am @@ -30,7 +30,7 @@ EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg if TEST_CROSS_COMPILE AWKPROG = LC_ALL=C LANG=C awk$(EXEEXT) else -AWKPROG = LC_ALL=C LANG=C $(abs_top_builddir)/gawk$(EXEEXT) +AWKPROG = LC_ALL=C LANG=C "$(abs_top_builddir)/gawk$(EXEEXT)" endif # Get config.h from the build directory and custom.h from the source directory. -- cgit v1.2.3 From 50925902635e9b66288318fd768157dbeb529f08 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 5 Nov 2014 06:24:09 +0200 Subject: Forgot awklib/Makefile.in. --- awklib/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awklib/Makefile.in b/awklib/Makefile.in index 4c9a0552..eb707f6c 100644 --- a/awklib/Makefile.in +++ b/awklib/Makefile.in @@ -342,7 +342,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg -@TEST_CROSS_COMPILE_FALSE@AWKPROG = LC_ALL=C LANG=C $(abs_top_builddir)/gawk$(EXEEXT) +@TEST_CROSS_COMPILE_FALSE@AWKPROG = LC_ALL=C LANG=C "$(abs_top_builddir)/gawk$(EXEEXT)" # With some locales, the script extract.awk fails. # So we fix the locale to some sensible value. @TEST_CROSS_COMPILE_TRUE@AWKPROG = LC_ALL=C LANG=C awk$(EXEEXT) -- cgit v1.2.3 From c483c50817e8accd0d5052d41d00869330193175 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Wed, 5 Nov 2014 12:29:58 -0500 Subject: If getline fails due to a retryable I/O error, return -2 without closing the file only if PROCINFO[, "RETRY"] is configured. --- ChangeLog | 7 +++++++ extension/ChangeLog | 7 +++++++ extension/select.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++-- io.c | 11 +++++++++-- 4 files changed, 76 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4cf75d0f..f37300d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-11-05 Andrew J. Schorr + + * io.c (retryable): New function to indicate whether I/O can be + retried for this file instead of throwing a hard error. + (get_a_record) Check whether this file is configured for retryable + I/O before returning nonstandard -2. + 2014-11-03 Norihiro Tanaka * re.c (research): Use dfa superset to improve matching speed. diff --git a/extension/ChangeLog b/extension/ChangeLog index 82ae5b69..5d278f6c 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,10 @@ +2014-11-05 Andrew J. Schorr + + * select.c (set_retry): New function to set PROCINFO[, "RETRY"]. + (do_set_non_blocking): If called with a file name as opposed to a file + descriptor, call the set_retry function to configure PROCINFO to tell + io.c to retry I/O for temporary failures. + 2014-10-08 Arnold D. Robbins * inplace.c (do_inplace_begin): Use a cast to void in front diff --git a/extension/select.c b/extension/select.c index 9aefaeac..1752ee34 100644 --- a/extension/select.c +++ b/extension/select.c @@ -496,6 +496,53 @@ set_non_blocking(int fd) #endif } +static void +set_retry(const char *name) +{ + static const char suffix[] = "RETRY"; + static awk_array_t procinfo; + static char *subsep; + static size_t subsep_len; + awk_value_t idx, val; + char *s; + size_t len; + + if (!subsep) { + /* initialize cached values for PROCINFO and SUBSEP */ + awk_value_t res; + + if (! sym_lookup("PROCINFO", AWK_ARRAY, & res)) { + procinfo = create_array(); + res.val_type = AWK_ARRAY; + res.array_cookie = procinfo; + if (! sym_update("PROCINFO", & res)) { + warning(ext_id, _("set_non_blocking: could not install PROCINFO array; unable to configure PROCINFO RETRY for `%s'"), name); + return; + } + /* must retrieve it after installing it! */ + if (! sym_lookup("PROCINFO", AWK_ARRAY, & res)) { + warning(ext_id, _("set_non_blocking: sym_lookup(`%s') failed; unable to configure PROCINFO RETRY for `%s'"), "PROCINFO", name); + return; + } + } + procinfo = res.array_cookie; + + if (! sym_lookup("SUBSEP", AWK_STRING, & res)) { + warning(ext_id, _("set_non_blocking: sym_lookup(`%s') failed; unable to configure PROCINFO RETRY for `%s'"), "SUBSEP", name); + return; + } + subsep = strdup(res.str_value.str); + subsep_len = res.str_value.len; + } + + len = strlen(name)+subsep_len+sizeof(suffix)-1; + emalloc(s, char *, len+2, "set_non_blocking"); + sprintf(s, "%s%s%s", name, subsep, suffix); + + if (! set_array_element(procinfo, make_malloced_string(s, len, &idx), make_null_string(&val))) + warning(ext_id, _("set_non_blocking: unable to configure PROCINFO RETRY for `%s'"), name); +} + /* do_set_non_blocking --- Set a file to be non-blocking */ static awk_value_t * @@ -520,8 +567,12 @@ do_set_non_blocking(int nargs, awk_value_t *result) (get_argument(1, AWK_STRING, & cmdtype) || (! cmd.str_value.len && (nargs == 1)))) { const awk_input_buf_t *buf; - if ((buf = get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len)) != NULL) - return make_number(set_non_blocking(buf->fd), result); + if ((buf = get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len)) != NULL) { + int rc = set_non_blocking(buf->fd); + if (rc == 0) + set_retry(buf->name); + return make_number(rc, result); + } warning(ext_id, _("set_non_blocking: get_file(`%s', `%s') failed"), cmd.str_value.str, cmdtype.str_value.str); } else if (do_lint) { if (nargs < 2) diff --git a/io.c b/io.c index 5692a519..6d816da7 100644 --- a/io.c +++ b/io.c @@ -3425,6 +3425,13 @@ find_longest_terminator: return REC_OK; } +/* return true if PROCINFO[, "RETRY"] exists */ +static inline int +retryable(IOBUF *iop) +{ + return PROCINFO_node && in_PROCINFO(iop->public.name, "RETRY", NULL); +} + /* Does the I/O error indicate that the operation should be retried later? */ static inline int @@ -3500,7 +3507,7 @@ get_a_record(char **out, /* pointer to pointer to data */ return EOF; } else if (iop->count == -1) { *errcode = errno; - if (errno_io_retry()) + if (errno_io_retry() && retryable(iop)) return -2; iop->flag |= IOP_AT_EOF; return EOF; @@ -3576,7 +3583,7 @@ get_a_record(char **out, /* pointer to pointer to data */ iop->count = iop->public.read_func(iop->public.fd, iop->dataend, amt_to_read); if (iop->count == -1) { *errcode = errno; - if (errno_io_retry()) + if (errno_io_retry() && retryable(iop)) return -2; iop->flag |= IOP_AT_EOF; break; -- cgit v1.2.3 From e3f20c041c078eacf648af94d9f012e4906359bb Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 6 Nov 2014 14:18:37 -0500 Subject: Enhance get_file API to return info about input and output and to enable extensions to create already-opened files or sockets. --- ChangeLog | 23 ++++++++++++++++++++ awk.h | 3 ++- eval.c | 1 - extension/ChangeLog | 12 +++++++++++ extension/errno.c | 2 -- extension/select.c | 41 ++++++++++++++++++++++++++++-------- extension/testext.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ gawkapi.c | 20 +++++++++++------- gawkapi.h | 34 +++++++++++++++++++++++------- io.c | 34 +++++++++++++++++++++--------- test/ChangeLog | 4 ++++ test/testext.ok | 6 ++++++ 12 files changed, 201 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index f37300d0..86477a6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2014-11-06 Andrew J. Schorr + + * awk.h (redirect_string): First argument should be const. Add a new + extfd argument to enable extensions to create files with pre-opened + file descriptors. + (after_beginfile): Declare function used in both eval.c and gawkapi.c. + * eval.c (after_beginfile): Remove extern declaration now in awk.h. + * gawkapi.c (api_get_file): Implement API changes to return + awk_input_buf_t and/or awk_output_buf_t info, as well as accept an + fd for inserting an opened file into the table. + * gawkapi.h (gawk_api): Modify the api_get_file declaration to + return awk_bool_t and add 3 new arguments -- a file descriptor + for inserting an already opened file, and awk_input_buf_t and + awk_output_buf_t to return info about both input and output. + (get_file): Add new arguments to the macro. + * io.c (redirect_string): First arg should be const, and add a new + extfd arg so extensions can pass in a file that has already been + opened by the extension. Use the passed-in fd when appropriate, + and pass it into two_way_open. + (redirect): Pass new fd -1 arg to redirect_string. + (two_way_open): Accept new extension fd parameter and open it + as a socket. + 2014-11-05 Andrew J. Schorr * io.c (retryable): New function to indicate whether I/O can be diff --git a/awk.h b/awk.h index 1f4364ad..8ec6bccb 100644 --- a/awk.h +++ b/awk.h @@ -1524,7 +1524,7 @@ extern void set_FNR(void); extern void set_NR(void); extern struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg); -extern struct redirect *redirect_string(char *redir_exp_str, size_t redir_exp_len, int not_string_flag, int redirtype, int *errflg); +extern struct redirect *redirect_string(const char *redir_exp_str, size_t redir_exp_len, int not_string_flag, int redirtype, int *errflg, int extfd); extern NODE *do_close(int nargs); extern int flush_io(void); extern int close_io(bool *stdio_problem); @@ -1543,6 +1543,7 @@ extern int is_off_limits_var(const char *var); extern char *estrdup(const char *str, size_t len); extern void update_global_values(); extern long getenv_long(const char *name); +extern void after_beginfile(IOBUF **curfile); /* mpfr.c */ extern void set_PREC(void); diff --git a/eval.c b/eval.c index e7a346d3..2c8d3064 100644 --- a/eval.c +++ b/eval.c @@ -25,7 +25,6 @@ #include "awk.h" -extern void after_beginfile(IOBUF **curfile); extern double pow(double x, double y); extern double modf(double x, double *yp); extern double fmod(double x, double y); diff --git a/extension/ChangeLog b/extension/ChangeLog index 5d278f6c..b8e68674 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,15 @@ +2014-11-06 Andrew J. Schorr + + * errno.c (do_errno2name, do_name2errno): Remove unused variable 'str'. + * select.c (do_signal): Remove unused variable 'override'. + (grabfd): New helper function to map a gawk file to the appropriate + fd for use in the arguments to selectd. + (do_select): get_file has 3 new arguments and returns info about both + the input and output buf. + (do_set_non_blocking): Support changes to get_file API. + * testext.c (test_get_file): New test function to check that extension + file creation via the get_file API is working. + 2014-11-05 Andrew J. Schorr * select.c (set_retry): New function to set PROCINFO[, "RETRY"]. diff --git a/extension/errno.c b/extension/errno.c index 2eafa437..5dc15d79 100644 --- a/extension/errno.c +++ b/extension/errno.c @@ -86,7 +86,6 @@ static awk_value_t * do_errno2name(int nargs, awk_value_t *result) { awk_value_t errnum; - const char *str; if (do_lint && nargs > 1) lintwarn(ext_id, _("errno2name: called with too many arguments")); @@ -112,7 +111,6 @@ static awk_value_t * do_name2errno(int nargs, awk_value_t *result) { awk_value_t err; - const char *str; if (do_lint && nargs > 1) lintwarn(ext_id, _("name2errno: called with too many arguments")); diff --git a/extension/select.c b/extension/select.c index 1752ee34..597b3a6b 100644 --- a/extension/select.c +++ b/extension/select.c @@ -223,7 +223,6 @@ do_signal(int nargs, awk_value_t *result) #ifdef HAVE_SIGACTION { - awk_value_t override; struct sigaction sa, prev; sa.sa_handler = func; sigfillset(& sa.sa_mask); /* block all signals in handler */ @@ -307,6 +306,27 @@ do_kill(int nargs, awk_value_t *result) #endif } +static int +grabfd(int i, const awk_input_buf_t *ibuf, const awk_output_buf_t *obuf, const char *fnm, const char *ftp) +{ + switch (i) { + case 0: /* read */ + return ibuf ? ibuf->fd : -1; + case 1: /* write */ + return obuf ? fileno(obuf->fp) : -1; + case 2: /* except */ + if (ibuf) { + if (obuf && ibuf->fd != fileno(obuf->fp)) + warning(ext_id, _("select: `%s', `%s' in `except' array has clashing fds, using input %d, not output %d"), fnm, ftp, ibuf->fd, fileno(obuf->fp)); + return ibuf->fd; + } + if (obuf) + return fileno(obuf->fp); + break; + } + return -1; +} + /* do_select --- I/O multiplexing */ static awk_value_t * @@ -362,9 +382,11 @@ do_select(int nargs, awk_value_t *result) if (((EL.value.val_type == AWK_UNDEFINED) || ((EL.value.val_type == AWK_STRING) && ! EL.value.str_value.len)) && (integer_string(EL.index.str_value.str, &x) == 0) && (x >= 0)) fds[i].array2fd[j] = x; else if (EL.value.val_type == AWK_STRING) { - const awk_input_buf_t *buf; - if ((buf = get_file(EL.index.str_value.str, EL.index.str_value.len, EL.value.str_value.str, EL.value.str_value.len)) != NULL) - fds[i].array2fd[j] = buf->fd; + const awk_input_buf_t *ibuf; + const awk_output_buf_t *obuf; + int fd; + if (get_file(EL.index.str_value.str, EL.index.str_value.len, EL.value.str_value.str, EL.value.str_value.len, -1, &ibuf, &obuf) && ((fd = grabfd(i, ibuf, obuf, EL.index.str_value.str, EL.value.str_value.str)) >= 0)) + fds[i].array2fd[j] = fd; else warning(ext_id, _("select: get_file(`%s', `%s') failed in `%s' array"), EL.index.str_value.str, EL.value.str_value.str, argname[i]); } @@ -566,11 +588,12 @@ do_set_non_blocking(int nargs, awk_value_t *result) else if (get_argument(0, AWK_STRING, & cmd) && (get_argument(1, AWK_STRING, & cmdtype) || (! cmd.str_value.len && (nargs == 1)))) { - const awk_input_buf_t *buf; - if ((buf = get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len)) != NULL) { - int rc = set_non_blocking(buf->fd); - if (rc == 0) - set_retry(buf->name); + const awk_input_buf_t *ibuf; + const awk_output_buf_t *obuf; + if (get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len, -1, &ibuf, &obuf)) { + int rc = set_non_blocking(ibuf ? ibuf->fd : fileno(obuf->fp)); + if (rc == 0 && ibuf) + set_retry(ibuf->name); return make_number(rc, result); } warning(ext_id, _("set_non_blocking: get_file(`%s', `%s') failed"), cmd.str_value.str, cmdtype.str_value.str); diff --git a/extension/testext.c b/extension/testext.c index 7462265b..3ac1f124 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -37,6 +37,7 @@ #include #include +#include #include "gawkapi.h" @@ -710,6 +711,7 @@ BEGIN { ret = test_indirect_vars() # should get correct value of NR printf("test_indirect_var() return %d\n", ret) delete ARGV[1] + print "" } */ @@ -742,6 +744,63 @@ out: return result; } +/* +BEGIN { + outfile = "testexttmp.txt" + alias = ".test.alias" + print "line 1" > outfile + print "line 2" > outfile + print "line 3" > outfile + close(outfile) + ret = test_get_file(outfile, alias) + printf "test_get_file returned %d\n", ret + nr = 0 + while ((getline < alias) > 0) + printf "File [%s] nr [%s]: %s\n", alias, ++nr, $0 + close(alias) + system("rm " outfile) + print "" +} +*/ + +/* test_get_file --- test that we can create a file */ + +static awk_value_t * +test_get_file(int nargs, awk_value_t *result) +{ + awk_value_t filename, alias; + int fd; + const awk_input_buf_t *ibuf; + const awk_output_buf_t *obuf; + + if (nargs != 2) { + printf("%s: nargs not right (%d should be 2)\n", __func__, nargs); + return make_number(-1.0, result); + } + + if (! get_argument(0, AWK_STRING, & filename)) { + printf("%s: cannot get first arg\n", __func__); + return make_number(-1.0, result); + } + if (! get_argument(1, AWK_STRING, & alias)) { + printf("%s: cannot get first arg\n", __func__); + return make_number(-1.0, result); + } + if ((fd = open(filename.str_value.str, O_RDONLY)) < 0) { + printf("%s: open(%s) failed\n", __func__, filename.str_value.str); + return make_number(-1.0, result); + } + if (! get_file(alias.str_value.str, strlen(alias.str_value.str), "<", 1, fd, &ibuf, &obuf)) { + printf("%s: get_file(%s) failed\n", __func__, alias.str_value.str); + return make_number(-1.0, result); + } + if (! ibuf || ibuf->fd != fd) { + printf("%s: get_file(%s) returned fd %d instead of %d\n", __func__, alias.str_value.str, ibuf ? ibuf->fd : -1, fd); + return make_number(-1.0, result); + } + return make_number(0.0, result); +} + /* fill_in_array --- fill in a new array */ static void @@ -837,6 +896,7 @@ static awk_ext_func_t func_table[] = { { "test_scalar", test_scalar, 1 }, { "test_scalar_reserved", test_scalar_reserved, 0 }, { "test_indirect_vars", test_indirect_vars, 0 }, + { "test_get_file", test_get_file, 2 }, }; /* init_testext --- additional initialization function */ diff --git a/gawkapi.c b/gawkapi.c index 46aef7b6..00a101ea 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -1039,8 +1039,8 @@ api_release_value(awk_ext_id_t id, awk_value_cookie_t value) /* api_get_file --- return a handle to an existing or newly opened file */ -static const awk_input_buf_t * -api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, size_t typelen) +static awk_bool_t +api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, size_t typelen, int fd, const awk_input_buf_t **ibufp, const awk_output_buf_t **obufp) { const struct redirect *f; int flag; /* not used, sigh */ @@ -1049,7 +1049,7 @@ api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *file if ((name == NULL) || (namelen == 0)) { if (curfile == NULL) { if (nextfile(& curfile, false) <= 0) - return NULL; + return awk_false; { INSTRUCTION *pc = main_beginfile; /* save execution state */ @@ -1072,7 +1072,9 @@ api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *file source = save_source; } } - return &curfile->public; + *ibufp = &curfile->public; + *obufp = NULL; + return awk_true; } redirtype = redirect_none; switch (typelen) { @@ -1110,11 +1112,13 @@ api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *file if (redirtype == redirect_none) { warning(_("cannot open unrecognized file type `%s' for `%s'"), filetype, name); - return NULL; + return awk_false; } - if ((f = redirect_string(name, namelen, 0, redirtype, &flag)) == NULL) - return NULL; - return &f->iop->public; + if ((f = redirect_string(name, namelen, 0, redirtype, &flag, fd)) == NULL) + return awk_false; + *ibufp = f->iop ? & f->iop->public : NULL; + *obufp = f->output.fp ? & f->output : NULL; + return awk_true; } /* diff --git a/gawkapi.h b/gawkapi.h index dbe7fdf8..65f1dfc3 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -679,16 +679,34 @@ typedef struct gawk_api { * Look up a file. If the name is NULL or name_len is 0, it returns * data for the currently open input file corresponding to FILENAME * (and it will not access the filetype or typelen arguments, so those - * may be undefined). + * may be undefined). * If the file is not already open, it tries to open it. * The "filetype" argument should be one of: * ">", ">>", "<", "|>", "|<", and "|&" + * If the file is not already open, and the fd argument is non-negative, + * gawk will use that file descriptor instead of opening the file + * in the usual way. If the fd is non-negative, but the file exists + * already, gawk ignores the fd and returns the existing file. It is + * the caller's responsibility to notice that the fd in the returned + * awk_input_buf_t does not match the requested value. Note that + * supplying a file descriptor is currently NOT supported for pipes. + * It should work for input, output, append, and two-way (coprocess) + * sockets. If the filetype is two-way, we assume that it is a socket! + * Note that in the two-way case, the intput and output file descriptors + * may differ. To check for success, one must check that either of + * them matches. */ - const awk_input_buf_t *(*api_get_file)(awk_ext_id_t id, - const char *name, - size_t name_len, - const char *filetype, - size_t typelen); + awk_bool_t (*api_get_file)(awk_ext_id_t id, + const char *name, + size_t name_len, + const char *filetype, + size_t typelen, int fd, + /* + * Return values (on success, one or both should + * be non-NULL): + */ + const awk_input_buf_t **ibufp, + const awk_output_buf_t **obufp); } gawk_api_t; #ifndef GAWK /* these are not for the gawk code itself! */ @@ -771,8 +789,8 @@ typedef struct gawk_api { #define release_value(value) \ (api->api_release_value(ext_id, value)) -#define get_file(name, namelen, filetype, typelen) \ - (api->api_get_file(ext_id, name, namelen, filetype, typelen)) +#define get_file(name, namelen, filetype, typelen, fd, ibuf, obuf) \ + (api->api_get_file(ext_id, name, namelen, filetype, typelen, fd, ibuf, obuf)) #define register_ext_version(version) \ (api->api_register_ext_version(ext_id, version)) diff --git a/io.c b/io.c index 6d816da7..e9947da3 100644 --- a/io.c +++ b/io.c @@ -264,7 +264,7 @@ static IOBUF *iop_alloc(int fd, const char *name, int errno_val); static IOBUF *iop_finish(IOBUF *iop); static int gawk_pclose(struct redirect *rp); static int str2mode(const char *mode); -static int two_way_open(const char *str, struct redirect *rp); +static int two_way_open(const char *str, struct redirect *rp, int extfd); static int pty_vs_pipe(const char *command); static void find_input_parser(IOBUF *iop); static bool find_output_wrapper(awk_output_buf_t *outbuf); @@ -720,7 +720,7 @@ redflags2str(int flags) /* redirect --- Redirection for printf and print commands */ struct redirect * -redirect_string(char *str, size_t explen, int not_string, int redirtype, int *errflg) +redirect_string(const char *str, size_t explen, int not_string, int redirtype, int *errflg, int extfd) { struct redirect *rp; int tflag = 0; @@ -848,7 +848,7 @@ redirect_string(char *str, size_t explen, int not_string, int redirtype, int *er memcpy(newstr, str, explen); newstr[explen] = '\0'; str = newstr; - rp->value = str; + rp->value = newstr; rp->flag = tflag; init_output_wrapper(& rp->output); rp->output.name = str; @@ -880,6 +880,10 @@ redirect_string(char *str, size_t explen, int not_string, int redirtype, int *er mode = binmode("a"); break; case redirect_pipe: + if (extfd >= 0) { + warning(_("get_file cannot create pipe `%s' with fd %d"), str, extfd); + return NULL; + } /* synchronize output before new pipe */ (void) flush_io(); @@ -893,6 +897,10 @@ redirect_string(char *str, size_t explen, int not_string, int redirtype, int *er rp->flag |= RED_NOBUF; break; case redirect_pipein: + if (extfd >= 0) { + warning(_("get_file cannot create pipe `%s' with fd %d"), str, extfd); + return NULL; + } direction = "from"; if (gawk_popen(str, rp) == NULL) fatal(_("can't open pipe `%s' for input (%s)"), @@ -900,7 +908,7 @@ redirect_string(char *str, size_t explen, int not_string, int redirtype, int *er break; case redirect_input: direction = "from"; - fd = devopen(str, binmode("r")); + fd = (extfd >= 0) ? extfd : devopen(str, binmode("r")); if (fd == INVALID_HANDLE && errno == EISDIR) { *errflg = EISDIR; /* do not free rp, saving it for reuse (save_rp = rp) */ @@ -917,8 +925,14 @@ redirect_string(char *str, size_t explen, int not_string, int redirtype, int *er } break; case redirect_twoway: +#ifndef HAVE_SOCKETS + if (extfd >= 0) { + warning(_("get_file socket creation not supported on this platform for `%s' with fd %d"), str, extfd); + return NULL; + } +#endif direction = "to/from"; - if (! two_way_open(str, rp)) { + if (! two_way_open(str, rp, extfd)) { #ifdef HAVE_SOCKETS if (inetfile(str, NULL)) { *errflg = errno; @@ -937,7 +951,7 @@ redirect_string(char *str, size_t explen, int not_string, int redirtype, int *er if (mode != NULL) { errno = 0; rp->output.mode = mode; - fd = devopen(str, mode); + fd = (extfd >= 0) ? extfd : devopen(str, mode); if (fd > INVALID_HANDLE) { if (fd == fileno(stdin)) @@ -1042,7 +1056,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) int not_string = ((redir_exp->flags & STRCUR) == 0); redir_exp = force_string(redir_exp); return redirect_string(redir_exp->stptr, redir_exp->stlen, not_string, - redirtype, errflg); + redirtype, errflg, -1); } /* getredirect --- find the struct redirect for this file or pipe */ @@ -1700,16 +1714,16 @@ strictopen: /* two_way_open --- open a two way communications channel */ static int -two_way_open(const char *str, struct redirect *rp) +two_way_open(const char *str, struct redirect *rp, int extfd) { static bool no_ptys = false; #ifdef HAVE_SOCKETS /* case 1: socket */ - if (inetfile(str, NULL)) { + if (extfd >= 0 || inetfile(str, NULL)) { int fd, newfd; - fd = devopen(str, "rw"); + fd = (extfd >= 0) ? extfd : devopen(str, "rw"); if (fd == INVALID_HANDLE) return false; if ((BINMODE & BINMODE_OUTPUT) != 0) diff --git a/test/ChangeLog b/test/ChangeLog index 9d49a888..b6d60d97 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-11-06 Andrew J. Schorr + + * testext.ok: Add results from new test_get_file test. + 2014-11-02 Arnold D. Robbins * Makefile.am (profile7): New test. diff --git a/test/testext.ok b/test/testext.ok index 9b36bf72..5a78c159 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -69,6 +69,12 @@ test_scalar_reserved: could not update new_value2 for ARGC - pass test_indirect_var: sym_lookup of NR passed test_indirect_var: value of NR is 3 test_indirect_var() return 1 + +test_get_file returned 0 +File [.test.alias] nr [1]: line 1 +File [.test.alias] nr [2]: line 2 +File [.test.alias] nr [3]: line 3 + answer_num = 42 message_string = hello, world new_array["hello"] = "world" -- cgit v1.2.3 From d0299eb46c0f4551d355591a58e88715fee139e7 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 9 Nov 2014 09:09:57 -0500 Subject: Add new functions input_fd and output_fd to the select extension. --- extension/ChangeLog | 10 +++++++++ extension/select.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ extension/testext.c | 12 +++++----- 3 files changed, 79 insertions(+), 6 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index b8e68674..ba0d3bfa 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,13 @@ +2014-11-09 Andrew J. Schorr + + * select.c (do_input_fd): New function to return the input file + descriptor associated with a file/command. + (do_output_fd): New function to return the output file descriptor + associated with a file/command. + (func_table): Add new functions "input_fd" and "output_fd". + * testext.c (test_get_file): Do not use __func__, since it is a C99 + feature, and gawk does not assume C99. + 2014-11-06 Andrew J. Schorr * errno.c (do_errno2name, do_name2errno): Remove unused variable 'str'. diff --git a/extension/select.c b/extension/select.c index 597b3a6b..b2105b75 100644 --- a/extension/select.c +++ b/extension/select.c @@ -606,11 +606,74 @@ do_set_non_blocking(int nargs, awk_value_t *result) return make_number(-1, result); } +/* do_input_fd --- Return command's input file descriptor */ + +static awk_value_t * +do_input_fd(int nargs, awk_value_t *result) +{ + awk_value_t cmd, cmdtype; + + if (do_lint && nargs > 2) + lintwarn(ext_id, _("input_fd: called with too many arguments")); + /* + * N.B. If called with a single "" arg, we want it to work! In that + * case, the 1st arg is an empty string, and get_argument fails on the + * 2nd arg. Note that API get_file promises not to access the type + * argument if the name argument is an empty string. + */ + if (get_argument(0, AWK_STRING, & cmd) && + (get_argument(1, AWK_STRING, & cmdtype) || + (! cmd.str_value.len && (nargs == 1)))) { + const awk_input_buf_t *ibuf; + const awk_output_buf_t *obuf; + if (get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len, -1, &ibuf, &obuf) && ibuf) + return make_number(ibuf->fd, result); + warning(ext_id, _("input_fd: get_file(`%s', `%s') failed to return an input descriptor"), cmd.str_value.str, cmdtype.str_value.str); + } else if (do_lint) { + if (nargs < 2) + lintwarn(ext_id, _("input_fd: called with too few arguments")); + else + lintwarn(ext_id, _("input_fd: called with inappropriate argument(s)")); + } + return make_number(-1, result); +} + +/* do_output_fd --- Return command's output file descriptor */ + +static awk_value_t * +do_output_fd(int nargs, awk_value_t *result) +{ + awk_value_t cmd, cmdtype; + + if (do_lint && nargs > 2) + lintwarn(ext_id, _("output_fd: called with too many arguments")); + /* + * N.B. If called with a single "" arg, it will not work, since there + * is no output fd associated the current input file. + */ + if (get_argument(0, AWK_STRING, & cmd) && + get_argument(1, AWK_STRING, & cmdtype)) { + const awk_input_buf_t *ibuf; + const awk_output_buf_t *obuf; + if (get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len, -1, &ibuf, &obuf) && obuf) + return make_number(fileno(obuf->fp), result); + warning(ext_id, _("output_fd: get_file(`%s', `%s') failed to return an output descriptor"), cmd.str_value.str, cmdtype.str_value.str); + } else if (do_lint) { + if (nargs < 2) + lintwarn(ext_id, _("output_fd: called with too few arguments")); + else + lintwarn(ext_id, _("output_fd: called with inappropriate argument(s)")); + } + return make_number(-1, result); +} + static awk_ext_func_t func_table[] = { { "select", do_select, 5 }, { "select_signal", do_signal, 3 }, { "set_non_blocking", do_set_non_blocking, 2 }, { "kill", do_kill, 2 }, + { "input_fd", do_input_fd, 2 }, + { "output_fd", do_output_fd, 2 }, }; /* define the dl_load function using the boilerplate macro */ diff --git a/extension/testext.c b/extension/testext.c index 3ac1f124..f00ced7d 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -774,28 +774,28 @@ test_get_file(int nargs, awk_value_t *result) const awk_output_buf_t *obuf; if (nargs != 2) { - printf("%s: nargs not right (%d should be 2)\n", __func__, nargs); + printf("%s: nargs not right (%d should be 2)\n", "test_get_file", nargs); return make_number(-1.0, result); } if (! get_argument(0, AWK_STRING, & filename)) { - printf("%s: cannot get first arg\n", __func__); + printf("%s: cannot get first arg\n", "test_get_file"); return make_number(-1.0, result); } if (! get_argument(1, AWK_STRING, & alias)) { - printf("%s: cannot get first arg\n", __func__); + printf("%s: cannot get first arg\n", "test_get_file"); return make_number(-1.0, result); } if ((fd = open(filename.str_value.str, O_RDONLY)) < 0) { - printf("%s: open(%s) failed\n", __func__, filename.str_value.str); + printf("%s: open(%s) failed\n", "test_get_file", filename.str_value.str); return make_number(-1.0, result); } if (! get_file(alias.str_value.str, strlen(alias.str_value.str), "<", 1, fd, &ibuf, &obuf)) { - printf("%s: get_file(%s) failed\n", __func__, alias.str_value.str); + printf("%s: get_file(%s) failed\n", "test_get_file", alias.str_value.str); return make_number(-1.0, result); } if (! ibuf || ibuf->fd != fd) { - printf("%s: get_file(%s) returned fd %d instead of %d\n", __func__, alias.str_value.str, ibuf ? ibuf->fd : -1, fd); + printf("%s: get_file(%s) returned fd %d instead of %d\n", "test_get_file", alias.str_value.str, ibuf ? ibuf->fd : -1, fd); return make_number(-1.0, result); } return make_number(0.0, result); -- cgit v1.2.3 From 0ea9121e4bf07514d75024837fe4dd1c615c8ec0 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 9 Nov 2014 09:27:07 -0500 Subject: Fix api to treat an uninitialized value as AWK_UNDEFINED. --- ChangeLog | 6 ++++++ gawkapi.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a7b66969..99aee7af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-11-09 Andrew J. Schorr + + * gawkapi.c (node_to_awk_value): When the type wanted is AWK_UNDEFINED + and a it's a Node_val set to Nnull_string, return AWK_UNDEFINED instead + of AWK_NUMBER 0. + 2014-11-03 Norihiro Tanaka * re.c (research): Use dfa superset to improve matching speed. diff --git a/gawkapi.c b/gawkapi.c index bcf8d90a..06f31929 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -441,7 +441,10 @@ node_to_awk_value(NODE *node, awk_value_t *val, awk_valtype_t wanted) case AWK_UNDEFINED: /* return true and actual type for request of undefined */ - if ((node->flags & NUMBER) != 0) { + if (node == Nnull_string) { + val->val_type = AWK_UNDEFINED; + ret = awk_true; + } else if ((node->flags & NUMBER) != 0) { val->val_type = AWK_NUMBER; val->num_value = get_number_d(node); ret = awk_true; -- cgit v1.2.3 From a9d4cec96e6e37f470ef5bf8ca7b5a6af6a722bc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 9 Nov 2014 23:01:43 +0200 Subject: Improve mprintf4 test. --- test/ChangeLog | 5 ++ test/mbprintf4.awk | 51 ++++++++++--------- test/mbprintf4.ok | 144 ++++++++++++++++++++++++++--------------------------- 3 files changed, 104 insertions(+), 96 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index ab6c9431..e28ac2bb 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-11-09 Arnold D. Robbins + + * mbprintf4.awk: Add record and line number for debugging. + * mpprint4.ok: Adjust. + 2014-11-02 Arnold D. Robbins * Makefile.am (profile7): New test. diff --git a/test/mbprintf4.awk b/test/mbprintf4.awk index a4b2a218..1e436bca 100644 --- a/test/mbprintf4.awk +++ b/test/mbprintf4.awk @@ -1,32 +1,35 @@ # printf with multi-byte text encoding, %c and %s, width and precision, and left-alignment. { - print "printf %c " $0 - printf "|%c|\n", $0 - printf "|%1c|\n", $0 - printf "|%3c|\n", $0 + count = 1 + + print NR, count++, "printf %c " $0 + printf "%d:%d: |%c|\n", NR, count++, $0 + printf "%d:%d: |%1c|\n", NR, count++, $0 + printf "%d:%d: |%3c|\n", NR, count++, $0 # precision is ignored by %c. - printf "|%3.1c|\n", $0 - printf "|%3.5c|\n", $0 - print "printf %-c " $0 - printf "|%-c|\n", $0 - printf "|%-1c|\n", $0 - printf "|%-3c|\n", $0 + printf "%d:%d: |%3.1c|\n", NR, count++, $0 + printf "%d:%d: |%3.5c|\n", NR, count++, $0 + print NR, count++, "printf %-c " $0 + printf "%d:%d: |%-c|\n", NR, count++, $0 + printf "%d:%d: |%-1c|\n", NR, count++, $0 + printf "%d:%d: |%-3c|\n", NR, count++, $0 # precision is ignored by %c. - printf "|%-3.1c|\n", $0 - printf "|%-3.5c|\n", $0 + printf "%d:%d: |%-3.1c|\n", NR, count++, $0 + printf "%d:%d: |%-3.5c|\n", NR, count++, $0 printf ORS - print "printf %s " $0 - printf "|%s|\n", $0 - printf "|%1s|\n", $0 - printf "|%3s|\n", $0 - printf "|%3.1s|\n", $0 - printf "|%3.5s|\n", $0 - print "printf %-s " $0 - printf "|%-s|\n", $0 - printf "|%-1s|\n", $0 - printf "|%-3s|\n", $0 - printf "|%-3.1s|\n", $0 - printf "|%-3.5s|\n", $0 + print NR, count++, "printf %s " $0 + printf "%d:%d: |%s|\n", NR, count++, $0 + printf "%d:%d: |%1s|\n", NR, count++, $0 + printf "%d:%d: |%3s|\n", NR, count++, $0 + printf "%d:%d: |%3.1s|\n", NR, count++, $0 + printf "%d:%d: |%3.5s|\n", NR, count++, $0 + + print NR, count++, "printf %-s " $0 + printf "%d:%d: |%-s|\n", NR, count++, $0 + printf "%d:%d: |%-1s|\n", NR, count++, $0 + printf "%d:%d: |%-3s|\n", NR, count++, $0 + printf "%d:%d: |%-3.1s|\n", NR, count++, $0 + printf "%d:%d: |%-3.5s|\n", NR, count++, $0 printf ORS ORS } diff --git a/test/mbprintf4.ok b/test/mbprintf4.ok index 9b9dd4e2..e32fe408 100644 --- a/test/mbprintf4.ok +++ b/test/mbprintf4.ok @@ -1,81 +1,81 @@ -printf %c ú -|ú| -|ú| -| ú| -| ú| -| ú| -printf %-c ú -|ú| -|ú| -|ú | -|ú | -|ú | +1 1 printf %c ú +1:2: |ú| +1:3: |ú| +1:4: | ú| +1:5: | ú| +1:6: | ú| +1 7 printf %-c ú +1:8: |ú| +1:9: |ú| +1:10: |ú | +1:11: |ú | +1:12: |ú | -printf %s ú -|ú| -|ú| -| ú| -| ú| -| ú| -printf %-s ú -|ú| -|ú| -|ú | -|ú | -|ú | +1 13 printf %s ú +1:14: |ú| +1:15: |ú| +1:16: | ú| +1:17: | ú| +1:18: | ú| +1 19 printf %-s ú +1:20: |ú| +1:21: |ú| +1:22: |ú | +1:23: |ú | +1:24: |ú | -printf %c último -|ú| -|ú| -| ú| -| ú| -| ú| -printf %-c último -|ú| -|ú| -|ú | -|ú | -|ú | +2 1 printf %c último +2:2: |ú| +2:3: |ú| +2:4: | ú| +2:5: | ú| +2:6: | ú| +2 7 printf %-c último +2:8: |ú| +2:9: |ú| +2:10: |ú | +2:11: |ú | +2:12: |ú | -printf %s último -|último| -|último| -|último| -| ú| -|últim| -printf %-s último -|último| -|último| -|último| -|ú | -|últim| +2 13 printf %s último +2:14: |último| +2:15: |último| +2:16: |último| +2:17: | ú| +2:18: |últim| +2 19 printf %-s último +2:20: |último| +2:21: |último| +2:22: |último| +2:23: |ú | +2:24: |últim| -printf %c áé -|á| -|á| -| á| -| á| -| á| -printf %-c áé -|á| -|á| -|á | -|á | -|á | +3 1 printf %c áé +3:2: |á| +3:3: |á| +3:4: | á| +3:5: | á| +3:6: | á| +3 7 printf %-c áé +3:8: |á| +3:9: |á| +3:10: |á | +3:11: |á | +3:12: |á | -printf %s áé -|áé| -|áé| -| áé| -| á| -| áé| -printf %-s áé -|áé| -|áé| -|áé | -|á | -|áé | +3 13 printf %s áé +3:14: |áé| +3:15: |áé| +3:16: | áé| +3:17: | á| +3:18: | áé| +3 19 printf %-s áé +3:20: |áé| +3:21: |áé| +3:22: |áé | +3:23: |á | +3:24: |áé | -- cgit v1.2.3 From b549d4314c75c5136bfc5ede78df5ecdfbd85690 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 10 Nov 2014 23:02:56 +0200 Subject: Add undocumented -Z option to set locale. --- ChangeLog | 10 + configure | 2 +- configure.ac | 2 +- main.c | 734 +++++++++++++++++++++++++++++++---------------------------- 4 files changed, 398 insertions(+), 350 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99aee7af..4f21f0ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-11-10 Arnold D. Robbins + + Reorder main.c activities so that we can set a locale on the + command line with the new, for now undocumented, -Z option. + + * main.c (parse_args, set_locale_stuff): New functions. + (stopped_early): Made file level static. + (optlist, optab): Add new argument. + (main): Adjust ordering and move inline code into new functions. + 2014-11-09 Andrew J. Schorr * gawkapi.c (node_to_awk_value): When the type wanted is AWK_UNDEFINED diff --git a/configure b/configure index d98aeb10..555cba29 100755 --- a/configure +++ b/configure @@ -5675,7 +5675,7 @@ $as_echo_n "checking for special development options... " >&6; } if test -f $srcdir/.developing then # add other debug flags as appropriate, save GAWKDEBUG for emergencies - CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG" + CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG -DLOCALEDEBUG" if grep dbug $srcdir/.developing then CFLAGS="$CFLAGS -DDBUG" diff --git a/configure.ac b/configure.ac index 55ca72de..ed7e3ccd 100644 --- a/configure.ac +++ b/configure.ac @@ -87,7 +87,7 @@ AC_MSG_CHECKING([for special development options]) if test -f $srcdir/.developing then # add other debug flags as appropriate, save GAWKDEBUG for emergencies - CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG" + CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG -DLOCALEDEBUG" if grep dbug $srcdir/.developing then CFLAGS="$CFLAGS -DDBUG" diff --git a/main.c b/main.c index 3bee0488..e3440b8c 100644 --- a/main.c +++ b/main.c @@ -142,11 +142,16 @@ static bool disallow_var_assigns = false; /* true for --exec */ static void add_preassign(enum assign_type type, char *val); +static void parse_args(int argc, char **argv); +static void set_locale_stuff(void); +static bool stopped_early = false; + int do_flags = false; bool do_optimize = false; /* apply default optimizations */ static int do_nostalgia = false; /* provide a blast from the past */ static int do_binary = false; /* hands off my data! */ static int do_version = false; /* print version info */ +static const char *locale = ""; /* default value to setlocale */ int use_lc_numeric = false; /* obey locale for decimal point */ @@ -186,6 +191,9 @@ static const struct option optab[] = { { "lint", optional_argument, NULL, 'L' }, { "lint-old", no_argument, NULL, 't' }, { "load", required_argument, NULL, 'l' }, +#if defined(LOCALEDEBUG) + { "locale", required_argument, NULL, 'Z' }, +#endif { "non-decimal-data", no_argument, NULL, 'n' }, { "nostalgia", no_argument, & do_nostalgia, 1 }, { "optimize", no_argument, NULL, 'O' }, @@ -209,15 +217,7 @@ static const struct option optab[] = { int main(int argc, char **argv) { - /* - * The + on the front tells GNU getopt not to rearrange argv. - */ - const char *optlist = "+F:f:v:W;bcCd::D::e:E:ghi:l:L:nNo::Op::MPrStVY"; - bool stopped_early = false; - int old_optind; int i; - int c; - char *scan, *src; char *extra_stack; int have_srcfile = 0; SRCFILE *s; @@ -233,60 +233,11 @@ main(int argc, char **argv) #endif /* HAVE_MTRACE */ #endif /* HAVE_MCHECK_H */ -#if defined(LC_CTYPE) - setlocale(LC_CTYPE, ""); -#endif -#if defined(LC_COLLATE) - setlocale(LC_COLLATE, ""); -#endif -#if defined(LC_MESSAGES) - setlocale(LC_MESSAGES, ""); -#endif -#if defined(LC_NUMERIC) && defined(HAVE_LOCALE_H) - /* - * Force the issue here. According to POSIX 2001, decimal - * point is used for parsing source code and for command-line - * assignments and the locale value for processing input, - * number to string conversion, and printing output. - * - * 10/2005 --- see below also; we now only use the locale's - * decimal point if do_posix in effect. - * - * 9/2007: - * This is a mess. We need to get the locale's numeric info for - * the thousands separator for the %'d flag. - */ - setlocale(LC_NUMERIC, ""); - init_locale(& loc); - setlocale(LC_NUMERIC, "C"); -#endif -#if defined(LC_TIME) - setlocale(LC_TIME, ""); -#endif - -#if MBS_SUPPORT - /* - * In glibc, MB_CUR_MAX is actually a function. This value is - * tested *a lot* in many speed-critical places in gawk. Caching - * this value once makes a speed difference. - */ - gawk_mb_cur_max = MB_CUR_MAX; - /* Without MBS_SUPPORT, gawk_mb_cur_max is 1. */ -#ifdef LIBC_IS_BORKED -{ - const char *env_lc; - - env_lc = getenv("LC_ALL"); - if (env_lc == NULL) - env_lc = getenv("LANG"); - if (env_lc != NULL && env_lc[1] == '\0' && tolower(env_lc[0]) == 'c') - gawk_mb_cur_max = 1; -} -#endif + myname = gawk_name(argv[0]); + os_arg_fixup(&argc, &argv); /* emulate redirection, expand wildcards */ - /* init the cache for checking bytes if they're characters */ - init_btowc_cache(); -#endif + if (argc < 2) + usage(EXIT_FAILURE, stderr); (void) bindtextdomain(PACKAGE, LOCALEDIR); (void) textdomain(PACKAGE); @@ -318,12 +269,6 @@ main(int argc, char **argv) (void) stackoverflow_install_handler(catchstackoverflow, extra_stack, STACK_SIZE); #undef STACK_SIZE - myname = gawk_name(argv[0]); - os_arg_fixup(&argc, &argv); /* emulate redirection, expand wildcards */ - - if (argc < 2) - usage(EXIT_FAILURE, stderr); - /* initialize the null string */ Nnull_string = make_string("", 0); @@ -338,306 +283,113 @@ main(int argc, char **argv) output_fp = stdout; - /* we do error messages ourselves on invalid options */ - opterr = false; - - /* copy argv before getopt gets to it; used to restart the debugger */ - save_argv(argc, argv); - /* initialize global (main) execution context */ push_context(new_context()); - /* option processing. ready, set, go! */ - for (optopt = 0, old_optind = 1; - (c = getopt_long(argc, argv, optlist, optab, NULL)) != EOF; - optopt = 0, old_optind = optind) { - if (do_posix) - opterr = true; - - switch (c) { - case 'F': - add_preassign(PRE_ASSIGN_FS, optarg); - break; + parse_args(argc, argv); - case 'E': - disallow_var_assigns = true; - /* fall through */ - case 'f': - /* - * Allow multiple -f options. - * This makes function libraries real easy. - * Most of the magic is in the scanner. - * - * The following is to allow for whitespace at the end - * of a #! /bin/gawk line in an executable file - */ - scan = optarg; - if (argv[optind-1] != optarg) - while (isspace((unsigned char) *scan)) - scan++; - src = (*scan == '\0' ? argv[optind++] : optarg); - (void) add_srcfile((src && src[0] == '-' && src[1] == '\0') ? - SRC_STDIN : SRC_FILE, - src, srcfiles, NULL, NULL); + set_locale_stuff(); - break; +#if MBS_SUPPORT + /* + * In glibc, MB_CUR_MAX is actually a function. This value is + * tested *a lot* in many speed-critical places in gawk. Caching + * this value once makes a speed difference. + */ + gawk_mb_cur_max = MB_CUR_MAX; + /* Without MBS_SUPPORT, gawk_mb_cur_max is 1. */ +#ifdef LIBC_IS_BORKED +{ + const char *env_lc; - case 'v': - add_preassign(PRE_ASSIGN, optarg); - break; + env_lc = getenv("LC_ALL"); + if (env_lc == NULL) + env_lc = getenv("LANG"); + if (env_lc != NULL && env_lc[1] == '\0' && tolower(env_lc[0]) == 'c') + gawk_mb_cur_max = 1; +} +#endif - case 'b': - do_binary = true; - break; + /* init the cache for checking bytes if they're characters */ + init_btowc_cache(); +#endif - case 'c': - do_flags |= DO_TRADITIONAL; - break; - case 'C': - copyleft(); - break; + if (do_nostalgia) + nostalgia(); - case 'd': - do_flags |= DO_DUMP_VARS; - if (optarg != NULL && optarg[0] != '\0') - varfile = optarg; - break; + /* check for POSIXLY_CORRECT environment variable */ + if (! do_posix && getenv("POSIXLY_CORRECT") != NULL) { + do_flags |= DO_POSIX; + if (do_lint) + lintwarn( + _("environment variable `POSIXLY_CORRECT' set: turning on `--posix'")); + } - case 'D': - do_flags |= DO_DEBUG; - if (optarg != NULL && optarg[0] != '\0') - command_file = optarg; - break; + if (do_posix) { + use_lc_numeric = true; + if (do_traditional) /* both on command line */ + warning(_("`--posix' overrides `--traditional'")); + else + do_flags |= DO_TRADITIONAL; + /* + * POSIX compliance also implies + * no GNU extensions either. + */ + } - case 'e': - if (optarg[0] == '\0') - warning(_("empty argument to `-e/--source' ignored")); - else - (void) add_srcfile(SRC_CMDLINE, optarg, srcfiles, NULL, NULL); - break; + if (do_traditional && do_non_decimal_data) { + do_flags &= ~DO_NON_DEC_DATA; + warning(_("`--posix'/`--traditional' overrides `--non-decimal-data'")); + } - case 'g': - do_flags |= DO_INTL; - break; + if (do_lint && os_is_setuid()) + warning(_("running %s setuid root may be a security problem"), myname); - case 'h': - /* write usage to stdout, per GNU coding stds */ - usage(EXIT_SUCCESS, stdout); - break; +#if MBS_SUPPORT + if (do_binary) { + if (do_posix) + warning(_("`--posix' overrides `--characters-as-bytes'")); + else + gawk_mb_cur_max = 1; /* hands off my data! */ +#if defined(LC_ALL) + setlocale(LC_ALL, "C"); +#endif + } +#endif - case 'i': - (void) add_srcfile(SRC_INC, optarg, srcfiles, NULL, NULL); - break; + if (do_debug) /* Need to register the debugger pre-exec hook before any other */ + init_debug(); - case 'l': - (void) add_srcfile(SRC_EXTLIB, optarg, srcfiles, NULL, NULL); - break; +#ifdef HAVE_MPFR + /* Set up MPFR defaults, and register pre-exec hook to process arithmetic opcodes */ + if (do_mpfr) + init_mpfr(DEFAULT_PREC, DEFAULT_ROUNDMODE); +#endif -#ifndef NO_LINT - case 'L': - do_flags |= DO_LINT_ALL; - if (optarg != NULL) { - if (strcmp(optarg, "fatal") == 0) - lintfunc = r_fatal; - else if (strcmp(optarg, "invalid") == 0) { - do_flags &= ~DO_LINT_ALL; - do_flags |= DO_LINT_INVALID; - } - } - break; + /* load group set */ + init_groupset(); - case 't': - do_flags |= DO_LINT_OLD; - break; -#else - case 'L': - case 't': - break; +#ifdef HAVE_MPFR + if (do_mpfr) { + mpz_init(Nnull_string->mpg_i); + Nnull_string->flags = (MALLOC|STRCUR|STRING|MPZN|NUMCUR|NUMBER); + } else #endif + { + Nnull_string->numbr = 0.0; + Nnull_string->flags = (MALLOC|STRCUR|STRING|NUMCUR|NUMBER); + } - case 'n': - do_flags |= DO_NON_DEC_DATA; - break; + /* + * Tell the regex routines how they should work. + * Do this before initializing variables, since + * they could want to do a regexp compile. + */ + resetup(); - case 'N': - use_lc_numeric = true; - break; - - case 'O': - do_optimize = true; - break; - - case 'p': - do_flags |= DO_PROFILE; - /* fall through */ - case 'o': - do_flags |= DO_PRETTY_PRINT; - if (optarg != NULL) - set_prof_file(optarg); - else - set_prof_file(DEFAULT_PROFILE); - break; - - case 'M': -#ifdef HAVE_MPFR - do_flags |= DO_MPFR; -#else - warning(_("-M ignored: MPFR/GMP support not compiled in")); -#endif - break; - - case 'P': - do_flags |= DO_POSIX; - break; - - case 'r': - do_flags |= DO_INTERVALS; - break; - - case 'S': - do_flags |= DO_SANDBOX; - break; - - case 'V': - do_version = true; - break; - - case 'W': /* gawk specific options - now in getopt_long */ - fprintf(stderr, _("%s: option `-W %s' unrecognized, ignored\n"), - argv[0], optarg); - break; - - case 0: - /* - * getopt_long found an option that sets a variable - * instead of returning a letter. Do nothing, just - * cycle around for the next one. - */ - break; - - case 'Y': -#if defined(YYDEBUG) || defined(GAWKDEBUG) - if (c == 'Y') { - yydebug = 2; - break; - } -#endif - /* if not debugging, fall through */ - case '?': - default: - /* - * If not posix, an unrecognized option stops argument - * processing so that it can go into ARGV for the awk - * program to see. This makes use of ``#! /bin/gawk -f'' - * easier. - * - * However, it's never simple. If optopt is set, - * an option that requires an argument didn't get the - * argument. We care because if opterr is 0, then - * getopt_long won't print the error message for us. - */ - if (! do_posix - && (optopt == '\0' || strchr(optlist, optopt) == NULL)) { - /* - * can't just do optind--. In case of an - * option with >= 2 letters, getopt_long - * won't have incremented optind. - */ - optind = old_optind; - stopped_early = true; - goto out; - } else if (optopt != '\0') { - /* Use POSIX required message format */ - fprintf(stderr, - _("%s: option requires an argument -- %c\n"), - myname, optopt); - usage(EXIT_FAILURE, stderr); - } - /* else - let getopt print error message for us */ - break; - } - if (c == 'E') /* --exec ends option processing */ - break; - } -out: - - if (do_nostalgia) - nostalgia(); - - /* check for POSIXLY_CORRECT environment variable */ - if (! do_posix && getenv("POSIXLY_CORRECT") != NULL) { - do_flags |= DO_POSIX; - if (do_lint) - lintwarn( - _("environment variable `POSIXLY_CORRECT' set: turning on `--posix'")); - } - - if (do_posix) { - use_lc_numeric = true; - if (do_traditional) /* both on command line */ - warning(_("`--posix' overrides `--traditional'")); - else - do_flags |= DO_TRADITIONAL; - /* - * POSIX compliance also implies - * no GNU extensions either. - */ - } - - if (do_traditional && do_non_decimal_data) { - do_flags &= ~DO_NON_DEC_DATA; - warning(_("`--posix'/`--traditional' overrides `--non-decimal-data'")); - } - - if (do_lint && os_is_setuid()) - warning(_("running %s setuid root may be a security problem"), myname); - -#if MBS_SUPPORT - if (do_binary) { - if (do_posix) - warning(_("`--posix' overrides `--characters-as-bytes'")); - else - gawk_mb_cur_max = 1; /* hands off my data! */ -#if defined(LC_ALL) - setlocale(LC_ALL, "C"); -#endif - } -#endif - - if (do_debug) /* Need to register the debugger pre-exec hook before any other */ - init_debug(); - -#ifdef HAVE_MPFR - /* Set up MPFR defaults, and register pre-exec hook to process arithmetic opcodes */ - if (do_mpfr) - init_mpfr(DEFAULT_PREC, DEFAULT_ROUNDMODE); -#endif - - /* load group set */ - init_groupset(); - -#ifdef HAVE_MPFR - if (do_mpfr) { - mpz_init(Nnull_string->mpg_i); - Nnull_string->flags = (MALLOC|STRCUR|STRING|MPZN|NUMCUR|NUMBER); - } else -#endif - { - Nnull_string->numbr = 0.0; - Nnull_string->flags = (MALLOC|STRCUR|STRING|NUMCUR|NUMBER); - } - - /* - * Tell the regex routines how they should work. - * Do this before initializing variables, since - * they could want to do a regexp compile. - */ - resetup(); - - /* Set up the special variables */ - init_vars(); + /* Set up the special variables */ + init_vars(); /* Set up the field variables */ init_fields(); @@ -745,8 +497,9 @@ out: * data using the local decimal point. */ if (use_lc_numeric) - setlocale(LC_NUMERIC, ""); + setlocale(LC_NUMERIC, locale); #endif +// fprintf(stderr, "locale is <%s>\n", locale); fflush(stderr); init_io(); output_fp = stdout; @@ -856,6 +609,9 @@ usage(int exitval, FILE *fp) #ifdef GAWKDEBUG fputs(_("\t-Y\t\t--parsedebug\n"), fp); #endif +#if defined(LOCALEDEBUG) + fputs(_("\t-Z\t\t--locale\n"), fp); +#endif /* This is one string to make things easier on translators. */ /* TRANSLATORS: --help output 5 (end) @@ -1387,7 +1143,7 @@ arg_assign(char *arg, bool initing) setlocale(LC_NUMERIC, "C"); (void) force_number(it); if (do_posix) - setlocale(LC_NUMERIC, ""); + setlocale(LC_NUMERIC, locale); #endif /* LC_NUMERIC */ /* @@ -1651,3 +1407,285 @@ getenv_long(const char *name) } return -1; } + +/* parse_args --- do the getopt_long thing */ + +static void +parse_args(int argc, char **argv) +{ + /* + * The + on the front tells GNU getopt not to rearrange argv. + */ + const char *optlist = "+F:f:v:W;bcCd::D::e:E:ghi:l:L:nNo::Op::MPrStVYZ:"; + int old_optind; + int c; + char *scan; + char *src; + + /* we do error messages ourselves on invalid options */ + opterr = false; + + /* copy argv before getopt gets to it; used to restart the debugger */ + save_argv(argc, argv); + + /* option processing. ready, set, go! */ + for (optopt = 0, old_optind = 1; + (c = getopt_long(argc, argv, optlist, optab, NULL)) != EOF; + optopt = 0, old_optind = optind) { + if (do_posix) + opterr = true; + + switch (c) { + case 'F': + add_preassign(PRE_ASSIGN_FS, optarg); + break; + + case 'E': + disallow_var_assigns = true; + /* fall through */ + case 'f': + /* + * Allow multiple -f options. + * This makes function libraries real easy. + * Most of the magic is in the scanner. + * + * The following is to allow for whitespace at the end + * of a #! /bin/gawk line in an executable file + */ + scan = optarg; + if (argv[optind-1] != optarg) + while (isspace((unsigned char) *scan)) + scan++; + src = (*scan == '\0' ? argv[optind++] : optarg); + (void) add_srcfile((src && src[0] == '-' && src[1] == '\0') ? + SRC_STDIN : SRC_FILE, + src, srcfiles, NULL, NULL); + + break; + + case 'v': + add_preassign(PRE_ASSIGN, optarg); + break; + + case 'b': + do_binary = true; + break; + + case 'c': + do_flags |= DO_TRADITIONAL; + break; + + case 'C': + copyleft(); + break; + + case 'd': + do_flags |= DO_DUMP_VARS; + if (optarg != NULL && optarg[0] != '\0') + varfile = optarg; + break; + + case 'D': + do_flags |= DO_DEBUG; + if (optarg != NULL && optarg[0] != '\0') + command_file = optarg; + break; + + case 'e': + if (optarg[0] == '\0') + warning(_("empty argument to `-e/--source' ignored")); + else + (void) add_srcfile(SRC_CMDLINE, optarg, srcfiles, NULL, NULL); + break; + + case 'g': + do_flags |= DO_INTL; + break; + + case 'h': + /* write usage to stdout, per GNU coding stds */ + usage(EXIT_SUCCESS, stdout); + break; + + case 'i': + (void) add_srcfile(SRC_INC, optarg, srcfiles, NULL, NULL); + break; + + case 'l': + (void) add_srcfile(SRC_EXTLIB, optarg, srcfiles, NULL, NULL); + break; + +#ifndef NO_LINT + case 'L': + do_flags |= DO_LINT_ALL; + if (optarg != NULL) { + if (strcmp(optarg, "fatal") == 0) + lintfunc = r_fatal; + else if (strcmp(optarg, "invalid") == 0) { + do_flags &= ~DO_LINT_ALL; + do_flags |= DO_LINT_INVALID; + } + } + break; + + case 't': + do_flags |= DO_LINT_OLD; + break; +#else + case 'L': + case 't': + break; +#endif + + case 'n': + do_flags |= DO_NON_DEC_DATA; + break; + + case 'N': + use_lc_numeric = true; + break; + + case 'O': + do_optimize = true; + break; + + case 'p': + do_flags |= DO_PROFILE; + /* fall through */ + case 'o': + do_flags |= DO_PRETTY_PRINT; + if (optarg != NULL) + set_prof_file(optarg); + else + set_prof_file(DEFAULT_PROFILE); + break; + + case 'M': +#ifdef HAVE_MPFR + do_flags |= DO_MPFR; +#else + warning(_("-M ignored: MPFR/GMP support not compiled in")); +#endif + break; + + case 'P': + do_flags |= DO_POSIX; + break; + + case 'r': + do_flags |= DO_INTERVALS; + break; + + case 'S': + do_flags |= DO_SANDBOX; + break; + + case 'V': + do_version = true; + break; + + case 'W': /* gawk specific options - now in getopt_long */ + fprintf(stderr, _("%s: option `-W %s' unrecognized, ignored\n"), + argv[0], optarg); + break; + + case 0: + /* + * getopt_long found an option that sets a variable + * instead of returning a letter. Do nothing, just + * cycle around for the next one. + */ + break; + + case 'Y': + case 'Z': +#if defined(YYDEBUG) || defined(GAWKDEBUG) + if (c == 'Y') { + yydebug = 2; + break; + } +#endif +#if defined(LOCALEDEBUG) + if (c == 'Z') { + locale = optarg; + break; + } +#endif + /* if not debugging, fall through */ + case '?': + default: + /* + * If not posix, an unrecognized option stops argument + * processing so that it can go into ARGV for the awk + * program to see. This makes use of ``#! /bin/gawk -f'' + * easier. + * + * However, it's never simple. If optopt is set, + * an option that requires an argument didn't get the + * argument. We care because if opterr is 0, then + * getopt_long won't print the error message for us. + */ + if (! do_posix + && (optopt == '\0' || strchr(optlist, optopt) == NULL)) { + /* + * can't just do optind--. In case of an + * option with >= 2 letters, getopt_long + * won't have incremented optind. + */ + optind = old_optind; + stopped_early = true; + goto out; + } else if (optopt != '\0') { + /* Use POSIX required message format */ + fprintf(stderr, + _("%s: option requires an argument -- %c\n"), + myname, optopt); + usage(EXIT_FAILURE, stderr); + } + /* else + let getopt print error message for us */ + break; + } + if (c == 'E') /* --exec ends option processing */ + break; + } +out: + return; +} + +/* set_locale_stuff --- setup the locale stuff */ + +static void +set_locale_stuff(void) +{ +#if defined(LC_CTYPE) + setlocale(LC_CTYPE, locale); +#endif +#if defined(LC_COLLATE) + setlocale(LC_COLLATE, locale); +#endif +#if defined(LC_MESSAGES) + setlocale(LC_MESSAGES, locale); +#endif +#if defined(LC_NUMERIC) && defined(HAVE_LOCALE_H) + /* + * Force the issue here. According to POSIX 2001, decimal + * point is used for parsing source code and for command-line + * assignments and the locale value for processing input, + * number to string conversion, and printing output. + * + * 10/2005 --- see below also; we now only use the locale's + * decimal point if do_posix in effect. + * + * 9/2007: + * This is a mess. We need to get the locale's numeric info for + * the thousands separator for the %'d flag. + */ + setlocale(LC_NUMERIC, locale); + init_locale(& loc); + setlocale(LC_NUMERIC, "C"); +#endif +#if defined(LC_TIME) + setlocale(LC_TIME, locale); +#endif +} -- cgit v1.2.3 From 350265fafb2a0153d4207c67d626f135b308ad34 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 10 Nov 2014 23:08:53 +0200 Subject: Don't add -Z to usage. --- main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/main.c b/main.c index e3440b8c..b9b76618 100644 --- a/main.c +++ b/main.c @@ -609,9 +609,6 @@ usage(int exitval, FILE *fp) #ifdef GAWKDEBUG fputs(_("\t-Y\t\t--parsedebug\n"), fp); #endif -#if defined(LOCALEDEBUG) - fputs(_("\t-Z\t\t--locale\n"), fp); -#endif /* This is one string to make things easier on translators. */ /* TRANSLATORS: --help output 5 (end) -- cgit v1.2.3 From b4cf3cc470eb1200ec90fcc7ad5b2d069059cf7e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 11 Nov 2014 23:12:01 +0200 Subject: Fix memory growth problem. --- ChangeLog | 10 ++++++++++ field.c | 6 ++++++ interpret.h | 24 ++++++++++++++++++++---- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f21f0ff..3049827a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-11-11 Arnold D. Robbins + + Don't let memory used increase linearly in the size of + the input. Problem reported by dragan legic + . + + * field.c (set_record): NUL-terminate the buffer. + * interpret.h (r_interpret): Op_field_spec: if it's $0, increment + the valref. Op_store_var: if we got $0, handle it appropriately. + 2014-11-10 Arnold D. Robbins Reorder main.c activities so that we can set a locale on the diff --git a/field.c b/field.c index 4819ea94..7b4f2190 100644 --- a/field.c +++ b/field.c @@ -277,6 +277,12 @@ set_record(const char *buf, int cnt) /* copy the data */ memcpy(databuf, buf, cnt); + /* + * Add terminating '\0' so that C library routines + * will know when to stop. + */ + databuf[cnt] = '\0'; + /* manage field 0: */ unref(fields_arr[0]); getnode(n); diff --git a/interpret.h b/interpret.h index 28804330..593f11a6 100644 --- a/interpret.h +++ b/interpret.h @@ -340,7 +340,12 @@ uninitialized_scalar: lhs = r_get_field(t1, (Func_ptr *) 0, true); decr_sp(); DEREF(t1); - r = dupnode(*lhs); /* can't use UPREF here */ + /* only for $0, up ref count */ + if (*lhs == fields_arr[0]) { + r = *lhs; + UPREF(r); + } else + r = dupnode(*lhs); PUSH(r); break; @@ -649,11 +654,22 @@ mod: lhs = get_lhs(pc->memory, false); unref(*lhs); r = pc->initval; /* constant initializer */ - if (r == NULL) - *lhs = POP_SCALAR(); - else { + if (r != NULL) { UPREF(r); *lhs = r; + } else { + r = POP_SCALAR(); + + /* if was a field, turn it into a var */ + if ((r->flags & FIELD) == 0) { + *lhs = r; + } else if (r->valref == 1) { + r->flags &= ~FIELD; + *lhs = r; + } else { + *lhs = dupnode(r); + DEREF(r); + } } break; -- cgit v1.2.3 From 0a050fa206e5d899f553b6ac492d389cb39591a2 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 12 Oct 2014 13:49:11 +0300 Subject: OS/2 fixes. --- ChangeLog | 9 +++++++++ Makefile.am | 6 +++--- Makefile.in | 6 +++--- extension/ChangeLog | 6 ++++++ extension/Makefile.am | 2 ++ extension/Makefile.in | 2 ++ getopt.h | 15 +++++++++++++++ io.c | 8 ++++++++ pc/ChangeLog | 6 ++++++ pc/gawkmisc.pc | 4 ++-- 10 files changed, 56 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3049827a..543ddd49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -86,6 +86,15 @@ more helpful - also used for unmatched [:, [., [=. Thanks to Davide Brini for raising the issue. +2014-10-12 KO Myung-Hun + + Fixes for OS/2: + + * Makefile.am (install-exec-hook, uninstall-links): Use $(EXEEXT). + * getopt.h: Redefinitions if using KLIBC. + * io.c (_S_IFDIR, _S_IRWXU): Define if the more standard versions + are available. + 2014-10-12 Arnold D. Robbins * README: Remove Pat Rankin from VMS duties, per his request. diff --git a/Makefile.am b/Makefile.am index 3d1c8837..a1883780 100644 --- a/Makefile.am +++ b/Makefile.am @@ -157,14 +157,14 @@ RM = rm -f install-exec-hook: (cd $(DESTDIR)$(bindir); \ $(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \ - if [ ! -f awk ]; \ - then $(LN_S) gawk$(EXEEXT) awk; \ + if [ ! -f awk$(EXEEXT) ]; \ + then $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \ fi; exit 0) # Undo the above when uninstalling uninstall-links: (cd $(DESTDIR)$(bindir); \ - if [ -f awk ] && cmp awk gawk$(EXEEXT) > /dev/null; then rm -f awk; fi ; \ + if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; then rm -f awk$(EXEEXT); fi ; \ rm -f gawk-$(VERSION)$(EXEEXT); exit 0) uninstall-recursive: uninstall-links diff --git a/Makefile.in b/Makefile.in index 4d50757d..39143e2e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1156,14 +1156,14 @@ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS install-exec-hook: (cd $(DESTDIR)$(bindir); \ $(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \ - if [ ! -f awk ]; \ - then $(LN_S) gawk$(EXEEXT) awk; \ + if [ ! -f awk$(EXEEXT) ]; \ + then $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \ fi; exit 0) # Undo the above when uninstalling uninstall-links: (cd $(DESTDIR)$(bindir); \ - if [ -f awk ] && cmp awk gawk$(EXEEXT) > /dev/null; then rm -f awk; fi ; \ + if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; then rm -f awk$(EXEEXT); fi ; \ rm -f gawk-$(VERSION)$(EXEEXT); exit 0) uninstall-recursive: uninstall-links diff --git a/extension/ChangeLog b/extension/ChangeLog index 3fee967f..51878ed5 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2014-10-12 KO Myung-Hun + + Fixes for OS/2: + + * Makefile.am (uninstall-so): Remove *.dll and *.a, also. + 2014-10-08 Arnold D. Robbins * inplace.c (do_inplace_begin): Use a cast to void in front diff --git a/extension/Makefile.am b/extension/Makefile.am index e6678c54..d0769a5a 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -109,6 +109,8 @@ install-data-hook: # Keep the uninstall check working: uninstall-so: $(RM) $(DESTDIR)$(pkgextensiondir)/*.so + $(RM) $(DESTDIR)$(pkgextensiondir)/*.dll + $(RM) $(DESTDIR)$(pkgextensiondir)/*.a uninstall-recursive: uninstall-so diff --git a/extension/Makefile.in b/extension/Makefile.in index 46168e4e..945e5534 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -1240,6 +1240,8 @@ install-data-hook: # Keep the uninstall check working: uninstall-so: $(RM) $(DESTDIR)$(pkgextensiondir)/*.so + $(RM) $(DESTDIR)$(pkgextensiondir)/*.dll + $(RM) $(DESTDIR)$(pkgextensiondir)/*.a uninstall-recursive: uninstall-so diff --git a/getopt.h b/getopt.h index da1a01ff..4471bf54 100644 --- a/getopt.h +++ b/getopt.h @@ -48,6 +48,21 @@ extern "C" { #endif +#ifdef __KLIBC__ +/* OS/2 kLIBC has already getopt(). So to avoid name clash, rename + them here. */ + +# define optarg gawk_optarg +# define optind gawk_optind +# define opterr gawk_opterr +# define optopt gawk_optopt + +# define getopt gawk_getopt +# define getopt_long gawk_getopt_long +# define getopt_long_only gawk_getopt_long_only +#endif + + /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. diff --git a/io.c b/io.c index 32caadfb..c584a0c2 100644 --- a/io.c +++ b/io.c @@ -110,6 +110,14 @@ #ifdef __EMX__ #include + +#if !defined(_S_IFDIR) && defined(S_IFDIR) +#define _S_IFDIR S_IFDIR +#endif + +#if !defined(_S_IRWXU) && defined(S_IRWXU) +#define _S_IRWXU S_IRWXU +#endif #endif #ifndef ENFILE diff --git a/pc/ChangeLog b/pc/ChangeLog index 235f520c..e22cb01a 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-12 KO Myung-Hun + + Fixes for OS/2: + + * gawkmisc.pc (init_sockets): Add additional checks for __EMX__. + 2014-09-23 Scott Deifik * Makefile.tst: Sync with mainline. diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc index 239f3f8f..fdd32e7e 100644 --- a/pc/gawkmisc.pc +++ b/pc/gawkmisc.pc @@ -850,12 +850,12 @@ w32_shutdown (int fd, int how) #endif /* __MINGW32__ */ -#if defined(__DJGPP__) || defined(__MINGW32__) +#if defined(__DJGPP__) || defined(__MINGW32__) || defined(__EMX__) void init_sockets(void) { -#ifdef HAVE_SOCKETS +#if defined(HAVE_SOCKETS) && !defined(__EMX__) WSADATA winsockData; int errcode; -- cgit v1.2.3 From d268465c69afb15db91f9dd0cb07131ef7ba9c45 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 12 Oct 2014 18:47:54 +0300 Subject: Additional OS/2 fix suggested by Andreas Buening. --- extension/ChangeLog | 5 +++++ extension/Makefile.am | 1 + extension/Makefile.in | 1 + 3 files changed, 7 insertions(+) diff --git a/extension/ChangeLog b/extension/ChangeLog index 51878ed5..940f7f15 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2014-10-12 Arnold D. Robbins + + * Makefile.am (uninstall-so): Remove *.lib too, per suggestion + from Andreas Buening. + 2014-10-12 KO Myung-Hun Fixes for OS/2: diff --git a/extension/Makefile.am b/extension/Makefile.am index d0769a5a..b9dabfe2 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -111,6 +111,7 @@ uninstall-so: $(RM) $(DESTDIR)$(pkgextensiondir)/*.so $(RM) $(DESTDIR)$(pkgextensiondir)/*.dll $(RM) $(DESTDIR)$(pkgextensiondir)/*.a + $(RM) $(DESTDIR)$(pkgextensiondir)/*.lib uninstall-recursive: uninstall-so diff --git a/extension/Makefile.in b/extension/Makefile.in index 945e5534..e08c6de2 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -1242,6 +1242,7 @@ uninstall-so: $(RM) $(DESTDIR)$(pkgextensiondir)/*.so $(RM) $(DESTDIR)$(pkgextensiondir)/*.dll $(RM) $(DESTDIR)$(pkgextensiondir)/*.a + $(RM) $(DESTDIR)$(pkgextensiondir)/*.lib uninstall-recursive: uninstall-so -- cgit v1.2.3 From 05de499531bc8fece2625b27a728bd24412ab41a Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 13 Nov 2014 20:31:00 +0200 Subject: Update pc/Makefile.tst. --- pc/ChangeLog | 4 ++++ pc/Makefile.tst | 27 +++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/pc/ChangeLog b/pc/ChangeLog index e22cb01a..03159c1e 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,7 @@ +2014-11-13 Scott Deifik + + * Makefile.tst: Sync with mainline. + 2014-10-12 KO Myung-Hun Fixes for OS/2: diff --git a/pc/Makefile.tst b/pc/Makefile.tst index 48fc5189..8ab15987 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -183,7 +183,7 @@ GAWK_EXT_TESTS = \ colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ - gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ + genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectcall indirectcall2 \ @@ -191,7 +191,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 pty1 \ + profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -322,6 +322,8 @@ charset-msg-start: @echo "************************************************" @echo "** Some or all of these tests may fail if you **" @echo "** have inadequate or missing locale support **" + @echo "** At least en_US.UTF-8, ru_RU.UTF-8 and **" + @echo "** ja_JP.UTF-8 are needed. **" @echo "************************************************" charset-msg-end: @@ -861,7 +863,7 @@ dumpvars:: profile1: @echo $@ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 - @$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out + @$(AWK) -f ./ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out @$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \ cp "$(srcdir)"/dtdgport.awk > $@.ok ; } @@ -890,6 +892,18 @@ profile5: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile6: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile7: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 @@ -1055,7 +1069,7 @@ testext:: @echo $@ # @$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk @$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk - @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk readdir: @@ -1176,6 +1190,11 @@ filefuncs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -v builddir="$(abs_top_builddir)" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +genpot: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: -- cgit v1.2.3 From 8b863f8852067b0638e09dc7c82355b96381dc12 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 15 Nov 2014 18:35:45 +0200 Subject: Remove MBS_SUPPORT ifdefs. --- ChangeLog | 8 ++++++ array.c | 9 +++--- awk.h | 18 ++---------- awkgram.c | 30 -------------------- awkgram.y | 30 -------------------- builtin.c | 84 ++++++++++---------------------------------------------- dfa.c | 71 ++++++++--------------------------------------- eval.c | 13 ++++----- field.c | 57 ++++++++++++-------------------------- interpret.h | 2 -- io.c | 5 +--- main.c | 7 ----- mbsupport.h | 74 ++++++------------------------------------------- mpfr.c | 2 -- node.c | 18 +----------- re.c | 7 +---- regex_internal.h | 8 ++---- replace.c | 2 +- 18 files changed, 80 insertions(+), 365 deletions(-) diff --git a/ChangeLog b/ChangeLog index 543ddd49..864ea364 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-11-15 Arnold D. Robbins + + * array.c, awk.h, awkgram.y, builtin.c, dfa.c, eval.c, field.c, + interpret.h, io.c, main.c, mpfr.c, node.c, re.c, regex_internal.h, + replace.c: Remove all uses of MBS_SUPPORT. + * regex_internal.h: Disable wide characters on DJGPP. + * mbsupport.h: Rework to be needed only for DJGPP. + 2014-11-11 Arnold D. Robbins Don't let memory used increase linearly in the size of diff --git a/array.c b/array.c index 682b8ddb..f7993624 100644 --- a/array.c +++ b/array.c @@ -978,14 +978,13 @@ cmp_strings(const NODE *n1, const NODE *n2) const unsigned char *cp1 = (const unsigned char *) s1; const unsigned char *cp2 = (const unsigned char *) s2; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { ret = strncasecmpmbs((const unsigned char *) cp1, (const unsigned char *) cp2, lmin); - } else -#endif - for (ret = 0; lmin-- > 0 && ret == 0; cp1++, cp2++) - ret = casetable[*cp1] - casetable[*cp2]; + } else { + for (ret = 0; lmin-- > 0 && ret == 0; cp1++, cp2++) + ret = casetable[*cp1] - casetable[*cp2]; + } if (ret != 0) return ret; /* diff --git a/awk.h b/awk.h index 8bc393e7..9b72a53c 100644 --- a/awk.h +++ b/awk.h @@ -95,13 +95,11 @@ extern int errno; #include "missing_d/gawkbool.h" #endif -#include "mbsupport.h" /* defines MBS_SUPPORT */ - -#if MBS_SUPPORT /* We can handle multibyte strings. */ #include #include -#endif + +#include "mbsupport.h" /* defines stuff for DJGPP to fake MBS */ #ifdef STDC_HEADERS #include @@ -395,10 +393,8 @@ typedef struct exp_node { size_t slen; long sref; int idx; -#if MBS_SUPPORT wchar_t *wsp; size_t wslen; -#endif } val; } sub; NODETYPE type; @@ -1104,11 +1100,7 @@ extern int exit_val; #define do_lint (do_flags & (DO_LINT_INVALID|DO_LINT_ALL)) #define do_lint_old (do_flags & DO_LINT_OLD) #endif -#if MBS_SUPPORT extern int gawk_mb_cur_max; -#else -#define gawk_mb_cur_max (1) -#endif #if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0 extern GETGROUPS_T *groupset; @@ -1416,10 +1408,8 @@ extern AWKNUM nondec2awknum(char *str, size_t len); extern NODE *do_dcgettext(int nargs); extern NODE *do_dcngettext(int nargs); extern NODE *do_bindtextdomain(int nargs); -#if MBS_SUPPORT extern int strncasecmpmbs(const unsigned char *, const unsigned char *, size_t); -#endif /* eval.c */ extern void PUSH_CODE(INSTRUCTION *cp); extern INSTRUCTION *POP_CODE(void); @@ -1602,7 +1592,6 @@ extern NODE *r_dupnode(NODE *n); extern NODE *make_str_node(const char *s, size_t len, int flags); extern void *more_blocks(int id); extern int parse_escape(const char **string_ptr); -#if MBS_SUPPORT extern NODE *str2wstr(NODE *n, size_t **ptr); extern NODE *wstr2str(NODE *n); #define force_wstring(n) str2wstr(n, NULL) @@ -1616,9 +1605,6 @@ extern wint_t btowc_cache[]; #define btowc_cache(x) btowc_cache[(x)&0xFF] extern void init_btowc_cache(); #define is_valid_character(b) (btowc_cache[(b)&0xFF] != WEOF) -#else -#define free_wstr(NODE) /* empty */ -#endif /* re.c */ extern Regexp *make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal); extern int research(Regexp *rp, char *str, int start, size_t len, int flags); diff --git a/awkgram.c b/awkgram.c index 63439b36..431954d9 100644 --- a/awkgram.c +++ b/awkgram.c @@ -4255,7 +4255,6 @@ static const struct token tokentab[] = { {"xor", Op_builtin, LEX_BUILTIN, GAWKX, do_xor, MPF(xor)}, }; -#if MBS_SUPPORT /* Variable containing the current shift state. */ static mbstate_t cur_mbstate; /* Ring buffer containing current characters. */ @@ -4267,10 +4266,6 @@ static int cur_ring_idx; /* This macro means that last nextc() return a singlebyte character or 1st byte of a multibyte character. */ #define nextc_is_1stbyte (cur_char_ring[cur_ring_idx] == 1) -#else /* MBS_SUPPORT */ -/* a dummy */ -#define nextc_is_1stbyte 1 -#endif /* MBS_SUPPORT */ /* getfname --- return name of a builtin function (for pretty printing) */ @@ -5159,8 +5154,6 @@ check_bad_char(int c) /* nextc --- get the next input character */ -#if MBS_SUPPORT - static int nextc(bool check_for_bad) { @@ -5231,35 +5224,14 @@ again: } } -#else /* MBS_SUPPORT */ - -int -nextc(bool check_for_bad) -{ - do { - if (lexeof) - return END_FILE; - if (lexptr && lexptr < lexend) { - if (check_for_bad) - check_bad_char(*lexptr); - return ((int) (unsigned char) *lexptr++); - } - } while (get_src_buf()); - return END_SRC; -} - -#endif /* MBS_SUPPORT */ - /* pushback --- push a character back on the input */ static inline void pushback(void) { -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) cur_ring_idx = (cur_ring_idx == 0)? RING_BUFFER_SIZE - 1 : cur_ring_idx - 1; -#endif (! lexeof && lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr); } @@ -5468,9 +5440,7 @@ retry: thisline = NULL; tok = tokstart; -#if MBS_SUPPORT if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) -#endif switch (c) { case END_SRC: return 0; diff --git a/awkgram.y b/awkgram.y index c59547eb..9cf88da3 100644 --- a/awkgram.y +++ b/awkgram.y @@ -1916,7 +1916,6 @@ static const struct token tokentab[] = { {"xor", Op_builtin, LEX_BUILTIN, GAWKX, do_xor, MPF(xor)}, }; -#if MBS_SUPPORT /* Variable containing the current shift state. */ static mbstate_t cur_mbstate; /* Ring buffer containing current characters. */ @@ -1928,10 +1927,6 @@ static int cur_ring_idx; /* This macro means that last nextc() return a singlebyte character or 1st byte of a multibyte character. */ #define nextc_is_1stbyte (cur_char_ring[cur_ring_idx] == 1) -#else /* MBS_SUPPORT */ -/* a dummy */ -#define nextc_is_1stbyte 1 -#endif /* MBS_SUPPORT */ /* getfname --- return name of a builtin function (for pretty printing) */ @@ -2820,8 +2815,6 @@ check_bad_char(int c) /* nextc --- get the next input character */ -#if MBS_SUPPORT - static int nextc(bool check_for_bad) { @@ -2892,35 +2885,14 @@ again: } } -#else /* MBS_SUPPORT */ - -int -nextc(bool check_for_bad) -{ - do { - if (lexeof) - return END_FILE; - if (lexptr && lexptr < lexend) { - if (check_for_bad) - check_bad_char(*lexptr); - return ((int) (unsigned char) *lexptr++); - } - } while (get_src_buf()); - return END_SRC; -} - -#endif /* MBS_SUPPORT */ - /* pushback --- push a character back on the input */ static inline void pushback(void) { -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) cur_ring_idx = (cur_ring_idx == 0)? RING_BUFFER_SIZE - 1 : cur_ring_idx - 1; -#endif (! lexeof && lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr); } @@ -3129,9 +3101,7 @@ retry: thisline = NULL; tok = tokstart; -#if MBS_SUPPORT if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) -#endif switch (c) { case END_SRC: return 0; diff --git a/builtin.c b/builtin.c index 3eb09b48..75e4f580 100644 --- a/builtin.c +++ b/builtin.c @@ -247,7 +247,6 @@ do_fflush(int nargs) return make_number((AWKNUM) status); } -#if MBS_SUPPORT /* strncasecmpmbs --- like strncasecmp (multibyte string version) */ int @@ -327,14 +326,6 @@ index_multibyte_buffer(char* src, char* dest, int len) dest[idx] = mbclen; } } -#else -/* a dummy function */ -static void -index_multibyte_buffer(char* src ATTRIBUTE_UNUSED, char* dest ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED) -{ - cant_happen(); -} -#endif /* do_index --- find index of a string */ @@ -345,7 +336,6 @@ do_index(int nargs) const char *p1, *p2; size_t l1, l2; long ret; -#if MBS_SUPPORT bool do_single_byte = false; mbstate_t mbs1, mbs2; @@ -353,7 +343,6 @@ do_index(int nargs) memset(& mbs1, 0, sizeof(mbstate_t)); memset(& mbs2, 0, sizeof(mbstate_t)); } -#endif POP_TWO_SCALARS(s1, s2); @@ -383,7 +372,6 @@ do_index(int nargs) goto out; } -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { s1 = force_wstring(s1); s2 = force_wstring(s2); @@ -394,14 +382,12 @@ do_index(int nargs) do_single_byte = ((s1->wstlen == 0 && s1->stlen > 0) || (s2->wstlen == 0 && s2->stlen > 0)); } -#endif /* IGNORECASE will already be false if posix */ if (IGNORECASE) { while (l1 > 0) { if (l2 > l1) break; -#if MBS_SUPPORT if (! do_single_byte && gawk_mb_cur_max > 1) { const wchar_t *pos; @@ -412,21 +398,18 @@ do_index(int nargs) ret = pos - s1->wstptr + 1; /* 1-based */ goto out; } else { -#endif - /* - * Could use tolower(*p1) == tolower(*p2) here. - * See discussion in eval.c as to why not. - */ - if (casetable[(unsigned char)*p1] == casetable[(unsigned char)*p2] - && (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) { - ret = 1 + s1->stlen - l1; - break; - } - l1--; - p1++; -#if MBS_SUPPORT + /* + * Could use tolower(*p1) == tolower(*p2) here. + * See discussion in eval.c as to why not. + */ + if (casetable[(unsigned char)*p1] == casetable[(unsigned char)*p2] + && (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) { + ret = 1 + s1->stlen - l1; + break; + } + l1--; + p1++; } -#endif } } else { while (l1 > 0) { @@ -437,7 +420,6 @@ do_index(int nargs) ret = 1 + s1->stlen - l1; break; } -#if MBS_SUPPORT if (! do_single_byte && gawk_mb_cur_max > 1) { const wchar_t *pos; @@ -451,10 +433,6 @@ do_index(int nargs) l1--; p1++; } -#else - l1--; - p1++; -#endif } } out: @@ -544,7 +522,6 @@ do_length(int nargs) lintwarn(_("length: received non-string argument")); tmp = force_string(tmp); -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { tmp = force_wstring(tmp); len = tmp->wstlen; @@ -555,7 +532,6 @@ do_length(int nargs) if (len == 0 && tmp->stlen > 0) len = tmp->stlen; } else -#endif len = tmp->stlen; DEREF(tmp); @@ -1058,7 +1034,6 @@ check_pos: (void) force_number(arg); if ((arg->flags & NUMBER) != 0) { uval = get_number_uj(arg); -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { char buf[100]; wchar_t wc; @@ -1099,7 +1074,7 @@ out0: ; /* else, fall through */ -#endif + cpbuf[0] = uval; prec = 1; cp = cpbuf; @@ -1113,7 +1088,6 @@ out0: */ cp = arg->stptr; prec = 1; -#if MBS_SUPPORT /* * First character can be multiple bytes if * it's a multibyte character. Grr. @@ -1131,7 +1105,6 @@ out0: fw += count - 1; } } -#endif goto pr_tail; case 's': need_format = false; @@ -1805,13 +1778,11 @@ do_substr(int nargs) if (nargs == 2) { /* third arg. missing */ /* use remainder of string */ length = t1->stlen - indx; /* default to bytes */ -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { t1 = force_wstring(t1); if (t1->wstlen > 0) /* use length of wide char string if we have one */ length = t1->wstlen - indx; } -#endif d_length = length; /* set here in case used in diagnostics, below */ } @@ -1824,12 +1795,10 @@ do_substr(int nargs) } /* get total len of input string, for following checks */ -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { t1 = force_wstring(t1); src_len = t1->wstlen; } else -#endif src_len = t1->stlen; if (indx >= src_len) { @@ -1847,7 +1816,6 @@ do_substr(int nargs) length = src_len - indx; } -#if MBS_SUPPORT /* force_wstring() already called */ if (gawk_mb_cur_max == 1 || t1->wstlen == t1->stlen) /* single byte case */ @@ -1877,9 +1845,6 @@ do_substr(int nargs) *cp = '\0'; r = make_str_node(substr, cp - substr, ALREADY_MALLOCED); } -#else - r = make_string(t1->stptr + indx, length); -#endif DEREF(t1); return r; @@ -2211,7 +2176,6 @@ do_print_rec(int nargs, int redirtype) rp->output.gawk_fflush(rp->output.fp, rp->output.opaque); } -#if MBS_SUPPORT /* is_wupper --- function version of iswupper for passing function pointers */ @@ -2276,7 +2240,6 @@ wide_tolower(wchar_t *wstr, size_t wlen) { wide_change_case(wstr, wlen, is_wupper, to_wlower); } -#endif /* do_tolower --- lower case a string */ @@ -2299,14 +2262,11 @@ do_tolower(int nargs) cp < cp2; cp++) if (isupper(*cp)) *cp = tolower(*cp); - } -#if MBS_SUPPORT - else { + } else { force_wstring(t2); wide_tolower(t2->wstptr, t2->wstlen); wstr2str(t2); } -#endif DEREF(t1); return t2; @@ -2333,14 +2293,11 @@ do_toupper(int nargs) cp < cp2; cp++) if (islower(*cp)) *cp = toupper(*cp); - } -#if MBS_SUPPORT - else { + } else { force_wstring(t2); wide_toupper(t2->wstptr, t2->wstlen); wstr2str(t2); } -#endif DEREF(t1); return t2; @@ -2490,13 +2447,12 @@ do_match(int nargs) size_t *wc_indices = NULL; rlength = REEND(rp, t1->stptr) - RESTART(rp, t1->stptr); /* byte length */ -#if MBS_SUPPORT if (rlength > 0 && gawk_mb_cur_max > 1) { t1 = str2wstr(t1, & wc_indices); rlength = wc_indices[rstart + rlength - 1] - wc_indices[rstart] + 1; rstart = wc_indices[rstart]; } -#endif + rstart++; /* now it's 1-based indexing */ /* Build the array only if the caller wants the optional subpatterns */ @@ -2518,12 +2474,10 @@ do_match(int nargs) start = t1->stptr + s; subpat_start = s; subpat_len = len = SUBPATEND(rp, t1->stptr, ii) - s; -#if MBS_SUPPORT if (len > 0 && gawk_mb_cur_max > 1) { subpat_start = wc_indices[s]; subpat_len = wc_indices[s + len - 1] - subpat_start + 1; } -#endif it = make_string(start, len); it->flags |= MAYBE_NUM; /* user input */ @@ -3578,7 +3532,6 @@ do_bindtextdomain(int nargs) static size_t mbc_byte_count(const char *ptr, size_t numchars) { -#if MBS_SUPPORT mbstate_t cur_state; size_t sum = 0; int mb_len; @@ -3599,9 +3552,6 @@ mbc_byte_count(const char *ptr, size_t numchars) } return sum; -#else - return numchars; -#endif } /* mbc_char_count --- return number of m.b. chars in string, up to numbytes bytes */ @@ -3609,7 +3559,6 @@ mbc_byte_count(const char *ptr, size_t numchars) static size_t mbc_char_count(const char *ptr, size_t numbytes) { -#if MBS_SUPPORT mbstate_t cur_state; size_t sum = 0; int mb_len; @@ -3632,7 +3581,4 @@ mbc_char_count(const char *ptr, size_t numbytes) } return sum; -#else - return numbytes; -#endif } diff --git a/dfa.c b/dfa.c index e658ad8a..53a8c2cc 100644 --- a/dfa.c +++ b/dfa.c @@ -58,15 +58,15 @@ #include "gettext.h" #define _(str) gettext (str) -#include "mbsupport.h" /* Define MBS_SUPPORT to 1 or 0, as appropriate. */ -#if MBS_SUPPORT -/* We can handle multibyte strings. */ -# include -# include -#endif +#include +#include #include "xalloc.h" +#if defined(__DJGPP__) +#include "mbsupport.h" +#endif + #include "dfa.h" #ifdef GAWK @@ -399,12 +399,10 @@ struct dfa */ int *multibyte_prop; -#if MBS_SUPPORT /* A table indexed by byte values that contains the corresponding wide character (if any) for that byte. WEOF means the byte is not a valid single-byte character. */ wint_t mbrtowc_cache[NOTCHAR]; -#endif /* Array of the bracket expression in the DFA. */ struct mb_char_classes *mbcsets; @@ -489,7 +487,6 @@ static void regexp (void); static void dfambcache (struct dfa *d) { -#if MBS_SUPPORT int i; for (i = CHAR_MIN; i <= CHAR_MAX; ++i) { @@ -499,10 +496,8 @@ dfambcache (struct dfa *d) wchar_t wc; d->mbrtowc_cache[uc] = mbrtowc (&wc, &c, 1, &s) <= 1 ? wc : WEOF; } -#endif } -#if MBS_SUPPORT /* Store into *PWC the result of converting the leading bytes of the multibyte buffer S of length N bytes, using the mbrtowc_cache in *D and updating the conversion state in *D. On conversion error, @@ -541,9 +536,6 @@ mbs_to_wchar (wint_t *pwc, char const *s, size_t n, struct dfa *d) *pwc = wc; return 1; } -#else -#define mbs_to_wchar(pwc, s, n, d) (WEOF) -#endif #ifdef DEBUG @@ -738,7 +730,7 @@ static charclass newline; #ifdef __GLIBC__ # define is_valid_unibyte_character(c) 1 #else -# define is_valid_unibyte_character(c) (! (MBS_SUPPORT && btowc (c) == WEOF)) +# define is_valid_unibyte_character(c) (btowc (c) != WEOF) #endif /* C is a "word-constituent" byte. */ @@ -799,17 +791,12 @@ dfasyntax (reg_syntax_t bits, int fold, unsigned char eol) static bool setbit_wc (wint_t wc, charclass c) { -#if MBS_SUPPORT int b = wctob (wc); if (b == EOF) return false; setbit (b, c); return true; -#else - abort (); - /*NOTREACHED*/ return false; -#endif } /* Set a bit for B and its case variants in the charclass C. @@ -907,7 +894,6 @@ static wint_t wctok; /* Wide character representation of the current MB_CUR_MAX > 1. */ -#if MBS_SUPPORT /* Fetch the next lexical input character. Set C (of type int) to the next input byte, except set C to EOF if the input is a multibyte character of length greater than 1. Set WC (of type wint_t) to the @@ -936,23 +922,6 @@ static wint_t wctok; /* Wide character representation of the current } \ } while (0) -#else -/* Note that characters become unsigned here. */ -# define FETCH_WC(c, unused, eoferr) \ - do { \ - if (! lexleft) \ - { \ - if ((eoferr) != 0) \ - dfaerror (eoferr); \ - else \ - return lasttok = END; \ - } \ - (c) = to_uchar (*lexptr++); \ - --lexleft; \ - } while (0) - -#endif /* MBS_SUPPORT */ - #ifndef MIN # define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif @@ -1764,7 +1733,6 @@ addtok (token t) } } -#if MBS_SUPPORT /* We treat a multibyte character as a single atom, so that DFA can treat a multibyte character as a single expression. @@ -1796,17 +1764,10 @@ addtok_wc (wint_t wc) addtok (CAT); } } -#else -static void -addtok_wc (wint_t wc) -{ -} -#endif static void add_utf8_anychar (void) { -#if MBS_SUPPORT static const charclass utf8_classes[5] = { /* 80-bf: non-leading bytes. */ {0, 0, 0, 0, CHARCLASS_WORD_MASK, CHARCLASS_WORD_MASK, 0, 0}, @@ -1861,7 +1822,6 @@ add_utf8_anychar (void) addtok (CAT); addtok (OR); } -#endif } /* The grammar understood by the parser is as follows. @@ -1902,7 +1862,7 @@ add_utf8_anychar (void) static void atom (void) { - if (MBS_SUPPORT && tok == WCHAR) + if (tok == WCHAR) { if (wctok == WEOF) addtok (BACKREF); @@ -1924,7 +1884,7 @@ atom (void) tok = lex (); } - else if (MBS_SUPPORT && tok == ANYCHAR && using_utf8 ()) + else if (tok == ANYCHAR && using_utf8 ()) { /* For UTF-8 expand the period to a series of CSETs that define a valid UTF-8 character. This avoids using the slow multibyte path. I'm @@ -1938,9 +1898,7 @@ atom (void) } else if ((tok >= 0 && tok < NOTCHAR) || tok >= CSET || tok == BACKREF || tok == BEGLINE || tok == ENDLINE || tok == BEGWORD -#if MBS_SUPPORT || tok == ANYCHAR || tok == MBCSET -#endif /* MBS_SUPPORT */ || tok == ENDWORD || tok == LIMWORD || tok == NOTLIMWORD) { addtok (tok); @@ -2273,10 +2231,8 @@ epsclosure (position_set *s, struct dfa const *d, char *visited) for (i = 0; i < s->nelem; ++i) if (d->tokens[s->elems[i].index] >= NOTCHAR && d->tokens[s->elems[i].index] != BACKREF -#if MBS_SUPPORT && d->tokens[s->elems[i].index] != ANYCHAR && d->tokens[s->elems[i].index] != MBCSET -#endif && d->tokens[s->elems[i].index] < CSET) { if (!initialized) @@ -2595,9 +2551,7 @@ dfaanalyze (struct dfa *d, int searchflag) it with its epsilon closure. */ for (i = 0; i < d->tindex; ++i) if (d->tokens[i] < NOTCHAR || d->tokens[i] == BACKREF -#if MBS_SUPPORT || d->tokens[i] == ANYCHAR || d->tokens[i] == MBCSET -#endif || d->tokens[i] >= CSET) { #ifdef DEBUG @@ -2707,9 +2661,8 @@ dfastate (state_num s, struct dfa *d, state_num trans[]) copyset (d->charclasses[d->tokens[pos.index] - CSET], matches); else { - if (MBS_SUPPORT - && (d->tokens[pos.index] == MBCSET - || d->tokens[pos.index] == ANYCHAR)) + if (d->tokens[pos.index] == MBCSET + || d->tokens[pos.index] == ANYCHAR) { /* MB_CUR_MAX > 1 */ if (d->tokens[pos.index] == MBCSET) @@ -3684,7 +3637,7 @@ dfaoptimize (struct dfa *d) size_t i; bool have_backref = false; - if (!MBS_SUPPORT || !using_utf8 ()) + if (!using_utf8 ()) return; for (i = 0; i < d->tindex; ++i) diff --git a/eval.c b/eval.c index 0d6a07b6..82b11719 100644 --- a/eval.c +++ b/eval.c @@ -530,7 +530,7 @@ posix_compare(NODE *s1, NODE *s2) * In either case, ret will be the right thing to return. */ } -#if MBS_SUPPORT +#if ! defined(__DJGPP__) else { /* Similar logic, using wide characters */ (void) force_wstring(s1); @@ -610,15 +610,14 @@ cmp_nodes(NODE *t1, NODE *t2) const unsigned char *cp1 = (const unsigned char *) t1->stptr; const unsigned char *cp2 = (const unsigned char *) t2->stptr; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { ret = strncasecmpmbs((const unsigned char *) cp1, (const unsigned char *) cp2, l); - } else -#endif - /* Could use tolower() here; see discussion above. */ - for (ret = 0; l-- > 0 && ret == 0; cp1++, cp2++) - ret = casetable[*cp1] - casetable[*cp2]; + } else { + /* Could use tolower() here; see discussion above. */ + for (ret = 0; l-- > 0 && ret == 0; cp1++, cp2++) + ret = casetable[*cp1] - casetable[*cp2]; + } } else ret = memcmp(t1->stptr, t2->stptr, l); diff --git a/field.c b/field.c index 7b4f2190..6a7c6b1d 100644 --- a/field.c +++ b/field.c @@ -392,12 +392,10 @@ re_parse_field(long up_to, /* parse only up to this field number */ char *end = scan + len; int regex_flags = RE_NEED_START; char *sep; -#if MBS_SUPPORT size_t mbclen = 0; mbstate_t mbs; - if (gawk_mb_cur_max > 1) - memset(&mbs, 0, sizeof(mbstate_t)); -#endif + + memset(&mbs, 0, sizeof(mbstate_t)); if (in_middle) regex_flags |= RE_NO_BOL; @@ -424,7 +422,6 @@ re_parse_field(long up_to, /* parse only up to this field number */ && nf < up_to) { regex_flags |= RE_NO_BOL; if (REEND(rp, scan) == RESTART(rp, scan)) { /* null match */ -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { mbclen = mbrlen(scan, end-scan, &mbs); if ((mbclen == 1) || (mbclen == (size_t) -1) @@ -434,8 +431,7 @@ re_parse_field(long up_to, /* parse only up to this field number */ } scan += mbclen; } else -#endif - scan++; + scan++; if (scan == end) { (*set)(++nf, field, (long)(scan - field), n); up_to = nf; @@ -636,7 +632,6 @@ null_parse_field(long up_to, /* parse only up to this field number */ if (len == 0) return nf; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { mbstate_t mbs; memset(&mbs, 0, sizeof(mbstate_t)); @@ -652,12 +647,12 @@ null_parse_field(long up_to, /* parse only up to this field number */ (*set)(++nf, scan, mbclen, n); scan += mbclen; } - } else -#endif - for (; nf < up_to && scan < end; scan++) { - if (sep_arr != NULL && nf > 0) - set_element(nf, scan, 0L, sep_arr); - (*set)(++nf, scan, 1L, n); + } else { + for (; nf < up_to && scan < end; scan++) { + if (sep_arr != NULL && nf > 0) + set_element(nf, scan, 0L, sep_arr); + (*set)(++nf, scan, 1L, n); + } } *buf = scan; @@ -688,12 +683,10 @@ sc_parse_field(long up_to, /* parse only up to this field number */ char *field; char *end = scan + len; char sav; -#if MBS_SUPPORT size_t mbclen = 0; mbstate_t mbs; - if (gawk_mb_cur_max > 1) - memset(&mbs, 0, sizeof(mbstate_t)); -#endif + + memset(&mbs, 0, sizeof(mbstate_t)); if (up_to == UNLIMITED) nf = 0; @@ -712,7 +705,6 @@ sc_parse_field(long up_to, /* parse only up to this field number */ for (; nf < up_to;) { field = scan; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { while (*scan != fschar) { mbclen = mbrlen(scan, end-scan, &mbs); @@ -723,10 +715,10 @@ sc_parse_field(long up_to, /* parse only up to this field number */ } scan += mbclen; } - } else -#endif - while (*scan != fschar) - scan++; + } else { + while (*scan != fschar) + scan++; + } (*set)(++nf, field, (long)(scan - field), n); if (scan == end) break; @@ -766,7 +758,6 @@ fw_parse_field(long up_to, /* parse only up to this field number */ char *scan = *buf; long nf = parse_high_water; char *end = scan + len; -#if MBS_SUPPORT int nmbc; size_t mbclen; size_t mbslen; @@ -775,14 +766,12 @@ fw_parse_field(long up_to, /* parse only up to this field number */ mbstate_t mbs; memset(&mbs, 0, sizeof(mbstate_t)); -#endif if (up_to == UNLIMITED) nf = 0; if (len == 0) return nf; for (; nf < up_to && (len = FIELDWIDTHS[nf+1]) != -1; ) { -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { nmbc = 0; mbslen = 0; @@ -805,10 +794,7 @@ fw_parse_field(long up_to, /* parse only up to this field number */ } (*set)(++nf, scan, (long) mbslen, n); scan += mbslen; - } - else -#endif - { + } else { if (len > end - scan) len = end - scan; (*set)(++nf, scan, (long) len, n); @@ -1451,13 +1437,8 @@ set_fpat_function: * Implementation varies if doing MBS or not. */ -#if MBS_SUPPORT #define increment_scan(scanp, len) incr_scan(scanp, len, & mbs) -#else -#define increment_scan(scanp, len) ((*scanp)++) -#endif -#if MBS_SUPPORT /* incr_scan --- MBS version of increment_scan() */ static void @@ -1478,7 +1459,6 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs) } else (*scanp)++; } -#endif /* * fpat_parse_field --- parse fields using a regexp. @@ -1603,12 +1583,9 @@ fpat_parse_field(long up_to, /* parse only up to this field number */ bool need_to_set_sep; bool non_empty; bool eosflag; -#if MBS_SUPPORT mbstate_t mbs; - if (gawk_mb_cur_max > 1) - memset(&mbs, 0, sizeof(mbstate_t)); -#endif + memset(&mbs, 0, sizeof(mbstate_t)); if (up_to == UNLIMITED) nf = 0; diff --git a/interpret.h b/interpret.h index 593f11a6..83ccbfc5 100644 --- a/interpret.h +++ b/interpret.h @@ -711,7 +711,6 @@ mod: t1->stptr[nlen] = '\0'; t1->flags &= ~(NUMCUR|NUMBER|NUMINT); -#if MBS_SUPPORT if ((t1->flags & WSTRCUR) != 0 && (t2->flags & WSTRCUR) != 0) { size_t wlen = t1->wstlen + t2->wstlen; @@ -723,7 +722,6 @@ mod: t1->flags |= WSTRCUR; } else free_wstr(*lhs); -#endif } else { size_t nlen = t1->stlen + t2->stlen; char *p; diff --git a/io.c b/io.c index c584a0c2..1d15d887 100644 --- a/io.c +++ b/io.c @@ -3073,10 +3073,8 @@ rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state) { char *bp; char rs; -#if MBS_SUPPORT size_t mbclen = 0; mbstate_t mbs; -#endif memset(recm, '\0', sizeof(struct recmatch)); rs = RS->stptr[0]; @@ -3087,7 +3085,6 @@ rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state) if (*state == INDATA) /* skip over data we've already seen */ bp += iop->scanoff; -#if MBS_SUPPORT /* * From: Bruno Haible * To: Aharon Robbins , gnits@gnits.org @@ -3184,7 +3181,7 @@ rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state) return NOTERM; } } -#endif + while (*bp != rs) bp++; diff --git a/main.c b/main.c index b9b76618..ddda1d66 100644 --- a/main.c +++ b/main.c @@ -155,9 +155,7 @@ static const char *locale = ""; /* default value to setlocale */ int use_lc_numeric = false; /* obey locale for decimal point */ -#if MBS_SUPPORT int gawk_mb_cur_max; /* MB_CUR_MAX value, see comment in main() */ -#endif FILE *output_fp; /* default gawk output, can be redirected in the debugger */ bool output_is_tty = false; /* control flushing of output */ @@ -290,14 +288,12 @@ main(int argc, char **argv) set_locale_stuff(); -#if MBS_SUPPORT /* * In glibc, MB_CUR_MAX is actually a function. This value is * tested *a lot* in many speed-critical places in gawk. Caching * this value once makes a speed difference. */ gawk_mb_cur_max = MB_CUR_MAX; - /* Without MBS_SUPPORT, gawk_mb_cur_max is 1. */ #ifdef LIBC_IS_BORKED { const char *env_lc; @@ -312,7 +308,6 @@ main(int argc, char **argv) /* init the cache for checking bytes if they're characters */ init_btowc_cache(); -#endif if (do_nostalgia) @@ -346,7 +341,6 @@ main(int argc, char **argv) if (do_lint && os_is_setuid()) warning(_("running %s setuid root may be a security problem"), myname); -#if MBS_SUPPORT if (do_binary) { if (do_posix) warning(_("`--posix' overrides `--characters-as-bytes'")); @@ -356,7 +350,6 @@ main(int argc, char **argv) setlocale(LC_ALL, "C"); #endif } -#endif if (do_debug) /* Need to register the debugger pre-exec hook before any other */ init_debug(); diff --git a/mbsupport.h b/mbsupport.h index 9a62486f..f4e1a821 100644 --- a/mbsupport.h +++ b/mbsupport.h @@ -23,81 +23,25 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/* - * This file is needed because we test for i18n support in 3 different - * places, and we want a consistent definition in all of them. Following - * the ``Don't Repeat Yourself'' principle from "The Pragmatic Programmer", - * we centralize the tests here. - * - * This test is the union of all the current tests. - */ - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifndef NO_MBSUPPORT - -#if defined(HAVE_ISWCTYPE) \ - && defined(HAVE_LOCALE_H) \ - && (defined(HAVE_BTOWC) || defined(ZOS_USS)) \ - && defined(HAVE_MBRLEN) \ - && defined(HAVE_MBRTOWC) \ - && defined(HAVE_WCHAR_H) \ - && defined(HAVE_WCRTOMB) \ - && defined(HAVE_WCSCOLL) \ - && defined(HAVE_WCTYPE) \ - && defined(HAVE_WCTYPE_H) \ - && defined(HAVE_WCTYPE_T) \ - && defined(HAVE_WINT_T) \ - && defined(HAVE_ISWLOWER) \ - && defined(HAVE_ISWUPPER) \ - && defined(HAVE_TOWLOWER) \ - && defined(HAVE_TOWUPPER) \ - && (defined(HAVE_STDLIB_H) && defined(MB_CUR_MAX)) \ -/* We can handle multibyte strings. */ -# define MBS_SUPPORT 1 -#else -# define MBS_SUPPORT 0 -#endif -#else /* NO_MBSUPPORT is defined */ -# define MBS_SUPPORT 0 -#endif - -#if ! MBS_SUPPORT +#ifdef __DJGPP__ # undef MB_CUR_MAX # define MB_CUR_MAX 1 -/* All this glop is for dfa.c. Bleah. */ - -#ifndef __DJGPP__ -#define wchar_t char -#endif +/* All this glop is for DGJPP */ -#define wctype_t int -#define wint_t int -#define mbstate_t int -#define WEOF EOF #define towupper toupper #define towlower tolower -#ifndef __DJGPP__ -#define btowc(x) ((int)x) -#endif #define iswalnum isalnum #define iswalpha isalpha #define iswupper isupper -#if defined(ZOS_USS) -#undef towupper -#undef towlower -#undef btowc -#undef iswalnum -#undef iswalpha -#undef iswupper -#undef wctype -#undef iswctype -#undef wcscoll -#endif +#define iswlower islower + +#define mbrtowc(wcp, s, e, mbs) (-1) +#define mbrlen(s, e, mbs) strlen(s) +#define wcrtomb(wc, b, mbs) (-1) +#define wcslen strlen +#define wctob(wc) (EOF) extern wctype_t wctype(const char *name); extern int iswctype(wint_t wc, wctype_t desc); diff --git a/mpfr.c b/mpfr.c index e53af616..a89b2bc6 100644 --- a/mpfr.c +++ b/mpfr.c @@ -121,10 +121,8 @@ mpg_node(unsigned int tp) r->flags |= MALLOC|NUMBER|NUMCUR; r->stptr = NULL; r->stlen = 0; -#if MBS_SUPPORT r->wstptr = NULL; r->wstlen = 0; -#endif /* defined MBS_SUPPORT */ return r; } diff --git a/node.c b/node.c index a3264f2d..9fd4c7b9 100644 --- a/node.c +++ b/node.c @@ -281,7 +281,6 @@ r_dupnode(NODE *n) r->flags &= ~FIELD; r->flags |= MALLOC; r->valref = 1; -#if MBS_SUPPORT /* * DON'T call free_wstr(r) here! * r->wstptr still points at n->wstptr's value, and we @@ -289,13 +288,11 @@ r_dupnode(NODE *n) */ r->wstptr = NULL; r->wstlen = 0; -#endif /* MBS_SUPPORT */ if ((n->flags & STRCUR) != 0) { emalloc(r->stptr, char *, n->stlen + 2, "r_dupnode"); memcpy(r->stptr, n->stptr, n->stlen); r->stptr[n->stlen] = '\0'; -#if MBS_SUPPORT if ((n->flags & WSTRCUR) != 0) { r->wstlen = n->wstlen; emalloc(r->wstptr, wchar_t *, sizeof(wchar_t) * (n->wstlen + 2), "r_dupnode"); @@ -303,7 +300,6 @@ r_dupnode(NODE *n) r->wstptr[n->wstlen] = L'\0'; r->flags |= WSTRCUR; } -#endif /* MBS_SUPPORT */ } return r; @@ -322,10 +318,8 @@ r_make_number(double x) r->valref = 1; r->stptr = NULL; r->stlen = 0; -#if MBS_SUPPORT r->wstptr = NULL; r->wstlen = 0; -#endif /* defined MBS_SUPPORT */ return r; } @@ -368,11 +362,8 @@ make_str_node(const char *s, size_t len, int flags) r->flags = (MALLOC|STRING|STRCUR); r->valref = 1; r->stfmt = -1; - -#if MBS_SUPPORT r->wstptr = NULL; r->wstlen = 0; -#endif /* MBS_SUPPORT */ if ((flags & ALREADY_MALLOCED) != 0) r->stptr = (char *) s; @@ -387,15 +378,12 @@ make_str_node(const char *s, size_t len, int flags) char *ptm; int c; const char *end; -#if MBS_SUPPORT mbstate_t cur_state; memset(& cur_state, 0, sizeof(cur_state)); -#endif end = &(r->stptr[len]); for (pf = ptm = r->stptr; pf < end;) { -#if MBS_SUPPORT /* * Keep multibyte characters together. This avoids * problems if a subsequent byte of a multibyte @@ -412,7 +400,7 @@ make_str_node(const char *s, size_t len, int flags) continue; } } -#endif + c = *pf++; if (c == '\\') { c = parse_escape(&pf); @@ -642,7 +630,6 @@ get_numbase(const char *s, bool use_locale) return 8; } -#if MBS_SUPPORT /* str2wstr --- convert a multibyte string to a wide string */ NODE * @@ -891,7 +878,6 @@ out: ; return NULL; } -#endif /* MBS_SUPPORT */ /* is_ieee_magic_val --- return true for +inf, -inf, +nan, -nan */ @@ -938,7 +924,6 @@ get_ieee_magic_val(const char *val) return v; } -#if MBS_SUPPORT wint_t btowc_cache[256]; /* init_btowc_cache --- initialize the cache */ @@ -951,7 +936,6 @@ void init_btowc_cache() btowc_cache[i] = btowc(i); } } -#endif #define BLOCKCHUNK 100 diff --git a/re.c b/re.c index 12c212a6..edb5bc48 100644 --- a/re.c +++ b/re.c @@ -54,12 +54,9 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) * It is 0, when the current character is a singlebyte character. */ size_t is_multibyte = 0; -#if MBS_SUPPORT mbstate_t mbs; - if (gawk_mb_cur_max > 1) - memset(&mbs, 0, sizeof(mbstate_t)); /* Initialize. */ -#endif + memset(&mbs, 0, sizeof(mbstate_t)); /* Initialize. */ if (first) { first = false; @@ -87,7 +84,6 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) dest = buf; while (src < end) { -#if MBS_SUPPORT if (gawk_mb_cur_max > 1 && ! is_multibyte) { /* The previous byte is a singlebyte character, or last byte of a multibyte character. We check the next character. */ @@ -100,7 +96,6 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) is_multibyte = 0; } } -#endif /* We skip multibyte character, since it must not be a special character. */ diff --git a/regex_internal.h b/regex_internal.h index c8981a08..3fc2fc58 100644 --- a/regex_internal.h +++ b/regex_internal.h @@ -26,18 +26,16 @@ #include #include -#include "mbsupport.h" /* gawk */ - #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC # include #endif #if defined HAVE_LOCALE_H || defined _LIBC # include #endif -#if MBS_SUPPORT && (defined HAVE_WCHAR_H || defined _LIBC) +#if defined HAVE_WCHAR_H || defined _LIBC # include #endif /* HAVE_WCHAR_H || _LIBC */ -#if MBS_SUPPORT && (defined HAVE_WCTYPE_H || defined _LIBC) +#if defined HAVE_WCTYPE_H || defined _LIBC # include #endif /* HAVE_WCTYPE_H || _LIBC */ #if defined HAVE_STDBOOL_H || defined _LIBC @@ -109,7 +107,7 @@ is_blank (int c) # define SIZE_MAX ((size_t) -1) #endif -#if MBS_SUPPORT || _LIBC +#if ! defined(__DJGPP__) && (defined(GAWK) || _LIBC) # define RE_ENABLE_I18N #endif diff --git a/replace.c b/replace.c index 71a8dc51..6d345f52 100644 --- a/replace.c +++ b/replace.c @@ -111,6 +111,6 @@ #include "missing_d/strcoll.c" #endif -#if ! MBS_SUPPORT +#if defined(__DJGPP__) #include "missing_d/wcmisc.c" #endif -- cgit v1.2.3 From ee77f64d563188b6a5d761fd9342df00431e99d8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 16 Nov 2014 19:43:18 +0200 Subject: Revert field reference changes of 2014-11-11. --- ChangeLog | 5 +++++ interpret.h | 24 ++++-------------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 864ea364..0facf7a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-16 Arnold D. Robbins + + * interpret.h: Revert change of 2014-11-11 since it breaks + certain uses. + 2014-11-15 Arnold D. Robbins * array.c, awk.h, awkgram.y, builtin.c, dfa.c, eval.c, field.c, diff --git a/interpret.h b/interpret.h index 83ccbfc5..74f56c73 100644 --- a/interpret.h +++ b/interpret.h @@ -340,12 +340,7 @@ uninitialized_scalar: lhs = r_get_field(t1, (Func_ptr *) 0, true); decr_sp(); DEREF(t1); - /* only for $0, up ref count */ - if (*lhs == fields_arr[0]) { - r = *lhs; - UPREF(r); - } else - r = dupnode(*lhs); + r = dupnode(*lhs); /* can't use UPREF here */ PUSH(r); break; @@ -654,22 +649,11 @@ mod: lhs = get_lhs(pc->memory, false); unref(*lhs); r = pc->initval; /* constant initializer */ - if (r != NULL) { + if (r == NULL) + *lhs = POP_SCALAR(); + else { UPREF(r); *lhs = r; - } else { - r = POP_SCALAR(); - - /* if was a field, turn it into a var */ - if ((r->flags & FIELD) == 0) { - *lhs = r; - } else if (r->valref == 1) { - r->flags &= ~FIELD; - *lhs = r; - } else { - *lhs = dupnode(r); - DEREF(r); - } } break; -- cgit v1.2.3 From d03f6f66493d8a8a80810f51fb363dfb7bcd02a5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 16 Nov 2014 19:43:58 +0200 Subject: Sync dfa with grep. --- ChangeLog | 4 ++++ dfa.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0facf7a6..67b36937 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ * interpret.h: Revert change of 2014-11-11 since it breaks certain uses. + Unrelated: + + * dfa.c: Sync with GNU grep. + 2014-11-15 Arnold D. Robbins * array.c, awk.h, awkgram.y, builtin.c, dfa.c, eval.c, field.c, diff --git a/dfa.c b/dfa.c index 53a8c2cc..66136ce2 100644 --- a/dfa.c +++ b/dfa.c @@ -3697,8 +3697,11 @@ dfassbuild (struct dfa *d) sup->musts = NULL; sup->charclasses = xnmalloc (sup->calloc, sizeof *sup->charclasses); - memcpy (sup->charclasses, d->charclasses, - d->cindex * sizeof *sup->charclasses); + if (d->cindex) + { + memcpy (sup->charclasses, d->charclasses, + d->cindex * sizeof *sup->charclasses); + } sup->tokens = xnmalloc (d->tindex, 2 * sizeof *sup->tokens); sup->talloc = d->tindex * 2; -- cgit v1.2.3 From 82e7082d1653a2143fc29d405fe40329188828b5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 16 Nov 2014 19:44:24 +0200 Subject: Update in NEWS. --- NEWS | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 8791de31..d6a69af4 100644 --- a/NEWS +++ b/NEWS @@ -23,17 +23,19 @@ Changes from 4.1.1 to 4.1.2 5. Indirect function calls now work for both built-in and extension functions. -6. In non-English locales, it was accidentally possible to use "letters" +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.) If you feel that you must have this misfeature, use `configure --help' to see what option to use when configuring gawk to reenable it. -7. The "where" command has been added to the debugger as an alias +8. The "where" command has been added to the debugger as an alias for "backtrace". This will make life easier for long-time GDB users. -8. Gawk no longer explicitly checks the current directory after doing +9. Gawk no longer explicitly checks the current directory after doing a path search of AWKPATH. The default value continues to have "." at the front, so most people should not be affected. If you have your own AWKPATH setting, be sure to put "." in it somewhere. The documentation -- cgit v1.2.3 From 31c6051694d3152e50eb037e20c4734c7321eac6 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 16 Nov 2014 19:54:57 +0200 Subject: Add field reference changes. Currently breaks sortglos test. --- interpret.h | 24 ++++++++++++++++++++---- test/ChangeLog | 5 +++++ test/Makefile.am | 5 ++++- test/Makefile.in | 10 +++++++++- test/Maketests | 5 +++++ test/sortglos.awk | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ test/sortglos.in | 22 ++++++++++++++++++++++ test/sortglos.ok | 15 +++++++++++++++ 8 files changed, 131 insertions(+), 6 deletions(-) create mode 100755 test/sortglos.awk create mode 100755 test/sortglos.in create mode 100644 test/sortglos.ok diff --git a/interpret.h b/interpret.h index 74f56c73..83ccbfc5 100644 --- a/interpret.h +++ b/interpret.h @@ -340,7 +340,12 @@ uninitialized_scalar: lhs = r_get_field(t1, (Func_ptr *) 0, true); decr_sp(); DEREF(t1); - r = dupnode(*lhs); /* can't use UPREF here */ + /* only for $0, up ref count */ + if (*lhs == fields_arr[0]) { + r = *lhs; + UPREF(r); + } else + r = dupnode(*lhs); PUSH(r); break; @@ -649,11 +654,22 @@ mod: lhs = get_lhs(pc->memory, false); unref(*lhs); r = pc->initval; /* constant initializer */ - if (r == NULL) - *lhs = POP_SCALAR(); - else { + if (r != NULL) { UPREF(r); *lhs = r; + } else { + r = POP_SCALAR(); + + /* if was a field, turn it into a var */ + if ((r->flags & FIELD) == 0) { + *lhs = r; + } else if (r->valref == 1) { + r->flags &= ~FIELD; + *lhs = r; + } else { + *lhs = dupnode(r); + DEREF(r); + } } break; diff --git a/test/ChangeLog b/test/ChangeLog index e28ac2bb..633fef51 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-11-16 Arnold D. Robbins + + * Makefile.am (sortglos): New test. + * sortglos.awk, sortglos.in, sortglos.ok: New files. + 2014-11-09 Arnold D. Robbins * mbprintf4.awk: Add record and line number for debugging. diff --git a/test/Makefile.am b/test/Makefile.am index f8db2833..3c850125 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -831,6 +831,9 @@ EXTRA_DIST = \ sortfor.awk \ sortfor.in \ sortfor.ok \ + sortglos.awk \ + sortglos.in \ + sortglos.ok \ sortu.awk \ sortu.ok \ space.ok \ @@ -996,7 +999,7 @@ BASIC_TESTS = \ rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ - scalar sclforin sclifin sortempty splitargv splitarr splitdef \ + scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ diff --git a/test/Makefile.in b/test/Makefile.in index a337288b..69a4befe 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1077,6 +1077,9 @@ EXTRA_DIST = \ sortfor.awk \ sortfor.in \ sortfor.ok \ + sortglos.awk \ + sortglos.in \ + sortglos.ok \ sortu.awk \ sortu.ok \ space.ok \ @@ -1241,7 +1244,7 @@ BASIC_TESTS = \ rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ - scalar sclforin sclifin sortempty splitargv splitarr splitdef \ + scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ @@ -3195,6 +3198,11 @@ sortempty: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +sortglos: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + splitargv: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index f8d5e8a9..85c13d5d 100644 --- a/test/Maketests +++ b/test/Maketests @@ -777,6 +777,11 @@ sortempty: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +sortglos: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + splitargv: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/sortglos.awk b/test/sortglos.awk new file mode 100755 index 00000000..e4f910d7 --- /dev/null +++ b/test/sortglos.awk @@ -0,0 +1,51 @@ +BEGIN { + pr="y"; + npre=0; + po="n"; + npos=0; + } + +pr=="y" { npre++; pre[npre]=$0; } +$1=="@table" && $2=="@asis" { pr="n";nite++; next; } + +po=="y" { npos++; pos[npos]=$0; } +$1=="@end" && $2=="table" { + po="y"; + npos++; + pos[npos]=$0; + # last item... + vec[nite]=nlin; +} + + { nite++; } + +END { + for ( i=1; i<=npre; i++ ) { print pre[i]; } + if ( srt=="y" ) { + n=asorti(entr,ital); + ##print "n=",n; + for ( i=1; i<=n; i++ ) { + #printf("=========> %3.3d %s\n",i,ital[i]); + # ital[i] is the sorted key; + j=entr[ital[i]]; + # j is the original item number + for ( k=1; k<=vec[j]; k++ ) { + print dat[j,k]; + } + } + } + if ( srt=="n" ) { + for ( i=1; i<=nite; i++ ) { + printf("=========> %3.3d %2.2d %s\n",i,vec[i],titl[i]); + for ( j=1; j<=vec[i]; j++ ) { + print dat[i,j]; + } + } + print "========================= END"; + } + for ( i=1; i<=npos; i++ ) { print pos[i]; } + print "@c npre=" npre; + print "@c nite=" nite; + print "@c npos=" npos; +} + diff --git a/test/sortglos.in b/test/sortglos.in new file mode 100755 index 00000000..b24373de --- /dev/null +++ b/test/sortglos.in @@ -0,0 +1,22 @@ +@node Glossario +@unnumbered Glossario + +@table @asis +@item Azione +Una serie di istruzioni @command{awk} associate a una regola. Se +l'espressione di ricerca della regola individua un record in input, +@command{awk} esegue su quel record l'azione relativa. Le azioni sono +sempre racchiuse fra parentesi graffe. +(@xref{Panoramica sulle azioni}). + +@item Spazio bianco +Una sequenza di spazi, TAB, o caratteri di "a capo" presenti in un record in +input o in una stringa. +@end table + +@end ifclear + +@c The GNU General Public License. + +@c aggiornato alla versione: settembre 2014 +@c ultimo aggiornamento: 14 novembre 2014 diff --git a/test/sortglos.ok b/test/sortglos.ok new file mode 100644 index 00000000..69ddbe67 --- /dev/null +++ b/test/sortglos.ok @@ -0,0 +1,15 @@ +@node Glossario +@unnumbered Glossario + +@table @asis +@end table + +@end ifclear + +@c The GNU General Public License. + +@c aggiornato alla versione: settembre 2014 +@c ultimo aggiornamento: 14 novembre 2014 +@c npre=4 +@c nite=22 +@c npos=8 -- cgit v1.2.3 From 2bf2c2b86482c77a8ca3b88df8e2def62e65f903 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 4 Nov 2014 08:26:16 +0200 Subject: Start on copyedits. --- doc/gawktexi.in | 107 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 82 insertions(+), 25 deletions(-) diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 6a66f8c4..4bc971b8 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -378,10 +378,10 @@ ISBN 1-882114-28-0 @* @sp 9 @center @i{To my parents, for their love, and for the wonderful example they set for me.} @sp 1 -@center @i{To my wife Miriam, for making me complete. +@center @i{To my wife, Miriam, for making me complete. Thank you for building your life together with me.} @sp 1 -@center @i{To our children Chana, Rivka, Nachum and Malka, for enrichening our lives in innumerable ways.} +@center @i{To our children, Chana, Rivka, Nachum, and Malka, for enrichening our lives in innumerable ways.} @sp 1 @w{ } @page @@ -1070,7 +1070,7 @@ for enrichening our lives in innumerable ways. Author of mawk - March, 2001 + March 2001 @end docbook @@ -1082,21 +1082,23 @@ The circumstances started a couple of years earlier. I was working at a new job and noticed an unplugged Unix computer sitting in the corner. No one knew how to use it, and neither did I. However, -a couple of days later it was running, and +a couple of days later, it was running, and I was @code{root} and the one-and-only user. That day, I began the transition from statistician to Unix programmer. On one of many trips to the library or bookstore in search of -books on Unix, I found the gray AWK book, a.k.a.@: Aho, Kernighan and -Weinberger, @cite{The AWK Programming Language}, Addison-Wesley, -1988. AWK's simple programming paradigm---find a pattern in the +books on Unix, I found the gray AWK book, a.k.a.@: +Alfred V.@: Aho, Brian W.@: Kernighan, and +Peter J.@: Weinberger's @cite{The AWK Programming Language} (Addison-Wesley, +1988). @command{awk}'s simple programming paradigm---find a pattern in the input and then perform an action---often reduced complex or tedious data manipulations to a few lines of code. I was excited to try my hand at programming in AWK. Alas, the @command{awk} on my computer was a limited version of the -language described in the AWK book. I discovered that my computer -had ``old @command{awk}'' and the AWK book described ``new @command{awk}.'' +language described in the gray book. I discovered that my computer +had ``old @command{awk}'' and the book described +``new @command{awk}.'' I learned that this was typical; the old version refused to step aside or relinquish its name. If a system had a new @command{awk}, it was invariably called @command{nawk}, and few systems had it. @@ -1114,7 +1116,7 @@ My Unix system started out unplugged from the wall; it certainly was not plugged into a network. So, oblivious to the existence of @command{gawk} and the Unix community in general, and desiring a new @command{awk}, I wrote my own, called @command{mawk}. -Before I was finished I knew about @command{gawk}, +Before I was finished, I knew about @command{gawk}, but it was too late to stop, so I eventually posted to a @code{comp.sources} newsgroup. @@ -1123,7 +1125,7 @@ from Arnold introducing himself. He suggested we share design and algorithms and attached a draft of the POSIX standard so that I could update @command{mawk} to support language extensions added -after publication of the AWK book. +after publication of @cite{The AWK Programming Language}. Frankly, if our roles had been reversed, I would not have been so open and we probably would @@ -1203,7 +1205,7 @@ AWK or want to learn how, then read this book. @display Michael Brennan Author of @command{mawk} -March, 2001 +March 2001 @end display @end ifnotdocbook @@ -1221,7 +1223,7 @@ March, 2001 Author of mawk - October, 2014 + October 2014 @end docbook @@ -1255,7 +1257,7 @@ details, and as expected, many examples to help you learn the ins and outs. @display Michael Brennan Author of @command{mawk} -October, 2014 +October 2014 @end display @end ifnotdocbook @@ -1289,7 +1291,7 @@ The @command{awk} utility interprets a special-purpose programming language that makes it easy to handle simple data-reformatting jobs. The GNU implementation of @command{awk} is called @command{gawk}; if you -invoke it with the proper options or environment variables +invoke it with the proper options or environment variables, it is fully compatible with the POSIX@footnote{The 2008 POSIX standard is accessible online at @w{@url{http://www.opengroup.org/onlinepubs/9699919799/}.}} @@ -1396,7 +1398,7 @@ has been removed.} @unnumberedsec History of @command{awk} and @command{gawk} @cindex recipe for a programming language @cindex programming language, recipe for -@sidebar Recipe For A Programming Language +@sidebar Recipe for a Programming Language @multitable {2 parts} {1 part @code{egrep}} {1 part @code{snobol}} @item @tab 1 part @code{egrep} @tab 1 part @code{snobol} @@ -1415,7 +1417,7 @@ more parts C. Document very well and release. @cindex Kernighan, Brian @cindex @command{awk}, history of The name @command{awk} comes from the initials of its designers: Alfred V.@: -Aho, Peter J.@: Weinberger and Brian W.@: Kernighan. The original version of +Aho, Peter J.@: Weinberger, and Brian W.@: Kernighan. The original version of @command{awk} was written in 1977 at AT&T Bell Laboratories. In 1985, a new version made the programming language more powerful, introducing user-defined functions, multiple input @@ -1441,7 +1443,7 @@ Circa 1994, I became the primary maintainer. Current development focuses on bug fixes, performance improvements, standards compliance and, occasionally, new features. -In May of 1997, J@"urgen Kahrs felt the need for network access +In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding features to do this for @command{gawk}. At that time, he also wrote the bulk of @@ -1454,6 +1456,7 @@ John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as @command{gawk} @value{PVERSION} 4.0, in 2011. +@c FIXME: COPYEDIT @xref{Contributors}, for a full list of those who made important contributions to @command{gawk}. @@ -1464,7 +1467,7 @@ for a full list of those who made important contributions to @command{gawk}. The @command{awk} language has evolved over the years. Full details are provided in @ref{Language History}. The language described in this @value{DOCUMENT} -is often referred to as ``new @command{awk}''. +is often referred to as ``new @command{awk}.'' By analogy, the original version of @command{awk} is referred to as ``old @command{awk}.'' @@ -1543,12 +1546,15 @@ Most of the time, the examples use complete @command{awk} programs. Some of the more advanced sections show only the part of the @command{awk} program that illustrates the concept being described. -While this @value{DOCUMENT} is aimed principally at people who have not been +Although this @value{DOCUMENT} is aimed principally at people who have not been exposed to @command{awk}, there is a lot of information here that even the @command{awk} expert should find useful. In particular, the description of POSIX @command{awk} and the example programs in -@ref{Library Functions}, and in +@ref{Library Functions}, and +@ifnotdocbook +in +@end ifnotdocbook @ref{Sample Programs}, should be of interest. @@ -1556,22 +1562,32 @@ This @value{DOCUMENT} is split into several parts, as follows: @c FULLXREF ON -Part I describes the @command{awk} language and @command{gawk} program in detail. +@itemize @value{BULLET} +@item +@c FIXME: COPYEDIT +Part I +describes the @command{awk} language and @command{gawk} program in detail. It starts with the basics, and continues through all of the features of @command{awk}. It contains the following chapters: +@c nested +@itemize @value{MINUS} +@item @ref{Getting Started}, provides the essentials you need to know to begin using @command{awk}. +@item @ref{Invoking Gawk}, describes how to run @command{gawk}, the meaning of its command-line options, and how it finds @command{awk} program source files. +@item @ref{Regexp}, introduces regular expressions in general, and in particular the flavors supported by POSIX @command{awk} and @command{gawk}. +@item @ref{Reading Files}, describes how @command{awk} reads your data. It introduces the concepts of records and fields, as well @@ -1579,46 +1595,62 @@ as the @code{getline} command. I/O redirection is first described here. Network I/O is also briefly introduced here. +@item @ref{Printing}, describes how @command{awk} programs can produce output with @code{print} and @code{printf}. +@item @ref{Expressions}, describes expressions, which are the basic building blocks for getting most things done in a program. +@item @ref{Patterns and Actions}, describes how to write patterns for matching records, actions for doing something when a record is matched, and the predefined variables @command{awk} and @command{gawk} use. +@item @ref{Arrays}, covers @command{awk}'s one-and-only data structure: associative arrays. Deleting array elements and whole arrays is also described, as well as sorting arrays in @command{gawk}. It also describes how @command{gawk} provides arrays of arrays. +@item @ref{Functions}, describes the built-in functions @command{awk} and @command{gawk} provide, as well as how to define your own functions. It also discusses how @command{gawk} lets you call functions indirectly. +@end itemize +@item +@c FIXME: COPYEDIT Part II shows how to use @command{awk} and @command{gawk} for problem solving. There is lots of code here for you to read and learn from. It contains the following chapters: +@itemize @value{MINUS} +@item @ref{Library Functions}, which provides a number of functions meant to be used from main @command{awk} programs. +@item @ref{Sample Programs}, which provides many sample @command{awk} programs. +@end itemize Reading these two chapters allows you to see @command{awk} solving real problems. +@item +@c FIXME: COPYEDIT Part III focuses on features specific to @command{gawk}. It contains the following chapters: +@itemize @value{MINUS} +@item @ref{Advanced Features}, describes a number of advanced features. Of particular note @@ -1627,33 +1659,43 @@ have two-way communications with another process, perform TCP/IP networking, and profile your @command{awk} programs. +@item @ref{Internationalization}, describes special features for translating program messages into different languages at runtime. +@item @ref{Debugger}, describes the @command{gawk} debugger. +@item @ref{Arbitrary Precision Arithmetic}, describes advanced arithmetic facilities. +@item @ref{Dynamic Extensions}, describes how to add new variables and functions to @command{gawk} by writing extensions in C or C++. +@end itemize +@item @ifclear FOR_PRINT Part IV provides the appendices, the Glossary, and two licenses that cover the @command{gawk} source code and this @value{DOCUMENT}, respectively. It contains the following appendices: @end ifclear @ifset FOR_PRINT +@c FIXME: COPYEDIT Part IV provides the following appendices, including the GNU General Public License: @end ifset +@itemize @value{MINUS} +@item @ref{Language History}, describes how the @command{awk} language has evolved since its first release to present. It also describes how @command{gawk} has acquired features over time. +@item @ref{Installation}, describes how to get @command{gawk}, how to compile it on POSIX-compatible systems, @@ -1661,17 +1703,22 @@ and how to compile and use it on different non-POSIX systems. It also describes how to report bugs in @command{gawk} and where to get other freely available @command{awk} implementations. +@end itemize @ifset FOR_PRINT - +@itemize @value{MINUS} +@item @ref{Copying}, presents the license that covers the @command{gawk} source code. +@end itemize The version of this @value{DOCUMENT} distributed with @command{gawk} contains additional appendices and other end material. To save space, we have omitted them from the printed edition. You may find them online, as follows: +@itemize @value{BULLET} +@item @uref{http://www.gnu.org/software/gawk/manual/html_node/Notes.html, The appendix on implementation notes} describes how to disable @command{gawk}'s extensions, how to contribute @@ -1679,44 +1726,54 @@ new code to @command{gawk}, where to find information on some possible future directions for @command{gawk} development, and the design decisions behind the extension API. +@item @uref{http://www.gnu.org/software/gawk/manual/html_node/Basic-Concepts.html, The appendix on basic concepts} provides some very cursory background material for those who are completely unfamiliar with computer programming. +@item @uref{http://www.gnu.org/software/gawk/manual/html_node/Glossary.html, The Glossary} -defines most, if not all, the significant terms used +defines most, if not all of, the significant terms used throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. +@item @uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html, The GNU FDL} is the license that covers this @value{DOCUMENT}. +@end itemize Some of the chapters have exercise sections; these have also been omitted from the print edition but are available online. @end ifset @ifclear FOR_PRINT +@itemize @value{MINUS} +@item @ref{Notes}, describes how to disable @command{gawk}'s extensions, as well as how to contribute new code to @command{gawk}, and some possible future directions for @command{gawk} development. +@item @ref{Basic Concepts}, provides some very cursory background material for those who are completely unfamiliar with computer programming. -The @ref{Glossary}, defines most, if not all, the significant terms used +The @ref{Glossary}, defines most, if not all of, the significant terms used throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. +@item @ref{Copying}, and @ref{GNU Free Documentation License}, present the licenses that cover the @command{gawk} source code and this @value{DOCUMENT}, respectively. +@end itemize @end ifclear +@end itemize @c FULLXREF OFF -- cgit v1.2.3 From afabab5ec7a8d8500576a3bf39321cb5ca566661 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 4 Nov 2014 08:26:46 +0200 Subject: Add NOTES. --- NOTES | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 NOTES diff --git a/NOTES b/NOTES new file mode 100644 index 00000000..9fb5f5dc --- /dev/null +++ b/NOTES @@ -0,0 +1,9 @@ +Page 18. OK to move the sidebar although having it at the opening +is sort of like the opening quotes I have in other places; it's meant +to be humorous. + +Page 10 - references to 'Chapter 10' and 'Chapter 11' have been left +alone since they are links and I can't do it that way in texinfo anyway. + +Appendices vs. Appendixes - I have left it as the former; the latter +looks totally wrong to me. -- cgit v1.2.3 From 0c9e840515309d37257da568d6b01dad72aa7ebc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 5 Nov 2014 06:23:04 +0200 Subject: Copyedits. --- doc/gawktexi.in | 78 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 4bc971b8..589ede77 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -51,7 +51,7 @@ @set PATCHLEVEL 2 @ifset FOR_PRINT -@set TITLE Effective AWK Programming +@set TITLE Effective Awk Programming @end ifset @ifclear FOR_PRINT @set TITLE GAWK: Effective AWK Programming @@ -170,12 +170,18 @@ @macro DBREF{text} @ref{\text\} @end macro +@macro DBXREF{text} +@xref{\text\} +@end macro @end ifdocbook @ifnotdocbook @macro DBREF{text} @ref{\text\}, @end macro +@macro DBXREF{text} +@xref{\text\}, +@end macro @end ifnotdocbook @ifclear FOR_PRINT @@ -1144,7 +1150,7 @@ standard. On the other hand, the novice AWK programmer can study a wealth of practical programs that emphasize the power of AWK's basic idioms: -data driven control-flow, pattern matching with regular expressions, +data-driven control flow, pattern matching with regular expressions, and associative arrays. Those looking for something new can try out @command{gawk}'s interface to network protocols via special @file{/inet} files. @@ -1277,9 +1283,9 @@ October 2014 Arnold Robbins Nof Ayalon - ISRAEL + Israel - December, 2014 + December 2014 @end docbook @@ -1456,8 +1462,7 @@ John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as @command{gawk} @value{PVERSION} 4.0, in 2011. -@c FIXME: COPYEDIT -@xref{Contributors}, +@DBXREF{Contributors} for a full list of those who made important contributions to @command{gawk}. @node Names @@ -1564,9 +1569,7 @@ This @value{DOCUMENT} is split into several parts, as follows: @itemize @value{BULLET} @item -@c FIXME: COPYEDIT -Part I -describes the @command{awk} language and @command{gawk} program in detail. +Part I describes the @command{awk} language and @command{gawk} program in detail. It starts with the basics, and continues through all of the features of @command{awk}. It contains the following chapters: @@ -1626,11 +1629,11 @@ as well as how to define your own functions. It also discusses how @end itemize @item -@c FIXME: COPYEDIT Part II shows how to use @command{awk} and @command{gawk} for problem solving. There is lots of code here for you to read and learn from. It contains the following chapters: +@c nested @itemize @value{MINUS} @item @ref{Library Functions}, which provides a number of functions meant to @@ -1645,10 +1648,10 @@ Reading these two chapters allows you to see @command{awk} solving real problems. @item -@c FIXME: COPYEDIT Part III focuses on features specific to @command{gawk}. It contains the following chapters: +@c nested @itemize @value{MINUS} @item @ref{Advanced Features}, @@ -1683,7 +1686,6 @@ the @command{gawk} source code and this @value{DOCUMENT}, respectively. It contains the following appendices: @end ifclear @ifset FOR_PRINT -@c FIXME: COPYEDIT Part IV provides the following appendices, including the GNU General Public License: @end ifset @@ -1836,7 +1838,7 @@ pressing the @kbd{d} key and finally releasing both keys. For the sake of brevity, throughout this @value{DOCUMENT}, we refer to Brian Kernighan's version of @command{awk} as ``BWK @command{awk}.'' -(@xref{Other Versions}, for information on his and other versions.) +(@DBXREF{Other Versions} for information on his and other versions.) @ifset FOR_PRINT @quotation NOTE @@ -1852,7 +1854,7 @@ Cautionary or warning notes look like this. @unnumberedsubsec Dark Corners @cindex Kernighan, Brian @quotation -@i{Dark corners are basically fractal --- no matter how much +@i{Dark corners are basically fractal---no matter how much you illuminate, there's always a smaller but darker one.} @author Brian Kernighan @end quotation @@ -1922,7 +1924,7 @@ The GPL applies to the C language source code for @command{gawk}. To find out more about the FSF and the GNU Project online, see @uref{http://www.gnu.org, the GNU Project's home page}. This @value{DOCUMENT} may also be read from -@uref{http://www.gnu.org/software/gawk/manual/, their web site}. +@uref{http://www.gnu.org/software/gawk/manual/, GNU's website}. @ifclear FOR_PRINT A shell, an editor (Emacs), highly portable optimizing C, C++, and @@ -1959,10 +1961,10 @@ License in @ref{GNU Free Documentation License}.) @cindex Close, Diane The @value{DOCUMENT} itself has gone through multiple previous editions. Paul Rubin wrote the very first draft of @cite{The GAWK Manual}; -it was around 40 pages in size. +it was around 40 pages long. Diane Close and Richard Stallman improved it, yielding a version that was -around 90 pages long and barely described the original, ``old'' +around 90 pages and barely described the original, ``old'' version of @command{awk}. I started working with that version in the fall of 1988. @@ -1995,17 +1997,17 @@ and the major new additions are @ref{Arbitrary Precision Arithmetic}, and @ref{Dynamic Extensions}. This @value{DOCUMENT} will undoubtedly continue to evolve. If you -find an error in this @value{DOCUMENT}, please report it! @xref{Bugs}, +find an error in this @value{DOCUMENT}, please report it! @DBXREF{Bugs} for information on submitting problem reports electronically. @ifset FOR_PRINT @c fakenode --- for prepinfo @unnumberedsec How to Stay Current -It may be you have a version of @command{gawk} which is newer than the +You may have a newer version of @command{gawk} than the one described here. To find out what has changed, you should first look at the @file{NEWS} file in the @command{gawk} -distribution, which provides a high level summary of what changed in +distribution, which provides a high-level summary of what changed in each release. You can then look at the @uref{http://www.gnu.org/software/gawk/manual/, @@ -2183,7 +2185,7 @@ portable program it is today. It has been and continues to be a pleasure working with this team of fine people. Notable code and documentation contributions were made by -a number of people. @xref{Contributors}, for the full list. +a number of people. @DBXREF{Contributors} for the full list. @ifset FOR_PRINT @cindex Oram, Andy @@ -2202,7 +2204,7 @@ the Texinfo markup language sane. @cindex Kernighan, Brian @cindex Brennan, Michael @cindex Day, Robert P.J.@: -Robert P.J.@: Day, Michael Brennan and Brian Kernighan kindly acted as +Robert P.J.@: Day, Michael Brennan, and Brian Kernighan kindly acted as reviewers for the 2015 edition of this @value{DOCUMENT}. Their feedback helped improve the final work. @@ -2214,7 +2216,7 @@ or its documentation without his help. Brian is in a class by himself as a programmer and technical author. I have to thank him (yet again) for his ongoing friendship -and the role model he has been for me for close to 30 years! +and for being a role model to me for close to 30 years! Having him as a reviewer is an exciting privilege. It has also been extremely humbling@enddots{} @@ -2235,8 +2237,8 @@ take advantage of those opportunities. @noindent Arnold Robbins @* Nof Ayalon @* -ISRAEL @* -December, 2014 +Israel @* +December 2014 @end iftex @ifnotinfo @@ -2253,31 +2255,31 @@ following chapters: @itemize @value{BULLET} @item -@ref{Getting Started}. +@ref{Getting Started} @item -@ref{Invoking Gawk}. +@ref{Invoking Gawk} @item -@ref{Regexp}. +@ref{Regexp} @item -@ref{Reading Files}. +@ref{Reading Files} @item -@ref{Printing}. +@ref{Printing} @item -@ref{Expressions}. +@ref{Expressions} @item -@ref{Patterns and Actions}. +@ref{Patterns and Actions} @item -@ref{Arrays}. +@ref{Arrays} @item -@ref{Functions}. +@ref{Functions} @end itemize @end ifdocbook @@ -2292,17 +2294,17 @@ following chapters: The basic function of @command{awk} is to search files for lines (or other units of text) that contain certain patterns. When a line matches one of the patterns, @command{awk} performs specified actions on that line. -@command{awk} keeps processing input lines in this way until it reaches +@command{awk} continues to process input lines in this way until it reaches the end of the input files. @cindex @command{awk}, uses for @cindex programming languages@comma{} data-driven vs.@: procedural @cindex @command{awk} programs Programs in @command{awk} are different from programs in most other languages, -because @command{awk} programs are @dfn{data-driven}; that is, you describe -the data you want to work with and then what to do when you find it. +because @command{awk} programs are @dfn{data driven} (i.e., you describe +the data you want to work with and then what to do when you find it). Most other languages are @dfn{procedural}; you have to describe, in great -detail, every step the program is to take. When working with procedural +detail, every step the program should take. When working with procedural languages, it is usually much harder to clearly describe the data your program will process. For this reason, @command{awk} programs are often refreshingly easy to -- cgit v1.2.3 From 757eacd6cf522e56df34372ca7e6968817947cbb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 5 Nov 2014 22:39:54 +0200 Subject: Copy edits. --- doc/gawktexi.in | 185 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 92 insertions(+), 93 deletions(-) diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 589ede77..dfb52d75 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -2314,9 +2314,9 @@ read and write. @cindex rule, definition of When you run @command{awk}, you specify an @command{awk} @dfn{program} that tells @command{awk} what to do. The program consists of a series of -@dfn{rules}. (It may also contain @dfn{function definitions}, -an advanced feature that we will ignore for now. -@xref{User-defined}.) Each rule specifies one +@dfn{rules} (it may also contain @dfn{function definitions}, +an advanced feature that we will ignore for now; +@pxref{User-defined}). Each rule specifies one pattern to search for and one action to perform upon finding the pattern. @@ -2416,10 +2416,11 @@ programs from shell scripts, because it avoids the need for a separate file for the @command{awk} program. A self-contained shell script is more reliable because there are no other files to misplace. +Later in this chapter, +@ifdocbook +the section +@end ifdocbook @ref{Very Simple}, -@ifnotinfo -later in this @value{CHAPTER}, -@end ifnotinfo presents several short, self-contained programs. @@ -2478,7 +2479,7 @@ startup file. This next simple @command{awk} program emulates the @command{cat} utility; it copies whatever you type on the -keyboard to its standard output (why this works is explained shortly). +keyboard to its standard output (why this works is explained shortly): @example $ @kbd{awk '@{ print @}'} @@ -2563,7 +2564,7 @@ affect the execution of the @command{awk} program but it does make Once you have learned @command{awk}, you may want to write self-contained @command{awk} scripts, using the @samp{#!} script mechanism. You can do this on many systems.@footnote{The @samp{#!} mechanism works on -GNU/Linux systems, BSD-based systems and commercial Unix systems.} +GNU/Linux systems, BSD-based systems, and commercial Unix systems.} For example, you could update the file @file{advice} to look like this: @example @@ -2648,14 +2649,14 @@ can explain what the program does and how it works. Nearly all programming languages have provisions for comments, as programs are typically hard to understand without them. -In the @command{awk} language, a comment starts with the sharp sign +In the @command{awk} language, a comment starts with the number sign character (@samp{#}) and continues to the end of the line. The @samp{#} does not have to be the first character on the line. The -@command{awk} language ignores the rest of a line following a sharp sign. +@command{awk} language ignores the rest of a line following a number sign. For example, we could have put the following into @file{advice}: @example -# This program prints a nice friendly message. It helps +# This program prints a nice, friendly message. It helps # keep novice users from being afraid of the computer. BEGIN @{ print "Don't Panic!" @} @end example @@ -2671,7 +2672,8 @@ when reading it at a later time. @quotation CAUTION As mentioned in @ref{One-shot}, -you can enclose small to medium programs in single quotes, in order to keep +you can enclose short to medium-sized programs in single quotes, +in order to keep your shell scripts self-contained. When doing so, @emph{don't} put an apostrophe (i.e., a single quote) into a comment (or anywhere else in your program). The shell interprets the quote as the closing @@ -2700,7 +2702,7 @@ $ @kbd{awk '@{ print "hello" @} # let's be cute'} @cindex @code{\} (backslash) @cindex backslash (@code{\}) Putting a backslash before the single quote in @samp{let's} wouldn't help, -since backslashes are not special inside single quotes. +because backslashes are not special inside single quotes. The next @value{SUBSECTION} describes the shell's quoting rules. @end quotation @@ -2712,7 +2714,7 @@ The next @value{SUBSECTION} describes the shell's quoting rules. * DOS Quoting:: Quoting in Windows Batch Files. @end menu -For short to medium length @command{awk} programs, it is most convenient +For short to medium-length @command{awk} programs, it is most convenient to enter the program on the @command{awk} command line. This is best done by enclosing the entire program in single quotes. This is true whether you are entering the program interactively at @@ -2736,8 +2738,8 @@ or empty, string. The null string is character data that has no value. In other words, it is empty. It is written in @command{awk} programs like this: @code{""}. In the shell, it can be written using single -or double quotes: @code{""} or @code{''}. While the null string has -no characters in it, it does exist. Consider this command: +or double quotes: @code{""} or @code{''}. Although the null string has +no characters in it, it does exist. For example, consider this command: @example $ @kbd{echo ""} @@ -2747,8 +2749,7 @@ $ @kbd{echo ""} Here, the @command{echo} utility receives a single argument, even though that argument has no characters in it. In the rest of this @value{DOCUMENT}, we use the terms @dfn{null string} and @dfn{empty string} -interchangeably. Now, on to the quoting rules. - +interchangeably. Now, on to the quoting rules: @itemize @value{BULLET} @item @@ -2771,7 +2772,7 @@ The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is @emph{impossible} to embed a single quote inside single-quoted text. Refer back to -@ref{Comments}, +@DBREF{Comments} for an example of what happens if you try. @item @@ -2781,7 +2782,7 @@ Double quotes protect most things between the opening and closing quotes. The shell does at least variable and command substitution on the quoted text. Different shells may do additional kinds of processing on double-quoted text. -Since certain characters within double-quoted text are processed by the shell, +Because certain characters within double-quoted text are processed by the shell, they must be @dfn{escaped} within the text. Of note are the characters @samp{$}, @samp{`}, @samp{\}, and @samp{"}, all of which must be preceded by a backslash within double-quoted text if they are to be passed on literally @@ -2843,7 +2844,7 @@ $ @kbd{awk 'BEGIN @{ print "Here is a single quote <'"'"'>" @}'} @noindent This program consists of three concatenated quoted strings. The first and the -third are single-quoted, the second is double-quoted. +third are single quoted, the second is double quoted. This can be ``simplified'' to: @@ -2959,7 +2960,7 @@ information about monthly shipments. In both files, each line is considered to be one @dfn{record}. In @file{mail-list}, each record contains the name of a person, -his/her phone number, his/her email-address, and a code for their relationship +his/her phone number, his/her email address, and a code for his/her relationship with the author of the list. The columns are aligned using spaces. An @samp{A} in the last column @@ -3080,8 +3081,8 @@ empty action that does nothing (i.e., no lines are printed). Many practical @command{awk} programs are just a line or two. Following is a collection of useful, short programs to get you started. Some of these programs contain constructs that haven't been covered yet. (The description -of the program will give you a good idea of what is going on, but please -read the rest of the @value{DOCUMENT} to become an @command{awk} expert!) +of the program will give you a good idea of what is going on, but you'll +need to read the rest of the @value{DOCUMENT} to become an @command{awk} expert!) Most of the examples use a @value{DF} named @file{data}. This is just a placeholder; if you use these programs yourself, substitute your own @value{FN}s for @file{data}. @@ -3122,7 +3123,7 @@ expand data | awk '@{ if (x < length($0)) x = length($0) @} @end example This example differs slightly from the previous one: -The input is processed by the @command{expand} utility to change TABs +the input is processed by the @command{expand} utility to change TABs into spaces, so the widths compared are actually the right-margin columns, as opposed to the number of input characters on each line. @@ -3376,7 +3377,7 @@ lines in the middle of a regular expression or a string. with the C shell.} It works for @command{awk} programs in files and for one-shot programs, @emph{provided} you are using a POSIX-compliant shell, such as the Unix Bourne shell or Bash. But the C shell behaves -differently! There, you must use two backslashes in a row, followed by +differently! There you must use two backslashes in a row, followed by a newline. Note also that when using the C shell, @emph{every} newline in your @command{awk} program must be escaped with a backslash. To illustrate: @@ -3469,7 +3470,7 @@ and array sorting. As we develop our presentation of the @command{awk} language, we introduce most of the variables and many of the functions. They are described -systematically in @ref{Built-in Variables}, and in +systematically in @DBREF{Built-in Variables} and in @ref{Built-in}. @node When @@ -3503,8 +3504,8 @@ eight-bit microprocessors, @end ifset and a microcode assembler for a special-purpose Prolog computer. -While the original @command{awk}'s capabilities were strained by tasks -of such complexity, modern versions are more capable. +The original @command{awk}'s capabilities were strained by tasks +of such complexity, but modern versions are more capable. @cindex @command{awk} programs, complex If you find yourself writing @command{awk} scripts of more than, say, @@ -3559,7 +3560,7 @@ a comma, open brace, question mark, colon, This @value{CHAPTER} covers how to run @command{awk}, both POSIX-standard and @command{gawk}-specific command-line options, and what @command{awk} and -@command{gawk} do with non-option arguments. +@command{gawk} do with nonoption arguments. It then proceeds to cover how @command{gawk} searches for source files, reading standard input along with other files, @command{gawk}'s environment variables, @command{gawk}'s exit status, using include files, @@ -3603,7 +3604,7 @@ enclosed in [@dots{}] in these templates are optional: @cindex GNU long options @cindex long options @cindex options, long -Besides traditional one-letter POSIX-style options, @command{gawk} also +In addition to traditional one-letter POSIX-style options, @command{gawk} also supports GNU long options. @cindex dark corner, invoking @command{awk} @@ -3666,7 +3667,7 @@ Set the @code{FS} variable to @var{fs} @cindex @option{--file} option @cindex @command{awk} programs, location of Read @command{awk} program source from @var{source-file} -instead of in the first non-option argument. +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 each specified @var{source-file}. @@ -3926,7 +3927,7 @@ care to search for all occurrences of each inappropriate construct. As @itemx @option{--bignum} @cindex @option{-M} option @cindex @option{--bignum} option -Force arbitrary precision arithmetic on numbers. This option has no effect +Force arbitrary-precision arithmetic on numbers. This option has no effect if @command{gawk} is not compiled to use the GNU MPFR and MP libraries (@pxref{Arbitrary Precision Arithmetic}). @@ -3942,10 +3943,8 @@ values in input data (@pxref{Nondecimal Data}). @quotation CAUTION -This option can severely break old programs. -Use with care. - -This option may disappear in a future version of @command{gawk}. +This option can severely break old programs. Use with care. Also note +that this option may disappear in a future version of @command{gawk}. @end quotation @item @option{-N} @@ -3979,7 +3978,7 @@ pretty-print the program and not run it. @cindex @option{--optimize} option @cindex @option{-O} option Enable some optimizations on the internal representation of the program. -At the moment this includes just simple constant folding. +At the moment, this includes just simple constant folding. @item @option{-p}[@var{file}] @itemx @option{--profile}[@code{=}@var{file}] @@ -4056,8 +4055,8 @@ Allow interval expressions (@pxref{Regexp Operators}) in regexps. This is now @command{gawk}'s default behavior. -Nevertheless, this option remains both for backward compatibility, -and for use in combination with @option{--traditional}. +Nevertheless, this option remains (both for backward compatibility +and for use in combination with @option{--traditional}). @item @option{-S} @itemx @option{--sandbox} @@ -4110,7 +4109,7 @@ If it is, @command{awk} reads its program source from all of the named files, as if they had been concatenated together into one big file. This is useful for creating libraries of @command{awk} functions. These functions can be written once and then retrieved from a standard place, instead -of having to be included into each individual program. +of having to be included in each individual program. The @option{-i} option is similar in this regard. (As mentioned in @ref{Definition Syntax}, @@ -4121,7 +4120,7 @@ if the program is entered at the keyboard, by specifying @samp{-f /dev/tty}. After typing your program, type @kbd{Ctrl-d} (the end-of-file character) to terminate it. (You may also use @samp{-f -} to read program source from the standard -input but then you will not be able to also use the standard input as a +input, but then you will not be able to also use the standard input as a source of data.) Because it is clumsy using the standard @command{awk} mechanisms to mix @@ -4134,7 +4133,7 @@ options may also be used multiple times on the command line. @cindex @option{-e} option If no @option{-f} or @option{-e} option is specified, then @command{gawk} -uses the first non-option command-line argument as the text of the +uses the first nonoption command-line argument as the text of the program source code. @cindex @env{POSIXLY_CORRECT} environment variable @@ -4201,7 +4200,7 @@ All the command-line arguments are made available to your @command{awk} program and the program text (if present) are omitted from @code{ARGV}. All other arguments, including variable assignments, are included. As each element of @code{ARGV} is processed, @command{gawk} -sets the variable @code{ARGIND} to the index in @code{ARGV} of the +sets @code{ARGIND} to the index in @code{ARGV} of the current element. @c FIXME: One day, move the ARGC and ARGV node closer to here. @@ -4378,7 +4377,7 @@ value of @env{AWKPATH}. @code{ENVIRON["AWKPATH"]}. This provides access to the actual search path value from within an @command{awk} program. -While you can change @code{ENVIRON["AWKPATH"]} within your @command{awk} +Although you can change @code{ENVIRON["AWKPATH"]} within your @command{awk} program, this has no effect on the running program's behavior. This makes sense: the @env{AWKPATH} environment variable is used to find the program source files. Once your program is running, all the files have been @@ -4414,7 +4413,7 @@ path value from within an @command{awk} program. A number of other environment variables affect @command{gawk}'s behavior, but they are more specialized. Those in the following -list are meant to be used by regular users. +list are meant to be used by regular users: @table @env @item GAWK_MSEC_SLEEP @@ -4434,7 +4433,7 @@ retry a two-way TCP/IP (socket) connection before giving up. @xref{TCP/IP Networking}. @item POSIXLY_CORRECT -Causes @command{gawk} to switch to POSIX compatibility +Causes @command{gawk} to switch to POSIX-compatibility mode, disabling all traditional and GNU extensions. @xref{Options}. @end table @@ -4466,11 +4465,11 @@ for debugging problems on filesystems on non-POSIX operating systems where I/O is performed in records, not in blocks. @item GAWK_MSG_SRC -If this variable exists, @command{gawk} includes the file -name and line number within the @command{gawk} source code +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, since there are multiple places which produce the +message, as there are multiple places which produce the same warning or error message. @item GAWK_NO_DFA @@ -4482,8 +4481,8 @@ supposed to be differences, but occasionally theory and practice don't coordinate with each other.) @item GAWK_NO_PP_RUN -If this variable exists, then when invoked with the @option{--pretty-print} -option, @command{gawk} skips running the program. +When @command{gawk} is invoked with the @option{--pretty-print} option, +it will not run the program if this environment variable exists. @quotation CAUTION This variable will not survive into the next major release. @@ -4522,11 +4521,11 @@ If an error occurs, @command{gawk} exits with the value of the C constant @code{EXIT_FAILURE}. This is usually one. If @command{gawk} exits because of a fatal error, the exit -status is 2. On non-POSIX systems, this value may be mapped +status is two. On non-POSIX systems, this value may be mapped to @code{EXIT_FAILURE}. @node Include Files -@section Including Other Files Into Your Program +@section Including Other Files into Your Program @c Panos Papadopoulos contributed the original @c text for this section. @@ -4575,9 +4574,9 @@ $ @kbd{gawk -f test2} @print{} This is script test2. @end example -@code{gawk} runs the @file{test2} script which includes @file{test1} +@code{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 +keyword. So, to include external @command{awk} source files, you just use @code{@@include} followed by the name of the file to be included, enclosed in double quotes. @@ -4614,26 +4613,26 @@ The @value{FN} can, of course, be a pathname. For example: @end example @noindent -or: +and: @example @@include "/usr/awklib/network" @end example @noindent -are valid. The @env{AWKPATH} environment variable can be of great +are both valid. The @env{AWKPATH} environment variable can be of great value when using @code{@@include}. The same rules for the use of the @env{AWKPATH} variable in command-line file searches (@pxref{AWKPATH Variable}) apply to @code{@@include} also. This is very helpful in constructing @command{gawk} function libraries. -If you have a large script with useful, general purpose @command{awk} +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} environment variable accordingly and then using @code{@@include} with -just the file part of the full pathname. Of course you can have more +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 environment is, the more directories you may need to organize the files to be included. @@ -4651,7 +4650,7 @@ searched first for source files, before searching in @env{AWKPATH}, and this also applies to files named with @code{@@include}. @node Loading Shared Libraries -@section Loading Dynamic Extensions Into Your Program +@section Loading Dynamic Extensions into Your Program This @value{SECTION} describes a feature that is specific to @command{gawk}. @@ -4669,7 +4668,7 @@ to using the @option{-l} command-line option. If the extension is not initially found in @env{AWKLIBPATH}, another search is conducted after appending the platform's default shared library suffix to the @value{FN}. For example, on GNU/Linux systems, the suffix -@samp{.so} is used. +@samp{.so} is used: @example $ @kbd{gawk '@@load "ordchr"; BEGIN @{print chr(65)@}'} @@ -4804,13 +4803,13 @@ The three standard options for all versions of @command{awk} are and many others, as well as corresponding GNU-style long options. @item -Non-option command-line arguments are usually treated as @value{FN}s, +Nonoption command-line arguments are usually treated as @value{FN}s, unless they have the form @samp{@var{var}=@var{value}}, in which case they are taken as variable assignments to be performed at that point in processing the input. @item -All non-option command-line arguments, excluding the program text, +All nonoption command-line arguments, excluding the program text, are placed in the @code{ARGV} array. Adjusting @code{ARGC} and @code{ARGV} affects how @command{awk} processes input. @@ -4859,7 +4858,7 @@ belongs to that set. The simplest regular expression is a sequence of letters, numbers, or both. Such a regexp matches any string that contains that sequence. Thus, the regexp @samp{foo} matches any string containing @samp{foo}. -Therefore, the pattern @code{/foo/} matches any input record containing +Thus, the pattern @code{/foo/} matches any input record containing the three adjacent characters @samp{foo} @emph{anywhere} in the record. Other kinds of regexps let you specify more complicated classes of strings. @@ -4922,17 +4921,16 @@ and @samp{!~} perform regular expression comparisons. Expressions using these operators can be used as patterns, or in @code{if}, @code{while}, @code{for}, and @code{do} statements. (@xref{Statements}.) -For example: +For example, the following is true if the expression @var{exp} (taken +as a string) matches @var{regexp}: @example @var{exp} ~ /@var{regexp}/ @end example @noindent -is true if the expression @var{exp} (taken as a string) -matches @var{regexp}. The following example matches, or selects, -all input records with the uppercase letter @samp{J} somewhere in the -first field: +This example matches, or selects, all input records with the uppercase +letter @samp{J} somewhere in the first field: @example $ @kbd{awk '$1 ~ /J/' inventory-shipped} @@ -5002,9 +5000,9 @@ string or regexp. Thus, the string whose contents are the two characters @samp{"} and @samp{\} must be written @code{"\"\\"}. Other escape sequences represent unprintable characters -such as TAB or newline. While there is nothing to stop you from entering most +such as TAB or newline. There is nothing to stop you from entering most unprintable characters directly in a string constant or regexp constant, -they may look ugly. +but they may look ugly. The following list presents all the escape sequences used in @command{awk} and @@ -5089,7 +5087,7 @@ A literal slash (necessary for regexp constants only). This sequence is used when you want to write a regexp constant that contains a slash (such as @code{/.*:\/home\/[[:alnum:]]+:.*/}; the @samp{[[:alnum:]]} -notation is discussed shortly, in @ref{Bracket Expressions}). +notation is discussed in @ref{Bracket Expressions}). Because the regexp is delimited by slashes, you need to escape any slash that is part of the pattern, in order to tell @command{awk} to keep processing the rest of the regexp. @@ -5112,7 +5110,7 @@ with a backslash have special meaning in regexps. In a regexp, a backslash before any character that is not in the previous list and not listed in -@ref{GNU Regexp Operators}, +@DBREF{GNU Regexp Operators} means that the next character should be taken literally, even if it would normally be a regexp operator. For example, @code{/a\+b/} matches the three characters @samp{a+b}. @@ -5123,25 +5121,7 @@ characters @samp{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. -To summarize: - -@itemize @value{BULLET} -@item -The escape sequences in the list above are always processed first, -for both string constants and regexp constants. This happens very early, -as soon as @command{awk} reads your program. - -@item -@command{gawk} processes both regexp constants and dynamic regexps -(@pxref{Computed Regexps}), -for the special operators listed in -@ref{GNU Regexp Operators}. - -@item -A backslash before any other character means to treat that character -literally. -@end itemize - +@c 11/2014: Moved so as to not stack sidebars @sidebar Backslash Before Regular Characters @cindex portability, backslash in escape sequences @cindex POSIX @command{awk}, backslashes in string constants @@ -5177,6 +5157,25 @@ In such implementations, typing @code{"a\qc"} is the same as typing @end table @end sidebar +To summarize: + +@itemize @value{BULLET} +@item +The escape sequences in the preceding list are always processed first, +for both string constants and regexp constants. This happens very early, +as soon as @command{awk} reads your program. + +@item +@command{gawk} processes both regexp constants and dynamic regexps +(@pxref{Computed Regexps}), +for the special operators listed in +@ref{GNU Regexp Operators}. + +@item +A backslash before any other character means to treat that character +literally. +@end itemize + @sidebar Escape Sequences for Metacharacters @cindex metacharacters, escape sequences for -- cgit v1.2.3 From 6e6d960b0964b43f3c94e19872537f7fd4603f59 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 6 Nov 2014 06:19:45 +0200 Subject: Copyedits. Through page 72 or so in ORA MS. --- doc/gawktexi.in | 214 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 111 insertions(+), 103 deletions(-) diff --git a/doc/gawktexi.in b/doc/gawktexi.in index dfb52d75..971faae4 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -173,6 +173,9 @@ @macro DBXREF{text} @xref{\text\} @end macro +@macro DBPXREF{text} +@pxref{\text\} +@end macro @end ifdocbook @ifnotdocbook @@ -182,6 +185,9 @@ @macro DBXREF{text} @xref{\text\}, @end macro +@macro DBPXREF{text} +@pxref{\text\}, +@end macro @end ifnotdocbook @ifclear FOR_PRINT @@ -5223,7 +5229,7 @@ sequences and that are not listed in the following stand for themselves: @cindex backslash (@code{\}), regexp operator @cindex @code{\} (backslash), regexp operator @item @code{\} -This is used to suppress the special meaning of a character when +This suppresses the special meaning of a character when matching. For example, @samp{\$} matches the character @samp{$}. @@ -5232,8 +5238,9 @@ matches the character @samp{$}. @cindex @code{^} (caret), regexp operator @cindex caret (@code{^}), regexp operator @item @code{^} -This matches the beginning of a string. For example, @samp{^@@chapter} -matches @samp{@@chapter} at the beginning of a string and can be used +This matches the beginning of a string. @samp{^@@chapter} +matches @samp{@@chapter} at the beginning of a string, +for example, and can be used to identify chapter beginnings in Texinfo source files. The @samp{^} is known as an @dfn{anchor}, because it anchors the pattern to match only at the beginning of the string. @@ -5339,7 +5346,7 @@ 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: -@samp{(ph)*} matches @samp{ph}, @samp{phph}, @samp{phphph} and so on. +@samp{(ph)*} matches @samp{ph}, @samp{phph}, @samp{phphph}, and so on. Second, @samp{*} finds as many repetitions as possible. If the text to be matched is @samp{phhhhhhhhhhhhhhooey}, @samp{ph*} matches all of @@ -5439,7 +5446,7 @@ expressions are not available in regular expressions. @cindex range expressions (regexps) @cindex character lists in regular expression -As mentioned earlier, a bracket expression matches any character amongst +As mentioned earlier, a bracket expression matches any character among those listed between the opening and closing square brackets. Within a bracket expression, a @dfn{range expression} consists of two @@ -5497,23 +5504,23 @@ a keyword denoting the class, and @samp{:]}. POSIX standard. @float Table,table-char-classes -@caption{POSIX Character Classes} +@caption{POSIX character classes} @multitable @columnfractions .15 .85 @headitem Class @tab Meaning -@item @code{[:alnum:]} @tab Alphanumeric characters. -@item @code{[:alpha:]} @tab Alphabetic characters. -@item @code{[:blank:]} @tab Space and TAB characters. -@item @code{[:cntrl:]} @tab Control characters. -@item @code{[:digit:]} @tab Numeric characters. -@item @code{[:graph:]} @tab Characters that are both printable and visible. -(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, -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. -@item @code{[:xdigit:]} @tab Characters that are hexadecimal digits. +@item @code{[:alnum:]} @tab Alphanumeric characters +@item @code{[:alpha:]} @tab Alphabetic characters +@item @code{[:blank:]} @tab Space and TAB characters +@item @code{[:cntrl:]} @tab Control characters +@item @code{[:digit:]} @tab Numeric characters +@item @code{[:graph:]} @tab Characters that are both printable and visible +(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 +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 +@item @code{[:xdigit:]} @tab Characters that are hexadecimal digits @end multitable @end float @@ -5528,7 +5535,7 @@ and numeric characters in your character set. @c Thanks to @c Date: Tue, 01 Jul 2014 07:39:51 +0200 @c From: Hermann Peifer -Some utilities that match regular expressions provide a non-standard +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 all values numerically between zero and 127, which is the defined @@ -5887,16 +5894,16 @@ in @ref{Regexp Operators}. @end ifnottex @item @code{--posix} -Only POSIX regexps are supported; the GNU operators are not special +Match only POSIX regexps; the GNU operators are not special (e.g., @samp{\w} matches a literal @samp{w}). Interval expressions are allowed. @cindex Brian Kernighan's @command{awk} @item @code{--traditional} -Traditional Unix @command{awk} regexps are matched. The GNU operators +Match traditional Unix @command{awk} regexps. The GNU operators are not special, and interval expressions are not available. -The POSIX character classes (@samp{[[:alnum:]]}, etc.) are supported, -as BWK @command{awk} supports them. +Because BWK @command{awk} supports them, +the POSIX character classes (@samp{[[:alnum:]]}, etc.) are available. Characters described by octal and hexadecimal escape sequences are treated literally, even if they represent regexp metacharacters. @@ -5956,7 +5963,7 @@ When @code{IGNORECASE} is not zero, @emph{all} regexp and string operations ignore case. Changing the value of @code{IGNORECASE} dynamically controls the -case-sensitivity of the program as it runs. Case is significant by +case sensitivity of the program as it runs. Case is significant by default because @code{IGNORECASE} (like most variables) is initialized to zero: @@ -5969,7 +5976,7 @@ if (x ~ /ab/) @dots{} # now it will succeed @end example In general, you cannot use @code{IGNORECASE} to make certain rules -case-insensitive and other rules case-sensitive, because there is no +case insensitive and other rules case sensitive, as there is no straightforward way to set @code{IGNORECASE} just for the pattern of a particular rule.@footnote{Experienced C and C++ programmers will note @@ -5980,7 +5987,7 @@ and However, this is somewhat obscure and we don't recommend it.} To do this, use either bracket expressions or @code{tolower()}. However, one thing you can do with @code{IGNORECASE} only is dynamically turn -case-sensitivity on or off for all the rules at once. +case sensitivity on or off for all the rules at once. @code{IGNORECASE} can be set on the command line or in a @code{BEGIN} rule (@pxref{Other Arguments}; also @@ -6023,12 +6030,12 @@ in conditional expressions, or as part of matching expressions using the @samp{~} and @samp{!~} operators. @item -Escape sequences let you represent non-printable characters and +Escape sequences let you represent nonprintable characters and also let you represent regexp metacharacters as literal characters to be matched. @item -Regexp operators provide grouping, alternation and repetition. +Regexp operators provide grouping, alternation, and repetition. @item Bracket expressions give you a shorthand for specifying sets @@ -6043,8 +6050,8 @@ the match, such as for text substitution and when the record separator is a regexp. @item -Matching expressions may use dynamic regexps, that is, string values -treated as regular expressions. +Matching expressions may use dynamic regexps (i.e., string values +treated as regular expressions). @item @command{gawk}'s @code{IGNORECASE} variable lets you control the @@ -6129,7 +6136,7 @@ never automatically reset to zero. @end menu @node awk split records -@subsection Record Splitting With Standard @command{awk} +@subsection Record Splitting with Standard @command{awk} @cindex separators, for records @cindex record separators @@ -6160,7 +6167,7 @@ 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 +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 @command{awk} program (the action with no pattern) prints each record. Because each @code{print} statement adds a newline at the end of @@ -6276,7 +6283,7 @@ The empty string @code{""} (a string without any characters) has a special meaning as the value of @code{RS}. It means that records are separated by one or more blank lines and nothing else. -@xref{Multiple Line}, for more details. +@DBXREF{Multiple Line} for more details. If you change the value of @code{RS} in the middle of an @command{awk} run, the new value is used to delimit subsequent records, but the record @@ -6296,7 +6303,7 @@ sets the variable @code{RT} to the text in the input that matched @code{RS}. @node gawk split records -@subsection Record Splitting With @command{gawk} +@subsection Record Splitting with @command{gawk} @cindex common extensions, @code{RS} as a regexp @cindex extensions, common@comma{} @code{RS} as a regexp @@ -6340,11 +6347,11 @@ $ @kbd{echo record 1 AAAA record 2 BBBB record 3 |} The square brackets delineate the contents of @code{RT}, letting you see the leading and trailing whitespace. The final value of @code{RT} is a newline. -@xref{Simple Sed}, for a more useful example +@DBXREF{Simple Sed} for a more useful example of @code{RS} as a regexp and @code{RT}. If you set @code{RS} to a regular expression that allows optional -trailing text, such as @samp{RS = "abc(XYZ)?"} it is possible, due +trailing text, such as @samp{RS = "abc(XYZ)?"}, it is possible, due to implementation constraints, that @command{gawk} may match the leading part of the regular expression, but not the trailing part, particularly if the input text that could match the trailing part is fairly long. @@ -6407,7 +6414,7 @@ character as a record separator. However, this is a special case: @cindex records, treating files as @cindex treating files, as single records -@xref{Readfile Function}, for an interesting way to read +@DBXREF{Readfile Function} for an interesting way to read whole files. If you are using @command{gawk}, see @ref{Extension Sample Readfile}, for another option. @end sidebar @@ -6431,9 +6438,9 @@ called @dfn{fields}. By default, fields are separated by @dfn{whitespace}, like words in a line. Whitespace in @command{awk} means any string of one or more spaces, TABs, or newlines;@footnote{In POSIX @command{awk}, newlines are not -considered whitespace for separating fields.} other characters, such as -formfeed, vertical tab, etc., that are -considered whitespace by other languages, are @emph{not} considered +considered whitespace for separating fields.} other characters +that are considered whitespace by other languages +(such as formfeed, vertical tab, etc.) are @emph{not} considered whitespace by @command{awk}. The purpose of fields is to make it more convenient for you to refer to @@ -6450,7 +6457,7 @@ 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. -@code{$127} is the one hundred twenty-seventh field in the record.) +@code{$127} is the 127th field in the record.) For example, suppose the following is a line of input: @example @@ -6520,7 +6527,7 @@ awk '@{ print $NR @}' @noindent Recall that @code{NR} is the number of records read so far: one in the -first record, two in the second, etc. So this example prints the first +first record, two in the second, and so on. So this example prints the first field of the first record, the second field of the second record, and so on. For the twentieth record, field number 20 is printed; most likely, the record has fewer than 20 fields, so this prints a blank line. @@ -6537,7 +6544,7 @@ 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, since @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 @@ -6611,7 +6618,7 @@ $ @kbd{awk '@{ $2 = $2 - 10; print $0 @}' inventory-shipped} @dots{} @end example -It is also possible to also assign contents to fields that are out +It is also possible to assign contents to fields that are out of range. For example: @example @@ -6662,9 +6669,9 @@ else @noindent should print @samp{everything is normal}, because @code{NF+1} is certain -to be out of range. (@xref{If Statement}, +to be out of range. (@DBXREF{If Statement} for more information about @command{awk}'s @code{if-else} statements. -@xref{Typing and Comparison}, +@DBXREF{Typing and Comparison} for more information about the @samp{!=} operator.) It is important to note that making an assignment to an existing field @@ -6749,7 +6756,7 @@ in a record simply by setting @code{FS} and @code{OFS}, and then expecting a plain @samp{print} or @samp{print $0} to print the modified record. -But this does not work, since nothing was done to change the record +But this does not work, because nothing was done to change the record itself. Instead, you must force the record to be rebuilt, typically with a statement such as @samp{$1 = $1}, as described earlier. @end sidebar @@ -6801,7 +6808,7 @@ the Unix Bourne shell, @command{sh}, or Bash). @cindex @code{FS} variable, changing value of The value of @code{FS} can be changed in the @command{awk} program with the assignment operator, @samp{=} (@pxref{Assignment Ops}). -Often the right time to do this is at the beginning of execution +Often, the right time to do this is at the beginning of execution before any input has been processed, so that the very first record is read with the proper separator. To do this, use the special @code{BEGIN} pattern @@ -6957,7 +6964,7 @@ statement prints the new @code{$0}. @cindex dark corner, @code{^}, in @code{FS} There is an additional subtlety to be aware of when using regular expressions for field splitting. -It is not well-specified in the POSIX standard, or anywhere else, what @samp{^} +It is not well specified in the POSIX standard, or anywhere else, what @samp{^} means when splitting fields. Does the @samp{^} match only at the beginning of the entire record? Or is each field separator a new string? It turns out that different @command{awk} versions answer this question differently, and you @@ -7123,11 +7130,11 @@ awk -F: '$5 == ""' /etc/passwd @end example @node Full Line Fields -@subsection Making The Full Line Be A Single Field +@subsection Making the Full Line Be a Single Field Occasionally, it's useful to treat the whole input line as a single field. This can be done easily and portably simply by -setting @code{FS} to @code{"\n"} (a newline).@footnote{Thanks to +setting @code{FS} to @code{"\n"} (a newline):@footnote{Thanks to Andrew Schorr for this tip.} @example @@ -7137,42 +7144,6 @@ awk -F'\n' '@var{program}' @var{files @dots{}} @noindent When you do this, @code{$1} is the same as @code{$0}. -@node Field Splitting Summary -@subsection Field-Splitting Summary - -It is important to remember that when you assign a string constant -as the value of @code{FS}, it undergoes normal @command{awk} string -processing. For example, with Unix @command{awk} and @command{gawk}, -the assignment @samp{FS = "\.."} assigns the character string @code{".."} -to @code{FS} (the backslash is stripped). This creates a regexp meaning -``fields are separated by occurrences of any two characters.'' -If instead you want fields to be separated by a literal period followed -by any single character, use @samp{FS = "\\.."}. - -The following list summarizes how fields are split, based on the value -of @code{FS} (@samp{==} means ``is equal to''): - -@table @code -@item FS == " " -Fields are separated by runs of whitespace. Leading and trailing -whitespace are ignored. This is the default. - -@item FS == @var{any other single character} -Fields are separated by each occurrence of the character. Multiple -successive occurrences delimit empty fields, as do leading and -trailing occurrences. -The character can even be a regexp metacharacter; it does not need -to be escaped. - -@item FS == @var{regexp} -Fields are separated by occurrences of characters that match @var{regexp}. -Leading and trailing matches of @var{regexp} delimit empty fields. - -@item FS == "" -Each individual character in the record becomes a separate field. -(This is a common extension; it is not specified by the POSIX standard.) -@end table - @sidebar Changing @code{FS} Does Not Affect the Fields @cindex POSIX @command{awk}, field separators and @@ -7218,6 +7189,42 @@ root:nSijPlPhZZwgE:0:0:Root:/: @end example @end sidebar +@node Field Splitting Summary +@subsection Field-Splitting Summary + +It is important to remember that when you assign a string constant +as the value of @code{FS}, it undergoes normal @command{awk} string +processing. For example, with Unix @command{awk} and @command{gawk}, +the assignment @samp{FS = "\.."} assigns the character string @code{".."} +to @code{FS} (the backslash is stripped). This creates a regexp meaning +``fields are separated by occurrences of any two characters.'' +If instead you want fields to be separated by a literal period followed +by any single character, use @samp{FS = "\\.."}. + +The following list summarizes how fields are split, based on the value +of @code{FS} (@samp{==} means ``is equal to''): + +@table @code +@item FS == " " +Fields are separated by runs of whitespace. Leading and trailing +whitespace are ignored. This is the default. + +@item FS == @var{any other single character} +Fields are separated by each occurrence of the character. Multiple +successive occurrences delimit empty fields, as do leading and +trailing occurrences. +The character can even be a regexp metacharacter; it does not need +to be escaped. + +@item FS == @var{regexp} +Fields are separated by occurrences of characters that match @var{regexp}. +Leading and trailing matches of @var{regexp} delimit empty fields. + +@item FS == "" +Each individual character in the record becomes a separate field. +(This is a common extension; it is not specified by the POSIX standard.) +@end table + @sidebar @code{FS} and @code{IGNORECASE} The @code{IGNORECASE} variable @@ -7236,7 +7243,7 @@ print $1 @noindent The output is @samp{aCa}. If you really want to split fields on an alphabetic character while ignoring case, use a regexp that will -do it for you. E.g., @samp{FS = "[c]"}. In this case, @code{IGNORECASE} +do it for you (e.g., @samp{FS = "[c]"}). In this case, @code{IGNORECASE} will take effect. @end sidebar @@ -7246,18 +7253,19 @@ will take effect. @node Constant Size @section Reading Fixed-Width Data +@cindex data, fixed-width +@cindex fixed-width data +@cindex advanced features, fixed-width data +@command{gawk} provides a facility for dealing with +fixed-width fields with no distinctive field separator. + @quotation NOTE This @value{SECTION} discusses an advanced feature of @command{gawk}. If you are a novice @command{awk} user, you might want to skip it on the first reading. @end quotation -@cindex data, fixed-width -@cindex fixed-width data -@cindex advanced features, fixed-width data -@command{gawk} provides a facility for dealing with -fixed-width fields with no distinctive field separator. For example, -data of this nature arises in the input for old Fortran programs where +Fixed-width data data arises in the input for old Fortran programs where numbers are run together, or in the output of programs that did not anticipate the use of their output as input for other programs. @@ -7298,15 +7306,10 @@ dave ttyq4 26Jun9115days 46 46 wnewmail @end group @end example -The following program takes the above input, converts the idle time to +The following program takes this input, converts the idle time to number of seconds, and prints out the first two fields and the calculated idle time: -@quotation NOTE -This program uses a number of @command{awk} features that -haven't been introduced yet. -@end quotation - @example BEGIN @{ FIELDWIDTHS = "9 6 10 6 7 7 35" @} NR > 2 @{ @@ -7325,6 +7328,11 @@ NR > 2 @{ @} @end example +@quotation NOTE +The preceding program uses a number of @command{awk} features that +haven't been introduced yet. +@end quotation + Running the program on the data produces the following results: @example @@ -7370,7 +7378,7 @@ else This information is useful when writing a function that needs to temporarily change @code{FS} or @code{FIELDWIDTHS}, read some records, and then restore the original settings -(@pxref{Passwd Functions}, +(@DBPXREF{Passwd Functions}, for an example of such a function). @node Splitting By Content -- cgit v1.2.3 From ab90088866a262f32c79e4fabc4a63409c9fd4f5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 6 Nov 2014 23:03:08 +0200 Subject: Copyedits through the end of chapter 4. --- doc/gawktexi.in | 90 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 971faae4..e6425313 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -2895,7 +2895,7 @@ escapes mean. A fourth option is to use command-line variable assignment, like this: @example -$ awk -v sq="'" 'BEGIN @{ print "Here is a single quote <" sq ">" @}' +$ @kbd{awk -v sq="'" 'BEGIN @{ print "Here is a single quote <" sq ">" @}'} @print{} Here is a single quote <'> @end example @@ -3424,9 +3424,9 @@ starts a comment, it ignores @emph{everything} on the rest of the line. For example: @example -$ gawk 'BEGIN @{ print "dont panic" # a friendly \ -> BEGIN rule -> @}' +$ @kbd{gawk 'BEGIN @{ print "dont panic" # a friendly \} +> @kbd{ BEGIN rule} +> @kbd{@}'} @error{} gawk: cmd. line:2: BEGIN rule @error{} gawk: cmd. line:2: ^ syntax error @end example @@ -5993,7 +5993,7 @@ case sensitivity on or off for all the rules at once. (@pxref{Other Arguments}; also @pxref{Using BEGIN/END}). Setting @code{IGNORECASE} from the command line is a way to make -a program case-insensitive without having to edit it. +a program case insensitive without having to edit it. @c @cindex ISO 8859-1 @c @cindex ISO Latin-1 @@ -6125,7 +6125,7 @@ used with it do not have to be named on the @command{awk} command line @command{awk} divides the input for your program into records and fields. It keeps track of the number of records that have been read so far from the current input file. This value is stored in a predefined variable -called @code{FNR} which is reset to zero every time a new file is started. +called @code{FNR}, which is reset to zero every time a new file is started. Another predefined variable, @code{NR}, records the total number of input records read so far from all @value{DF}s. It starts at zero, but is never automatically reset to zero. @@ -6153,7 +6153,7 @@ the value of @code{RS} can be changed in the @command{awk} program with the assignment operator, @samp{=} (@pxref{Assignment Ops}). The new record-separator character should be enclosed in quotation marks, -which indicate a string constant. Often the right time to do this is +which indicate a string constant. Often, the right time to do this is at the beginning of execution, before any input is processed, so that the very first record is read with the proper separator. To do this, use the special @code{BEGIN} pattern @@ -6261,7 +6261,7 @@ being fully POSIX-compliant (@pxref{Options}). Then, the following (extreme) pipeline prints a surprising @samp{1}: @example -$ echo | gawk --posix 'BEGIN @{ RS = "a" @} ; @{ print NF @}' +$ @kbd{echo | gawk --posix 'BEGIN @{ RS = "a" @} ; @{ print NF @}'} @print{} 1 @end example @@ -6415,8 +6415,8 @@ character as a record separator. However, this is a special case: @cindex records, treating files as @cindex treating files, as single records @DBXREF{Readfile Function} for an interesting way to read -whole files. If you are using @command{gawk}, see @ref{Extension Sample -Readfile}, for another option. +whole files. If you are using @command{gawk}, see @DBREF{Extension Sample +Readfile} for another option. @end sidebar @c ENDOFRANGE inspl @c ENDOFRANGE recspl @@ -6711,8 +6711,8 @@ after the new value of @code{NF} and recomputes @code{$0}. Here is an example: @example -$ echo a b c d e f | awk '@{ print "NF =", NF; -> NF = 3; print $0 @}' +$ @kbd{echo a b c d e f | awk '@{ print "NF =", NF;} +> @kbd{ NF = 3; print $0 @}'} @print{} NF = 6 @print{} a b c @end example @@ -7256,18 +7256,17 @@ will take effect. @cindex data, fixed-width @cindex fixed-width data @cindex advanced features, fixed-width data -@command{gawk} provides a facility for dealing with -fixed-width fields with no distinctive field separator. -@quotation NOTE +@c O'Reilly doesn't like it as a note the first thing in the section. This @value{SECTION} discusses an advanced feature of @command{gawk}. If you are a novice @command{awk} user, you might want to skip it on the first reading. -@end quotation -Fixed-width data data arises in the input for old Fortran programs where -numbers are run together, or in the output of programs that did not -anticipate the use of their output as input for other programs. +@command{gawk} provides a facility for dealing with fixed-width fields +with no distinctive field separator. For example, data of this nature +arises in the input for old Fortran programs where numbers are run +together, or in the output of programs that did not anticipate the use +of their output as input for other programs. An example of the latter is a table where all the columns are lined up by the use of a variable number of spaces and @emph{empty fields are just @@ -7378,17 +7377,16 @@ else This information is useful when writing a function that needs to temporarily change @code{FS} or @code{FIELDWIDTHS}, read some records, and then restore the original settings -(@DBPXREF{Passwd Functions}, +(@DBPXREF{Passwd Functions} for an example of such a function). @node Splitting By Content -@section Defining Fields By Content +@section Defining Fields by Content -@quotation NOTE +@c O'Reilly doesn't like it as a note the first thing in the section. This @value{SECTION} discusses an advanced feature of @command{gawk}. If you are a novice @command{awk} user, you might want to skip it on the first reading. -@end quotation @cindex advanced features, specifying field content Normally, when using @code{FS}, @command{gawk} defines the fields as the @@ -7399,12 +7397,12 @@ However, there are times when you really want to define the fields by what they are, and not by what they are not. The most notorious such case -is so-called @dfn{comma separated value} (CSV) data. Many spreadsheet programs, +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 -one of the fields contains an @emph{embedded} comma. While there is no -formal standard specification for CSV data@footnote{At least, we don't know of one.}, +one of the fields contains an @emph{embedded} comma. Altough there is no +formal standard specification for CSV data,@footnote{At least, we don't know of one.} in such cases, most programs embed the field in double quotes. So we might have data like this: @@ -7420,7 +7418,7 @@ The @code{FPAT} variable offers a solution for cases like this. The value of @code{FPAT} should be a string that provides a regular expression. This regular expression describes the contents of each field. -In the case of CSV data as presented above, each field is either ``anything that +In the case of CSV data as presented here, each field is either ``anything that is not a comma,'' or ``a double quote, anything that is not a double quote, and a closing double quote.'' If written as a regular expression constant (@pxref{Regexp}), @@ -7485,7 +7483,7 @@ will be @code{"FPAT"} if content-based field splitting is being used. @quotation NOTE Some programs export CSV data that contains embedded newlines between the double quotes. @command{gawk} provides no way to deal with this. -Since there is no formal specification for CSV data, there isn't much +Because no formal specification for CSV data exists, there isn't much more to be done; the @code{FPAT} mechanism provides an elegant solution for the majority of cases, and the @command{gawk} developers are satisfied with that. @@ -7642,7 +7640,7 @@ $ @kbd{awk -f addrs.awk addresses} @dots{} @end example -@xref{Labels Program}, for a more realistic program that deals with +@DBXREF{Labels Program} for a more realistic program dealing with address lists. The following list summarizes how records are split, based on the value of @ifinfo @@ -7737,7 +7735,7 @@ represents a shell command. @quotation NOTE When @option{--sandbox} is specified (@pxref{Options}), -reading lines from files, pipes and coprocesses is disabled. +reading lines from files, pipes, and coprocesses is disabled. @end quotation @menu @@ -7880,7 +7878,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. @@ -7934,7 +7932,7 @@ you want your program to be portable to all @command{awk} implementations. Use @samp{getline @var{var} < @var{file}} to read input from the file -@var{file}, and put it in the variable @var{var}. As above, @var{file} +@var{file}, and put it in the variable @var{var}. As earlier, @var{file} is a string-valued expression that specifies the file from which to read. In this version of @code{getline}, none of the predefined variables are @@ -7970,7 +7968,7 @@ One deficiency of this program is that it does not process nested @code{@@include} statements (i.e., @code{@@include} statements in included files) the way a true macro preprocessor would. -@xref{Igawk Program}, for a program +@DBXREF{Igawk Program} for a program that does handle nested @code{@@include} statements. @node Getline/Pipe @@ -8269,7 +8267,7 @@ and whether the variant is standard or a @command{gawk} extension. Note: for each variant, @command{gawk} sets the @code{RT} predefined variable. @float Table,table-getline-variants -@caption{@code{getline} Variants and What They Set} +@caption{@code{getline} variants and what they set} @multitable @columnfractions .33 .38 .27 @headitem Variant @tab Effect @tab @command{awk} / @command{gawk} @item @code{getline} @tab Sets @code{$0}, @code{NF}, @code{FNR}, @code{NR}, and @code{RT} @tab @command{awk} @@ -8287,7 +8285,7 @@ Note: for each variant, @command{gawk} sets the @code{RT} predefined variable. @c ENDOFRANGE infir @node Read Timeout -@section Reading Input With A Timeout +@section Reading Input with a Timeout @cindex timeout, reading input @cindex differences in @command{awk} and @command{gawk}, read timeouts @@ -8295,7 +8293,7 @@ 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 +on a per input, command, or connection basis, by setting a special element in the @code{PROCINFO} array (@pxref{Auto-set}): @example @@ -8369,11 +8367,11 @@ You should not assume that the read operation will block exactly after the tenth record has been printed. It is possible that @command{gawk} will read and buffer more than one record's worth of data the first time. Because of this, changing the value -of timeout like in the above example is not very useful. +of timeout like in the preceding example is not very useful. @end quotation -If the @code{PROCINFO} element is not present and the environment -variable @env{GAWK_READ_TIMEOUT} exists, +If the @code{PROCINFO} element is not present and the +@env{GAWK_READ_TIMEOUT} environment variable exists, @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 @@ -8394,7 +8392,7 @@ or the attempt to open a FIFO special file for reading can block indefinitely until some other process opens it for writing. @node Command-line directories -@section Directories On The Command Line +@section Directories on the Command Line @cindex differences in @command{awk} and @command{gawk}, command-line directories @cindex directories, command-line @cindex command line, directories on @@ -8416,7 +8414,7 @@ If either of the @option{--posix} or @option{--traditional} options is given, then @command{gawk} reverts to treating a directory on the command line as a fatal error. -@xref{Extension Sample Readdir}, for a way to treat directories +@DBXREF{Extension Sample Readdir} for a way to treat directories as usable data from an @command{awk} program. @node Input Summary @@ -8443,7 +8441,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 record 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. @@ -8457,7 +8455,7 @@ greater than @code{NF} creates the field and rebuilds the record, using thing. Decrementing @code{NF} throws away fields and rebuilds the record. @item -Field splitting is more complicated than record splitting. +Field splitting is more complicated than record splitting: @multitable @columnfractions .40 .45 .15 @headitem Field separator value @tab Fields are split @dots{} @tab @command{awk} / @command{gawk} @@ -11156,7 +11154,7 @@ This is most notable in some commercial @command{awk} versions. For example: @example -$ awk /==/ /dev/null +$ @kbd{awk /==/ /dev/null} @error{} awk: syntax error at source line 1 @error{} context is @error{} >>> /= <<< @@ -18036,7 +18034,7 @@ interprets the current time according to the format specifiers in the string. For example: @example -$ date '+Today is %A, %B %d, %Y.' +$ @kbd{date '+Today is %A, %B %d, %Y.'} @print{} Today is Monday, September 22, 2014. @end example @@ -27899,7 +27897,7 @@ called ``Hippy.'' Ah, well.} @example @group -$ cp guide.pot guide-mellow.po +$ @kbd{cp guide.pot guide-mellow.po} @var{Add translations to} guide-mellow.po @dots{} @end group @end example -- cgit v1.2.3 From 0a0442fb4744b4a6f419b5e341dfb553081cf04e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 7 Nov 2014 14:25:42 +0200 Subject: More copyedits. --- NOTES | 2 ++ doc/gawktexi.in | 42 +++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/NOTES b/NOTES index 9fb5f5dc..aa3d1890 100644 --- a/NOTES +++ b/NOTES @@ -7,3 +7,5 @@ alone since they are links and I can't do it that way in texinfo anyway. Appendices vs. Appendixes - I have left it as the former; the latter looks totally wrong to me. + +At page 104. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index e6425313..da76a324 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -8528,7 +8528,7 @@ The @code{print} statement is not limited when computing @emph{which} values to print. However, with two exceptions, you cannot specify @emph{how} to print them---how many columns, whether to use exponential notation or not, and so on. -(For the exceptions, @pxref{Output Separators}, and +(For the exceptions, @DBPXREF{Output Separators} and @ref{OFMT}.) For printing with specifications, you need the @code{printf} statement (@pxref{Printf}). @@ -8725,14 +8725,14 @@ separated by single spaces. However, this doesn't need to be the case; a single space is simply the default. Any string of characters may be used as the @dfn{output field separator} by setting the predefined variable @code{OFS}. The initial value of this variable -is the string @w{@code{" "}}---that is, a single space. +is the string @w{@code{" "}} (i.e., a single space). -The output from an entire @code{print} statement is called an -@dfn{output record}. Each @code{print} statement outputs one output -record, and then outputs a string called the @dfn{output record separator} -(or @code{ORS}). The initial -value of @code{ORS} is the string @code{"\n"}; i.e., a newline -character. Thus, each @code{print} statement normally makes a separate line. +The output from an entire @code{print} statement is called an @dfn{output +record}. Each @code{print} statement outputs one output record, and +then outputs a string called the @dfn{output record separator} (or +@code{ORS}). The initial value of @code{ORS} is the string @code{"\n"} +(i.e., a newline character). Thus, each @code{print} statement normally +makes a separate line. @cindex output, records @cindex output record separator, See @code{ORS} variable @@ -8856,7 +8856,7 @@ printf @var{format}, @var{item1}, @var{item2}, @dots{} @end example @noindent -As print @code{print}, the entire list of arguments may optionally be +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, it can be confused with an output redirection (@pxref{Redirection}). @@ -8964,7 +8964,7 @@ which follow the decimal point. (The @samp{4.3} represents two modifiers, discussed in the next @value{SUBSECTION}.) -On systems supporting IEEE 754 floating point format, values +On systems supporting IEEE 754 floating-point format, values representing negative infinity are formatted as @samp{-inf} or @samp{-infinity}, @@ -8995,7 +8995,7 @@ Print a string. @item @code{%u} Print an unsigned decimal integer. (This format is of marginal use, because all numbers in @command{awk} -are floating-point; it is provided primarily for compatibility with C.) +are floating point; it is provided primarily for compatibility with C.) @item @code{%x}, @code{%X} Print an unsigned hexadecimal integer; @@ -9088,7 +9088,7 @@ says to always supply a sign for numeric conversions, even if the data to format is positive. The @samp{+} overrides the space modifier. @item # -Use an ``alternate form'' for certain control letters. +Use an ``alternative form'' for certain control letters. For @code{%o}, supply a leading zero. For @code{%x} and @code{%X}, supply a leading @code{0x} or @samp{0X} for a nonzero result. @@ -9105,7 +9105,7 @@ value to print. @item ' A single quote or apostrophe character is a POSIX extension to ISO C. -It indicates that the integer part of a floating point value, or the +It indicates that the integer part of a floating-point value, or the entire part of an integer decimal value, should have a thousands-separator character in it. This only works in locales that support such characters. For example: @@ -9186,7 +9186,7 @@ prints @samp{foob}. @end table The C library @code{printf}'s dynamic @var{width} and @var{prec} -capability (for example, @code{"%*.*s"}) is supported. Instead of +capability (e.g., @code{"%*.*s"}) is supported. Instead of supplying explicit @var{width} and/or @var{prec} values in the format string, they are passed in the argument list. For example: @@ -9286,7 +9286,7 @@ awk 'BEGIN @{ print "Name Number" @{ printf "%-10s %s\n", $1, $2 @}' mail-list @end example -The above example mixes @code{print} and @code{printf} statements in +The preceding example mixes @code{print} and @code{printf} statements in the same program. Using just @code{printf} statements can produce the same results: @@ -9433,7 +9433,7 @@ close(report) The @code{close()} function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to it. -@xref{Close Files And Pipes}, +@DBXREF{Close Files And Pipes} for more information. This example also illustrates the use of a variable to represent @@ -9457,9 +9457,9 @@ but subsidiary to, the @command{awk} program. This feature is a @command{gawk} extension, and is not available in POSIX @command{awk}. -@xref{Getline/Coprocess}, +@DBXREF{Getline/Coprocess} for a brief discussion. -@xref{Two-way I/O}, +@DBXREF{Two-way I/O} for a more complete discussion. @end table @@ -9483,7 +9483,7 @@ print "Avoid improbability generators" >> "guide.txt" @noindent 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, since the output file +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 for the same file is definitely poor style, and is confusing to readers @@ -9532,7 +9532,7 @@ The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. -@xref{Shell Quoting}, for a function that can help in generating +@DBXREF{Shell Quoting} for a function that can help in generating command lines to be fed to the shell. @end sidebar @c ENDOFRANGE outre @@ -9597,7 +9597,7 @@ that happens, writing to the screen is not correct. In fact, if terminal at all. Then opening @file{/dev/tty} fails. -@command{gawk}, BWK @command{awk} and @command{mawk} provide +@command{gawk}, BWK @command{awk}, and @command{mawk} provide special @value{FN}s for accessing the three standard streams. If the @value{FN} matches one of these special names when @command{gawk} (or one of the others) redirects input or output, then it directly uses -- cgit v1.2.3 From 0ef2d77362b1ac3caae96512c0dbdcda5b87adc5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 9 Nov 2014 06:33:30 +0200 Subject: Copyedits. --- NOTES | 10 ++- doc/gawktexi.in | 209 +++++++++++++++++++++++++++++--------------------------- 2 files changed, 118 insertions(+), 101 deletions(-) diff --git a/NOTES b/NOTES index aa3d1890..7e707c83 100644 --- a/NOTES +++ b/NOTES @@ -8,4 +8,12 @@ alone since they are links and I can't do it that way in texinfo anyway. Appendices vs. Appendixes - I have left it as the former; the latter looks totally wrong to me. -At page 104. +Numbers. I use the style where values from zero to nine are spelled +out and from 10 up they're written with digits. I forget what the +Chicago Manual of Style calls this. So I've rejected those changes. + +C heads - I have not lowercased them; this would be incorrect +for the Texinfo, so I've marked them as Rejected but with a reply +in the PDF to please do this during production. + +At page 149, before 'the do-while statement'. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index da76a324..ba355aaf 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -5831,9 +5831,9 @@ word-constituent characters. For example, @cindex regular expressions, operators, for buffers @cindex operators, string-matching, for buffers There are two other operators that work on buffers. In Emacs, a -@dfn{buffer} is, naturally, an Emacs buffer. For other programs, -@command{gawk}'s regexp library routines consider the entire -string to match as the buffer. +@dfn{buffer} is, naturally, an Emacs buffer. +Other GNU programs, including @command{gawk}, +consider the entire string to match as the buffer. The operators are: @table @code @@ -9640,7 +9640,7 @@ It is a common error to omit the quotes, which leads to confusing results. @command{gawk} does not treat these @value{FN}s as special when -in POSIX compatibility mode. However, since BWK @command{awk} +in POSIX-compatibility mode. However, because BWK @command{awk} supports them, @command{gawk} does support them even when invoked with the @option{--traditional} option (@pxref{Options}). @@ -9649,7 +9649,7 @@ invoked with the @option{--traditional} option (@pxref{Options}). @c STARTOFRANGE gfn @cindex @command{gawk}, file names in -Besides access to standard input, stanard output, and standard error, +Besides access to standard input, standard output, and standard error, @command{gawk} provides access to any open file descriptor. Additionally, there are special @value{FN}s reserved for TCP/IP networking. @@ -9698,7 +9698,7 @@ This is done using a special @value{FN} of the form: @file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}} @end example -The @var{net-type} is one of @samp{inet}, @samp{inet4} or @samp{inet6}. +The @var{net-type} is one of @samp{inet}, @samp{inet4}, or @samp{inet6}. The @var{protocol} is one of @samp{tcp} or @samp{udp}, and the other fields represent the other essential pieces of information for making a networking connection. @@ -9887,7 +9887,7 @@ is not closed and released until @code{close()} is called or @command{awk} exits. @code{close()} silently does nothing if given an argument that -does not represent a file, pipe or coprocess that was opened with +does not represent a file, pipe, or coprocess that was opened with a redirection. In such a case, it returns a negative value, indicating an error. In addition, @command{gawk} sets @code{ERRNO} to a string indicating the error. @@ -9921,9 +9921,10 @@ which describes it in more detail and gives an example. @cindex Unix @command{awk}, @code{close()} function and In many older versions of Unix @command{awk}, the @code{close()} function -is actually a statement. It is a syntax error to try and use the return -value from @code{close()}: +is actually a statement. @value{DARKCORNER} +It is a syntax error to try and use the return +value from @code{close()}: @example command = "@dots{}" @@ -9986,11 +9987,11 @@ Output from both @code{print} and @code{printf} may be redirected to files, pipes, and coprocesses. @item -@command{gawk} provides special file names for access to standard input, -output and error, and for network communications. +@command{gawk} provides special @value{FN}s for access to standard input, +output, and error, and for network communications. @item -Use @code{close()} to close open file, pipe and coprocess redirections. +Use @code{close()} to close open file, pipe, and coprocess redirections. For coprocesses, it is possible to close only one direction of the communications. @@ -10058,7 +10059,7 @@ combinations of these with various operators. @end menu @node Values -@section Constants, Variables and Conversions +@section Constants, Variables, and Conversions Expressions are built up from values and the operations performed upon them. This @value{SECTION} describes the elementary objects @@ -10084,7 +10085,7 @@ string, and regular expression. Each is used in the appropriate context when you need a data value that isn't going to change. Numeric constants can -have different forms, but are stored identically internally. +have different forms, but are internally stored in an identical manner. @menu * Scalar Constants:: Numeric and string constants. @@ -10100,7 +10101,7 @@ have different forms, but are stored identically internally. A @dfn{numeric constant} stands for a number. This number can be an integer, a decimal fraction, or a number in scientific (exponential) notation.@footnote{The internal representation of all numbers, -including integers, uses double precision floating-point numbers. +including integers, uses double-precision floating-point numbers. On most modern systems, these are in IEEE 754 standard format. @xref{Arbitrary Precision Arithmetic}, for much more information.} Here are some examples of numeric constants that all @@ -10114,7 +10115,7 @@ have the same value: @cindex string constants A string constant consists of a sequence of characters enclosed in -double-quotation marks. For example: +double quotation marks. For example: @example "parrot" @@ -10136,13 +10137,13 @@ implementations may have difficulty with some character codes. @cindex numbers, octal @cindex numbers, hexadecimal -In @command{awk}, all numbers are in decimal; i.e., base 10. Many other +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, etc. +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. -In hexadecimal, there are 16 digits. Since the everyday 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} @@ -10194,11 +10195,12 @@ you can use the @code{strtonum()} function 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 @ref{Bitwise Functions}, +see @DBREF{Bitwise Functions} for more information. -Unlike some early C implementations, @samp{8} and @samp{9} are not valid -in octal constants; e.g., @command{gawk} treats @samp{018} as decimal 18: +Unlike 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: @example $ @kbd{gawk 'BEGIN @{ print "021 is", 021 ; print 018 @}'} @@ -10255,7 +10257,7 @@ matched. However, regexp constants (such as @code{/foo/}) may be used like simple expressions. When a regexp constant appears by itself, it has the same meaning as if it appeared -in a pattern, i.e., @samp{($0 ~ /foo/)} +in a pattern (i.e., @samp{($0 ~ /foo/)}). @value{DARKCORNER} @xref{Expression Patterns}. This means that the following two code segments: @@ -10352,7 +10354,7 @@ either @code{sub()} or @code{gsub()}. However, what really happens is that the @code{pat} parameter is 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, since passing a truth value in +a parameter to a user-defined function, because passing a truth value in this way is probably not what was intended. @c ENDOFRANGE rec @@ -10392,7 +10394,7 @@ variable's current value. Variables are given new values with @dfn{decrement operators}. @xref{Assignment Ops}. In addition, the @code{sub()} and @code{gsub()} functions can -change a variable's value, and the @code{match()}, @code{split()} +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}. @@ -10400,7 +10402,7 @@ array parameters. @xref{String Functions}. @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 -record). @xref{Built-in Variables}, for a list of the predefined variables. +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 @command{awk}. All predefined variables' names are entirely uppercase. @@ -10441,7 +10443,7 @@ as in the following: the variable is set at the very beginning, even before the @code{BEGIN} rules execute. The @option{-v} option and its assignment must precede all the @value{FN} arguments, as well as the program text. -(@xref{Options}, for more information about +(@DBXREF{Options} for more information about the @option{-v} option.) Otherwise, the variable assignment is performed at a time determined by its position among the input file arguments---after the processing of the @@ -10481,7 +10483,7 @@ sequences @node Conversion @subsection Conversion of Strings and Numbers -Number to string and string to number conversion are generally +Number-to-string and string-to-number conversion are generally straightforward. There can be subtleties to be aware of; this @value{SECTION} discusses this important facet of @command{awk}. @@ -10492,7 +10494,7 @@ this @value{SECTION} discusses this important facet of @command{awk}. @end menu @node Strings And Numbers -@subsubsection How @command{awk} Converts Between Strings And Numbers +@subsubsection How @command{awk} Converts Between Strings and Numbers @cindex converting, strings to numbers @cindex strings, converting @@ -10523,7 +10525,7 @@ string, concatenate that number with the empty string, @code{""}. To force a string to be converted to a number, add zero to that string. A string is converted to a number by interpreting any numeric prefix of the string as numerals: -@code{"2.5"} converts to 2.5, @code{"1e3"} converts to 1000, and @code{"25fix"} +@code{"2.5"} converts to 2.5, @code{"1e3"} converts to 1,000, and @code{"25fix"} has a numeric value of 25. Strings that can't be interpreted as valid numbers convert to zero. @@ -10563,7 +10565,7 @@ b = a "" @code{b} has the value @code{"12"}, not @code{"12.00"}. @value{DARKCORNER} -@sidebar Pre-POSIX @command{awk} Used @code{OFMT} For String Conversion +@sidebar Pre-POSIX @command{awk} Used @code{OFMT} for String Conversion @cindex POSIX @command{awk}, @code{OFMT} variable and @cindex @code{OFMT} variable @cindex portability, new @command{awk} vs.@: old @command{awk} @@ -10575,7 +10577,7 @@ specifies the output format to use when printing numbers with @code{print}. conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. -@xref{Print}, for more information on the @code{print} statement. +@DBXREF{Print} for more information on the @code{print} statement. @end sidebar @node Locale influences conversions @@ -10597,7 +10599,7 @@ The POSIX standard says that @command{awk} always uses the period as the decimal point when reading the @command{awk} program source code, and for command-line variable assignments (@pxref{Other Arguments}). However, when interpreting input data, for @code{print} and @code{printf} output, -and for number to string conversion, the local decimal point character +and for number-to-string conversion, the local decimal point character is used. @value{DARKCORNER} In all cases, numbers in source code and in input data cannot have a thousands separator. Here are some examples indicating the difference in behavior, on a GNU/Linux system: @@ -10622,7 +10624,7 @@ as the full number including the fractional part, 4.321. Some earlier versions of @command{gawk} fully complied with this aspect of the standard. However, many users in non-English locales complained -about this behavior, since their data used a period as the decimal +about this behavior, because their data used a period as the decimal 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 @@ -10635,7 +10637,7 @@ point character is used and when a period is used. Some of these features have not been described yet. @float Table,table-locale-affects -@caption{Locale Decimal Point versus A Period} +@caption{Locale decimal point versus a period} @multitable @columnfractions .15 .20 .45 @headitem Feature @tab Default @tab @option{--posix} or @option{--use-lc-numeric} @item @code{%'g} @tab Use locale @tab Use locale @@ -10645,13 +10647,13 @@ 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 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}. @node All Operators -@section Operators: Doing Something With Values +@section Operators: Doing Something with Values This @value{SECTION} introduces the @dfn{operators} which make use of the values provided by constants and variables. @@ -10730,7 +10732,7 @@ Multiplication. Division; because all numbers in @command{awk} are floating-point numbers, the result is @emph{not} rounded to an integer---@samp{3 / 4} has the value 0.75. (It is a common mistake, especially for C programmers, -to forget that @emph{all} numbers in @command{awk} are floating-point, +to forget that @emph{all} numbers in @command{awk} are floating point, and that division of integer-looking constants produces a real number, not an integer.) @@ -10815,7 +10817,7 @@ $ @kbd{awk '@{ print "Field number one:" $1 @}' mail-list} @cindex troubleshooting, string concatenation Because string concatenation does not have an explicit operator, it is -often necessary to insure that it happens at the right time by using +often necessary to ensure that it happens at the right time by using parentheses to enclose the items to concatenate. For example, you might expect that the following code fragment concatenates @code{file} and @code{name}: @@ -11077,7 +11079,11 @@ The indices of @code{bar} are practically guaranteed to be different, because @code{rand()} returns different values each time it is called. (Arrays and the @code{rand()} function haven't been covered yet. @xref{Arrays}, -and see @ref{Numeric Functions}, for more information). +and +@ifnotdocbook +see +@end ifnotdocbook +@DBREF{Numeric Functions} for more information). This example illustrates an important fact about assignment operators: the lefthand expression is only evaluated @emph{once}. @@ -11110,20 +11116,20 @@ to a number. @cindex @code{*} (asterisk), @code{**=} operator @cindex asterisk (@code{*}), @code{**=} operator @float Table,table-assign-ops -@caption{Arithmetic Assignment Operators} +@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} @value{COMMONEXT} @end multitable @end float @@ -11206,7 +11212,7 @@ but with the side effect of incrementing it. The post-increment @samp{foo++} is nearly the same as writing @samp{(foo += 1) - 1}. It is not perfectly equivalent because all numbers in -@command{awk} are floating-point---in floating-point, @samp{foo + 1 - 1} does +@command{awk} are floating point---in floating point, @samp{foo + 1 - 1} does not necessarily equal @code{foo}. But the difference is minute as long as you stick to numbers that are fairly small (less than @iftex @@ -11311,8 +11317,8 @@ You should avoid such things in your own programs. @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. @@ -11368,7 +11374,7 @@ the string constant @code{"0"} is actually true, because it is non-null. @subsection Variable Typing and Comparison Expressions @quotation @i{The Guide is definitive. Reality is frequently inaccurate.} -@author The Hitchhiker's Guide to the Galaxy +@author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy} @end quotation @c STARTOFRANGE comex @@ -11396,7 +11402,7 @@ compares variables. @end menu @node Variable Typing -@subsubsection String Type Versus Numeric Type +@subsubsection String Type versus Numeric Type @cindex numeric, strings @cindex strings, numeric @@ -11422,7 +11428,7 @@ 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 +@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. @@ -11623,18 +11629,18 @@ operators}, which are a superset of those in C. @cindex exclamation point (@code{!}), @code{!~} operator @cindex @code{in} operator @float Table,table-relational-ops -@caption{Relational Operators} +@caption{Relational operators} @multitable @columnfractions .25 .75 @headitem Expression @tab Result -@item @var{x} @code{<} @var{y} @tab True if @var{x} is less than @var{y}. -@item @var{x} @code{<=} @var{y} @tab True if @var{x} is less than or equal to @var{y}. -@item @var{x} @code{>} @var{y} @tab True if @var{x} is greater than @var{y}. -@item @var{x} @code{>=} @var{y} @tab True if @var{x} is greater than or equal to @var{y}. -@item @var{x} @code{==} @var{y} @tab True if @var{x} is equal to @var{y}. -@item @var{x} @code{!=} @var{y} @tab True if @var{x} is not equal to @var{y}. -@item @var{x} @code{~} @var{y} @tab True if the string @var{x} matches the regexp denoted by @var{y}. -@item @var{x} @code{!~} @var{y} @tab True if the string @var{x} does not match the regexp denoted by @var{y}. -@item @var{subscript} @code{in} @var{array} @tab True if the array @var{array} has an element with the subscript @var{subscript}. +@item @var{x} @code{<} @var{y} @tab True if @var{x} is less than @var{y} +@item @var{x} @code{<=} @var{y} @tab True if @var{x} is less than or equal to @var{y} +@item @var{x} @code{>} @var{y} @tab True if @var{x} is greater than @var{y} +@item @var{x} @code{>=} @var{y} @tab True if @var{x} is greater than or equal to @var{y} +@item @var{x} @code{==} @var{y} @tab True if @var{x} is equal to @var{y} +@item @var{x} @code{!=} @var{y} @tab True if @var{x} is not equal to @var{y} +@item @var{x} @code{~} @var{y} @tab True if the string @var{x} matches the regexp denoted by @var{y} +@item @var{x} @code{!~} @var{y} @tab True if the string @var{x} does not match the regexp denoted by @var{y} +@item @var{subscript} @code{in} @var{array} @tab True if the array @var{array} has an element with the subscript @var{subscript} @end multitable @end float @@ -11672,24 +11678,24 @@ The following list of expressions illustrates the kinds of comparisons @table @code @item 1.5 <= 2.0 -numeric comparison (true) +Numeric comparison (true) @item "abc" >= "xyz" -string comparison (false) +String comparison (false) @item 1.5 != " +2" -string comparison (true) +String comparison (true) @item "1e2" < "3" -string comparison (true) +String comparison (true) @item a = 2; b = "2" @itemx a == b -string comparison (true) +String comparison (true) @item a = 2; b = " +2" @itemx a == b -string comparison (false) +String comparison (false) @end table In this example: @@ -11742,7 +11748,7 @@ dynamic regexp (@pxref{Regexp Usage}; also @cindex @command{awk}, regexp constants and @cindex regexp constants A constant regular -expression in slashes by itself is also an expression. The regexp +expression in slashes by itself is also an expression. @code{/@var{regexp}/} is an abbreviation for the following comparison expression: @example @@ -11756,7 +11762,7 @@ One special place where @code{/foo/} is @emph{not} an abbreviation for where this is discussed in more detail. @node POSIX String Comparison -@subsubsection String Comparison With POSIX Rules +@subsubsection String Comparison with POSIX Rules The POSIX standard says that string comparison is performed based on the locale's @dfn{collating order}. This is the order in which @@ -12012,13 +12018,13 @@ 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 available in every @command{awk} program. The @code{sqrt()} function is one -of these. @xref{Built-in}, for a list of built-in +of these. @DBXREF{Built-in} for a list of built-in functions and their descriptions. In addition, you can define functions for use in your program. -@xref{User-defined}, +@DBXREF{User-defined} for instructions on how to do this. Finally, @command{gawk} lets you write functions in C or C++ -that may be called from your program: see @ref{Dynamic Extensions}. +that may be called from your program (@pxref{Dynamic Extensions}). @cindex arguments, in function calls The way to use a function is with a @dfn{function call} expression, @@ -12037,7 +12043,7 @@ rand() @ii{no arguments} @cindex troubleshooting, function call syntax @quotation CAUTION -Do not put any space between the function name and the open-parenthesis! +Do not put any space between the function name and the opening parenthesis! A user-defined function name looks just like the name of a variable---a space would make the expression look like concatenation of a variable with an expression inside parentheses. @@ -12058,7 +12064,7 @@ Some of the built-in functions have one or more optional arguments. If those arguments are not supplied, the functions use a reasonable default value. -@xref{Built-in}, for full details. If arguments +@DBXREF{Built-in} for full details. If arguments are omitted in calls to user-defined functions, then those arguments are treated as local variables. Such local variables act like the empty string if referenced where a string value is required, @@ -12213,7 +12219,7 @@ Multiplication, division, remainder. @item @code{+ -} Addition, subtraction. -@item String Concatenation +@item String concatenation There is no special symbol for concatenation. The operands are simply written side by side (@pxref{Concatenation}). @@ -12252,7 +12258,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 (for example, @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)}. @@ -12310,7 +12316,7 @@ For maximum portability, do not use them. @c ENDOFRANGE oppr @node Locales -@section Where You Are Makes A Difference +@section Where You Are Makes a Difference @cindex locale, definition of Modern systems support the notion of @dfn{locales}: a way to tell the @@ -12330,7 +12336,7 @@ character}, to find the record terminator. Locales can affect how dates and times are formatted (@pxref{Time Functions}). For example, a common way to abbreviate the date September -4, 2015 in the United States is ``9/4/15.'' In many countries in +4, 2015, in the United States is ``9/4/15.'' In many countries in Europe, however, it is abbreviated ``4.9.15.'' Thus, the @code{%x} specification in a @code{"US"} locale might produce @samp{9/4/15}, while in a @code{"EUROPE"} locale, it might produce @samp{4.9.15}. @@ -12349,13 +12355,13 @@ in @ref{Conversion}. @itemize @value{BULLET} @item Expressions are the basic elements of computation in programs. They are -built from constants, variables, function calls and combinations of the +built from constants, variables, function calls, and combinations of the various kinds of values with operators. @item @command{awk} supplies three kinds of constants: numeric, string, and regexp. @command{gawk} lets you specify numeric constants in octal -and hexadecimal (bases 8 and 16) in addition to decimal (base 10). +and hexadecimal (bases 8 and 16) as well as decimal (base 10). In certain contexts, a standalone regexp constant such as @code{/foo/} has the same meaning as @samp{$0 ~ /foo/}. @@ -12397,8 +12403,8 @@ or numeric). Function calls return a value which 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 later on in this -@value{DOCUMENT}. +built-in and user-defined functions; this is described in +@ref{Functions}. @item Operator precedence specifies the order in which operations are performed, @@ -12611,7 +12617,7 @@ The subexpressions of a Boolean operator in a pattern can be constant regular expressions, comparisons, or any other @command{awk} expressions. Range patterns are not expressions, so they cannot appear inside Boolean patterns. Likewise, the special patterns @code{BEGIN}, @code{END}, -@code{BEGINFILE} and @code{ENDFILE}, +@code{BEGINFILE}, and @code{ENDFILE}, which never match any input record, are not expressions and cannot appear inside Boolean patterns. @@ -12722,7 +12728,7 @@ They supply startup and cleanup actions for @command{awk} programs. @code{BEGIN} and @code{END} rules must have actions; there is no default action for these rules because there is no current record when they run. @code{BEGIN} and @code{END} rules are often referred to as -``@code{BEGIN} and @code{END} blocks'' by long-time @command{awk} +``@code{BEGIN} and @code{END} blocks'' by longtime @command{awk} programmers. @menu @@ -12753,7 +12759,7 @@ $ @kbd{awk '} This program finds the number of records in the input file @file{mail-list} that contain the string @samp{li}. The @code{BEGIN} rule prints a title for the report. There is no need to use the @code{BEGIN} rule to -initialize the counter @code{n} to zero, since @command{awk} does this +initialize the counter @code{n} to zero, as @command{awk} does this automatically (@pxref{Variables}). The second rule increments the variable @code{n} every time a record containing the pattern @samp{li} is read. The @code{END} rule @@ -12781,7 +12787,7 @@ The order in which library functions are named on the command line controls the order in which their @code{BEGIN} and @code{END} rules are executed. Therefore, you have to be careful when writing such rules in library files so that the order in which they are executed doesn't matter. -@xref{Options}, for more information on +@DBXREF{Options} for more information on using library functions. @xref{Library Functions}, for a number of useful library functions. @@ -12830,11 +12836,11 @@ of Unix @command{awk} do not. The third point follows from the first two. The meaning of @samp{print} inside a @code{BEGIN} or @code{END} rule is the same as always: @samp{print $0}. If @code{$0} is the null string, then this prints an -empty record. Many long time @command{awk} programmers use an unadorned +empty record. Many longtime @command{awk} programmers use an unadorned @samp{print} in @code{BEGIN} and @code{END} rules, to mean @samp{@w{print ""}}, relying on @code{$0} being null. Although one might generally get away with this in @code{BEGIN} rules, it is a very bad idea in @code{END} rules, -at least in @command{gawk}. It is also poor style, since if an empty +at least in @command{gawk}. It is also poor style, because if an empty line is needed in the output, the program should print one explicitly. @cindex @code{next} statement, @code{BEGIN}/@code{END} patterns and @@ -12844,9 +12850,12 @@ line is needed in the output, the program should print one explicitly. Finally, the @code{next} and @code{nextfile} statements are not allowed in a @code{BEGIN} rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements -are not valid in an @code{END} rule, since all the input has been read. -(@xref{Next Statement}, and see -@ref{Nextfile Statement}.) +are not valid in an @code{END} rule, because all the input has been read. +(@DBXREF{Next Statement} and +@ifnotdocbook +see +@end ifnotdocbook +@DBREF{Nextfile Statement}.) @c ENDOFRANGE beg @c ENDOFRANGE end @@ -12999,9 +13008,9 @@ 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 messy. It requires a good understanding of the shell's quoting rules @@ -13030,7 +13039,7 @@ The assignment @samp{-v pat="$pattern"} still requires double quotes, in case there is whitespace in the value of @code{$pattern}. The @command{awk} variable @code{pat} could be named @code{pattern} too, but that would be more confusing. Using a variable also -provides more flexibility, since the variable can be used anywhere inside +provides more flexibility, as the variable can be used anywhere inside the program---for printing, as an array subscript, or for any other use---without requiring the quoting tricks at every point in the program. @@ -13103,7 +13112,7 @@ is used in order to put several statements together in the body of an Use the @code{getline} command (@pxref{Getline}). Also supplied in @command{awk} are the @code{next} -statement (@pxref{Next Statement}), +statement (@pxref{Next Statement}) and the @code{nextfile} statement (@pxref{Nextfile Statement}). @@ -13191,7 +13200,7 @@ else print "x is odd" @end example -In this example, if the expression @samp{x % 2 == 0} is true (that is, +In this example, if the expression @samp{x % 2 == 0} is true (i.e., if the value of @code{x} is evenly divisible by two), then the first @code{print} statement is executed; otherwise, the second @code{print} statement is executed. @@ -13270,7 +13279,7 @@ 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 +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. @@ -28944,7 +28953,7 @@ Print a backtrace of all function calls (stack frames), or innermost @var{count} frames if @var{count} > 0. Print the outermost @var{count} frames if @var{count} < 0. The backtrace displays the name and arguments to each function, the source @value{FN}, and the line number. -The alias @code{where} for @code{backtrace} is provided for long-time +The alias @code{where} for @code{backtrace} is provided for longtime GDB users who may be used to that command. @cindex debugger commands, @code{down} -- cgit v1.2.3 From 67557ccd7bfedd6656394c42b367493f6eba0bdb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 10 Nov 2014 06:22:54 +0200 Subject: Copyedits. --- NOTES | 2 +- doc/gawktexi.in | 163 ++++++++++++++++++++++++++++++++------------------------ 2 files changed, 94 insertions(+), 71 deletions(-) diff --git a/NOTES b/NOTES index 7e707c83..00eec27c 100644 --- a/NOTES +++ b/NOTES @@ -16,4 +16,4 @@ C heads - I have not lowercased them; this would be incorrect for the Texinfo, so I've marked them as Rejected but with a reply in the PDF to please do this during production. -At page 149, before 'the do-while statement'. +At page 191. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index ba355aaf..3069d4b3 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -11081,9 +11081,12 @@ The indices of @code{bar} are practically guaranteed to be different, because @xref{Arrays}, and @ifnotdocbook -see +@DBPXREF{Numeric Functions} @end ifnotdocbook -@DBREF{Numeric Functions} for more information). +@ifdocbook +@DBREF{Numeric Functions} +@end ifdocbook +for more information). This example illustrates an important fact about assignment operators: the lefthand expression is only evaluated @emph{once}. @@ -12853,9 +12856,11 @@ read-a-record-and-match-against-the-rules loop has not started yet. Similarly, are not valid in an @code{END} rule, because all the input has been read. (@DBXREF{Next Statement} and @ifnotdocbook -see +@DBPXREF{Nextfile Statement}.) @end ifnotdocbook +@ifdocbook @DBREF{Nextfile Statement}.) +@end ifdocbook @c ENDOFRANGE beg @c ENDOFRANGE end @@ -13326,7 +13331,7 @@ The following is an example of a @code{do} statement: @noindent This program prints each input record 10 times. However, it isn't a very -realistic example, since in this case an ordinary @code{while} would do +realistic example, because in this case an ordinary @code{while} would do just as well. This situation reflects actual experience; only occasionally is there a real use for a @code{do} statement. @@ -13423,7 +13428,7 @@ very common in loops. It can be easier to think of this counting as part of looping rather than as something to do inside the loop. @cindex @code{in} operator -There is an alternate version of the @code{for} loop, for iterating over +There is an alternative version of the @code{for} loop, for iterating over all the indices of an array: @example @@ -13432,7 +13437,7 @@ for (i in array) @end example @noindent -@xref{Scanning an Array}, +@DBXREF{Scanning an Array} for more information on this version of the @code{for} loop. @node Switch Statement @@ -13499,9 +13504,9 @@ while ((c = getopt(ARGC, ARGV, "aksx")) != -1) @{ @} @end example -Note that if none of the statements specified above halt execution +Note that if none of the statements specified here halt execution of a matched @code{case} statement, execution falls through to the -next @code{case} until execution halts. In the above example, the +next @code{case} until execution halts. In this example, the @code{case} for @code{"?"} falls through to the @code{default} case, which is to call a function named @code{usage()}. (The @code{getopt()} function being called here is @@ -13628,7 +13633,7 @@ BEGIN @{ @end example @noindent -This program loops forever once @code{x} reaches 5, since +This program loops forever once @code{x} reaches 5, because the increment (@samp{x++}) is never reached. @c @cindex @code{continue}, outside of loops @@ -13689,7 +13694,7 @@ Because of the @code{next} statement, the program's subsequent rules won't see the bad record. The error message is redirected to the standard error output stream, as error messages should be. -For more detail see +For more detail, see @ref{Special Files}. If the @code{next} statement causes the end of the input to be reached, @@ -13755,7 +13760,7 @@ rule to skip over a file that would otherwise cause @command{gawk} to exit with a fatal error. In this case, @code{ENDFILE} rules are not executed. @xref{BEGINFILE/ENDFILE}. -While one might think that @samp{close(FILENAME)} would accomplish +Although it might seem that @samp{close(FILENAME)} would accomplish the same as @code{nextfile}, this isn't true. @code{close()} is reserved for closing files, pipes, and coprocesses that are opened with redirections. It is not related to the main processing that @@ -13763,7 +13768,7 @@ opened with redirections. It is not related to the main processing that @quotation NOTE For many years, @code{nextfile} was a -common extension. In September, 2012, it was accepted for +common extension. In September 2012, it was accepted for inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=607, the Austin Group website}. @end quotation @@ -13812,7 +13817,7 @@ 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 the @code{END} rule. -@xref{Assert Function}, +@DBXREF{Assert Function} for an example that does this. @cindex dark corner, @code{exit} statement @@ -13823,7 +13828,7 @@ In the case where an argument is supplied to a first @code{exit} statement, and then @code{exit} is called a second time from an @code{END} rule with no argument, @command{awk} uses the previously supplied exit value. @value{DARKCORNER} -@xref{Exit Status}, for more information. +@DBXREF{Exit Status} for more information. @cindex programming conventions, @code{exit} statement For example, suppose an error condition occurs that is difficult or @@ -13883,7 +13888,7 @@ their areas of activity. @end menu @node User-modified -@subsection Built-in Variables That Control @command{awk} +@subsection Built-In Variables That Control @command{awk} @c STARTOFRANGE bvaru @cindex predefined variables, user-modifiable @c STARTOFRANGE nmbv @@ -13940,7 +13945,7 @@ A space-separated list of columns that tells @command{gawk} how to split input with fixed columnar boundaries. Assigning a value to @code{FIELDWIDTHS} overrides the use of @code{FS} and @code{FPAT} for field splitting. -@xref{Constant Size}, for more information. +@DBXREF{Constant Size} for more information. @cindex @command{gawk}, @code{FPAT} variable in @cindex @code{FPAT} variable @@ -13952,7 +13957,7 @@ A regular expression (as a string) that tells @command{gawk} to create the fields based on text that matches the regular expression. Assigning a value to @code{FPAT} overrides the use of @code{FS} and @code{FIELDWIDTHS} for field splitting. -@xref{Splitting By Content}, for more information. +@DBXREF{Splitting By Content} for more information. @cindex @code{FS} variable @cindex separators, field @@ -14062,12 +14067,12 @@ character. (@xref{Output Separators}.) @cindex @code{PREC} variable @item PREC # -The working precision of arbitrary precision floating-point numbers, +The working precision of arbitrary-precision floating-point numbers, 53 bits by default (@pxref{Setting precision}). @cindex @code{ROUNDMODE} variable @item ROUNDMODE # -The rounding mode to use for arbitrary precision arithmetic on +The rounding mode to use for arbitrary-precision arithmetic on numbers, by default @code{"N"} (@samp{roundTiesToEven} in the IEEE 754 standard; @pxref{Setting the rounding mode}). @@ -14109,7 +14114,7 @@ really accesses @code{foo["A\034B"]} Used for internationalization of programs at the @command{awk} level. It sets the default text domain for specially marked string constants in the source text, as well as for the -@code{dcgettext()}, @code{dcngettext()} and @code{bindtextdomain()} functions +@code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()} functions (@pxref{Internationalization}). The default value of @code{TEXTDOMAIN} is @code{"messages"}. @end table @@ -14119,7 +14124,7 @@ The default value of @code{TEXTDOMAIN} is @code{"messages"}. @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 @@ -14132,7 +14137,7 @@ information to your program. The variables that are specific to @command{gawk} are marked with a pound sign (@samp{#}). These variables are @command{gawk} extensions. In other @command{awk} implementations or if @command{gawk} is in compatibility -mode (@pxref{Options}), they are not special. +mode (@pxref{Options}), they are not special: @c @asis for docbook @table @asis @@ -14173,7 +14178,7 @@ method of accessing command-line arguments. The value of @code{ARGV[0]} can vary from system to system. Also, you should note that the program text is @emph{not} included in @code{ARGV}, nor are any of @command{awk}'s command-line options. -@xref{ARGC and ARGV}, for information +@DBXREF{ARGC and ARGV} for information about how @command{awk} uses these variables. @value{DARKCORNER} @@ -14211,8 +14216,13 @@ Some operating systems may not have environment variables. On such systems, the @code{ENVIRON} array is empty (except for @w{@code{ENVIRON["AWKPATH"]}} and @w{@code{ENVIRON["AWKLIBPATH"]}}; -@pxref{AWKPATH Variable}, and +@DBPXREF{AWKPATH Variable} and +@ifdocbook +@DBREF{AWKLIBPATH Variable}). +@end ifdocbook +@ifnotdocbook @pxref{AWKLIBPATH Variable}). +@end ifnotdocbook @cindex @command{gawk}, @code{ERRNO} variable in @cindex @code{ERRNO} variable @@ -14241,7 +14251,7 @@ The name of the current input file. When no @value{DF}s are listed on the command line, @command{awk} reads from the standard input and @code{FILENAME} is set to @code{"-"}. @code{FILENAME} changes each time a new file is read (@pxref{Reading Files}). Inside a @code{BEGIN} -rule, the value of @code{FILENAME} is @code{""}, since there are no input +rule, the value of @code{FILENAME} is @code{""}, because there are no input files being processed yet.@footnote{Some early implementations of Unix @command{awk} initialized @code{FILENAME} to @code{"-"}, even if there were @value{DF}s to be processed. This behavior was incorrect and should @@ -14273,7 +14283,7 @@ current record. @xref{Changing Fields}. @cindex differences in @command{awk} and @command{gawk}, @code{FUNCTAB} variable @item @code{FUNCTAB #} An array whose indices and corresponding values are the names of all -the built-in, user-defined and extension functions in the program. +the built-in, user-defined, and extension functions in the program. @quotation NOTE Attempting to use the @code{delete} statement with the @code{FUNCTAB} @@ -14367,7 +14377,7 @@ The parent process ID of the current process. If this element exists in @code{PROCINFO}, its value controls the order in which array indices will be processed by @samp{for (@var{indx} in @var{array})} loops. -Since this is an advanced feature, we defer the +This is an advanced feature, so we defer the full description until later; see @ref{Scanning an Array}. @@ -14387,7 +14397,7 @@ The version of @command{gawk}. The following additional elements in the array are available to provide information about the MPFR and GMP libraries -if your version of @command{gawk} supports arbitrary precision arithmetic +if your version of @command{gawk} supports arbitrary-precision arithmetic (@pxref{Arbitrary Precision Arithmetic}): @table @code @@ -14438,7 +14448,7 @@ The @code{PROCINFO} array has the following additional uses: @item It may be used to provide a timeout when reading from any open input file, pipe, or coprocess. -@xref{Read Timeout}, for more information. +@DBXREF{Read Timeout} for more information. @item It may be used to cause coprocesses to communicate over pseudo-ttys @@ -14637,8 +14647,14 @@ use the @code{delete} statement to remove elements from All of these actions are typically done in the @code{BEGIN} rule, before actual processing of the input begins. -@xref{Split Program}, and see -@ref{Tee Program}, for examples +@DBXREF{Split Program} and +@ifnotdocbook +@DBPXREF{Tee Program} +@end ifnotdocbook +@ifdocbook +@DBREF{Tee Program} +@end ifdocbook +for examples of each way of removing elements from @code{ARGV}. To actually get options into an @command{awk} program, @@ -14650,7 +14666,7 @@ awk -f myprog.awk -- -v -q file1 file2 @dots{} @end example The following fragment processes @code{ARGV} in order to examine, and -then remove, the above command-line options: +then remove, the previously mentioned command-line options: @example BEGIN @{ @@ -14686,14 +14702,21 @@ gawk -f myprog.awk -q -v file1 file2 @dots{} @noindent Because @option{-q} is not a valid @command{gawk} option, it and the following @option{-v} are passed on to the @command{awk} program. -(@xref{Getopt Function}, for an @command{awk} library function that +(@DBXREF{Getopt Function} for an @command{awk} library function that parses command-line options.) When designing your program, you should choose options that don't -conflict with @command{gawk}'s, since it will process any options +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 -(@pxref{Executable Scripts}, and @pxref{Options}). +(@DBXREF{Executable Scripts} +and +@ifnotdocbook +@DBPXREF{Options}). +@end ifnotdocbook +@ifdocbook +@DBREF{Options}). +@end ifdocbook @node Pattern Action Summary @section Summary @@ -14859,7 +14882,7 @@ as shown in @inlineraw{docbook, }: @ifnotdocbook @float Figure,figure-array-elements -@caption{A Contiguous Array} +@caption{A contiguous array} @ifinfo @center @image{array-elements, , , Basic Program Stages, txt} @end ifinfo @@ -14871,7 +14894,7 @@ as shown in @inlineraw{docbook, }: @docbook
-A Contiguous Array +A contiguous array @@ -14890,7 +14913,7 @@ position with zero elements before it. @cindex associative arrays @cindex arrays, associative Arrays in @command{awk} are different---they are @dfn{associative}. This means -that each array is a collection of pairs: an index and its corresponding +that each array is a collection of pairs---an index and its corresponding array element value: @ifnotdocbook @@ -15071,7 +15094,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, since @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 @@ -15156,7 +15179,7 @@ This expression tests whether the particular index @var{indx} exists, without the side effect of creating that element if it is not present. The expression has the value one (true) if @code{@var{array}[@var{indx}]} exists and zero (false) if it does not exist. -(We use @var{indx} here, since @samp{index} is the name of a built-in +(We use @var{indx} here, because @samp{index} is the name of a built-in function.) For example, this statement tests whether the array @code{frequencies} contains the index @samp{2}: @@ -15299,7 +15322,7 @@ the word as 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. -@xref{String Functions}, +@DBXREF{String Functions} for more information on the built-in function @code{length()}. @example @@ -15322,7 +15345,7 @@ END @{ @end example @noindent -@xref{Word Sorting}, +@DBXREF{Word Sorting} for a more detailed example of this type. @cindex arrays, elements, order of access by @code{in} operator @@ -15377,7 +15400,7 @@ $ @kbd{nawk -f loopcheck.awk} @end example @node Controlling Scanning -@subsection Using Predefined Array Scanning Orders With @command{gawk} +@subsection Using Predefined Array Scanning Orders with @command{gawk} This @value{SUBSECTION} describes a feature that is specific to @command{gawk}. @@ -15402,7 +15425,7 @@ We describe this now. @item Set @code{PROCINFO["sorted_in"]} to the name of a user-defined function to use for comparison of array elements. This advanced feature -is described later, in @ref{Array Sorting}. +is described later in @ref{Array Sorting}. @end itemize @cindex @code{PROCINFO}, values of @code{sorted_in} @@ -15501,7 +15524,7 @@ and all subarrays are treated as being equal to each other. Their order relative to each other is determined by their index strings. Here are some additional things to bear in mind about sorted -array traversal. +array traversal: @itemize @value{BULLET} @item @@ -15521,7 +15544,7 @@ if (save_sorted) @end example @item -As mentioned, the default array traversal order is represented by +As already mentioned, the default array traversal order is represented by @code{"@@unsorted"}. You can also get the default behavior by assigning the null string to @code{PROCINFO["sorted_in"]} or by just deleting the @code{"sorted_in"} element from the @code{PROCINFO} array with @@ -15566,7 +15589,7 @@ The program then changes the value of @code{CONVFMT}. The test @samp{(xyz in data)} generates a new string value from @code{xyz}---this time @code{"12.15"}---because the value of @code{CONVFMT} only allows two significant digits. This test fails, -since @code{"12.15"} is different from @code{"12.153"}. +because @code{"12.15"} is different from @code{"12.153"}. @cindex converting integer array subscripts @cindex integer array indices @@ -15584,19 +15607,19 @@ for (i = 1; i <= maxsub; i++) The ``integer values always convert to strings as integers'' rule has an additional consequence for array indexing. Octal and hexadecimal constants +@ifnotdocbook (@pxref{Nondecimal-numbers}) +@end ifnotdocbook +@ifdocbook +(covered in @pref{Nondecimal-numbers}) +@end ifdocbook are converted internally into numbers, and their original form -is forgotten. -This means, for example, that -@code{array[17]}, -@code{array[021]}, -and -@code{array[0x11]} -all refer to the same element! +is forgotten. This means, for example, that @code{array[17]}, +@code{array[021]}, and @code{array[0x11]} all refer to the same element! As with many things in @command{awk}, the majority of the time things work as you would expect them to. But it is useful to have a precise -knowledge of the actual rules since they can sometimes have a subtle +knowledge of the actual rules, as they can sometimes have a subtle effect on your programs. @node Uninitialized Subscripts @@ -15739,7 +15762,7 @@ by a number of other implementations. @cindex Brian Kernighan's @command{awk} @quotation NOTE For many years, using @code{delete} without a subscript was a common -extension. In September, 2012, it was accepted for inclusion into the +extension. In September 2012, it was accepted for inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=544, the Austin Group website}. @end quotation @@ -15781,7 +15804,7 @@ a = 3 @cindex subscripts in arrays, multidimensional @cindex arrays, multidimensional -A multidimensional array is an array in which an element is identified +A @dfn{multidimensional array} is an array in which an element is identified by a sequence of indices instead of a single index. For example, a two-dimensional array requires two indices. The usual way (in many languages, including @command{awk}) to refer to an element of a @@ -15823,7 +15846,7 @@ stored as @samp{foo["a@@b@@c"]}. @cindex @code{in} operator, index existence in multidimensional arrays To test whether a particular index sequence exists in a multidimensional array, use the same operator (@code{in}) that is -used for single dimensional arrays. Write the whole sequence of indices +used for single-dimensional arrays. Write the whole sequence of indices in parentheses, separated by commas, as the left operand: @example @@ -15947,7 +15970,7 @@ 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 -separated by commas (that is, a regular @command{awk} simulated +separated by commas (i.e., a regular @command{awk} simulated multidimensional subscript). So the following is valid in @command{gawk}: @@ -15966,7 +15989,7 @@ is itself an array and not a scalar: a[4] = "An element in a jagged array" @end example -The terms @dfn{dimension}, @dfn{row} and @dfn{column} are +The terms @dfn{dimension}, @dfn{row}, and @dfn{column} are meaningless when applied to such an array, but we will use ``dimension'' henceforth to imply the maximum number of indices needed to refer to an existing element. The @@ -16064,8 +16087,8 @@ for (i in a) @{ @end example @noindent -@xref{Walking Arrays}, for a user-defined function that ``walks'' an -arbitrarily-dimensioned array of arrays. +@DBXREF{Walking Arrays} for a user-defined function that ``walks'' an +arbitrarily dimensioned array of arrays. Recall that a reference to an uninitialized array element yields a value of @code{""}, the null string. This has one important implication when you @@ -16115,8 +16138,9 @@ special predefined values to @code{PROCINFO["sorted_in"]}. @item Use @samp{delete @var{array}[@var{indx}]} to delete an individual element. -You may also use @samp{delete @var{array}} to delete all of the elements -in the array. This latter feature has been a common extension for many +To delete all of the elements in an array, +use @samp{delete @var{array}}. +This latter feature has been a common extension for many years and is now standard, but may not be supported by all commercial versions of @command{awk}. @@ -16169,7 +16193,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 @@ -16192,7 +16216,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 @@ -16202,7 +16226,7 @@ is a call to the function @code{atan2()} and has two arguments. @cindex programming conventions, functions, calling @cindex whitespace, functions@comma{} calling Whitespace is ignored between the built-in function name and the -open parenthesis, but nonetheless it is good practice to avoid using whitespace +opening parenthesis, but nonetheless it is good practice to avoid using whitespace there. User-defined functions do not permit whitespace in this way, and it is easier to avoid mistakes by following a simple convention that always works---no whitespace after a function name. @@ -16282,7 +16306,6 @@ depends on your machine's floating-point representation. @cindex round to nearest integer Return the nearest integer to @var{x}, located between @var{x} and zero and truncated toward zero. - For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)} is @minus{}3, and @code{int(-3)} is @minus{}3 as well. @@ -30470,7 +30493,7 @@ This is shown in @inlineraw{docbook, }. @ifnotdocbook @float Figure,figure-load-extension -@caption{Loading The Extension} +@caption{Loading the extension} @c FIXME: One day, it should not be necessary to have two cases, @c but rather just the one without the "txt" final argument. @c This applies to the other figures as well. @@ -30485,7 +30508,7 @@ This is shown in @inlineraw{docbook, }. @docbook
-Loading The Extension +Loading the extension -- cgit v1.2.3 From b027c0d5d49cddfb46565d2d572ecf3828b80b1a Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 11 Nov 2014 06:22:26 +0200 Subject: Copyedits. --- NOTES | 2 +- doc/gawktexi.in | 170 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 87 insertions(+), 85 deletions(-) diff --git a/NOTES b/NOTES index 00eec27c..85b8fda9 100644 --- a/NOTES +++ b/NOTES @@ -16,4 +16,4 @@ C heads - I have not lowercased them; this would be incorrect for the Texinfo, so I've marked them as Rejected but with a reply in the PDF to please do this during production. -At page 191. +At page 222. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 3069d4b3..01fa8565 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -16395,7 +16395,7 @@ for generating random numbers to the value @var{x}. Each seed value leads to a particular sequence of random numbers.@footnote{Computer-generated random numbers really are not truly random. They are technically known as ``pseudorandom.'' This means -that while the numbers in a sequence appear to be random, you can in +that although the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again.} Thus, if the seed is set to the same value a second time, the same sequence of random numbers is produced again. @@ -16445,7 +16445,7 @@ doing index calculations, particularly if you are used to C. In the following list, optional parameters are enclosed in square brackets@w{ ([ ]).} Several functions perform string substitution; the full discussion is provided in the description of the @code{sub()} function, which comes -towards the end since the list is presented alphabetically. +toward the end, because the list is presented alphabetically. Those functions that are specific to @command{gawk} are marked with a pound sign (@samp{#}). They are not available in compatibility mode @@ -16471,10 +16471,10 @@ These two functions are similar in behavior, so they are described together. @quotation NOTE -The following description ignores the third argument, @var{how}, since it +The following description ignores the third argument, @var{how}, as it requires understanding features that we have not discussed yet. Thus, the discussion here is a deliberate simplification. (We do provide all -the details later on: @xref{Array Sorting Functions}, for the full story.) +the details later on; see @DBREF{Array Sorting Functions} for the full story.) @end quotation Both functions return the number of elements in the array @var{source}. @@ -16721,7 +16721,7 @@ at which that substring begins (one, if it starts at the beginning of The @var{regexp} argument may be either a regexp constant (@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -16814,7 +16814,7 @@ $ @kbd{echo foooobazbarrrrr |} @end example There may not be subscripts for the start and index for every parenthesized -subexpression, since 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}). @@ -16869,7 +16869,7 @@ 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 return value of -@code{split()} (that is, the number of elements in @var{array}). +@code{split()} (i.e., the number of elements in @var{array}). The @code{split()} function splits strings into pieces in a manner similar to the way input lines are split into fields. For example: @@ -16905,7 +16905,7 @@ 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} @@ -16919,7 +16919,7 @@ the third argument to be a regexp constant (@code{/abc/}) as well as a string. @value{DARKCORNER} The POSIX standard allows this as well. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between using a string constant or a regexp constant, and the implications for writing your program correctly. @@ -16970,7 +16970,7 @@ Using the @code{strtonum()} function is @emph{not} the same as adding zero to a string value; the automatic coercion of strings to numbers works only for decimal data, not for octal or hexadecimal.@footnote{Unless you use the @option{--non-decimal-data} option, which isn't recommended. -@xref{Nondecimal Data}, for more information.} +@DBXREF{Nondecimal Data} for more information.} Note also that @code{strtonum()} uses the current locale's decimal point for recognizing numbers (@pxref{Locales}). @@ -16988,7 +16988,7 @@ Return the number of substitutions made (zero or one). The @var{regexp} argument may be either a regexp constant (@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -17174,7 +17174,7 @@ Although this makes a certain amount of sense, it can be surprising. @node Gory Details -@subsubsection More About @samp{\} and @samp{&} with @code{sub()}, @code{gsub()}, and @code{gensub()} +@subsubsection More about @samp{\} and @samp{&} with @code{sub()}, @code{gsub()}, and @code{gensub()} @cindex escape processing, @code{gsub()}/@code{gensub()}/@code{sub()} functions @cindex @code{sub()} function, escape processing @@ -17221,7 +17221,7 @@ through unchanged. This is illustrated in @ref{table-sub-escapes}. @c Thank to Karl Berry for help with the TeX stuff. @float Table,table-sub-escapes -@caption{Historical Escape Sequence Processing for @code{sub()} and @code{gsub()}} +@caption{Historical escape sequence processing for @code{sub()} and @code{gsub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -17293,7 +17293,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{GNU @command{awk} rules for @code{sub()} and backslash} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -17356,7 +17356,7 @@ by anything else is not special; the @samp{\} is placed straight into the output These rules are presented in @ref{table-posix-sub}. @float Table,table-posix-sub -@caption{POSIX Rules For @code{sub()} And @code{gsub()}} +@caption{POSIX rules for @code{sub()} and @code{gsub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -17405,12 +17405,12 @@ 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, -it continued to follow the proposed rules, since +it continued to follow the proposed rules, as that had been its behavior for many years. When @value{PVERSION} 4.0.0 was released, the @command{gawk} maintainer made the POSIX rules the default, breaking well over a decade's worth -of backwards compatibility.@footnote{This was rather naive of him, despite +of backward compatibility.@footnote{This was rather naive of him, despite there being a note in this section indicating that the next major version would move to the POSIX rules.} Needless to say, this was a bad idea, and as of @value{PVERSION} 4.0.1, @command{gawk} resumed its historical @@ -17425,7 +17425,7 @@ appears in the generated text and the @samp{\} does not, as shown in @ref{table-gensub-escapes}. @float Table,table-gensub-escapes -@caption{Escape Sequence Processing For @code{gensub()}} +@caption{Escape sequence processing for @code{gensub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -17492,7 +17492,7 @@ Optional parameters are enclosed in square brackets ([ ]): Close the file @var{filename} for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess or pipe is closed. -@xref{Close Files And Pipes}, +@DBXREF{Close Files And Pipes} for more information. When closing a coprocess, it is occasionally useful to first close @@ -17516,13 +17516,13 @@ a pipe or coprocess. @cindex buffers, flushing @cindex output, buffering -Many utility programs @dfn{buffer} their output; i.e., they save information +Many utility programs @dfn{buffer} their output (i.e., they save information to write to a disk file or the screen in memory until there is enough -for it to be worthwhile to send the data to the output device. +for it to be worthwhile to send the data to the output device). This is often more efficient than writing 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; that is, -write the information to its destination, even if a buffer is not full. +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 @command{gawk} to flush its buffers. @@ -17530,11 +17530,11 @@ buffers its output and the @code{fflush()} function forces @cindex extensions, common@comma{} @code{fflush()} function @cindex Brian Kernighan's @command{awk} Brian Kernighan added @code{fflush()} to his @command{awk} in April -of 1992. For two decades, it was a common extension. In December, +1992. For two decades, it was a common extension. In December 2012, it was accepted for inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=634, the Austin Group website}. -POSIX standardizes @code{fflush()} as follows: If there +POSIX standardizes @code{fflush()} as follows: if there is no argument, or if the argument is the null string (@w{@code{""}}), then @command{awk} flushes the buffers for @emph{all} open output files and pipes. @@ -17566,6 +17566,49 @@ a file or pipe that was opened for reading (such as with @code{getline}), or if @var{filename} is not an open file, pipe, or coprocess. 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 +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.} + +@c Thanks to Walter.Mecky@dresdnerbank.de for this example, and for +@c motivating me to write this section. +Interactive programs generally @dfn{line buffer} their output (i.e., they +write out every line). Noninteractive programs wait until they have +a full buffer, which may be many lines of output. +Here is an example of the difference: + +@example +$ @kbd{awk '@{ print $1 + $2 @}'} +@kbd{1 1} +@print{} 2 +@kbd{2 3} +@print{} 5 +@kbd{Ctrl-d} +@end example + +@noindent +Each line of output is printed immediately. Compare that behavior +with this example: + +@example +$ @kbd{awk '@{ print $1 + $2 @}' | cat} +@kbd{1 1} +@kbd{2 3} +@kbd{Ctrl-d} +@print{} 2 +@print{} 5 +@end example + +@noindent +Here, no output is printed until after the @kbd{Ctrl-d} is typed, because +it is all buffered and sent down the pipe to @command{cat} in one shot. +@end sidebar + @item @code{system(@var{command})} @cindexawkfunc{system} @cindex invoke shell command @@ -17613,49 +17656,6 @@ When @option{--sandbox} is specified, the @code{system()} function is disabled @end table -@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 -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.} - -@c Thanks to Walter.Mecky@dresdnerbank.de for this example, and for -@c motivating me to write this section. -Interactive programs generally @dfn{line buffer} their output; i.e., they -write out every line. Noninteractive programs wait until they have -a full buffer, which may be many lines of output. -Here is an example of the difference: - -@example -$ @kbd{awk '@{ print $1 + $2 @}'} -@kbd{1 1} -@print{} 2 -@kbd{2 3} -@print{} 5 -@kbd{Ctrl-d} -@end example - -@noindent -Each line of output is printed immediately. Compare that behavior -with this example: - -@example -$ @kbd{awk '@{ print $1 + $2 @}' | cat} -@kbd{1 1} -@kbd{2 3} -@kbd{Ctrl-d} -@print{} 2 -@print{} 5 -@end example - -@noindent -Here, no output is printed until after the @kbd{Ctrl-d} is typed, because -it is all buffered and sent down the pipe to @command{cat} in one shot. -@end sidebar - @sidebar Controlling Output Buffering with @code{system()} @cindex buffers, flushing @cindex buffering, input/output @@ -17674,7 +17674,7 @@ system("") # flush output @command{gawk} treats this use of the @code{system()} function as a special case and is smart enough not to run a shell (or other command interpreter) with the empty command. Therefore, with @command{gawk}, this -idiom is not only useful, it is also efficient. While this method should work +idiom is not only useful, it is also efficient. Although this method should work with other @command{awk} implementations, it does not necessarily avoid starting an unnecessary shell. (Other implementations may only flush the buffer associated with the standard output and not necessarily @@ -17813,14 +17813,14 @@ Mean Time). Otherwise, the value is formatted for the local time zone. The @var{timestamp} is in the same format as the value returned by the @code{systime()} function. If no @var{timestamp} argument is supplied, @command{gawk} uses the current time of day as the timestamp. -If no @var{format} argument is supplied, @code{strftime()} uses +Without a @var{format} argument, @code{strftime()} uses the value of @code{PROCINFO["strftime"]} as the format string (@pxref{Built-in Variables}). The default string value is @code{@w{"%a %b %e %H:%M:%S %Z %Y"}}. This format string produces output that is equivalent to that of the @command{date} utility. You can assign a new value to @code{PROCINFO["strftime"]} to -change the default format; see below for the various format directives. +change the default format; see the following list for the various format directives. @item @code{systime()} @cindexgawkfunc{systime} @@ -17897,9 +17897,9 @@ This is the ISO 8601 date format. @item %g The year modulo 100 of the ISO 8601 week number, as a decimal number (00--99). -For example, January 1, 2012 is in week 53 of 2011. Thus, the year +For example, January 1, 2012, is in week 53 of 2011. Thus, the year of its ISO 8601 week number is 2011, even though its year is 2012. -Similarly, December 31, 2012 is in week 1 of 2013. Thus, the year +Similarly, December 31, 2012, is in week 1 of 2013. Thus, the year of its ISO week number is 2013, even though its year is 2012. @item %G @@ -17995,7 +17995,7 @@ no time zone is determinable. @item %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH @itemx %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy -``Alternate representations'' for the specifications +``Alternative representations'' for the specifications that use only the second letter (@code{%c}, @code{%C}, and so on).@footnote{If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to ``internationalize'' @@ -18008,7 +18008,7 @@ Other internationalization features are described in A literal @samp{%}. @end table -If a conversion specifier is not one of the above, the behavior is +If a conversion specifier is not one of those just listed, the behavior is undefined.@footnote{This is because ISO C leaves the behavior of the C version of @code{strftime()} undefined and @command{gawk} uses the system's version of @code{strftime()} if it's there. @@ -18052,7 +18052,7 @@ The date in VMS format (e.g., @samp{20-JUN-1991}). @end table @c ENDOFRANGE strf -Additionally, the alternate representations are recognized but their +Additionally, the alternative representations are recognized but their normal representations are used. @cindex @code{date} utility, POSIX @@ -18130,8 +18130,10 @@ each successive pair of bits in the operands. Three common operations are bitwise AND, OR, and XOR. The operations are described in @ref{table-bitwise-ops}. +@c 11/2014: Postprocessing turns the docbook informaltable +@c into a table. Hurray for scripting! @float Table,table-bitwise-ops -@caption{Bitwise Operations} +@caption{Bitwise operations} @ifnottex @ifnotdocbook @display @@ -18299,7 +18301,7 @@ Return the value of @var{val}, shifted right by @var{count} bits. Return the bitwise XOR of the arguments. There must be at least two. @end table -For all of these functions, first the double precision floating-point value is +For all of these functions, first the double-precision floating-point value is converted to the widest C unsigned integer type, then the bitwise operation is performed. If the result cannot be represented exactly as a C @code{double}, leading nonzero bits are removed one by one until it can be represented @@ -18398,7 +18400,7 @@ Otherwise, a @code{"0"} is added. The value is then shifted right by one bit and the loop continues until there are no more 1 bits. -If the initial value is zero it returns a simple @code{"0"}. +If the initial value is zero, it returns a simple @code{"0"}. Otherwise, at the end, it pads the value with zeros to represent multiples of 8-bit quantities. This is typical in modern computers. @@ -18436,7 +18438,7 @@ array or not. @quotation NOTE Using @code{isarray()} at the global level to test -variables makes no sense. Since you are the one writing the program, you +variables makes no sense. Because you are the one writing the program, you are supposed to know if your variables are arrays or not. And in fact, due to the way @command{gawk} works, if you pass the name of a variable that has not been previously used to @code{isarray()}, @command{gawk} @@ -18504,7 +18506,7 @@ The default value for @var{category} is @code{"LC_MESSAGES"}. Complicated @command{awk} programs can often be simplified by defining your own functions. User-defined functions can be called just like built-in ones (@pxref{Function Calls}), but it is up to you to define -them, i.e., to tell @command{awk} what they should do. +them (i.e., to tell @command{awk} what they should do). @menu * Definition Syntax:: How to write definitions and what they mean. @@ -18643,13 +18645,13 @@ func foo() @{ a = sqrt($1) ; print a @} @end example @noindent -Instead it defines a rule that, for each record, concatenates the value +Instead, it defines a rule that, for each record, concatenates the value of the variable @samp{func} with the return value of the function @samp{foo}. If the resulting string is non-null, the action is executed. This is probably not what is desired. (@command{awk} accepts this input as syntactically valid, because functions may be used before they are defined in @command{awk} programs.@footnote{This program won't actually run, -since @code{foo()} is undefined.}) +because @code{foo()} is undefined.}) @cindex portability, functions@comma{} defining To ensure that your @command{awk} programs are portable, always use the @@ -18720,7 +18722,7 @@ The following is an example of a recursive function. It takes a string as an input parameter and returns the string in backwards order. Recursive functions must always have a test that stops the recursion. In this case, the recursion terminates when the input string is -already empty. +already empty: @c 8/2014: Thanks to Mike Brennan for the improved formulation @cindex @code{rev()} user-defined function -- cgit v1.2.3 From d4397f45eb710a3c24b7b24aa895e8b9323aff4f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 12 Nov 2014 22:29:14 +0200 Subject: Copyedits. Through Part II. --- NOTES | 15 ++-- doc/gawktexi.in | 258 +++++++++++++++++++++++++++++--------------------------- 2 files changed, 144 insertions(+), 129 deletions(-) diff --git a/NOTES b/NOTES index 85b8fda9..f4181d82 100644 --- a/NOTES +++ b/NOTES @@ -5,15 +5,20 @@ to be humorous. Page 10 - references to 'Chapter 10' and 'Chapter 11' have been left alone since they are links and I can't do it that way in texinfo anyway. -Appendices vs. Appendixes - I have left it as the former; the latter +Appendices vs. Appendixes: I have left it as the former; the latter looks totally wrong to me. -Numbers. I use the style where values from zero to nine are spelled -out and from 10 up they're written with digits. I forget what the -Chicago Manual of Style calls this. So I've rejected those changes. +Numbers: I use the style where values from zero to nine are spelled +out and from 10 up they're written with digits. (I forget what the +Chicago Manual of Style calls this.) So I've rejected those changes. C heads - I have not lowercased them; this would be incorrect for the Texinfo, so I've marked them as Rejected but with a reply in the PDF to please do this during production. -At page 222. +Literal layout blocks not being indented - I used literal layout to get +the brackets, which indicate optional stuff, in Roman. I think that if you +simply fix the style sheets to indent those blocks, we should be in better +shape. + +At page 321. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 01fa8565..65e8b8f3 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -18770,7 +18770,7 @@ function ctime(ts, format) @end example You might think that @code{ctime()} could use @code{PROCINFO["strftime"]} -for its format string. That would be a mistake, since @code{ctime()} is +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 @@ -18791,7 +18791,7 @@ the function. @end menu @node Calling A Function -@subsubsection Writing A Function Call +@subsubsection Writing a Function Call A function call consists of the function name followed by the arguments in parentheses. @command{awk} expressions are what you write in the @@ -18806,7 +18806,7 @@ foo(x y, "lose", 4 * z) @quotation CAUTION Whitespace characters (spaces and TABs) are not allowed -between the function name and the open-parenthesis of the argument list. +between the function name and the opening parenthesis of the argument list. If you write whitespace by mistake, @command{awk} might think that you mean to concatenate a variable with an expression in parentheses. However, it notices that you used a function name and not a variable name, and reports @@ -18869,7 +18869,7 @@ top's i=3 @end example If you want @code{i} to be local to both @code{foo()} and @code{bar()} do as -follows (the extra-space before @code{i} is a coding convention to +follows (the extra space before @code{i} is a coding convention to indicate that @code{i} is a local variable, not an argument): @example @@ -18949,21 +18949,16 @@ At level 2, index 2 is found in a @end example @node Pass By Value/Reference -@subsubsection Passing Function Arguments By Value Or By Reference +@subsubsection Passing Function Arguments by Value Or by Reference In @command{awk}, when you declare a function, there is no way to declare explicitly whether the arguments are passed @dfn{by value} or @dfn{by reference}. -Instead the passing convention is determined at runtime when +Instead, the passing convention is determined at runtime when the function is called according to the following rule: - -@itemize -@item -If the argument is an array variable, then it is passed by reference, -@item -Otherwise the argument is passed by value. -@end itemize +if the argument is an array variable, then it is passed by reference. +Otherwise, the argument is passed by value. @cindex call by value Passing an argument by value means that when a function is called, it @@ -19066,7 +19061,13 @@ If @option{--lint} is specified Some @command{awk} implementations generate a runtime error if you use either the @code{next} statement or the @code{nextfile} statement -(@pxref{Next Statement}, also @pxref{Nextfile Statement}) +(@pxref{Next Statement}, and +@ifdocbook +@ref{Nextfile Statement}) +@end ifdocbook +@ifnotdocbook +@pxref{Nextfile Statement}) +@end ifnotdocbook inside a user-defined function. @command{gawk} does not have this limitation. @c ENDOFRANGE fudc @@ -19122,8 +19123,8 @@ function maxelt(vec, i, ret) @noindent You call @code{maxelt()} with one argument, which is an array name. The local variables @code{i} and @code{ret} are not intended to be arguments; -while there is nothing to stop you from passing more than one argument -to @code{maxelt()}, the results would be strange. The extra space before +there is nothing to stop you from passing more than one argument +to @code{maxelt()} but the results would be strange. The extra space before @code{i} in the function parameter list indicates that @code{i} and @code{ret} are local variables. You should follow this convention when defining functions. @@ -19260,8 +19261,8 @@ variable as the @emph{name} of the function to call. @cindex indirect function calls, @code{@@}-notation @cindex function calls, indirect, @code{@@}-notation for The syntax is similar to that of a regular function call: an identifier -immediately followed by a left parenthesis, any arguments, and then -a closing right parenthesis, with the addition of a leading @samp{@@} +immediately followed by an opening parenthesis, any arguments, and then +a closing parenthesis, with the addition of a leading @samp{@@} character: @example @@ -19270,7 +19271,7 @@ result = @@the_func() # calls the sum() function @end example Here is a full program that processes the previously shown data, -using indirect function calls. +using indirect function calls: @example @c file eg/prog/indirectcall.awk @@ -19311,7 +19312,7 @@ function sum(first, last, ret, i) These two functions expect to work on fields; thus the parameters @code{first} and @code{last} indicate where in the fields to start and end. -Otherwise they perform the expected computations and are not unusual. +Otherwise they perform the expected computations and are not unusual: @example @c file eg/prog/indirectcall.awk @@ -19637,7 +19638,7 @@ functions. POSIX @command{awk} provides three kinds of built-in functions: numeric, string, and I/O. @command{gawk} provides functions that sort arrays, work with values representing time, do bit manipulation, determine variable -type (array vs.@: scalar), and internationalize and localize programs. +type (array versus scalar), and internationalize and localize programs. @command{gawk} also provides several extensions to some of standard functions, typically in the form of additional arguments. @@ -19693,7 +19694,7 @@ program. This is equivalent to function pointers in C and C++. @c ENDOFRANGE funcud @ifnotinfo -@part @value{PART2}Problem Solving With @command{awk} +@part @value{PART2}Problem Solving with @command{awk} @end ifnotinfo @ifdocbook @@ -19703,10 +19704,10 @@ It contains the following chapters: @itemize @value{BULLET} @item -@ref{Library Functions}. +@ref{Library Functions} @item -@ref{Sample Programs}. +@ref{Sample Programs} @end itemize @end ifdocbook @@ -19767,9 +19768,9 @@ and would like to contribute them to the @command{awk} user community, see @cindex portability, example programs The programs in this @value{CHAPTER} and in @ref{Sample Programs}, -freely use features that are @command{gawk}-specific. +freely use @command{gawk}-specific features. Rewriting these programs for different implementations of @command{awk} -is pretty straightforward. +is pretty straightforward: @itemize @value{BULLET} @item @@ -19839,7 +19840,7 @@ Library functions often need to have global variables that they can use to preserve state information between calls to the function---for example, @code{getopt()}'s variable @code{_opti} (@pxref{Getopt Function}). -Such variables are called @dfn{private}, since the only functions that need to +Such variables are called @dfn{private}, as the only functions that need to use them are the ones in the library. When writing a library function, you should try to choose names for your @@ -19861,10 +19862,10 @@ In addition, several of the library functions use a prefix that helps indicate what function or set of functions use the variables---for example, @code{_pw_byname()} in the user database routines (@pxref{Passwd Functions}). -This convention is recommended, since it even further decreases the +This convention is recommended, as it even further decreases the chance of inadvertent conflict among variable names. Note that this convention is used equally well for variable names and for private -function names.@footnote{While all the library routines could have +function names.@footnote{Although all the library routines could have been rewritten to use this convention, this was not done, in order to show how our own @command{awk} programming style has evolved and to provide some basis for this discussion.} @@ -19937,7 +19938,7 @@ programming use. @end menu @node Strtonum Function -@subsection Converting Strings To Numbers +@subsection Converting Strings to Numbers The @code{strtonum()} function (@pxref{String Functions}) is a @command{gawk} extension. The following function @@ -20019,7 +20020,7 @@ string. It sets @code{k} to the index in @code{"1234567"} of the current octal digit. The return value will either be the same number as the digit, or zero if the character is not there, which will be true for a @samp{0}. -This is safe, since the regexp test in the @code{if} ensures that +This is safe, because the regexp test in the @code{if} ensures that only octal values are converted. Similar logic applies to the code that checks for and converts a @@ -20366,7 +20367,7 @@ is always 1. This means that on those systems, characters have numeric values from 128 to 255. Finally, large mainframe systems use the EBCDIC character set, which uses all 256 values. -While there are other character sets in use on some older systems, +There are other character sets in use on some older systems, but they are not really worth worrying about: @example @@ -20420,7 +20421,7 @@ Good function design is important; this function needs to be general but it should also have a reasonable default behavior. It is called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array indices are numeric---a reasonable -assumption since the array was likely created with @code{split()} +assumption, as the array was likely created with @code{split()} (@pxref{String Functions}): @cindex @code{join()} user-defined function @@ -20473,7 +20474,7 @@ more difficult than they really need to be.} The @code{systime()} and @code{strftime()} functions described in @DBREF{Time Functions} provide the minimum functionality necessary for dealing with the time of day -in human readable form. While @code{strftime()} is extensive, the control +in human-readable form. Although @code{strftime()} is extensive, the control formats are not necessarily easy to remember or intuitively obvious when reading a program. @@ -20564,7 +20565,7 @@ allowed the user to supply an optional timestamp value to use instead of the current time. @node Readfile Function -@subsection Reading A Whole File At Once +@subsection Reading a Whole File At Once Often, it is convenient to have the entire contents of a file available in memory as a single string. A straightforward but naive way to @@ -20624,7 +20625,7 @@ will never match if the file has contents. @command{gawk} reads data from the file into @code{tmp} attempting to match @code{RS}. The match fails after each read, but fails quickly, such that @command{gawk} fills @code{tmp} with the entire contents of the file. -(@xref{Records}, for information on @code{RT} and @code{RS}.) +(@DBXREF{Records} for information on @code{RT} and @code{RS}.) In the case that @code{file} is empty, the return value is the null string. Thus calling code may use something like: @@ -20642,7 +20643,7 @@ test would be @samp{contents == ""}. also reads an entire file into memory. @node Shell Quoting -@subsection Quoting Strings to Pass to The Shell +@subsection Quoting Strings to Pass to the Shell @c included by permission @ignore @@ -20684,7 +20685,7 @@ chmod -w file.flac Note the need for shell quoting. The function @code{shell_quote()} does it. @code{SINGLE} is the one-character string @code{"'"} and -@code{QSINGLE} is the three-character string @code{"\"'\""}. +@code{QSINGLE} is the three-character string @code{"\"'\""}: @example @c file eg/lib/shellquote.awk @@ -20744,7 +20745,7 @@ command-line @value{DF}s. @cindex files, managing, data file boundaries @cindex files, initialization and cleanup -The @code{BEGIN} and @code{END} rules are each executed exactly once at +The @code{BEGIN} and @code{END} rules are each executed exactly once, at the beginning and end of your @command{awk} program, respectively (@pxref{BEGIN/END}). We (the @command{gawk} authors) once had a user who mistakenly thought that the @@ -20816,7 +20817,7 @@ The following version solves the problem: @example @c file eg/lib/ftrans.awk -# ftrans.awk --- handle data file transitions +# ftrans.awk --- handle datafile transitions # # user supplies beginfile() and endfile() functions @c endfile @@ -20844,7 +20845,7 @@ END @{ endfile(_filename_) @} shows how this library function can be used and how it simplifies writing the main program. -@sidebar So Why Does @command{gawk} have @code{BEGINFILE} and @code{ENDFILE}? +@sidebar So Why Does @command{gawk} Have @code{BEGINFILE} and @code{ENDFILE}? You are probably wondering, if @code{beginfile()} and @code{endfile()} functions can do the job, why does @command{gawk} have @@ -20852,7 +20853,7 @@ functions can do the job, why does @command{gawk} have Good question. Normally, if @command{awk} cannot open a file, this causes an immediate fatal error. In this case, there is no way for a -user-defined function to deal with the problem, since the mechanism for +user-defined function to deal with the problem, as the mechanism for calling it relies on the file being open and at the first record. Thus, the main reason for @code{BEGINFILE} is to give you a ``hook'' to catch files that cannot be processed. @code{ENDFILE} exists for symmetry, @@ -20910,8 +20911,8 @@ The @code{rewind()} function relies on the @code{ARGIND} variable (@pxref{Auto-set}), which is specific to @command{gawk}. It also relies on the @code{nextfile} keyword (@pxref{Nextfile Statement}). Because of this, you should not call it from an @code{ENDFILE} rule. -(This isn't necessary anyway, since as soon as an @code{ENDFILE} rule -finishes @command{gawk} goes to the next file!) +(This isn't necessary anyway, because @command{gawk} goes to the next +file as soon as an @code{ENDFILE} rule finishes!) @node File Checking @subsection Checking for Readable @value{DDF}s @@ -20959,13 +20960,13 @@ BEGIN @{ @cindex troubleshooting, @code{getline} function This works, because the @code{getline} won't be fatal. Removing the element from @code{ARGV} with @code{delete} -skips the file (since it's no longer in the list). +skips the file (because it's no longer in the list). See also @ref{ARGC and ARGV}. -The regular expression check purposely does not use character classes +Because @command{awk} variable names only allow the English letters, +the regular expression check purposely does not use character classes such as @samp{[:alpha:]} and @samp{[:alnum:]} (@pxref{Bracket Expressions}) -since @command{awk} variable names only allow the English letters. @node Empty Files @subsection Checking for Zero-length Files @@ -21107,12 +21108,12 @@ are left alone. @c STARTOFRANGE clibf @cindex functions, library, C library @cindex arguments, processing -Most utilities on POSIX compatible systems take options on +Most utilities on POSIX-compatible systems take options on the command line that can be used to change the way a program behaves. @command{awk} is an example of such a program (@pxref{Options}). -Often, options take @dfn{arguments}; i.e., data that the program needs to -correctly obey the command-line option. For example, @command{awk}'s +Often, options take @dfn{arguments} (i.e., data that the program needs to +correctly obey the command-line option). For example, @command{awk}'s @option{-F} option requires a string to use as the field separator. The first occurrence on the command line of either @option{--} or a string that does not begin with @samp{-} ends the options. @@ -21216,7 +21217,7 @@ necessary for accessing individual characters (@pxref{String Functions}).@footnote{This function was written before @command{gawk} acquired the ability to split strings into single characters using @code{""} as the separator. -We have left it alone, since using @code{substr()} is more portable.} +We have left it alone, as using @code{substr()} is more portable.} The discussion that follows walks through the code a bit at a time: @@ -21384,9 +21385,9 @@ next element in @code{argv}. If neither condition is true, then only on the next call to @code{getopt()}. The @code{BEGIN} rule initializes both @code{Opterr} and @code{Optind} to one. -@code{Opterr} is set to one, since the default behavior is for @code{getopt()} +@code{Opterr} is set to one, because the default behavior is for @code{getopt()} to print a diagnostic message upon seeing an invalid option. @code{Optind} -is set to one, since there's no reason to look at the program name, which is +is set to one, because there's no reason to look at the program name, which is in @code{ARGV[0]}: @example @@ -21436,16 +21437,22 @@ etc., as its own options. @quotation NOTE After @code{getopt()} is through, -user level code must clear out all the elements of @code{ARGV} from 1 +user-level code must clear out all the elements of @code{ARGV} from 1 to @code{Optind}, so that @command{awk} does not try to process the command-line options as @value{FN}s. @end quotation Using @samp{#!} with the @option{-E} option may help avoid conflicts between your program's options and @command{gawk}'s options, -since @option{-E} causes @command{gawk} to abandon processing of +as @option{-E} causes @command{gawk} to abandon processing of further options -(@pxref{Executable Scripts}, and @pxref{Options}). +(@DBPXREF{Executable Scripts} and +@ifnotdocbook +@pxref{Options}). +@end ifnotdocbook +@ifdocbook +@ref{Options}). +@end ifdocbook Several of the sample programs presented in @ref{Sample Programs}, @@ -21475,7 +21482,7 @@ However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This @value{SECTION} presents a suite of functions for retrieving information from the -user database. @xref{Group Functions}, +user database. @DBXREF{Group Functions} for a similar suite that retrieves information from the group database. @cindex @code{getpwent()} function (C library) @@ -21494,7 +21501,7 @@ The ``password'' comes from the original user database file, encrypted passwords (hence the name). @cindex @command{pwcat} program -While an @command{awk} program could simply read @file{/etc/passwd} +Although an @command{awk} program could simply read @file{/etc/passwd} directly, this file may not contain complete information about the system's set of users.@footnote{It is often the case that password information is stored in a network database.} To be sure you are able to @@ -21589,12 +21596,12 @@ The user's encrypted password. This may not be available on some systems. @item User-ID The user's numeric user ID number. -(On some systems it's a C @code{long}, and not an @code{int}. Thus +(On some systems, it's a C @code{long}, and not an @code{int}. Thus we cast it to @code{long} for all cases.) @item Group-ID The user's numeric group ID number. -(Similar comments about @code{long} vs.@: @code{int} apply here.) +(Similar comments about @code{long} versus @code{int} apply here.) @item Full name The user's full name, and perhaps other information associated with the @@ -21695,7 +21702,7 @@ The function @code{_pw_init()} fills three copies of the user information into three associative arrays. The arrays are indexed by username (@code{_pw_byname}), by user ID number (@code{_pw_byuid}), and by order of occurrence (@code{_pw_bycount}). -The variable @code{_pw_inited} is used for efficiency, since @code{_pw_init()} +The variable @code{_pw_inited} is used for efficiency, as @code{_pw_init()} needs to be called only once. @cindex @code{PROCINFO} array, testing the field splitting @@ -21704,7 +21711,7 @@ Because this function uses @code{getline} to read information from @command{pwcat}, it first saves the values of @code{FS}, @code{RS}, and @code{$0}. It notes in the variable @code{using_fw} whether field splitting with @code{FIELDWIDTHS} is in effect or not. -Doing so is necessary, since these functions could be called +Doing so is necessary, as these functions could be called from anywhere within a user's program, and the user may have his or her own way of splitting records and fields. This makes it possible to restore the correct @@ -21806,7 +21813,7 @@ In turn, calling @code{_pw_init()} is not too expensive, because the once. If you are worried about squeezing every last cycle out of your @command{awk} program, the check of @code{_pw_inited} could be moved out of @code{_pw_init()} and duplicated in all the other functions. In practice, -this is not necessary, since most @command{awk} programs are I/O-bound, +this is not necessary, as most @command{awk} programs are I/O-bound, and such a change would clutter up the code. The @command{id} program in @DBREF{Id Program} @@ -21945,7 +21952,7 @@ the association of name to number must be unique within the file. we cast it to @code{long} for all cases.) @item Group Member List -A comma-separated list of user names. These users are members of the group. +A comma-separated list of usernames. These users are members of the group. Modern Unix systems allow users to be members of several groups simultaneously. If your system does, then there are elements @code{"group1"} through @code{"group@var{N}"} in @code{PROCINFO} @@ -22060,7 +22067,7 @@ is being used, and to restore the appropriate field splitting mechanism. The group information is stored is several associative arrays. The arrays are indexed by group name (@code{@w{_gr_byname}}), by group ID number (@code{@w{_gr_bygid}}), and by position in the database (@code{@w{_gr_bycount}}). -There is an additional array indexed by user name (@code{@w{_gr_groupsbyuser}}), +There is an additional array indexed by username (@code{@w{_gr_groupsbyuser}}), which is a space-separated list of groups to which each user belongs. Unlike the user database, it is possible to have multiple records in the @@ -22073,7 +22080,7 @@ tvpeople:*:101:david,conan,tom,joan @end example For this reason, @code{_gr_init()} looks to see if a group name or -group ID number is already seen. If it is, then the user names are +group ID number is already seen. If it is, the usernames are simply concatenated onto the previous list of users.@footnote{There is actually a subtle problem with the code just presented. Suppose that the first time there were no names. This code adds the names with @@ -22119,7 +22126,7 @@ function getgrgid(gid) @cindex @code{getgruser()} function (C library) The @code{getgruser()} function does not have a C counterpart. It takes a -user name and returns the list of groups that have the user as a member: +username and returns the list of groups that have the user as a member: @cindex @code{getgruser()} function, user-defined @example @@ -22262,7 +22269,7 @@ The functions presented here fit into the following categories: @c nested list @table @asis @item General problems -Number to string conversion, assertions, rounding, random number +Number-to-string conversion, assertions, rounding, random number generation, converting characters to numbers, joining strings, getting easily usable time-of-day information, and reading a whole file in one shot. @@ -22458,7 +22465,7 @@ The programs are presented in alphabetical order. @end menu @node Cut Program -@subsection Cutting out Fields and Columns +@subsection Cutting Out Fields and Columns @cindex @command{cut} utility @c STARTOFRANGE cut @@ -22735,7 +22742,7 @@ function set_charlist( field, i, j, f, g, n, m, t, @c endfile @end example -Next is the rule that actually processes the data. If the @option{-s} option +Next is the rule that processes the data. If the @option{-s} option is given, then @code{suppress} is true. The first @code{if} statement makes sure that the input record does have the field separator. If @command{cut} is processing fields, @code{suppress} is true, and the field @@ -22767,9 +22774,9 @@ written out between the fields: @end example This version of @command{cut} relies on @command{gawk}'s @code{FIELDWIDTHS} -variable to do the character-based cutting. While it is possible in +variable to do the character-based cutting. It is possible in other @command{awk} implementations to use @code{substr()} -(@pxref{String Functions}), +(@pxref{String Functions}), but it is also extremely painful. The @code{FIELDWIDTHS} variable supplies an elegant solution to the problem of picking the input line apart by characters. @@ -22914,7 +22921,7 @@ matched lines in the output: @c endfile @end example -The last two lines are commented out, since they are not needed in +The last two lines are commented out, as they are not needed in @command{gawk}. They should be uncommented if you have to use another version of @command{awk}. @@ -22924,7 +22931,7 @@ into lowercase if the @option{-i} option is specified.@footnote{It also introduces a subtle bug; if a match happens, we output the translated line, not the original.} The rule is -commented out since it is not necessary with @command{gawk}: +commented out as it is not necessary with @command{gawk}: @example @c file eg/prog/egrep.awk @@ -23061,7 +23068,7 @@ function usage() @c ENDOFRANGE egrep @node Id Program -@subsection Printing out User Information +@subsection Printing Out User Information @cindex printing, user information @cindex users, information about, printing @@ -23176,7 +23183,7 @@ function pr_first_field(str, a) The test in the @code{for} loop is worth noting. Any supplementary groups in the @code{PROCINFO} array have the indices @code{"group1"} through @code{"group@var{N}"} for some -@var{N}, i.e., the total number of supplementary groups. +@var{N} (i.e., the total number of supplementary groups). However, we don't know in advance how many of these groups there are. @@ -23216,10 +23223,10 @@ aims to demonstrate.} By default, the output files are named @file{xaa}, @file{xab}, and so on. Each file has -1000 lines in it, with the likely exception of the last file. To change the +1,000 lines in it, with the likely exception of the last file. To change the number of lines in each file, supply a number on the command line -preceded with a minus; e.g., @samp{-500} for files with 500 lines in them -instead of 1000. To change the name of the output files to something like +preceded with a minus (e.g., @samp{-500} for files with 500 lines in them +instead of 1,000). To change the name of the output files to something like @file{myfileaa}, @file{myfileab}, and so on, supply an additional argument that specifies the @value{FN} prefix. @@ -23267,7 +23274,7 @@ BEGIN @{ @} # test argv in case reading from stdin instead of file if (i in ARGV) - i++ # skip data file name + i++ # skip datafile name if (i in ARGV) @{ outfile = ARGV[i] ARGV[i] = "" @@ -23361,8 +23368,8 @@ truncating them and starting over. The @code{BEGIN} rule first makes a copy of all the command-line arguments into an array named @code{copy}. -@code{ARGV[0]} is not copied, since it is not needed. -@code{tee} cannot use @code{ARGV} directly, since @command{awk} attempts to +@code{ARGV[0]} is not needed, so it is not copied. +@code{tee} cannot use @code{ARGV} directly, because @command{awk} attempts to process each @value{FN} in @code{ARGV} as input data. @cindex flag variables @@ -23411,7 +23418,7 @@ BEGIN @{ @c endfile @end example -The following single rule does all the work. Since there is no pattern, it is +The following single rule does all the work. Because there is no pattern, it is executed for each line of input. The body of the rule simply prints the line into each file on the command line, and then to the standard output: @@ -23442,7 +23449,7 @@ for (i in copy) @end example @noindent -This is more concise but it is also less efficient. The @samp{if} is +This is more concise, but it is also less efficient. The @samp{if} is tested for each record and for each output file. By duplicating the loop body, the @samp{if} is only tested once for each input record. If there are @var{N} input records and @var{M} output files, the first method only @@ -23662,10 +23669,10 @@ The second rule does the work. The variable @code{equal} is one or zero, depending upon the results of @code{are_equal()}'s comparison. If @command{uniq} is counting repeated lines, and the lines are equal, then it increments the @code{count} variable. Otherwise, it prints the line and resets @code{count}, -since the two lines are not equal. +because the two lines are not equal. If @command{uniq} is not counting, and if the lines are equal, @code{count} is incremented. -Nothing is printed, since the point is to remove duplicates. +Nothing is printed, as the point is to remove duplicates. Otherwise, if @command{uniq} is counting repeated lines and more than one line is seen, or if @command{uniq} is counting nonrepeated lines and only one line is seen, then the line is printed, and @code{count} @@ -23786,7 +23793,7 @@ Count only characters. @end table Implementing @command{wc} in @command{awk} is particularly elegant, -since @command{awk} does a lot of the work for us; it splits lines into +because @command{awk} does a lot of the work for us; it splits lines into words (i.e., fields) and counts them, it counts lines (i.e., records), and it can easily tell us how long a line is. @@ -23891,7 +23898,7 @@ function endfile(file) @end example There is one rule that is executed for each line. It adds the length of -the record, plus one, to @code{chars}.@footnote{Since @command{gawk} +the record, plus one, to @code{chars}.@footnote{Because @command{gawk} understands multibyte locales, this code counts characters, not bytes.} Adding one plus the record length is needed because the newline character separating records (the value @@ -24239,8 +24246,8 @@ often used to map uppercase letters into lowercase for further processing: @command{tr} requires two lists of characters.@footnote{On some older systems, including Solaris, the system version of @command{tr} may require that the lists be written as range expressions enclosed in square brackets -(@samp{[a-z]}) and quoted, to prevent the shell from attempting a file -name expansion. This is not a feature.} When processing the input, the +(@samp{[a-z]}) and quoted, to prevent the shell from attempting a +@value{FN} expansion. This is not a feature.} When processing the input, the first character in the first list is replaced with the first character in the second list, the second character in the first list is replaced with the second character in the second list, and so on. If there are @@ -24355,9 +24362,9 @@ BEGIN @{ @c endfile @end example -While it is possible to do character transliteration in a user-level -function, it is not necessarily efficient, and we (the @command{gawk} -authors) started to consider adding a built-in function. However, +It is possible to do character transliteration in a user-level +function, but it is not necessarily efficient, and we (the @command{gawk} +developers) started to consider adding a built-in function. However, shortly after writing this program, we learned that Brian Kernighan had added the @code{toupper()} and @code{tolower()} functions to his @command{awk} (@pxref{String Functions}). These functions handle the @@ -24401,7 +24408,7 @@ the @code{line} array and printing the page when 20 labels have been read. The @code{BEGIN} rule simply sets @code{RS} to the empty string, so that @command{awk} splits records at blank lines (@pxref{Records}). -It sets @code{MAXLINES} to 100, since 100 is the maximum number +It sets @code{MAXLINES} to 100, because 100 is the maximum number of lines on the page @iftex (@math{20 @cdot 5 = 100}). @@ -24558,9 +24565,9 @@ useful on real text files: @item The @command{awk} language considers upper- and lowercase characters to be distinct. Therefore, ``bartender'' and ``Bartender'' are not treated -as the same word. This is undesirable, since in normal text, words -are capitalized if they begin sentences, and a frequency analyzer should not -be sensitive to capitalization. +as the same word. This is undesirable, because words are capitalized +if they begin sentences in normal text, and a frequency analyzer should +not be sensitive to capitalization. @item Words are detected using the @command{awk} convention that fields are @@ -24741,7 +24748,7 @@ The nodes and @ref{Sample Programs}, are the top level nodes for a large number of @command{awk} programs. @end ifinfo -If you want to experiment with these programs, it is tedious to have to type +If you want to experiment with these programs, it is tedious to type them in by hand. Here we present a program that can extract parts of a Texinfo input file into separate files. @@ -24819,7 +24826,7 @@ It also prints some final advice: @@example @@c file examples/messages.awk -END @@@{ print "Always avoid bored archeologists!" @@@} +END @@@{ print "Always avoid bored archaeologists!" @@@} @@c end file @@end example @dots{} @@ -24991,7 +24998,7 @@ The @command{sed} utility is a stream editor, a program that reads a stream of data, makes changes to it, and passes it on. It is often used to make global changes to a large file or to a stream of data generated by a pipeline of commands. -While @command{sed} is a complicated program in its own right, its most common +Although @command{sed} is a complicated program in its own right, its most common use is to perform global substitutions in the middle of a pipeline: @example @@ -25000,7 +25007,7 @@ use is to perform global substitutions in the middle of a pipeline: Here, @samp{s/old/new/g} tells @command{sed} to look for the regexp @samp{old} on each input line and globally replace it with the text -@samp{new}, i.e., all the occurrences on a line. This is similar to +@samp{new} (i.e., all the occurrences on a line). This is similar to @command{awk}'s @code{gsub()} function (@pxref{String Functions}). @@ -25084,7 +25091,7 @@ not treated as @value{FN}s (@pxref{ARGC and ARGV}). The @code{usage()} function prints an error message and exits. -Finally, the single rule handles the printing scheme outlined above, +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 @@ -25128,8 +25135,8 @@ BEGIN @{ The following program, @file{igawk.sh}, provides this service. It simulates @command{gawk}'s searching of the @env{AWKPATH} variable -and also allows @dfn{nested} includes; i.e., a file that is included -with @code{@@include} can contain further @code{@@include} statements. +and also allows @dfn{nested} includes (i.e., a file that is included +with @code{@@include} can contain further @code{@@include} statements). @command{igawk} makes an effort to only include files once, so that nested includes don't accidentally include a library function twice. @@ -25159,10 +25166,10 @@ Literal text, provided with @option{-e} or @option{--source}. This text is just appended directly. @item -Source @value{FN}s, provided with @option{-f}. We use a neat trick and append -@samp{@@include @var{filename}} to the shell variable's contents. Since the file-inclusion -program works the way @command{gawk} does, this gets the text -of the file included into the program at the correct point. +Source @value{FN}s, provided with @option{-f}. We use a neat trick and +append @samp{@@include @var{filename}} to the shell variable's contents. +Because the file-inclusion program works the way @command{gawk} does, this +gets the text of the file included in the program at the correct point. @end enumerate @item @@ -25461,9 +25468,10 @@ EOF @c endfile @end example -The shell construct @samp{@var{command} << @var{marker}} is called a @dfn{here document}. -Everything in the shell script up to the @var{marker} is fed to @var{command} as input. -The shell processes the contents of the here document for variable and command substitution +The shell construct @samp{@var{command} << @var{marker}} is called +a @dfn{here document}. Everything in the shell script up to the +@var{marker} is fed to @var{command} as input. The shell processes +the contents of the here document for variable and command substitution (and possibly other things as well, depending upon the shell). The shell construct @samp{$(@dots{})} is called @dfn{command substitution}. @@ -25478,14 +25486,16 @@ It's done in these steps: @enumerate @item Run @command{gawk} with the @code{@@include}-processing program (the -value of the @code{expand_prog} shell variable) on standard input. +value of the @code{expand_prog} shell variable) reading standard input. @item -Standard input is the contents of the user's program, from the shell variable @code{program}. -Its contents are fed to @command{gawk} via a here document. +Standard input is the contents of the user's program, +from the shell variable @code{program}. +Feed its contents to @command{gawk} via a here document. @item -The results of this processing are saved in the shell variable @code{processed_program} by using command substitution. +Save the results of this processing in the shell variable +@code{processed_program} by using command substitution. @end enumerate The last step is to call @command{gawk} with the expanded program, @@ -25561,7 +25571,7 @@ of @command{awk} programs as Web CGI scripts.} @c ENDOFRANGE igawk @node Anagram Program -@subsection Finding Anagrams From A Dictionary +@subsection Finding Anagrams from a Dictionary @cindex anagrams, finding An interesting programming challenge is to @@ -25570,17 +25580,17 @@ word list (such as @file{/usr/share/dict/words} on many GNU/Linux systems). One word is an anagram of another if both words contain the same letters -(for example, ``babbling'' and ``blabbing''). +(e.g., ``babbling'' and ``blabbing''). -Column 2, Problem C of Jon Bentley's @cite{Programming Pearls}, second -edition, presents an elegant algorithm. The idea is to give words that +Column 2, Problem C, of Jon Bentley's @cite{Programming Pearls}, Second +Edition, presents an elegant algorithm. The idea is to give words that are anagrams a common signature, sort all the words together by their signature, and then print them. Dr.@: Bentley observes that taking the letters in each word and sorting them produces that common signature. 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. +in sorted order: @c STARTOFRANGE anagram @cindex @code{anagram.awk} program @@ -25652,7 +25662,7 @@ function word2key(word, a, i, n, result) Finally, the @code{END} rule traverses the array and prints out the anagram lists. It sends the output -to the system @command{sort} command, since otherwise +to the system @command{sort} command because otherwise the anagrams would appear in arbitrary order: @example @@ -25694,7 +25704,7 @@ babery yabber @c ENDOFRANGE anagram @node Signature Program -@subsection And Now For Something Completely Different +@subsection And Now for Something Completely Different @cindex signature program @cindex Brini, Davide @@ -37347,9 +37357,9 @@ recommend compiling and using the current version. @node Bugs @appendixsec Reporting Problems and Bugs -@cindex archeologists +@cindex archaeologists @quotation -@i{There is nothing more dangerous than a bored archeologist.} +@i{There is nothing more dangerous than a bored archaeologist.} @author The Hitchhiker's Guide to the Galaxy @end quotation @c the radio show, not the book. :-) -- cgit v1.2.3 From 6cc74b6a9954bcfcf48aeb6178b3426b5940f928 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 14 Nov 2014 13:52:05 +0200 Subject: Copyedits, through Chapter 14. --- NOTES | 2 +- doc/gawktexi.in | 406 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 204 insertions(+), 204 deletions(-) diff --git a/NOTES b/NOTES index f4181d82..c5c1094a 100644 --- a/NOTES +++ b/NOTES @@ -21,4 +21,4 @@ the brackets, which indicate optional stuff, in Roman. I think that if you simply fix the style sheets to indent those blocks, we should be in better shape. -At page 321. +At page 373. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 65e8b8f3..6f06c498 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -4666,7 +4666,7 @@ This @value{SECTION} describes a feature that is specific to @command{gawk}. The @code{@@load} keyword can be used to read external @command{awk} extensions (stored as system shared libraries). This allows you to link in compiled code that may offer superior -performance and/or give you access to extended capabilities not supported +performance and/or give you access to extended capabilities not supported by the @command{awk} language. The @env{AWKLIBPATH} variable is used to search for the extension. Using @code{@@load} is completely equivalent to using the @option{-l} command-line option. @@ -5721,7 +5721,7 @@ $ @kbd{awk '$0 ~ "[ \t\n]"'} @error{} ]... @error{} source line number 1 @error{} context is -@error{} $0 ~ "[ >>> \t\n]" <<< +@error{} $0 ~ "[ >>> \t\n]" <<< @end example @cindex newlines, in regexp constants @@ -6215,7 +6215,7 @@ $ @kbd{awk 'BEGIN @{ RS = "u" @}} @print{} m@@ny @print{} .ed @print{} R -@print{} +@print{} @end example @noindent @@ -7486,7 +7486,7 @@ the double quotes. @command{gawk} provides no way to deal with this. Because no formal specification for CSV data exists, there isn't much more to be done; the @code{FPAT} mechanism provides an elegant solution for the majority -of cases, and the @command{gawk} developers are satisfied with that. +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 @@ -8755,27 +8755,27 @@ newline: $ @kbd{awk 'BEGIN @{ OFS = ";"; ORS = "\n\n" @}} > @kbd{@{ print $1, $2 @}' mail-list} @print{} Amelia;555-5553 -@print{} +@print{} @print{} Anthony;555-3412 -@print{} +@print{} @print{} Becky;555-7685 -@print{} +@print{} @print{} Bill;555-1675 -@print{} +@print{} @print{} Broderick;555-0542 -@print{} +@print{} @print{} Camilla;555-2912 -@print{} +@print{} @print{} Fabius;555-1234 -@print{} +@print{} @print{} Julie;555-6699 -@print{} +@print{} @print{} Martin;555-6480 -@print{} +@print{} @print{} Samuel;555-3430 -@print{} +@print{} @print{} Jean-Paul;555-2127 -@print{} +@print{} @end example If the value of @code{ORS} does not contain a newline, the program's output @@ -13457,7 +13457,7 @@ are checked for a match in the order they are defined. If no suitable Each @code{case} contains a single constant, be it numeric, string, or regexp. The @code{switch} expression is evaluated, and then each -@code{case}'s constant is compared against the result in turn. The type of constant +@code{case}'s constant is compared against the result in turn. The type of constant determines the comparison: numeric or string do the usual comparisons. A regexp constant does a regular expression match against the string value of the original expression. The general form of the @code{switch} @@ -14398,9 +14398,9 @@ The version of @command{gawk}. The following additional elements in the array are available to provide information about the MPFR and GMP libraries if your version of @command{gawk} supports arbitrary-precision arithmetic -(@pxref{Arbitrary Precision Arithmetic}): +(@pxref{Arbitrary Precision Arithmetic}): -@table @code +@table @code @cindex version of GNU MPFR library @item PROCINFO["mpfr_version"] The version of the GNU MPFR library. @@ -15443,7 +15443,7 @@ the index is @code{"10"} rather than numeric 10.) @item "@@ind_num_asc" Order by indices in ascending order but force them to be treated as numbers in the process. -Any index with a non-numeric value will end up positioned as if it were zero. +Any index with a non-numeric value will end up positioned as if it were zero. @item "@@val_type_asc" Order by element values in ascending order (rather than by indices). @@ -15455,11 +15455,11 @@ which in turn come before all subarrays. @pxref{Arrays of Arrays}.) @item "@@val_str_asc" -Order by element values in ascending order (rather than by indices). Scalar values are +Order by element values in ascending order (rather than by indices). Scalar values are compared as strings. Subarrays, if present, come out last. @item "@@val_num_asc" -Order by element values in ascending order (rather than by indices). Scalar values are +Order by element values in ascending order (rather than by indices). Scalar values are compared as numbers. Subarrays, if present, come out last. When numeric values are equal, the string values are used to provide an ordering: this guarantees consistent results across different @@ -15520,7 +15520,7 @@ $ @kbd{gawk '} When sorting an array by element values, if a value happens to be a subarray then it is considered to be greater than any string or numeric value, regardless of what the subarray itself contains, -and all subarrays are treated as being equal to each other. Their +and all subarrays are treated as being equal to each other. Their order relative to each other is determined by their index strings. Here are some additional things to bear in mind about sorted @@ -15988,7 +15988,7 @@ is itself an array and not a scalar: @example a[4] = "An element in a jagged array" @end example - + The terms @dfn{dimension}, @dfn{row}, and @dfn{column} are meaningless when applied to such an array, but we will use ``dimension'' henceforth to imply the @@ -16045,14 +16045,14 @@ The @samp{for (item in array)} statement (@pxref{Scanning an Array}) 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) +(i.e., in which each first-level element is itself an +array, not necessarily of the same length) you could use the following code: @example for (i in array) for (j in array[i]) - print array[i][j] + print array[i][j] @end example The @code{isarray()} function (@pxref{Type Functions}) @@ -16062,7 +16062,7 @@ lets you test if an array element is itself an array: for (i in array) @{ if (isarray(array[i]) @{ for (j in array[i]) @{ - print array[i][j] + print array[i][j] @} @} else @@ -16072,7 +16072,7 @@ for (i in array) @{ If the structure of a jagged array of arrays is known in advance, you can often devise workarounds using control statements. For example, -the following code prints the elements of our main array @code{a}: +the following code prints the elements of our main array @code{a}: @example for (i in a) @{ @@ -16082,7 +16082,7 @@ for (i in a) @{ print a[i][j][k] @} else print a[i][j] - @} + @} @} @end example @@ -16861,14 +16861,14 @@ 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]}. +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 -return value of +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}). The @code{split()} function splits strings into pieces in a @@ -18437,7 +18437,7 @@ an array or not. The second is inside the body of a user-defined function array or not. @quotation NOTE -Using @code{isarray()} at the global level to test +Using @code{isarray()} at the global level to test variables makes no sense. Because you are the one writing the program, you are supposed to know if your variables are arrays or not. And in fact, due to the way @command{gawk} works, if you pass the name of a variable @@ -18846,7 +18846,7 @@ function foo(j) print "foo's i=" i @} -BEGIN @{ +BEGIN @{ i = 10 print "top's i=" i foo(0) @@ -18875,7 +18875,7 @@ indicate that @code{i} is a local variable, not an argument): @example function bar( i) @{ - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) print "bar's i=" i @} @@ -18887,10 +18887,10 @@ function foo(j, i) print "foo's i=" i @} -BEGIN @{ +BEGIN @{ i = 10 print "top's i=" i - foo(0) + foo(0) print "top's i=" i @} @end example @@ -19357,11 +19357,11 @@ $ @kbd{gawk -f indirectcall.awk class_data1} @print{} Biology 101: @print{} sum: <352.8> @print{} average: <88.2> -@print{} +@print{} @print{} Chemistry 305: @print{} sum: <356.4> @print{} average: <89.1> -@print{} +@print{} @print{} English 401: @print{} sum: <376.1> @print{} average: <94.025> @@ -19483,7 +19483,7 @@ function do_sort(first, last, compare, data, i, retval) retval = data[1] for (i = 2; i in data; i++) retval = retval " " data[i] - + return retval @} @c endfile @@ -19529,13 +19529,13 @@ $ @kbd{gawk -f quicksort.awk -f indirectcall.awk class_data2} @print{} average: <88.2> @print{} sort: <78.5 87.0 92.4 94.9> @print{} rsort: <94.9 92.4 87.0 78.5> -@print{} +@print{} @print{} Chemistry 305: @print{} sum: <356.4> @print{} average: <89.1> @print{} sort: <75.2 88.2 94.7 98.3> @print{} rsort: <98.3 94.7 88.2 75.2> -@print{} +@print{} @print{} English 401: @print{} sum: <376.1> @print{} average: <94.025> @@ -20006,7 +20006,7 @@ function mystrtonum(str, ret, n, i, k, c) # a[6] = "1.e3" # a[7] = "1.32" # a[8] = "1.32E2" -# +# # for (i = 1; i in a; i++) # print a[i], strtonum(a[i]), mystrtonum(a[i]) # @} @@ -20972,7 +20972,7 @@ such as @samp{[:alpha:]} and @samp{[:alnum:]} @subsection Checking for Zero-length Files All known @command{awk} implementations silently skip over zero-length files. -This is a by-product of @command{awk}'s implicit +This is a by-product of @command{awk}'s implicit read-a-record-and-match-against-the-rules loop: when @command{awk} tries to read a record from an empty file, it immediately receives an end of file indication, closes the file, and proceeds on to the next @@ -22329,7 +22329,7 @@ ARGIND != Argind @{ @} END @{ if (ARGIND < ARGC - 1) - ARGIND = ARGC - 1 + ARGIND = ARGC - 1 if (ARGIND > Argind) for (Argind++; Argind <= ARGIND; Argind++) zerofile(ARGV[Argind], Argind) @@ -23741,7 +23741,7 @@ Brian Kernighan suggests that ``an alternative approach to state machines is to just read the input into an array, then use indexing. It's almost always easier code, and for most inputs where you would use this, just -as fast.'' Consider how to rewrite the logic to follow this +as fast.'' Consider how to rewrite the logic to follow this suggestion. @end ifset @@ -25690,14 +25690,14 @@ Here is some partial output when the program is run: @example $ @kbd{gawk -f anagram.awk /usr/share/dict/words | grep '^b'} @dots{} -babbled blabbed -babbler blabber brabble -babblers blabbers brabbles -babbling blabbing -babbly blabby -babel bable -babels beslab -babery yabber +babbled blabbed +babbler blabber brabble +babblers blabbers brabbles +babbling blabbing +babbly blabby +babel bable +babels beslab +babery yabber @dots{} @end example @@ -25744,28 +25744,28 @@ Subject: The GNU Awk User's Guide, Section 13.3.11 From: "Chris Johansen" Message-ID: -Arnold, you don't know me, but we have a tenuous connection. My wife is +Arnold, you don't know me, but we have a tenuous connection. My wife is Barbara A. Field, FAIA, GIT '65 (B. Arch.). -I have had a couple of paper copies of "Effective Awk Programming" for -years, and now I'm going through a Kindle version of "The GNU Awk User's -Guide" again. When I got to section 13.3.11, I reformatted and lightly +I have had a couple of paper copies of "Effective Awk Programming" for +years, and now I'm going through a Kindle version of "The GNU Awk User's +Guide" again. When I got to section 13.3.11, I reformatted and lightly commented Davide Brin's signature script to understand its workings. -It occurs to me that this might have pedagogical value as an example -(although imperfect) of the value of whitespace and comments, and a -starting point for that discussion. It certainly helped _me_ understand -what's going on. You are welcome to it, as-is or modified (subject to +It occurs to me that this might have pedagogical value as an example +(although imperfect) of the value of whitespace and comments, and a +starting point for that discussion. It certainly helped _me_ understand +what's going on. You are welcome to it, as-is or modified (subject to Davide's constraints, of course, which I think I have met). -If I were to include it in a future edition, I would put it at some -distance from section 13.3.11, say, as a note or an appendix, so as not to +If I were to include it in a future edition, I would put it at some +distance from section 13.3.11, say, as a note or an appendix, so as not to be a "spoiler" to the puzzle. Best regards, --- +-- Chris Johansen {johansen at main dot nc dot us} - . . . collapsing the probability wave function, sending ripples of + . . . collapsing the probability wave function, sending ripples of certainty through the space-time continuum. @@ -25774,7 +25774,7 @@ certainty through the space-time continuum. # From "13.3.11 And Now For Something Completely Different" # http://www.gnu.org/software/gawk/manual/html_node/Signature-Program.html#Signature-Program -# Copyright © 2008 Davide Brini +# Copyright © 2008 Davide Brini # Copying and distribution of the code published in this page, with # or without modification, are permitted in any medium without @@ -25893,7 +25893,7 @@ Brian Kernighan suggests that ``an alternative approach to state machines is to just read the input into an array, then use indexing. It's almost always easier code, and for most inputs where you would use this, just -as fast.'' Rewrite the logic to follow this +as fast.'' Rewrite the logic to follow this suggestion. @@ -25994,7 +25994,7 @@ the use of the external @command{sort} utility. @c EXCLUDE END @ifnotinfo -@part @value{PART3}Moving Beyond Standard @command{awk} With @command{gawk} +@part @value{PART3}Moving Beyond Standard @command{awk} with @command{gawk} @end ifnotinfo @ifdocbook @@ -26003,19 +26003,19 @@ It contains the following chapters: @itemize @value{BULLET} @item -@ref{Advanced Features}. +@ref{Advanced Features} @item -@ref{Internationalization}. +@ref{Internationalization} @item -@ref{Debugger}. +@ref{Debugger} @item -@ref{Arbitrary Precision Arithmetic}. +@ref{Arbitrary Precision Arithmetic} @item -@ref{Dynamic Extensions}. +@ref{Dynamic Extensions} @end itemize @end ifdocbook @@ -26174,7 +26174,7 @@ in a particular order that you, the programmer, choose. @command{gawk} lets you do this. @DBREF{Controlling Scanning} describes how you can assign special, -pre-defined values to @code{PROCINFO["sorted_in"]} in order to +predefined values to @code{PROCINFO["sorted_in"]} in order to control the order in which @command{gawk} traverses an array during a @code{for} loop. @@ -26198,7 +26198,7 @@ Here, @var{i1} and @var{i2} are the indices, and @var{v1} and @var{v2} are the corresponding values of the two elements being compared. Either @var{v1} or @var{v2}, or both, can be arrays if the array being traversed contains subarrays as values. -(@xref{Arrays of Arrays}, for more information about subarrays.) +(@DBXREF{Arrays of Arrays} for more information about subarrays.) The three possible return values are interpreted as follows: @table @code @@ -26241,7 +26241,7 @@ function cmp_str_val(i1, v1, i2, v2) The third comparison function makes all numbers, and numeric strings without -any leading or trailing spaces, come out first during loop traversal: +any leading or trailing spaces, come out first during loop traversal: @example function cmp_num_str_val(i1, v1, i2, v2, n1, n2) @@ -26249,10 +26249,10 @@ function cmp_num_str_val(i1, v1, i2, v2, n1, n2) # numbers before string value comparison, ascending order n1 = v1 + 0 n2 = v2 + 0 - if (n1 == v1) + if (n1 == v1) return (n2 == v2) ? (n1 - n2) : -1 else if (n2 == v2) - return 1 + return 1 return (v1 < v2) ? -1 : (v1 != v2) @} @end example @@ -26267,7 +26267,7 @@ BEGIN @{ data[10] = "one" data[100] = 100 data[20] = "two" - + f[1] = "cmp_num_idx" f[2] = "cmp_str_val" f[3] = "cmp_num_str_val" @@ -26291,14 +26291,14 @@ $ @kbd{gawk -f compdemo.awk} @print{} data[10] = one @print{} data[20] = two @print{} data[100] = 100 -@print{} +@print{} @print{} Sort function: cmp_str_val @ii{Sort by element values as strings} @print{} data[one] = 10 @print{} data[100] = 100 @ii{String 100 is less than string 20} @print{} data[two] = 20 @print{} data[10] = one @print{} data[20] = two -@print{} +@print{} @print{} Sort function: cmp_num_str_val @ii{Sort all numeric values before all strings} @print{} data[one] = 10 @print{} data[two] = 20 @@ -26309,7 +26309,7 @@ $ @kbd{gawk -f compdemo.awk} Consider sorting the entries of a GNU/Linux system password file according to login name. The following program sorts records -by a specific field position and can be used for this purpose: +by a specific field position and can be used for this purpose: @example # passwd-sort.awk --- simple program to sort by field position @@ -26355,7 +26355,7 @@ $ @kbd{gawk -v POS=1 -F: -f sort.awk /etc/passwd} The comparison should normally always return the same value when given a specific pair of array elements as its arguments. If inconsistent -results are returned then the order is undefined. This behavior can be +results are returned, then the order is undefined. This behavior can be exploited to introduce random order into otherwise seemingly ordered data: @@ -26367,7 +26367,7 @@ function cmp_randomize(i1, v1, i2, v2) @} @end example -As mentioned above, the order of the indices is arbitrary if two +As already mentioned, the order of the indices is arbitrary if two elements compare equal. This is usually not a problem, but letting the tied elements come out in arbitrary order can be an issue, especially when comparing item values. The partial ordering of the equal elements @@ -26408,10 +26408,10 @@ When string comparisons are made during a sort, either for element values where one or both aren't numbers, or for element indices handled as strings, the value of @code{IGNORECASE} (@pxref{Built-in Variables}) controls whether -the comparisons treat corresponding uppercase and lowercase letters as +the comparisons treat corresponding upper- and lowercase letters as equivalent or distinct. -Another point to keep in mind is that in the case of subarrays +Another point to keep in mind is that in the case of subarrays, the element values can themselves be arrays; a production comparison function should use the @code{isarray()} function (@pxref{Type Functions}), @@ -26419,7 +26419,7 @@ to check for this, and choose a defined sorting order for subarrays. All sorting based on @code{PROCINFO["sorted_in"]} is disabled in POSIX mode, -since the @code{PROCINFO} array is not special in that case. +because the @code{PROCINFO} array is not special in that case. As a side note, sorting the array indices before traversing the array has been reported to add 15% to 20% overhead to the @@ -26440,8 +26440,8 @@ sorted array traversal is not the default. @cindex @code{asorti()} function (@command{gawk}), arrays@comma{} sorting @cindex sort function, arrays, sorting In most @command{awk} implementations, sorting an array requires writing -a @code{sort()} function. While this can be educational for exploring -different sorting algorithms, usually that's not the point of the program. +a @code{sort()} function. This can be educational for exploring +different sorting algorithms, but usually that's not the point of the program. @command{gawk} provides the built-in @code{asort()} and @code{asorti()} functions (@pxref{String Functions}) for sorting arrays. For example: @@ -26537,8 +26537,8 @@ Because @code{IGNORECASE} affects string comparisons, the value of @code{IGNORECASE} also affects sorting for both @code{asort()} and @code{asorti()}. Note also that the locale's sorting order does @emph{not} come into play; comparisons are based on character values only.@footnote{This -is true because locale-based comparison occurs only when in POSIX -compatibility mode, and since @code{asort()} and @code{asorti()} are +is true because locale-based comparison occurs only when in +POSIX-compatibility mode, and becasue @code{asort()} and @code{asorti()} are @command{gawk} extensions, they are not available in that case.} @node Two-way I/O @@ -26614,7 +26614,7 @@ remain more difficult to use than two-way pipes.} @c 8/2014 @cindex @command{csh} utility, @code{|&} operator, comparison with However, with @command{gawk}, it is possible to open a @emph{two-way} pipe to another process. The second process is -termed a @dfn{coprocess}, since it runs in parallel with @command{gawk}. +termed a @dfn{coprocess}, as it runs in parallel with @command{gawk}. The two-way connection is created using the @samp{|&} operator (borrowed from the Korn shell, @command{ksh}):@footnote{This is very different from the same operator in the C shell and in Bash.} @@ -26774,7 +26774,7 @@ You can think of this as just a @emph{very long} two-way pipeline to a coprocess. The way @command{gawk} decides that you want to use TCP/IP networking is by recognizing special @value{FN}s that begin with one of @samp{/inet/}, -@samp{/inet4/} or @samp{/inet6/}. +@samp{/inet4/}, or @samp{/inet6/}. The full syntax of the special @value{FN} is @file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}}. @@ -26803,7 +26803,7 @@ or @samp{http}, in which case @command{gawk} attempts to determine the predefined port number using the C @code{getaddrinfo()} function. @item remote-host -The IP address or fully-qualified domain name of the Internet +The IP address or fully qualified domain name of the Internet host to which you want to connect. @item remote-port @@ -26877,12 +26877,12 @@ gawk --profile=myprog.prof -f myprog.awk data1 data2 @end example @noindent -In the above example, @command{gawk} places the profile in +In the preceding example, @command{gawk} places the profile in @file{myprog.prof} instead of in @file{awkprof.out}. -Here is a sample session showing a simple @command{awk} program, its input data, and the -results from running @command{gawk} with the @option{--profile} option. -First, the @command{awk} program: +Here is a sample session showing a simple @command{awk} program, +its input data, and the results from running @command{gawk} with the +@option{--profile} option. First, the @command{awk} program: @example BEGIN @{ print "First BEGIN rule" @} @@ -27040,7 +27040,7 @@ the body of an @code{if}, @code{else}, or loop is only a single statement. @item Parentheses are used only where needed, as indicated by the structure of the program and the precedence rules. -For example, @samp{(3 + 5) * 4} means add three plus five, then multiply +For example, @samp{(3 + 5) * 4} means add three and five, then multiply the total by four. However, @samp{3 + 5 * 4} has no parentheses, and means @samp{3 + (5 * 4)}. @@ -27299,8 +27299,7 @@ following steps, in this order: @enumerate @item -The programmer goes -through the source for all of @command{guide}'s components +The programmer reviews the source for all of @command{guide}'s components and marks each string that is a candidate for translation. For example, @code{"`-F': option required"} is a good candidate for translation. A table with strings of option names is not (e.g., @command{gawk}'s @@ -27420,8 +27419,8 @@ if necessary. (It is almost never necessary to supply a different category.) @cindex sorting characters in different languages @cindex @code{LC_COLLATE} locale category @item LC_COLLATE -Text-collation information; i.e., how different characters -and/or groups of characters sort in a given language. +Text-collation information (i.e., how different characters +and/or groups of characters sort in a given language). @cindex @code{LC_CTYPE} locale category @item LC_CTYPE @@ -27640,7 +27639,7 @@ BEGIN @{ @end enumerate -@xref{I18N Example}, +@DBXREF{I18N Example} for an example program showing the steps to create and use translations from @command{awk}. @@ -27701,7 +27700,7 @@ second argument to @code{dcngettext()}.@footnote{The You should distribute the generated @file{.pot} file with your @command{awk} program; translators will eventually use it to provide you translations that you can also then distribute. -@xref{I18N Example}, +@DBXREF{I18N Example} for the full list of steps to go through to create and test translations for @command{guide}. @c ENDOFRANGE portobfi @@ -27829,7 +27828,7 @@ change: @cindex @code{TEXTDOMAIN} variable, portability and @item Assignments to @code{TEXTDOMAIN} won't have any effect, -since @code{TEXTDOMAIN} is not special in other @command{awk} implementations. +because @code{TEXTDOMAIN} is not special in other @command{awk} implementations. @item Non-GNU versions of @command{awk} treat marked strings @@ -27877,8 +27876,8 @@ enough arguments are supplied in the function call. Many versions of underlying C library version of @code{sprintf()}, but only one format and argument at a time. What happens if a positional specification is used is anybody's guess. -However, since the positional specifications are primarily for use in -@emph{translated} format strings, and since non-GNU @command{awk}s never +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 @@ -27967,7 +27966,7 @@ msgstr "Like, the scoop is" The next step is to make the directory to hold the binary message object file and then to create the @file{guide.mo} file. We pretend that our file is to be used in the @code{en_US.UTF-8} locale, -since we have to use a locale name known to the C @command{gettext} routines. +because we have to use a locale name known to the C @command{gettext} routines. The directory layout shown here is standard for GNU @command{gettext} on GNU/Linux systems. Other versions of @command{gettext} may use a different layout: @@ -28004,7 +28003,7 @@ $ @kbd{gawk -f guide.awk} @print{} Pardon me, Zaphod who? @end example -If the three replacement functions for @code{dcgettext()}, @code{dcngettext()} +If the three replacement functions for @code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()} (@pxref{I18N Portability}) are in a file named @file{libintl.awk}, @@ -28106,7 +28105,7 @@ how to use @command{gawk} for debugging your program is easy. @end menu @node Debugging -@section Introduction to The @command{gawk} Debugger +@section Introduction to the @command{gawk} Debugger This @value{SECTION} introduces debugging in general and begins the discussion of debugging in @command{gawk}. @@ -28124,8 +28123,8 @@ the discussion of debugging in @command{gawk}. ahead to the next section on the specific features of the @command{gawk} debugger.) -Of course, a debugging program cannot remove bugs for you, since it has -no way of knowing what you or your users consider a ``bug'' and what is a +Of course, a debugging program cannot remove bugs for you, because it has +no way of knowing what you or your users consider a ``bug'' versus a ``feature.'' (Sometimes, we humans have a hard time with this ourselves.) In that case, what can you expect from such a tool? The answer to that depends on the language being debugged, but in general, you can expect at @@ -28146,7 +28145,7 @@ having to change your source files. @item The chance to see the values of data in the program at any point in execution, and also to change that data on the fly, to see how that -affects what happens afterwards. (This often includes the ability +affects what happens afterward. (This often includes the ability to look at internal data structures besides the variables you actually defined in your code.) @@ -28166,11 +28165,11 @@ functional program that you or someone else wrote). Before diving in to the details, we need to introduce several important concepts that apply to just about all debuggers. The following list defines terms used throughout the rest of -this @value{CHAPTER}. +this @value{CHAPTER}: @table @dfn @cindex stack frame -@item Stack Frame +@item Stack frame Programs generally call functions during the course of their execution. One function can call another, or a function can call itself (recursion). You can view the chain of called functions (main program calls A, which @@ -28205,7 +28204,7 @@ as many breakpoints as you like. A watchpoint is similar to a breakpoint. The difference is that breakpoints are oriented around the code: stop when a certain point in the code is reached. A watchpoint, however, specifies that program execution -should stop when a @emph{data value} is changed. This is useful, since +should stop when a @emph{data value} is changed. This is useful, as sometimes it happens that a variable receives an erroneous value, and it's hard to track down where this happens just by looking at the code. By using a watchpoint, you can stop whenever a variable is assigned to, @@ -28219,13 +28218,13 @@ Debugging an @command{awk} program has some specific aspects that are not shared with other programming languages. First of all, the fact that @command{awk} programs usually take input -line-by-line from a file or files and operate on those lines using specific +line by line from a file or files and operate on those lines using specific rules makes it especially useful to organize viewing the execution of the program in terms of these rules. As we will see, each @command{awk} rule is treated almost like a function call, with its own specific block of instructions. -In addition, since @command{awk} is by design a very concise language, +In addition, because @command{awk} is by design a very concise language, it is easy to lose sight of everything that is going on ``inside'' each line of @command{awk} code. The debugger provides the opportunity to look at the individual primitive instructions carried out @@ -28352,7 +28351,7 @@ gawk> @kbd{bt} @end example This tells us that @code{are_equal()} was called by the main program at -line 88 of @file{uniq.awk}. (This is not a big surprise, since this +line 88 of @file{uniq.awk}. (This is not a big surprise, because this is the only call to @code{are_equal()} in the program, but in more complex programs, knowing who called a function and with what parameters can be the key to finding the source of the problem.) @@ -28369,7 +28368,7 @@ gawk> @kbd{p n} @end example @noindent -In this case, @code{n} is an uninitialized local variable, since the +In this case, @code{n} is an uninitialized local variable, because the function was called without arguments (@pxref{Function Calls}). A more useful variable to display might be the current record: @@ -28380,8 +28379,8 @@ gawk> @kbd{p $0} @end example @noindent -This might be a bit puzzling at first since this is the second line of -our test input above. Let's look at @code{NR}: +This might be a bit puzzling at first, as this is the second line of +our test input. Let's look at @code{NR}: @example gawk> @kbd{p NR} @@ -28421,7 +28420,7 @@ gawk> @kbd{n} This tells us that @command{gawk} is now ready to execute line 66, which decides whether to give the lines the special ``field skipping'' treatment indicated by the @option{-1} command-line option. (Notice that we skipped -from where we were before at line 63 to here, since the condition in line 63 +from where we were before at line 63 to here, because the condition in line 63 @samp{if (fcount == 0 && charcount == 0)} was false.) Continuing to step, we now get to the splitting of the current and @@ -28451,7 +28450,7 @@ gawk> @kbd{p n m alast aline} This is kind of disappointing, though. All we found out is that there are five elements in @code{alast}; @code{m} and @code{aline} don't have -values since we are at line 68 but haven't executed it yet. +values because we are at line 68 but haven't executed it yet. This information is useful enough (we now know that none of the words were accidentally left out), but what if we want to see inside the array? @@ -28560,8 +28559,9 @@ show the abbreviation on a second description line. A debugger command name may also be truncated if that partial name is unambiguous. The debugger has the built-in capability to automatically repeat the previous command just by hitting @key{Enter}. -This works for the commands @code{list}, @code{next}, @code{nexti}, @code{step}, @code{stepi} -and @code{continue} executed without any argument. +This works for the commands @code{list}, @code{next}, @code{nexti}, +@code{step}, @code{stepi}, and @code{continue} executed without any +argument. @menu * Breakpoint Control:: Control of Breakpoints. @@ -28576,9 +28576,9 @@ and @code{continue} executed without any argument. @node Breakpoint Control @subsection Control of Breakpoints -As we saw above, the first thing you probably want to do in a debugging -session is to get your breakpoints set up, since otherwise your program -will just run as if it was not under the debugger. The commands for +As we saw earlier, the first thing you probably want to do in a debugging +session is to get your breakpoints set up, because your program +will otherwise just run as if it was not under the debugger. The commands for controlling breakpoints are: @table @asis @@ -28649,8 +28649,8 @@ that the debugger evaluates whenever the breakpoint or watchpoint is reached. If the condition is true, then the debugger stops execution and prompts for a command. Otherwise, the debugger continues executing the program. If the condition expression is -not specified, any existing condition is removed; i.e., the breakpoint or -watchpoint is made unconditional. +not specified, any existing condition is removed (i.e., the breakpoint or +watchpoint is made unconditional). @cindex debugger commands, @code{d} (@code{delete}) @cindex debugger commands, @code{delete} @@ -28791,7 +28791,7 @@ Execute one (or @var{count}) instruction(s), stepping over function calls. @item @code{return} [@var{value}] Cancel execution of a function call. If @var{value} (either a string or a number) is specified, it is used as the function's return value. If used in a -frame other than the innermost one (the currently executing function, i.e., +frame other than the innermost one (the currently executing function; i.e., frame number 0), discard all inner frames in addition to the selected one, and the caller of that frame becomes the innermost frame. @@ -28857,7 +28857,7 @@ gawk> @kbd{display x} @end example @noindent -displays the assigned item number, the variable name and its current value. +This displays the assigned item number, the variable name, and its current value. If the display variable refers to a function parameter, it is silently deleted from the list as soon as the execution reaches a context where no such variable of the given name exists. @@ -28925,7 +28925,7 @@ or field. String values must be enclosed between double quotes (@code{"}@dots{}@code{"}). You can also set special @command{awk} variables, such as @code{FS}, -@code{NF}, @code{NR}, etc. +@code{NF}, @code{NR}, and son on. @cindex debugger commands, @code{w} (@code{watch}) @cindex debugger commands, @code{watch} @@ -29017,7 +29017,7 @@ Then select and print the frame. @end table @node Debugger Info -@subsection Obtaining Information about the Program and the Debugger State +@subsection Obtaining Information About the Program and the Debugger State Besides looking at the values of variables, there is often a need to get other sorts of information about the state of your program and of the @@ -29185,51 +29185,51 @@ partial dump of Davide Brini's obfuscated code @smallexample gawk> @kbd{dump} @print{} # BEGIN -@print{} -@print{} [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] -@print{} [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc280] Op_match : -@print{} [ 1:0xfcc1e0] Op_store_var : O -@print{} [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc320] Op_equal : -@print{} [ 1:0xfcc200] Op_store_var : o -@print{} [ 1:0xfcc380] Op_push : o -@print{} [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER] -@print{} [ 1:0xfcc220] Op_push_lhs : o [do_reference = true] -@print{} [ 1:0xfcc300] Op_assign_plus : -@print{} [ :0xfcc2c0] Op_pop : -@print{} [ 1:0xfcc400] Op_push : O -@print{} [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR] -@print{} [ :0xfcc4a0] Op_no_op : -@print{} [ 1:0xfcc480] Op_push : O -@print{} [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0] -@print{} [ 1:0xfcc3c0] Op_store_var : x -@print{} [ 1:0xfcc440] Op_push_lhs : X [do_reference = true] -@print{} [ 1:0xfcc3a0] Op_postincrement : -@print{} [ 1:0xfcc4e0] Op_push : x -@print{} [ 1:0xfcc540] Op_push : o -@print{} [ 1:0xfcc500] Op_plus : -@print{} [ 1:0xfcc580] Op_push : o -@print{} [ 1:0xfcc560] Op_plus : -@print{} [ 1:0xfcc460] Op_leq : -@print{} [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0] -@print{} [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR] -@print{} [ :0xfcc660] Op_no_op : -@print{} [ 1:0xfcc520] Op_assign_concat : c -@print{} [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440] -@print{} -@dots{} -@print{} +@print{} +@print{} [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] +@print{} [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc280] Op_match : +@print{} [ 1:0xfcc1e0] Op_store_var : O +@print{} [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc320] Op_equal : +@print{} [ 1:0xfcc200] Op_store_var : o +@print{} [ 1:0xfcc380] Op_push : o +@print{} [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER] +@print{} [ 1:0xfcc220] Op_push_lhs : o [do_reference = true] +@print{} [ 1:0xfcc300] Op_assign_plus : +@print{} [ :0xfcc2c0] Op_pop : +@print{} [ 1:0xfcc400] Op_push : O +@print{} [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR] +@print{} [ :0xfcc4a0] Op_no_op : +@print{} [ 1:0xfcc480] Op_push : O +@print{} [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0] +@print{} [ 1:0xfcc3c0] Op_store_var : x +@print{} [ 1:0xfcc440] Op_push_lhs : X [do_reference = true] +@print{} [ 1:0xfcc3a0] Op_postincrement : +@print{} [ 1:0xfcc4e0] Op_push : x +@print{} [ 1:0xfcc540] Op_push : o +@print{} [ 1:0xfcc500] Op_plus : +@print{} [ 1:0xfcc580] Op_push : o +@print{} [ 1:0xfcc560] Op_plus : +@print{} [ 1:0xfcc460] Op_leq : +@print{} [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0] +@print{} [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR] +@print{} [ :0xfcc660] Op_no_op : +@print{} [ 1:0xfcc520] Op_assign_concat : c +@print{} [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440] +@print{} +@dots{} +@print{} @print{} [ 2:0xfcc5a0] Op_K_printf : [expr_count = 17] [redir_type = ""] -@print{} [ :0xfcc140] Op_no_op : -@print{} [ :0xfcc1c0] Op_atexit : -@print{} [ :0xfcc640] Op_stop : -@print{} [ :0xfcc180] Op_no_op : -@print{} [ :0xfcd150] Op_after_beginfile : -@print{} [ :0xfcc160] Op_no_op : -@print{} [ :0xfcc1a0] Op_after_endfile : +@print{} [ :0xfcc140] Op_no_op : +@print{} [ :0xfcc1c0] Op_atexit : +@print{} [ :0xfcc640] Op_stop : +@print{} [ :0xfcc180] Op_no_op : +@print{} [ :0xfcd150] Op_after_beginfile : +@print{} [ :0xfcc160] Op_no_op : +@print{} [ :0xfcc1a0] Op_after_endfile : gawk> @end smallexample @@ -29286,7 +29286,7 @@ function @var{function}. This command may change the current source file. @itemx @code{q} Exit the debugger. Debugging is great fun, but sometimes we all have to tend to other obligations in life, and sometimes we find the bug, -and are free to go on to the next one! As we saw above, if you are +and are free to go on to the next one! As we saw earlier, if you are running a program, the debugger warns you if you accidentally type @samp{q} or @samp{quit}, to make sure you really want to quit. @@ -29363,7 +29363,7 @@ If you perused the dump of opcodes in @ref{Miscellaneous Debugger Commands} (or if you are already familiar with @command{gawk} internals), you will realize that much of the internal manipulation of data in @command{gawk}, as in many interpreters, is done on a stack. -@code{Op_push}, @code{Op_pop}, etc., are the ``bread and butter'' of +@code{Op_push}, @code{Op_pop}, and the like, are the ``bread and butter'' of most @command{gawk} code. Unfortunately, as of now, the @command{gawk} @@ -29377,8 +29377,8 @@ change back to obscure, perhaps more optimal code later. @item There is no way to look ``inside'' the process of compiling regular expressions to see if you got it right. As an @command{awk} -programmer, you are expected to know what @code{/[^[:alnum:][:blank:]]/} -means. +programmer, you are expected to know the meaning of +@code{/[^[:alnum:][:blank:]]/}. @item The @command{gawk} debugger is designed to be used by running a program (with all its @@ -29656,7 +29656,7 @@ field values for the basic IEEE 754 binary formats: @caption{Basic IEEE Format Values} @multitable @columnfractions .20 .20 .20 .20 .20 @headitem Name @tab Total bits @tab Precision @tab Minimum exponent @tab Maximum exponent -@item Single @tab 32 @tab 24 @tab @minus{}126 @tab +127 +@item Single @tab 32 @tab 24 @tab @minus{}126 @tab +127 @item Double @tab 64 @tab 53 @tab @minus{}1022 @tab +1023 @item Quadruple @tab 128 @tab 113 @tab @minus{}16382 @tab +16383 @end multitable @@ -29798,7 +29798,7 @@ Because the underlying representation can be a little bit off from the exact val comparing floating-point values to see if they are exactly equal is generally a bad idea. Here is an example where it does not work like you would expect: -@example +@example $ @kbd{gawk 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} @print{} 0 @end example @@ -29889,7 +29889,7 @@ it decides that they are not equal! (@xref{Comparing FP Values}.) You can get the result you want by increasing the precision; 56 bits in this case does the job: -@example +@example $ @kbd{gawk -M -v PREC=56 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} @print{} 1 @end example @@ -29898,7 +29898,7 @@ If adding more bits is good, perhaps adding even more bits of precision is better? Here is what happens if we use an even larger value of @code{PREC}: -@example +@example $ @kbd{gawk -M -v PREC=201 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} @print{} 0 @end example @@ -30019,7 +30019,7 @@ differences among various ways to print a floating-point constant: @example $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 0.1) @}'} -@print{} 0.1000000000000000055511151 +@print{} 0.1000000000000000055511151 $ @kbd{gawk -M -v PREC=113 'BEGIN @{ printf("%0.25f\n", 0.1) @}'} @print{} 0.1000000000000000000000000 $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", "0.1") @}'} @@ -30740,7 +30740,7 @@ corresponding standard header file @emph{before} including @file{gawkapi.h}: @item @code{memset()} @tab @code{} @item @code{size_t} @tab @code{} @item @code{struct stat} @tab @code{} -@end multitable +@end multitable Due to portability concerns, especially to systems that are not fully standards-compliant, it is your responsibility @@ -30875,7 +30875,7 @@ It is used in the following @code{struct}. @itemx @ @ @ @ @ @ @ @ awk_value_cookie_t@ vc; @itemx @ @ @ @ @} u; @itemx @} awk_value_t; -An ``@command{awk} value.'' +An ``@command{awk} value.'' The @code{val_type} member indicates what kind of value the @code{union} holds, and each member is of the appropriate type. @@ -31303,7 +31303,7 @@ The name of the file. @item int fd; A file descriptor for the file. If @command{gawk} was able to -open the file, then @code{fd} will @emph{not} be equal to +open the file, then @code{fd} will @emph{not} be equal to @code{INVALID_HANDLE}. Otherwise, it will. @item struct stat sbuf; @@ -32052,7 +32052,7 @@ my_extension_init() size_t long_string_len; /* code from earlier */ - @dots{} + @dots{} /* @dots{} fill in long_string and long_string_len @dots{} */ make_malloced_string(long_string, long_string_len, & value); create_value(& value, & answer_cookie); /* create cookie */ @@ -32785,7 +32785,7 @@ The others should not change during execution. As mentioned earlier (@pxref{Extension Mechanism Outline}), the function definitions as presented are really macros. To use these macros, your extension must provide a small amount of boilerplate code (variables and -functions) towards the top of your source file, using pre-defined names +functions) towards the top of your source file, using predefined names as described below. The boilerplate needed is also provided in comments in the @file{gawkapi.h} header file: @@ -33090,7 +33090,7 @@ in the @command{gawk} distribution for the complete version.} The file includes a number of standard header files, and then includes the @file{gawkapi.h} header file which provides the API definitions. -Those are followed by the necessary variable declarations +Those are followed by the necessary variable declarations to make use of the API macros and boilerplate code (@pxref{Extension API Boilerplate}). @@ -35644,7 +35644,7 @@ load @command{awk} library files. @item The @option{-l} and @option{--load} options load compiled dynamic extensions. -@item +@item The @option{-M} and @option{--bignum} options enable MPFR. @item @@ -39749,7 +39749,7 @@ record or a string. @end docbook @c This file is intended to be included within another document, -@c hence no sectioning command or @node. +@c hence no sectioning command or @node. @display Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} @@ -39971,7 +39971,7 @@ terms of section 4, provided that you also meet all of these conditions: @enumerate a -@item +@item The work must carry prominent notices stating that you modified it, and giving a relevant date. @@ -40421,7 +40421,7 @@ state the exclusion of warranty; and each file should have at least the ``copyright'' line and a pointer to where the full notice is found. @smallexample -@var{one line to give the program's name and a brief idea of what it does.} +@var{one line to give the program's name and a brief idea of what it does.} Copyright (C) @var{year} @var{name of author} This program is free software: you can redistribute it and/or modify @@ -40444,7 +40444,7 @@ If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: @smallexample -@var{program} Copyright (C) @var{year} @var{name of author} +@var{program} Copyright (C) @var{year} @var{name of author} This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details. -- cgit v1.2.3 From bfb15f15556411332a2c33c2ddf51ca44c7df82f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 15 Nov 2014 20:47:03 +0200 Subject: Through page 436. --- NOTES | 4 +- doc/gawktexi.in | 384 +++++++++++++++++++++++++++++--------------------------- 2 files changed, 200 insertions(+), 188 deletions(-) diff --git a/NOTES b/NOTES index c5c1094a..12b6e502 100644 --- a/NOTES +++ b/NOTES @@ -21,4 +21,6 @@ the brackets, which indicate optional stuff, in Roman. I think that if you simply fix the style sheets to indent those blocks, we should be in better shape. -At page 373. +For me to think about: Page 396, where there's a full sentence in bold. + +At page 438. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 6f06c498..a486a0a5 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -29430,7 +29430,7 @@ and editing. @end itemize @node Arbitrary Precision Arithmetic -@chapter Arithmetic and Arbitrary Precision Arithmetic with @command{gawk} +@chapter Arithmetic and Arbitrary-Precision Arithmetic with @command{gawk} @cindex arbitrary precision @cindex multiple precision @cindex infinite precision @@ -29440,9 +29440,9 @@ This @value{CHAPTER} introduces some basic concepts relating to how computers do arithmetic and defines some important terms. It then proceeds to describe floating-point arithmetic, which is what @command{awk} uses for all its computations, including a -discussion of arbitrary precision floating point arithmetic, which is +discussion of arbitrary-precision floating-point arithmetic, which is a feature available only in @command{gawk}. It continues on to present -arbitrary precision integers, and concludes with a description of some +arbitrary-precision integers, and concludes with a description of some points where @command{gawk} and the POSIX standard are not quite in agreement. @@ -29505,51 +29505,51 @@ The disadvantage is that their range is limited. @cindex integers, unsigned In computers, integer values come in two flavors: @dfn{signed} and @dfn{unsigned}. Signed values may be negative or positive, whereas -unsigned values are always positive (that is, greater than or equal +unsigned values are always positive (i.e., greater than or equal to zero). In computer systems, integer arithmetic is exact, but the possible range of values is limited. Integer arithmetic is generally faster than -floating point arithmetic. +floating-point arithmetic. -@item Floating point arithmetic +@item Floating-point arithmetic Floating-point numbers represent what were called in school ``real'' -numbers; i.e., those that have a fractional part, such as 3.1415927. +numbers (i.e., those that have a fractional part, such as 3.1415927). The advantage to floating-point numbers is that they can represent a much larger range of values than can integers. The disadvantage is that there are numbers that they cannot represent exactly. -Modern systems support floating point arithmetic in hardware, with a +Modern systems support floating-point arithmetic in hardware, with a limited range of values. There are software libraries that allow -the use of arbitrary precision floating point calculations. +the use of arbitrary-precision floating-point calculations. -POSIX @command{awk} uses @dfn{double precision} floating-point numbers, which -can hold more digits than @dfn{single precision} floating-point numbers. -@command{gawk} has facilities for performing arbitrary precision floating -point arithmetic, which we describe in more detail shortly. +POSIX @command{awk} uses @dfn{double-precision} floating-point numbers, which +can hold more digits than @dfn{single-precision} floating-point numbers. +@command{gawk} has facilities for performing arbitrary-precision +floating-point arithmetic, which we describe in more detail shortly. @end table -Computers work with integer and floating point values of different -ranges. Integer values are usually either 32 or 64 bits in size. Single -precision floating point values occupy 32 bits, whereas double precision -floating point values occupy 64 bits. Floating point values are always +Computers work with integer and floating-point values of different +ranges. Integer values are usually either 32 or 64 bits in size. +Single-precision floating-point values occupy 32 bits, whereas double-precision +floating-point values occupy 64 bits. Floating-point values are always signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. @float Table,table-numeric-ranges -@caption{Value Ranges for Different Numeric Representations} +@caption{Value ranges for different numeric representations} @multitable @columnfractions .34 .33 .33 @headitem Numeric representation @tab Minimum value @tab Maximum value @item 32-bit signed integer @tab @minus{}2,147,483,648 @tab 2,147,483,647 @item 32-bit unsigned integer @tab 0 @tab 4,294,967,295 @item 64-bit signed integer @tab @minus{}9,223,372,036,854,775,808 @tab 9,223,372,036,854,775,807 @item 64-bit unsigned integer @tab 0 @tab 18,446,744,073,709,551,615 -@item Single precision floating point (approximate) @tab @code{1.175494e-38} @tab @code{3.402823e+38} -@item Double precision floating point (approximate) @tab @code{2.225074e-308} @tab @code{1.797693e+308} +@item Single-precision floating point (approximate) @tab @code{1.175494e-38} @tab @code{3.402823e+38} +@item Double-precision floating point (approximate) @tab @code{2.225074e-308} @tab @code{1.797693e+308} @end multitable @end float @node Math Definitions -@section Other Stuff To Know +@section Other Stuff to Know The rest of this @value{CHAPTER} uses a number of terms. Here are some informal definitions that should help you work your way through the material @@ -29626,7 +29626,7 @@ How numbers are rounded up or down when necessary. More details are provided later. @item Significand -A floating point value consists the significand multiplied by 10 +A floating-point value consists the significand multiplied by 10 to the power of the exponent. For example, in @code{1.2345e67}, the significand is @code{1.2345}. @@ -29644,16 +29644,16 @@ on some of those terms. On modern systems, floating-point hardware uses the representation and operations defined by the IEEE 754 standard. Three of the standard IEEE 754 types are 32-bit single precision, -64-bit double precision and 128-bit quadruple precision. +64-bit double precision, and 128-bit quadruple precision. The standard also specifies extended precision formats to allow greater precisions and larger exponent ranges. -(@command{awk} uses only the 64-bit double precision format.) +(@command{awk} uses only the 64-bit double-precision format.) @ref{table-ieee-formats} lists the precision and exponent field values for the basic IEEE 754 binary formats: @float Table,table-ieee-formats -@caption{Basic IEEE Format Values} +@caption{Basic IEEE format values} @multitable @columnfractions .20 .20 .20 .20 .20 @headitem Name @tab Total bits @tab Precision @tab Minimum exponent @tab Maximum exponent @item Single @tab 32 @tab 24 @tab @minus{}126 @tab +127 @@ -29668,14 +29668,14 @@ one extra bit of significand. @end quotation @node MPFR features -@section Arbitrary Precision Arithmetic Features In @command{gawk} +@section Arbitrary-Precision Arithmetic Features in @command{gawk} -By default, @command{gawk} uses the double precision floating-point values +By default, @command{gawk} uses the double-precision floating-point values supplied by the hardware of the system it runs on. However, if it was -compiled to do so, @command{gawk} uses the @uref{http://www.mpfr.org -GNU MPFR} and @uref{http://gmplib.org, GNU MP} (GMP) libraries for arbitrary -precision arithmetic on numbers. You can see if MPFR support is available -like so: +compiled to do so, @command{gawk} uses the @uref{http://www.mpfr.org, +GNU MPFR} and @uref{http://gmplib.org, GNU MP} (GMP) libraries for +arbitrary-precision arithmetic on numbers. You can see if MPFR support +is available like so: @example $ @kbd{gawk --version} @@ -29703,11 +29703,11 @@ Two predefined variables, @code{PREC} and @code{ROUNDMODE}, provide control over the working precision and the rounding mode. The precision and the rounding mode are set globally for every operation to follow. -@xref{Setting precision}, and @ref{Setting the rounding mode}, +@DBXREF{Setting precision} and @DBREF{Setting the rounding mode} for more information. @node FP Math Caution -@section Floating Point Arithmetic: Caveat Emptor! +@section Floating-Point Arithmetic: Caveat Emptor! @quotation @i{Math class is tough!} @@ -29740,17 +29740,17 @@ rely just on what we tell you. @end menu @node Inexactness of computations -@subsection Floating Point Arithmetic Is Not Exact +@subsection Floating-Point Arithmetic Is Not Exact Binary floating-point representations and arithmetic are inexact. Simple values like 0.1 cannot be precisely represented using binary floating-point numbers, and the limited precision of floating-point numbers means that slight changes in the order of operations or the precision of intermediate storage -can change the result. To make matters worse, with arbitrary precision -floating-point, you can set the precision before starting a computation, -but then you cannot be sure of the number of significant decimal places -in the final result. +can change the result. To make matters worse, with arbitrary-precision +floating-point arithmetic, you can set the precision before starting a +computation, but then you cannot be sure of the number of significant +decimal places in the final result. @menu * Inexact representation:: Numbers are not exactly represented. @@ -29772,7 +29772,7 @@ y = 0.425 Unlike the number in @code{y}, the number stored in @code{x} is exactly representable -in binary since it can be written as a finite sum of one or +in binary because it can be written as a finite sum of one or more fractions whose denominators are all powers of two. When @command{gawk} reads a floating-point number from program source, it automatically rounds that number to whatever @@ -29807,7 +29807,7 @@ The general wisdom when comparing floating-point values is to see if they are within some small range of each other (called a @dfn{delta}, or @dfn{tolerance}). You have to decide how small a delta is important to you. Code to do -this looks something like this: +this looks something like the following: @example delta = 0.00001 # for example @@ -29827,7 +29827,7 @@ else The loss of accuracy during a single computation with floating-point numbers usually isn't enough to worry about. However, if you compute a -value which is the result of a sequence of floating point operations, +value which is the result of a sequence of floating-point operations, the error can accumulate and greatly affect the computation itself. Here is an attempt to compute the value of @value{PI} using one of its many series representations: @@ -29873,9 +29873,9 @@ $ @kbd{gawk 'BEGIN @{} @end example @node Getting Accuracy -@subsection Getting The Accuracy You Need +@subsection Getting the Accuracy You Need -Can arbitrary precision arithmetic give exact results? There are +Can arbitrary-precision arithmetic give exact results? There are no easy answers. The standard rules of algebra often do not apply when using floating-point arithmetic. Among other things, the distributive and associative laws @@ -29884,7 +29884,7 @@ for your computation. Rounding error, cumulative precision loss and underflow are often troublesome. When @command{gawk} tests the expressions @samp{0.1 + 12.2} and -@samp{12.3} for equality using the machine double precision arithmetic, +@samp{12.3} for equality using the machine double-precision arithmetic, it decides that they are not equal! (@xref{Comparing FP Values}.) You can get the result you want by increasing the precision; 56 bits in this case does the job: @@ -29907,15 +29907,15 @@ This is not a bug in @command{gawk} or in the MPFR library. It is easy to forget that the finite number of bits used to store the value is often just an approximation after proper rounding. The test for equality succeeds if and only if @emph{all} bits in the two operands -are exactly the same. Since this is not necessarily true after floating-point +are exactly the same. Because this is not necessarily true after floating-point computations with a particular precision and effective rounding mode, a straight test for equality may not work. Instead, compare the two numbers to see if they are within the desirable delta of each other. In applications where 15 or fewer decimal places suffice, -hardware double precision arithmetic can be adequate, and is usually much faster. +hardware double-precision arithmetic can be adequate, and is usually much faster. But you need to keep in mind that every floating-point operation -can suffer a new rounding error with catastrophic consequences as illustrated +can suffer a new rounding error with catastrophic consequences, as illustrated by our earlier attempt to compute the value of @value{PI}. Extra precision can greatly enhance the stability and the accuracy of your computation in such cases. @@ -29939,9 +29939,9 @@ an arbitrarily large value for @code{PREC}. Reformulation of the problem at hand is often the correct approach in such situations. @node Try To Round -@subsection Try A Few Extra Bits of Precision and Rounding +@subsection Try a Few Extra Bits of Precision and Rounding -Instead of arbitrary precision floating-point arithmetic, +Instead of arbitrary-precision floating-point arithmetic, often all you need is an adjustment of your logic or a different order for the operations in your calculation. The stability and the accuracy of the computation of @value{PI} @@ -29953,7 +29953,7 @@ simple algebraic transformation: @end example @noindent -After making this, change the program converges to +After making this change, the program converges to @value{PI} in under 30 iterations: @example @@ -29969,7 +29969,7 @@ $ @kbd{gawk -f pi2.awk} @end example @node Setting precision -@subsection Setting The Precision +@subsection Setting the Precision @command{gawk} uses a global working precision; it does not keep track of the precision or accuracy of individual numbers. Performing an arithmetic @@ -29981,14 +29981,14 @@ shown in @ref{table-predefined-precision-strings}, to emulate an IEEE 754 binary format. @float Table,table-predefined-precision-strings -@caption{Predefined Precision Strings For @code{PREC}} +@caption{Predefined precision strings for @code{PREC}} @multitable {@code{"double"}} {12345678901234567890123456789012345} @headitem @code{PREC} @tab IEEE 754 Binary Format -@item @code{"half"} @tab 16-bit half-precision. -@item @code{"single"} @tab Basic 32-bit single precision. -@item @code{"double"} @tab Basic 64-bit double precision. -@item @code{"quad"} @tab Basic 128-bit quadruple precision. -@item @code{"oct"} @tab 256-bit octuple precision. +@item @code{"half"} @tab 16-bit half-precision +@item @code{"single"} @tab Basic 32-bit single precision +@item @code{"double"} @tab Basic 64-bit double precision +@item @code{"quad"} @tab Basic 128-bit quadruple precision +@item @code{"oct"} @tab 256-bit octuple precision @end multitable @end float @@ -30029,7 +30029,7 @@ $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 1/10) @}'} @end example @node Setting the rounding mode -@subsection Setting The Rounding Mode +@subsection Setting the Rounding Mode The @code{ROUNDMODE} variable provides program level control over the rounding mode. @@ -30037,7 +30037,7 @@ The correspondence between @code{ROUNDMODE} and the IEEE rounding modes is shown in @ref{table-gawk-rounding-modes}. @float Table,table-gawk-rounding-modes -@caption{@command{gawk} Rounding Modes} +@caption{@command{gawk} rounding modes} @multitable @columnfractions .45 .30 .25 @headitem Rounding Mode @tab IEEE Name @tab @code{ROUNDMODE} @item Round to nearest, ties to even @tab @code{roundTiesToEven} @tab @code{"N"} or @code{"n"} @@ -30052,7 +30052,7 @@ rounding modes is shown in @ref{table-gawk-rounding-modes}. selects the IEEE 754 rounding mode @code{roundTiesToEven}. In @ref{table-gawk-rounding-modes}, the value @code{"A"} selects @code{roundTiesToAway}. This is only available if your version of the -MPFR library supports it; otherwise setting @code{ROUNDMODE} to @code{"A"} +MPFR library supports it; otherwise, setting @code{ROUNDMODE} to @code{"A"} has no effect. The default mode @code{roundTiesToEven} is the most preferred, @@ -30123,14 +30123,14 @@ accumulation of round-off error, look for a significant difference in output when you change the rounding mode to be sure. @node Arbitrary Precision Integers -@section Arbitrary Precision Integer Arithmetic with @command{gawk} +@section Arbitrary-Precision Integer Arithmetic with @command{gawk} @cindex integers, arbitrary precision @cindex arbitrary precision integers When given the @option{-M} option, -@command{gawk} performs all integer arithmetic using GMP arbitrary -precision integers. Any number that looks like an integer in a source -or @value{DF} is stored as an arbitrary precision integer. The size +@command{gawk} performs all integer arithmetic using GMP arbitrary-precision +integers. Any number that looks like an integer in a source +or @value{DF} is stored as an arbitrary-precision integer. The size of the integer is limited only by the available memory. For example, the following computes @iftex @@ -30145,7 +30145,7 @@ the following computes 5432, @c @end docbook the result of which is beyond the -limits of ordinary hardware double precision floating point values: +limits of ordinary hardware double-precision floating-point values: @example $ @kbd{gawk -M 'BEGIN @{} @@ -30157,7 +30157,7 @@ $ @kbd{gawk -M 'BEGIN @{} @print{} 62060698786608744707 ... 92256259918212890625 @end example -If instead you were to compute the same value using arbitrary precision +If instead you were to compute the same value using arbitrary-precision floating-point values, the precision needed for correct output (using the formula @iftex @@ -30202,10 +30202,10 @@ floating-point results exactly. You can either increase the precision @samp{2.0} with an integer, to perform all computations using integer arithmetic to get the correct output. -Sometimes @command{gawk} must implicitly convert an arbitrary precision -integer into an arbitrary precision floating-point value. This is +Sometimes @command{gawk} must implicitly convert an arbitrary-precision +integer into an arbitrary-precision floating-point value. This is primarily because the MPFR library does not always provide the relevant -interface to process arbitrary precision integers or mixed-mode numbers +interface to process arbitrary-precision integers or mixed-mode numbers as needed by an operation or function. In such a case, the precision is set to the minimum value necessary for exact conversion, and the working precision is not used for this purpose. If this is not what you need or @@ -30223,7 +30223,7 @@ to begin with: gawk -M 'BEGIN @{ n = 13.0; print n % 2.0 @}' @end example -Note that for the particular example above, it is likely best +Note that for this particular example, it is likely best to just use the following: @example @@ -30245,13 +30245,13 @@ should support additional features. These features are: @itemize @value{BULLET} @item -Interpretation of floating point data values specified in hexadecimal +Interpretation of floating-point data values specified in hexadecimal notation (e.g., @code{0xDEADBEEF}). (Note: data values, @emph{not} source code constants.) @item -Support for the special IEEE 754 floating point values ``Not A Number'' -(NaN), positive Infinity (``inf'') and negative Infinity (``@minus{}inf''). +Support for the special IEEE 754 floating-point values ``Not A Number'' +(NaN), positive Infinity (``inf''), and negative Infinity (``@minus{}inf''). In particular, the format for these values is as specified by the ISO 1999 C standard, which ignores case and can allow implementation-dependent additional characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}. @@ -30262,8 +30262,8 @@ practice: @itemize @value{BULLET} @item -The @command{gawk} maintainer feels that supporting hexadecimal floating -point values, in particular, is ugly, and was never intended by the +The @command{gawk} maintainer feels that supporting hexadecimal +floating-point values, in particular, is ugly, and was never intended by the original designers to be part of the language. @item @@ -30277,10 +30277,10 @@ interpretation of the standard, which requires a certain amount of intended by the standard developers. In other words, ``we see how you got where you are, but we don't think that that's where you want to be.'' -Recognizing the above issues, but attempting to provide compatibility +Recognizing these issues, but attempting to provide compatibility with the earlier versions of the standard, the 2008 POSIX standard added explicit wording to allow, but not require, -that @command{awk} support hexadecimal floating point values and +that @command{awk} support hexadecimal floating-point values and special values for ``Not A Number'' and infinity. Although the @command{gawk} maintainer continues to feel that @@ -30337,12 +30337,12 @@ Thus @samp{+nan} and @samp{+NaN} are the same. @itemize @value{BULLET} @item Most computer arithmetic is done using either integers or floating-point -values. Standard @command{awk} uses double precision +values. Standard @command{awk} uses double-precision floating-point values. @item -In the early 1990's, Barbie mistakenly said ``Math class is tough!'' -While math isn't tough, floating-point arithmetic isn't the same +In the early 1990s, Barbie mistakenly said ``Math class is tough!'' +Although math isn't tough, floating-point arithmetic isn't the same as pencil and paper math, and care must be taken: @c nested list @@ -30375,7 +30375,7 @@ arithmetic. Use @code{PREC} to set the precision in bits, and @item With @option{-M}, @command{gawk} performs -arbitrary precision integer arithmetic using the GMP library. +arbitrary-precision integer arithmetic using the GMP library. This is faster and more space efficient than using MPFR for the same calculations. @@ -30388,7 +30388,7 @@ It pays to be aware of them. Overall, there is no need to be unduly suspicious about the results from floating-point arithmetic. The lesson to remember is that floating-point arithmetic is always more complex than arithmetic using pencil and -paper. In order to take advantage of the power of computer floating-point, +paper. In order to take advantage of the power of computer floating point, you need to know its limitations and work within them. For most casual use of floating-point arithmetic, you will often get the expected result if you simply round the display of your final results to the correct number @@ -30452,8 +30452,8 @@ C library routines that could be of use. As with most software, ``the sky is the limit;'' if you can imagine something that you might want to do and can write in C or C++, you can write an extension to do it! -Extensions are written in C or C++, using the @dfn{Application Programming -Interface} (API) defined for this purpose by the @command{gawk} +Extensions are written in C or C++, using the @dfn{application programming +interface} (API) defined for this purpose by the @command{gawk} developers. The rest of this @value{CHAPTER} explains the facilities that the API provides and how to use them, and presents a small example extension. In addition, it documents @@ -30490,7 +30490,7 @@ int plugin_is_GPL_compatible; @end example @node Extension Mechanism Outline -@section At A High Level How It Works +@section How It Works at a High Level Communication between @command{gawk} and an extension is two-way. First, when an extension @@ -30510,10 +30510,10 @@ This is shown in @inlineraw{docbook, }. @c but rather just the one without the "txt" final argument. @c This applies to the other figures as well. @ifinfo -@center @image{api-figure1, , , Loading The Extension, txt} +@center @image{api-figure1, , , Loading the extension, txt} @end ifinfo @ifnotinfo -@center @image{api-figure1, , , Loading The Extension} +@center @image{api-figure1, , , Loading the extension} @end ifnotinfo @end float @end ifnotdocbook @@ -30540,19 +30540,19 @@ This is shown in @inlineraw{docbook, -Registering A New Function +Registering a new function @@ -30573,7 +30573,7 @@ This is shown in @inlineraw{docbook, } @ifnotdocbook @float Figure,figure-call-new-function -@caption{Calling The New Function} +@caption{Calling the new function} @ifinfo @center @image{api-figure3, , , Calling the new function, txt} @end ifinfo @@ -30585,7 +30585,7 @@ This is shown in @inlineraw{docbook, } @docbook
-Calling The New Function +Calling the new function @@ -30621,10 +30621,9 @@ The API also provides major and minor version numbers, so that an extension can check if the @command{gawk} it is loaded with supports the facilities it was compiled with. (Version mismatches ``shouldn't'' happen, but we all know how @emph{that} goes.) -@xref{Extension Versioning}, for details. +@DBXREF{Extension Versioning} for details. @end itemize - @node Extension API Description @section API Description @cindex extension API @@ -30666,20 +30665,23 @@ Allocating, reallocating, and releasing memory. @item Registration functions. You may register: + +@c nested list @itemize @value{MINUS} @item -extension functions, +Extension functions @item -exit callbacks, +Exit callbacks @item -a version string, +A version string @item -input parsers, +Input parsers @item -output wrappers, +Output wrappers @item -and two-way processors. +Two-way processors @end itemize + All of these are discussed in detail, later in this @value{CHAPTER}. @item @@ -30726,7 +30728,7 @@ Some points about using the API: @itemize @value{BULLET} @item -The following types and/or macros and/or functions are referenced +The following types, macros, and/or functions are referenced in @file{gawkapi.h}. For correct use, you must therefore include the corresponding standard header file @emph{before} including @file{gawkapi.h}: @@ -30772,7 +30774,7 @@ and is managed by @command{gawk} from then on. The API defines several simple @code{struct}s that map values as seen from @command{awk}. A value can be a @code{double}, a string, or an array (as in multidimensional arrays, or when creating a new array). -String values maintain both pointer and length since embedded @sc{nul} +String values maintain both pointer and length, because embedded @sc{nul} characters are allowed. @quotation NOTE @@ -30797,14 +30799,14 @@ so that the extension can, e.g., print an error message @c The table there should be presented here @end itemize -While you may call the API functions by using the function pointers -directly, the interface is not so pretty. To make extension code look +You may call the API functions by using the function pointers +directly, but the interface is not so pretty. To make extension code look more like regular code, the @file{gawkapi.h} header file defines several macros that you should use in your code. This @value{SECTION} presents the macros as if they were functions. @node General Data Types -@subsection General Purpose Data Types +@subsection General-Purpose Data Types @cindex Robbins, Arnold @cindex Ramey, Chet @@ -30819,9 +30821,10 @@ can accommodate both love and hate.} @author Chet Ramey @end quotation -The extension API defines a number of simple types and structures for general -purpose use. Additional, more specialized, data structures are introduced -in subsequent @value{SECTION}s, together with the functions that use them. +The extension API defines a number of simple types and structures for +general-purpose use. Additional, more specialized, data structures are +introduced in subsequent @value{SECTION}s, together with the functions +that use them. @table @code @item typedef void *awk_ext_id_t; @@ -30888,13 +30891,14 @@ These macros make accessing the fields of the @code{awk_value_t} more readable. @item typedef void *awk_scalar_t; -Scalars can be represented as an opaque type. These values are obtained from -@command{gawk} and then passed back into it. This is discussed in a general fashion below, -and in more detail in @ref{Symbol table by cookie}. +Scalars can be represented as an opaque type. These values are obtained +from @command{gawk} and then passed back into it. This is discussed +in a general fashion in the text following this list, and in more detail in +@ref{Symbol table by cookie}. @item typedef void *awk_value_cookie_t; A ``value cookie'' is an opaque type representing a cached value. -This is also discussed in a general fashion below, +This is also discussed in a general fashion in the text following this list, and in more detail in @ref{Cached values}. @end table @@ -30904,7 +30908,7 @@ Scalar values in @command{awk} are either numbers or strings. The indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings -require more work. Since @command{gawk} allows embedded @sc{nul} bytes +require more work. Because @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a data-pointer and length. This is the @code{awk_string_t} type. @@ -30917,13 +30921,13 @@ itself be an array. Discussion of arrays is delayed until The various macros listed earlier make it easier to use the elements of the @code{union} as if they were fields in a @code{struct}; this is a common coding practice in C. Such code is easier to write and to -read, however it remains @emph{your} responsibility to make sure that +read, but it remains @emph{your} responsibility to make sure that the @code{val_type} member correctly reflects the type of the value in the @code{awk_value_t}. Conceptually, the first three members of the @code{union} (number, string, and array) are all that is needed for working with @command{awk} values. -However, since the API provides routines for accessing and changing +However, because the API provides routines for accessing and changing the value of global scalar variables only by using the variable's name, there is a performance penalty: @command{gawk} must find the variable each time it is accessed and changed. This turns out to be a real issue, @@ -30963,7 +30967,7 @@ The API provides a number of @dfn{memory allocation} functions for allocating memory that can be passed to @command{gawk}, as well as a number of convenience macros. This @value{SUBSECTION} presents them all as function prototypes, in -the way that extension code would use them. +the way that extension code would use them: @table @code @item void *gawk_malloc(size_t size); @@ -31008,7 +31012,8 @@ The arguments to this macro are as follows: The pointer variable to point at the allocated storage. @item type -The type of the pointer variable, used to create a cast for the call to @code{gawk_malloc()}. +The type of the pointer variable. This is used to create a cast for +the call to @code{gawk_malloc()}. @item size The total number of bytes to be allocated. @@ -31043,7 +31048,7 @@ The arguments are the same as for the @code{emalloc()} macro. The API provides a number of @dfn{constructor} functions for creating string and numeric values, as well as a number of convenience macros. This @value{SUBSECTION} presents them all as function prototypes, in -the way that extension code would use them. +the way that extension code would use them: @table @code @item static inline awk_value_t * @@ -31122,8 +31127,8 @@ This is a pointer to the C function that provides the extension's functionality. The function must fill in @code{*result} with either a number or a string. @command{gawk} takes ownership of any string memory. -As mentioned earlier, string memory @strong{must} come from one of @code{gawk_malloc()}, -@code{gawk_calloc()} or @code{gawk_realloc()}. +As mentioned earlier, string memory @strong{must} come from one of +@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The @code{num_actual_args} argument tells the C function how many actual parameters were passed from the calling @command{awk} code. @@ -31158,7 +31163,7 @@ Such functions are useful if you have general ``cleanup'' tasks that should be performed in your extension (such as closing database connections or other resource deallocations). You can register such -a function with @command{gawk} using the following function. +a function with @command{gawk} using the following function: @table @code @item void awk_atexit(void (*funcp)(void *data, int exit_status), @@ -31179,8 +31184,9 @@ the function pointed to by @code{funcp}. @end table @end table -Exit callback functions are called in Last-In-First-Out (LIFO) order---that is, in -the reverse order in which they are registered with @command{gawk}. +Exit callback functions are called in last-in-first-out (LIFO) +order---that is, in the reverse order in which they are registered with +@command{gawk}. @node Extension Version String @subsubsection Registering An Extension Version String @@ -31191,7 +31197,7 @@ version of your extension, with @command{gawk}, as follows: @table @code @item void register_ext_version(const char *version); Register the string pointed to by @code{version} with @command{gawk}. -@command{gawk} does @emph{not} copy the @code{version} string, so +Note that @command{gawk} does @emph{not} copy the @code{version} string, so it should not be changed. @end table @@ -31273,7 +31279,7 @@ appropriately. @item When your extension is loaded, register your input parser with @command{gawk} using the @code{register_input_parser()} API function -(described below). +(described next). @end enumerate An @code{awk_input_buf_t} looks like this: @@ -31317,15 +31323,15 @@ The decision can be made based upon @command{gawk} state (the value of a variable defined previously by the extension and set by @command{awk} code), the name of the file, whether or not the file descriptor is valid, the information -in the @code{struct stat}, or any combination of the above. +in the @code{struct stat}, or any combination of these factors. Once @code{@var{XXX}_can_take_file()} has returned true, and @command{gawk} has decided to use your input parser, it calls @code{@var{XXX}_take_control_of()}. That function then fills one of either the @code{get_record} field or the @code{read_func} field in the @code{awk_input_buf_t}. It must also ensure that @code{fd} is @emph{not} -set to @code{INVALID_HANDLE}. All of the fields that may be filled by -@code{@var{XXX}_take_control_of()} are as follows: +set to @code{INVALID_HANDLE}. The following list describes the fields that +may be filled by @code{@var{XXX}_take_control_of()}: @table @code @item void *opaque; @@ -31340,13 +31346,13 @@ is not required to use this pointer. @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ size_t *rt_len); This function pointer should point to a function that creates the input records. Said function is the core of the input parser. Its behavior -is described below. +is described in the text following this list. @item ssize_t (*read_func)(); This function pointer should point to function that has the same behavior as the standard POSIX @code{read()} system call. It is an alternative to the @code{get_record} pointer. Its behavior -is also described below. +is also described in the text following this list. @item void (*close_func)(struct awk_input *iobuf); This function pointer should point to a function that does @@ -31484,7 +31490,7 @@ values, etc.) within @command{gawk}. The function pointed to by this field is called when @command{gawk} decides to let the output wrapper take control of the file. It should fill in appropriate members of the @code{awk_output_buf_t} structure, -as described below, and return true if successful, false otherwise. +as described next, and return true if successful, false otherwise. @item awk_const struct output_wrapper *awk_const next; This is for use by @command{gawk}; @@ -31627,9 +31633,9 @@ Register the two-way processor pointed to by @code{two_way_processor} with @cindex messages from extensions You can print different kinds of warning messages from your -extension, as described below. Note that for these functions, +extension, as described here. Note that for these functions, you must pass in the extension id received from @command{gawk} -when the extension was loaded.@footnote{Because the API uses only ISO C 90 +when the extension was loaded:@footnote{Because the API uses only ISO C 90 features, it cannot make use of the ISO C 99 variadic macro feature to hide that parameter. More's the pity.} @@ -31686,7 +31692,7 @@ value type, as appropriate. This behavior is summarized in @ref{table-value-types-returned}. @float Table,table-value-types-returned -@caption{API Value Types Returned} +@caption{API value types returned} @docbook @@ -31698,7 +31704,7 @@ value type, as appropriate. This behavior is summarized in - Type of Actual Value: + Type of Actual Value @@ -31734,7 +31740,7 @@ value type, as appropriate. This behavior is summarized in false - Requested: + Requested Scalar Scalar Scalar @@ -31765,7 +31771,7 @@ value type, as appropriate. This behavior is summarized in @ifnotplaintext @ifnotdocbook @multitable @columnfractions .50 .50 -@headitem @tab Type of Actual Value: +@headitem @tab Type of Actual Value @end multitable @c 10/2014: Thanks to Karl Berry for this bit to reduce the space: @tex @@ -31776,7 +31782,7 @@ value type, as appropriate. This behavior is summarized in @item @tab @b{String} @tab String @tab String @tab false @tab false @item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab false @tab false @item @b{Type} @tab @b{Array} @tab false @tab false @tab Array @tab false -@item @b{Requested:} @tab @b{Scalar} @tab Scalar @tab Scalar @tab false @tab false +@item @b{Requested} @tab @b{Scalar} @tab Scalar @tab Scalar @tab false @tab false @item @tab @b{Undefined} @tab String @tab Number @tab Array @tab Undefined @item @tab @b{Value Cookie} @tab false @tab false @tab false @tab false @end multitable @@ -31830,7 +31836,7 @@ indicates the type of value expected. @item awk_bool_t set_argument(size_t count, awk_array_t array); Convert a parameter that was undefined into an array; this provides call-by-reference for arrays. Return false if @code{count} is too big, -or if the argument's type is not undefined. @xref{Array Manipulation}, +or if the argument's type is not undefined. @DBXREF{Array Manipulation} for more information on creating arrays. @end table @@ -31885,7 +31891,7 @@ cannot change any of those variables. @quotation CAUTION It is possible for the lookup of @code{PROCINFO} to fail. This happens if the @command{awk} program being run does not reference @code{PROCINFO}; -in this case @command{gawk} doesn't bother to create the array and +in this case, @command{gawk} doesn't bother to create the array and populate it. @end quotation @@ -31895,9 +31901,9 @@ populate it. A @dfn{scalar cookie} is an opaque handle that provides access to a global variable or array. It is an optimization that avoids looking up variables in @command{gawk}'s symbol table every time -access is needed. This was discussed earlier, in @ref{General Data Types}. +access is needed. This was discussed earlier in @ref{General Data Types}. -The following functions let you work with scalar cookies. +The following functions let you work with scalar cookies: @table @code @item awk_bool_t sym_lookup_scalar(awk_scalar_t cookie, @@ -31942,18 +31948,21 @@ do_magic(int nargs, awk_value_t *result) @noindent This code looks (and is) simple and straightforward. So what's the problem? -Consider what happens if @command{awk}-level code associated with your -extension calls the @code{magic()} function (implemented in C by @code{do_magic()}), -once per record, while processing hundreds of thousands or millions of records. -The @code{MAGIC_VAR} variable is looked up in the symbol table once or twice per function call! +Well, consider what happens if @command{awk}-level code associated +with your extension calls the @code{magic()} function (implemented in +C by @code{do_magic()}), once per record, while processing hundreds +of thousands or millions of records. The @code{MAGIC_VAR} variable is +looked up in the symbol table once or twice per function call! -The symbol table lookup is really pure overhead; it is considerably more efficient -to get a cookie that represents the variable, and use that to get the variable's -value and update it as needed.@footnote{The difference is measurable and quite real. Trust us.} +The symbol table lookup is really pure overhead; it is considerably +more efficient to get a cookie that represents the variable, and use +that to get the variable's value and update it as needed.@footnote{The +difference is measurable and quite real. Trust us.} -Thus, the way to use cookies is as follows. First, install your extension's variable -in @command{gawk}'s symbol table using @code{sym_update()}, as usual. Then get a -scalar cookie for the variable using @code{sym_lookup()}: +Thus, the way to use cookies is as follows. First, install +your extension's variable in @command{gawk}'s symbol table using +@code{sym_update()}, as usual. Then get a scalar cookie for the variable +using @code{sym_lookup()}: @example static awk_scalar_t magic_var_cookie; /* cookie for MAGIC_VAR */ @@ -32016,7 +32025,7 @@ or @code{sym_update_scalar()}, as you like. However, you can understand the point of cached values if you remember that @emph{every} string value's storage @emph{must} come from @code{gawk_malloc()}, -@code{gawk_calloc()} or @code{gawk_realloc()}. +@code{gawk_calloc()}, or @code{gawk_realloc()}. If you have 20 variables, all of which have the same string value, you must create 20 identical copies of the string.@footnote{Numeric values are clearly less problematic, requiring only a C @code{double} to store.} @@ -32027,11 +32036,11 @@ is what the routines in this section let you do. The functions are as follows: @table @code @item awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result); -Create a cached string or numeric value from @code{value} for efficient later -assignment. -Only values of type @code{AWK_NUMBER} and @code{AWK_STRING} are allowed. Any other type -is rejected. While @code{AWK_UNDEFINED} could be allowed, doing so would -result in inferior performance. +Create a cached string or numeric value from @code{value} for +efficient later assignment. Only values of type @code{AWK_NUMBER} +and @code{AWK_STRING} are allowed. Any other type is rejected. +@code{AWK_UNDEFINED} could be allowed, but doing so would result in +inferior performance. @item awk_bool_t release_value(awk_value_cookie_t vc); Release the memory associated with a value cookie obtained @@ -32082,7 +32091,7 @@ do_magic(int nargs, awk_value_t *result) @end example @noindent -Using value cookies in this way saves considerable storage, since all of +Using value cookies in this way saves considerable storage, as all of @code{VAR1} through @code{VAR100} share the same value. You might be wondering, ``Is this sharing problematic? @@ -32104,7 +32113,7 @@ you should release any cached values that you created, using @subsection Array Manipulation @cindex array manipulation in extensions -The primary data structure@footnote{Okay, the only data structure.} in @command{awk} +The primary data structure@footnote{OK, the only data structure.} in @command{awk} is the associative array (@pxref{Arrays}). Extensions need to be able to manipulate @command{awk} arrays. The API provides a number of data structures for working with arrays, @@ -32125,7 +32134,7 @@ both work with and create true arrays of arrays (@pxref{General Data Types}). @node Array Data Types @subsubsection Array Data Types -The data types associated with arrays are listed below. +The data types associated with arrays are as follows: @table @code @item typedef void *awk_array_t; @@ -32244,7 +32253,7 @@ The following functions relate to arrays as a whole: @table @code @item awk_array_t create_array(void); Create a new array to which elements may be added. -@xref{Creating Arrays}, for a discussion of how to +@DBXREF{Creating Arrays} for a discussion of how to create a new array and add elements to it. @item awk_bool_t clear_array(awk_array_t a_cookie); @@ -32279,7 +32288,7 @@ The function returns true upon success, false otherwise. @node Flattening Arrays @subsubsection Working With All The Elements of an Array -To @dfn{flatten} an array is create a structure that +To @dfn{flatten} an array is to create a structure that represents the full array in a fashion that makes it easy for C code to traverse the entire array. Test code in @file{extension/testext.c} does this, and also serves @@ -32447,7 +32456,7 @@ code) once you have called @code{release_flattened_array()}: @} @end example -Finally, since everything was successful, the function sets the +Finally, because everything was successful, the function sets the return value to success, and returns: @example @@ -32482,7 +32491,7 @@ code can access them and manipulate them. There are two important points about creating arrays from extension code: -@enumerate 1 +@itemize @value{BULLET} @item You must install a new array into @command{gawk}'s symbol table immediately upon creating it. Once you have done so, @@ -32524,7 +32533,7 @@ new_array = val.array_cookie; /* YOU MUST DO THIS */ If installing an array as a subarray, you must also retrieve the value of the array cookie after the call to @code{set_element()}. -@end enumerate +@end itemize The following C code is a simple test extension to create an array with two regular elements and with a subarray. The leading @code{#include} @@ -32643,7 +32652,7 @@ dl_load_func(func_table, testarray, "") @end ignore @end example -Here is sample script that loads the extension +Here is a sample script that loads the extension and then dumps the array: @example @@ -32673,7 +32682,7 @@ $ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk} @end example @noindent -(@xref{Finding Extensions}, for more information on the +(@DBXREF{Finding Extensions} for more information on the @env{AWKLIBPATH} environment variable.) @node Extension API Variables @@ -32785,8 +32794,8 @@ The others should not change during execution. As mentioned earlier (@pxref{Extension Mechanism Outline}), the function definitions as presented are really macros. To use these macros, your extension must provide a small amount of boilerplate code (variables and -functions) towards the top of your source file, using predefined names -as described below. The boilerplate needed is also provided in comments +functions) toward the top of your source file, using predefined names +as described here. The boilerplate needed is also provided in comments in the @file{gawkapi.h} header file: @example @@ -32874,7 +32883,7 @@ This macro expands to a @code{dl_load()} function that performs all the necessary initializations. @end table -The point of the all the variables and arrays is to let the +The point of all the variables and arrays is to let the @code{dl_load()} function (from the @code{dl_load_func()} macro) do all the standard work. It does the following: @@ -32909,7 +32918,7 @@ Compiled extensions have to be installed in a directory where built in the default fashion, the directory in which to find extensions is @file{/usr/local/lib/gawk}. You can also specify a search path with a list of directories to search for compiled extensions. -@xref{AWKLIBPATH Variable}, for more information. +@DBXREF{AWKLIBPATH Variable} for more information. @node Extension Example @section Example: Some File Functions @@ -32917,7 +32926,7 @@ path with a list of directories to search for compiled extensions. @quotation @i{No matter where you go, there you are.} -@author Buckaroo Bonzai +@author Buckaroo Banzai @end quotation @c It's enough to show chdir and stat, no need for fts @@ -33092,7 +33101,7 @@ The file includes a number of standard header files, and then includes the @file{gawkapi.h} header file which provides the API definitions. Those are followed by the necessary variable declarations to make use of the API macros and boilerplate code -(@pxref{Extension API Boilerplate}). +(@pxref{Extension API Boilerplate}): @example #ifdef HAVE_CONFIG_H @@ -33133,7 +33142,7 @@ that implements it is called @code{do_foo()}. The function should have two arguments: the first is an @code{int} usually called @code{nargs}, that represents the number of actual arguments for the function. The second is a pointer to an @code{awk_value_t}, usually named -@code{result}. +@code{result}: @example /* do_chdir --- provide dynamically loaded chdir() function for gawk */ @@ -33153,13 +33162,13 @@ do_chdir(int nargs, awk_value_t *result) @end example The @code{newdir} -variable represents the new directory to change to, retrieved +variable represents the new directory to change to, which is retrieved with @code{get_argument()}. Note that the first argument is numbered zero. If the argument is retrieved successfully, the function calls the @code{chdir()} system call. If the @code{chdir()} fails, @code{ERRNO} -is updated. +is updated: @example if (get_argument(0, AWK_STRING, & newdir)) @{ @@ -33360,7 +33369,7 @@ of @code{stat()}) to get the file information, in case the file is a symbolic link. However, if there were three arguments, @code{statfunc} is set point to @code{stat()}, instead. -Here is the @code{do_stat()} function. It starts with +Here is the @code{do_stat()} function, which starts with variable declarations and argument checking: @ignore @@ -33475,7 +33484,7 @@ dl_load_func(func_table, filefuncs, "") And that's it! @node Using Internal File Ops -@subsection Integrating The Extensions +@subsection Integrating the Extensions @cindex @command{gawk}, interpreter@comma{} adding code to Now that the code is written, it must be possible to add it at @@ -33484,9 +33493,9 @@ code must be compiled. Assuming that the functions are in a file named @file{filefuncs.c}, and @var{idir} is the location of the @file{gawkapi.h} header file, the following steps@footnote{In practice, you would probably want to -use the GNU Autotools---Automake, Autoconf, Libtool, and @command{gettext}---to +use the GNU Autotools (Automake, Autoconf, Libtool, and @command{gettext}) to configure and build your libraries. Instructions for doing so are beyond -the scope of this @value{DOCUMENT}. @xref{gawkextlib}, for Internet links to +the scope of this @value{DOCUMENT}. @DBXREF{gawkextlib} for Internet links to the tools.} create a GNU/Linux shared library: @example @@ -33494,7 +33503,7 @@ $ @kbd{gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -I@var{idir} filefuncs.c} $ @kbd{gcc -o filefuncs.so -shared filefuncs.o} @end example -Once the library exists, it is loaded by using the @code{@@load} keyword. +Once the library exists, it is loaded by using the @code{@@load} keyword: @example # file testff.awk @@ -33558,13 +33567,14 @@ $ @kbd{AWKLIBPATH=$PWD gawk -f testff.awk} @end example @node Extension Samples -@section The Sample Extensions In The @command{gawk} Distribution +@section The Sample Extensions in the @command{gawk} Distribution @cindex extensions distributed with @command{gawk} This @value{SECTION} provides brief overviews of the sample extensions that come in the @command{gawk} distribution. Some of them are intended -for production use, such the @code{filefuncs}, @code{readdir} and @code{inplace} extensions. -Others mainly provide example code that shows how to use the extension API. +for production use (e.g., the @code{filefuncs}, @code{readdir} and +@code{inplace} extensions). Others mainly provide example code that +shows how to use the extension API. @menu * Extension Sample File Functions:: The file functions sample. @@ -33585,7 +33595,7 @@ Others mainly provide example code that shows how to use the extension API. @end menu @node Extension Sample File Functions -@subsection File Related Functions +@subsection File-Related Functions The @code{filefuncs} extension provides three different functions, as follows: The usage is: -- cgit v1.2.3 From c55f68090438121e3bb7c4baa66d5bba6681f277 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 16 Nov 2014 21:18:36 +0200 Subject: Through p. 482. --- NOTES | 4 +- doc/gawktexi.in | 231 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 118 insertions(+), 117 deletions(-) diff --git a/NOTES b/NOTES index 12b6e502..f7dee5ca 100644 --- a/NOTES +++ b/NOTES @@ -21,6 +21,6 @@ the brackets, which indicate optional stuff, in Roman. I think that if you simply fix the style sheets to indent those blocks, we should be in better shape. -For me to think about: Page 396, where there's a full sentence in bold. +ADD STUFF ON danfuzz repo. -At page 438. +At page 482. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index a486a0a5..f1a57699 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -30851,8 +30851,9 @@ A simple boolean type. This represents a mutable string. @command{gawk} owns the memory pointed to if it supplied the value. Otherwise, it takes ownership of the memory pointed to. -@strong{Such memory must come from calling one of the -@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()} functions!} +@emph{Such memory must come from calling one of the +@code{gawk_malloc()}, @code{gawk_calloc()}, or +@code{gawk_realloc()} functions!} As mentioned earlier, strings are maintained using the current multibyte encoding. @@ -33597,7 +33598,7 @@ shows how to use the extension API. @node Extension Sample File Functions @subsection File-Related Functions -The @code{filefuncs} extension provides three different functions, as follows: +The @code{filefuncs} extension provides three different functions, as follows. The usage is: @table @asis @@ -33608,7 +33609,7 @@ This is how you load the extension. @item @code{result = chdir("/some/directory")} The @code{chdir()} function is a direct hook to the @code{chdir()} system call to change the current directory. It returns zero -upon success or less than zero upon error. In the latter case it updates +upon success or less than zero upon error. In the latter case, it updates @code{ERRNO}. @cindex @code{stat()} extension function @@ -33616,7 +33617,7 @@ upon success or less than zero upon error. In the latter case it updates The @code{stat()} function provides a hook into the @code{stat()} system call. It returns zero upon success or less than zero upon error. -In the latter case it updates @code{ERRNO}. +In the latter case, it updates @code{ERRNO}. By default, it uses the @code{lstat()} system call. However, if passed a third argument, it uses @code{stat()} instead. @@ -33663,8 +33664,8 @@ Not all systems support all file types. @tab All @item @code{flags = or(FTS_PHYSICAL, ...)} @itemx @code{result = fts(pathlist, flags, filedata)} Walk the file trees provided in @code{pathlist} and fill in the -@code{filedata} array as described below. @code{flags} is the bitwise -OR of several predefined values, also described below. +@code{filedata} array as described next. @code{flags} is the bitwise +OR of several predefined values, also described in a moment. Return zero if there were no errors, otherwise return @minus{}1. @end table @@ -33712,7 +33713,7 @@ whether or not @code{FTS_LOGICAL} is set. By default, the C library @code{fts()} routines do not return entries for @file{.} (dot) and @file{..} (dot-dot). This option causes entries for dot-dot to also be included. (The extension always includes an entry -for dot, see below.) +for dot; more on this in a moment.) @item FTS_XDEV During a traversal, do not cross onto a different mounted filesystem. @@ -33722,7 +33723,7 @@ During a traversal, do not cross onto a different mounted filesystem. The @code{filedata} array is first cleared. Then, @code{fts()} creates an element in @code{filedata} for every element in @code{pathlist}. The index is the name of the directory or file given in @code{pathlist}. -The element for this index is itself an array. There are two cases. +The element for this index is itself an array. There are two cases: @c nested table @table @emph @@ -33748,8 +33749,8 @@ contain an element named @code{"error"}, which is a string describing the error. @item The path is a directory In this case, the array contains one element for each entry in the -directory. If an entry is a file, that element is as for files, just -described. If the entry is a directory, that element is (recursively), +directory. If an entry is a file, that element is the same as for files, just +described. If the entry is a directory, that element is (recursively) an array describing the subdirectory. If @code{FTS_SEEDOT} was provided in the flags, then there will also be an element named @code{".."}. This element will be an array containing the data as provided by @code{stat()}. @@ -33768,8 +33769,8 @@ The @code{fts()} extension does not exactly mimic the interface of the C library @code{fts()} routines, choosing instead to provide an interface that is based on associative arrays, which is more comfortable to use from an @command{awk} program. This includes the -lack of a comparison function, since @command{gawk} already provides -powerful array sorting facilities. While an @code{fts_read()}-like +lack of a comparison function, because @command{gawk} already provides +powerful array sorting facilities. Although an @code{fts_read()}-like interface could have been provided, this felt less natural than simply creating a multidimensional array to represent the file hierarchy and its information. @@ -33779,7 +33780,7 @@ See @file{test/fts.awk} in the @command{gawk} distribution for an example use of the @code{fts()} extension function. @node Extension Sample Fnmatch -@subsection Interface To @code{fnmatch()} +@subsection Interface to @code{fnmatch()} This extension provides an interface to the C library @code{fnmatch()} function. The usage is: @@ -33792,10 +33793,10 @@ This is how you load the extension. @item result = fnmatch(pattern, string, flags) The return value is zero on success, @code{FNM_NOMATCH} if the string did not match the pattern, or -a different non-zero value if an error occurred. +a different nonzero value if an error occurred. @end table -Besides the @code{fnmatch()} function, the @code{fnmatch} extension +In addition to the @code{fnmatch()} function, the @code{fnmatch} extension adds one constant (@code{FNM_NOMATCH}), and an array of flag values named @code{FNM}. @@ -33813,7 +33814,7 @@ Either zero, or the bitwise OR of one or more of the flags in the @code{FNM} array. @end table -The flags are follows: +The flags are as follows: @multitable @columnfractions .25 .75 @headitem Array element @tab Corresponding flag defined by @code{fnmatch()} @@ -33836,9 +33837,9 @@ if (fnmatch("*.a", "foo.c", flags) == FNM_NOMATCH) @end example @node Extension Sample Fork -@subsection Interface To @code{fork()}, @code{wait()} and @code{waitpid()} +@subsection Interface to @code{fork()}, @code{wait()}, and @code{waitpid()} -The @code{fork} extension adds three functions, as follows. +The @code{fork} extension adds three functions, as follows: @table @code @item @@load "fork" @@ -33936,7 +33937,7 @@ $ @kbd{gawk -i inplace -v INPLACE_SUFFIX=.bak '@{ gsub(/foo/, "bar") @}} @subsection Character and Numeric values: @code{ord()} and @code{chr()} The @code{ordchr} extension adds two functions, named -@code{ord()} and @code{chr()}, as follows. +@code{ord()} and @code{chr()}, as follows: @table @code @item @@load "ordchr" @@ -33984,7 +33985,7 @@ indicating the type of the file. The letters and their corresponding file types are shown in @ref{table-readdir-file-types}. @float Table,table-readdir-file-types -@caption{File Types Returned By The @code{readdir} Extension} +@caption{File types returned by the @code{readdir} extension} @multitable @columnfractions .1 .9 @headitem Letter @tab File Type @item @code{b} @tab Block device @@ -34021,7 +34022,7 @@ BEGIN @{ FS = "/" @} @subsection Reversing Output The @code{revoutput} extension adds a simple output wrapper that reverses -the characters in each output line. It's main purpose is to show how to +the characters in each output line. Its main purpose is to show how to write an output wrapper, although it may be mildly amusing for the unwary. Here is an example: @@ -34043,7 +34044,7 @@ The output from this program is: The @code{revtwoway} extension adds a simple two-way processor that reverses the characters in each line sent to it for reading back by -the @command{awk} program. It's main purpose is to show how to write +the @command{awk} program. Its main purpose is to show how to write a two-way processor, although it may also be mildly amusing. The following example shows how to use it: @@ -34070,7 +34071,7 @@ is: @samp{cinap t'nod}. @node Extension Sample Read write array -@subsection Dumping and Restoring An Array +@subsection Dumping and Restoring an Array The @code{rwarray} extension adds two functions, named @code{writea()} and @code{reada()}, as follows: @@ -34096,7 +34097,7 @@ Here too, the return value is one on success and zero upon failure. The array created by @code{reada()} is identical to that written by @code{writea()} in the sense that the contents are the same. However, -due to implementation issues, the array traversal order of the recreated +due to implementation issues, the array traversal order of the re-created array is likely to be different from that of the original array. As array traversal order in @command{awk} is by default undefined, this is (technically) not a problem. If you need to guarantee a particular traversal @@ -34104,7 +34105,7 @@ order, use the array sorting features in @command{gawk} to do so (@pxref{Array Sorting}). The file contains binary data. All integral values are written in network -byte order. However, double precision floating-point values are written +byte order. However, double-precision floating-point values are written as native binary data. Thus, arrays containing only string data can theoretically be dumped on systems with one byte order and restored on systems with a different one, but this has not been tried. @@ -34120,7 +34121,7 @@ ret = reada("arraydump.bin", array) @end example @node Extension Sample Readfile -@subsection Reading An Entire File +@subsection Reading an Entire File The @code{readfile} extension adds a single function named @code{readfile()}, and an input parser: @@ -34167,7 +34168,7 @@ This is how you load the extension. @cindex @code{gettimeofday()} extension function @item the_time = gettimeofday() Return the time in seconds that has elapsed since 1970-01-01 UTC as a -floating point value. If the time is unavailable on this platform, return +floating-point value. If the time is unavailable on this platform, return @minus{}1 and set @code{ERRNO}. The returned time should have sub-second precision, but the actual precision may vary based on the platform. If the standard C @code{gettimeofday()} system call is available on this @@ -34210,22 +34211,22 @@ As of this writing, there are five extensions: @itemize @value{BULLET} @item -GD graphics library extension. +GD graphics library extension @item -PDF extension. +PDF extension @item -PostgreSQL extension. +PostgreSQL extension @item -MPFR library extension. -This provides access to a number of MPFR functions which @command{gawk}'s -native MPFR support does not. +MPFR library extension +(this provides access to a number of MPFR functions which @command{gawk}'s +native MPFR support does not) @item XML parser extension, using the @uref{http://expat.sourceforge.net, Expat} -XML parsing library. +XML parsing library @end itemize @cindex @command{git} utility @@ -34276,9 +34277,9 @@ to install both @command{gawk} and @code{gawkextlib}, depending upon how your system works. If you write an extension that you wish to share with other -@command{gawk} users, please consider doing so through the +@command{gawk} users, consider doing so through the @code{gawkextlib} project. -See the project's web site for more information. +See the project's website for more information. @node Extension summary @section Summary @@ -34286,7 +34287,7 @@ See the project's web site for more information. @itemize @value{BULLET} @item You can write extensions (sometimes called plug-ins) for @command{gawk} -in C or C++ using the Application Programming Interface (API) defined +in C or C++ using the application programming interface (API) defined by the @command{gawk} developers. @item @@ -34317,44 +34318,44 @@ API function pointers are provided for the following kinds of operations: @itemize @value{BULLET} @item -Allocating, reallocating, and releasing memory. +Allocating, reallocating, and releasing memory @item -Registration functions. You may register +Registration functions (you may register extension functions, exit callbacks, a version string, input parsers, output wrappers, -and two-way processors. +and two-way processors) @item -Printing fatal, warning, and ``lint'' warning messages. +Printing fatal, warning, and ``lint'' warning messages @item -Updating @code{ERRNO}, or unsetting it. +Updating @code{ERRNO}, or unsetting it @item Accessing parameters, including converting an undefined parameter into -an array. +an array @item -Symbol table access: retrieving a global variable, creating one, -or changing one. +Symbol table access (retrieving a global variable, creating one, +or changing one) @item Creating and releasing cached values; this provides an efficient way to use values for multiple variables and -can be a big performance win. +can be a big performance win @item -Manipulating arrays: -retrieving, adding, deleting, and modifying elements; +Manipulating arrays +(retrieving, adding, deleting, and modifying elements; getting the count of elements in an array; creating a new array; clearing an array; and -flattening an array for easy C style looping over all its indices and elements. +flattening an array for easy C style looping over all its indices and elements) @end itemize @item @@ -34433,34 +34434,34 @@ and the Glossary: @end ifclear @ifset FOR_PRINT -Part IV contains two appendices and the license that +Part IV contains three appendices, the last of which is the license that covers the @command{gawk} source code: @end ifset @itemize @value{BULLET} @item -@ref{Language History}. +@ref{Language History} @item -@ref{Installation}. +@ref{Installation} @ifclear FOR_PRINT @item -@ref{Notes}. +@ref{Notes} @item -@ref{Basic Concepts}. +@ref{Basic Concepts} @item -@ref{Glossary}. +@ref{Glossary} @end ifclear @item -@ref{Copying}. +@ref{Copying} @ifclear FOR_PRINT @item -@ref{GNU Free Documentation License}. +@ref{GNU Free Documentation License} @end ifclear @end itemize @end ifdocbook @@ -34469,7 +34470,7 @@ covers the @command{gawk} source code: @appendix The Evolution of the @command{awk} Language This @value{DOCUMENT} describes the GNU implementation of @command{awk}, -which follows the POSIX specification. Many long-time @command{awk} +which follows the POSIX specification. Many longtime @command{awk} users learned @command{awk} programming with the original @command{awk} implementation in Version 7 Unix. (This implementation was the basis for @command{awk} in Berkeley Unix, through 4.3-Reno. Subsequent versions @@ -34704,7 +34705,7 @@ The ability to delete all of an array at once with @samp{delete @var{array}} @end itemize -@xref{Common Extensions}, for a list of common extensions +@DBXREF{Common Extensions} for a list of common extensions not permitted by the POSIX standard. The 2008 POSIX standard can be found online at @@ -34724,7 +34725,7 @@ has made his version available via his home page (@pxref{Other Versions}). This @value{SECTION} describes common extensions that -originally appeared in his version of @command{awk}. +originally appeared in his version of @command{awk}: @itemize @value{BULLET} @item @@ -34750,7 +34751,7 @@ or array elements through it. @end ignore @end itemize -@xref{Common Extensions}, for a full list of the extensions +@DBXREF{Common Extensions} for a full list of the extensions available in his @command{awk}. @node POSIX/GNU @@ -34806,7 +34807,7 @@ The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr} and @item The @file{/inet}, @file{/inet4}, and @samp{/inet6} special files for TCP/IP networking using @samp{|&} to specify which version of the -IP protocol to use. +IP protocol to use (@pxref{TCP/IP Networking}). @end itemize @@ -34854,7 +34855,7 @@ New keywords: @itemize @value{MINUS} @item -The @code{BEGINFILE} and @code{ENDFILE} special patterns. +The @code{BEGINFILE} and @code{ENDFILE} special patterns (@pxref{BEGINFILE/ENDFILE}). @item @@ -34891,7 +34892,7 @@ making translations easier @item The @code{split()} function's additional optional fourth -argument which is an array to hold the text of the field separators. +argument which is an array to hold the text of the field separators (@pxref{String Functions}). @end itemize @@ -35693,7 +35694,7 @@ The dynamic extension interface was completely redone @cindex extensions, @command{mawk} The following table summarizes the common extensions supported by @command{gawk}, Brian Kernighan's @command{awk}, and @command{mawk}, -the three most widely-used freely available versions of @command{awk} +the three most widely used freely available versions of @command{awk} (@pxref{Other Versions}). @multitable {@file{/dev/stderr} special file} {BWK Awk} {Mawk} {GNU Awk} {Now standard} @@ -35711,7 +35712,7 @@ the three most widely-used freely available versions of @command{awk} @item @code{func} keyword @tab X @tab @tab X @tab @item @code{BINMODE} variable @tab @tab X @tab X @tab @item @code{RS} as regexp @tab @tab X @tab X @tab -@item Time related functions @tab @tab X @tab X @tab +@item Time-related functions @tab @tab X @tab X @tab @end multitable @node Ranges and Locales @@ -35727,7 +35728,7 @@ the first character in the range and the last character in the range, inclusive. Ordering was based on the numeric value of each character in the machine's native character set. Thus, on ASCII-based systems, @samp{[a-z]} matched all the lowercase letters, and only the lowercase -letters, since the numeric values for the letters from @samp{a} through +letters, as the numeric values for the letters from @samp{a} through @samp{z} were contiguous. (On an EBCDIC system, the range @samp{[a-z]} includes additional, non-alphabetic characters as well.) @@ -35738,8 +35739,8 @@ that @samp{[A-Z]} was the ``correct'' way to match uppercase letters. And indeed, this was true.@footnote{And Life was good.} The 1992 POSIX standard introduced the idea of locales (@pxref{Locales}). -Since many locales include other letters besides the plain twenty-six -letters of the American English alphabet, the POSIX standard added +Because many locales include other letters besides the plain 26 +letters of the English alphabet, the POSIX standard added character classes (@pxref{Bracket Expressions}) as a way to match different kinds of characters besides the traditional ones in the ASCII character set. @@ -35756,7 +35757,7 @@ In other words, these locales sort characters in dictionary order, and @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]}; instead it might be equivalent to @samp{[ABCXYabcdxyz]}, for example. -This point needs to be emphasized: Much literature teaches that you should +This point needs to be emphasized: much literature teaches that you should use @samp{[a-z]} to match a lowercase character. But on systems with non-ASCII locales, this also matches all of the uppercase characters except @samp{A} or @samp{Z}! This was a continuous cause of confusion, even well @@ -35772,7 +35773,7 @@ $ @kbd{echo something1234abc | gawk-3.1.8 '@{ sub("[A-Z]*$", ""); print @}'} @end example @noindent -This output is unexpected, since the @samp{bc} at the end of +This output is unexpected, as the @samp{bc} at the end of @samp{something1234abc} should not normally match @samp{[A-Z]*}. This result is due to the locale setting (and thus you may not see it on your system). @@ -35794,7 +35795,7 @@ like ``why does @samp{[A-Z]} match lowercase letters?!?'' @cindex Berry, Karl This situation existed for close to 10 years, if not more, and the @command{gawk} maintainer grew weary of trying to explain that -@command{gawk} was being nicely standards-compliant, and that the issue +@command{gawk} was being nicely standards compliant, and that the issue was in the user's locale. During the development of @value{PVERSION} 4.0, he modified @command{gawk} to always treat ranges in the original, pre-POSIX fashion, unless @option{--posix} was used (@pxref{Options}).@footnote{And @@ -36007,7 +36008,7 @@ Michael Benzinger contributed the initial code for @code{switch} statements. @cindex McPhee, Patrick Patrick T.J.@: McPhee contributed the code for dynamic loading in Windows32 environments. -(This is no longer supported) +(This is no longer supported.) @item @cindex Wallin, Anders @@ -36031,7 +36032,7 @@ into a byte-code interpreter, including the debugger. The addition of true arrays of arrays. @item -The additional modifications for support of arbitrary precision arithmetic. +The additional modifications for support of arbitrary-precision arithmetic. @item The initial text of @@ -36087,7 +36088,7 @@ helping David Trueman, and as the primary maintainer since around 1994. @itemize @value{BULLET} @item The @command{awk} language has evolved over time. The first release -was with V7 Unix circa 1978. In 1987 for System V Release 3.1, +was with V7 Unix circa 1978. In 1987, for System V Release 3.1, major additions, including user-defined functions, were made to the language. Additional changes were made for System V Release 4, in 1989. Since then, further minor changes happen under the auspices of the @@ -36129,8 +36130,8 @@ This appendix provides instructions for installing @command{gawk} on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are contributed. -@xref{Bugs}, -for the electronic mail addresses of the people who maintain +@DBXREF{Bugs} +for the email addresses of the people who maintain the respective ports. @menu @@ -36184,7 +36185,7 @@ wget http://ftp.gnu.org/gnu/gawk/gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz The GNU software archive is mirrored around the world. The up-to-date list of mirror sites is available from -@uref{http://www.gnu.org/order/ftp.html, the main FSF web site}. +@uref{http://www.gnu.org/order/ftp.html, the main FSF website}. Try to use one of the mirrors; they will be less busy, and you can usually find one closer to your site. @@ -36195,7 +36196,7 @@ different compression programs: @command{gzip}, @command{bzip2}, and @command{xz}. For simplicity, the rest of these instructions assume you are using the one compressed with the GNU Zip program, @code{gzip}. -Once you have the distribution (for example, +Once you have the distribution (e.g., @file{gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz}), use @code{gzip} to expand the file and then use @code{tar} to extract it. You can use the following @@ -36288,7 +36289,7 @@ as a list of things that the POSIX standard should describe but does not. @item doc/awkforai.txt Pointers to the original draft of a short article describing why @command{gawk} is a good language for -Artificial Intelligence (AI) programming. +artificial intelligence (AI) programming. @item doc/bc_notes A brief description of @command{gawk}'s ``byte code'' internals. @@ -36394,7 +36395,7 @@ source file for this @value{DOCUMENT}. It also contains a @file{Makefile.in} fil The library functions from @ref{Library Functions}, and the @command{igawk} program from -@ref{Igawk Program}, +@DBREF{Igawk Program} are included as ready-to-use files in the @command{gawk} distribution. They are installed as part of the installation process. The rest of the programs in this @value{DOCUMENT} are available in appropriate @@ -36413,11 +36414,11 @@ Files needed for building @command{gawk} under MS-Windows @ifclear FOR_PRINT and OS/2 @end ifclear -(@pxref{PC Installation}, for details). +(@DBPXREF{PC Installation} for details). @item vms/* Files needed for building @command{gawk} under Vax/VMS and OpenVMS -(@pxref{VMS Installation}, for details). +(@DBPXREF{VMS Installation} for details). @item test/* A test suite for @@ -36429,7 +36430,7 @@ be confident of a successful port. @c ENDOFRANGE gawdis @node Unix Installation -@appendixsec Compiling and Installing @command{gawk} on Unix-like Systems +@appendixsec Compiling and Installing @command{gawk} on Unix-Like Systems Usually, you can compile and install @command{gawk} by typing only two commands. However, if you use an unusual system, you may need @@ -36442,7 +36443,7 @@ to configure @command{gawk} for your system yourself. @end menu @node Quick Installation -@appendixsubsec Compiling @command{gawk} for Unix-like Systems +@appendixsubsec Compiling @command{gawk} for Unix-Like Systems The normal installation steps should work on all modern commercial Unix-derived systems, GNU/Linux, BSD-based systems, and the Cygwin @@ -36459,7 +36460,7 @@ described fully in @cite{Autoconf---Generating Automatic Configuration Scripts}, which can be found online at @uref{http://www.gnu.org/software/autoconf/manual/index.html, -the Free Software Foundation's web site}.) +the Free Software Foundation's website}.) @end ifnotinfo @ifinfo (The Autoconf software is described fully starting with @@ -36506,7 +36507,7 @@ run @samp{make check}. All of the tests should succeed. If these steps do not work, or if any of the tests fail, check the files in the @file{README_d} directory to see if you've found a known problem. If the failure is not described there, -please send in a bug report (@pxref{Bugs}). +send in a bug report (@pxref{Bugs}). Of course, once you've built @command{gawk}, it is likely that you will wish to install it. To do so, you need to run the command @samp{make @@ -36570,7 +36571,7 @@ function for deficient systems. @end table Use the command @samp{./configure --help} to see the full list of -options that @command{configure} supplies. +options supplied by @command{configure}. @node Configuration Philosophy @appendixsubsec The Configuration Process @@ -36604,19 +36605,19 @@ facts about your operating system. For example, there may not be an @cindex @code{custom.h} file It is possible for your C compiler to lie to @command{configure}. It may do so by not exiting with an error when a library function is not -available. To get around this, edit the file @file{custom.h}. +available. To get around this, edit the @file{custom.h} file. Use an @samp{#ifdef} that is appropriate for your system, and either @code{#define} any constants that @command{configure} should have defined but didn't, or @code{#undef} any constants that @command{configure} defined and -should not have. @file{custom.h} is automatically included by -@file{config.h}. +should not have. The @file{custom.h} file is automatically included by +the @file{config.h} file. It is also possible that the @command{configure} program generated by Autoconf will not work on your system in some other fashion. -If you do have a problem, the file @file{configure.ac} is the input for +If you do have a problem, the @file{configure.ac} file is the input for Autoconf. You may be able to change this file and generate a new version of @command{configure} that works on your system -(@pxref{Bugs}, +(@DBPXREF{Bugs} for information on how to report problems in configuring @command{gawk}). The same mechanism may be used to send in updates to @file{configure.ac} and/or @file{custom.h}. @@ -36656,7 +36657,7 @@ The limitations of MS-DOS (and MS-DOS shells under the other operating systems) has meant that various ``DOS extenders'' are often used with programs such as @command{gawk}. The varying capabilities of Microsoft Windows 3.1 and Windows32 can add to the confusion. For an overview -of the considerations, please refer to @file{README_d/README.pc} in +of the considerations, refer to @file{README_d/README.pc} in the distribution. @menu @@ -37029,7 +37030,7 @@ need to use the @code{BINMODE} variable. This can cause problems with other Unix-like components that have been ported to MS-Windows that expect @command{gawk} to do automatic -translation of @code{"\r\n"}, since it won't. +translation of @code{"\r\n"}, because it won't. @node VMS Installation @appendixsubsec Compiling and Installing @command{gawk} on Vax/VMS and OpenVMS @@ -37093,14 +37094,14 @@ The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha and IA64 VMS 8.4 used HP C 7.3.@footnote{The IA64 architecture is also known as ``Itanium.''} -@xref{VMS GNV}, for information on building +@DBXREF{VMS GNV} for information on building @command{gawk} as a PCSI kit that is compatible with the GNV product. @node VMS Dynamic Extensions @appendixsubsubsec Compiling @command{gawk} Dynamic Extensions on VMS The extensions that have been ported to VMS can be built using one of -the following commands. +the following commands: @example $ @kbd{MMS/DESCRIPTION=[.vms]descrip.mms extensions} @@ -37117,7 +37118,7 @@ $ @kbd{MMK/DESCRIPTION=[.vms]descrip.mms extensions} or a logical name to find the dynamic extensions. Dynamic extensions need to be compiled with the same compiler options for -floating point, pointer size, and symbol name handling as were used +floating-point, pointer size, and symbol name handling as were used to compile @command{gawk} itself. Alpha and Itanium should use IEEE floating point. The pointer size is 32 bits, and the symbol name handling should be exact case with CRC shortening for @@ -37247,7 +37248,7 @@ Note that uppercase and mixed-case text must be quoted. The VMS port of @command{gawk} includes a @code{DCL}-style interface in addition to the original shell-style interface (see the help entry for details). One side effect of dual command-line parsing is that if there is only a -single parameter (as in the quoted string program above), the command +single parameter (as in the quoted string program), the command becomes ambiguous. To work around this, the normally optional @option{--} flag is required to force Unix-style parsing rather than @code{DCL} parsing. If any other dash-type options (or multiple parameters such as @value{DF}s to @@ -37370,7 +37371,7 @@ recommend compiling and using the current version. @cindex archaeologists @quotation @i{There is nothing more dangerous than a bored archaeologist.} -@author The Hitchhiker's Guide to the Galaxy +@author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy} @end quotation @c the radio show, not the book. :-) @@ -37379,10 +37380,10 @@ recommend compiling and using the current version. @c STARTOFRANGE tblgawb @cindex troubleshooting, @command{gawk}, bug reports If you have problems with @command{gawk} or think that you have found a bug, -please report it to the developers; we cannot promise to do anything +report it to the developers; we cannot promise to do anything but we might well want to fix it. -Before reporting a bug, please make sure you have really found a genuine bug. +Before reporting a bug, make sure you have really found a genuine bug. Carefully reread the documentation and see if it says you can do what you're trying to do. If it's not clear whether you should be able to do something or not, report that too; it's a bug in the documentation! @@ -37395,7 +37396,7 @@ the compiler you used to compile @command{gawk}, and the exact results @command{gawk} gave you. Also say what you expected to occur; this helps us decide whether the problem is really in the documentation. -Please include the version number of @command{gawk} you are using. +Make sure to include the version number of @command{gawk} you are using. You can get this information with the command @samp{gawk --version}. @cindex @code{bug-gawk@@gnu.org} bug reporting address @@ -37407,7 +37408,7 @@ Once you have a precise problem description, send email to The @command{gawk} maintainers subscribe to this address and thus they will receive your bug report. Although you can send mail to the maintainers directly, -the bug reporting address is preferred since the +the bug reporting address is preferred because the email list is archived at the GNU Project. @emph{All email must be in English. This is the only language understood in common by all the maintainers.} @@ -37416,19 +37417,19 @@ understood in common by all the maintainers.} @quotation CAUTION Do @emph{not} try to report bugs in @command{gawk} by posting to the Usenet/Internet newsgroup @code{comp.lang.awk}. -While the @command{gawk} developers do occasionally read this newsgroup, -there is no guarantee that we will see your posting. The steps described -above are the only official recognized way for reporting bugs. +The @command{gawk} developers do occasionally read this newsgroup, +but there is no guarantee that we will see your posting. The steps described +here are the only officially recognized way for reporting bugs. Really. @end quotation @quotation NOTE Many distributions of GNU/Linux and the various BSD-based operating systems have their own bug reporting systems. If you report a bug using your distribution's -bug reporting system, @emph{please} also send a copy to +bug reporting system, you should also send a copy to @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org}. -This is for two reasons. First, while some distributions forward +This is for two reasons. First, although some distributions forward bug reports ``upstream'' to the GNU mailing list, many don't, so there is a good chance that the @command{gawk} maintainers won't even see the bug report! Second, mail to the GNU list is archived, and having everything at the GNU project @@ -37439,8 +37440,8 @@ Non-bug suggestions are always welcome as well. If you have questions about things that are unclear in the documentation or are just obscure features, ask on the bug list; we will try to help you out if we can. -If you find bugs in one of the non-Unix ports of @command{gawk}, please -send an electronic mail message to the bug list, with a copy to the +If you find bugs in one of the non-Unix ports of @command{gawk}, +send an email to the bug list, with a copy to the person who maintains that port. They are named in the following list, as well as in the @file{README} file in the @command{gawk} distribution. Information in the @file{README} file should be considered authoritative @@ -37471,7 +37472,7 @@ The people maintaining the various @command{gawk} ports are: @item z/OS (OS/390) @tab Dave Pitts, @EMAIL{dpitts@@cozx.com,dpitts at cozx dot com}. @end multitable -If your bug is also reproducible under Unix, please send a copy of your +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 @@ -37515,7 +37516,7 @@ This @value{SECTION} briefly describes where to get them: Brian Kernighan, one of the original designers of Unix @command{awk}, has made his implementation of @command{awk} freely available. -You can retrieve this version via the World Wide Web from +You can retrieve this version via @uref{http://www.cs.princeton.edu/~bwk, his home page}. It is available in several archive formats: @@ -37538,7 +37539,7 @@ git clone git://github.com/onetrueawk/awk bwkawk @end example @noindent -The above command creates a copy of the @uref{http://www.git-scm.com, Git} +This command creates a copy of the @uref{http://www.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}. -- cgit v1.2.3 From 52edf49564243b1d6392477e7c447eeb0d8558c0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 17 Nov 2014 11:07:36 +0200 Subject: Finish up copyedits. --- doc/gawktexi.in | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/doc/gawktexi.in b/doc/gawktexi.in index f1a57699..c883faea 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -322,7 +322,7 @@ A copy of the license is included in the section entitled A copy of the license may be found on the Internet at @uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html, -the GNU Project's web site}. +the GNU Project's website}. @end ifset @enumerate a @@ -2038,13 +2038,13 @@ contributed code: the archive did not grow and the domain went unused for several years. Late in 2008, a volunteer took on the task of setting up -an @command{awk}-related web site---@uref{http://awk.info}---and did a very +an @command{awk}-related website---@uref{http://awk.info}---and did a very nice job. If you have written an interesting @command{awk} program, or have written a @command{gawk} extension that you would like to share with the rest of the world, please see @uref{http://awk.info/?contribute} for how to -contribute it to the web site. +contribute it to the website. @ignore As of this writing, this website is in search of a maintainer; please @@ -2609,7 +2609,7 @@ according to the instructions in your program. (This is different from a @dfn{compiled} language such as C, where your program is first compiled into machine code that is executed directly by your system's processor.) The @command{awk} utility is thus termed an @dfn{interpreter}. -Many modern languages are interperted. +Many modern languages are interpreted. The line beginning with @samp{#!} lists the full @value{FN} of an interpreter to run and a single optional initial command-line argument @@ -5081,7 +5081,7 @@ undefined results. (The @samp{\x} escape sequence is not allowed in POSIX @command{awk}.) @quotation CAUTION -The next major relase of @command{gawk} will change, such +The next major release of @command{gawk} will change, such that a maximum of two hexadecimal digits following the @samp{\x} will be used. @end quotation @@ -7401,7 +7401,7 @@ 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 -one of the fields contains an @emph{embedded} comma. Altough there is no +one of the fields contains an @emph{embedded} comma. Although there is no formal standard specification for CSV data,@footnote{At least, we don't know of one.} in such cases, most programs embed the field in double quotes. So we might have data like this: @@ -8407,7 +8407,7 @@ command line, but otherwise ignores it. This makes it easier to use shell wildcards with your @command{awk} program: @example -$ @kbd{gawk -f whizprog.awk *} @ii{Directories could kill this progam} +$ @kbd{gawk -f whizprog.awk *} @ii{Directories could kill this program} @end example If either of the @option{--posix} @@ -26538,7 +26538,7 @@ of @code{IGNORECASE} also affects sorting for both @code{asort()} and @code{asor Note also that the locale's sorting order does @emph{not} come into play; comparisons are based on character values only.@footnote{This is true because locale-based comparison occurs only when in -POSIX-compatibility mode, and becasue @code{asort()} and @code{asorti()} are +POSIX-compatibility mode, and because @code{asort()} and @code{asorti()} are @command{gawk} extensions, they are not available in that case.} @node Two-way I/O @@ -36820,7 +36820,7 @@ Ancient OS/2 ports of GNU @command{make} are not able to handle the Makefiles of this package. If you encounter any problems with @command{make}, try GNU Make 3.79.1 or later versions. You should find the latest version on -@uref{ftp://hobbes.nmsu.edu/pub/os2/}.@footnote{As of May, 2014, +@uref{ftp://hobbes.nmsu.edu/pub/os2/}.@footnote{As of November 2014, this site is still there, but the author could not find a package for GNU Make.} @end quotation @@ -37547,9 +37547,13 @@ directory named @file{awk}. This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely. -@xref{Common Extensions}, +@DBXREF{Common Extensions} for a list of extensions in this @command{awk} that are not in POSIX @command{awk}. +As a side note, Dan Bornstein has created a Git repository tracking +all the versions of BWK @command{awk} that he could find. It's +available at @uref{git://github.com/onetrueawk/awk}. + @cindex Brennan, Michael @cindex @command{mawk} utility @cindex source code, @command{mawk} @@ -37579,7 +37583,7 @@ Once you have it, is similar to @command{gawk}'s (@pxref{Unix Installation}). -@xref{Common Extensions}, +@DBXREF{Common Extensions} for a list of extensions in @command{mawk} that are not in POSIX @command{awk}. @cindex Sumner, Andrew @@ -37641,8 +37645,8 @@ has not been done, at least to our knowledge. @cindex Illumos @cindex Illumos, POSIX-compliant @command{awk} @cindex source code, Illumos @command{awk} -The source code used to be available from the OpenSolaris web site. -However, that project was ended and the web site shut down. Fortunately, the +The source code used to be available from the OpenSolaris website. +However, that project was ended and the website shut down. Fortunately, the @uref{http://wiki.illumos.org/display/illumos/illumos+Home, Illumos project} makes this implementation available. You can view the files one at a time from @uref{https://github.com/joyent/illumos-joyent/blob/master/usr/src/cmd/awk_xpg4}. @@ -37661,7 +37665,7 @@ from POSIX @command{awk}. More information is available on the @cindex libmawk @cindex source code, libmawk This is an embeddable @command{awk} interpreter derived from -@command{mawk}. For more information see +@command{mawk}. For more information, see @uref{http://repo.hu/projects/libmawk/}. @item @code{pawk} @@ -37675,7 +37679,7 @@ modified version of BWK @command{awk}, described earlier.) @item @w{QSE Awk} @cindex QSE Awk @cindex source code, QSE Awk -This is an embeddable @command{awk} interpreter. For more information +This is an embeddable @command{awk} interpreter. For more information, see @uref{http://code.google.com/p/qse/} and @uref{http://awk.info/?tools/qse}. @item @command{QTawk} @@ -37690,9 +37694,10 @@ including the manual and a download link. The project may also be frozen; no new code changes have been made since approximately 2008. -@item Other Versions -See also the @uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, -Wikipedia article}, for information on additional versions. +@item Other versions +See also the ``Versions and Implementations'' section of the +@uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, +Wikipedia article} for information on additional versions. @end table @c ENDOFRANGE awkim @@ -37894,7 +37899,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, web site}. +@uref{http://www.gnu.org/prep/standards_toc.html, website}. Texinfo, Info, and DVI versions are also available.) @cindex @command{gawk}, coding style in -- cgit v1.2.3 From f35c7514dda9bf9cf06580ab5870af13e0e58103 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 17 Nov 2014 11:11:29 +0200 Subject: Rebuild derived doc files, add ChangeLog entry. --- awklib/eg/lib/ftrans.awk | 2 +- awklib/eg/lib/strtonum.awk | 2 +- awklib/eg/prog/indirectcall.awk | 2 +- awklib/eg/prog/split.awk | 2 +- doc/ChangeLog | 4 + doc/gawk.info | 4127 ++++++++++++++++++++------------------- doc/gawk.texi | 2609 +++++++++++++------------ 7 files changed, 3442 insertions(+), 3306 deletions(-) diff --git a/awklib/eg/lib/ftrans.awk b/awklib/eg/lib/ftrans.awk index 2fec27ef..6461efff 100644 --- a/awklib/eg/lib/ftrans.awk +++ b/awklib/eg/lib/ftrans.awk @@ -1,4 +1,4 @@ -# ftrans.awk --- handle data file transitions +# ftrans.awk --- handle datafile transitions # # user supplies beginfile() and endfile() functions # diff --git a/awklib/eg/lib/strtonum.awk b/awklib/eg/lib/strtonum.awk index cd56a449..783496e4 100644 --- a/awklib/eg/lib/strtonum.awk +++ b/awklib/eg/lib/strtonum.awk @@ -52,7 +52,7 @@ function mystrtonum(str, ret, n, i, k, c) # a[6] = "1.e3" # a[7] = "1.32" # a[8] = "1.32E2" -# +# # for (i = 1; i in a; i++) # print a[i], strtonum(a[i]), mystrtonum(a[i]) # } diff --git a/awklib/eg/prog/indirectcall.awk b/awklib/eg/prog/indirectcall.awk index 3ecb2887..165b022a 100644 --- a/awklib/eg/prog/indirectcall.awk +++ b/awklib/eg/prog/indirectcall.awk @@ -27,7 +27,7 @@ function do_sort(first, last, compare, data, i, retval) retval = data[1] for (i = 2; i in data; i++) retval = retval " " data[i] - + return retval } # sort --- sort the data in ascending order and return it as a string diff --git a/awklib/eg/prog/split.awk b/awklib/eg/prog/split.awk index 6a7198f6..b878fa50 100644 --- a/awklib/eg/prog/split.awk +++ b/awklib/eg/prog/split.awk @@ -22,7 +22,7 @@ BEGIN { } # test argv in case reading from stdin instead of file if (i in ARGV) - i++ # skip data file name + i++ # skip datafile name if (i in ARGV) { outfile = ARGV[i] ARGV[i] = "" diff --git a/doc/ChangeLog b/doc/ChangeLog index ae3a25cd..7288fb77 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-11-17 Arnold D. Robbins + + * gawktexi.in: Copyedits applied. + 2014-11-02 Arnold D. Robbins * gawktexi.in: Comment out that I need an owner for awk.info. diff --git a/doc/gawk.info b/doc/gawk.info index 32d86905..e01a794b 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -690,24 +690,24 @@ circumstances--and our favorite programming language, AWK. The circumstances started a couple of years earlier. I was working at a new job and noticed an unplugged Unix computer sitting in the corner. No one knew how to use it, and neither did I. However, a couple of days -later it was running, and I was `root' and the one-and-only user. That -day, I began the transition from statistician to Unix programmer. +later, it was running, and I was `root' and the one-and-only user. +That day, I began the transition from statistician to Unix programmer. On one of many trips to the library or bookstore in search of books -on Unix, I found the gray AWK book, a.k.a. Aho, Kernighan and -Weinberger, `The AWK Programming Language', Addison-Wesley, 1988. -AWK's simple programming paradigm--find a pattern in the input and then -perform an action--often reduced complex or tedious data manipulations -to a few lines of code. I was excited to try my hand at programming in -AWK. +on Unix, I found the gray AWK book, a.k.a. Alfred V. Aho, Brian W. +Kernighan, and Peter J. Weinberger's `The AWK Programming Language' +(Addison-Wesley, 1988). `awk''s simple programming paradigm--find a +pattern in the input and then perform an action--often reduced complex +or tedious data manipulations to a few lines of code. I was excited to +try my hand at programming in AWK. Alas, the `awk' on my computer was a limited version of the -language described in the AWK book. I discovered that my computer had -"old `awk'" and the AWK book described "new `awk'." I learned that -this was typical; the old version refused to step aside or relinquish -its name. If a system had a new `awk', it was invariably called -`nawk', and few systems had it. The best way to get a new `awk' was to -`ftp' the source code for `gawk' from `prep.ai.mit.edu'. `gawk' was a +language described in the gray book. I discovered that my computer had +"old `awk'" and the book described "new `awk'." I learned that this +was typical; the old version refused to step aside or relinquish its +name. If a system had a new `awk', it was invariably called `nawk', +and few systems had it. The best way to get a new `awk' was to `ftp' +the source code for `gawk' from `prep.ai.mit.edu'. `gawk' was a version of new `awk' written by David Trueman and Arnold, and available under the GNU General Public License. @@ -718,14 +718,15 @@ almost any system; my wife uses `gawk' on her VMS box.) My Unix system started out unplugged from the wall; it certainly was not plugged into a network. So, oblivious to the existence of `gawk' and the Unix community in general, and desiring a new `awk', I wrote my -own, called `mawk'. Before I was finished I knew about `gawk', but it +own, called `mawk'. Before I was finished, I knew about `gawk', but it was too late to stop, so I eventually posted to a `comp.sources' newsgroup. A few days after my posting, I got a friendly email from Arnold introducing himself. He suggested we share design and algorithms and attached a draft of the POSIX standard so that I could update `mawk' to -support language extensions added after publication of the AWK book. +support language extensions added after publication of `The AWK +Programming Language'. Frankly, if our roles had been reversed, I would not have been so open and we probably would have never met. I'm glad we did meet. He @@ -739,9 +740,9 @@ a definitive reference to the AWK language as defined by the 1987 Bell Laboratories release and codified in the 1992 POSIX Utilities standard. On the other hand, the novice AWK programmer can study a wealth of -practical programs that emphasize the power of AWK's basic idioms: data -driven control-flow, pattern matching with regular expressions, and -associative arrays. Those looking for something new can try out +practical programs that emphasize the power of AWK's basic idioms: +data-driven control flow, pattern matching with regular expressions, +and associative arrays. Those looking for something new can try out `gawk''s interface to network protocols via special `/inet' files. The programs in this book make clear that an AWK program is @@ -764,7 +765,7 @@ want to learn how, then read this book. Michael Brennan Author of `mawk' - March, 2001 + March 2001  File: gawk.info, Node: Foreword4, Next: Preface, Prev: Foreword3, Up: Top @@ -798,7 +799,7 @@ help you learn the ins and outs. Michael Brennan Author of `mawk' - October, 2014 + October 2014  File: gawk.info, Node: Preface, Next: Getting Started, Prev: Foreword4, Up: Top @@ -814,12 +815,12 @@ rest of the file alone. Such jobs are often easy with `awk'. The makes it easy to handle simple data-reformatting jobs. The GNU implementation of `awk' is called `gawk'; if you invoke it -with the proper options or environment variables it is fully compatible -with the POSIX(1) specification of the `awk' language and with the Unix -version of `awk' maintained by Brian Kernighan. This means that all -properly written `awk' programs should work with `gawk'. So most of -the time, we don't distinguish between `gawk' and other `awk' -implementations. +with the proper options or environment variables, it is fully +compatible with the POSIX(1) specification of the `awk' language and +with the Unix version of `awk' maintained by Brian Kernighan. This +means that all properly written `awk' programs should work with `gawk'. +So most of the time, we don't distinguish between `gawk' and other +`awk' implementations. Using `awk' you can: @@ -892,7 +893,7 @@ File: gawk.info, Node: History, Next: Names, Up: Preface History of `awk' and `gawk' =========================== - Recipe For A Programming Language + Recipe for a Programming Language 1 part `egrep' 1 part `snobol' 2 parts `ed' 3 parts C @@ -904,7 +905,7 @@ release. Document very well and release. The name `awk' comes from the initials of its designers: Alfred V. -Aho, Peter J. Weinberger and Brian W. Kernighan. The original version +Aho, Peter J. Weinberger, and Brian W. Kernighan. The original version of `awk' was written in 1977 at AT&T Bell Laboratories. In 1985, a new version made the programming language more powerful, introducing user-defined functions, multiple input streams, and computed regular @@ -924,7 +925,7 @@ Circa 1994, I became the primary maintainer. Current development focuses on bug fixes, performance improvements, standards compliance and, occasionally, new features. - In May of 1997, Ju"rgen Kahrs felt the need for network access from + In May 1997, Ju"rgen Kahrs felt the need for network access from `awk', and with a little help from me, set about adding features to do this for `gawk'. At that time, he also wrote the bulk of `TCP/IP Internetworking with `gawk'' (a separate document, available as part of @@ -946,7 +947,7 @@ A Rose by Any Other Name The `awk' language has evolved over the years. Full details are provided in *note Language History::. The language described in this -Info file is often referred to as "new `awk'". By analogy, the +Info file is often referred to as "new `awk'." By analogy, the original version of `awk' is referred to as "old `awk'." Today, on most systems, when you run the `awk' utility, you get some @@ -1001,110 +1002,120 @@ heading "sidebar." the more advanced sections show only the part of the `awk' program that illustrates the concept being described. - While this Info file is aimed principally at people who have not been -exposed to `awk', there is a lot of information here that even the `awk' -expert should find useful. In particular, the description of POSIX -`awk' and the example programs in *note Library Functions::, and in -*note Sample Programs::, should be of interest. + Although this Info file is aimed principally at people who have not +been exposed to `awk', there is a lot of information here that even the +`awk' expert should find useful. In particular, the description of +POSIX `awk' and the example programs in *note Library Functions::, and +in *note Sample Programs::, should be of interest. This Info file is split into several parts, as follows: - Part I describes the `awk' language and `gawk' program in detail. -It starts with the basics, and continues through all of the features of -`awk'. It contains the following chapters: + * Part I describes the `awk' language and `gawk' program in detail. + It starts with the basics, and continues through all of the + features of `awk'. It contains the following chapters: - *note Getting Started::, provides the essentials you need to know to -begin using `awk'. + - *note Getting Started::, provides the essentials you need to + know to begin using `awk'. - *note Invoking Gawk::, describes how to run `gawk', the meaning of -its command-line options, and how it finds `awk' program source files. + - *note Invoking Gawk::, describes how to run `gawk', the + meaning of its command-line options, and how it finds `awk' + program source files. - *note Regexp::, introduces regular expressions in general, and in -particular the flavors supported by POSIX `awk' and `gawk'. + - *note Regexp::, introduces regular expressions in general, + and in particular the flavors supported by POSIX `awk' and + `gawk'. - *note Reading Files::, describes how `awk' reads your data. It -introduces the concepts of records and fields, as well as the `getline' -command. I/O redirection is first described here. Network I/O is also -briefly introduced here. + - *note Reading Files::, describes how `awk' reads your data. + It introduces the concepts of records and fields, as well as + the `getline' command. I/O redirection is first described + here. Network I/O is also briefly introduced here. - *note Printing::, describes how `awk' programs can produce output -with `print' and `printf'. + - *note Printing::, describes how `awk' programs can produce + output with `print' and `printf'. - *note Expressions::, describes expressions, which are the basic -building blocks for getting most things done in a program. + - *note Expressions::, describes expressions, which are the + basic building blocks for getting most things done in a + program. - *note Patterns and Actions::, describes how to write patterns for -matching records, actions for doing something when a record is matched, -and the predefined variables `awk' and `gawk' use. + - *note Patterns and Actions::, describes how to write patterns + for matching records, actions for doing something when a + record is matched, and the predefined variables `awk' and + `gawk' use. - *note Arrays::, covers `awk''s one-and-only data structure: -associative arrays. Deleting array elements and whole arrays is also -described, as well as sorting arrays in `gawk'. It also describes how -`gawk' provides arrays of arrays. + - *note Arrays::, covers `awk''s one-and-only data structure: + associative arrays. Deleting array elements and whole arrays + is also described, as well as sorting arrays in `gawk'. It + also describes how `gawk' provides arrays of arrays. - *note Functions::, describes the built-in functions `awk' and `gawk' -provide, as well as how to define your own functions. It also -discusses how `gawk' lets you call functions indirectly. + - *note Functions::, describes the built-in functions `awk' and + `gawk' provide, as well as how to define your own functions. + It also discusses how `gawk' lets you call functions + indirectly. - Part II shows how to use `awk' and `gawk' for problem solving. -There is lots of code here for you to read and learn from. It contains -the following chapters: + * Part II shows how to use `awk' and `gawk' for problem solving. + There is lots of code here for you to read and learn from. It + contains the following chapters: - *note Library Functions::, which provides a number of functions -meant to be used from main `awk' programs. + - *note Library Functions::, which provides a number of + functions meant to be used from main `awk' programs. - *note Sample Programs::, which provides many sample `awk' programs. + - *note Sample Programs::, which provides many sample `awk' + programs. - Reading these two chapters allows you to see `awk' solving real -problems. + Reading these two chapters allows you to see `awk' solving real + problems. - Part III focuses on features specific to `gawk'. It contains the -following chapters: + * Part III focuses on features specific to `gawk'. It contains the + following chapters: - *note Advanced Features::, describes a number of advanced features. -Of particular note are the abilities to control the order of array -traversal, have two-way communications with another process, perform -TCP/IP networking, and profile your `awk' programs. + - *note Advanced Features::, describes a number of advanced + features. Of particular note are the abilities to control + the order of array traversal, have two-way communications + with another process, perform TCP/IP networking, and profile + your `awk' programs. - *note Internationalization::, describes special features for -translating program messages into different languages at runtime. + - *note Internationalization::, describes special features for + translating program messages into different languages at + runtime. - *note Debugger::, describes the `gawk' debugger. + - *note Debugger::, describes the `gawk' debugger. - *note Arbitrary Precision Arithmetic::, describes advanced -arithmetic facilities. + - *note Arbitrary Precision Arithmetic::, describes advanced + arithmetic facilities. - *note Dynamic Extensions::, describes how to add new variables and -functions to `gawk' by writing extensions in C or C++. + - *note Dynamic Extensions::, describes how to add new + variables and functions to `gawk' by writing extensions in C + or C++. - Part IV provides the appendices, the Glossary, and two licenses that -cover the `gawk' source code and this Info file, respectively. It -contains the following appendices: + * Part IV provides the appendices, the Glossary, and two licenses + that cover the `gawk' source code and this Info file, respectively. + It contains the following appendices: - *note Language History::, describes how the `awk' language has -evolved since its first release to present. It also describes how -`gawk' has acquired features over time. + - *note Language History::, describes how the `awk' language + has evolved since its first release to present. It also + describes how `gawk' has acquired features over time. - *note Installation::, describes how to get `gawk', how to compile it -on POSIX-compatible systems, and how to compile and use it on different -non-POSIX systems. It also describes how to report bugs in `gawk' and -where to get other freely available `awk' implementations. + - *note Installation::, describes how to get `gawk', how to + compile it on POSIX-compatible systems, and how to compile + and use it on different non-POSIX systems. It also describes + how to report bugs in `gawk' and where to get other freely + available `awk' implementations. - *note Notes::, describes how to disable `gawk''s extensions, as well -as how to contribute new code to `gawk', and some possible future -directions for `gawk' development. + - *note Notes::, describes how to disable `gawk''s extensions, + as well as how to contribute new code to `gawk', and some + possible future directions for `gawk' development. - *note Basic Concepts::, provides some very cursory background -material for those who are completely unfamiliar with computer -programming. + - *note Basic Concepts::, provides some very cursory background + material for those who are completely unfamiliar with + computer programming. - The *note Glossary::, defines most, if not all, the significant -terms used throughout the Info file. If you find terms that you aren't -familiar with, try looking them up here. + The *note Glossary::, defines most, if not all of, the + significant terms used throughout the Info file. If you find + terms that you aren't familiar with, try looking them up here. - *note Copying::, and *note GNU Free Documentation License::, present -the licenses that cover the `gawk' source code and this Info file, -respectively. + - *note Copying::, and *note GNU Free Documentation License::, + present the licenses that cover the `gawk' source code and + this Info file, respectively. ---------- Footnotes ---------- @@ -1149,7 +1160,7 @@ Versions::, for information on his and other versions.) Dark Corners ------------ - Dark corners are basically fractal -- no matter how much you + Dark corners are basically fractal--no matter how much you illuminate, there's always a smaller but darker one. -- Brian Kernighan @@ -1185,7 +1196,7 @@ always available to the end user. A copy of the GPL is included for your reference (*note Copying::). The GPL applies to the C language source code for `gawk'. To find out more about the FSF and the GNU Project online, see the GNU Project's home page (http://www.gnu.org). -This Info file may also be read from their web site +This Info file may also be read from GNU's website (http://www.gnu.org/software/gawk/manual/). A shell, an editor (Emacs), highly portable optimizing C, C++, and @@ -1202,9 +1213,9 @@ from the Internet. The Info file itself has gone through multiple previous editions. Paul Rubin wrote the very first draft of `The GAWK Manual'; it was -around 40 pages in size. Diane Close and Richard Stallman improved it, -yielding a version that was around 90 pages long and barely described -the original, "old" version of `awk'. +around 40 pages long. Diane Close and Richard Stallman improved it, +yielding a version that was around 90 pages and barely described the +original, "old" version of `awk'. I started working with that version in the fall of 1988. As work on it progressed, the FSF published several preliminary versions (numbered @@ -1251,12 +1262,12 @@ contributed code: the archive did not grow and the domain went unused for several years. Late in 2008, a volunteer took on the task of setting up an -`awk'-related web site--`http://awk.info'--and did a very nice job. +`awk'-related website--`http://awk.info'--and did a very nice job. If you have written an interesting `awk' program, or have written a `gawk' extension that you would like to share with the rest of the world, please see `http://awk.info/?contribute' for how to contribute -it to the web site. +it to the website.  File: gawk.info, Node: Acknowledgments, Prev: How To Contribute, Up: Preface @@ -1336,7 +1347,7 @@ of people. *Note Contributors::, for the full list. Karl Berry who continues to work to keep the Texinfo markup language sane. - Robert P.J. Day, Michael Brennan and Brian Kernighan kindly acted as + Robert P.J. Day, Michael Brennan, and Brian Kernighan kindly acted as reviewers for the 2015 edition of this Info file. Their feedback helped improve the final work. @@ -1347,8 +1358,8 @@ have done nearly as good a job on either `gawk' or its documentation without his help. Brian is in a class by himself as a programmer and technical author. -I have to thank him (yet again) for his ongoing friendship and the role -model he has been for me for close to 30 years! Having him as a +I have to thank him (yet again) for his ongoing friendship and for +being a role model to me for close to 30 years! Having him as a reviewer is an exciting privilege. It has also been extremely humbling... @@ -1369,22 +1380,22 @@ File: gawk.info, Node: Getting Started, Next: Invoking Gawk, Prev: Preface, The basic function of `awk' is to search files for lines (or other units of text) that contain certain patterns. When a line matches one of the patterns, `awk' performs specified actions on that line. `awk' -keeps processing input lines in this way until it reaches the end of -the input files. +continues to process input lines in this way until it reaches the end +of the input files. Programs in `awk' are different from programs in most other -languages, because `awk' programs are "data-driven"; that is, you -describe the data you want to work with and then what to do when you -find it. Most other languages are "procedural"; you have to describe, -in great detail, every step the program is to take. When working with +languages, because `awk' programs are "data driven" (i.e., you describe +the data you want to work with and then what to do when you find it). +Most other languages are "procedural"; you have to describe, in great +detail, every step the program should take. When working with procedural languages, it is usually much harder to clearly describe the data your program will process. For this reason, `awk' programs are often refreshingly easy to read and write. When you run `awk', you specify an `awk' "program" that tells `awk' -what to do. The program consists of a series of "rules". (It may also +what to do. The program consists of a series of "rules" (it may also contain "function definitions", an advanced feature that we will ignore -for now. *Note User-defined::.) Each rule specifies one pattern to +for now; *note User-defined::). Each rule specifies one pattern to search for and one action to perform upon finding the pattern. Syntactically, a rule consists of a pattern followed by an action. @@ -1473,7 +1484,8 @@ programs from shell scripts, because it avoids the need for a separate file for the `awk' program. A self-contained shell script is more reliable because there are no other files to misplace. - *note Very Simple::, presents several short, self-contained programs. + Later in this chapter, *note Very Simple::, presents several short, +self-contained programs.  File: gawk.info, Node: Read Terminal, Next: Long, Prev: One-shot, Up: Running gawk @@ -1515,7 +1527,7 @@ ugly shell quoting tricks. This next simple `awk' program emulates the `cat' utility; it copies whatever you type on the keyboard to its standard output (why this -works is explained shortly). +works is explained shortly): $ awk '{ print }' Now is the time for all good men @@ -1607,7 +1619,7 @@ the instructions in your program. (This is different from a "compiled" language such as C, where your program is first compiled into machine code that is executed directly by your system's processor.) The `awk' utility is thus termed an "interpreter". Many modern languages are -interperted. +interpreted. The line beginning with `#!' lists the full file name of an interpreter to run and a single optional initial command-line argument @@ -1635,8 +1647,8 @@ the name of your script (`advice'). (d.c.) Don't rely on the value of ---------- Footnotes ---------- - (1) The `#!' mechanism works on GNU/Linux systems, BSD-based systems -and commercial Unix systems. + (1) The `#!' mechanism works on GNU/Linux systems, BSD-based +systems, and commercial Unix systems.  File: gawk.info, Node: Comments, Next: Quoting, Prev: Executable Scripts, Up: Running gawk @@ -1650,13 +1662,13 @@ Comments can explain what the program does and how it works. Nearly all programming languages have provisions for comments, as programs are typically hard to understand without them. - In the `awk' language, a comment starts with the sharp sign + In the `awk' language, a comment starts with the number sign character (`#') and continues to the end of the line. The `#' does not have to be the first character on the line. The `awk' language ignores -the rest of a line following a sharp sign. For example, we could have +the rest of a line following a number sign. For example, we could have put the following into `advice': - # This program prints a nice friendly message. It helps + # This program prints a nice, friendly message. It helps # keep novice users from being afraid of the computer. BEGIN { print "Don't Panic!" } @@ -1665,15 +1677,15 @@ programs, but this usually isn't very useful; the purpose of a comment is to help you or another person understand the program when reading it at a later time. - CAUTION: As mentioned in *note One-shot::, you can enclose small - to medium programs in single quotes, in order to keep your shell - scripts self-contained. When doing so, _don't_ put an apostrophe - (i.e., a single quote) into a comment (or anywhere else in your - program). The shell interprets the quote as the closing quote for - the entire program. As a result, usually the shell prints a - message about mismatched quotes, and if `awk' actually runs, it - will probably print strange messages about syntax errors. For - example, look at the following: + CAUTION: As mentioned in *note One-shot::, you can enclose short + to medium-sized programs in single quotes, in order to keep your + shell scripts self-contained. When doing so, _don't_ put an + apostrophe (i.e., a single quote) into a comment (or anywhere else + in your program). The shell interprets the quote as the closing + quote for the entire program. As a result, usually the shell + prints a message about mismatched quotes, and if `awk' actually + runs, it will probably print strange messages about syntax errors. + For example, look at the following: $ awk 'BEGIN { print "hello" } # let's be cute' > @@ -1689,8 +1701,8 @@ at a later time. error--> source line number 1 Putting a backslash before the single quote in `let's' wouldn't - help, since backslashes are not special inside single quotes. The - next node describes the shell's quoting rules. + help, because backslashes are not special inside single quotes. + The next node describes the shell's quoting rules.  File: gawk.info, Node: Quoting, Prev: Comments, Up: Running gawk @@ -1702,7 +1714,7 @@ File: gawk.info, Node: Quoting, Prev: Comments, Up: Running gawk * DOS Quoting:: Quoting in Windows Batch Files. - For short to medium length `awk' programs, it is most convenient to + For short to medium-length `awk' programs, it is most convenient to enter the program on the `awk' command line. This is best done by enclosing the entire program in single quotes. This is true whether you are entering the program interactively at the shell prompt, or @@ -1722,15 +1734,15 @@ string. The null string is character data that has no value. In other words, it is empty. It is written in `awk' programs like this: `""'. In the shell, it can be written using single or double quotes: `""' or -`'''. While the null string has no characters in it, it does exist. -Consider this command: +`'''. Although the null string has no characters in it, it does exist. +For example, consider this command: $ echo "" Here, the `echo' utility receives a single argument, even though that argument has no characters in it. In the rest of this Info file, we use the terms "null string" and "empty string" interchangeably. Now, on to -the quoting rules. +the quoting rules: * Quoted items can be concatenated with nonquoted items as well as with other quoted items. The shell turns everything into one @@ -1751,7 +1763,7 @@ the quoting rules. on the quoted text. Different shells may do additional kinds of processing on double-quoted text. - Since certain characters within double-quoted text are processed + Because certain characters within double-quoted text are processed by the shell, they must be "escaped" within the text. Of note are the characters `$', ``', `\', and `"', all of which must be preceded by a backslash within double-quoted text if they are to @@ -1790,7 +1802,7 @@ shell quoting tricks, like this: -| Here is a single quote <'> This program consists of three concatenated quoted strings. The first -and the third are single-quoted, the second is double-quoted. +and the third are single quoted, the second is double quoted. This can be "simplified" to: @@ -1865,7 +1877,7 @@ about monthly shipments. In both files, each line is considered to be one "record". In `mail-list', each record contains the name of a person, his/her -phone number, his/her email-address, and a code for their relationship +phone number, his/her email address, and a code for his/her relationship with the author of the list. The columns are aligned using spaces. An `A' in the last column means that the person is an acquaintance. An `F' in the last column means that the person is a friend. An `R' means @@ -1961,13 +1973,13 @@ that does nothing (i.e., no lines are printed). collection of useful, short programs to get you started. Some of these programs contain constructs that haven't been covered yet. (The description of the program will give you a good idea of what is going -on, but please read the rest of the Info file to become an `awk' -expert!) Most of the examples use a data file named `data'. This is -just a placeholder; if you use these programs yourself, substitute your -own file names for `data'. For future reference, note that there is -often more than one way to do things in `awk'. At some point, you may -want to look back at these examples and see if you can come up with -different ways to do the same things shown here: +on, but you'll need to read the rest of the Info file to become an +`awk' expert!) Most of the examples use a data file named `data'. +This is just a placeholder; if you use these programs yourself, +substitute your own file names for `data'. For future reference, note +that there is often more than one way to do things in `awk'. At some +point, you may want to look back at these examples and see if you can +come up with different ways to do the same things shown here: * Print every line that is longer than 80 characters: @@ -1989,7 +2001,7 @@ different ways to do the same things shown here: expand data | awk '{ if (x < length($0)) x = length($0) } END { print "maximum line length is " x }' - This example differs slightly from the previous one: The input is + This example differs slightly from the previous one: the input is processed by the `expand' utility to change TABs into spaces, so the widths compared are actually the right-margin columns, as opposed to the number of input characters on each line. @@ -2183,10 +2195,10 @@ or a string. the C shell._ It works for `awk' programs in files and for one-shot programs, _provided_ you are using a POSIX-compliant shell, such as the Unix Bourne shell or Bash. But the C shell - behaves differently! There, you must use two backslashes in a - row, followed by a newline. Note also that when using the C - shell, _every_ newline in your `awk' program must be escaped with - a backslash. To illustrate: + behaves differently! There you must use two backslashes in a row, + followed by a newline. Note also that when using the C shell, + _every_ newline in your `awk' program must be escaped with a + backslash. To illustrate: % awk 'BEGIN { \ ? print \\ @@ -2291,8 +2303,8 @@ edit-compile-test-debug cycle of software development. Complex programs have been written in `awk', including a complete retargetable assembler for eight-bit microprocessors (*note Glossary::, for more information), and a microcode assembler for a special-purpose -Prolog computer. While the original `awk''s capabilities were strained -by tasks of such complexity, modern versions are more capable. +Prolog computer. The original `awk''s capabilities were strained by +tasks of such complexity, but modern versions are more capable. If you find yourself writing `awk' scripts of more than, say, a few hundred lines, you might consider using a different programming @@ -2340,10 +2352,10 @@ File: gawk.info, Node: Invoking Gawk, Next: Regexp, Prev: Getting Started, U This major node covers how to run `awk', both POSIX-standard and `gawk'-specific command-line options, and what `awk' and `gawk' do with -non-option arguments. It then proceeds to cover how `gawk' searches -for source files, reading standard input along with other files, -`gawk''s environment variables, `gawk''s exit status, using include -files, and obsolete and undocumented options and/or features. +nonoption arguments. It then proceeds to cover how `gawk' searches for +source files, reading standard input along with other files, `gawk''s +environment variables, `gawk''s exit status, using include files, and +obsolete and undocumented options and/or features. Many of the options and features described here are discussed in more detail later in the Info file; feel free to skip over things in @@ -2377,8 +2389,8 @@ enclosed in [...] in these templates are optional: `awk' [OPTIONS] `-f' PROGFILE [`--'] FILE ... `awk' [OPTIONS] [`--'] `'PROGRAM'' FILE ... - Besides traditional one-letter POSIX-style options, `gawk' also -supports GNU long options. + In addition to traditional one-letter POSIX-style options, `gawk' +also supports GNU long options. It is possible to invoke `awk' with an empty program: @@ -2414,7 +2426,7 @@ 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 - non-option argument. This option may be given multiple times; the + nonoption argument. This option may be given multiple times; the `awk' program consists of the concatenation of the contents of each specified SOURCE-FILE. @@ -2593,7 +2605,7 @@ The following list describes options mandated by the POSIX standard: `-M' `--bignum' - Force arbitrary precision arithmetic on numbers. This option has + Force arbitrary-precision arithmetic on numbers. This option has no effect if `gawk' is not compiled to use the GNU MPFR and MP libraries (*note Arbitrary Precision Arithmetic::). @@ -2603,9 +2615,8 @@ The following list describes options mandated by the POSIX standard: input data (*note Nondecimal Data::). CAUTION: This option can severely break old programs. Use - with care. - - This option may disappear in a future version of `gawk'. + with care. Also note that this option may disappear in a + future version of `gawk'. `-N' `--use-lc-numeric' @@ -2628,7 +2639,8 @@ The following list describes options mandated by the POSIX standard: `-O' `--optimize' Enable some optimizations on the internal representation of the - program. At the moment this includes just simple constant folding. + program. At the moment, this includes just simple constant + folding. `-p'[FILE] `--profile'[`='FILE] @@ -2671,8 +2683,8 @@ The following list describes options mandated by the POSIX standard: `--re-interval' Allow interval expressions (*note Regexp Operators::) in regexps. This is now `gawk''s default behavior. Nevertheless, this option - remains both for backward compatibility, and for use in - combination with `--traditional'. + remains (both for backward compatibility and for use in + combination with `--traditional'). `-S' `--sandbox' @@ -2708,7 +2720,7 @@ it is, `awk' reads its program source from all of the named files, as if they had been concatenated together into one big file. This is useful for creating libraries of `awk' functions. These functions can be written once and then retrieved from a standard place, instead of -having to be included into each individual program. The `-i' option is +having to be included in each individual program. The `-i' option is similar in this regard. (As mentioned in *note Definition Syntax::, function names must be unique.) @@ -2716,7 +2728,7 @@ function names must be unique.) the program is entered at the keyboard, by specifying `-f /dev/tty'. After typing your program, type `Ctrl-d' (the end-of-file character) to terminate it. (You may also use `-f -' to read program source from the -standard input but then you will not be able to also use the standard +standard input, but then you will not be able to also use the standard input as a source of data.) Because it is clumsy using the standard `awk' mechanisms to mix @@ -2727,7 +2739,7 @@ source code (*note AWKPATH Variable::). As with `-f', the `-e' and `-i' options may also be used multiple times on the command line. If no `-f' or `-e' option is specified, then `gawk' uses the first -non-option command-line argument as the text of the program source code. +nonoption command-line argument as the text of the program source code. If the environment variable `POSIXLY_CORRECT' exists, then `gawk' behaves in strict POSIX mode, exactly as if you had supplied `--posix'. @@ -2776,8 +2788,8 @@ not a file name: program in the `ARGV' array (*note Built-in Variables::). Command-line options and the program text (if present) are omitted from `ARGV'. All other arguments, including variable assignments, are included. As -each element of `ARGV' is processed, `gawk' sets the variable `ARGIND' -to the index in `ARGV' of the current element. +each element of `ARGV' is processed, `gawk' sets `ARGIND' to the index +in `ARGV' of the current element. Changing `ARGC' and `ARGV' in your `awk' program lets you control how `awk' processes the input files; this is described in more detail @@ -2921,11 +2933,11 @@ this means that you will rarely need to change the value of `AWKPATH'. `ENVIRON["AWKPATH"]'. This provides access to the actual search path value from within an `awk' program. - While you can change `ENVIRON["AWKPATH"]' within your `awk' program, -this has no effect on the running program's behavior. This makes -sense: the `AWKPATH' environment variable is used to find the program -source files. Once your program is running, all the files have been -found, and `gawk' no longer needs to use `AWKPATH'. + Although you can change `ENVIRON["AWKPATH"]' within your `awk' +program, this has no effect on the running program's behavior. This +makes sense: the `AWKPATH' environment variable is used to find the +program source files. Once your program is running, all the files have +been found, and `gawk' no longer needs to use `AWKPATH'. ---------- Footnotes ---------- @@ -2968,7 +2980,7 @@ File: gawk.info, Node: Other Environment Variables, Prev: AWKLIBPATH Variable, A number of other environment variables affect `gawk''s behavior, but they are more specialized. Those in the following list are meant to be -used by regular users. +used by regular users: `GAWK_MSEC_SLEEP' Specifies the interval between connection retries, in @@ -2985,7 +2997,7 @@ used by regular users. Networking::. `POSIXLY_CORRECT' - Causes `gawk' to switch to POSIX compatibility mode, disabling all + Causes `gawk' to switch to POSIX-compatibility mode, disabling all traditional and GNU extensions. *Note Options::. The environment variables in the following list are meant for use by @@ -3016,8 +3028,8 @@ 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, since there are multiple places which produce - the same warning or error message. + source of a message, as there are multiple places which produce the + same warning or error message. `GAWK_NO_DFA' If this variable exists, `gawk' does not use the DFA regexp matcher @@ -3028,8 +3040,8 @@ change. The variables are: don't coordinate with each other.) `GAWK_NO_PP_RUN' - If this variable exists, then when invoked with the - `--pretty-print' option, `gawk' skips running the program. + When `gawk' is invoked with the `--pretty-print' option, it will + not run the program if this environment variable exists. CAUTION: This variable will not survive into the next major release. @@ -3065,13 +3077,13 @@ with the value of the C constant `EXIT_SUCCESS'. This is usually zero. If an error occurs, `gawk' exits with the value of the C constant `EXIT_FAILURE'. This is usually one. - If `gawk' exits because of a fatal error, the exit status is 2. On -non-POSIX systems, this value may be mapped to `EXIT_FAILURE'. + If `gawk' exits because of a fatal error, the exit status is two. +On non-POSIX systems, this value may be mapped to `EXIT_FAILURE'.  File: gawk.info, Node: Include Files, Next: Loading Shared Libraries, Prev: Exit Status, Up: Invoking Gawk -2.7 Including Other Files Into Your Program +2.7 Including Other Files into Your Program =========================================== This minor node describes a feature that is specific to `gawk'. @@ -3106,9 +3118,9 @@ and here is `test2': -| This is script test1. -| This is script test2. - `gawk' runs the `test2' script which includes `test1' using the -`@include' keyword. So, to include external `awk' source files you just -use `@include' followed by the name of the file to be included, + `gawk' runs the `test2' script, which includes `test1' using the +`@include' keyword. So, to include external `awk' source files, you +just use `@include' followed by the name of the file to be included, enclosed in double quotes. NOTE: Keep in mind that this is a language construct and the file @@ -3134,22 +3146,22 @@ Running `gawk' with the `test3' script produces the following results: @include "../io_funcs" -or: +and: @include "/usr/awklib/network" -are valid. The `AWKPATH' environment variable can be of great value -when using `@include'. The same rules for the use of the `AWKPATH' -variable in command-line file searches (*note AWKPATH Variable::) apply -to `@include' also. +are both valid. The `AWKPATH' environment variable can be of great +value when using `@include'. The same rules for the use of the +`AWKPATH' variable in command-line file searches (*note AWKPATH +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 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' environment variable accordingly and then using `@include' with just -the file part of the full pathname. Of course you can have more than +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 environment is, the more directories you may need to organize the files to be included. @@ -3168,7 +3180,7 @@ and this also applies to files named with `@include'.  File: gawk.info, Node: Loading Shared Libraries, Next: Obsolete, Prev: Include Files, Up: Invoking Gawk -2.8 Loading Dynamic Extensions Into Your Program +2.8 Loading Dynamic Extensions into Your Program ================================================ This minor node describes a feature that is specific to `gawk'. @@ -3183,7 +3195,7 @@ The `AWKLIBPATH' variable is used to search for the extension. Using If the extension is not initially found in `AWKLIBPATH', another search is conducted after appending the platform's default shared library suffix to the file name. For example, on GNU/Linux systems, -the suffix `.so' is used. +the suffix `.so' is used: $ gawk '@load "ordchr"; BEGIN {print chr(65)}' -| A @@ -3240,12 +3252,12 @@ File: gawk.info, Node: Invoking Summary, Prev: Undocumented, Up: Invoking Gaw `-F' and `-v'. `gawk' supplies these and many others, as well as corresponding GNU-style long options. - * Non-option command-line arguments are usually treated as file - names, unless they have the form `VAR=VALUE', in which case they - are taken as variable assignments to be performed at that point in + * Nonoption command-line arguments are usually treated as file names, + unless they have the form `VAR=VALUE', in which case they are + taken as variable assignments to be performed at that point in processing the input. - * All non-option command-line arguments, excluding the program text, + * All nonoption command-line arguments, excluding the program text, are placed in the `ARGV' array. Adjusting `ARGC' and `ARGV' affects how `awk' processes input. @@ -3284,7 +3296,7 @@ strings. Because regular expressions are such a fundamental part of that matches every input record whose text belongs to that set. The simplest regular expression is a sequence of letters, numbers, or both. Such a regexp matches any string that contains that sequence. Thus, -the regexp `foo' matches any string containing `foo'. Therefore, the +the regexp `foo' matches any string containing `foo'. Thus, the pattern `/foo/' matches any input record containing the three adjacent characters `foo' _anywhere_ in the record. Other kinds of regexps let you specify more complicated classes of strings. @@ -3325,13 +3337,13 @@ expressions allow you to specify the string to match against; it need not be the entire current input record. The two operators `~' and `!~' perform regular expression comparisons. Expressions using these operators can be used as patterns, or in `if', `while', `for', and `do' -statements. (*Note Statements::.) For example: +statements. (*Note Statements::.) For example, the following is true +if the expression EXP (taken as a string) matches REGEXP: EXP ~ /REGEXP/ -is true if the expression EXP (taken as a string) matches REGEXP. The -following example matches, or selects, all input records with the -uppercase letter `J' somewhere in the first field: +This example matches, or selects, all input records with the uppercase +letter `J' somewhere in the first field: $ awk '$1 ~ /J/' inventory-shipped -| Jan 13 25 15 115 @@ -3385,9 +3397,9 @@ string or regexp. Thus, the string whose contents are the two characters `"' and `\' must be written `"\"\\"'. Other escape sequences represent unprintable characters such as TAB -or newline. While there is nothing to stop you from entering most +or newline. There is nothing to stop you from entering most unprintable characters directly in a string constant or regexp constant, -they may look ugly. +but they may look ugly. The following list presents all the escape sequences used in `awk' and what they represent. Unless noted otherwise, all these escape @@ -3431,7 +3443,7 @@ sequences apply to both string constants and regexp constants: more than two hexadecimal digits produces undefined results. (The `\x' escape sequence is not allowed in POSIX `awk'.) - CAUTION: The next major relase of `gawk' will change, such + CAUTION: The next major release of `gawk' will change, such that a maximum of two hexadecimal digits following the `\x' will be used. @@ -3439,7 +3451,7 @@ sequences apply to both string constants and regexp constants: A literal slash (necessary for regexp constants only). This sequence is used when you want to write a regexp constant that contains a slash (such as `/.*:\/home\/[[:alnum:]]+:.*/'; the - `[[:alnum:]]' notation is discussed shortly, in *note Bracket + `[[:alnum:]]' notation is discussed in *note Bracket Expressions::). Because the regexp is delimited by slashes, you need to escape any slash that is part of the pattern, in order to tell `awk' to keep processing the rest of the regexp. @@ -3465,19 +3477,6 @@ 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. - To summarize: - - * The escape sequences in the list above are always processed first, - for both string constants and regexp constants. This happens very - early, as soon as `awk' reads your program. - - * `gawk' processes both regexp constants and dynamic regexps (*note - Computed Regexps::), for the special operators listed in *note GNU - Regexp Operators::. - - * A backslash before any other character means to treat that - character literally. - Backslash Before Regular Characters If you place a backslash in a string constant before something that @@ -3496,6 +3495,19 @@ Leave the backslash alone Some other `awk' implementations do this. In such implementations, typing `"a\qc"' is the same as typing `"a\\qc"'. + To summarize: + + * The escape sequences in the preceding list are always processed + first, for both string constants and regexp constants. This + happens very early, as soon as `awk' reads your program. + + * `gawk' processes both regexp constants and dynamic regexps (*note + Computed Regexps::), for the special operators listed in *note GNU + Regexp Operators::. + + * A backslash before any other character means to treat that + character literally. + Escape Sequences for Metacharacters Suppose you use an octal or hexadecimal escape to represent a regexp @@ -3528,15 +3540,15 @@ in processing regexps. sequences and that are not listed in the following stand for themselves: `\' - This is used to suppress the special meaning of a character when - matching. For example, `\$' matches the character `$'. + This suppresses the special meaning of a character when matching. + For example, `\$' matches the character `$'. `^' - This matches the beginning of a string. For example, `^@chapter' - matches `@chapter' at the beginning of a string and can be used to - identify chapter beginnings in Texinfo source files. The `^' is - known as an "anchor", because it anchors the pattern to match only - at the beginning of the string. + This matches the beginning of a string. `^@chapter' matches + `@chapter' at the beginning of a string, for example, and can be + used to identify chapter beginnings in Texinfo source files. The + `^' is known as an "anchor", because it anchors the pattern to + match only at the beginning of the string. It is important to realize that `^' does not match the beginning of a line (the point right after a `\n' newline character) embedded @@ -3609,7 +3621,7 @@ sequences and that are not listed in the following stand for themselves: 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: - `(ph)*' matches `ph', `phph', `phphph' and so on. + `(ph)*' matches `ph', `phph', `phphph', and so on. Second, `*' finds as many repetitions as possible. If the text to be matched is `phhhhhhhhhhhhhhooey', `ph*' matches all of the `h's. @@ -3693,7 +3705,7 @@ File: gawk.info, Node: Bracket Expressions, Next: Leftmost Longest, Prev: Reg 3.4 Using Bracket Expressions ============================= -As mentioned earlier, a bracket expression matches any character amongst +As mentioned earlier, a bracket expression matches any character among those listed between the opening and closing square brackets. Within a bracket expression, a "range expression" consists of two @@ -3733,24 +3745,24 @@ character classes defined by the POSIX standard. Class Meaning -------------------------------------------------------------------------- -`[:alnum:]' Alphanumeric characters. -`[:alpha:]' Alphabetic characters. -`[:blank:]' Space and TAB characters. -`[:cntrl:]' Control characters. -`[:digit:]' Numeric characters. -`[:graph:]' Characters that are both printable and visible. (A space is - printable but not visible, whereas an `a' is both.) -`[:lower:]' Lowercase alphabetic characters. +`[:alnum:]' Alphanumeric characters +`[:alpha:]' Alphabetic characters +`[:blank:]' Space and TAB characters +`[:cntrl:]' Control characters +`[:digit:]' Numeric characters +`[:graph:]' Characters that are both printable and visible (a space is + printable but not visible, whereas an `a' is both) +`[:lower:]' Lowercase alphabetic characters `[:print:]' Printable characters (characters that are not control - characters). + 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. -`[:xdigit:]'Characters that are hexadecimal digits. + a few) +`[:upper:]' Uppercase alphabetic characters +`[:xdigit:]'Characters that are hexadecimal digits -Table 3.1: POSIX Character Classes +Table 3.1: POSIX character classes For example, before the POSIX standard, you had to write `/[A-Za-z0-9]/' to match alphanumeric characters. If your character @@ -3758,7 +3770,7 @@ set had other alphabetic characters in it, this would not match them. With the POSIX character classes, you can write `/[[:alnum:]]/' to match the alphabetic and numeric characters in your character set. - Some utilities that match regular expressions provide a non-standard + Some utilities that match regular expressions provide a nonstandard `[:ascii:]' character class; `awk' does not. However, you can simulate such a construct using `[\x00-\x7F]'. This matches all values numerically between zero and 127, which is the defined range of the @@ -3951,9 +3963,9 @@ letters, digits, or underscores (`_'): not match `dirty rat'. `\B' is essentially the opposite of `\y'. There are two other operators that work on buffers. In Emacs, a -"buffer" is, naturally, an Emacs buffer. For other programs, `gawk''s -regexp library routines consider the entire string to match as the -buffer. The operators are: +"buffer" is, naturally, an Emacs buffer. Other GNU programs, including +`gawk', consider the entire string to match as the buffer. The +operators are: `\`' Matches the empty string at the beginning of a buffer (string). @@ -3981,15 +3993,14 @@ No options Operators::. `--posix' - Only POSIX regexps are supported; the GNU operators are not special - (e.g., `\w' matches a literal `w'). Interval expressions are - allowed. + Match only POSIX regexps; the GNU operators are not special (e.g., + `\w' matches a literal `w'). Interval expressions are allowed. `--traditional' - Traditional Unix `awk' regexps are matched. The GNU operators are - not special, and interval expressions are not available. The - POSIX character classes (`[[:alnum:]]', etc.) are supported, as - BWK `awk' supports them. Characters described by octal and + Match traditional Unix `awk' regexps. The GNU operators are not + special, and interval expressions are not available. Because BWK + `awk' supports them, the POSIX character classes (`[[:alnum:]]', + etc.) are available. Characters described by octal and hexadecimal escape sequences are treated literally, even if they represent regexp metacharacters. @@ -4029,10 +4040,9 @@ works in any POSIX-compliant `awk'. `IGNORECASE' is not zero, _all_ regexp and string operations ignore case. - Changing the value of `IGNORECASE' dynamically controls the -case-sensitivity of the program as it runs. Case is significant by -default because `IGNORECASE' (like most variables) is initialized to -zero: + Changing the value of `IGNORECASE' dynamically controls the case +sensitivity of the program as it runs. Case is significant by default +because `IGNORECASE' (like most variables) is initialized to zero: x = "aB" if (x ~ /ab/) ... # this test will fail @@ -4040,17 +4050,17 @@ zero: IGNORECASE = 1 if (x ~ /ab/) ... # now it will succeed - In general, you cannot use `IGNORECASE' to make certain rules -case-insensitive and other rules case-sensitive, because there is no + In general, you cannot use `IGNORECASE' to make certain rules case +insensitive and other rules case sensitive, as there is no straightforward way to set `IGNORECASE' just for the pattern of a particular rule.(1) To do this, use either bracket expressions or `tolower()'. However, one thing you can do with `IGNORECASE' only is -dynamically turn case-sensitivity on or off for all the rules at once. +dynamically turn case sensitivity on or off for all the rules at once. `IGNORECASE' can be set on the command line or in a `BEGIN' rule (*note Other Arguments::; also *note Using BEGIN/END::). Setting -`IGNORECASE' from the command line is a way to make a program -case-insensitive without having to edit it. +`IGNORECASE' from the command line is a way to make a program case +insensitive without having to edit it. In multibyte locales, the equivalences between upper- and lowercase characters are tested based on the wide-character values of the @@ -4087,11 +4097,11 @@ File: gawk.info, Node: Regexp Summary, Prev: Case-sensitivity, Up: Regexp conditional expressions, or as part of matching expressions using the `~' and `!~' operators. - * Escape sequences let you represent non-printable characters and + * Escape sequences let you represent nonprintable characters and also let you represent regexp metacharacters as literal characters to be matched. - * Regexp operators provide grouping, alternation and repetition. + * Regexp operators provide grouping, alternation, and repetition. * Bracket expressions give you a shorthand for specifying sets of characters that can match at a particular point in a regexp. @@ -4103,8 +4113,8 @@ File: gawk.info, Node: Regexp Summary, Prev: Case-sensitivity, Up: Regexp extent of the match, such as for text substitution and when the record separator is a regexp. - * Matching expressions may use dynamic regexps, that is, string - values treated as regular expressions. + * Matching expressions may use dynamic regexps (i.e., string values + treated as regular expressions). * `gawk''s `IGNORECASE' variable lets you control the case sensitivity of regexp matching. In other `awk' versions, use @@ -4163,7 +4173,7 @@ File: gawk.info, Node: Records, Next: Fields, Up: Reading Files `awk' divides the input for your program into records and fields. It keeps track of the number of records that have been read so far from the current input file. This value is stored in a predefined variable -called `FNR' which is reset to zero every time a new file is started. +called `FNR', which is reset to zero every time a new file is started. Another predefined variable, `NR', records the total number of input records read so far from all data files. It starts at zero, but is never automatically reset to zero. @@ -4176,7 +4186,7 @@ never automatically reset to zero.  File: gawk.info, Node: awk split records, Next: gawk split records, Up: Records -4.1.1 Record Splitting With Standard `awk' +4.1.1 Record Splitting with Standard `awk' ------------------------------------------ Records are separated by a character called the "record separator". By @@ -4188,7 +4198,7 @@ predefined variable `RS'. Like any other variable, the value of `RS' can be changed in the `awk' program with the assignment operator, `=' (*note Assignment Ops::). The new record-separator character should be enclosed in -quotation marks, which indicate a string constant. Often the right +quotation marks, which indicate a string constant. Often, the right time to do this is at the beginning of execution, before any input is processed, so that the very first record is read with the proper separator. To do this, use the special `BEGIN' pattern (*note @@ -4198,7 +4208,7 @@ BEGIN/END::). For example: { 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 +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 @@ -4304,7 +4314,7 @@ variable `RT' to the text in the input that matched `RS'.  File: gawk.info, Node: gawk split records, Prev: awk split records, Up: Records -4.1.2 Record Splitting With `gawk' +4.1.2 Record Splitting with `gawk' ---------------------------------- When using `gawk', the value of `RS' is not limited to a one-character @@ -4344,7 +4354,7 @@ leading and trailing whitespace. The final value of `RT' is a newline. `RT'. If you set `RS' to a regular expression that allows optional -trailing text, such as `RS = "abc(XYZ)?"' it is possible, due to +trailing text, such as `RS = "abc(XYZ)?"', it is possible, due to implementation constraints, that `gawk' may match the leading part of the regular expression, but not the trailing part, particularly if the input text that could match the trailing part is fairly long. `gawk' @@ -4412,8 +4422,8 @@ When `awk' reads an input record, the record is automatically "parsed" or separated by the `awk' utility into chunks called "fields". By default, fields are separated by "whitespace", like words in a line. Whitespace in `awk' means any string of one or more spaces, TABs, or -newlines;(1) other characters, such as formfeed, vertical tab, etc., -that are considered whitespace by other languages, are _not_ considered +newlines;(1) other characters that are considered whitespace by other +languages (such as formfeed, vertical tab, etc.) are _not_ considered whitespace by `awk'. The purpose of fields is to make it more convenient for you to refer @@ -4424,9 +4434,9 @@ simple `awk' programs so powerful. 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 one -hundred twenty-seventh field in the record.) For example, suppose the -following is a line of input: +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. @@ -4485,11 +4495,11 @@ example: awk '{ print $NR }' Recall that `NR' is the number of records read so far: one in the first -record, two in the second, etc. So this example prints the first field -of the first record, the second field of the second record, and so on. -For the twentieth record, field number 20 is printed; most likely, the -record has fewer than 20 fields, so this prints a blank line. Here is -another example of using expressions as field numbers: +record, two in the second, and so on. So this example prints the first +field of the first record, the second field of the second record, and so +on. For the twentieth record, field number 20 is printed; most likely, +the record has fewer than 20 fields, so this prints a blank line. Here +is another example of using expressions as field numbers: awk '{ print $(2*2) }' mail-list @@ -4519,7 +4529,7 @@ field number. ---------- Footnotes ---------- (1) A "binary operator", such as `*' for multiplication, is one that -takes two operands. The distinction is required, since `awk' also has +takes two operands. The distinction is required, because `awk' also has unary (one-operand) and ternary (three-operand) operators.  @@ -4565,8 +4575,8 @@ subtracted from the second field of each line: -| Mar 5 24 34 228 ... - It is also possible to also assign contents to fields that are out -of range. For example: + It is also possible to assign contents to fields that are out of +range. For example: $ awk '{ $6 = ($5 + $4 + $3 + $2) > print $6 }' inventory-shipped @@ -4667,7 +4677,7 @@ separate the fields. record simply by setting `FS' and `OFS', and then expecting a plain `print' or `print $0' to print the modified record. - But this does not work, since nothing was done to change the record + But this does not work, because nothing was done to change the record itself. Instead, you must force the record to be rebuilt, typically with a statement such as `$1 = $1', as described earlier. @@ -4707,7 +4717,7 @@ is used by the POSIX-compliant shells (such as the Unix Bourne shell, `sh', or Bash). The value of `FS' can be changed in the `awk' program with the -assignment operator, `=' (*note Assignment Ops::). Often the right +assignment operator, `=' (*note Assignment Ops::). Often, the right time to do this is at the beginning of execution before any input has been processed, so that the very first record is read with the proper separator. To do this, use the special `BEGIN' pattern (*note @@ -4819,7 +4829,7 @@ was ignored when finding `$1', it is not part of the new `$0'. Finally, the last `print' statement prints the new `$0'. There is an additional subtlety to be aware of when using regular -expressions for field splitting. It is not well-specified in the POSIX +expressions for field splitting. It is not well specified in the POSIX standard, or anywhere else, what `^' means when splitting fields. Does the `^' match only at the beginning of the entire record? Or is each field separator a new string? It turns out that different `awk' @@ -4944,21 +4954,50 @@ the entries for users whose full name is not indicated:  File: gawk.info, Node: Full Line Fields, Next: Field Splitting Summary, Prev: Command Line Field Separator, Up: Field Separators -4.5.5 Making The Full Line Be A Single Field +4.5.5 Making the Full Line Be a Single Field -------------------------------------------- Occasionally, it's useful to treat the whole input line as a single field. This can be done easily and portably simply by setting `FS' to -`"\n"' (a newline).(1) +`"\n"' (a newline):(1) awk -F'\n' 'PROGRAM' FILES ... When you do this, `$1' is the same as `$0'. + Changing `FS' Does Not Affect the Fields + + 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) +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'.) + + sed 1q /etc/passwd | awk '{ FS = ":" ; print $1 }' + +which usually prints: + + root + +on an incorrect implementation of `awk', while `gawk' prints the full +first line of the file, something like: + + root:nSijPlPhZZwgE:0:0:Root:/: + ---------- Footnotes ---------- (1) Thanks to Andrew Schorr for this tip. + (2) The `sed' utility is a "stream editor." Its behavior is also +defined by the POSIX standard. +  File: gawk.info, Node: Field Splitting Summary, Prev: Full Line Fields, Up: Field Separators @@ -4997,32 +5036,6 @@ value of `FS' (`==' means "is equal to"): (This is a common extension; it is not specified by the POSIX standard.) - Changing `FS' Does Not Affect the Fields - - 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) -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'(1) command prints just the first line of `/etc/passwd'.) - - sed 1q /etc/passwd | awk '{ FS = ":" ; print $1 }' - -which usually prints: - - root - -on an incorrect implementation of `awk', while `gawk' prints the full -first line of the file, something like: - - root:nSijPlPhZZwgE:0:0:Root:/: - `FS' and `IGNORECASE' The `IGNORECASE' variable (*note User-modified::) affects field @@ -5037,23 +5050,17 @@ Thus, in the following code: The output is `aCa'. If you really want to split fields on an alphabetic character while ignoring case, use a regexp that will do it -for you. E.g., `FS = "[c]"'. In this case, `IGNORECASE' will take +for you (e.g., `FS = "[c]"'). In this case, `IGNORECASE' will take effect. - ---------- Footnotes ---------- - - (1) The `sed' utility is a "stream editor." Its behavior is also -defined by the POSIX standard. -  File: gawk.info, Node: Constant Size, Next: Splitting By Content, Prev: Field Separators, Up: Reading Files 4.6 Reading Fixed-Width Data ============================ - NOTE: This minor node discusses an advanced feature of `gawk'. If - you are a novice `awk' user, you might want to skip it on the - first reading. +This minor node discusses an advanced feature of `gawk'. If you are a +novice `awk' user, you might want to skip it on the first reading. `gawk' provides a facility for dealing with fixed-width fields with no distinctive field separator. For example, data of this nature @@ -5089,13 +5096,10 @@ use of `FIELDWIDTHS': brent ttyp0 26Jun91 4:46 26:46 4:41 bash dave ttyq4 26Jun9115days 46 46 wnewmail - The following program takes the above input, converts the idle time -to number of seconds, and prints out the first two fields and the + The following program takes this input, converts the idle time to +number of seconds, and prints out the first two fields and the calculated idle time: - NOTE: This program uses a number of `awk' features that haven't - been introduced yet. - BEGIN { FIELDWIDTHS = "9 6 10 6 7 7 35" } NR > 2 { idle = $4 @@ -5112,6 +5116,9 @@ calculated idle time: print $1, $2, idle } + NOTE: The preceding program uses a number of `awk' features that + haven't been introduced yet. + Running the program on the data produces the following results: hzuo ttyV0 0 @@ -5155,12 +5162,11 @@ of such a function).  File: gawk.info, Node: Splitting By Content, Next: Multiple Line, Prev: Constant Size, Up: Reading Files -4.7 Defining Fields By Content +4.7 Defining Fields by Content ============================== - NOTE: This minor node discusses an advanced feature of `gawk'. If - you are a novice `awk' user, you might want to skip it on the - first reading. +This minor node discusses an advanced feature of `gawk'. If you are a +novice `awk' user, you might want to skip it on the first reading. Normally, when using `FS', `gawk' defines the fields as the parts of the record that occur in between each field separator. In other words, @@ -5168,13 +5174,13 @@ the record that occur in between each field separator. In other words, However, there are times when you really want to define the fields by what they are, and not by what they are not. - The most notorious such case is so-called "comma separated value" + 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, there wouldn't be an issue. The problem comes when one of the fields -contains an _embedded_ comma. While there is no formal standard -specification for CSV data(1), in such cases, most programs embed the +contains an _embedded_ comma. Although there is no formal standard +specification for CSV data,(1) in such cases, most programs embed the field in double quotes. So we might have data like this: Robbins,Arnold,"1234 A Pretty Street, NE",MyTown,MyState,12345-6789,USA @@ -5183,7 +5189,7 @@ field in double quotes. So we might have data like this: value of `FPAT' should be a string that provides a regular expression. This regular expression describes the contents of each field. - In the case of CSV data as presented above, each field is either + In the case of CSV data as presented here, each field is either "anything that is not a comma," or "a double quote, anything that is not a double quote, and a closing double quote." If written as a regular expression constant (*note Regexp::), we would have @@ -5237,8 +5243,8 @@ being used. NOTE: Some programs export CSV data that contains embedded newlines between the double quotes. `gawk' provides no way to - deal with this. Since there is no formal specification for CSV - data, there isn't much more to be done; the `FPAT' mechanism + deal with this. Because no formal specification for CSV data + exists, there isn't much more to be done; the `FPAT' mechanism provides an elegant solution for the majority of cases, and the `gawk' developers are satisfied with that. @@ -5364,7 +5370,7 @@ A simple program to process this file is as follows: -| ... - *Note Labels Program::, for a more realistic program that deals with + *Note Labels Program::, for a more realistic program dealing with address lists. The following list summarizes how records are split, based on the value of `RS'. (`==' means "is equal to.") @@ -5429,7 +5435,7 @@ describing the error that occurred. represents a shell command. NOTE: When `--sandbox' is specified (*note Options::), reading - lines from files, pipes and coprocesses is disabled. + lines from files, pipes, and coprocesses is disabled. * Menu: @@ -5546,7 +5552,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. @@ -5590,8 +5596,8 @@ File: gawk.info, Node: Getline/Variable/File, Next: Getline/Pipe, Prev: Getli ------------------------------------------------- Use `getline VAR < FILE' to read input from the file FILE, and put it -in the variable VAR. As above, FILE is a string-valued expression that -specifies the file from which to read. +in the variable VAR. As earlier, FILE is a string-valued expression +that specifies the file from which to read. In this version of `getline', none of the predefined variables are changed and the record is not split into fields. The only variable @@ -5857,19 +5863,19 @@ COMMAND `|& getline' Sets `$0', `NF', and `RT' `gawk' COMMAND `|& getline' Sets VAR and `RT' `gawk' VAR -Table 4.1: `getline' Variants and What They Set +Table 4.1: `getline' variants and what they set  File: gawk.info, Node: Read Timeout, Next: Command-line directories, Prev: Getline, Up: Reading Files -4.10 Reading Input With A Timeout +4.10 Reading Input with a Timeout ================================= 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 +This can be done on a per input, command, or connection basis, by setting a special element in the `PROCINFO' array (*note Auto-set::): PROCINFO["input_name", "READ_TIMEOUT"] = TIMEOUT IN MILLISECONDS @@ -5928,13 +5934,13 @@ input to arrive: exactly after the tenth record has been printed. It is possible that `gawk' will read and buffer more than one record's worth of data the first time. Because of this, changing the value of - timeout like in the above example is not very useful. + timeout like in the preceding example is not very useful. - If the `PROCINFO' element is not present and the environment -variable `GAWK_READ_TIMEOUT' 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. + If the `PROCINFO' element is not present and the `GAWK_READ_TIMEOUT' +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. `gawk' considers a timeout event to be an error even though the attempt to read from the underlying device may succeed in a later @@ -5956,7 +5962,7 @@ writing.  File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Read Timeout, Up: Reading Files -4.11 Directories On The Command Line +4.11 Directories on the Command Line ==================================== According to the POSIX standard, files named on the `awk' command line @@ -5967,7 +5973,7 @@ of `awk' treat a directory on the command line as a fatal error. line, but otherwise ignores it. This makes it easier to use shell wildcards with your `awk' program: - $ gawk -f whizprog.awk * Directories could kill this progam + $ gawk -f whizprog.awk * Directories could kill this program If either of the `--posix' or `--traditional' options is given, then `gawk' reverts to treating a directory on the command line as a fatal @@ -6001,8 +6007,8 @@ 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' is - the whole record, and `NF' indicates how many fields there are. + record 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. * Fields may be referenced using a variable, as in `$NF'. Fields @@ -6013,7 +6019,7 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li does the same thing. Decrementing `NF' throws away fields and rebuilds the record. - * Field splitting is more complicated than record splitting. + * Field splitting is more complicated than record splitting: Field separator value Fields are split ... `awk' / `gawk' @@ -6230,14 +6236,15 @@ separated by commas. In the output, the items are normally separated by single spaces. However, this doesn't need to be the case; a single space is simply the default. Any string of characters may be used as the "output field separator" by setting the predefined variable `OFS'. -The initial value of this variable is the string `" "'--that is, a -single space. +The initial value of this variable is the string `" "' (i.e., a single +space). The output from an entire `print' statement is called an "output record". Each `print' statement outputs one output record, and then outputs a string called the "output record separator" (or `ORS'). The -initial value of `ORS' is the string `"\n"'; i.e., a newline character. -Thus, each `print' statement normally makes a separate line. +initial value of `ORS' is the string `"\n"' (i.e., a newline +character). Thus, each `print' statement normally makes a separate +line. In order to change how output fields and records are separated, assign new values to the variables `OFS' and `ORS'. The usual place to @@ -6336,10 +6343,10 @@ A simple `printf' statement looks like this: printf FORMAT, ITEM1, ITEM2, ... -As print `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 confused with an output redirection (*note Redirection::). +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 +confused with an output redirection (*note Redirection::). The difference between `printf' and `print' is the FORMAT argument. This is an expression whose value is taken as a string; it specifies @@ -6422,7 +6429,7 @@ width. Here is a list of the format-control letters: of which follow the decimal point. (The `4.3' represents two modifiers, discussed in the next node.) - On systems supporting IEEE 754 floating point format, values + On systems supporting IEEE 754 floating-point format, values representing negative infinity are formatted as `-inf' or `-infinity', and positive infinity as `inf' and `infinity'. The special "not a number" value formats as `-nan' or `nan' (*note @@ -6448,7 +6455,7 @@ width. Here is a list of the format-control letters: `%u' Print an unsigned decimal integer. (This format is of marginal - use, because all numbers in `awk' are floating-point; it is + use, because all numbers in `awk' are floating point; it is provided primarily for compatibility with C.) `%x', `%X' @@ -6519,7 +6526,7 @@ which they may appear: space modifier. `#' - Use an "alternate form" for certain control letters. For `%o', + Use an "alternative form" for certain control letters. For `%o', supply a leading zero. For `%x' and `%X', supply a leading `0x' or `0X' for a nonzero result. For `%e', `%E', `%f', and `%F', the result always contains a decimal point. For `%g' and `%G', @@ -6533,7 +6540,7 @@ which they may appear: `'' A single quote or apostrophe character is a POSIX extension to ISO - C. It indicates that the integer part of a floating point value, + C. It indicates that the integer part of a floating-point value, or the entire part of an integer decimal value, should have a thousands-separator character in it. This only works in locales that support such characters. For example: @@ -6598,10 +6605,10 @@ which they may appear: prints `foob'. - The C library `printf''s dynamic WIDTH and PREC capability (for -example, `"%*.*s"') is supported. Instead of supplying explicit WIDTH -and/or PREC values in the format string, they are passed in the -argument list. For example: + The C library `printf''s dynamic WIDTH and PREC capability (e.g., +`"%*.*s"') is supported. Instead of supplying explicit WIDTH and/or +PREC values in the format string, they are passed in the argument list. +For example: w = 5 p = 3 @@ -6679,8 +6686,9 @@ beginning of the `awk' program: print "---- ------" } { printf "%-10s %s\n", $1, $2 }' mail-list - The above example mixes `print' and `printf' statements in the same -program. Using just `printf' statements can produce the same results: + The preceding example mixes `print' and `printf' statements in the +same program. Using just `printf' statements can produce the same +results: awk 'BEGIN { printf "%-10s %s\n", "Name", "Number" printf "%-10s %s\n", "----", "------" } @@ -6821,7 +6829,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, since the output file is only +`>' for all the `print' statements, because the output file is only opened once. (It happens that if you mix `>' and `>>' that 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 @@ -6893,7 +6901,7 @@ 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 opening `/dev/tty' fails. - `gawk', BWK `awk' and `mawk' provide special file names for + `gawk', BWK `awk', and `mawk' provide special file names for accessing the three standard streams. If the file name matches one of these special names when `gawk' (or one of the others) redirects input or output, then it directly uses the descriptor that the file name @@ -6918,10 +6926,10 @@ becomes: redirection, the value must be a string. It is a common error to omit the quotes, which leads to confusing results. - `gawk' does not treat these file names as special when in POSIX -compatibility mode. However, since BWK `awk' supports them, `gawk' does -support them even when invoked with the `--traditional' option (*note -Options::). + `gawk' does not treat these file names as special when in +POSIX-compatibility mode. However, because BWK `awk' supports them, +`gawk' does support them even when invoked with the `--traditional' +option (*note Options::). ---------- Footnotes ---------- @@ -6933,7 +6941,7 @@ File: gawk.info, Node: Special Files, Next: Close Files And Pipes, Prev: Spec 5.8 Special File Names in `gawk' ================================ -Besides access to standard input, stanard output, and standard error, +Besides access to standard input, standard output, and standard error, `gawk' provides access to any open file descriptor. Additionally, there are special file names reserved for TCP/IP networking. @@ -6980,7 +6988,7 @@ form: `/NET-TYPE/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT' - The NET-TYPE is one of `inet', `inet4' or `inet6'. The PROTOCOL is + The NET-TYPE is one of `inet', `inet4', or `inet6'. The PROTOCOL is one of `tcp' or `udp', and the other fields represent the other essential pieces of information for making a networking connection. These file names are used with the `|&' operator for communicating with @@ -7122,9 +7130,10 @@ terminated;(1) more importantly, the file descriptor for the pipe is not closed and released until `close()' is called or `awk' exits. `close()' silently does nothing if given an argument that does not -represent a file, pipe or coprocess that was opened with a redirection. -In such a case, it returns a negative value, indicating an error. In -addition, `gawk' sets `ERRNO' to a string indicating the error. +represent a file, pipe, or coprocess that was opened with a +redirection. In such a case, it returns a negative value, indicating +an error. In addition, `gawk' sets `ERRNO' to a string indicating the +error. Note also that `close(FILENAME)' has no "magic" effects on the implicit loop that reads through the files named on the command line. @@ -7145,8 +7154,8 @@ describes it in more detail and gives an example. Using `close()''s Return Value In many older versions of Unix `awk', the `close()' function is -actually a statement. It is a syntax error to try and use the return -value from `close()': (d.c.) +actually a statement. (d.c.) It is a syntax error to try and use the +return value from `close()': command = "..." command | getline info @@ -7199,9 +7208,9 @@ File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Fi pipes, and coprocesses. * `gawk' provides special file names for access to standard input, - output and error, and for network communications. + output, and error, and for network communications. - * Use `close()' to close open file, pipe and coprocess redirections. + * Use `close()' to close open file, pipe, and coprocess redirections. For coprocesses, it is possible to close only one direction of the communications. @@ -7261,8 +7270,8 @@ operators.  File: gawk.info, Node: Values, Next: All Operators, Up: Expressions -6.1 Constants, Variables and Conversions -======================================== +6.1 Constants, Variables, and Conversions +========================================= Expressions are built up from values and the operations performed upon them. This minor node describes the elementary objects which provide @@ -7288,7 +7297,7 @@ regular expression. Each is used in the appropriate context when you need a data value that isn't going to change. Numeric constants can have different -forms, but are stored identically internally. +forms, but are internally stored in an identical manner. * Menu: @@ -7312,7 +7321,7 @@ the same value: 1050e-1 A string constant consists of a sequence of characters enclosed in -double-quotation marks. For example: +double quotation marks. For example: "parrot" @@ -7325,7 +7334,7 @@ codes. ---------- Footnotes ---------- (1) The internal representation of all numbers, including integers, -uses double precision floating-point numbers. On most modern systems, +uses double-precision floating-point numbers. On most modern systems, these are in IEEE 754 standard format. *Note Arbitrary Precision Arithmetic::, for much more information. @@ -7335,17 +7344,17 @@ File: gawk.info, Node: Nondecimal-numbers, Next: Regexp Constants, Prev: Scal 6.1.1.2 Octal and Hexadecimal Numbers ..................................... -In `awk', all numbers are in decimal; i.e., base 10. Many other +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, etc. 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. Since 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 @@ -7383,7 +7392,7 @@ manipulation functions; see *note Bitwise Functions::, for more information. Unlike some early C implementations, `8' and `9' are not valid in -octal constants; e.g., `gawk' treats `018' as decimal 18: +octal constants. For example, `gawk' treats `018' as decimal 18: $ gawk 'BEGIN { print "021 is", 021 ; print 018 }' -| 021 is 17 @@ -7426,8 +7435,8 @@ When used on the righthand side of the `~' or `!~' operators, a regexp constant merely stands for the regexp that is to be matched. However, regexp constants (such as `/foo/') may be used like simple expressions. When a regexp constant appears by itself, it has the same meaning as if -it appeared in a pattern, i.e., `($0 ~ /foo/)' (d.c.) *Note Expression -Patterns::. This means that the following two code segments: +it appeared in a pattern (i.e., `($0 ~ /foo/)'). (d.c.) *Note +Expression Patterns::. This means that the following two code segments: if ($0 ~ /barfly/ || $0 ~ /camelot/) print "found" @@ -7491,8 +7500,8 @@ 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, since passing -a truth value in this way is probably not what was intended. +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 @@ -7532,7 +7541,7 @@ 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 +`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 @@ -7604,7 +7613,7 @@ File: gawk.info, Node: Conversion, Prev: Variables, Up: Values 6.1.4 Conversion of Strings and Numbers --------------------------------------- -Number to string and string to number conversion are generally +Number-to-string and string-to-number conversion are generally straightforward. There can be subtleties to be aware of; this minor node discusses this important facet of `awk'. @@ -7617,7 +7626,7 @@ node discusses this important facet of `awk'.  File: gawk.info, Node: Strings And Numbers, Next: Locale influences conversions, Up: Conversion -6.1.4.1 How `awk' Converts Between Strings And Numbers +6.1.4.1 How `awk' Converts Between Strings and Numbers ...................................................... Strings are converted to numbers and numbers are converted to strings, @@ -7640,7 +7649,7 @@ string, concatenate that number with the empty string, `""'. To force a string to be converted to a number, add zero to that string. A string is converted to a number by interpreting any numeric prefix of the string as numerals: `"2.5"' converts to 2.5, `"1e3"' converts to -1000, and `"25fix"' has a numeric value of 25. Strings that can't be +1,000, and `"25fix"' has a numeric value of 25. Strings that can't be interpreted as valid numbers convert to zero. The exact manner in which numbers are converted into strings is @@ -7669,7 +7678,7 @@ value of `CONVFMT' may be. Given the following code fragment: `b' has the value `"12"', not `"12.00"'. (d.c.) - Pre-POSIX `awk' Used `OFMT' For String Conversion + Pre-POSIX `awk' Used `OFMT' for String Conversion Prior to the POSIX standard, `awk' used the value of `OFMT' for converting numbers to strings. `OFMT' specifies the output format to @@ -7706,7 +7715,7 @@ separator, if they have one. decimal point when reading the `awk' program source code, and for command-line variable assignments (*note Other Arguments::). However, when interpreting input data, for `print' and `printf' output, and for -number to string conversion, the local decimal point character is used. +number-to-string conversion, the local decimal point character is used. (d.c.) In all cases, numbers in source code and in input data cannot have a thousands separator. Here are some examples indicating the difference in behavior, on a GNU/Linux system: @@ -7728,7 +7737,7 @@ full number including the fractional part, 4.321. Some earlier versions of `gawk' fully complied with this aspect of the standard. However, many users in non-English locales complained -about this behavior, since their data used a period as the decimal +about this behavior, because their data used a period as the decimal 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 @@ -7747,9 +7756,9 @@ Feature Default `--posix' or `--use-lc-numeric' Input Use period Use locale `strtonum()'Use period Use locale -Table 6.1: Locale Decimal Point versus A Period +Table 6.1: Locale decimal point versus a period - Finally, modern day formal standards and IEEE standard floating point + 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::. @@ -7757,7 +7766,7 @@ presented in *note POSIX Floating Point Problems::.  File: gawk.info, Node: All Operators, Next: Truth Values and Conditions, Prev: Values, Up: Expressions -6.2 Operators: Doing Something With Values +6.2 Operators: Doing Something with Values ========================================== This minor node introduces the "operators" which make use of the values @@ -7819,9 +7828,9 @@ order from the highest precedence to the lowest: Division; because all numbers in `awk' are floating-point numbers, the result is _not_ rounded to an integer--`3 / 4' has the value 0.75. (It is a common mistake, especially for C - programmers, to forget that _all_ numbers in `awk' are - floating-point, and that division of integer-looking constants - produces a real number, not an integer.) + programmers, to forget that _all_ numbers in `awk' are floating + point, and that division of integer-looking constants produces a + real number, not an integer.) `X % Y' Remainder; further discussion is provided in the text, just after @@ -7883,7 +7892,7 @@ runs together. For example: ... Because string concatenation does not have an explicit operator, it -is often necessary to insure that it happens at the right time by using +is often necessary to ensure that it happens at the right time by using parentheses to enclose the items to concatenate. For example, you might expect that the following code fragment concatenates `file' and `name': @@ -8058,7 +8067,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 -see *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_. @@ -8076,16 +8085,16 @@ 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 `/=' 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 `**=' POWER Raise LVALUE to the power POWER (c.e.) -Table 6.2: Arithmetic Assignment Operators +Table 6.2: Arithmetic assignment operators NOTE: Only the `^=' operator is specified by POSIX. For maximum portability, do not use the `**=' operator. @@ -8134,7 +8143,7 @@ effect of incrementing it. The post-increment `foo++' is nearly the same as writing `(foo += 1) - 1'. It is not perfectly equivalent because all numbers in `awk' are -floating-point--in floating-point, `foo + 1 - 1' does not necessarily +floating point--in floating point, `foo + 1 - 1' does not necessarily equal `foo'. But the difference is minute as long as you stick to numbers that are fairly small (less than 10e12). @@ -8198,8 +8207,8 @@ File: gawk.info, Node: Truth Values and Conditions, Next: Function Calls, Pre 6.3 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 minor node describes how `awk' defines "true" and "false" and how values are compared. @@ -8250,8 +8259,8 @@ File: gawk.info, Node: Typing and Comparison, Next: Boolean Ops, Prev: Truth 6.3.2 Variable Typing and Comparison Expressions ------------------------------------------------ - The Guide is definitive. Reality is frequently inaccurate. -- The - Hitchhiker's Guide to the Galaxy + 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 @@ -8267,7 +8276,7 @@ are typed, and how `awk' compares variables.  File: gawk.info, Node: Variable Typing, Next: Comparison Operators, Up: Typing and Comparison -6.3.2.1 String Type Versus Numeric Type +6.3.2.1 String Type versus Numeric Type ....................................... The POSIX standard introduced the concept of a "numeric string", which @@ -8284,7 +8293,7 @@ determine how they are compared. Variable typing follows these rules: * 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 + `split()', and `patsplit()' that are numeric strings have the STRNUM attribute. Otherwise, they have the STRING attribute. Uninitialized variables also have the STRNUM attribute. @@ -8365,19 +8374,19 @@ them. Expression Result -------------------------------------------------------------------------- -X `<' Y True if X is less than Y. -X `<=' Y True if X is less than or equal to Y. -X `>' Y True if X is greater than Y. -X `>=' Y True if X is greater than or equal to Y. -X `==' Y True if X is equal to Y. -X `!=' Y True if X is not equal to Y. -X `~' Y True if the string X matches the regexp denoted by Y. +X `<' Y True if X is less than Y +X `<=' Y True if X is less than or equal to Y +X `>' Y True if X is greater than Y +X `>=' Y True if X is greater than or equal to Y +X `==' Y True if X is equal to Y +X `!=' Y True if X is not equal to Y +X `~' Y True if the string X matches the regexp denoted by Y X `!~' Y True if the string X does not match the regexp - denoted by Y. + denoted by Y SUBSCRIPT `in' True if the array ARRAY has an element with the -ARRAY subscript SUBSCRIPT. +ARRAY subscript SUBSCRIPT -Table 6.3: Relational Operators +Table 6.3: Relational operators Comparison expressions have the value one if true and zero if false. When comparing operands of mixed types, numeric operands are converted @@ -8407,24 +8416,24 @@ comparisons `awk' performs, as well as what the result of each comparison is: `1.5 <= 2.0' - numeric comparison (true) + Numeric comparison (true) `"abc" >= "xyz"' - string comparison (false) + String comparison (false) `1.5 != " +2"' - string comparison (true) + String comparison (true) `"1e2" < "3"' - string comparison (true) + String comparison (true) `a = 2; b = "2"' `a == b' - string comparison (true) + String comparison (true) `a = 2; b = " +2"' `a == b' - string comparison (false) + String comparison (false) In this example: @@ -8456,8 +8465,8 @@ case, the value of the expression as a string is used as a dynamic regexp (*note Regexp Usage::; also *note Computed Regexps::). A constant regular expression in slashes by itself is also an -expression. The regexp `/REGEXP/' is an abbreviation for the following -comparison expression: +expression. `/REGEXP/' is an abbreviation for the following comparison +expression: $0 ~ /REGEXP/ @@ -8468,7 +8477,7 @@ Constant Regexps::, where this is discussed in more detail.  File: gawk.info, Node: POSIX String Comparison, Prev: Comparison Operators, Up: Typing and Comparison -6.3.2.3 String Comparison With POSIX Rules +6.3.2.3 String Comparison with POSIX Rules .......................................... The POSIX standard says that string comparison is performed based on @@ -8655,7 +8664,7 @@ these. *Note Built-in::, for a list of built-in functions and their descriptions. In addition, you can define functions for use in your program. *Note User-defined::, for instructions on how to do this. Finally, `gawk' lets you write functions in C or C++ that may be called -from your program: see *note Dynamic Extensions::. +from your program (*note Dynamic Extensions::). The way to use a function is with a "function call" expression, which consists of the function name followed immediately by a list of @@ -8670,7 +8679,7 @@ examples show function calls with and without arguments: rand() no arguments CAUTION: Do not put any space between the function name and the - open-parenthesis! A user-defined function name looks just like + opening parenthesis! A user-defined function name looks just like the name of a variable--a space would make the expression look like concatenation of a variable with an expression inside parentheses. With built-in functions, space before the @@ -8795,7 +8804,7 @@ precedence: `+ -' Addition, subtraction. -String Concatenation +String concatenation There is no special symbol for concatenation. The operands are simply written side by side (*note Concatenation::). @@ -8810,9 +8819,9 @@ String Concatenation 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 (for example, - `print foo > a ? b : c'), result in syntax errors. The correct - way to write this statement is `print foo > (a ? b : c)'. + precedence without parentheses. Such combinations (e.g., `print + foo > a ? b : c'), result in syntax errors. The correct way to + write this statement is `print foo > (a ? b : c)'. `~ !~' Matching, nonmatching. @@ -8838,7 +8847,7 @@ String Concatenation  File: gawk.info, Node: Locales, Next: Expressions Summary, Prev: Precedence, Up: Expressions -6.6 Where You Are Makes A Difference +6.6 Where You Are Makes a Difference ==================================== Modern systems support the notion of "locales": a way to tell the @@ -8858,7 +8867,7 @@ terminator. Locales can affect how dates and times are formatted (*note Time Functions::). For example, a common way to abbreviate the date -September 4, 2015 in the United States is "9/4/15." In many countries +September 4, 2015, in the United States is "9/4/15." In many countries in Europe, however, it is abbreviated "4.9.15." Thus, the `%x' specification in a `"US"' locale might produce `9/4/15', while in a `"EUROPE"' locale, it might produce `4.9.15'. @@ -8878,12 +8887,12 @@ File: gawk.info, Node: Expressions Summary, Prev: Locales, Up: Expressions =========== * Expressions are the basic elements of computation in programs. - They are built from constants, variables, function calls and + They are built from constants, variables, function calls, and combinations of the various kinds of values with operators. * `awk' supplies three kinds of constants: numeric, string, and regexp. `gawk' lets you specify numeric constants in octal and - hexadecimal (bases 8 and 16) in addition to decimal (base 10). In + hexadecimal (bases 8 and 16) as well as decimal (base 10). In certain contexts, a standalone regexp constant such as `/foo/' has the same meaning as `$0 ~ /foo/'. @@ -8918,8 +8927,7 @@ File: gawk.info, Node: Expressions Summary, Prev: Locales, Up: Expressions * Function calls return a value which 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 later on in this - Info file. + and user-defined functions; this is described in *note Functions::. * Operator precedence specifies the order in which operations are performed, unless explicitly overridden by parentheses. `awk''s @@ -9088,7 +9096,7 @@ _not_ contain the string `li': constant regular expressions, comparisons, or any other `awk' expressions. Range patterns are not expressions, so they cannot appear inside Boolean patterns. Likewise, the special patterns `BEGIN', `END', -`BEGINFILE' and `ENDFILE', which never match any input record, are not +`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 @@ -9174,8 +9182,7 @@ All the patterns described so far are for matching input records. The and cleanup actions for `awk' programs. `BEGIN' and `END' rules must have actions; there is no default action for these rules because there is no current record when they run. `BEGIN' and `END' rules are often -referred to as "`BEGIN' and `END' blocks" by long-time `awk' -programmers. +referred to as "`BEGIN' and `END' blocks" by longtime `awk' programmers. * Menu: @@ -9202,7 +9209,7 @@ input is read. For example: This program finds the number of records in the input file `mail-list' that contain the string `li'. The `BEGIN' rule prints a title for the report. There is no need to use the `BEGIN' rule to -initialize the counter `n' to zero, since `awk' does this automatically +initialize the counter `n' to zero, as `awk' does this automatically (*note Variables::). The second rule increments the variable `n' every time a record containing the pattern `li' is read. The `END' rule prints the value of `n' at the end of the run. @@ -9270,20 +9277,20 @@ many older versions of Unix `awk' do not. The third point follows from the first two. The meaning of `print' inside a `BEGIN' or `END' rule is the same as always: `print $0'. If -`$0' is the null string, then this prints an empty record. Many long -time `awk' programmers use an unadorned `print' in `BEGIN' and `END' -rules, to mean `print ""', relying on `$0' being null. Although one -might generally get away with this in `BEGIN' rules, it is a very bad -idea in `END' rules, at least in `gawk'. It is also poor style, since -if an empty line is needed in the output, the program should print one -explicitly. +`$0' is the null string, then this prints an empty record. Many +longtime `awk' programmers use an unadorned `print' in `BEGIN' and +`END' rules, to mean `print ""', relying on `$0' being null. Although +one might generally get away with this in `BEGIN' rules, it is a very +bad idea in `END' rules, at least in `gawk'. It is also poor style, +because if an empty line is needed in the output, the program should +print one explicitly. Finally, the `next' and `nextfile' statements are not allowed in a `BEGIN' rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. -Similarly, those statements are not valid in an `END' rule, since all -the input has been read. (*Note Next Statement::, and see *note -Nextfile Statement::.) +Similarly, those statements are not valid in an `END' rule, because all +the input has been read. (*Note Next Statement::, and *note Nextfile +Statement::,.)  File: gawk.info, Node: BEGINFILE/ENDFILE, Next: Empty, Prev: BEGIN/END, Up: Pattern Overview @@ -9382,9 +9389,9 @@ 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 messy. It requires a good understanding of the shell's quoting rules @@ -9406,10 +9413,10 @@ Now, the `awk' program is just one single-quoted string. The assignment `-v pat="$pattern"' still requires double quotes, in case there is whitespace in the value of `$pattern'. The `awk' variable `pat' could be named `pattern' too, but that would be more confusing. -Using a variable also provides more flexibility, since the variable can -be used anywhere inside the program--for printing, as an array -subscript, or for any other use--without requiring the quoting tricks -at every point in the program. +Using a variable also provides more flexibility, as the variable can be +used anywhere inside the program--for printing, as an array subscript, +or for any other use--without requiring the quoting tricks at every +point in the program.  File: gawk.info, Node: Action Overview, Next: Statements, Prev: Using Shell Variables, Up: Patterns and Actions @@ -9461,7 +9468,7 @@ Compound statements Input statements Use the `getline' command (*note Getline::). Also supplied in - `awk' are the `next' statement (*note Next Statement::), and the + `awk' are the `next' statement (*note Next Statement::) and the `nextfile' statement (*note Nextfile Statement::). Output statements @@ -9529,7 +9536,7 @@ following: else print "x is odd" - In this example, if the expression `x % 2 == 0' is true (that is, if + In this example, if the expression `x % 2 == 0' is true (i.e., if the value of `x' is evenly divisible by two), then the first `print' statement is executed; otherwise, the second `print' statement is executed. If the `else' keyword appears on the same line as THEN-BODY @@ -9588,7 +9595,7 @@ 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 +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. @@ -9626,8 +9633,8 @@ false to begin with. The following is an example of a `do' statement: } This program prints each input record 10 times. However, it isn't a -very realistic example, since in this case an ordinary `while' would do -just as well. This situation reflects actual experience; only +very realistic example, because in this case an ordinary `while' would +do just as well. This situation reflects actual experience; only occasionally is there a real use for a `do' statement.  @@ -9706,7 +9713,7 @@ natural to think of. Counting the number of iterations is very common in loops. It can be easier to think of this counting as part of looping rather than as something to do inside the loop. - There is an alternate version of the `for' loop, for iterating over + There is an alternative version of the `for' loop, for iterating over all the indices of an array: for (i in array) @@ -9773,12 +9780,12 @@ the end of the `switch' statement itself. For example: } } - Note that if none of the statements specified above halt execution -of a matched `case' statement, execution falls through to the next -`case' until execution halts. In the above example, the `case' for -`"?"' falls through to the `default' case, which is to call a function -named `usage()'. (The `getopt()' function being called here is -described in *note Getopt Function::.) + Note that if none of the statements specified here halt execution of +a matched `case' statement, execution falls through to the next `case' +until execution halts. In this example, the `case' for `"?"' falls +through to the `default' case, which is to call a function named +`usage()'. (The `getopt()' function being called here is described in +*note Getopt Function::.)  File: gawk.info, Node: Break Statement, Next: Continue Statement, Prev: Switch Statement, Up: Statements @@ -9879,7 +9886,7 @@ the previous example with the following `while' loop: print "" } -This program loops forever once `x' reaches 5, since the increment +This program loops forever once `x' reaches 5, because the increment (`x++') is never reached. The `continue' statement has no special meaning with respect to the @@ -9925,7 +9932,7 @@ beginning, in the following manner: Because of the `next' statement, the program's subsequent rules won't see the bad record. The error message is redirected to the standard -error output stream, as error messages should be. For more detail see +error output stream, as error messages should be. For more detail, see *note Special Files::. If the `next' statement causes the end of the input to be reached, @@ -9978,14 +9985,14 @@ over a file that would otherwise cause `gawk' to exit with a fatal error. In this case, `ENDFILE' rules are not executed. *Note BEGINFILE/ENDFILE::. - While one might think that `close(FILENAME)' would accomplish the + Although it might seem that `close(FILENAME)' would accomplish the same as `nextfile', this isn't true. `close()' is reserved for closing files, pipes, and coprocesses that are opened with redirections. It is not related to the main processing that `awk' does with the files listed in `ARGV'. NOTE: For many years, `nextfile' was a common extension. In - September, 2012, it was accepted for inclusion into the POSIX + September 2012, it was accepted for inclusion into the POSIX standard. See the Austin Group website (http://austingroupbugs.net/view.php?id=607). @@ -10082,7 +10089,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 @@ -10203,11 +10210,11 @@ description of each variable.) character. (*Note Output Separators::.) `PREC #' - The working precision of arbitrary precision floating-point + The working precision of arbitrary-precision floating-point numbers, 53 bits by default (*note Setting precision::). `ROUNDMODE #' - The rounding mode to use for arbitrary precision arithmetic on + The rounding mode to use for arbitrary-precision arithmetic on numbers, by default `"N"' (`roundTiesToEven' in the IEEE 754 standard; *note Setting the rounding mode::). @@ -10234,7 +10241,7 @@ description of each variable.) Used for internationalization of programs at the `awk' level. It sets the default text domain for specially marked string constants in the source text, as well as for the `dcgettext()', - `dcngettext()' and `bindtextdomain()' functions (*note + `dcngettext()', and `bindtextdomain()' functions (*note Internationalization::). The default value of `TEXTDOMAIN' is `"messages"'. @@ -10245,7 +10252,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 @@ -10255,7 +10262,7 @@ your program. The variables that are specific to `gawk' are marked with a pound sign (`#'). These variables are `gawk' extensions. In other `awk' implementations or if `gawk' is in compatibility mode (*note -Options::), they are not special. +Options::), they are not special: `ARGC', `ARGV' The command-line arguments available to `awk' programs are stored @@ -10337,9 +10344,10 @@ Options::), they are not special. on the command line, `awk' reads from the standard input and `FILENAME' is set to `"-"'. `FILENAME' changes each time a new file is read (*note Reading Files::). Inside a `BEGIN' rule, the - value of `FILENAME' is `""', since there are no input files being - processed yet.(1) (d.c.) Note, though, that using `getline' (*note - Getline::) inside a `BEGIN' rule can give `FILENAME' a value. + value of `FILENAME' is `""', because there are no input files + being processed yet.(1) (d.c.) Note, though, that using `getline' + (*note Getline::) inside a `BEGIN' rule can give `FILENAME' a + value. `FNR' The current record number in the current file. `awk' increments @@ -10359,7 +10367,7 @@ Options::), they are not special. `FUNCTAB #' An array whose indices and corresponding values are the names of - all the built-in, user-defined and extension functions in the + all the built-in, user-defined, and extension functions in the program. NOTE: Attempting to use the `delete' statement with the @@ -10435,8 +10443,8 @@ Options::), they are not special. `PROCINFO["sorted_in"]' If this element exists in `PROCINFO', its value controls the order in which array indices will be processed by `for (INDX - in ARRAY)' loops. Since this is an advanced feature, we - defer the full description until later; see *note Scanning an + in ARRAY)' loops. This is an advanced feature, so we defer + the full description until later; see *note Scanning an Array::. `PROCINFO["strftime"]' @@ -10452,7 +10460,7 @@ Options::), they are not special. The following additional elements in the array are available to provide information about the MPFR and GMP libraries if your - version of `gawk' supports arbitrary precision arithmetic (*note + version of `gawk' supports arbitrary-precision arithmetic (*note Arbitrary Precision Arithmetic::): `PROCINFO["mpfr_version"]' @@ -10644,7 +10652,7 @@ string. Another option is to use the `delete' statement to remove elements from `ARGV' (*note Delete::). All of these actions are typically done in the `BEGIN' rule, before -actual processing of the input begins. *Note Split Program::, and see +actual processing of the input begins. *Note Split Program::, and *note Tee Program::, for examples of each way of removing elements from `ARGV'. @@ -10655,7 +10663,7 @@ manner: awk -f myprog.awk -- -v -q file1 file2 ... The following fragment processes `ARGV' in order to examine, and -then remove, the above command-line options: +then remove, the previously mentioned command-line options: BEGIN { for (i = 1; i < ARGC; i++) { @@ -10687,10 +10695,10 @@ are passed on to the `awk' program. (*Note Getopt Function::, for an `awk' library function that parses command-line options.) When designing your program, you should choose options that don't -conflict with `gawk''s, since it will process any options that it +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::, -and *note Options::). +Using `#!' with the `-E' option may help (*Note Executable Scripts::, +and *note Options::,).  File: gawk.info, Node: Pattern Action Summary, Prev: Built-in Variables, Up: Patterns and Actions @@ -10842,14 +10850,14 @@ example, conceptually, if the element values are 8, `"foo"', `""', and | 8 | "foo" | "" | 30 | @r{Value} +---------+---------+--------+---------+ 0 1 2 3 @r{Index} -Figure 8.1: A Contiguous Array +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. Arrays in `awk' are different--they are "associative". This means -that each array is a collection of pairs: an index and its corresponding +that each array is a collection of pairs--an index and its corresponding array element value: Index 3 Value 30 @@ -10889,7 +10897,7 @@ 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, since +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. @@ -10952,8 +10960,8 @@ index, use the following expression: This expression tests whether the particular index INDX exists, without the side effect of creating that element if it is not present. The expression has the value one (true) if `ARRAY[INDX]' exists and zero -(false) if it does not exist. (We use INDX here, since `index' is the -name of a built-in function.) For example, this statement tests +(false) if it does not exist. (We use INDX here, because `index' is +the name of a built-in function.) For example, this statement tests whether the array `frequencies' contains the index `2': if (2 in frequencies) @@ -11129,7 +11137,7 @@ all `awk' versions do so. Consider this program, named `loopcheck.awk':  File: gawk.info, Node: Controlling Scanning, Prev: Scanning an Array, Up: Array Basics -8.1.6 Using Predefined Array Scanning Orders With `gawk' +8.1.6 Using Predefined Array Scanning Orders with `gawk' -------------------------------------------------------- This node describes a feature that is specific to `gawk'. @@ -11150,7 +11158,7 @@ internal implementation of arrays and will vary from one version of * Set `PROCINFO["sorted_in"]' to the name of a user-defined function to use for comparison of array elements. This advanced feature is - described later, in *note Array Sorting::. + described later in *note Array Sorting::. The following special values for `PROCINFO["sorted_in"]' are available: @@ -11239,7 +11247,7 @@ subarrays are treated as being equal to each other. Their order relative to each other is determined by their index strings. Here are some additional things to bear in mind about sorted array -traversal. +traversal: * The value of `PROCINFO["sorted_in"]' is global. That is, it affects all array traversal `for' loops. If you need to change it within @@ -11255,12 +11263,12 @@ traversal. if (save_sorted) PROCINFO["sorted_in"] = save_sorted - * As mentioned, the default array traversal order is represented by - `"@unsorted"'. You can also get the default behavior by assigning - the null string to `PROCINFO["sorted_in"]' or by just deleting the - `"sorted_in"' element from the `PROCINFO' array with the `delete' - statement. (The `delete' statement hasn't been described yet; - *note Delete::.) + * As already mentioned, the default array traversal order is + represented by `"@unsorted"'. You can also get the default + behavior by assigning the null string to `PROCINFO["sorted_in"]' + or by just deleting the `"sorted_in"' element from the `PROCINFO' + array with the `delete' statement. (The `delete' statement hasn't + been described yet; *note Delete::.) In addition, `gawk' provides built-in functions for sorting arrays; see *note Array Sorting Functions::. @@ -11301,8 +11309,8 @@ string value `"12.153"' (using the default conversion value of assigned the value one. The program then changes the value of `CONVFMT'. The test `(xyz in data)' generates a new string value from `xyz'--this time `"12.15"'--because the value of `CONVFMT' only allows -two significant digits. This test fails, since `"12.15"' is different -from `"12.153"'. +two significant digits. This test fails, because `"12.15"' is +different from `"12.153"'. According to the rules for conversions (*note Conversion::), integer values always convert to strings as integers, no matter what the value @@ -11321,7 +11329,7 @@ the same element! As with many things in `awk', the majority of the time things work as you would expect them to. But it is useful to have a precise -knowledge of the actual rules since they can sometimes have a subtle +knowledge of the actual rules, as they can sometimes have a subtle effect on your programs.  @@ -11424,7 +11432,7 @@ at a time. and `mawk', as well as by a number of other implementations. NOTE: For many years, using `delete' without a subscript was a - common extension. In September, 2012, it was accepted for + common extension. In September 2012, it was accepted for inclusion into the POSIX standard. See the Austin Group website (http://austingroupbugs.net/view.php?id=544). @@ -11461,7 +11469,7 @@ File: gawk.info, Node: Multidimensional, Next: Arrays of Arrays, Prev: Delete * Multiscanning:: Scanning multidimensional arrays. - A multidimensional array is an array in which an element is + A "multidimensional array" is an array in which an element is identified by a sequence of indices instead of a single index. For example, a two-dimensional array requires two indices. The usual way (in many languages, including `awk') to refer to an element of a @@ -11496,7 +11504,7 @@ stored as `foo["a@b@c"]'. To test whether a particular index sequence exists in a multidimensional array, use the same operator (`in') that is used for -single dimensional arrays. Write the whole sequence of indices in +single-dimensional arrays. Write the whole sequence of indices in parentheses, separated by commas, as the left operand: if ((SUBSCRIPT1, SUBSCRIPT2, ...) in ARRAY) @@ -11597,8 +11605,8 @@ two-element subarray at index `1' of the main array `a': 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 -separated by commas (that is, a regular `awk' simulated -multidimensional subscript). So the following is valid in `gawk': +separated by commas (i.e., a regular `awk' simulated multidimensional +subscript). So the following is valid in `gawk': a[1][3][1, "name"] = "barney" @@ -11611,7 +11619,7 @@ itself an array and not a scalar: a[4] = "An element in a jagged array" - The terms "dimension", "row" and "column" are meaningless when + The terms "dimension", "row", and "column" are meaningless when applied to such an array, but we will use "dimension" henceforth to imply the maximum number of indices needed to refer to an existing element. The type of any element that has already been assigned cannot @@ -11687,7 +11695,7 @@ the following code prints the elements of our main array `a': } *Note Walking Arrays::, for a user-defined function that "walks" an -arbitrarily-dimensioned array of arrays. +arbitrarily dimensioned array of arrays. Recall that a reference to an uninitialized array element yields a value of `""', the null string. This has one important implication when @@ -11728,11 +11736,11 @@ File: gawk.info, Node: Arrays Summary, Prev: Arrays of Arrays, Up: Arrays `gawk' lets you control the order by assigning special predefined values to `PROCINFO["sorted_in"]'. - * Use `delete ARRAY[INDX]' to delete an individual element. You may - also use `delete ARRAY' to delete all of the elements in the - array. This latter feature has been a common extension for many - years and is now standard, but may not be supported by all - commercial versions of `awk'. + * Use `delete ARRAY[INDX]' to delete an individual element. To + delete all of the elements in an array, use `delete ARRAY'. This + latter feature has been a common extension for many years and is + now standard, but may not be supported by all commercial versions + of `awk'. * Standard `awk' simulates multidimensional arrays by separating subscript values with a comma. The values are concatenated into a @@ -11776,7 +11784,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 @@ -11801,7 +11809,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 @@ -11809,7 +11817,7 @@ function followed by arguments in parentheses. For example, `atan2(y + z, 1)' is a call to the function `atan2()' and has two arguments. Whitespace is ignored between the built-in function name and the -open parenthesis, but nonetheless it is good practice to avoid using +opening parenthesis, but nonetheless it is good practice to avoid using whitespace there. User-defined functions do not permit whitespace in this way, and it is easier to avoid mistakes by following a simple convention that always works--no whitespace after a function name. @@ -11866,10 +11874,8 @@ brackets ([ ]): `int(X)' Return the nearest integer to X, located between X and zero and - truncated toward zero. - - For example, `int(3)' is 3, `int(3.9)' is 3, `int(-3.9)' is -3, - and `int(-3)' is -3 as well. + truncated toward zero. For example, `int(3)' is 3, `int(3.9)' is + 3, `int(-3.9)' is -3, and `int(-3)' is -3 as well. `log(X)' Return the natural logarithm of X, if X is positive; otherwise, @@ -11960,7 +11966,7 @@ numbers. (2) `mawk' uses a different seed each time. (3) Computer-generated random numbers really are not truly random. -They are technically known as "pseudorandom." This means that while +They are technically known as "pseudorandom." This means that although the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again. @@ -11991,7 +11997,8 @@ with character indices, and not byte indices. In the following list, optional parameters are enclosed in square brackets ([ ]). Several functions perform string substitution; the full discussion is provided in the description of the `sub()' function, -which comes towards the end since the list is presented alphabetically. +which comes toward the end, because the list is presented +alphabetically. Those functions that are specific to `gawk' are marked with a pound sign (`#'). They are not available in compatibility mode (*note @@ -12009,10 +12016,10 @@ Options::): together. NOTE: The following description ignores the third argument, - HOW, since it requires understanding features that we have - not discussed yet. Thus, the discussion here is a deliberate - simplification. (We do provide all the details later on: - *Note Array Sorting Functions::, for the full story.) + HOW, as it requires understanding features that we have not + discussed yet. Thus, the discussion here is a deliberate + simplification. (We do provide all the details later on; see + *note Array Sorting Functions::, for the full story.) Both functions return the number of elements in the array SOURCE. For `asort()', `gawk' sorts the values of SOURCE and replaces the @@ -12251,7 +12258,7 @@ Options::): -| 9 7 There may not be subscripts for the start and index for every - parenthesized subexpression, since they may not all have matched + parenthesized subexpression, because they may not all have matched text; thus they should be tested for with the `in' operator (*note Reference to Elements::). @@ -12290,8 +12297,8 @@ Options::): `SEPS[I]' being the separator string between `ARRAY[I]' and `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()' (that is, - 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: @@ -12315,7 +12322,7 @@ 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 + 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.) @@ -12524,7 +12531,7 @@ is number zero.  File: gawk.info, Node: Gory Details, Up: String Functions -9.1.3.1 More About `\' and `&' with `sub()', `gsub()', and `gensub()' +9.1.3.1 More about `\' and `&' with `sub()', `gsub()', and `gensub()' ..................................................................... CAUTION: This subsubsection has been reported to cause headaches. @@ -12567,7 +12574,7 @@ is illustrated in *note table-sub-escapes::. `\\\\\\&' `\\\&' A literal `\\&' `\\q' `\q' A literal `\q' -Table 9.1: Historical Escape Sequence Processing for `sub()' and +Table 9.1: Historical escape sequence processing for `sub()' and `gsub()' This table shows both the lexical-level processing, where an odd number @@ -12597,7 +12604,7 @@ 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: GNU `awk' rules for `sub()' and backslash In a nutshell, at the runtime level, there are now three special sequences of characters (`\\\&', `\\&' and `\&') whereas historically @@ -12624,20 +12631,19 @@ rules are presented in *note table-posix-sub::. `\\q' `\q' A literal `\q' `\\\\' `\\' `\' -Table 9.3: POSIX Rules For `sub()' And `gsub()' +Table 9.3: POSIX rules for `sub()' and `gsub()' The only case where the difference is noticeable is the last one: `\\\\' 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 -follow the proposed rules, since that had been its behavior for many -years. +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 POSIX rules the default, breaking well over a decade's worth of -backwards compatibility.(1) Needless to say, this was a bad idea, and -as of version 4.0.1, `gawk' resumed its historical behavior, and only +backward compatibility.(1) Needless to say, this was a bad idea, and as +of version 4.0.1, `gawk' resumed its historical behavior, and only follows the POSIX rules when `--posix' is given. The rules for `gensub()' are considerably simpler. At the runtime @@ -12656,7 +12662,7 @@ the `\' does not, as shown in *note table-gensub-escapes::. `\\\\\\&' `\\\&' A literal `\&' `\\q' `\q' A literal `q' -Table 9.4: Escape Sequence Processing For `gensub()' +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 @@ -12700,23 +12706,23 @@ parameters are enclosed in square brackets ([ ]): either a file opened for writing or a shell command for redirecting output to a pipe or coprocess. - Many utility programs "buffer" their output; i.e., they save + Many utility programs "buffer" their output (i.e., they save information to write to a disk file or the screen in memory until there is enough for it to be worthwhile to send the data to the - output device. This is often more efficient than writing every + output device). This is often more efficient than writing every little bit of information as soon as it is ready. However, sometimes it is necessary to force a program to "flush" its - buffers; that is, write the information to its destination, even - if a buffer is not full. This is the purpose of the `fflush()' + 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 forces `gawk' to flush its buffers. - Brian Kernighan added `fflush()' to his `awk' in April of 1992. - For two decades, it was a common extension. In December, 2012, it - was accepted for inclusion into the POSIX standard. See the - Austin Group website (http://austingroupbugs.net/view.php?id=634). + Brian Kernighan added `fflush()' to his `awk' in April 1992. For + two decades, it was a common extension. In December 2012, it was + accepted for inclusion into the POSIX standard. See the Austin + Group website (http://austingroupbugs.net/view.php?id=634). - POSIX standardizes `fflush()' as follows: If there is no argument, + POSIX standardizes `fflush()' as follows: if there is no argument, or if the argument is the null string (`""'), then `awk' flushes the buffers for _all_ open output files and pipes. @@ -12741,6 +12747,38 @@ parameters are enclosed in square brackets ([ ]): or if FILENAME is not an open file, pipe, or coprocess. In such a case, `fflush()' returns -1, as well. + 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) + + Interactive programs generally "line buffer" their output (i.e., + they write out every line). Noninteractive programs wait until + they have a full buffer, which may be many lines of output. Here + is an example of the difference: + + $ awk '{ print $1 + $2 }' + 1 1 + -| 2 + 2 3 + -| 5 + Ctrl-d + + Each line of output is printed immediately. Compare that behavior + with this example: + + $ awk '{ print $1 + $2 }' | cat + 1 1 + 2 3 + Ctrl-d + -| 2 + -| 5 + + Here, no output is printed until after the `Ctrl-d' is typed, + because it is all buffered and sent down the pipe to `cat' in one + shot. + `system(COMMAND)' Execute the operating-system command COMMAND and then return to the `awk' program. Return COMMAND's exit status. @@ -12774,37 +12812,6 @@ parameters are enclosed in square brackets ([ ]): is disabled (*note Options::). - 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) - - Interactive programs generally "line buffer" their output; i.e., they -write out every line. Noninteractive programs wait until they have a -full buffer, which may be many lines of output. Here is an example of -the difference: - - $ awk '{ print $1 + $2 }' - 1 1 - -| 2 - 2 3 - -| 5 - Ctrl-d - -Each line of output is printed immediately. Compare that behavior with -this example: - - $ awk '{ print $1 + $2 }' | cat - 1 1 - 2 3 - Ctrl-d - -| 2 - -| 5 - -Here, no output is printed until after the `Ctrl-d' is typed, because -it is all buffered and sent down the pipe to `cat' in one shot. - Controlling Output Buffering with `system()' The `fflush()' function provides explicit control over output @@ -12818,8 +12825,8 @@ argument: `gawk' treats this use of the `system()' function as a special case and is smart enough not to run a shell (or other command interpreter) with the empty command. Therefore, with `gawk', this idiom is not only -useful, it is also efficient. While this method should work with other -`awk' implementations, it does not necessarily avoid starting an +useful, it is also efficient. Although this method should work with +other `awk' implementations, it does not necessarily avoid starting an unnecessary shell. (Other implementations may only flush the buffer associated with the standard output and not necessarily all buffered output.) @@ -12910,14 +12917,14 @@ enclosed in square brackets ([ ]): Otherwise, the value is formatted for the local time zone. The TIMESTAMP is in the same format as the value returned by the `systime()' function. If no TIMESTAMP argument is supplied, - `gawk' uses the current time of day as the timestamp. If no - FORMAT argument is supplied, `strftime()' uses the value of + `gawk' uses the current time of day as the timestamp. Without a + FORMAT argument, `strftime()' uses the value of `PROCINFO["strftime"]' as the format string (*note Built-in Variables::). The default string value is `"%a %b %e %H:%M:%S %Z %Y"'. This format string produces output that is equivalent to that of the `date' utility. You can assign a new value to `PROCINFO["strftime"]' to change the default - format; see below for the various format directives. + format; see the following list for the various format directives. `systime()' Return the current time as the number of seconds since the system @@ -12981,9 +12988,9 @@ the following date format specifications: `%g' The year modulo 100 of the ISO 8601 week number, as a decimal - number (00-99). For example, January 1, 2012 is in week 53 of + number (00-99). For example, January 1, 2012, is in week 53 of 2011. Thus, the year of its ISO 8601 week number is 2011, even - though its year is 2012. Similarly, December 31, 2012 is in week + though its year is 2012. Similarly, December 31, 2012, is in week 1 of 2013. Thus, the year of its ISO week number is 2013, even though its year is 2012. @@ -13077,15 +13084,15 @@ the following date format specifications: `%Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH' `%OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy' - "Alternate representations" for the specifications that use only + "Alternative representations" for the specifications that use only the second letter (`%c', `%C', and so on).(5) (These facilitate compliance with the POSIX `date' utility.) `%%' A literal `%'. - If a conversion specifier is not one of the above, the behavior is -undefined.(6) + If a conversion specifier is not one of those just listed, the +behavior is undefined.(6) For systems that are not yet fully standards-compliant, `gawk' supplies a copy of `strftime()' from the GNU C Library. It supports @@ -13105,8 +13112,8 @@ format specifications are available: The time as a decimal timestamp in seconds since the epoch. - Additionally, the alternate representations are recognized but their -normal representations are used. + Additionally, the alternative representations are recognized but +their normal representations are used. The following example is an `awk' implementation of the POSIX `date' utility. Normally, the `date' utility prints the current date and time @@ -13194,7 +13201,7 @@ table-bitwise-ops::. 0 | 0 0 | 0 1 | 0 1 1 | 0 1 | 1 1 | 1 0 -Table 9.5: Bitwise Operations +Table 9.5: Bitwise operations As you can see, the result of an AND operation is 1 only when _both_ bits are 1. The result of an OR operation is 1 if _either_ bit is 1. @@ -13231,7 +13238,7 @@ are enclosed in square brackets ([ ]): Return the bitwise XOR of the arguments. There must be at least two. - For all of these functions, first the double precision + For all of these functions, first the double-precision floating-point value is converted to the widest C unsigned integer type, then the bitwise operation is performed. If the result cannot be represented exactly as a C `double', leading nonzero bits are removed @@ -13289,7 +13296,7 @@ or not. If so, a `"1"' is concatenated onto the front of the string. Otherwise, a `"0"' is added. The value is then shifted right by one bit and the loop continues until there are no more 1 bits. - If the initial value is zero it returns a simple `"0"'. Otherwise, + If the initial value is zero, it returns a simple `"0"'. Otherwise, at the end, it pads the value with zeros to represent multiples of 8-bit quantities. This is typical in modern computers. @@ -13325,11 +13332,11 @@ user-defined function (not discussed yet; *note User-defined::), to test if a parameter is an array or not. NOTE: Using `isarray()' at the global level to test variables - makes no sense. Since you are the one writing the program, you are - supposed to know if your variables are arrays or not. And in fact, - due to the way `gawk' works, if you pass the name of a variable - that has not been previously used to `isarray()', `gawk' ends up - turning it into a scalar. + makes no sense. Because you are the one writing the program, you + are supposed to know if your variables are arrays or not. And in + fact, due to the way `gawk' works, if you pass the name of a + variable that has not been previously used to `isarray()', `gawk' + ends up turning it into a scalar.  File: gawk.info, Node: I18N Functions, Prev: Type Functions, Up: Built-in @@ -13375,8 +13382,8 @@ File: gawk.info, Node: User-defined, Next: Indirect Calls, Prev: Built-in, U Complicated `awk' programs can often be simplified by defining your own functions. User-defined functions can be called just like built-in -ones (*note Function Calls::), but it is up to you to define them, -i.e., to tell `awk' what they should do. +ones (*note Function Calls::), but it is up to you to define them +(i.e., to tell `awk' what they should do). * Menu: @@ -13489,7 +13496,7 @@ function: func foo() { a = sqrt($1) ; print a } -Instead it defines a rule that, for each record, concatenates the value +Instead, it defines a rule that, for each record, concatenates the value of the variable `func' with the return value of the function `foo'. If the resulting string is non-null, the action is executed. This is probably not what is desired. (`awk' accepts this input as @@ -13501,7 +13508,7 @@ keyword `function' when defining a function. ---------- Footnotes ---------- - (1) This program won't actually run, since `foo()' is undefined. + (1) This program won't actually run, because `foo()' is undefined.  File: gawk.info, Node: Function Example, Next: Function Caveats, Prev: Definition Syntax, Up: User-defined @@ -13555,7 +13562,7 @@ POSIX standard.) string as an input parameter and returns the string in backwards order. Recursive functions must always have a test that stops the recursion. In this case, the recursion terminates when the input string is already -empty. +empty: function rev(str) { @@ -13591,9 +13598,9 @@ an `awk' version of `ctime()': } You might think that `ctime()' could use `PROCINFO["strftime"]' for -its format string. That would be a mistake, since `ctime()' is supposed -to return the time formatted in a standard fashion, and user-level code -could have changed `PROCINFO["strftime"]'. +its format string. That would be a mistake, because `ctime()' is +supposed to return the time formatted in a standard fashion, and +user-level code could have changed `PROCINFO["strftime"]'. ---------- Footnotes ---------- @@ -13618,7 +13625,7 @@ the function.  File: gawk.info, Node: Calling A Function, Next: Variable Scope, Up: Function Caveats -9.2.3.1 Writing A Function Call +9.2.3.1 Writing a Function Call ............................... A function call consists of the function name followed by the arguments @@ -13631,10 +13638,10 @@ string concatenation): foo(x y, "lose", 4 * z) CAUTION: Whitespace characters (spaces and TABs) are not allowed - between the function name and the open-parenthesis of the argument - list. If you write whitespace by mistake, `awk' might think that - you mean to concatenate a variable with an expression in - parentheses. However, it notices that you used a function name + between the function name and the opening parenthesis of the + argument list. If you write whitespace by mistake, `awk' might + think that you mean to concatenate a variable with an expression + in parentheses. However, it notices that you used a function name and not a variable name, and reports an error.  @@ -13687,7 +13694,7 @@ variable instance: top's i=3 If you want `i' to be local to both `foo()' and `bar()' do as -follows (the extra-space before `i' is a coding convention to indicate +follows (the extra space before `i' is a coding convention to indicate that `i' is a local variable, not an argument): function bar( i) @@ -13760,20 +13767,17 @@ create new arrays. Consider this example:  File: gawk.info, Node: Pass By Value/Reference, Prev: Variable Scope, Up: Function Caveats -9.2.3.3 Passing Function Arguments By Value Or By Reference +9.2.3.3 Passing Function Arguments by Value Or by Reference ........................................................... In `awk', when you declare a function, there is no way to declare explicitly whether the arguments are passed "by value" or "by reference". - Instead the passing convention is determined at runtime when the -function is called according to the following rule: - - * If the argument is an array variable, then it is passed by - reference, - - * Otherwise the argument is passed by value. + Instead, the passing convention is determined at runtime when the +function is called according to the following rule: if the argument is +an array variable, then it is passed by reference. Otherwise, the +argument is passed by value. Passing an argument by value means that when a function is called, it is given a _copy_ of the value of this argument. The caller may use a @@ -13850,7 +13854,7 @@ undefined functions. Some `awk' implementations generate a runtime error if you use either the `next' statement or the `nextfile' statement (*note Next -Statement::, also *note Nextfile Statement::) inside a user-defined +Statement::, and *note Nextfile Statement::) inside a user-defined function. `gawk' does not have this limitation.  @@ -13899,11 +13903,12 @@ a value for the largest number among the elements of an array: } You call `maxelt()' with one argument, which is an array name. The -local variables `i' and `ret' are not intended to be arguments; while -there is nothing to stop you from passing more than one argument to -`maxelt()', the results would be strange. The extra space before `i' -in the function parameter list indicates that `i' and `ret' are local -variables. You should follow this convention when defining functions. +local variables `i' and `ret' are not intended to be arguments; there +is nothing to stop you from passing more than one argument to +`maxelt()' but the results would be strange. The extra space before +`i' in the function parameter list indicates that `i' and `ret' are +local variables. You should follow this convention when defining +functions. The following program uses the `maxelt()' function. It loads an array, calls `maxelt()', and then reports the maximum number in that @@ -14017,15 +14022,15 @@ function calls, you tell `gawk' to use the _value_ of a variable as the _name_ of the function to call. The syntax is similar to that of a regular function call: an -identifier immediately followed by a left parenthesis, any arguments, -and then a closing right parenthesis, with the addition of a leading `@' -character: +identifier immediately followed by an opening parenthesis, any +arguments, and then a closing parenthesis, with the addition of a +leading `@' character: the_func = "sum" result = @the_func() # calls the sum() function Here is a full program that processes the previously shown data, -using indirect function calls. +using indirect function calls: # indirectcall.awk --- Demonstrate indirect function calls @@ -14053,7 +14058,7 @@ using indirect function calls. These two functions expect to work on fields; thus the parameters `first' and `last' indicate where in the fields to start and end. -Otherwise they perform the expected computations and are not unusual. +Otherwise they perform the expected computations and are not unusual: # For each record, print the class name and the requested statistics { @@ -14330,7 +14335,7 @@ File: gawk.info, Node: Functions Summary, Prev: Indirect Calls, Up: Functions * POSIX `awk' provides three kinds of built-in functions: numeric, string, and I/O. `gawk' provides functions that sort arrays, work with values representing time, do bit manipulation, determine - variable type (array vs. scalar), and internationalize and + variable type (array versus scalar), and internationalize and localize programs. `gawk' also provides several extensions to some of standard functions, typically in the form of additional arguments. @@ -14420,8 +14425,8 @@ functions and would like to contribute them to the `awk' user community, see *note How To Contribute::, for more information. The programs in this major node and in *note Sample Programs::, -freely use features that are `gawk'-specific. Rewriting these programs -for different implementations of `awk' is pretty straightforward. +freely use `gawk'-specific features. Rewriting these programs for +different implementations of `awk' is pretty straightforward: * Diagnostic error messages are sent to `/dev/stderr'. Use `| "cat 1>&2"' instead of `> "/dev/stderr"' if your system does not have a @@ -14479,8 +14484,8 @@ specific function). There is no intermediate state analogous to Library functions often need to have global variables that they can use to preserve state information between calls to the function--for example, `getopt()''s variable `_opti' (*note Getopt Function::). Such -variables are called "private", since the only functions that need to -use them are the ones in the library. +variables are called "private", as the only functions that need to use +them are the ones in the library. When writing a library function, you should try to choose names for your private variables that will not conflict with any variables used by @@ -14497,7 +14502,7 @@ will be accidentally shared with the user's program. In addition, several of the library functions use a prefix that helps indicate what function or set of functions use the variables--for example, `_pw_byname()' in the user database routines (*note Passwd -Functions::). This convention is recommended, since it even further +Functions::). This convention is recommended, as it even further decreases the chance of inadvertent conflict among variable names. Note that this convention is used equally well for variable names and for private function names.(1) @@ -14538,9 +14543,9 @@ merely recommend that you do so. ---------- Footnotes ---------- - (1) While all the library routines could have been rewritten to use -this convention, this was not done, in order to show how our own `awk' -programming style has evolved and to provide some basis for this + (1) Although all the library routines could have been rewritten to +use this convention, this was not done, in order to show how our own +`awk' programming style has evolved and to provide some basis for this discussion. (2) `gawk''s `--dump-variables' command-line option is useful for @@ -14574,7 +14579,7 @@ programming use.  File: gawk.info, Node: Strtonum Function, Next: Assert Function, Up: General Functions -10.2.1 Converting Strings To Numbers +10.2.1 Converting Strings to Numbers ------------------------------------ The `strtonum()' function (*note String Functions::) is a `gawk' @@ -14641,8 +14646,8 @@ then `mystrtonum()' loops through each character in the string. It sets `k' to the index in `"1234567"' of the current octal digit. The return value will either be the same number as the digit, or zero if the character is not there, which will be true for a `0'. This is -safe, since the regexp test in the `if' ensures that only octal values -are converted. +safe, because the regexp test in the `if' ensures that only octal +values are converted. Similar logic applies to the code that checks for and converts a hexadecimal value, which starts with `0x' or `0X'. The use of @@ -14871,8 +14876,8 @@ distant past, at least one minicomputer manufacturer used ASCII, but with mark parity, meaning that the leftmost bit in the byte is always 1. This means that on those systems, characters have numeric values from 128 to 255. Finally, large mainframe systems use the EBCDIC -character set, which uses all 256 values. While there are other -character sets in use on some older systems, they are not really worth +character set, which uses all 256 values. There are other character +sets in use on some older systems, but they are not really worth worrying about: function ord(str, c) @@ -14930,7 +14935,7 @@ application programs (*note Sample Programs::). but it should also have a reasonable default behavior. It is called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array -indices are numeric--a reasonable assumption since the array was likely +indices are numeric--a reasonable assumption, as the array was likely created with `split()' (*note String Functions::): # join.awk --- join an array into a string @@ -14970,7 +14975,7 @@ File: gawk.info, Node: Getlocaltime Function, Next: Readfile Function, Prev: The `systime()' and `strftime()' functions described in *note Time Functions::, provide the minimum functionality necessary for dealing -with the time of day in human readable form. While `strftime()' is +with the time of day in human-readable form. Although `strftime()' is extensive, the control formats are not necessarily easy to remember or intuitively obvious when reading a program. @@ -15047,7 +15052,7 @@ optional timestamp value to use instead of the current time.  File: gawk.info, Node: Readfile Function, Next: Shell Quoting, Prev: Getlocaltime Function, Up: General Functions -10.2.8 Reading A Whole File At Once +10.2.8 Reading a Whole File At Once ----------------------------------- Often, it is convenient to have the entire contents of a file available @@ -15110,7 +15115,7 @@ also reads an entire file into memory.  File: gawk.info, Node: Shell Quoting, Prev: Readfile Function, Up: General Functions -10.2.9 Quoting Strings to Pass to The Shell +10.2.9 Quoting Strings to Pass to the Shell ------------------------------------------- Michael Brennan offers the following programming pattern, which he uses @@ -15138,7 +15143,7 @@ frequently: Note the need for shell quoting. The function `shell_quote()' does it. `SINGLE' is the one-character string `"'"' and `QSINGLE' is the -three-character string `"\"'\""'. +three-character string `"\"'\""': # shell_quote --- quote an argument for passing to the shell @@ -15182,7 +15187,7 @@ File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Up: Data Fi 10.3.1 Noting Data File Boundaries ---------------------------------- -The `BEGIN' and `END' rules are each executed exactly once at the +The `BEGIN' and `END' rules are each executed exactly once, at the beginning and end of your `awk' program, respectively (*note BEGIN/END::). We (the `gawk' authors) once had a user who mistakenly thought that the `BEGIN' rule is executed at the beginning of each data @@ -15242,7 +15247,7 @@ again the value of multiple `BEGIN' and `END' rules should be clear. pass and at the beginning of the second pass. The following version solves the problem: - # ftrans.awk --- handle data file transitions + # ftrans.awk --- handle datafile transitions # # user supplies beginfile() and endfile() functions @@ -15258,7 +15263,7 @@ solves the problem: *note Wc Program::, shows how this library function can be used and how it simplifies writing the main program. - So Why Does `gawk' have `BEGINFILE' and `ENDFILE'? + So Why Does `gawk' Have `BEGINFILE' and `ENDFILE'? You are probably wondering, if `beginfile()' and `endfile()' functions can do the job, why does `gawk' have `BEGINFILE' and @@ -15266,7 +15271,7 @@ functions can do the job, why does `gawk' have `BEGINFILE' and Good question. Normally, if `awk' cannot open a file, this causes an immediate fatal error. In this case, there is no way for a -user-defined function to deal with the problem, since the mechanism for +user-defined function to deal with the problem, as the mechanism for calling it relies on the file being open and at the first record. Thus, the main reason for `BEGINFILE' is to give you a "hook" to catch files that cannot be processed. `ENDFILE' exists for symmetry, and because @@ -15310,8 +15315,8 @@ over with it from the top. For lack of a better name, we'll call it Auto-set::), which is specific to `gawk'. It also relies on the `nextfile' keyword (*note Nextfile Statement::). Because of this, you should not call it from an `ENDFILE' rule. (This isn't necessary -anyway, since as soon as an `ENDFILE' rule finishes `gawk' goes to the -next file!) +anyway, because `gawk' goes to the next file as soon as an `ENDFILE' +rule finishes!)  File: gawk.info, Node: File Checking, Next: Empty Files, Prev: Rewind Function, Up: Data File Management @@ -15339,12 +15344,12 @@ following program to your `awk' program: } This works, because the `getline' won't be fatal. Removing the -element from `ARGV' with `delete' skips the file (since it's no longer -in the list). See also *note ARGC and ARGV::. +element from `ARGV' with `delete' skips the file (because it's no +longer in the list). See also *note ARGC and ARGV::. - The regular expression check purposely does not use character classes -such as `[:alpha:]' and `[:alnum:]' (*note Bracket Expressions::) since -`awk' variable names only allow the English letters. + Because `awk' variable names only allow the English letters, the +regular expression check purposely does not use character classes such +as `[:alpha:]' and `[:alnum:]' (*note Bracket Expressions::) ---------- Footnotes ---------- @@ -15452,11 +15457,11 @@ File: gawk.info, Node: Getopt Function, Next: Passwd Functions, Prev: Data Fi 10.4 Processing Command-Line Options ==================================== -Most utilities on POSIX compatible systems take options on the command +Most utilities on POSIX-compatible systems take options on the command line that can be used to change the way a program behaves. `awk' is an example of such a program (*note Options::). Often, options take -"arguments"; i.e., data that the program needs to correctly obey the -command-line option. For example, `awk''s `-F' option requires a +"arguments" (i.e., data that the program needs to correctly obey the +command-line option). For example, `awk''s `-F' option requires a string to use as the field separator. The first occurrence on the command line of either `--' or a string that does not begin with `-' ends the options. @@ -15681,10 +15686,10 @@ next element in `argv'. If neither condition is true, then only on the next call to `getopt()'. The `BEGIN' rule initializes both `Opterr' and `Optind' to one. -`Opterr' is set to one, since the default behavior is for `getopt()' to -print a diagnostic message upon seeing an invalid option. `Optind' is -set to one, since there's no reason to look at the program name, which -is in `ARGV[0]': +`Opterr' is set to one, because the default behavior is for `getopt()' +to print a diagnostic message upon seeing an invalid option. `Optind' +is set to one, because there's no reason to look at the program name, +which is in `ARGV[0]': BEGIN { Opterr = 1 # default is to diagnose @@ -15724,14 +15729,14 @@ result of two sample runs of the test program: In both runs, the first `--' terminates the arguments to `awk', so that it does not try to interpret the `-a', etc., as its own options. - NOTE: After `getopt()' is through, user level code must clear out + NOTE: After `getopt()' is through, user-level code must clear out all the elements of `ARGV' from 1 to `Optind', so that `awk' does not try to process the command-line options as file names. Using `#!' with the `-E' option may help avoid conflicts between -your program's options and `gawk''s options, since `-E' causes `gawk' -to abandon processing of further options (*note Executable Scripts::, -and *note Options::). +your program's options and `gawk''s options, as `-E' causes `gawk' to +abandon processing of further options (*note Executable Scripts::, and +*note Options::). Several of the sample programs presented in *note Sample Programs::, use `getopt()' to process their arguments. @@ -15740,7 +15745,7 @@ use `getopt()' to process their arguments. (1) This function was written before `gawk' acquired the ability to split strings into single characters using `""' as the separator. We -have left it alone, since using `substr()' is more portable. +have left it alone, as using `substr()' is more portable.  File: gawk.info, Node: Passwd Functions, Next: Group Functions, Prev: Getopt Function, Up: Library Functions @@ -15765,7 +15770,7 @@ function is `getpwent()', for "get password entry." The "password" comes from the original user database file, `/etc/passwd', which stores user information, along with the encrypted passwords (hence the name). - While an `awk' program could simply read `/etc/passwd' directly, + Although an `awk' program could simply read `/etc/passwd' directly, this file may not contain complete information about the system's set of users.(1) To be sure you are able to produce a readable and complete version of the user database, it is necessary to write a small C @@ -15810,13 +15815,13 @@ Encrypted password systems. User-ID - The user's numeric user ID number. (On some systems it's a C + The user's numeric user ID number. (On some systems, it's a C `long', and not an `int'. Thus we cast it to `long' for all cases.) Group-ID The user's numeric group ID number. (Similar comments about - `long' vs. `int' apply here.) + `long' versus `int' apply here.) Full name The user's full name, and perhaps other information associated @@ -15894,14 +15899,14 @@ you might want it to be in a different directory on your system. into three associative arrays. The arrays are indexed by username (`_pw_byname'), by user ID number (`_pw_byuid'), and by order of occurrence (`_pw_bycount'). The variable `_pw_inited' is used for -efficiency, since `_pw_init()' needs to be called only once. +efficiency, as `_pw_init()' needs to be called only once. Because this function uses `getline' to read information from `pwcat', it first saves the values of `FS', `RS', and `$0'. It notes in the variable `using_fw' whether field splitting with `FIELDWIDTHS' -is in effect or not. Doing so is necessary, since these functions -could be called from anywhere within a user's program, and the user may -have his or her own way of splitting records and fields. This makes it +is in effect or not. Doing so is necessary, as these functions could +be called from anywhere within a user's program, and the user may have +his or her own way of splitting records and fields. This makes it possible to restore the correct field-splitting mechanism later. The test can only be true for `gawk'. It is false if using `FS' or `FPAT', or on some other `awk' implementation. @@ -15972,8 +15977,8 @@ simplifies the code but runs an extra process that may never be needed.) once. If you are worried about squeezing every last cycle out of your `awk' program, the check of `_pw_inited' could be moved out of `_pw_init()' and duplicated in all the other functions. In practice, -this is not necessary, since most `awk' programs are I/O-bound, and -such a change would clutter up the code. +this is not necessary, as most `awk' programs are I/O-bound, and such a +change would clutter up the code. The `id' program in *note Id Program::, uses these functions. @@ -16043,7 +16048,7 @@ Group ID Number cases.) Group Member List - A comma-separated list of user names. These users are members of + A comma-separated list of usernames. These users are members of the group. Modern Unix systems allow users to be members of several groups simultaneously. If your system does, then there are elements `"group1"' through `"groupN"' in `PROCINFO' for those @@ -16134,7 +16139,7 @@ used, and to restore the appropriate field splitting mechanism. The group information is stored is several associative arrays. The arrays are indexed by group name (`_gr_byname'), by group ID number (`_gr_bygid'), and by position in the database (`_gr_bycount'). There -is an additional array indexed by user name (`_gr_groupsbyuser'), which +is an additional array indexed by username (`_gr_groupsbyuser'), which is a space-separated list of groups to which each user belongs. Unlike the user database, it is possible to have multiple records in @@ -16146,7 +16151,7 @@ following: tvpeople:*:101:david,conan,tom,joan For this reason, `_gr_init()' looks to see if a group name or group -ID number is already seen. If it is, then the user names are simply +ID number is already seen. If it is, the usernames are simply concatenated onto the previous list of users.(1) Finally, `_gr_init()' closes the pipeline to `grcat', restores `FS' @@ -16174,7 +16179,7 @@ looks up the information associated with that group ID: } The `getgruser()' function does not have a C counterpart. It takes a -user name and returns the list of groups that have the user as a member: +username and returns the list of groups that have the user as a member: function getgruser(user) { @@ -16286,7 +16291,7 @@ File: gawk.info, Node: Library Functions Summary, Next: Library Exercises, Pr * The functions presented here fit into the following categories: General problems - Number to string conversion, assertions, rounding, random + Number-to-string conversion, assertions, rounding, random number generation, converting characters to numbers, joining strings, getting easily usable time-of-day information, and reading a whole file in one shot. @@ -16415,7 +16420,7 @@ programming for "real world" tasks.  File: gawk.info, Node: Cut Program, Next: Egrep Program, Up: Clones -11.2.1 Cutting out Fields and Columns +11.2.1 Cutting Out Fields and Columns ------------------------------------- The `cut' utility selects, or "cuts," characters or fields from its @@ -16632,10 +16637,10 @@ filler fields: nfields = j - 1 } - Next is the rule that actually processes the data. If the `-s' -option is given, then `suppress' is true. The first `if' statement -makes sure that the input record does have the field separator. If -`cut' is processing fields, `suppress' is true, and the field separator + Next is the rule that processes the data. If the `-s' option is +given, then `suppress' is true. The first `if' statement makes sure +that the input record does have the field separator. If `cut' is +processing fields, `suppress' is true, and the field separator character is not in the record, then the record is skipped. If the record is valid, then `gawk' has split the data into fields, @@ -16660,8 +16665,8 @@ out between the fields: } This version of `cut' relies on `gawk''s `FIELDWIDTHS' variable to -do the character-based cutting. While it is possible in other `awk' -implementations to use `substr()' (*note String Functions::), it is +do the character-based cutting. It is possible in other `awk' +implementations to use `substr()' (*note String Functions::), but it is also extremely painful. The `FIELDWIDTHS' variable supplies an elegant solution to the problem of picking the input line apart by characters. @@ -16772,14 +16777,14 @@ the matched lines in the output: # pattern = tolower(pattern) } - The last two lines are commented out, since they are not needed in + The last two lines are commented out, as they are not needed in `gawk'. They should be uncommented if you have to use another version of `awk'. The next set of lines should be uncommented if you are not using `gawk'. This rule translates all the characters in the input line into lowercase if the `-i' option is specified.(1) The rule is commented out -since it is not necessary with `gawk': +as it is not necessary with `gawk': #{ # if (IGNORECASE) @@ -16891,7 +16896,7 @@ the translated line, not the original.  File: gawk.info, Node: Id Program, Next: Split Program, Prev: Egrep Program, Up: Clones -11.2.3 Printing out User Information +11.2.3 Printing Out User Information ------------------------------------ The `id' utility lists a user's real and effective user ID numbers, @@ -16975,7 +16980,7 @@ and the group numbers: The test in the `for' loop is worth noting. Any supplementary groups in the `PROCINFO' array have the indices `"group1"' through -`"groupN"' for some N, i.e., the total number of supplementary groups. +`"groupN"' for some N (i.e., the total number of supplementary groups). However, we don't know in advance how many of these groups there are. This loop works by starting at one, concatenating the value with @@ -17004,11 +17009,11 @@ is as follows:(1) `split' [`-COUNT'] [FILE] [PREFIX] By default, the output files are named `xaa', `xab', and so on. Each -file has 1000 lines in it, with the likely exception of the last file. +file has 1,000 lines in it, with the likely exception of the last file. To change the number of lines in each file, supply a number on the -command line preceded with a minus; e.g., `-500' for files with 500 -lines in them instead of 1000. To change the name of the output files -to something like `myfileaa', `myfileab', and so on, supply an +command line preceded with a minus (e.g., `-500' for files with 500 +lines in them instead of 1,000). To change the name of the output +files to something like `myfileaa', `myfileab', and so on, supply an additional argument that specifies the file name prefix. Here is a version of `split' in `awk'. It uses the `ord()' and @@ -17041,7 +17046,7 @@ output file names: } # test argv in case reading from stdin instead of file if (i in ARGV) - i++ # skip data file name + i++ # skip datafile name if (i in ARGV) { outfile = ARGV[i] ARGV[i] = "" @@ -17113,8 +17118,8 @@ files named on the command line. Its usage is as follows: truncating them and starting over. The `BEGIN' rule first makes a copy of all the command-line arguments -into an array named `copy'. `ARGV[0]' is not copied, since it is not -needed. `tee' cannot use `ARGV' directly, since `awk' attempts to +into an array named `copy'. `ARGV[0]' is not needed, so it is not +copied. `tee' cannot use `ARGV' directly, because `awk' attempts to process each file name in `ARGV' as input data. If the first argument is `-a', then the flag variable `append' is @@ -17146,7 +17151,7 @@ input by setting `ARGV[1]' to `"-"' and `ARGC' to two: ARGC = 2 } - The following single rule does all the work. Since there is no + The following single rule does all the work. Because there is no pattern, it is executed for each line of input. The body of the rule simply prints the line into each file on the command line, and then to the standard output: @@ -17170,11 +17175,12 @@ It is also possible to write the loop this way: else print > copy[i] -This is more concise but it is also less efficient. The `if' is tested -for each record and for each output file. By duplicating the loop -body, the `if' is only tested once for each input record. If there are -N input records and M output files, the first method only executes N -`if' statements, while the second executes N`*'M `if' statements. +This is more concise, but it is also less efficient. The `if' is +tested for each record and for each output file. By duplicating the +loop body, the `if' is only tested once for each input record. If +there are N input records and M output files, the first method only +executes N `if' statements, while the second executes N`*'M `if' +statements. Finally, the `END' rule cleans up by closing all the output files: @@ -17352,13 +17358,13 @@ to. depending upon the results of `are_equal()''s comparison. If `uniq' is counting repeated lines, and the lines are equal, then it increments the `count' variable. Otherwise, it prints the line and resets `count', -since the two lines are not equal. +because the two lines are not equal. If `uniq' is not counting, and if the lines are equal, `count' is -incremented. Nothing is printed, since the point is to remove -duplicates. Otherwise, if `uniq' is counting repeated lines and more -than one line is seen, or if `uniq' is counting nonrepeated lines and -only one line is seen, then the line is printed, and `count' is reset. +incremented. Nothing is printed, as the point is to remove duplicates. +Otherwise, if `uniq' is counting repeated lines and more than one line +is seen, or if `uniq' is counting nonrepeated lines and only one line +is seen, then the line is printed, and `count' is reset. Finally, similar logic is used in the `END' rule to print the final line of input data: @@ -17430,10 +17436,10 @@ follows: `-c' Count only characters. - Implementing `wc' in `awk' is particularly elegant, since `awk' does -a lot of the work for us; it splits lines into words (i.e., fields) and -counts them, it counts lines (i.e., records), and it can easily tell us -how long a line is. + Implementing `wc' in `awk' is particularly elegant, because `awk' +does a lot of the work for us; it splits lines into words (i.e., +fields) and counts them, it counts lines (i.e., records), and it can +easily tell us how long a line is. This program uses the `getopt()' library function (*note Getopt Function::) and the file-transition functions (*note Filetrans @@ -17540,7 +17546,7 @@ in its length. Next, `lines' is incremented for each line read, and ---------- Footnotes ---------- - (1) Since `gawk' understands multibyte locales, this code counts + (1) Because `gawk' understands multibyte locales, this code counts characters, not bytes.  @@ -17854,14 +17860,15 @@ record: print } - While it is possible to do character transliteration in a user-level -function, it is not necessarily efficient, and we (the `gawk' authors) -started to consider adding a built-in function. However, shortly after -writing this program, we learned that Brian Kernighan had added the -`toupper()' and `tolower()' functions to his `awk' (*note String -Functions::). These functions handle the vast majority of the cases -where character transliteration is necessary, and so we chose to simply -add those functions to `gawk' as well and then leave well enough alone. + It is possible to do character transliteration in a user-level +function, but it is not necessarily efficient, and we (the `gawk' +developers) started to consider adding a built-in function. However, +shortly after writing this program, we learned that Brian Kernighan had +added the `toupper()' and `tolower()' functions to his `awk' (*note +String Functions::). These functions handle the vast majority of the +cases where character transliteration is necessary, and so we chose to +simply add those functions to `gawk' as well and then leave well enough +alone. An obvious improvement to this program would be to set up the `t_ar' array only once, in a `BEGIN' rule. However, this assumes that the @@ -17898,7 +17905,7 @@ been read. The `BEGIN' rule simply sets `RS' to the empty string, so that `awk' splits records at blank lines (*note Records::). It sets `MAXLINES' to -100, since 100 is the maximum number of lines on the page (20 * 5 = +100, because 100 is the maximum number of lines on the page (20 * 5 = 100). Most of the work is done in the `printpage()' function. The label @@ -18022,9 +18029,9 @@ on real text files: * The `awk' language considers upper- and lowercase characters to be distinct. Therefore, "bartender" and "Bartender" are not treated - as the same word. This is undesirable, since in normal text, words - are capitalized if they begin sentences, and a frequency analyzer - should not be sensitive to capitalization. + as the same word. This is undesirable, because words are + capitalized if they begin sentences in normal text, and a + frequency analyzer should not be sensitive to capitalization. * Words are detected using the `awk' convention that fields are separated just by whitespace. Other characters in the input @@ -18147,9 +18154,9 @@ File: gawk.info, Node: Extract Program, Next: Simple Sed, Prev: History Sorti The nodes *note Library Functions::, and *note Sample Programs::, are the top level nodes for a large number of `awk' programs. If you want -to experiment with these programs, it is tedious to have to type them -in by hand. Here we present a program that can extract parts of a -Texinfo input file into separate files. +to experiment with these programs, it is tedious to type them in by +hand. Here we present a program that can extract parts of a Texinfo +input file into separate files. This Info file is written in Texinfo (http://www.gnu.org/software/texinfo/), the GNU project's document @@ -18206,7 +18213,7 @@ file looks something like this: @example @c file examples/messages.awk - END @{ print "Always avoid bored archeologists!" @} + END @{ print "Always avoid bored archaeologists!" @} @c end file @end example ... @@ -18342,15 +18349,15 @@ File: gawk.info, Node: Simple Sed, Next: Igawk Program, Prev: Extract Program The `sed' utility is a stream editor, a program that reads a stream of data, makes changes to it, and passes it on. It is often used to make global changes to a large file or to a stream of data generated by a -pipeline of commands. While `sed' is a complicated program in its own -right, its most common use is to perform global substitutions in the -middle of a pipeline: +pipeline of commands. Although `sed' is a complicated program in its +own right, its most common use is to perform global substitutions in +the middle of a pipeline: COMMAND1 < orig.data | sed 's/old/new/g' | COMMAND2 > result Here, `s/old/new/g' tells `sed' to look for the regexp `old' on each -input line and globally replace it with the text `new', i.e., all the -occurrences on a line. This is similar to `awk''s `gsub()' function +input line and globally replace it with the text `new' (i.e., all the +occurrences on a line). This is similar to `awk''s `gsub()' function (*note String Functions::). The following program, `awksed.awk', accepts at least two @@ -18411,7 +18418,7 @@ arguments and calling `usage()' if there is a problem. Then it sets (*note ARGC and ARGV::). The `usage()' function prints an error message and exits. Finally, -the single rule handles the printing scheme outlined above, using +the single rule handles the printing scheme outlined earlier, using `print' or `printf' as appropriate, depending upon the value of `RT'.  @@ -18449,10 +18456,10 @@ to be able to write programs in the following manner: The following program, `igawk.sh', provides this service. It simulates `gawk''s searching of the `AWKPATH' variable and also allows -"nested" includes; i.e., a file that is included with `@include' can -contain further `@include' statements. `igawk' makes an effort to only -include files once, so that nested includes don't accidentally include -a library function twice. +"nested" includes (i.e., a file that is included with `@include' can +contain further `@include' statements). `igawk' makes an effort to +only include files once, so that nested includes don't accidentally +include a library function twice. `igawk' should behave just like `gawk' externally. This means it should accept all of `gawk''s command-line arguments, including the @@ -18473,8 +18480,8 @@ language.(1) It works as follows: b. Source file names, provided with `-f'. We use a neat trick and append `@include FILENAME' to the shell variable's - contents. Since the file-inclusion program works the way - `gawk' does, this gets the text of the file included into the + contents. Because the file-inclusion program works the way + `gawk' does, this gets the text of the file included in the program at the correct point. 3. Run an `awk' program (naturally) over the shell variable's @@ -18734,13 +18741,13 @@ is saved as a single string, even if the results contain whitespace. It's done in these steps: 1. Run `gawk' with the `@include'-processing program (the value of - the `expand_prog' shell variable) on standard input. + the `expand_prog' shell variable) reading standard input. 2. Standard input is the contents of the user's program, from the - shell variable `program'. Its contents are fed to `gawk' via a - here document. + shell variable `program'. Feed its contents to `gawk' via a here + document. - 3. The results of this processing are saved in the shell variable + 3. Save the results of this processing in the shell variable `processed_program' by using command substitution. The last step is to call `gawk' with the expanded program, along @@ -18797,23 +18804,23 @@ use of `awk' programs as Web CGI scripts.  File: gawk.info, Node: Anagram Program, Next: Signature Program, Prev: Igawk Program, Up: Miscellaneous Programs -11.3.10 Finding Anagrams From A Dictionary +11.3.10 Finding Anagrams from a Dictionary ------------------------------------------ An interesting programming challenge is to search for "anagrams" in a word list (such as `/usr/share/dict/words' on many GNU/Linux systems). One word is an anagram of another if both words contain the same letters -(for example, "babbling" and "blabbing"). +(e.g., "babbling" and "blabbing"). - Column 2, Problem C of Jon Bentley's `Programming Pearls', second -edition, presents an elegant algorithm. The idea is to give words that + Column 2, Problem C, of Jon Bentley's `Programming Pearls', Second +Edition, presents an elegant algorithm. The idea is to give words that are anagrams a common signature, sort all the words together by their signature, and then print them. Dr. Bentley observes that taking the letters in each word and sorting them produces that common signature. 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. +order: # anagram.awk --- An implementation of the anagram finding algorithm # from Jon Bentley's "Programming Pearls", 2nd edition. @@ -18850,8 +18857,8 @@ back together: } Finally, the `END' rule traverses the array and prints out the -anagram lists. It sends the output to the system `sort' command, since -otherwise the anagrams would appear in arbitrary order: +anagram lists. It sends the output to the system `sort' command +because otherwise the anagrams would appear in arbitrary order: END { sort = "sort" @@ -18886,7 +18893,7 @@ otherwise the anagrams would appear in arbitrary order:  File: gawk.info, Node: Signature Program, Prev: Anagram Program, Up: Miscellaneous Programs -11.3.11 And Now For Something Completely Different +11.3.11 And Now for Something Completely Different -------------------------------------------------- The following program was written by Davide Brini and is published on @@ -19167,7 +19174,7 @@ in a particular order that you, the programmer, choose. `gawk' lets you do this. *note Controlling Scanning::, describes how you can assign special, -pre-defined values to `PROCINFO["sorted_in"]' in order to control the +predefined values to `PROCINFO["sorted_in"]' in order to control the order in which `gawk' traverses an array during a `for' loop. In addition, the value of `PROCINFO["sorted_in"]' can be a function @@ -19324,7 +19331,7 @@ Running the program produces the following output: The comparison should normally always return the same value when given a specific pair of array elements as its arguments. If -inconsistent results are returned then the order is undefined. This +inconsistent results are returned, then the order is undefined. This behavior can be exploited to introduce random order into otherwise seemingly ordered data: @@ -19334,7 +19341,7 @@ seemingly ordered data: return (2 - 4 * rand()) } - As mentioned above, the order of the indices is arbitrary if two + As already mentioned, the order of the indices is arbitrary if two elements compare equal. This is usually not a problem, but letting the tied elements come out in arbitrary order can be an issue, especially when comparing item values. The partial ordering of the equal elements @@ -19368,16 +19375,16 @@ such a function. When string comparisons are made during a sort, either for element values where one or both aren't numbers, or for element indices handled as strings, the value of `IGNORECASE' (*note Built-in Variables::) -controls whether the comparisons treat corresponding uppercase and +controls whether the comparisons treat corresponding upper- and lowercase letters as equivalent or distinct. - Another point to keep in mind is that in the case of subarrays the + Another point to keep in mind is that in the case of subarrays, the element values can themselves be arrays; a production comparison function should use the `isarray()' function (*note Type Functions::), to check for this, and choose a defined sorting order for subarrays. All sorting based on `PROCINFO["sorted_in"]' is disabled in POSIX -mode, since the `PROCINFO' array is not special in that case. +mode, because the `PROCINFO' array is not special in that case. As a side note, sorting the array indices before traversing the array has been reported to add 15% to 20% overhead to the execution @@ -19396,10 +19403,10 @@ File: gawk.info, Node: Array Sorting Functions, Prev: Controlling Array Traver --------------------------------------------------- In most `awk' implementations, sorting an array requires writing a -`sort()' function. While this can be educational for exploring -different sorting algorithms, usually that's not the point of the -program. `gawk' provides the built-in `asort()' and `asorti()' -functions (*note String Functions::) for sorting arrays. For example: +`sort()' function. This can be educational for exploring different +sorting algorithms, but usually that's not the point of the program. +`gawk' provides the built-in `asort()' and `asorti()' functions (*note +String Functions::) for sorting arrays. For example: POPULATE THE ARRAY data n = asort(data) @@ -19480,8 +19487,8 @@ comparisons are based on character values only.(1) ---------- Footnotes ---------- (1) This is true because locale-based comparison occurs only when in -POSIX compatibility mode, and since `asort()' and `asorti()' are `gawk' -extensions, they are not available in that case. +POSIX-compatibility mode, and because `asort()' and `asorti()' are +`gawk' extensions, they are not available in that case.  File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Array Sorting, Up: Advanced Features @@ -19510,7 +19517,7 @@ the program be run in a directory that cannot be shared among users; for example, `/tmp' will not do, as another user might happen to be using a temporary file with the same name.(1) However, with `gawk', it is possible to open a _two-way_ pipe to another process. The second -process is termed a "coprocess", since it runs in parallel with `gawk'. +process is termed a "coprocess", as it runs in parallel with `gawk'. The two-way connection is created using the `|&' operator (borrowed from the Korn shell, `ksh'):(2) @@ -19626,7 +19633,7 @@ connection. You can think of this as just a _very long_ two-way pipeline to a coprocess. The way `gawk' decides that you want to use TCP/IP networking is by recognizing special file names that begin with one of -`/inet/', `/inet4/' or `/inet6/'. +`/inet/', `/inet4/', or `/inet6/'. The full syntax of the special file name is `/NET-TYPE/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'. The @@ -19652,7 +19659,7 @@ LOCAL-PORT `getaddrinfo()' function. REMOTE-HOST - The IP address or fully-qualified domain name of the Internet host + The IP address or fully qualified domain name of the Internet host to which you want to connect. REMOTE-PORT @@ -19700,7 +19707,7 @@ used to change the name of the file where `gawk' will write the profile: gawk --profile=myprog.prof -f myprog.awk data1 data2 -In the above example, `gawk' places the profile in `myprog.prof' +In the preceding example, `gawk' places the profile in `myprog.prof' instead of in `awkprof.out'. Here is a sample session showing a simple `awk' program, its input @@ -19831,9 +19838,9 @@ output. They are as follows: * Parentheses are used only where needed, as indicated by the structure of the program and the precedence rules. For example, - `(3 + 5) * 4' means add three plus five, then multiply the total - by four. However, `3 + 5 * 4' has no parentheses, and means `3 + - (5 * 4)'. + `(3 + 5) * 4' means add three and five, then multiply the total by + four. However, `3 + 5 * 4' has no parentheses, and means `3 + (5 + * 4)'. * Parentheses are used around the arguments to `print' and `printf' only when the `print' or `printf' statement is followed by a @@ -20023,12 +20030,12 @@ components--programs written in C or C++, as well as scripts written in named `guide'. Internationalization consists of the following steps, in this order: - 1. The programmer goes through the source for all of `guide''s - components and marks each string that is a candidate for - translation. For example, `"`-F': option required"' is a good - candidate for translation. A table with strings of option names - is not (e.g., `gawk''s `--profile' option should remain the same, - no matter what the local language). + 1. The programmer reviews the source for all of `guide''s components + and marks each string that is a candidate for translation. For + example, `"`-F': option required"' is a good candidate for + translation. A table with strings of option names is not (e.g., + `gawk''s `--profile' option should remain the same, no matter what + the local language). 2. The programmer indicates the application's text domain (`"guide"') to the `gettext' library, by calling the `textdomain()' function. @@ -20097,8 +20104,8 @@ are: a different category.) `LC_COLLATE' - Text-collation information; i.e., how different characters and/or - groups of characters sort in a given language. + Text-collation information (i.e., how different characters and/or + groups of characters sort in a given language). `LC_CTYPE' Character-type information (alphabetic, digit, upper- or @@ -20403,7 +20410,7 @@ them to other versions of `awk'. Consider this program: As written, it won't work on other versions of `awk'. However, it is actually almost portable, requiring very little change: - * Assignments to `TEXTDOMAIN' won't have any effect, since + * Assignments to `TEXTDOMAIN' won't have any effect, because `TEXTDOMAIN' is not special in other `awk' implementations. * Non-GNU versions of `awk' treat marked strings as the @@ -20439,10 +20446,10 @@ actually almost portable, requiring very little change: and arguments unchanged to the underlying C library version of `sprintf()', but only one format and argument at a time. What happens if a positional specification is used is anybody's guess. - However, since the positional specifications are primarily for use - in _translated_ format strings, and since non-GNU `awk's never - retrieve the translated string, this should not be a problem in - practice. + However, because the positional specifications are primarily for + use in _translated_ format strings, and because non-GNU `awk's + never retrieve the translated string, this should not be a problem + in practice. ---------- Footnotes ---------- @@ -20505,7 +20512,7 @@ Following are the translations: The next step is to make the directory to hold the binary message object file and then to create the `guide.mo' file. We pretend that -our file is to be used in the `en_US.UTF-8' locale, since we have to +our file is to be used in the `en_US.UTF-8' locale, because we have to use a locale name known to the C `gettext' routines. The directory layout shown here is standard for GNU `gettext' on GNU/Linux systems. Other versions of `gettext' may use a different layout: @@ -20526,7 +20533,7 @@ proper directory (using the `-o' option) so that `gawk' can find it: -| Like, the scoop is 42 -| Pardon me, Zaphod who? - If the three replacement functions for `dcgettext()', `dcngettext()' + If the three replacement functions for `dcgettext()', `dcngettext()', and `bindtextdomain()' (*note I18N Portability::) are in a file named `libintl.awk', then we can run `guide.awk' unchanged as follows: @@ -20615,7 +20622,7 @@ program is easy.  File: gawk.info, Node: Debugging, Next: Sample Debugging Session, Up: Debugger -14.1 Introduction to The `gawk' Debugger +14.1 Introduction to the `gawk' Debugger ======================================== This minor node introduces debugging in general and begins the @@ -20637,9 +20644,9 @@ File: gawk.info, Node: Debugging Concepts, Next: Debugging Terms, Up: Debuggi ahead to the next section on the specific features of the `gawk' debugger.) - Of course, a debugging program cannot remove bugs for you, since it -has no way of knowing what you or your users consider a "bug" and what -is a "feature." (Sometimes, we humans have a hard time with this + Of course, a debugging program cannot remove bugs for you, because +it has no way of knowing what you or your users consider a "bug" versus +a "feature." (Sometimes, we humans have a hard time with this ourselves.) In that case, what can you expect from such a tool? The answer to that depends on the language being debugged, but in general, you can expect at least the following: @@ -20655,7 +20662,7 @@ you can expect at least the following: * The chance to see the values of data in the program at any point in execution, and also to change that data on the fly, to see how that - affects what happens afterwards. (This often includes the ability + affects what happens afterward. (This often includes the ability to look at internal data structures besides the variables you actually defined in your code.) @@ -20675,9 +20682,9 @@ File: gawk.info, Node: Debugging Terms, Next: Awk Debugging, Prev: Debugging Before diving in to the details, we need to introduce several important concepts that apply to just about all debuggers. The following list -defines terms used throughout the rest of this major node. +defines terms used throughout the rest of this major node: -"Stack Frame" +"Stack frame" Programs generally call functions during the course of their execution. One function can call another, or a function can call itself (recursion). You can view the chain of called functions @@ -20713,11 +20720,11 @@ defines terms used throughout the rest of this major node. breakpoints are oriented around the code: stop when a certain point in the code is reached. A watchpoint, however, specifies that program execution should stop when a _data value_ is changed. - This is useful, since sometimes it happens that a variable - receives an erroneous value, and it's hard to track down where - this happens just by looking at the code. By using a watchpoint, - you can stop whenever a variable is assigned to, and usually find - the errant code quite quickly. + This is useful, as sometimes it happens that a variable receives + an erroneous value, and it's hard to track down where this happens + just by looking at the code. By using a watchpoint, you can stop + whenever a variable is assigned to, and usually find the errant + code quite quickly.  File: gawk.info, Node: Awk Debugging, Prev: Debugging Terms, Up: Debugging @@ -20728,16 +20735,16 @@ File: gawk.info, Node: Awk Debugging, Prev: Debugging Terms, Up: Debugging Debugging an `awk' program has some specific aspects that are not shared with other programming languages. - First of all, the fact that `awk' programs usually take input -line-by-line from a file or files and operate on those lines using -specific rules makes it especially useful to organize viewing the -execution of the program in terms of these rules. As we will see, each -`awk' rule is treated almost like a function call, with its own -specific block of instructions. + First of all, the fact that `awk' programs usually take input line +by line from a file or files and operate on those lines using specific +rules makes it especially useful to organize viewing the execution of +the program in terms of these rules. As we will see, each `awk' rule +is treated almost like a function call, with its own specific block of +instructions. - In addition, since `awk' is by design a very concise language, it is -easy to lose sight of everything that is going on "inside" each line of -`awk' code. The debugger provides the opportunity to look at the + In addition, because `awk' is by design a very concise language, it +is easy to lose sight of everything that is going on "inside" each line +of `awk' code. The debugger provides the opportunity to look at the individual primitive instructions carried out by the higher-level `awk' commands. @@ -20848,8 +20855,8 @@ the current stack frames: -| #1 in main() at `awklib/eg/prog/uniq.awk':88 This tells us that `are_equal()' was called by the main program at -line 88 of `uniq.awk'. (This is not a big surprise, since this is the -only call to `are_equal()' in the program, but in more complex +line 88 of `uniq.awk'. (This is not a big surprise, because this is +the only call to `are_equal()' in the program, but in more complex programs, knowing who called a function and with what parameters can be the key to finding the source of the problem.) @@ -20861,7 +20868,7 @@ Actually, the debugger gives us: gawk> p n -| n = untyped variable -In this case, `n' is an uninitialized local variable, since the +In this case, `n' is an uninitialized local variable, because the function was called without arguments (*note Function Calls::). A more useful variable to display might be the current record: @@ -20869,8 +20876,8 @@ function was called without arguments (*note Function Calls::). gawk> p $0 -| $0 = "gawk is a wonderful program!" -This might be a bit puzzling at first since this is the second line of -our test input above. Let's look at `NR': +This might be a bit puzzling at first, as this is the second line of +our test input. Let's look at `NR': gawk> p NR -| NR = 2 @@ -20901,7 +20908,7 @@ typing `n' (for "next"): This tells us that `gawk' is now ready to execute line 66, which decides whether to give the lines the special "field skipping" treatment indicated by the `-1' command-line option. (Notice that we skipped -from where we were before at line 63 to here, since the condition in +from where we were before at line 63 to here, because the condition in line 63 `if (fcount == 0 && charcount == 0)' was false.) Continuing to step, we now get to the splitting of the current and @@ -20926,9 +20933,9 @@ split into, so we try to look: This is kind of disappointing, though. All we found out is that there are five elements in `alast'; `m' and `aline' don't have values -since we are at line 68 but haven't executed it yet. This information -is useful enough (we now know that none of the words were accidentally -left out), but what if we want to see inside the array? +because we are at line 68 but haven't executed it yet. This +information is useful enough (we now know that none of the words were +accidentally left out), but what if we want to see inside the array? The first choice would be to use subscripts: @@ -21010,7 +21017,7 @@ abbreviation on a second description line. A debugger command name may also be truncated if that partial name is unambiguous. The debugger has the built-in capability to automatically repeat the previous command just by hitting . This works for the commands `list', `next', -`nexti', `step', `stepi' and `continue' executed without any argument. +`nexti', `step', `stepi', and `continue' executed without any argument. * Menu: @@ -21028,10 +21035,10 @@ File: gawk.info, Node: Breakpoint Control, Next: Debugger Execution Control, 14.3.1 Control of Breakpoints ----------------------------- -As we saw above, the first thing you probably want to do in a debugging -session is to get your breakpoints set up, since otherwise your program -will just run as if it was not under the debugger. The commands for -controlling breakpoints are: +As we saw earlier, the first thing you probably want to do in a +debugging session is to get your breakpoints set up, because your +program will otherwise just run as if it was not under the debugger. +The commands for controlling breakpoints are: `break' [[FILENAME`:']N | FUNCTION] [`"EXPRESSION"'] `b' [[FILENAME`:']N | FUNCTION] [`"EXPRESSION"'] @@ -21083,8 +21090,8 @@ controlling breakpoints are: reached. If the condition is true, then the debugger stops execution and prompts for a command. Otherwise, the debugger continues executing the program. If the condition expression is - not specified, any existing condition is removed; i.e., the - breakpoint or watchpoint is made unconditional. + not specified, any existing condition is removed (i.e., the + breakpoint or watchpoint is made unconditional). `delete' [N1 N2 ...] [N-M] `d' [N1 N2 ...] [N-M] @@ -21175,7 +21182,7 @@ execution of the program than we saw in our earlier example: Cancel execution of a function call. If VALUE (either a string or a number) is specified, it is used as the function's return value. If used in a frame other than the innermost one (the currently - executing function, i.e., frame number 0), discard all inner + executing function; i.e., frame number 0), discard all inner frames in addition to the selected one, and the caller of that frame becomes the innermost frame. @@ -21223,7 +21230,7 @@ The commands for viewing and changing variables inside of `gawk' are: gawk> display x -| 10: x = 1 - displays the assigned item number, the variable name and its + This displays the assigned item number, the variable name, and its current value. If the display variable refers to a function parameter, it is silently deleted from the list as soon as the execution reaches a context where no such variable of the given @@ -21272,7 +21279,7 @@ AWK STATEMENTS (`"'...`"'). You can also set special `awk' variables, such as `FS', `NF', - `NR', etc. + `NR', and son on. `watch' VAR | `$'N [`"EXPRESSION"'] `w' VAR | `$'N [`"EXPRESSION"'] @@ -21316,8 +21323,8 @@ are: innermost COUNT frames if COUNT > 0. Print the outermost COUNT frames if COUNT < 0. The backtrace displays the name and arguments to each function, the source file name, and the line - number. The alias `where' for `backtrace' is provided for - long-time GDB users who may be used to that command. + number. The alias `where' for `backtrace' is provided for longtime + GDB users who may be used to that command. `down' [COUNT] Move COUNT (default 1) frames down the stack toward the innermost @@ -21339,7 +21346,7 @@ are:  File: gawk.info, Node: Debugger Info, Next: Miscellaneous Debugger Commands, Prev: Execution Stack, Up: List of Debugger Commands -14.3.5 Obtaining Information about the Program and the Debugger State +14.3.5 Obtaining Information About the Program and the Debugger State --------------------------------------------------------------------- Besides looking at the values of variables, there is often a need to get @@ -21465,39 +21472,39 @@ categories, as follows: gawk> dump -| # BEGIN -| - -| [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] - -| [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR] - -| [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR] - -| [ 1:0xfcc280] Op_match : - -| [ 1:0xfcc1e0] Op_store_var : O - -| [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR] - -| [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR] - -| [ 1:0xfcc320] Op_equal : - -| [ 1:0xfcc200] Op_store_var : o - -| [ 1:0xfcc380] Op_push : o - -| [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER] - -| [ 1:0xfcc220] Op_push_lhs : o [do_reference = true] - -| [ 1:0xfcc300] Op_assign_plus : - -| [ :0xfcc2c0] Op_pop : - -| [ 1:0xfcc400] Op_push : O - -| [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR] - -| [ :0xfcc4a0] Op_no_op : - -| [ 1:0xfcc480] Op_push : O - -| [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0] - -| [ 1:0xfcc3c0] Op_store_var : x - -| [ 1:0xfcc440] Op_push_lhs : X [do_reference = true] - -| [ 1:0xfcc3a0] Op_postincrement : - -| [ 1:0xfcc4e0] Op_push : x - -| [ 1:0xfcc540] Op_push : o - -| [ 1:0xfcc500] Op_plus : - -| [ 1:0xfcc580] Op_push : o - -| [ 1:0xfcc560] Op_plus : - -| [ 1:0xfcc460] Op_leq : - -| [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0] - -| [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR] - -| [ :0xfcc660] Op_no_op : - -| [ 1:0xfcc520] Op_assign_concat : c - -| [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440] + -| [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] + -| [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR] + -| [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR] + -| [ 1:0xfcc280] Op_match : + -| [ 1:0xfcc1e0] Op_store_var : O + -| [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR] + -| [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR] + -| [ 1:0xfcc320] Op_equal : + -| [ 1:0xfcc200] Op_store_var : o + -| [ 1:0xfcc380] Op_push : o + -| [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER] + -| [ 1:0xfcc220] Op_push_lhs : o [do_reference = true] + -| [ 1:0xfcc300] Op_assign_plus : + -| [ :0xfcc2c0] Op_pop : + -| [ 1:0xfcc400] Op_push : O + -| [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR] + -| [ :0xfcc4a0] Op_no_op : + -| [ 1:0xfcc480] Op_push : O + -| [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0] + -| [ 1:0xfcc3c0] Op_store_var : x + -| [ 1:0xfcc440] Op_push_lhs : X [do_reference = true] + -| [ 1:0xfcc3a0] Op_postincrement : + -| [ 1:0xfcc4e0] Op_push : x + -| [ 1:0xfcc540] Op_push : o + -| [ 1:0xfcc500] Op_plus : + -| [ 1:0xfcc580] Op_push : o + -| [ 1:0xfcc560] Op_plus : + -| [ 1:0xfcc460] Op_leq : + -| [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0] + -| [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR] + -| [ :0xfcc660] Op_no_op : + -| [ 1:0xfcc520] Op_assign_concat : c + -| [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440] -| ... -| @@ -21548,10 +21555,10 @@ categories, as follows: `q' Exit the debugger. Debugging is great fun, but sometimes we all have to tend to other obligations in life, and sometimes we find - the bug, and are free to go on to the next one! As we saw above, - if you are running a program, the debugger warns you if you - accidentally type `q' or `quit', to make sure you really want to - quit. + the bug, and are free to go on to the next one! As we saw + earlier, if you are running a program, the debugger warns you if + you accidentally type `q' or `quit', to make sure you really want + to quit. `trace' [`on' | `off'] Turn on or off a continuous printing of instructions which are @@ -21610,7 +21617,8 @@ some limitations. A few which are worth being aware of are: Commands:: (or if you are already familiar with `gawk' internals), you will realize that much of the internal manipulation of data in `gawk', as in many interpreters, is done on a stack. `Op_push', - `Op_pop', etc., are the "bread and butter" of most `gawk' code. + `Op_pop', and the like, are the "bread and butter" of most `gawk' + code. Unfortunately, as of now, the `gawk' debugger does not allow you to examine the stack's contents. That is, the intermediate @@ -21622,7 +21630,7 @@ some limitations. A few which are worth being aware of are: * There is no way to look "inside" the process of compiling regular expressions to see if you got it right. As an `awk' programmer, - you are expected to know what `/[^[:alnum:][:blank:]]/' means. + you are expected to know the meaning of `/[^[:alnum:][:blank:]]/'. * The `gawk' debugger is designed to be used by running a program (with all its parameters) on the command line, as described in @@ -21666,17 +21674,17 @@ File: gawk.info, Node: Debugging Summary, Prev: Limitations, Up: Debugger  File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Dynamic Extensions, Prev: Debugger, Up: Top -15 Arithmetic and Arbitrary Precision Arithmetic with `gawk' +15 Arithmetic and Arbitrary-Precision Arithmetic with `gawk' ************************************************************ This major node introduces some basic concepts relating to how computers do arithmetic and defines some important terms. It then proceeds to describe floating-point arithmetic, which is what `awk' -uses for all its computations, including a discussion of arbitrary -precision floating point arithmetic, which is a feature available only -in `gawk'. It continues on to present arbitrary precision integers, and -concludes with a description of some points where `gawk' and the POSIX -standard are not quite in agreement. +uses for all its computations, including a discussion of +arbitrary-precision floating-point arithmetic, which is a feature +available only in `gawk'. It continues on to present +arbitrary-precision integers, and concludes with a description of some +points where `gawk' and the POSIX standard are not quite in agreement. NOTE: Most users of `gawk' can safely skip this chapter. But if you want to do scientific calculations with `gawk', this is the @@ -21736,37 +21744,37 @@ Integer arithmetic In computers, integer values come in two flavors: "signed" and "unsigned". Signed values may be negative or positive, whereas - unsigned values are always positive (that is, greater than or equal + unsigned values are always positive (i.e., greater than or equal to zero). In computer systems, integer arithmetic is exact, but the possible range of values is limited. Integer arithmetic is generally - faster than floating point arithmetic. + faster than floating-point arithmetic. -Floating point arithmetic +Floating-point arithmetic Floating-point numbers represent what were called in school "real" - numbers; i.e., those that have a fractional part, such as - 3.1415927. The advantage to floating-point numbers is that they + numbers (i.e., those that have a fractional part, such as + 3.1415927). The advantage to floating-point numbers is that they can represent a much larger range of values than can integers. The disadvantage is that there are numbers that they cannot represent exactly. - Modern systems support floating point arithmetic in hardware, with + Modern systems support floating-point arithmetic in hardware, with a limited range of values. There are software libraries that allow - the use of arbitrary precision floating point calculations. + the use of arbitrary-precision floating-point calculations. - POSIX `awk' uses "double precision" floating-point numbers, which - can hold more digits than "single precision" floating-point - numbers. `gawk' has facilities for performing arbitrary precision - floating point arithmetic, which we describe in more detail + POSIX `awk' uses "double-precision" floating-point numbers, which + can hold more digits than "single-precision" floating-point + numbers. `gawk' has facilities for performing arbitrary-precision + floating-point arithmetic, which we describe in more detail shortly. - Computers work with integer and floating point values of different -ranges. Integer values are usually either 32 or 64 bits in size. Single -precision floating point values occupy 32 bits, whereas double precision -floating point values occupy 64 bits. Floating point values are always -signed. The possible ranges of values are shown in *note -table-numeric-ranges::. + Computers work with integer and floating-point values of different +ranges. Integer values are usually either 32 or 64 bits in size. +Single-precision floating-point values occupy 32 bits, whereas +double-precision floating-point values occupy 64 bits. Floating-point +values are always signed. The possible ranges of values are shown in +*note table-numeric-ranges::. Numeric representation Minimum value Maximum value --------------------------------------------------------------------------- @@ -21774,14 +21782,14 @@ Numeric representation Minimum value Maximum value 32-bit unsigned integer 0 4,294,967,295 64-bit signed integer -9,223,372,036,854,775,8089,223,372,036,854,775,807 64-bit unsigned integer 0 18,446,744,073,709,551,615 -Single precision `1.175494e-38' `3.402823e+38' +Single-precision `1.175494e-38' `3.402823e+38' floating point (approximate) -Double precision `2.225074e-308' `1.797693e+308' +Double-precision `2.225074e-308' `1.797693e+308' floating point (approximate) -Table 15.1: Value Ranges for Different Numeric Representations +Table 15.1: Value ranges for different numeric representations ---------- Footnotes ---------- @@ -21790,7 +21798,7 @@ Table 15.1: Value Ranges for Different Numeric Representations  File: gawk.info, Node: Math Definitions, Next: MPFR features, Prev: Computer Arithmetic, Up: Arbitrary Precision Arithmetic -15.2 Other Stuff To Know +15.2 Other Stuff to Know ======================== The rest of this major node uses a number of terms. Here are some @@ -21849,7 +21857,7 @@ material here. are provided later. "Significand" - A floating point value consists the significand multiplied by 10 + A floating-point value consists the significand multiplied by 10 to the power of the exponent. For example, in `1.2345e67', the significand is `1.2345'. @@ -21865,10 +21873,10 @@ information on some of those terms. On modern systems, floating-point hardware uses the representation and operations defined by the IEEE 754 standard. Three of the standard -IEEE 754 types are 32-bit single precision, 64-bit double precision and -128-bit quadruple precision. The standard also specifies extended +IEEE 754 types are 32-bit single precision, 64-bit double precision, +and 128-bit quadruple precision. The standard also specifies extended precision formats to allow greater precisions and larger exponent -ranges. (`awk' uses only the 64-bit double precision format.) +ranges. (`awk' uses only the 64-bit double-precision format.) *note table-ieee-formats:: lists the precision and exponent field values for the basic IEEE 754 binary formats: @@ -21880,7 +21888,7 @@ Single 32 24 -126 +127 Double 64 53 -1022 +1023 Quadruple 128 113 -16382 +16383 -Table 15.2: Basic IEEE Format Values +Table 15.2: Basic IEEE format values NOTE: The precision numbers include the implied leading one that gives them one extra bit of significand. @@ -21893,13 +21901,13 @@ paraphrased, and for the examples.  File: gawk.info, Node: MPFR features, Next: FP Math Caution, Prev: Math Definitions, Up: Arbitrary Precision Arithmetic -15.3 Arbitrary Precision Arithmetic Features In `gawk' +15.3 Arbitrary-Precision Arithmetic Features in `gawk' ====================================================== -By default, `gawk' uses the double precision floating-point values +By default, `gawk' uses the double-precision floating-point values supplied by the hardware of the system it runs on. However, if it was -compiled to do so, `gawk' uses the `http://www.mpfr.org GNU MPFR' and -GNU MP (http://gmplib.org) (GMP) libraries for arbitrary precision +compiled to do so, `gawk' uses the GNU MPFR (http://www.mpfr.org) and +GNU MP (http://gmplib.org) (GMP) libraries for arbitrary-precision arithmetic on numbers. You can see if MPFR support is available like so: @@ -21931,7 +21939,7 @@ more information.  File: gawk.info, Node: FP Math Caution, Next: Arbitrary Precision Integers, Prev: MPFR features, Up: Arbitrary Precision Arithmetic -15.4 Floating Point Arithmetic: Caveat Emptor! +15.4 Floating-Point Arithmetic: Caveat Emptor! ============================================== Math class is tough! -- Teen Talk Barbie, July 1992 @@ -21965,7 +21973,7 @@ in computer science.  File: gawk.info, Node: Inexactness of computations, Next: Getting Accuracy, Up: FP Math Caution -15.4.1 Floating Point Arithmetic Is Not Exact +15.4.1 Floating-Point Arithmetic Is Not Exact --------------------------------------------- Binary floating-point representations and arithmetic are inexact. @@ -21973,9 +21981,10 @@ Simple values like 0.1 cannot be precisely represented using binary floating-point numbers, and the limited precision of floating-point numbers means that slight changes in the order of operations or the precision of intermediate storage can change the result. To make -matters worse, with arbitrary precision floating-point, you can set the -precision before starting a computation, but then you cannot be sure of -the number of significant decimal places in the final result. +matters worse, with arbitrary-precision floating-point arithmetic, you +can set the precision before starting a computation, but then you +cannot be sure of the number of significant decimal places in the final +result. * Menu: @@ -21997,8 +22006,8 @@ the following example: y = 0.425 Unlike the number in `y', the number stored in `x' is exactly -representable in binary since it can be written as a finite sum of one -or more fractions whose denominators are all powers of two. When +representable in binary because it can be written as a finite sum of +one or more fractions whose denominators are all powers of two. When `gawk' reads a floating-point number from program source, it automatically rounds that number to whatever precision your machine supports. If you try to print the numeric content of a variable using @@ -22031,7 +22040,7 @@ work like you would expect: The general wisdom when comparing floating-point values is to see if they are within some small range of each other (called a "delta", or "tolerance"). You have to decide how small a delta is important to -you. Code to do this looks something like this: +you. Code to do this looks something like the following: delta = 0.00001 # for example difference = abs(a) - abs(b) # subtract the two values @@ -22051,7 +22060,7 @@ File: gawk.info, Node: Errors accumulate, Prev: Comparing FP Values, Up: Inex The loss of accuracy during a single computation with floating-point numbers usually isn't enough to worry about. However, if you compute a -value which is the result of a sequence of floating point operations, +value which is the result of a sequence of floating-point operations, the error can accumulate and greatly affect the computation itself. Here is an attempt to compute the value of pi using one of its many series representations: @@ -22094,10 +22103,10 @@ representations yield an unexpected result:  File: gawk.info, Node: Getting Accuracy, Next: Try To Round, Prev: Inexactness of computations, Up: FP Math Caution -15.4.2 Getting The Accuracy You Need +15.4.2 Getting the Accuracy You Need ------------------------------------ -Can arbitrary precision arithmetic give exact results? There are no +Can arbitrary-precision arithmetic give exact results? There are no easy answers. The standard rules of algebra often do not apply when using floating-point arithmetic. Among other things, the distributive and associative laws do not hold completely, and order of operation may @@ -22105,7 +22114,7 @@ be important for your computation. Rounding error, cumulative precision loss and underflow are often troublesome. When `gawk' tests the expressions `0.1 + 12.2' and `12.3' for -equality using the machine double precision arithmetic, it decides that +equality using the machine double-precision arithmetic, it decides that they are not equal! (*Note Comparing FP Values::.) You can get the result you want by increasing the precision; 56 bits in this case does the job: @@ -22124,15 +22133,15 @@ value of `PREC': forget that the finite number of bits used to store the value is often just an approximation after proper rounding. The test for equality succeeds if and only if _all_ bits in the two operands are exactly the -same. Since this is not necessarily true after floating-point +same. Because this is not necessarily true after floating-point computations with a particular precision and effective rounding mode, a straight test for equality may not work. Instead, compare the two numbers to see if they are within the desirable delta of each other. In applications where 15 or fewer decimal places suffice, hardware -double precision arithmetic can be adequate, and is usually much faster. +double-precision arithmetic can be adequate, and is usually much faster. But you need to keep in mind that every floating-point operation can -suffer a new rounding error with catastrophic consequences as +suffer a new rounding error with catastrophic consequences, as illustrated by our earlier attempt to compute the value of pi. Extra precision can greatly enhance the stability and the accuracy of your computation in such cases. @@ -22154,10 +22163,10 @@ hand is often the correct approach in such situations.  File: gawk.info, Node: Try To Round, Next: Setting precision, Prev: Getting Accuracy, Up: FP Math Caution -15.4.3 Try A Few Extra Bits of Precision and Rounding +15.4.3 Try a Few Extra Bits of Precision and Rounding ----------------------------------------------------- -Instead of arbitrary precision floating-point arithmetic, often all you +Instead of arbitrary-precision floating-point arithmetic, often all you need is an adjustment of your logic or a different order for the operations in your calculation. The stability and the accuracy of the computation of pi in the earlier example can be enhanced by using the @@ -22165,7 +22174,7 @@ following simple algebraic transformation: (sqrt(x * x + 1) - 1) / x == x / (sqrt(x * x + 1) + 1) -After making this, change the program converges to pi in under 30 +After making this change, the program converges to pi in under 30 iterations: $ gawk -f pi2.awk @@ -22181,7 +22190,7 @@ iterations:  File: gawk.info, Node: Setting precision, Next: Setting the rounding mode, Prev: Try To Round, Up: FP Math Caution -15.4.4 Setting The Precision +15.4.4 Setting the Precision ---------------------------- `gawk' uses a global working precision; it does not keep track of the @@ -22195,13 +22204,13 @@ binary format. `PREC' IEEE 754 Binary Format --------------------------------------------------- -`"half"' 16-bit half-precision. -`"single"' Basic 32-bit single precision. -`"double"' Basic 64-bit double precision. -`"quad"' Basic 128-bit quadruple precision. -`"oct"' 256-bit octuple precision. +`"half"' 16-bit half-precision +`"single"' Basic 32-bit single precision +`"double"' Basic 64-bit double precision +`"quad"' Basic 128-bit quadruple precision +`"oct"' 256-bit octuple precision -Table 15.3: Predefined Precision Strings For `PREC' +Table 15.3: Predefined precision strings for `PREC' The following example illustrates the effects of changing precision on arithmetic operations: @@ -22238,7 +22247,7 @@ on arithmetic operations:  File: gawk.info, Node: Setting the rounding mode, Prev: Setting precision, Up: FP Math Caution -15.4.5 Setting The Rounding Mode +15.4.5 Setting the Rounding Mode -------------------------------- The `ROUNDMODE' variable provides program level control over the @@ -22254,13 +22263,13 @@ Round toward zero `roundTowardZero' `"Z"' or `"z"' Round to nearest, ties away `roundTiesToAway' `"A"' or `"a"' from zero -Table 15.4: `gawk' Rounding Modes +Table 15.4: `gawk' rounding modes `ROUNDMODE' has the default value `"N"', which selects the IEEE 754 rounding mode `roundTiesToEven'. In *note Table 15.4: table-gawk-rounding-modes, the value `"A"' selects `roundTiesToAway'. This is only available if your version of the MPFR library supports it; -otherwise setting `ROUNDMODE' to `"A"' has no effect. +otherwise, setting `ROUNDMODE' to `"A"' has no effect. The default mode `roundTiesToEven' is the most preferred, but the least intuitive. This method does the obvious thing for most values, by @@ -22328,16 +22337,16 @@ to round halfway cases for `printf'.  File: gawk.info, Node: Arbitrary Precision Integers, Next: POSIX Floating Point Problems, Prev: FP Math Caution, Up: Arbitrary Precision Arithmetic -15.5 Arbitrary Precision Integer Arithmetic with `gawk' +15.5 Arbitrary-Precision Integer Arithmetic with `gawk' ======================================================= When given the `-M' option, `gawk' performs all integer arithmetic -using GMP arbitrary precision integers. Any number that looks like an -integer in a source or data file is stored as an arbitrary precision +using GMP arbitrary-precision integers. Any number that looks like an +integer in a source or data file is stored as an arbitrary-precision integer. The size of the integer is limited only by the available memory. For example, the following computes 5^4^3^2, the result of -which is beyond the limits of ordinary hardware double precision -floating point values: +which is beyond the limits of ordinary hardware double-precision +floating-point values: $ gawk -M 'BEGIN { > x = 5^4^3^2 @@ -22347,10 +22356,10 @@ floating point values: -| number of digits = 183231 -| 62060698786608744707 ... 92256259918212890625 - If instead you were to compute the same value using arbitrary -precision floating-point values, the precision needed for correct -output (using the formula `prec = 3.322 * dps'), would be 3.322 x -183231, or 608693. + If instead you were to compute the same value using +arbitrary-precision floating-point values, the precision needed for +correct output (using the formula `prec = 3.322 * dps'), would be 3.322 +x 183231, or 608693. The result from an arithmetic operation with an integer and a floating-point value is a floating-point value with a precision equal @@ -22373,10 +22382,10 @@ case), or replace the floating-point constant `2.0' with an integer, to perform all computations using integer arithmetic to get the correct output. - Sometimes `gawk' must implicitly convert an arbitrary precision -integer into an arbitrary precision floating-point value. This is + Sometimes `gawk' must implicitly convert an arbitrary-precision +integer into an arbitrary-precision floating-point value. This is primarily because the MPFR library does not always provide the relevant -interface to process arbitrary precision integers or mixed-mode numbers +interface to process arbitrary-precision integers or mixed-mode numbers as needed by an operation or function. In such a case, the precision is set to the minimum value necessary for exact conversion, and the working precision is not used for this purpose. If this is not what you need or @@ -22390,8 +22399,8 @@ floating-point value to begin with: gawk -M 'BEGIN { n = 13.0; print n % 2.0 }' - Note that for the particular example above, it is likely best to -just use the following: + Note that for this particular example, it is likely best to just use +the following: gawk -M 'BEGIN { n = 13; print n % 2 }' @@ -22417,12 +22426,12 @@ that `awk' only understands decimal numbers (base 10), and not octal interpreted to imply that `awk' should support additional features. These features are: - * Interpretation of floating point data values specified in + * Interpretation of floating-point data values specified in hexadecimal notation (e.g., `0xDEADBEEF'). (Note: data values, _not_ source code constants.) - * Support for the special IEEE 754 floating point values "Not A - Number" (NaN), positive Infinity ("inf") and negative Infinity + * Support for the special IEEE 754 floating-point values "Not A + Number" (NaN), positive Infinity ("inf"), and negative Infinity ("-inf"). In particular, the format for these values is as specified by the ISO 1999 C standard, which ignores case and can allow implementation-dependent additional characters after the @@ -22431,9 +22440,9 @@ These features are: The first problem is that both of these are clear changes to historical practice: - * The `gawk' maintainer feels that supporting hexadecimal floating - point values, in particular, is ugly, and was never intended by the - original designers to be part of the language. + * The `gawk' maintainer feels that supporting hexadecimal + floating-point values, in particular, is ugly, and was never + intended by the original designers to be part of the language. * Allowing completely alphabetic strings to have valid numeric values is also a very severe departure from historical practice. @@ -22444,10 +22453,10 @@ interpretation of the standard, which requires a certain amount of intended by the standard developers. In other words, "we see how you got where you are, but we don't think that that's where you want to be." - Recognizing the above issues, but attempting to provide compatibility + Recognizing these issues, but attempting to provide compatibility with the earlier versions of the standard, the 2008 POSIX standard added explicit wording to allow, but not require, that `awk' support -hexadecimal floating point values and special values for "Not A Number" +hexadecimal floating-point values and special values for "Not A Number" and infinity. Although the `gawk' maintainer continues to feel that providing @@ -22496,11 +22505,11 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob ============ * Most computer arithmetic is done using either integers or - floating-point values. Standard `awk' uses double precision + floating-point values. Standard `awk' uses double-precision floating-point values. - * In the early 1990's, Barbie mistakenly said "Math class is tough!" - While math isn't tough, floating-point arithmetic isn't the same + * In the early 1990s, Barbie mistakenly said "Math class is tough!" + Although math isn't tough, floating-point arithmetic isn't the same as pencil and paper math, and care must be taken: - Not all numbers can be represented exactly. @@ -22521,7 +22530,7 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob set the precision in bits, and `ROUNDMODE' to set the IEEE 754 rounding mode. - * With `-M', `gawk' performs arbitrary precision integer arithmetic + * With `-M', `gawk' performs arbitrary-precision integer arithmetic using the GMP library. This is faster and more space efficient than using MPFR for the same calculations. @@ -22533,7 +22542,7 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob results from floating-point arithmetic. The lesson to remember is that floating-point arithmetic is always more complex than arithmetic using pencil and paper. In order to take advantage of - the power of computer floating-point, you need to know its + the power of computer floating point, you need to know its limitations and work within them. For most casual use of floating-point arithmetic, you will often get the expected result if you simply round the display of your final results to the @@ -22595,8 +22604,8 @@ routines that could be of use. As with most software, "the sky is the limit;" if you can imagine something that you might want to do and can write in C or C++, you can write an extension to do it! - Extensions are written in C or C++, using the "Application -Programming Interface" (API) defined for this purpose by the `gawk' + Extensions are written in C or C++, using the "application +programming interface" (API) defined for this purpose by the `gawk' developers. The rest of this major node explains the facilities that the API provides and how to use them, and presents a small example extension. In addition, it documents the sample extensions included in @@ -22627,7 +22636,7 @@ the symbol exists in the global scope. Something like this is enough:  File: gawk.info, Node: Extension Mechanism Outline, Next: Extension API Description, Prev: Plugin License, Up: Dynamic Extensions -16.3 At A High Level How It Works +16.3 How It Works at a High Level ================================= Communication between `gawk' and an extension is two-way. First, when @@ -22659,7 +22668,7 @@ figure-load-extension::. +-------+-+---+-+---+-+------------------+--------------------+ gawk Main Program Address Space Extension -Figure 16.1: Loading The Extension +Figure 16.1: Loading the extension The extension can call functions inside `gawk' through these function pointers, at runtime, without needing (link-time) access to @@ -22679,7 +22688,7 @@ figure-register-new-function::. +-------+-+---+-+---+-+------------------+--------------+-+---+ gawk Main Program Address Space Extension -Figure 16.2: Registering A New Function +Figure 16.2: Registering a new function In the other direction, the extension registers its new functions with `gawk' by passing function pointers to the functions that provide @@ -22700,7 +22709,7 @@ calling convention. This is shown in *note figure-call-new-function::. +-------+-+---+-+---+-+------------------+--------------+-+---+ gawk Main Program Address Space Extension -Figure 16.3: Calling The New Function +Figure 16.3: Calling the new function The `do_XXX()' function, in turn, then uses the function pointers in the API `struct' to do its work, such as updating variables or arrays, @@ -22773,17 +22782,19 @@ operations: * Allocating, reallocating, and releasing memory. * Registration functions. You may register: - - extension functions, - - exit callbacks, + - Extension functions - - a version string, + - Exit callbacks - - input parsers, + - A version string - - output wrappers, + - Input parsers + + - Output wrappers + + - Two-way processors - - and two-way processors. All of these are discussed in detail, later in this major node. * Printing fatal, warning, and "lint" warning messages. @@ -22815,8 +22826,8 @@ operations: Some points about using the API: - * The following types and/or macros and/or functions are referenced - in `gawkapi.h'. For correct use, you must therefore include the + * The following types, macros, and/or functions are referenced in + `gawkapi.h'. For correct use, you must therefore include the corresponding standard header file _before_ including `gawkapi.h': C Entity Header File @@ -22855,7 +22866,7 @@ operations: * The API defines several simple `struct's that map values as seen from `awk'. A value can be a `double', a string, or an array (as in multidimensional arrays, or when creating a new array). String - values maintain both pointer and length since embedded NUL + values maintain both pointer and length, because embedded NUL characters are allowed. NOTE: By intent, strings are maintained using the current @@ -22876,16 +22887,16 @@ operations: message (such as "scalar passed where array expected"). - While you may call the API functions by using the function pointers -directly, the interface is not so pretty. To make extension code look -more like regular code, the `gawkapi.h' header file defines several + You may call the API functions by using the function pointers +directly, but the interface is not so pretty. To make extension code +look more like regular code, the `gawkapi.h' header file defines several macros that you should use in your code. This minor node presents the macros as if they were functions.  File: gawk.info, Node: General Data Types, Next: Memory Allocation Functions, Prev: Extension API Functions Introduction, Up: Extension API Description -16.4.2 General Purpose Data Types +16.4.2 General-Purpose Data Types --------------------------------- I have a true love/hate relationship with unions. -- Arnold @@ -22894,10 +22905,10 @@ File: gawk.info, Node: General Data Types, Next: Memory Allocation Functions, That's the thing about unions: the compiler will arrange things so they can accommodate both love and hate. -- Chet Ramey - The extension API defines a number of simple types and structures -for general purpose use. Additional, more specialized, data structures -are introduced in subsequent minor nodes, together with the functions -that use them. + The extension API defines a number of simple types and structures for +general-purpose use. Additional, more specialized, data structures are +introduced in subsequent minor nodes, together with the functions that +use them. `typedef void *awk_ext_id_t;' A value of this type is received from `gawk' when an extension is @@ -22922,8 +22933,8 @@ that use them. `} awk_string_t;' This represents a mutable string. `gawk' owns the memory pointed to if it supplied the value. Otherwise, it takes ownership of the - memory pointed to. *Such memory must come from calling one of the - `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()' functions!* + memory pointed to. _Such memory must come from calling one of the + `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()' functions!_ As mentioned earlier, strings are maintained using the current multibyte encoding. @@ -22964,13 +22975,13 @@ that use them. `typedef void *awk_scalar_t;' Scalars can be represented as an opaque type. These values are obtained from `gawk' and then passed back into it. This is - discussed in a general fashion below, and in more detail in *note - Symbol table by cookie::. + discussed in a general fashion in the text following this list, + and in more detail in *note Symbol table by cookie::. `typedef void *awk_value_cookie_t;' A "value cookie" is an opaque type representing a cached value. - This is also discussed in a general fashion below, and in more - detail in *note Cached values::. + This is also discussed in a general fashion in the text following + this list, and in more detail in *note Cached values::. Scalar values in `awk' are either numbers or strings. The @@ -22978,7 +22989,7 @@ that use them. indicates what is in the `union'. Representing numbers is easy--the API uses a C `double'. Strings -require more work. Since `gawk' allows embedded NUL bytes in string +require more work. Because `gawk' allows embedded NUL bytes in string values, a string must be represented as a pair containing a data-pointer and length. This is the `awk_string_t' type. @@ -22990,15 +23001,14 @@ Manipulation::. The various macros listed earlier make it easier to use the elements of the `union' as if they were fields in a `struct'; this is a common -coding practice in C. Such code is easier to write and to read, -however it remains _your_ responsibility to make sure that the -`val_type' member correctly reflects the type of the value in the -`awk_value_t'. +coding practice in C. Such code is easier to write and to read, but it +remains _your_ responsibility to make sure that the `val_type' member +correctly reflects the type of the value in the `awk_value_t'. Conceptually, the first three members of the `union' (number, string, and array) are all that is needed for working with `awk' values. -However, since the API provides routines for accessing and changing the -value of global scalar variables only by using the variable's name, +However, because the API provides routines for accessing and changing +the value of global scalar variables only by using the variable's name, there is a performance penalty: `gawk' must find the variable each time it is accessed and changed. This turns out to be a real issue, not just a theoretical one. @@ -23036,7 +23046,7 @@ File: gawk.info, Node: Memory Allocation Functions, Next: Constructor Function The API provides a number of "memory allocation" functions for allocating memory that can be passed to `gawk', as well as a number of convenience macros. This node presents them all as function -prototypes, in the way that extension code would use them. +prototypes, in the way that extension code would use them: `void *gawk_malloc(size_t size);' Call the correct version of `malloc()' to allocate storage that may @@ -23073,8 +23083,8 @@ as if they were procedure calls that do not return a value. The pointer variable to point at the allocated storage. `type' - The type of the pointer variable, used to create a cast for - the call to `gawk_malloc()'. + The type of the pointer variable. This is used to create a + cast for the call to `gawk_malloc()'. `size' The total number of bytes to be allocated. @@ -23112,7 +23122,7 @@ File: gawk.info, Node: Constructor Functions, Next: Registration Functions, P The API provides a number of "constructor" functions for creating string and numeric values, as well as a number of convenience macros. This node presents them all as function prototypes, in the way that -extension code would use them. +extension code would use them: `static inline awk_value_t *' `make_const_string(const char *string, size_t length, awk_value_t *result)' @@ -23189,7 +23199,7 @@ Extension functions are described by the following record: functionality. The function must fill in `*result' with either a number or a string. `gawk' takes ownership of any string memory. As mentioned earlier, string memory *must* come from one of - `gawk_malloc()', `gawk_calloc()' or `gawk_realloc()'. + `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()'. The `num_actual_args' argument tells the C function how many actual parameters were passed from the calling `awk' code. @@ -23222,7 +23232,7 @@ An "exit callback" function is a function that `gawk' calls before it exits. Such functions are useful if you have general "cleanup" tasks that should be performed in your extension (such as closing database connections or other resource deallocations). You can register such a -function with `gawk' using the following function. +function with `gawk' using the following function: `void awk_atexit(void (*funcp)(void *data, int exit_status),' ` void *arg0);' @@ -23238,7 +23248,7 @@ function with `gawk' using the following function. A pointer to private data which `gawk' saves in order to pass to the function pointed to by `funcp'. - Exit callback functions are called in Last-In-First-Out (LIFO) + Exit callback functions are called in last-in-first-out (LIFO) order--that is, in the reverse order in which they are registered with `gawk'. @@ -23252,8 +23262,9 @@ You can register a version string which indicates the name and version of your extension, with `gawk', as follows: `void register_ext_version(const char *version);' - Register the string pointed to by `version' with `gawk'. `gawk' - does _not_ copy the `version' string, so it should not be changed. + Register the string pointed to by `version' with `gawk'. Note + that `gawk' does _not_ copy the `version' string, so it should not + be changed. `gawk' prints all registered extension version strings when it is invoked with the `--version' option. @@ -23326,7 +23337,7 @@ used for `RT', if any. 2. When your extension is loaded, register your input parser with `gawk' using the `register_input_parser()' API function (described - below). + next). An `awk_input_buf_t' looks like this: @@ -23364,14 +23375,14 @@ decide if the input parser should be used for the file. The decision can be made based upon `gawk' state (the value of a variable defined previously by the extension and set by `awk' code), the name of the file, whether or not the file descriptor is valid, the information in -the `struct stat', or any combination of the above. +the `struct stat', or any combination of these factors. Once `XXX_can_take_file()' has returned true, and `gawk' has decided to use your input parser, it calls `XXX_take_control_of()'. That function then fills one of either the `get_record' field or the `read_func' field in the `awk_input_buf_t'. It must also ensure that -`fd' is _not_ set to `INVALID_HANDLE'. All of the fields that may be -filled by `XXX_take_control_of()' are as follows: +`fd' is _not_ set to `INVALID_HANDLE'. The following list describes +the fields that may be filled by `XXX_take_control_of()': `void *opaque;' This is used to hold any state information needed by the input @@ -23385,13 +23396,13 @@ filled by `XXX_take_control_of()' are as follows: ` size_t *rt_len);' This function pointer should point to a function that creates the input records. Said function is the core of the input parser. - Its behavior is described below. + Its behavior is described in the text following this list. `ssize_t (*read_func)();' This function pointer should point to function that has the same behavior as the standard POSIX `read()' system call. It is an alternative to the `get_record' pointer. Its behavior is also - described below. + described in the text following this list. `void (*close_func)(struct awk_input *iobuf);' This function pointer should point to a function that does the @@ -23516,8 +23527,8 @@ an extension to take over the output to a file opened with the `>' or The function pointed to by this field is called when `gawk' decides to let the output wrapper take control of the file. It should fill in appropriate members of the `awk_output_buf_t' - structure, as described below, and return true if successful, - false otherwise. + structure, as described next, and return true if successful, false + otherwise. `awk_const struct output_wrapper *awk_const next;' This is for use by `gawk'; therefore it is marked `awk_const' so @@ -23648,8 +23659,8 @@ File: gawk.info, Node: Printing Messages, Next: Updating `ERRNO', Prev: Regis ------------------------ You can print different kinds of warning messages from your extension, -as described below. Note that for these functions, you must pass in -the extension id received from `gawk' when the extension was loaded.(1) +as described here. Note that for these functions, you must pass in the +extension id received from `gawk' when the extension was loaded:(1) `void fatal(awk_ext_id_t id, const char *format, ...);' Print a message and then cause `gawk' to exit immediately. @@ -23709,7 +23720,7 @@ message, or reissue the request for the actual value type, as appropriate. This behavior is summarized in *note table-value-types-returned::. - Type of Actual Value: + Type of Actual Value -------------------------------------------------------------------------- String Number Array Undefined @@ -23719,12 +23730,12 @@ table-value-types-returned::. be converted, else false Type Array false false Array false -Requested: Scalar Scalar Scalar false false +Requested Scalar Scalar Scalar false false Undefined String Number Array Undefined Value false false false false Cookie -Table 16.1: API Value Types Returned +Table 16.1: API value types returned  File: gawk.info, Node: Accessing Parameters, Next: Symbol Table Access, Prev: Requesting Values, Up: Extension API Description @@ -23805,8 +23816,8 @@ cannot change any of those variables. CAUTION: It is possible for the lookup of `PROCINFO' to fail. This happens if the `awk' program being run does not reference - `PROCINFO'; in this case `gawk' doesn't bother to create the array - and populate it. + `PROCINFO'; in this case, `gawk' doesn't bother to create the + array and populate it.  File: gawk.info, Node: Symbol table by cookie, Next: Cached values, Prev: Symbol table by name, Up: Symbol Table Access @@ -23817,9 +23828,9 @@ File: gawk.info, Node: Symbol table by cookie, Next: Cached values, Prev: Sym A "scalar cookie" is an opaque handle that provides access to a global variable or array. It is an optimization that avoids looking up variables in `gawk''s symbol table every time access is needed. This -was discussed earlier, in *note General Data Types::. +was discussed earlier in *note General Data Types::. - The following functions let you work with scalar cookies. + The following functions let you work with scalar cookies: `awk_bool_t sym_lookup_scalar(awk_scalar_t cookie,' ` awk_valtype_t wanted,' @@ -23860,7 +23871,7 @@ variable based on the result of that evaluation, like so: This code looks (and is) simple and straightforward. So what's the problem? - Consider what happens if `awk'-level code associated with your + Well, consider what happens if `awk'-level code associated with your extension calls the `magic()' function (implemented in C by `do_magic()'), once per record, while processing hundreds of thousands or millions of records. The `MAGIC_VAR' variable is looked up in the @@ -23935,7 +23946,7 @@ variables using `sym_update()' or `sym_update_scalar()', as you like. However, you can understand the point of cached values if you remember that _every_ string value's storage _must_ come from -`gawk_malloc()', `gawk_calloc()' or `gawk_realloc()'. If you have 20 +`gawk_malloc()', `gawk_calloc()', or `gawk_realloc()'. If you have 20 variables, all of which have the same string value, you must create 20 identical copies of the string.(1) @@ -23947,8 +23958,8 @@ follows: `awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result);' Create a cached string or numeric value from `value' for efficient later assignment. Only values of type `AWK_NUMBER' and - `AWK_STRING' are allowed. Any other type is rejected. While - `AWK_UNDEFINED' could be allowed, doing so would result in + `AWK_STRING' are allowed. Any other type is rejected. + `AWK_UNDEFINED' could be allowed, but doing so would result in inferior performance. `awk_bool_t release_value(awk_value_cookie_t vc);' @@ -23995,7 +24006,7 @@ of variables: ... } -Using value cookies in this way saves considerable storage, since all of +Using value cookies in this way saves considerable storage, as all of `VAR1' through `VAR100' share the same value. You might be wondering, "Is this sharing problematic? What happens @@ -24043,7 +24054,7 @@ arrays of arrays (*note General Data Types::). ---------- Footnotes ---------- - (1) Okay, the only data structure. + (1) OK, the only data structure.  File: gawk.info, Node: Array Data Types, Next: Array Functions, Up: Array Manipulation @@ -24051,7 +24062,7 @@ File: gawk.info, Node: Array Data Types, Next: Array Functions, Up: Array Man 16.4.11.1 Array Data Types .......................... -The data types associated with arrays are listed below. +The data types associated with arrays are as follows: `typedef void *awk_array_t;' If you request the value of an array variable, you get back an @@ -24196,7 +24207,7 @@ File: gawk.info, Node: Flattening Arrays, Next: Creating Arrays, Prev: Array 16.4.11.3 Working With All The Elements of an Array ................................................... -To "flatten" an array is create a structure that represents the full +To "flatten" an array is to create a structure that represents the full array in a fashion that makes it easy for C code to traverse the entire array. Test code in `extension/testext.c' does this, and also serves as a nice example showing how to use the APIs. @@ -24342,7 +24353,7 @@ this code) once you have called `release_flattened_array()': goto out; } - Finally, since everything was successful, the function sets the + Finally, because everything was successful, the function sets the return value to success, and returns: make_number(1.0, result); @@ -24377,7 +24388,7 @@ them and manipulate them. There are two important points about creating arrays from extension code: - 1. You must install a new array into `gawk''s symbol table + * You must install a new array into `gawk''s symbol table immediately upon creating it. Once you have done so, you can then populate the array. @@ -24391,7 +24402,7 @@ code: previously existing array using `set_array_element()'. We show example code shortly. - 2. Due to gawk internals, after using `sym_update()' to install an + * Due to gawk internals, after using `sym_update()' to install an array into `gawk', you have to retrieve the array cookie from the value passed in to `sym_update()' before doing anything else with it, like so: @@ -24475,7 +24486,7 @@ Note how `a_cookie' is reset from the `array_cookie' field in the } } - Here is sample script that loads the extension and then dumps the + Here is a sample script that loads the extension and then dumps the array: @load "subarray" @@ -24614,8 +24625,8 @@ File: gawk.info, Node: Extension API Boilerplate, Prev: Extension API Variable As mentioned earlier (*note Extension Mechanism Outline::), the function definitions as presented are really macros. To use these macros, your extension must provide a small amount of boilerplate code (variables and -functions) towards the top of your source file, using pre-defined names -as described below. The boilerplate needed is also provided in comments +functions) toward the top of your source file, using predefined names +as described here. The boilerplate needed is also provided in comments in the `gawkapi.h' header file: /* Boiler plate code: */ @@ -24689,9 +24700,9 @@ in the `gawkapi.h' header file: This macro expands to a `dl_load()' function that performs all the necessary initializations. - The point of the all the variables and arrays is to let the -`dl_load()' function (from the `dl_load_func()' macro) do all the -standard work. It does the following: + The point of all the variables and arrays is to let the `dl_load()' +function (from the `dl_load_func()' macro) do all the standard work. It +does the following: 1. Check the API versions. If the extension major version does not match `gawk''s, or if the extension minor version is greater than @@ -24725,7 +24736,7 @@ File: gawk.info, Node: Extension Example, Next: Extension Samples, Prev: Find 16.6 Example: Some File Functions ================================= - No matter where you go, there you are. -- Buckaroo Bonzai + No matter where you go, there you are. -- Buckaroo Banzai Two useful functions that are not in `awk' are `chdir()' (so that an `awk' program can change its directory) and `stat()' (so that an `awk' @@ -24881,7 +24892,7 @@ Here is the C code for these extensions.(1) includes the `gawkapi.h' header file which provides the API definitions. Those are followed by the necessary variable declarations to make use of the API macros and boilerplate code (*note Extension API -Boilerplate::). +Boilerplate::): #ifdef HAVE_CONFIG_H #include @@ -24918,7 +24929,7 @@ Boilerplate::). implements it is called `do_foo()'. The function should have two arguments: the first is an `int' usually called `nargs', that represents the number of actual arguments for the function. The second -is a pointer to an `awk_value_t', usually named `result'. +is a pointer to an `awk_value_t', usually named `result': /* do_chdir --- provide dynamically loaded chdir() function for gawk */ @@ -24936,11 +24947,11 @@ is a pointer to an `awk_value_t', usually named `result'. "expecting 1")); The `newdir' variable represents the new directory to change to, -retrieved with `get_argument()'. Note that the first argument is -numbered zero. +which is retrieved with `get_argument()'. Note that the first argument +is numbered zero. If the argument is retrieved successfully, the function calls the -`chdir()' system call. If the `chdir()' fails, `ERRNO' is updated. +`chdir()' system call. If the `chdir()' fails, `ERRNO' is updated: if (get_argument(0, AWK_STRING, & newdir)) { ret = chdir(newdir.str_value.str); @@ -25121,7 +25132,7 @@ initialized to point to `lstat()' (instead of `stat()') to get the file information, in case the file is a symbolic link. However, if there were three arguments, `statfunc' is set point to `stat()', instead. - Here is the `do_stat()' function. It starts with variable + Here is the `do_stat()' function, which starts with variable declarations and argument checking: /* do_stat --- provide a stat() function for gawk */ @@ -25227,7 +25238,7 @@ version.  File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Extension Example -16.6.3 Integrating The Extensions +16.6.3 Integrating the Extensions --------------------------------- Now that the code is written, it must be possible to add it at runtime @@ -25239,7 +25250,7 @@ create a GNU/Linux shared library: $ gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -IIDIR filefuncs.c $ gcc -o filefuncs.so -shared filefuncs.o - Once the library exists, it is loaded by using the `@load' keyword. + Once the library exists, it is loaded by using the `@load' keyword: # file testff.awk @load "filefuncs" @@ -25300,21 +25311,21 @@ directory and run the program: ---------- Footnotes ---------- - (1) In practice, you would probably want to use the GNU -Autotools--Automake, Autoconf, Libtool, and `gettext'--to configure and -build your libraries. Instructions for doing so are beyond the scope of -this Info file. *Note gawkextlib::, for Internet links to the tools. + (1) In practice, you would probably want to use the GNU Autotools +(Automake, Autoconf, Libtool, and `gettext') to configure and build +your libraries. Instructions for doing so are beyond the scope of this +Info file. *Note gawkextlib::, for Internet links to the tools.  File: gawk.info, Node: Extension Samples, Next: gawkextlib, Prev: Extension Example, Up: Dynamic Extensions -16.7 The Sample Extensions In The `gawk' Distribution +16.7 The Sample Extensions in the `gawk' Distribution ===================================================== This minor node provides brief overviews of the sample extensions that come in the `gawk' distribution. Some of them are intended for -production use, such the `filefuncs', `readdir' and `inplace' -extensions. Others mainly provide example code that shows how to use +production use (e.g., the `filefuncs', `readdir' and `inplace' +extensions). Others mainly provide example code that shows how to use the extension API. * Menu: @@ -25338,11 +25349,11 @@ the extension API.  File: gawk.info, Node: Extension Sample File Functions, Next: Extension Sample Fnmatch, Up: Extension Samples -16.7.1 File Related Functions +16.7.1 File-Related Functions ----------------------------- The `filefuncs' extension provides three different functions, as -follows: The usage is: +follows. The usage is: `@load "filefuncs"' This is how you load the extension. @@ -25350,13 +25361,13 @@ follows: The usage is: `result = chdir("/some/directory")' The `chdir()' function is a direct hook to the `chdir()' system call to change the current directory. It returns zero upon - success or less than zero upon error. In the latter case it + success or less than zero upon error. In the latter case, it updates `ERRNO'. `result = stat("/some/path", statdata' [`, follow']`)' The `stat()' function provides a hook into the `stat()' system call. It returns zero upon success or less than zero upon error. - In the latter case it updates `ERRNO'. + In the latter case, it updates `ERRNO'. By default, it uses the `lstat()' system call. However, if passed a third argument, it uses `stat()' instead. @@ -25399,9 +25410,9 @@ follows: The usage is: `flags = or(FTS_PHYSICAL, ...)' `result = fts(pathlist, flags, filedata)' Walk the file trees provided in `pathlist' and fill in the - `filedata' array as described below. `flags' is the bitwise OR of - several predefined values, also described below. Return zero if - there were no errors, otherwise return -1. + `filedata' array as described next. `flags' is the bitwise OR of + several predefined values, also described in a moment. Return + zero if there were no errors, otherwise return -1. The `fts()' function provides a hook to the C library `fts()' routines for traversing file hierarchies. Instead of returning data @@ -25445,7 +25456,7 @@ requested hierarchies. By default, the C library `fts()' routines do not return entries for `.' (dot) and `..' (dot-dot). This option causes entries for dot-dot to also be included. (The extension - always includes an entry for dot, see below.) + always includes an entry for dot; more on this in a moment.) `FTS_XDEV' During a traversal, do not cross onto a different mounted @@ -25455,7 +25466,7 @@ requested hierarchies. The `filedata' array is first cleared. Then, `fts()' creates an element in `filedata' for every element in `pathlist'. The index is the name of the directory or file given in `pathlist'. The - element for this index is itself an array. There are two cases. + element for this index is itself an array. There are two cases: _The path is a file_ In this case, the array contains two or three elements: @@ -25478,10 +25489,10 @@ requested hierarchies. _The path is a directory_ In this case, the array contains one element for each entry - in the directory. If an entry is a file, that element is as - for files, just described. If the entry is a directory, that - element is (recursively), an array describing the - subdirectory. If `FTS_SEEDOT' was provided in the flags, + in the directory. If an entry is a file, that element is the + same as for files, just described. If the entry is a + directory, that element is (recursively) an array describing + the subdirectory. If `FTS_SEEDOT' was provided in the flags, then there will also be an element named `".."'. This element will be an array containing the data as provided by `stat()'. @@ -25497,8 +25508,8 @@ Otherwise it returns -1. of the C library `fts()' routines, choosing instead to provide an interface that is based on associative arrays, which is more comfortable to use from an `awk' program. This includes the lack - of a comparison function, since `gawk' already provides powerful - array sorting facilities. While an `fts_read()'-like interface + of a comparison function, because `gawk' already provides powerful + array sorting facilities. Although an `fts_read()'-like interface could have been provided, this felt less natural than simply creating a multidimensional array to represent the file hierarchy and its information. @@ -25509,7 +25520,7 @@ the `fts()' extension function.  File: gawk.info, Node: Extension Sample Fnmatch, Next: Extension Sample Fork, Prev: Extension Sample File Functions, Up: Extension Samples -16.7.2 Interface To `fnmatch()' +16.7.2 Interface to `fnmatch()' ------------------------------- This extension provides an interface to the C library `fnmatch()' @@ -25520,11 +25531,12 @@ function. The usage is: `result = fnmatch(pattern, string, flags)' The return value is zero on success, `FNM_NOMATCH' if the string - did not match the pattern, or a different non-zero value if an + did not match the pattern, or a different nonzero value if an error occurred. - Besides the `fnmatch()' function, the `fnmatch' extension adds one -constant (`FNM_NOMATCH'), and an array of flag values named `FNM'. + In addition to the `fnmatch()' function, the `fnmatch' extension +adds one constant (`FNM_NOMATCH'), and an array of flag values named +`FNM'. The arguments to `fnmatch()' are: @@ -25538,7 +25550,7 @@ constant (`FNM_NOMATCH'), and an array of flag values named `FNM'. Either zero, or the bitwise OR of one or more of the flags in the `FNM' array. - The flags are follows: + The flags are as follows: Array element Corresponding flag defined by `fnmatch()' -------------------------------------------------------------------------- @@ -25560,10 +25572,10 @@ Array element Corresponding flag defined by `fnmatch()'  File: gawk.info, Node: Extension Sample Fork, Next: Extension Sample Inplace, Prev: Extension Sample Fnmatch, Up: Extension Samples -16.7.3 Interface To `fork()', `wait()' and `waitpid()' ------------------------------------------------------- +16.7.3 Interface to `fork()', `wait()', and `waitpid()' +------------------------------------------------------- -The `fork' extension adds three functions, as follows. +The `fork' extension adds three functions, as follows: `@load "fork"' This is how you load the extension. @@ -25646,7 +25658,7 @@ File: gawk.info, Node: Extension Sample Ord, Next: Extension Sample Readdir, -------------------------------------------------------- The `ordchr' extension adds two functions, named `ord()' and `chr()', -as follows. +as follows: `@load "ordchr"' This is how you load the extension. @@ -25699,7 +25711,7 @@ Letter File Type `s' Socket `u' Anything else (unknown) -Table 16.2: File Types Returned By The `readdir' Extension +Table 16.2: File types returned by the `readdir' extension On systems without the file type information, the third field is always `u'. @@ -25724,7 +25736,7 @@ File: gawk.info, Node: Extension Sample Revout, Next: Extension Sample Rev2way ----------------------- The `revoutput' extension adds a simple output wrapper that reverses -the characters in each output line. It's main purpose is to show how to +the characters in each output line. Its main purpose is to show how to write an output wrapper, although it may be mildly amusing for the unwary. Here is an example: @@ -25745,9 +25757,9 @@ File: gawk.info, Node: Extension Sample Rev2way, Next: Extension Sample Read w The `revtwoway' extension adds a simple two-way processor that reverses the characters in each line sent to it for reading back by the `awk' -program. It's main purpose is to show how to write a two-way -processor, although it may also be mildly amusing. The following -example shows how to use it: +program. Its main purpose is to show how to write a two-way processor, +although it may also be mildly amusing. The following example shows +how to use it: @load "revtwoway" @@ -25764,7 +25776,7 @@ example shows how to use it:  File: gawk.info, Node: Extension Sample Read write array, Next: Extension Sample Readfile, Prev: Extension Sample Rev2way, Up: Extension Samples -16.7.9 Dumping and Restoring An Array +16.7.9 Dumping and Restoring an Array ------------------------------------- The `rwarray' extension adds two functions, named `writea()' and @@ -25787,15 +25799,15 @@ The `rwarray' extension adds two functions, named `writea()' and The array created by `reada()' is identical to that written by `writea()' in the sense that the contents are the same. However, due to -implementation issues, the array traversal order of the recreated array -is likely to be different from that of the original array. As array -traversal order in `awk' is by default undefined, this is (technically) -not a problem. If you need to guarantee a particular traversal order, -use the array sorting features in `gawk' to do so (*note Array -Sorting::). +implementation issues, the array traversal order of the re-created +array is likely to be different from that of the original array. As +array traversal order in `awk' is by default undefined, this is +(technically) not a problem. If you need to guarantee a particular +traversal order, use the array sorting features in `gawk' to do so +(*note Array Sorting::). The file contains binary data. All integral values are written in -network byte order. However, double precision floating-point values +network byte order. However, double-precision floating-point values are written as native binary data. Thus, arrays containing only string data can theoretically be dumped on systems with one byte order and restored on systems with a different one, but this has not been tried. @@ -25811,7 +25823,7 @@ restored on systems with a different one, but this has not been tried.  File: gawk.info, Node: Extension Sample Readfile, Next: Extension Sample Time, Prev: Extension Sample Read write array, Up: Extension Samples -16.7.10 Reading An Entire File +16.7.10 Reading an Entire File ------------------------------ The `readfile' extension adds a single function named `readfile()', and @@ -25855,7 +25867,7 @@ The `time' extension adds two functions, named `gettimeofday()' and `the_time = gettimeofday()' Return the time in seconds that has elapsed since 1970-01-01 UTC - as a floating point value. If the time is unavailable on this + as a floating-point value. If the time is unavailable on this platform, return -1 and set `ERRNO'. The returned time should have sub-second precision, but the actual precision may vary based on the platform. If the standard C `gettimeofday()' system call @@ -25897,17 +25909,17 @@ project. As of this writing, there are five extensions: - * GD graphics library extension. + * GD graphics library extension - * PDF extension. + * PDF extension - * PostgreSQL extension. + * PostgreSQL extension - * MPFR library extension. This provides access to a number of MPFR - functions which `gawk''s native MPFR support does not. + * MPFR library extension (this provides access to a number of MPFR + functions which `gawk''s native MPFR support does not) * XML parser extension, using the Expat - (http://expat.sourceforge.net) XML parsing library. + (http://expat.sourceforge.net) XML parsing library You can check out the code for the `gawkextlib' project using the Git (http://git-scm.com) distributed source code control system. The @@ -25947,8 +25959,8 @@ You may also need to use the `sudo' utility to install both `gawk' and `gawkextlib', depending upon how your system works. If you write an extension that you wish to share with other `gawk' -users, please consider doing so through the `gawkextlib' project. See -the project's web site for more information. +users, consider doing so through the `gawkextlib' project. See the +project's website for more information.  File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: gawkextlib, Up: Dynamic Extensions @@ -25957,7 +25969,7 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga ============ * You can write extensions (sometimes called plug-ins) for `gawk' in - C or C++ using the Application Programming Interface (API) defined + C or C++ using the application programming interface (API) defined by the `gawk' developers. * Extensions must have a license compatible with the GNU General @@ -25983,31 +25995,31 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga * API function pointers are provided for the following kinds of operations: - * Allocating, reallocating, and releasing memory. + * Allocating, reallocating, and releasing memory - * Registration functions. You may register extension functions, + * Registration functions (you may register extension functions, exit callbacks, a version string, input parsers, output - wrappers, and two-way processors. + wrappers, and two-way processors) - * Printing fatal, warning, and "lint" warning messages. + * Printing fatal, warning, and "lint" warning messages - * Updating `ERRNO', or unsetting it. + * Updating `ERRNO', or unsetting it * Accessing parameters, including converting an undefined - parameter into an array. + parameter into an array - * Symbol table access: retrieving a global variable, creating - one, or changing one. + * Symbol table access (retrieving a global variable, creating + one, or changing one) * Creating and releasing cached values; this provides an efficient way to use values for multiple variables and can be - a big performance win. + a big performance win - * Manipulating arrays: retrieving, adding, deleting, and + * Manipulating arrays (retrieving, adding, deleting, and modifying elements; getting the count of elements in an array; creating a new array; clearing an array; and flattening an array for easy C style looping over all its indices and - elements. + elements) * The API defines a number of standard data types for representing `awk' values, array elements, and arrays. @@ -26066,7 +26078,7 @@ Appendix A The Evolution of the `awk' Language ********************************************** This Info file describes the GNU implementation of `awk', which follows -the POSIX specification. Many long-time `awk' users learned `awk' +the POSIX specification. Many longtime `awk' users learned `awk' programming with the original `awk' implementation in Version 7 Unix. (This implementation was the basis for `awk' in Berkeley Unix, through 4.3-Reno. Subsequent versions of Berkeley Unix, and, for a while, some @@ -26248,7 +26260,7 @@ Brian Kernighan has made his version available via his home page (*note Other Versions::). This minor node describes common extensions that originally appeared -in his version of `awk'. +in his version of `awk': * The `**' and `**=' operators (*note Arithmetic Ops:: and *note Assignment Ops::). @@ -26290,7 +26302,7 @@ the current version of `gawk'. - The `/inet', `/inet4', and `/inet6' special files for TCP/IP networking using `|&' to specify which version of the IP - protocol to use. (*note TCP/IP Networking::). + protocol to use (*note TCP/IP Networking::). * Changes and/or additions to the language: @@ -26316,7 +26328,7 @@ the current version of `gawk'. * New keywords: - - The `BEGINFILE' and `ENDFILE' special patterns. (*note + - The `BEGINFILE' and `ENDFILE' special patterns (*note BEGINFILE/ENDFILE::). - The `switch' statement (*note Switch Statement::). @@ -26341,7 +26353,7 @@ the current version of `gawk'. translations easier (*note Printf Ordering::). - The `split()' function's additional optional fourth argument - which is an array to hold the text of the field separators. + which is an array to hold the text of the field separators (*note String Functions::). * Additional functions only in `gawk': @@ -26812,7 +26824,7 @@ A.7 Common Extensions Summary ============================= The following table summarizes the common extensions supported by -`gawk', Brian Kernighan's `awk', and `mawk', the three most widely-used +`gawk', Brian Kernighan's `awk', and `mawk', the three most widely used freely available versions of `awk' (*note Other Versions::). Feature BWK Awk Mawk GNU Awk Now standard @@ -26830,7 +26842,7 @@ Feature BWK Awk Mawk GNU Awk Now standard `func' keyword X X `BINMODE' variable X X `RS' as regexp X X -Time related functions X X +Time-related functions X X  File: gawk.info, Node: Ranges and Locales, Next: Contributors, Prev: Common Extensions, Up: Language History @@ -26848,7 +26860,7 @@ first character in the range and the last character in the range, inclusive. Ordering was based on the numeric value of each character in the machine's native character set. Thus, on ASCII-based systems, `[a-z]' matched all the lowercase letters, and only the lowercase -letters, since the numeric values for the letters from `a' through `z' +letters, as the numeric values for the letters from `a' through `z' were contiguous. (On an EBCDIC system, the range `[a-z]' includes additional, non-alphabetic characters as well.) @@ -26859,9 +26871,9 @@ as working in this fashion, and in particular, would teach that the this was true.(1) The 1992 POSIX standard introduced the idea of locales (*note -Locales::). Since many locales include other letters besides the plain -twenty-six letters of the American English alphabet, the POSIX standard -added character classes (*note Bracket Expressions::) as a way to match +Locales::). Because many locales include other letters besides the +plain 26 letters of the English alphabet, the POSIX standard added +character classes (*note Bracket Expressions::) as a way to match different kinds of characters besides the traditional ones in the ASCII character set. @@ -26876,7 +26888,7 @@ than `B'. In other words, these locales sort characters in dictionary order, and `[a-dx-z]' is typically not equivalent to `[abcdxyz]'; instead it might be equivalent to `[ABCXYabcdxyz]', for example. - This point needs to be emphasized: Much literature teaches that you + This point needs to be emphasized: much literature teaches that you should use `[a-z]' to match a lowercase character. But on systems with non-ASCII locales, this also matches all of the uppercase characters except `A' or `Z'! This was a continuous cause of confusion, even well @@ -26889,9 +26901,9 @@ the intent is to remove trailing uppercase characters: $ echo something1234abc | gawk-3.1.8 '{ sub("[A-Z]*$", ""); print }' -| something1234a -This output is unexpected, since the `bc' at the end of -`something1234abc' should not normally match `[A-Z]*'. This result is -due to the locale setting (and thus you may not see it on your system). +This output is unexpected, as the `bc' at the end of `something1234abc' +should not normally match `[A-Z]*'. This result is due to the locale +setting (and thus you may not see it on your system). Similar considerations apply to other ranges. For example, `["-/]' is perfectly valid in ASCII, but is not valid in many Unicode locales, @@ -26908,7 +26920,7 @@ like "why does `[A-Z]' match lowercase letters?!?" This situation existed for close to 10 years, if not more, and the `gawk' maintainer grew weary of trying to explain that `gawk' was being -nicely standards-compliant, and that the issue was in the user's +nicely standards compliant, and that the issue was in the user's locale. During the development of version 4.0, he modified `gawk' to always treat ranges in the original, pre-POSIX fashion, unless `--posix' was used (*note Options::).(2) @@ -27039,7 +27051,7 @@ Info file, in approximate chronological order: statements. * Patrick T.J. McPhee contributed the code for dynamic loading in - Windows32 environments. (This is no longer supported) + Windows32 environments. (This is no longer supported.) * Anders Wallin helped keep the VMS port going for several years. @@ -27053,8 +27065,8 @@ Info file, in approximate chronological order: - The addition of true arrays of arrays. - - The additional modifications for support of arbitrary - precision arithmetic. + - The additional modifications for support of + arbitrary-precision arithmetic. - The initial text of *note Arbitrary Precision Arithmetic::. @@ -27093,7 +27105,7 @@ A.10 Summary ============ * The `awk' language has evolved over time. The first release was - with V7 Unix circa 1978. In 1987 for System V Release 3.1, major + with V7 Unix circa 1978. In 1987, for System V Release 3.1, major additions, including user-defined functions, were made to the language. Additional changes were made for System V Release 4, in 1989. Since then, further minor changes happen under the auspices @@ -27127,8 +27139,8 @@ Appendix B Installing `gawk' This appendix provides instructions for installing `gawk' on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are -contributed. *Note Bugs::, for the electronic mail addresses of the -people who maintain the respective ports. +contributed. *Note Bugs::, for the email addresses of the people who +maintain the respective ports. * Menu: @@ -27174,7 +27186,7 @@ There are two ways to get GNU software: wget http://ftp.gnu.org/gnu/gawk/gawk-4.1.2.tar.gz The GNU software archive is mirrored around the world. The -up-to-date list of mirror sites is available from the main FSF web site +up-to-date list of mirror sites is available from the main FSF website (http://www.gnu.org/order/ftp.html). Try to use one of the mirrors; they will be less busy, and you can usually find one closer to your site. @@ -27190,9 +27202,9 @@ compression programs: `gzip', `bzip2', and `xz'. For simplicity, the rest of these instructions assume you are using the one compressed with the GNU Zip program, `gzip'. - Once you have the distribution (for example, `gawk-4.1.2.tar.gz'), -use `gzip' to expand the file and then use `tar' to extract it. You -can use the following pipeline to produce the `gawk' distribution: + Once you have the distribution (e.g., `gawk-4.1.2.tar.gz'), use +`gzip' to expand the file and then use `tar' to extract it. You can +use the following pipeline to produce the `gawk' distribution: gzip -d -c gawk-4.1.2.tar.gz | tar -xvpf - @@ -27270,7 +27282,7 @@ Various `.c', `.y', and `.h' files `doc/awkforai.txt' Pointers to the original draft of a short article describing why - `gawk' is a good language for Artificial Intelligence (AI) + `gawk' is a good language for artificial intelligence (AI) programming. `doc/bc_notes' @@ -27394,7 +27406,7 @@ Various `.c', `.y', and `.h' files  File: gawk.info, Node: Unix Installation, Next: Non-Unix Installation, Prev: Gawk Distribution, Up: Installation -B.2 Compiling and Installing `gawk' on Unix-like Systems +B.2 Compiling and Installing `gawk' on Unix-Like Systems ======================================================== Usually, you can compile and install `gawk' by typing only two @@ -27410,7 +27422,7 @@ configure `gawk' for your system yourself.  File: gawk.info, Node: Quick Installation, Next: Additional Configuration Options, Up: Unix Installation -B.2.1 Compiling `gawk' for Unix-like Systems +B.2.1 Compiling `gawk' for Unix-Like Systems -------------------------------------------- The normal installation steps should work on all modern commercial @@ -27453,8 +27465,7 @@ That's all there is to it! To verify that `gawk' is working properly, run `make check'. All of the tests should succeed. If these steps do not work, or if any of the tests fail, check the files in the `README_d' directory to see if you've found a known problem. If the -failure is not described there, please send in a bug report (*note -Bugs::). +failure is not described there, send in a bug report (*note Bugs::). Of course, once you've built `gawk', it is likely that you will wish to install it. To do so, you need to run the command `make install', @@ -27504,7 +27515,7 @@ command line when compiling `gawk' from scratch, including: for deficient systems. Use the command `./configure --help' to see the full list of options -that `configure' supplies. +supplied by `configure'.  File: gawk.info, Node: Configuration Philosophy, Prev: Additional Configuration Options, Up: Unix Installation @@ -27538,15 +27549,15 @@ element in the `stat' structure. In this case, It is possible for your C compiler to lie to `configure'. It may do so by not exiting with an error when a library function is not -available. To get around this, edit the file `custom.h'. Use an +available. To get around this, edit the `custom.h' file. Use an `#ifdef' that is appropriate for your system, and either `#define' any constants that `configure' should have defined but didn't, or `#undef' -any constants that `configure' defined and should not have. `custom.h' -is automatically included by `config.h'. +any constants that `configure' defined and should not have. The +`custom.h' file is automatically included by the `config.h' file. It is also possible that the `configure' program generated by Autoconf will not work on your system in some other fashion. If you do -have a problem, the file `configure.ac' is the input for Autoconf. You +have a problem, the `configure.ac' file is the input for Autoconf. You may be able to change this file and generate a new version of `configure' that works on your system (*note Bugs::, for information on how to report problems in configuring `gawk'). The same mechanism may @@ -27582,8 +27593,8 @@ Microsoft Windows-95/98/ME/NT/2000/XP/Vista/7/8. operating systems) has meant that various "DOS extenders" are often used with programs such as `gawk'. The varying capabilities of Microsoft Windows 3.1 and Windows32 can add to the confusion. For an -overview of the considerations, please refer to `README_d/README.pc' in -the distribution. +overview of the considerations, refer to `README_d/README.pc' in the +distribution. * Menu: @@ -27712,8 +27723,8 @@ other set of (self-consistent) environment variables and compiler flags. ---------- Footnotes ---------- - (1) As of May, 2014, this site is still there, but the author could -not find a package for GNU Make. + (1) As of November 2014, this site is still there, but the author +could not find a package for GNU Make.  File: gawk.info, Node: PC Testing, Next: PC Using, Prev: PC Compiling, Up: PC Installation @@ -27866,7 +27877,7 @@ use the `BINMODE' variable. This can cause problems with other Unix-like components that have been ported to MS-Windows that expect `gawk' to do automatic -translation of `"\r\n"', since it won't. +translation of `"\r\n"', because it won't.  File: gawk.info, Node: VMS Installation, Prev: PC Installation, Up: Non-Unix Installation @@ -27934,7 +27945,7 @@ B.3.2.2 Compiling `gawk' Dynamic Extensions on VMS .................................................. The extensions that have been ported to VMS can be built using one of -the following commands. +the following commands: $ MMS/DESCRIPTION=[.vms]descrip.mms extensions @@ -27946,7 +27957,7 @@ or: logical name to find the dynamic extensions. Dynamic extensions need to be compiled with the same compiler -options for floating point, pointer size, and symbol name handling as +options for floating-point, pointer size, and symbol name handling as were used to compile `gawk' itself. Alpha and Itanium should use IEEE floating point. The pointer size is 32 bits, and the symbol name handling should be exact case with CRC shortening for symbols longer @@ -28062,12 +28073,11 @@ Note that uppercase and mixed-case text must be quoted. The VMS port of `gawk' includes a `DCL'-style interface in addition to the original shell-style interface (see the help entry for details). One side effect of dual command-line parsing is that if there is only a -single parameter (as in the quoted string program above), the command -becomes ambiguous. To work around this, the normally optional `--' -flag is required to force Unix-style parsing rather than `DCL' parsing. -If any other dash-type options (or multiple parameters such as data -files to process) are present, there is no ambiguity and `--' can be -omitted. +single parameter (as in the quoted string program), the command becomes +ambiguous. To work around this, the normally optional `--' flag is +required to force Unix-style parsing rather than `DCL' parsing. If any +other dash-type options (or multiple parameters such as data files to +process) are present, there is no ambiguity and `--' can be omitted. The `exit' value is a Unix-style value and is encoded into a VMS exit status value when the program exits. @@ -28143,17 +28153,17 @@ File: gawk.info, Node: Bugs, Next: Other Versions, Prev: Non-Unix Installatio B.4 Reporting Problems and Bugs =============================== - There is nothing more dangerous than a bored archeologist. -- The - Hitchhiker's Guide to the Galaxy + There is nothing more dangerous than a bored archaeologist. -- + Douglas Adams, `The Hitchhiker's Guide to the Galaxy' If you have problems with `gawk' or think that you have found a bug, -please report it to the developers; we cannot promise to do anything -but we might well want to fix it. +report it to the developers; we cannot promise to do anything but we +might well want to fix it. - Before reporting a bug, please make sure you have really found a -genuine bug. Carefully reread the documentation and see if it says you -can do what you're trying to do. If it's not clear whether you should -be able to do something or not, report that too; it's a bug in the + Before reporting a bug, make sure you have really found a genuine +bug. Carefully reread the documentation and see if it says you can do +what you're trying to do. If it's not clear whether you should be able +to do something or not, report that too; it's a bug in the documentation! Before reporting a bug or trying to fix it yourself, try to isolate @@ -28164,48 +28174,46 @@ compile `gawk', and the exact results `gawk' gave you. Also say what you expected to occur; this helps us decide whether the problem is really in the documentation. - Please include the version number of `gawk' you are using. You can -get this information with the command `gawk --version'. + Make sure to include the version number of `gawk' you are using. +You can get this information with the command `gawk --version'. Once you have a precise problem description, send email to . The `gawk' maintainers subscribe to this address and thus they will receive your bug report. Although you can send mail to the maintainers -directly, the bug reporting address is preferred since the email list +directly, the bug reporting address is preferred because the email list is archived at the GNU Project. _All email must be in English. This is the only language understood in common by all the maintainers._ CAUTION: Do _not_ try to report bugs in `gawk' by posting to the - Usenet/Internet newsgroup `comp.lang.awk'. While the `gawk' - developers do occasionally read this newsgroup, there is no - guarantee that we will see your posting. The steps described - above are the only official recognized way for reporting bugs. - Really. + Usenet/Internet newsgroup `comp.lang.awk'. The `gawk' developers + do occasionally read this newsgroup, but there is no guarantee + that we will see your posting. The steps described here are the + only officially recognized way for reporting bugs. Really. NOTE: Many distributions of GNU/Linux and the various BSD-based operating systems have their own bug reporting systems. If you - report a bug using your distribution's bug reporting system, - _please_ also send a copy to . + report a bug using your distribution's bug reporting system, you + should also send a copy to . - This is for two reasons. First, while some distributions forward - bug reports "upstream" to the GNU mailing list, many don't, so - there is a good chance that the `gawk' maintainers won't even see - the bug report! Second, mail to the GNU list is archived, and - having everything at the GNU project keeps things self-contained - and not dependant on other organizations. + This is for two reasons. First, although some distributions + forward bug reports "upstream" to the GNU mailing list, many + don't, so there is a good chance that the `gawk' maintainers + won't even see the bug report! Second, mail to the GNU list is + archived, and having everything at the GNU project keeps things + self-contained and not dependant on other organizations. Non-bug suggestions are always welcome as well. If you have questions about things that are unclear in the documentation or are just obscure features, ask on the bug list; we will try to help you out if we can. - If you find bugs in one of the non-Unix ports of `gawk', please send -an electronic mail message to the bug list, with a copy to the person -who maintains that port. They are named in the following list, as well -as in the `README' file in the `gawk' distribution. Information in the -`README' file should be considered authoritative if it conflicts with -this Info file. + If you find bugs in one of the non-Unix ports of `gawk', send an +email to the bug list, with a copy to the person who maintains that +port. They are named in the following list, as well as in the `README' +file in the `gawk' distribution. Information in the `README' file +should be considered authoritative if it conflicts with this Info file. The people maintaining the various `gawk' ports are: @@ -28216,8 +28224,8 @@ OS/2 Andreas Buening, . VMS John Malmberg, . z/OS (OS/390) Dave Pitts, . - If your bug is also reproducible under Unix, please send a copy of -your report to the email list as well. + If your bug is also reproducible under Unix, send a copy of your +report to the email list as well.  File: gawk.info, Node: Other Versions, Next: Installation summary, Prev: Bugs, Up: Installation @@ -28235,7 +28243,7 @@ This minor node briefly describes where to get them: Unix `awk' Brian Kernighan, one of the original designers of Unix `awk', has made his implementation of `awk' freely available. You can - retrieve this version via the World Wide Web from his home page + retrieve this version via his home page (http://www.cs.princeton.edu/~bwk). It is available in several archive formats: @@ -28252,10 +28260,10 @@ Unix `awk' git clone git://github.com/onetrueawk/awk bwkawk - The above command creates a copy of the Git - (http://www.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'. + This command creates a copy of the Git (http://www.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'. This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely. @@ -28263,6 +28271,10 @@ Unix `awk' *Note Common Extensions::, for a list of extensions in this `awk' that are not in POSIX `awk'. + As a side note, Dan Bornstein has created a Git repository tracking + all the versions of BWK `awk' that he could find. It's available + at `git://github.com/onetrueawk/awk'. + `mawk' Michael Brennan wrote an independent implementation of `awk', called `mawk'. It is available under the GPL (*note Copying::), @@ -28324,8 +28336,8 @@ The OpenSolaris POSIX `awk' Automake) would take more work, and this has not been done, at least to our knowledge. - The source code used to be available from the OpenSolaris web site. - However, that project was ended and the web site shut down. + The source code used to be available from the OpenSolaris website. + However, that project was ended and the website shut down. Fortunately, the Illumos project (http://wiki.illumos.org/display/illumos/illumos+Home) makes this implementation available. You can view the files one at a time @@ -28341,7 +28353,7 @@ The OpenSolaris POSIX `awk' Libmawk This is an embeddable `awk' interpreter derived from `mawk'. For - more information see `http://repo.hu/projects/libmawk/'. + more information, see `http://repo.hu/projects/libmawk/'. `pawk' This is a Python module that claims to bring `awk'-like features @@ -28350,7 +28362,7 @@ Libmawk version of BWK `awk', described earlier.) QSE Awk - This is an embeddable `awk' interpreter. For more information see + This is an embeddable `awk' interpreter. For more information, see `http://code.google.com/p/qse/' and `http://awk.info/?tools/qse'. `QTawk' @@ -28363,9 +28375,10 @@ QSE Awk The project may also be frozen; no new code changes have been made since approximately 2008. -Other Versions - See also the Wikipedia article - (http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations), +Other versions + See also the "Versions and Implementations" section of the + Wikipedia article + (http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations) for information on additional versions. @@ -28534,9 +28547,8 @@ 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 web site - (http://www.gnu.org/prep/standards_toc.html). Texinfo, Info, and - DVI versions are also available.) + GNU Project's website (http://www.gnu.org/prep/standards_toc.html). + Texinfo, Info, and DVI versions are also available.) 5. Use the `gawk' coding style. The C code for `gawk' follows the instructions in the `GNU Coding Standards', with minor exceptions. @@ -31269,7 +31281,7 @@ Index * * (asterisk), * operator, as regexp operator: Regexp Operators. (line 89) * * (asterisk), * operator, null strings, matching: String Functions. - (line 535) + (line 536) * * (asterisk), ** operator <1>: Precedence. (line 49) * * (asterisk), ** operator: Arithmetic Ops. (line 81) * * (asterisk), **= operator <1>: Precedence. (line 95) @@ -31319,23 +31331,23 @@ Index * --non-decimal-data option: Options. (line 211) * --non-decimal-data option, strtonum() function and: Nondecimal Data. (line 35) -* --optimize option: Options. (line 239) +* --optimize option: Options. (line 238) * --posix option: Options. (line 256) * --posix option, --traditional option and: Options. (line 275) -* --pretty-print option: Options. (line 226) +* --pretty-print option: Options. (line 225) * --profile option <1>: Profiling. (line 12) * --profile option: Options. (line 244) * --re-interval option: Options. (line 281) * --sandbox option: Options. (line 288) * --sandbox option, disabling system() function: I/O Functions. - (line 96) + (line 128) * --sandbox option, input redirection with getline: Getline. (line 19) * --sandbox option, output redirection with print, printf: Redirection. (line 6) * --source option: Options. (line 117) * --traditional option: Options. (line 81) * --traditional option, --posix option and: Options. (line 275) -* --use-lc-numeric option: Options. (line 221) +* --use-lc-numeric option: Options. (line 220) * --version option: Options. (line 302) * --with-whiny-user-strftime configuration option: Additional Configuration Options. (line 35) @@ -31360,10 +31372,10 @@ Index * -L option: Options. (line 297) * -l option: Options. (line 173) * -M option: Options. (line 205) -* -N option: Options. (line 221) +* -N option: Options. (line 220) * -n option: Options. (line 211) -* -O option: Options. (line 239) -* -o option: Options. (line 226) +* -O option: Options. (line 238) +* -o option: Options. (line 225) * -P option: Options. (line 256) * -p option: Options. (line 244) * -r option: Options. (line 281) @@ -31474,7 +31486,7 @@ Index * \ (backslash), in bracket expressions: Bracket Expressions. (line 17) * \ (backslash), in escape sequences: Escape Sequences. (line 6) * \ (backslash), in escape sequences, POSIX and: Escape Sequences. - (line 118) + (line 105) * \ (backslash), in regexp constants: Computed Regexps. (line 29) * \ (backslash), in shell commands: Quoting. (line 48) * \ (backslash), regexp operator: Regexp Operators. (line 18) @@ -31506,14 +31518,14 @@ Index * Ada programming language: Glossary. (line 19) * adding, features to gawk: Adding Code. (line 6) * adding, fields: Changing Fields. (line 53) -* advanced features, fixed-width data: Constant Size. (line 10) +* advanced features, fixed-width data: Constant Size. (line 6) * advanced features, gawk: Advanced Features. (line 6) * advanced features, network programming: TCP/IP Networking. (line 6) * advanced features, nondecimal input data: Nondecimal Data. (line 6) * advanced features, processes, communicating with: Two-way I/O. (line 6) * advanced features, specifying field content: Splitting By Content. - (line 10) + (line 9) * Aho, Alfred <1>: Contributors. (line 11) * Aho, Alfred: History. (line 17) * alarm clock example program: Alarm Program. (line 11) @@ -31543,7 +31555,7 @@ Index (line 6) * arbitrary precision integers: Arbitrary Precision Integers. (line 6) -* archeologists: Bugs. (line 6) +* archaeologists: Bugs. (line 6) * arctangent: Numeric Functions. (line 11) * ARGC/ARGV variables: Auto-set. (line 15) * ARGC/ARGV variables, command-line arguments: Other Arguments. @@ -31565,13 +31577,13 @@ Index (line 6) * array scanning order, controlling: Controlling Scanning. (line 14) -* array, number of elements: String Functions. (line 200) +* array, number of elements: String Functions. (line 201) * 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, as parameters to functions: Pass By Value/Reference. - (line 47) + (line 44) * arrays, associative: Array Intro. (line 50) * arrays, associative, library functions and: Library Names. (line 58) * arrays, deleting entire contents: Delete. (line 39) @@ -31581,7 +31593,7 @@ Index * arrays, elements, deleting: Delete. (line 6) * arrays, elements, order of access by in operator: Scanning an Array. (line 48) -* arrays, elements, retrieving number of: String Functions. (line 41) +* arrays, elements, retrieving number of: String Functions. (line 42) * arrays, for statement and: Scanning an Array. (line 20) * arrays, indexing: Array Intro. (line 50) * arrays, merging into strings: Join Function. (line 6) @@ -31607,12 +31619,12 @@ Index * ASCII: Ordinal Functions. (line 45) * asort <1>: Array Sorting Functions. (line 6) -* asort: String Functions. (line 41) +* asort: String Functions. (line 42) * asort() function (gawk), arrays, sorting: Array Sorting Functions. (line 6) * asorti <1>: Array Sorting Functions. (line 6) -* asorti: String Functions. (line 41) +* asorti: String Functions. (line 42) * asorti() function (gawk), arrays, sorting: Array Sorting Functions. (line 6) * assert() function (C library): Assert Function. (line 6) @@ -31630,7 +31642,7 @@ Index * asterisk (*), * operator, as regexp operator: Regexp Operators. (line 89) * asterisk (*), * operator, null strings, matching: String Functions. - (line 535) + (line 536) * asterisk (*), ** operator <1>: Precedence. (line 49) * asterisk (*), ** operator: Arithmetic Ops. (line 81) * asterisk (*), **= operator <1>: Precedence. (line 95) @@ -31691,7 +31703,7 @@ Index * awk, versions of, See Also Brian Kernighan's awk <1>: Other Versions. (line 13) * awk, versions of, See Also Brian Kernighan's awk: BTL. (line 6) -* awka compiler for awk: Other Versions. (line 64) +* awka compiler for awk: Other Versions. (line 68) * AWKLIBPATH environment variable: AWKLIBPATH Variable. (line 6) * AWKPATH environment variable <1>: PC Using. (line 10) * AWKPATH environment variable: AWKPATH Variable. (line 6) @@ -31743,12 +31755,12 @@ Index * backslash (\), in bracket expressions: Bracket Expressions. (line 17) * backslash (\), in escape sequences: Escape Sequences. (line 6) * backslash (\), in escape sequences, POSIX and: Escape Sequences. - (line 118) + (line 105) * backslash (\), in regexp constants: Computed Regexps. (line 29) * backslash (\), in shell commands: Quoting. (line 48) * backslash (\), regexp operator: Regexp Operators. (line 18) * backtrace debugger command: Execution Stack. (line 13) -* Beebe, Nelson H.F. <1>: Other Versions. (line 78) +* Beebe, Nelson H.F. <1>: Other Versions. (line 82) * Beebe, Nelson H.F.: Acknowledgments. (line 60) * BEGIN pattern <1>: Using BEGIN/END. (line 6) * BEGIN pattern <2>: BEGIN/END. (line 6) @@ -31765,7 +31777,7 @@ Index * BEGIN pattern, next/nextfile statements and: I/O And BEGIN/END. (line 37) * BEGIN pattern, OFS/ORS variables, assigning values to: Output Separators. - (line 20) + (line 21) * BEGIN pattern, operators and: Using BEGIN/END. (line 17) * BEGIN pattern, print statement and: I/O And BEGIN/END. (line 16) * BEGIN pattern, pwcat program: Passwd Functions. (line 143) @@ -31834,10 +31846,10 @@ Index * Brennan, Michael <3>: Delete. (line 56) * Brennan, Michael <4>: Acknowledgments. (line 78) * Brennan, Michael <5>: Foreword4. (line 30) -* Brennan, Michael: Foreword3. (line 83) +* 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 491) +* Brian Kernighan's awk <3>: String Functions. (line 492) * 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) @@ -31848,8 +31860,8 @@ Index * Brian Kernighan's awk <11>: Regexp Field Splitting. (line 67) * Brian Kernighan's awk <12>: GNU Regexp Operators. - (line 83) -* Brian Kernighan's awk <13>: Escape Sequences. (line 122) + (line 82) +* Brian Kernighan's awk <13>: Escape Sequences. (line 109) * Brian Kernighan's awk: When. (line 21) * Brian Kernighan's awk, extensions: BTL. (line 6) * Brian Kernighan's awk, source code: Other Versions. (line 13) @@ -31859,12 +31871,12 @@ Index * Brown, Martin: Contributors. (line 82) * BSD-based operating systems: Glossary. (line 611) * bt debugger command (alias for backtrace): Execution Stack. (line 13) -* Buening, Andreas <1>: Bugs. (line 72) +* 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 139) -* buffering, interactive vs. noninteractive: I/O Functions. (line 108) +* buffering, input/output: I/O Functions. (line 140) +* buffering, interactive vs. noninteractive: I/O Functions. (line 75) * buffers, flushing: I/O Functions. (line 32) * buffers, operators for: GNU Regexp Operators. (line 48) @@ -31872,12 +31884,12 @@ Index * bug-gawk@gnu.org bug reporting address: Bugs. (line 30) * built-in functions: Functions. (line 6) * built-in functions, evaluation order: Calling Built-in. (line 30) -* Busybox Awk: Other Versions. (line 88) +* Busybox Awk: Other Versions. (line 92) * c.e., See common extensions: Conventions. (line 51) * call by reference: Pass By Value/Reference. - (line 47) + (line 44) * call by value: Pass By Value/Reference. - (line 18) + (line 15) * call stack, display in debugger: Execution Stack. (line 13) * caret (^), ^ operator: Precedence. (line 49) * caret (^), ^= operator <1>: Precedence. (line 95) @@ -31890,7 +31902,7 @@ Index * 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 521) +* case sensitivity, converting case: String Functions. (line 522) * case sensitivity, example programs: Library Functions. (line 53) * case sensitivity, gawk: Case-sensitivity. (line 26) * case sensitivity, regexps and: Case-sensitivity. (line 6) @@ -31926,7 +31938,7 @@ Index * close() function, portability: Close Files And Pipes. (line 81) * close() function, return value: Close Files And Pipes. - (line 132) + (line 133) * close() function, two-way pipes and: Two-way I/O. (line 59) * Close, Diane <1>: Contributors. (line 20) * Close, Diane: Manual History. (line 34) @@ -31970,7 +31982,7 @@ Index * common extensions, delete to delete entire arrays: Delete. (line 39) * common extensions, func keyword: Definition Syntax. (line 93) * common extensions, length() applied to an array: String Functions. - (line 200) + (line 201) * common extensions, RS as a regexp: gawk split records. (line 6) * common extensions, single character fields: Single Character Fields. (line 6) @@ -32019,9 +32031,9 @@ Index * control statements: Statements. (line 6) * controlling array scanning order: Controlling Scanning. (line 14) -* convert string to lower case: String Functions. (line 522) -* convert string to number: String Functions. (line 389) -* convert string to upper case: String Functions. (line 528) +* 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) * converting integer array subscripts: Numeric Array Subscripts. (line 31) * converting, dates to timestamps: Time Functions. (line 76) @@ -32068,7 +32080,7 @@ Index (line 43) * dark corner, break statement: Break Statement. (line 51) * dark corner, close() function: Close Files And Pipes. - (line 132) + (line 133) * dark corner, command-line arguments: Assignment Options. (line 43) * dark corner, continue statement: Continue Statement. (line 44) * dark corner, CONVFMT variable: Strings And Numbers. (line 40) @@ -32076,34 +32088,33 @@ Index * dark corner, escape sequences, for metacharacters: Escape Sequences. (line 140) * dark corner, exit statement: Exit Statement. (line 30) -* dark corner, field separators: Field Splitting Summary. - (line 46) +* dark corner, field separators: Full Line Fields. (line 22) * dark corner, FILENAME variable <1>: Auto-set. (line 90) * dark corner, FILENAME variable: Getline Notes. (line 19) -* dark corner, FNR/NR variables: Auto-set. (line 313) +* dark corner, FNR/NR variables: Auto-set. (line 314) * dark corner, format-control characters: Control Letters. (line 18) * dark corner, FS as null string: Single Character Fields. (line 20) * dark corner, input files: awk split records. (line 111) * dark corner, invoking awk: Command Line. (line 16) -* dark corner, length() function: String Functions. (line 186) +* dark corner, length() function: String Functions. (line 187) * dark corner, locale's decimal point character: Locale influences conversions. (line 17) * dark corner, multiline records: Multiple Line. (line 35) * dark corner, NF variable, decrementing: Changing Fields. (line 107) * dark corner, OFMT variable: OFMT. (line 27) * dark corner, regexp as second argument to index(): String Functions. - (line 164) + (line 165) * dark corner, regexp constants: Using Constant Regexps. (line 6) * dark corner, regexp constants, /= operator and: Assignment Ops. (line 148) * dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps. (line 43) -* dark corner, split() function: String Functions. (line 360) +* dark corner, split() function: String Functions. (line 361) * 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 10) +* data, fixed-width: Constant Size. (line 6) * data-driven languages: Basic High Level. (line 85) * database, group, reading: Group Functions. (line 6) * database, users, reading: Passwd Functions. (line 6) @@ -32233,7 +32244,7 @@ Index * decimal point character, locale specific: Options. (line 272) * decrement operators: Increment Ops. (line 35) * default keyword: Switch Statement. (line 6) -* Deifik, Scott <1>: Bugs. (line 72) +* Deifik, Scott <1>: Bugs. (line 70) * Deifik, Scott <2>: Contributors. (line 53) * Deifik, Scott: Acknowledgments. (line 60) * delete ARRAY: Delete. (line 39) @@ -32247,7 +32258,7 @@ Index * deleting entire arrays: Delete. (line 39) * Demaille, Akim: Acknowledgments. (line 60) * describe call stack frame, in debugger: Debugger Info. (line 27) -* differences between gawk and awk: String Functions. (line 200) +* differences between gawk and awk: String Functions. (line 201) * differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV. (line 90) * differences in awk and gawk, ARGIND variable: Auto-set. (line 44) @@ -32274,7 +32285,7 @@ Index * differences in awk and gawk, FIELDWIDTHS variable: User-modified. (line 37) * differences in awk and gawk, FPAT variable: User-modified. (line 43) -* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 115) +* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 116) * differences in awk and gawk, function arguments (gawk): Calling Built-in. (line 16) * differences in awk and gawk, getline command: Getline. (line 19) @@ -32294,10 +32305,10 @@ Index (line 34) * differences in awk and gawk, LINT variable: User-modified. (line 88) * differences in awk and gawk, match() function: String Functions. - (line 262) + (line 263) * differences in awk and gawk, print/printf statements: Format Modifiers. (line 13) -* differences in awk and gawk, PROCINFO array: Auto-set. (line 129) +* differences in awk and gawk, PROCINFO array: Auto-set. (line 130) * differences in awk and gawk, read timeouts: Read Timeout. (line 6) * differences in awk and gawk, record separators: awk split records. (line 125) @@ -32307,15 +32318,15 @@ Index (line 26) * differences in awk and gawk, RS/RT variables: gawk split records. (line 58) -* differences in awk and gawk, RT variable: Auto-set. (line 264) +* differences in awk and gawk, RT variable: Auto-set. (line 265) * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. - (line 348) + (line 349) * differences in awk and gawk, strings: Scalar Constants. (line 20) * differences in awk and gawk, strings, storing: gawk split records. (line 77) -* differences in awk and gawk, SYMTAB variable: Auto-set. (line 268) +* differences in awk and gawk, SYMTAB variable: Auto-set. (line 269) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. (line 151) * differences in awk and gawk, trunc-mod operation: Arithmetic Ops. @@ -32355,8 +32366,8 @@ Index * dynamically loaded extensions: Dynamic Extensions. (line 6) * e debugger command (alias for enable): Breakpoint Control. (line 73) * EBCDIC: Ordinal Functions. (line 45) -* effective group ID of gawk user: Auto-set. (line 134) -* effective user ID of gawk user: Auto-set. (line 138) +* effective group ID of gawk user: Auto-set. (line 135) +* effective user ID of gawk user: Auto-set. (line 139) * egrep utility <1>: Egrep Program. (line 6) * egrep utility: Bracket Expressions. (line 26) * egrep.awk program: Egrep Program. (line 54) @@ -32414,7 +32425,7 @@ Index * ERRNO variable: Auto-set. (line 74) * ERRNO variable, with BEGINFILE pattern: BEGINFILE/ENDFILE. (line 26) * ERRNO variable, with close() function: Close Files And Pipes. - (line 140) + (line 141) * ERRNO variable, with getline command: Getline. (line 19) * error handling: Special FD. (line 19) * error handling, ERRNO variable and: Auto-set. (line 74) @@ -32447,7 +32458,7 @@ Index * exclamation point (!), !~ operator: Regexp Usage. (line 19) * exit statement: Exit Statement. (line 6) * exit status, of gawk: Exit Status. (line 6) -* exit status, of VMS: VMS Running. (line 29) +* exit status, of VMS: VMS Running. (line 28) * exit the debugger: Miscellaneous Debugger Commands. (line 99) * exp: Numeric Functions. (line 18) @@ -32471,7 +32482,7 @@ Index (line 6) * extension API version: Extension Versioning. (line 6) -* extension API, version number: Auto-set. (line 231) +* extension API, version number: Auto-set. (line 232) * extension example: Extension Example. (line 6) * extension registration: Registration Functions. (line 6) @@ -32492,7 +32503,7 @@ Index * extensions, common, fflush() function: I/O Functions. (line 43) * extensions, common, func keyword: Definition Syntax. (line 93) * extensions, common, length() applied to an array: String Functions. - (line 200) + (line 201) * extensions, common, RS as a regexp: gawk split records. (line 6) * extensions, common, single character fields: Single Character Fields. (line 6) @@ -32520,8 +32531,7 @@ Index * field separator, in multiline records: Multiple Line. (line 41) * field separator, on command line: Command Line Field Separator. (line 6) -* field separator, POSIX and: Field Splitting Summary. - (line 40) +* field separator, POSIX and: Full Line Fields. (line 16) * field separators <1>: User-modified. (line 50) * field separators: Field Separators. (line 15) * field separators, choice of: Field Separators. (line 51) @@ -32547,7 +32557,7 @@ Index * fields, single-character: Single Character Fields. (line 6) * FIELDWIDTHS variable <1>: User-modified. (line 37) -* FIELDWIDTHS variable: Constant Size. (line 23) +* FIELDWIDTHS variable: Constant Size. (line 22) * file descriptors: Special FD. (line 6) * file inclusion, @include directive: Include Files. (line 8) * file names, distinguishing: Auto-set. (line 56) @@ -32607,23 +32617,23 @@ Index * files, source, search path for: Programs Exercises. (line 70) * files, splitting: Split Program. (line 6) * files, Texinfo, extracting programs from: Extract Program. (line 6) -* find substring in string: String Functions. (line 155) +* find substring in string: String Functions. (line 156) * finding extensions: Finding Extensions. (line 6) * finish debugger command: Debugger Execution Control. (line 39) * Fish, Fred: Contributors. (line 50) -* fixed-width data: Constant Size. (line 10) +* fixed-width data: Constant Size. (line 6) * flag variables <1>: Tee Program. (line 20) * flag variables: Boolean Ops. (line 69) * floating-point, numbers, arbitrary precision: Arbitrary Precision Arithmetic. (line 6) -* floating-point, VAX/VMS: VMS Running. (line 51) +* floating-point, VAX/VMS: VMS Running. (line 50) * flush buffered output: I/O Functions. (line 28) * fnmatch() extension function: Extension Sample Fnmatch. (line 12) -* FNR variable <1>: Auto-set. (line 99) +* FNR variable <1>: Auto-set. (line 100) * FNR variable: Records. (line 6) -* FNR variable, changing: Auto-set. (line 313) +* FNR variable, changing: Auto-set. (line 314) * for statement: For Statement. (line 6) * for statement, looping over arrays: Scanning an Array. (line 20) * fork() extension function: Extension Sample Fork. @@ -32637,7 +32647,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 382) +* formatting strings: String Functions. (line 383) * forward slash (/) to enclose regular expressions: Regexp. (line 10) * forward slash (/), / operator: Precedence. (line 55) * forward slash (/), /= operator <1>: Precedence. (line 95) @@ -32647,7 +32657,7 @@ Index * forward slash (/), patterns and: Expression Patterns. (line 24) * FPAT variable <1>: User-modified. (line 43) * FPAT variable: Splitting By Content. - (line 27) + (line 26) * frame debugger command: Execution Stack. (line 27) * Free Documentation License (FDL): GNU Free Documentation License. (line 7) @@ -32673,14 +32683,14 @@ Index * FSF (Free Software Foundation): Manual History. (line 6) * fts() extension function: Extension Sample File Functions. (line 61) -* FUNCTAB array: Auto-set. (line 115) +* FUNCTAB array: Auto-set. (line 116) * function calls: Function Calls. (line 6) * function calls, indirect: Indirect Calls. (line 6) * function calls, indirect, @-notation for: Indirect Calls. (line 47) * function definition example: Function Example. (line 6) * function pointers: Indirect Calls. (line 6) * functions, arrays as parameters to: Pass By Value/Reference. - (line 47) + (line 44) * functions, built-in <1>: Functions. (line 6) * functions, built-in: Function Calls. (line 10) * functions, built-in, evaluation order: Calling Built-in. (line 30) @@ -32711,7 +32721,7 @@ Index * functions, recursive: Definition Syntax. (line 83) * functions, string-translation: I18N Functions. (line 6) * functions, undefined: Pass By Value/Reference. - (line 71) + (line 68) * functions, user-defined: User-defined. (line 6) * functions, user-defined, calling: Function Caveats. (line 6) * functions, user-defined, counts, in a profile: Profiling. (line 137) @@ -32723,14 +32733,14 @@ Index * G-d: Acknowledgments. (line 94) * Garfinkle, Scott: Contributors. (line 34) * gawk program, dynamic profiling: Profiling. (line 179) -* gawk version: Auto-set. (line 206) +* gawk version: Auto-set. (line 207) * gawk, ARGIND variable in: Other Arguments. (line 15) * gawk, awk and <1>: This Manual. (line 14) * 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, coding style in: Adding Code. (line 39) +* gawk, coding style in: Adding Code. (line 38) * gawk, command-line options, and regular expressions: GNU Regexp Operators. (line 70) * gawk, configuring: Configuration Philosophy. @@ -32744,26 +32754,26 @@ Index * gawk, ERRNO variable in <2>: Auto-set. (line 74) * gawk, ERRNO variable in <3>: BEGINFILE/ENDFILE. (line 26) * gawk, ERRNO variable in <4>: Close Files And Pipes. - (line 140) + (line 141) * gawk, ERRNO variable in: Getline. (line 19) -* gawk, escape sequences: Escape Sequences. (line 130) +* gawk, escape sequences: Escape Sequences. (line 117) * gawk, extensions, disabling: Options. (line 256) * gawk, features, adding: Adding Code. (line 6) * gawk, features, advanced: Advanced Features. (line 6) * gawk, field separators and: User-modified. (line 71) * gawk, FIELDWIDTHS variable in <1>: User-modified. (line 37) -* gawk, FIELDWIDTHS variable in: Constant Size. (line 23) +* gawk, FIELDWIDTHS variable in: Constant Size. (line 22) * gawk, file names in: Special Files. (line 6) * gawk, format-control characters: Control Letters. (line 18) * gawk, FPAT variable in <1>: User-modified. (line 43) * gawk, FPAT variable in: Splitting By Content. - (line 27) -* gawk, FUNCTAB array in: Auto-set. (line 115) + (line 26) +* gawk, FUNCTAB array in: Auto-set. (line 116) * gawk, function arguments and: Calling Built-in. (line 16) * gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42) * gawk, IGNORECASE variable in <1>: Array Sorting Functions. (line 83) -* gawk, IGNORECASE variable in <2>: String Functions. (line 57) +* gawk, IGNORECASE variable in <2>: String Functions. (line 58) * gawk, IGNORECASE variable in <3>: Array Intro. (line 94) * gawk, IGNORECASE variable in <4>: User-modified. (line 76) * gawk, IGNORECASE variable in: Case-sensitivity. (line 26) @@ -32790,7 +32800,7 @@ Index * gawk, predefined variables and: Built-in Variables. (line 14) * gawk, PROCINFO array in <1>: Two-way I/O. (line 99) * gawk, PROCINFO array in <2>: Time Functions. (line 47) -* gawk, PROCINFO array in: Auto-set. (line 129) +* gawk, PROCINFO array in: Auto-set. (line 130) * gawk, regexp constants and: Using Constant Regexps. (line 28) * gawk, regular expressions, case sensitivity: Case-sensitivity. @@ -32798,14 +32808,14 @@ Index * gawk, regular expressions, operators: GNU Regexp Operators. (line 6) * gawk, regular expressions, precedence: Regexp Operators. (line 161) -* gawk, RT variable in <1>: Auto-set. (line 264) +* gawk, RT variable in <1>: Auto-set. (line 265) * gawk, RT variable in <2>: Multiple Line. (line 129) * gawk, RT variable in: awk split records. (line 125) * gawk, See Also awk: Preface. (line 34) * gawk, source code, obtaining: Getting. (line 6) -* gawk, splitting fields and: Constant Size. (line 88) +* gawk, splitting fields and: Constant Size. (line 87) * gawk, string-translation functions: I18N Functions. (line 6) -* gawk, SYMTAB array in: Auto-set. (line 268) +* gawk, SYMTAB array in: Auto-set. (line 269) * gawk, TEXTDOMAIN variable in: User-modified. (line 151) * gawk, timestamps: Time Functions. (line 6) * gawk, uses for: Preface. (line 34) @@ -32818,7 +32828,7 @@ Index * General Public License (GPL): Glossary. (line 305) * General Public License, See GPL: Manual History. (line 11) * generate time values: Time Functions. (line 25) -* gensub <1>: String Functions. (line 89) +* gensub <1>: String Functions. (line 90) * gensub: Using Constant Regexps. (line 43) * gensub() function (gawk), escape processing: Gory Details. (line 6) @@ -32863,7 +32873,7 @@ Index * gettext() function (C library): Explaining gettext. (line 63) * gettimeofday() extension function: Extension Sample Time. (line 12) -* git utility <1>: Adding Code. (line 112) +* git utility <1>: Adding Code. (line 111) * git utility <2>: Accessing The Source. (line 10) * git utility <3>: Other Versions. (line 29) @@ -32891,12 +32901,12 @@ Index * Grigera, Juan: Contributors. (line 57) * group database, reading: Group Functions. (line 6) * group file: Group Functions. (line 6) -* group ID of gawk user: Auto-set. (line 179) +* group ID of gawk user: Auto-set. (line 180) * groups, information about: Group Functions. (line 6) -* gsub <1>: String Functions. (line 139) +* gsub <1>: String Functions. (line 140) * gsub: Using Constant Regexps. (line 43) -* gsub() function, arguments of: String Functions. (line 461) +* gsub() function, arguments of: String Functions. (line 462) * gsub() function, escape processing: Gory Details. (line 6) * h debugger command (alias for help): Miscellaneous Debugger Commands. (line 66) @@ -32938,8 +32948,8 @@ Index (line 53) * IGNORECASE variable, with ~ and !~ operators: Case-sensitivity. (line 26) -* Illumos: Other Versions. (line 105) -* Illumos, POSIX-compliant awk: Other Versions. (line 105) +* Illumos: Other Versions. (line 109) +* Illumos, POSIX-compliant awk: Other Versions. (line 109) * implementation issues, gawk: Notes. (line 6) * implementation issues, gawk, debugging: Compatibility Mode. (line 6) * implementation issues, gawk, limits <1>: Redirection. (line 129) @@ -32956,7 +32966,7 @@ Index * in operator, use in loops: Scanning an Array. (line 17) * including files, @include directive: Include Files. (line 8) * increment operators: Increment Ops. (line 6) -* index: String Functions. (line 155) +* index: String Functions. (line 156) * indexing arrays: Array Intro. (line 50) * indirect function calls: Indirect Calls. (line 6) * indirect function calls, @-notation: Indirect Calls. (line 47) @@ -32975,7 +32985,7 @@ Index * input files, running awk without: Read Terminal. (line 6) * input files, variable assignments and: Other Arguments. (line 26) * input pipeline: Getline/Pipe. (line 9) -* input record, length of: String Functions. (line 177) +* input record, length of: String Functions. (line 178) * input redirection: Getline/File. (line 6) * input, data, nondecimal: Nondecimal Data. (line 6) * input, explicit: Getline. (line 6) @@ -32999,7 +33009,7 @@ Index * integers, arbitrary precision: Arbitrary Precision Integers. (line 6) * integers, unsigned: Computer Arithmetic. (line 41) -* interacting with other programs: I/O Functions. (line 74) +* interacting with other programs: I/O Functions. (line 106) * internationalization <1>: I18N and L10N. (line 6) * internationalization: I18N Functions. (line 6) * internationalization, localization <1>: Internationalization. @@ -33020,7 +33030,7 @@ Index * 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 74) +* invoke shell command: I/O Functions. (line 106) * isarray: Type Functions. (line 11) * ISO: Glossary. (line 367) * ISO 8859-1: Glossary. (line 133) @@ -33028,9 +33038,9 @@ Index * Jacobs, Andrew: Passwd Functions. (line 90) * Jaegermann, Michal <1>: Contributors. (line 45) * Jaegermann, Michal: Acknowledgments. (line 60) -* Java implementation of awk: Other Versions. (line 113) +* Java implementation of awk: Other Versions. (line 117) * Java programming language: Glossary. (line 379) -* jawk: Other Versions. (line 113) +* jawk: Other Versions. (line 117) * Jedi knights: Undocumented. (line 6) * Johansen, Chris: Signature Program. (line 25) * join() user-defined function: Join Function. (line 18) @@ -33076,12 +33086,12 @@ Index * left shift: Bitwise Functions. (line 47) * left shift, bitwise: Bitwise Functions. (line 32) * leftmost longest match: Multiple Line. (line 26) -* length: String Functions. (line 170) -* length of input record: String Functions. (line 177) -* length of string: String Functions. (line 170) +* 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) -* libmawk: Other Versions. (line 121) +* libmawk: Other Versions. (line 125) * libraries of awk functions: Library Functions. (line 6) * libraries of awk functions, assertions: Assert Function. (line 6) * libraries of awk functions, associative arrays and: Library Names. @@ -33123,7 +33133,7 @@ Index * lint checking, POSIXLY_CORRECT environment variable: Options. (line 341) * lint checking, undefined functions: Pass By Value/Reference. - (line 88) + (line 85) * LINT variable: User-modified. (line 88) * Linux <1>: Glossary. (line 611) * Linux <2>: I18N Example. (line 55) @@ -33142,9 +33152,9 @@ Index * localization: I18N and L10N. (line 6) * localization, See internationalization, localization: I18N and L10N. (line 6) -* log: Numeric Functions. (line 30) +* log: Numeric Functions. (line 28) * log files, timestamps in: Time Functions. (line 6) -* logarithm: Numeric Functions. (line 30) +* logarithm: Numeric Functions. (line 28) * logical false/true: Truth Values. (line 6) * logical operators, See Boolean expressions: Boolean Ops. (line 6) * login information: Passwd Functions. (line 16) @@ -33165,7 +33175,7 @@ Index * mail-list file: Sample Data Files. (line 6) * mailing labels, printing: Labels Program. (line 6) * mailing list, GNITS: Acknowledgments. (line 52) -* Malmberg, John <1>: Bugs. (line 72) +* Malmberg, John <1>: Bugs. (line 70) * Malmberg, John: Acknowledgments. (line 60) * Malmberg, John E.: Contributors. (line 137) * mark parity: Ordinal Functions. (line 45) @@ -33173,20 +33183,20 @@ Index (line 6) * marked strings, extracting: String Extraction. (line 6) * Marx, Groucho: Increment Ops. (line 60) -* match: String Functions. (line 210) -* match regexp in string: String Functions. (line 210) +* match: String Functions. (line 211) +* match regexp in string: String Functions. (line 211) * match() function, RSTART/RLENGTH variables: String Functions. - (line 227) + (line 228) * matching, expressions, See comparison expressions: Typing and Comparison. (line 9) * matching, leftmost longest: Multiple Line. (line 26) -* matching, null strings: String Functions. (line 535) -* mawk utility <1>: Other Versions. (line 44) +* matching, null strings: String Functions. (line 536) +* 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 130) -* maximum precision supported by MPFR library: Auto-set. (line 220) +* mawk utility: Escape Sequences. (line 117) +* maximum precision supported by MPFR library: Auto-set. (line 221) * McIlroy, Doug: Glossary. (line 149) * McPhee, Patrick: Contributors. (line 100) * message object files: Explaining gettext. (line 42) @@ -33199,7 +33209,7 @@ Index * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) * metacharacters, escape sequences for: Escape Sequences. (line 136) -* minimum precision supported by MPFR library: Auto-set. (line 223) +* minimum precision supported by MPFR library: Auto-set. (line 224) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 104) @@ -33248,7 +33258,7 @@ Index (line 47) * nexti debugger command: Debugger Execution Control. (line 49) -* NF variable <1>: Auto-set. (line 104) +* NF variable <1>: Auto-set. (line 105) * NF variable: Fields. (line 33) * NF variable, decrementing: Changing Fields. (line 107) * ni debugger command (alias for nexti): Debugger Execution Control. @@ -33257,9 +33267,9 @@ Index * non-existent array elements: Reference to Elements. (line 23) * not Boolean-logic operator: Boolean Ops. (line 6) -* NR variable <1>: Auto-set. (line 124) +* NR variable <1>: Auto-set. (line 125) * NR variable: Records. (line 6) -* NR variable, changing: Auto-set. (line 313) +* NR variable, changing: Auto-set. (line 314) * null strings <1>: Basic Data Typing. (line 26) * null strings <2>: Truth Values. (line 6) * null strings <3>: Regexp Field Splitting. @@ -33271,9 +33281,9 @@ Index (line 43) * null strings, converting numbers to strings: Strings And Numbers. (line 21) -* null strings, matching: String Functions. (line 535) +* null strings, matching: String Functions. (line 536) * number as string of bits: Bitwise Functions. (line 110) -* number of array elements: String Functions. (line 200) +* number of array elements: String Functions. (line 201) * number sign (#), #! (executable scripts): Executable Scripts. (line 6) * number sign (#), commenting: Comments. (line 6) @@ -33304,7 +33314,7 @@ Index * OFS variable <2>: Output Separators. (line 6) * OFS variable: Changing Fields. (line 64) * OpenBSD: Glossary. (line 611) -* OpenSolaris: Other Versions. (line 96) +* OpenSolaris: Other Versions. (line 100) * operating systems, BSD-based: Manual History. (line 28) * operating systems, PC, gawk on: PC Using. (line 6) * operating systems, PC, gawk on, installing: PC Installation. @@ -33354,10 +33364,10 @@ Index * ord() user-defined function: Ordinal Functions. (line 16) * order of evaluation, concatenation: Concatenation. (line 41) * ORS variable <1>: User-modified. (line 118) -* ORS variable: Output Separators. (line 20) +* ORS variable: Output Separators. (line 21) * output field separator, See OFS variable: Changing Fields. (line 64) * output record separator, See ORS variable: Output Separators. - (line 20) + (line 21) * output redirection: Redirection. (line 6) * output wrapper: Output Wrappers. (line 6) * output, buffering: I/O Functions. (line 32) @@ -33368,16 +33378,16 @@ Index * output, formatted: Printf. (line 6) * output, pipes: Redirection. (line 57) * output, printing, See printing: Printing. (line 6) -* output, records: Output Separators. (line 20) +* output, records: Output Separators. (line 21) * output, standard: Special FD. (line 6) * p debugger command (alias for print): Viewing And Changing Data. (line 36) * Papadopoulos, Panos: Contributors. (line 128) -* parent process ID of gawk process: Auto-set. (line 188) +* parent process ID of gawk process: Auto-set. (line 189) * parentheses (), in a profile: Profiling. (line 146) * parentheses (), regexp operator: Regexp Operators. (line 81) * password file: Passwd Functions. (line 16) -* patsplit: String Functions. (line 296) +* patsplit: String Functions. (line 297) * patterns: Patterns and Actions. (line 6) * patterns, comparison expressions as: Expression Patterns. (line 14) @@ -33389,8 +33399,8 @@ Index * patterns, regexp constants as: Expression Patterns. (line 34) * patterns, types of: Pattern Overview. (line 15) * pawk (profiling version of Brian Kernighan's awk): Other Versions. - (line 78) -* pawk, awk-like facilities for Python: Other Versions. (line 125) + (line 82) +* pawk, awk-like facilities for Python: Other Versions. (line 129) * PC operating systems, gawk on: PC Using. (line 6) * PC operating systems, gawk on, installing: PC Installation. (line 6) * percent sign (%), % operator: Precedence. (line 55) @@ -33404,7 +33414,7 @@ Index (line 6) * pipe, input: Getline/Pipe. (line 9) * pipe, output: Redirection. (line 57) -* Pitts, Dave <1>: Bugs. (line 72) +* Pitts, Dave <1>: Bugs. (line 70) * Pitts, Dave: Acknowledgments. (line 60) * Plauger, P.J.: Library Functions. (line 12) * plug-in: Extension Intro. (line 6) @@ -33422,7 +33432,7 @@ Index * portability, ARGV variable: Executable Scripts. (line 59) * portability, backslash continuation and: Statements/Lines. (line 30) * portability, backslash in escape sequences: Escape Sequences. - (line 118) + (line 105) * portability, close() function and: Close Files And Pipes. (line 81) * portability, data files as single record: gawk split records. @@ -33433,15 +33443,15 @@ Index * portability, gawk: New Ports. (line 6) * portability, gettext library and: Explaining gettext. (line 11) * portability, internationalization and: I18N Portability. (line 6) -* portability, length() function: String Functions. (line 179) +* portability, length() function: String Functions. (line 180) * portability, new awk vs. old awk: Strings And Numbers. (line 57) * portability, next statement in user-defined functions: Pass By Value/Reference. - (line 91) + (line 88) * portability, NF variable, decrementing: Changing Fields. (line 115) * portability, operators: Increment Ops. (line 60) * portability, operators, not in POSIX awk: Precedence. (line 98) * portability, POSIXLY_CORRECT environment variable: Options. (line 361) -* portability, substr() function: String Functions. (line 511) +* portability, substr() function: String Functions. (line 512) * 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. @@ -33461,7 +33471,7 @@ Index * POSIX awk, < operator and: Getline/File. (line 26) * POSIX awk, arithmetic operators and: Arithmetic Ops. (line 30) * POSIX awk, backslashes in string constants: Escape Sequences. - (line 118) + (line 105) * POSIX awk, BEGIN/END patterns: I/O And BEGIN/END. (line 16) * POSIX awk, bracket expressions and: Bracket Expressions. (line 26) * POSIX awk, bracket expressions and, character classes: Bracket Expressions. @@ -33471,13 +33481,12 @@ Index * POSIX awk, continue statement and: Continue Statement. (line 44) * POSIX awk, CONVFMT variable and: User-modified. (line 30) * POSIX awk, date utility and: Time Functions. (line 254) -* POSIX awk, field separators and <1>: Field Splitting Summary. - (line 40) +* 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, functions and, gsub()/sub(): Gory Details. (line 90) -* POSIX awk, functions and, length(): String Functions. (line 179) +* POSIX awk, functions and, length(): String Functions. (line 180) * POSIX awk, GNU long options and: Options. (line 15) * POSIX awk, interval expressions in: Regexp Operators. (line 135) * POSIX awk, next/nextfile statements and: Next Statement. (line 44) @@ -33540,24 +33549,24 @@ Index * printing, unduplicated lines of text: Uniq Program. (line 6) * printing, user information: Id Program. (line 6) * private variables: Library Names. (line 11) -* process group idIDof gawk process: Auto-set. (line 182) -* process ID of gawk process: Auto-set. (line 185) +* process group idIDof gawk process: Auto-set. (line 183) +* process ID of gawk process: Auto-set. (line 186) * processes, two-way communications with: Two-way I/O. (line 6) * processing data: Basic High Level. (line 6) * PROCINFO array <1>: Passwd Functions. (line 6) * PROCINFO array <2>: Time Functions. (line 47) -* PROCINFO array: Auto-set. (line 129) +* PROCINFO array: Auto-set. (line 130) * PROCINFO array, and communications via ptys: Two-way I/O. (line 99) * PROCINFO array, and group membership: Group Functions. (line 6) * PROCINFO array, and user and group ID numbers: Id Program. (line 15) * PROCINFO array, testing the field splitting: Passwd Functions. (line 154) -* PROCINFO array, uses: Auto-set. (line 241) +* PROCINFO array, uses: Auto-set. (line 242) * PROCINFO, values of sorted_in: Controlling Scanning. (line 26) * profiling awk programs: Profiling. (line 6) * profiling awk programs, dynamically: Profiling. (line 179) -* program identifiers: Auto-set. (line 147) +* program identifiers: Auto-set. (line 148) * program, definition of: Getting Started. (line 21) * programming conventions, --non-decimal-data option: Nondecimal Data. (line 35) @@ -33583,13 +33592,13 @@ Index * pwcat program: Passwd Functions. (line 23) * q debugger command (alias for quit): Miscellaneous Debugger Commands. (line 99) -* QSE Awk: Other Versions. (line 131) +* QSE Awk: Other Versions. (line 135) * Quanstrom, Erik: Alarm Program. (line 8) * question mark (?), ?: operator: Precedence. (line 92) * question mark (?), regexp operator <1>: GNU Regexp Operators. (line 59) * question mark (?), regexp operator: Regexp Operators. (line 111) -* QuikTrim Awk: Other Versions. (line 135) +* QuikTrim Awk: Other Versions. (line 139) * quit debugger command: Miscellaneous Debugger Commands. (line 99) * QUIT signal (MS-Windows): Profiling. (line 214) @@ -33601,12 +33610,12 @@ Index * Rakitzis, Byron: History Sorting. (line 25) * Ramey, Chet <1>: General Data Types. (line 6) * Ramey, Chet: Acknowledgments. (line 60) -* rand: Numeric Functions. (line 35) +* rand: Numeric Functions. (line 33) * random numbers, Cliff: Cliff Random Function. (line 6) * random numbers, rand()/srand() functions: Numeric Functions. - (line 35) -* random numbers, seed of: Numeric Functions. (line 65) + (line 33) +* random numbers, seed of: Numeric Functions. (line 63) * range expressions (regexps): Bracket Expressions. (line 6) * range patterns: Ranges. (line 6) * range patterns, line continuation and: Ranges. (line 65) @@ -33691,12 +33700,12 @@ 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 407) +* replace in string: String Functions. (line 408) * return debugger command: Debugger Execution Control. (line 54) * return statement, user-defined functions: Return Statement. (line 6) * return value, close() function: Close Files And Pipes. - (line 132) + (line 133) * rev() user-defined function: Function Example. (line 54) * revoutput extension: Extension Sample Revout. (line 11) @@ -33715,10 +33724,10 @@ Index * right shift: Bitwise Functions. (line 53) * right shift, bitwise: Bitwise Functions. (line 32) * Ritchie, Dennis: Basic Data Typing. (line 54) -* RLENGTH variable: Auto-set. (line 251) -* RLENGTH variable, match() function and: String Functions. (line 227) +* RLENGTH variable: Auto-set. (line 252) +* RLENGTH variable, match() function and: String Functions. (line 228) * Robbins, Arnold <1>: Future Extensions. (line 6) -* Robbins, Arnold <2>: Bugs. (line 72) +* Robbins, Arnold <2>: Bugs. (line 70) * Robbins, Arnold <3>: Contributors. (line 144) * Robbins, Arnold <4>: General Data Types. (line 6) * Robbins, Arnold <5>: Alarm Program. (line 6) @@ -33741,9 +33750,9 @@ Index * RS variable: awk split records. (line 12) * RS variable, multiline records and: Multiple Line. (line 17) * rshift: Bitwise Functions. (line 53) -* RSTART variable: Auto-set. (line 257) -* RSTART variable, match() function and: String Functions. (line 227) -* RT variable <1>: Auto-set. (line 264) +* RSTART variable: Auto-set. (line 258) +* RSTART variable, match() function and: String Functions. (line 228) +* RT variable <1>: Auto-set. (line 265) * RT variable <2>: Multiple Line. (line 129) * RT variable: awk split records. (line 125) * Rubin, Paul <1>: Contributors. (line 15) @@ -33763,17 +33772,17 @@ Index * scanning arrays: Scanning an Array. (line 6) * scanning multidimensional arrays: Multiscanning. (line 11) * Schorr, Andrew <1>: Contributors. (line 133) -* Schorr, Andrew <2>: Auto-set. (line 296) +* Schorr, Andrew <2>: Auto-set. (line 297) * Schorr, Andrew: Acknowledgments. (line 60) * Schreiber, Bert: Acknowledgments. (line 38) * Schreiber, Rita: Acknowledgments. (line 38) -* search and replace in strings: String Functions. (line 89) -* search in string: String Functions. (line 155) -* search paths <1>: VMS Running. (line 58) +* search and replace in strings: String Functions. (line 90) +* search in string: String Functions. (line 156) +* search paths <1>: VMS Running. (line 57) * search paths <2>: PC Using. (line 10) * search paths: Programs Exercises. (line 70) * search paths, for loadable extensions: AWKLIBPATH Variable. (line 6) -* search paths, for source files <1>: VMS Running. (line 58) +* search paths, for source files <1>: VMS Running. (line 57) * search paths, for source files <2>: PC Using. (line 10) * search paths, for source files <3>: Programs Exercises. (line 70) * search paths, for source files: AWKPATH Variable. (line 6) @@ -33781,9 +33790,8 @@ Index * searching, for words: Dupword Program. (line 6) * sed utility <1>: Glossary. (line 11) * sed utility <2>: Simple Sed. (line 6) -* sed utility: Field Splitting Summary. - (line 46) -* seeding random number generator: Numeric Functions. (line 65) +* sed utility: Full Line Fields. (line 22) +* seeding random number generator: Numeric Functions. (line 63) * semicolon (;), AWKPATH variable and: PC Using. (line 10) * semicolon (;), separating statements in actions <1>: Statements. (line 10) @@ -33844,26 +33852,26 @@ Index * sidebar, A Constant's Base Does Not Affect Its Value: Nondecimal-numbers. (line 64) * sidebar, Backslash Before Regular Characters: Escape Sequences. - (line 116) -* sidebar, Changing FS Does Not Affect the Fields: Field Splitting Summary. - (line 38) -* sidebar, Changing NR and FNR: Auto-set. (line 311) + (line 103) +* sidebar, Changing FS Does Not Affect the Fields: Full Line Fields. + (line 14) +* sidebar, Changing NR and FNR: Auto-set. (line 312) * sidebar, Controlling Output Buffering with system(): I/O Functions. - (line 137) + (line 138) * sidebar, Escape Sequences for Metacharacters: Escape Sequences. (line 134) * sidebar, FS and IGNORECASE: Field Splitting Summary. - (line 64) + (line 38) * sidebar, Interactive Versus Noninteractive Buffering: I/O Functions. - (line 106) -* sidebar, Matching the Null String: String Functions. (line 533) + (line 73) +* sidebar, Matching the Null String: String Functions. (line 534) * 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. +* sidebar, Pre-POSIX awk Used OFMT for String Conversion: Strings And Numbers. (line 55) -* sidebar, Recipe For A Programming Language: History. (line 6) +* sidebar, Recipe for a Programming Language: History. (line 6) * sidebar, RS = "\0" Is Not Portable: gawk split records. (line 63) -* sidebar, So Why Does gawk have BEGINFILE and ENDFILE?: Filetrans Function. +* sidebar, So Why Does gawk Have BEGINFILE and ENDFILE?: Filetrans Function. (line 82) * sidebar, Syntactic Ambiguities Between /= and Regular Expressions: Assignment Ops. (line 146) @@ -33872,7 +33880,7 @@ Index * sidebar, Using \n in Bracket Expressions of Dynamic Regexps: Computed Regexps. (line 57) * sidebar, Using close()'s Return Value: Close Files And Pipes. - (line 130) + (line 131) * SIGHUP signal, for dynamic profiling: Profiling. (line 211) * SIGINT signal (MS-Windows): Profiling. (line 214) * signals, HUP/SIGHUP, for profiling: Profiling. (line 211) @@ -33884,8 +33892,8 @@ Index * SIGUSR1 signal, for dynamic profiling: Profiling. (line 188) * silent debugger command: Debugger Execution Control. (line 10) -* sin: Numeric Functions. (line 76) -* sine: Numeric Functions. (line 76) +* sin: Numeric Functions. (line 74) +* sine: Numeric Functions. (line 74) * single quote ('): One-shot. (line 15) * single quote (') in gawk command lines: Long. (line 35) * single quote ('), in shell commands: Quoting. (line 48) @@ -33899,46 +33907,46 @@ Index * sleep utility: Alarm Program. (line 110) * sleep() extension function: Extension Sample Time. (line 22) -* Solaris, POSIX-compliant awk: Other Versions. (line 96) -* sort array: String Functions. (line 41) -* sort array indices: String Functions. (line 41) +* Solaris, POSIX-compliant awk: Other Versions. (line 100) +* sort array: String Functions. (line 42) +* sort array indices: String Functions. (line 42) * sort function, arrays, sorting: Array Sorting Functions. (line 6) * sort utility: Word Sorting. (line 50) * sort utility, coprocesses and: Two-way I/O. (line 65) * sorting characters in different languages: Explaining gettext. (line 94) -* source code, awka: Other Versions. (line 64) +* source code, awka: Other Versions. (line 68) * source code, Brian Kernighan's awk: Other Versions. (line 13) -* source code, Busybox Awk: Other Versions. (line 88) +* source code, Busybox Awk: Other Versions. (line 92) * source code, gawk: Gawk Distribution. (line 6) -* source code, Illumos awk: Other Versions. (line 105) -* source code, jawk: Other Versions. (line 113) -* source code, libmawk: Other Versions. (line 121) -* source code, mawk: Other Versions. (line 44) +* source code, Illumos awk: Other Versions. (line 109) +* source code, jawk: Other Versions. (line 117) +* source code, libmawk: Other Versions. (line 125) +* source code, mawk: Other Versions. (line 48) * source code, mixing: Options. (line 117) -* source code, pawk: Other Versions. (line 78) -* source code, pawk (Python version): Other Versions. (line 125) -* source code, QSE Awk: Other Versions. (line 131) -* source code, QuikTrim Awk: Other Versions. (line 135) -* source code, Solaris awk: Other Versions. (line 96) +* source code, pawk: Other Versions. (line 82) +* source code, pawk (Python version): Other Versions. (line 129) +* source code, QSE Awk: Other Versions. (line 135) +* 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) * Spencer, Henry: Glossary. (line 11) -* split: String Functions. (line 315) -* split string into array: String Functions. (line 296) +* 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 382) +* sprintf <1>: String Functions. (line 383) * sprintf: OFMT. (line 15) * sprintf() function, OFMT variable and: User-modified. (line 113) * sprintf() function, print/printf statements and: Round Function. (line 6) -* sqrt: Numeric Functions. (line 79) +* sqrt: Numeric Functions. (line 77) * square brackets ([]), regexp operator: Regexp Operators. (line 56) -* square root: Numeric Functions. (line 79) -* srand: Numeric Functions. (line 83) +* square root: Numeric Functions. (line 77) +* srand: Numeric Functions. (line 81) * stack frame: Debugging Terms. (line 10) * Stallman, Richard <1>: Glossary. (line 296) * Stallman, Richard <2>: Contributors. (line 23) @@ -33961,23 +33969,22 @@ Index * stop automatic display, in debugger: Viewing And Changing Data. (line 80) * stream editors <1>: Simple Sed. (line 6) -* stream editors: Field Splitting Summary. - (line 46) +* 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 extraction (internationalization): String Extraction. (line 6) -* string length: String Functions. (line 170) +* string length: String Functions. (line 171) * string operators: Concatenation. (line 8) -* string, regular expression match: String Functions. (line 210) +* string, regular expression match: String Functions. (line 211) * string-manipulation functions: String Functions. (line 6) * string-matching operators: Regexp Usage. (line 19) * string-translation functions: I18N Functions. (line 6) -* strings splitting, example: String Functions. (line 334) +* 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 521) +* strings, converting letter case: String Functions. (line 522) * strings, converting, numbers to: User-modified. (line 30) * strings, empty, See null strings: awk split records. (line 115) * strings, extracting: String Extraction. (line 6) @@ -33987,13 +33994,13 @@ Index * strings, null: Regexp Field Splitting. (line 43) * strings, numeric: Variable Typing. (line 6) -* strtonum: String Functions. (line 389) +* strtonum: String Functions. (line 390) * strtonum() function (gawk), --non-decimal-data option and: Nondecimal Data. (line 35) -* sub <1>: String Functions. (line 407) +* sub <1>: String Functions. (line 408) * sub: Using Constant Regexps. (line 43) -* sub() function, arguments of: String Functions. (line 461) +* sub() function, arguments of: String Functions. (line 462) * sub() function, escape processing: Gory Details. (line 6) * subscript separators: User-modified. (line 145) * subscripts in arrays, multidimensional: Multidimensional. (line 10) @@ -34006,16 +34013,16 @@ Index * SUBSEP variable: User-modified. (line 145) * SUBSEP variable, and multidimensional arrays: Multidimensional. (line 16) -* substitute in string: String Functions. (line 89) -* substr: String Functions. (line 480) -* substring: String Functions. (line 480) -* Sumner, Andrew: Other Versions. (line 64) -* supplementary groups of gawk process: Auto-set. (line 236) +* substitute in string: String Functions. (line 90) +* substr: String Functions. (line 481) +* substring: String Functions. (line 481) +* Sumner, Andrew: Other Versions. (line 68) +* supplementary groups of gawk process: Auto-set. (line 237) * switch statement: Switch Statement. (line 6) -* SYMTAB array: Auto-set. (line 268) +* SYMTAB array: Auto-set. (line 269) * syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops. (line 148) -* system: I/O Functions. (line 74) +* system: I/O Functions. (line 106) * systime: Time Functions. (line 66) * t debugger command (alias for tbreak): Breakpoint Control. (line 90) * tbreak debugger command: Breakpoint Control. (line 90) @@ -34029,7 +34036,7 @@ Index * testbits.awk program: Bitwise Functions. (line 71) * testext extension: Extension Sample API Tests. (line 6) -* Texinfo <1>: Adding Code. (line 100) +* Texinfo <1>: Adding Code. (line 99) * Texinfo <2>: Distribution contents. (line 77) * Texinfo <3>: Extract Program. (line 12) @@ -34065,8 +34072,8 @@ Index * timestamps, converting dates to: Time Functions. (line 76) * timestamps, formatted: Getlocaltime Function. (line 6) -* tolower: String Functions. (line 522) -* toupper: String Functions. (line 528) +* tolower: String Functions. (line 523) +* toupper: String Functions. (line 529) * tr utility: Translate Program. (line 6) * trace debugger command: Miscellaneous Debugger Commands. (line 108) @@ -34079,10 +34086,10 @@ Index (line 37) * troubleshooting, awk uses FS not IFS: Field Separators. (line 30) * troubleshooting, backslash before nonspecial character: Escape Sequences. - (line 118) + (line 105) * troubleshooting, division: Arithmetic Ops. (line 44) * troubleshooting, fatal errors, field widths, specifying: Constant Size. - (line 23) + (line 22) * troubleshooting, fatal errors, printf format strings: Format Modifiers. (line 158) * troubleshooting, fflush() function: I/O Functions. (line 62) @@ -34092,8 +34099,8 @@ Index * 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 471) -* troubleshooting, match() function: String Functions. (line 291) +* troubleshooting, gsub()/sub() functions: String Functions. (line 472) +* troubleshooting, match() function: String Functions. (line 292) * troubleshooting, print statement, omitting commas: Print Examples. (line 31) * troubleshooting, printing: Redirection. (line 112) @@ -34102,8 +34109,8 @@ Index * troubleshooting, regexp constants vs. string constants: Computed Regexps. (line 39) * troubleshooting, string concatenation: Concatenation. (line 26) -* troubleshooting, substr() function: String Functions. (line 498) -* troubleshooting, system() function: I/O Functions. (line 96) +* troubleshooting, substr() function: String Functions. (line 499) +* troubleshooting, system() function: I/O Functions. (line 128) * troubleshooting, typographical errors, global variables: Options. (line 98) * true, logical: Truth Values. (line 6) @@ -34118,7 +34125,7 @@ Index * unassigned array elements: Reference to Elements. (line 18) * undefined functions: Pass By Value/Reference. - (line 71) + (line 68) * underscore (_), C macro: Explaining gettext. (line 71) * underscore (_), in names of private variables: Library Names. (line 29) @@ -34135,9 +34142,9 @@ Index * uniq.awk program: Uniq Program. (line 65) * Unix: Glossary. (line 611) * Unix awk, backslashes in escape sequences: Escape Sequences. - (line 130) + (line 117) * Unix awk, close() function and: Close Files And Pipes. - (line 132) + (line 133) * Unix awk, password files, field separators and: Command Line Field Separator. (line 62) * Unix, awk scripts and: Executable Scripts. (line 6) @@ -34189,10 +34196,10 @@ Index * variables, uninitialized, as array subscripts: Uninitialized Subscripts. (line 6) * variables, user-defined: Variables. (line 6) -* version of gawk: Auto-set. (line 206) -* version of gawk extension API: Auto-set. (line 231) -* version of GNU MP library: Auto-set. (line 217) -* version of GNU MPFR library: Auto-set. (line 213) +* version of gawk: Auto-set. (line 207) +* version of gawk extension API: Auto-set. (line 232) +* version of GNU MP library: Auto-set. (line 218) +* version of GNU MPFR library: Auto-set. (line 214) * vertical bar (|): Regexp Operators. (line 70) * vertical bar (|), | operator (I/O) <1>: Precedence. (line 65) * vertical bar (|), | operator (I/O): Getline/Pipe. (line 9) @@ -34204,7 +34211,7 @@ Index * Vinschen, Corinna: Acknowledgments. (line 60) * w debugger command (alias for watch): Viewing And Changing Data. (line 67) -* w utility: Constant Size. (line 23) +* w utility: Constant Size. (line 22) * wait() extension function: Extension Sample Fork. (line 22) * waitpid() extension function: Extension Sample Fork. @@ -34249,7 +34256,7 @@ Index * xor: Bitwise Functions. (line 56) * XOR bitwise operation: Bitwise Functions. (line 6) * Yawitz, Efraim: Contributors. (line 131) -* Zaretskii, Eli <1>: Bugs. (line 72) +* Zaretskii, Eli <1>: Bugs. (line 70) * Zaretskii, Eli <2>: Contributors. (line 55) * Zaretskii, Eli: Acknowledgments. (line 60) * zerofile.awk program: Empty Files. (line 21) @@ -34266,7 +34273,7 @@ Index * | (vertical bar), |& operator (I/O) <3>: Redirection. (line 96) * | (vertical bar), |& operator (I/O): Getline/Coprocess. (line 6) * | (vertical bar), |& operator (I/O), pipes, closing: Close Files And Pipes. - (line 120) + (line 121) * | (vertical bar), || operator <1>: Precedence. (line 89) * | (vertical bar), || operator: Boolean Ops. (line 59) * ~ (tilde), ~ operator <1>: Expression Patterns. (line 24) @@ -34283,557 +34290,557 @@ Index Tag Table: Node: Top1204 Node: Foreword342156 -Node: Foreword446548 -Node: Preface47982 -Ref: Preface-Footnote-150853 -Ref: Preface-Footnote-250960 -Ref: Preface-Footnote-351193 -Node: History51335 -Node: Names53683 -Ref: Names-Footnote-154777 -Node: This Manual54923 -Ref: This Manual-Footnote-160752 -Node: Conventions60852 -Node: Manual History63192 -Ref: Manual History-Footnote-166183 -Ref: Manual History-Footnote-266224 -Node: How To Contribute66298 -Node: Acknowledgments67429 -Node: Getting Started72237 -Node: Running gawk74671 -Node: One-shot75861 -Node: Read Terminal77086 -Node: Long79113 -Node: Executable Scripts80629 -Ref: Executable Scripts-Footnote-183418 -Node: Comments83520 -Node: Quoting85993 -Node: DOS Quoting91499 -Node: Sample Data Files92174 -Node: Very Simple94767 -Node: Two Rules99658 -Node: More Complex101544 -Node: Statements/Lines104406 -Ref: Statements/Lines-Footnote-1108862 -Node: Other Features109127 -Node: When110058 -Ref: When-Footnote-1111814 -Node: Intro Summary111879 -Node: Invoking Gawk112762 -Node: Command Line114277 -Node: Options115068 -Ref: Options-Footnote-1130980 -Node: Other Arguments131005 -Node: Naming Standard Input133966 -Node: Environment Variables135059 -Node: AWKPATH Variable135617 -Ref: AWKPATH Variable-Footnote-1138917 -Ref: AWKPATH Variable-Footnote-2138962 -Node: AWKLIBPATH Variable139222 -Node: Other Environment Variables140365 -Node: Exit Status144085 -Node: Include Files144760 -Node: Loading Shared Libraries148348 -Node: Obsolete149775 -Node: Undocumented150472 -Node: Invoking Summary150739 -Node: Regexp152405 -Node: Regexp Usage153864 -Node: Escape Sequences155897 -Node: Regexp Operators161914 -Ref: Regexp Operators-Footnote-1169348 -Ref: Regexp Operators-Footnote-2169495 -Node: Bracket Expressions169593 -Ref: table-char-classes171610 -Node: Leftmost Longest174550 -Node: Computed Regexps175852 -Node: GNU Regexp Operators179249 -Node: Case-sensitivity182951 -Ref: Case-sensitivity-Footnote-1185841 -Ref: Case-sensitivity-Footnote-2186076 -Node: Regexp Summary186184 -Node: Reading Files187653 -Node: Records189747 -Node: awk split records190479 -Node: gawk split records195393 -Ref: gawk split records-Footnote-1199932 -Node: Fields199969 -Ref: Fields-Footnote-1202767 -Node: Nonconstant Fields202853 -Ref: Nonconstant Fields-Footnote-1205089 -Node: Changing Fields205291 -Node: Field Separators211223 -Node: Default Field Splitting213927 -Node: Regexp Field Splitting215044 -Node: Single Character Fields218394 -Node: Command Line Field Separator219453 -Node: Full Line Fields222665 -Ref: Full Line Fields-Footnote-1223173 -Node: Field Splitting Summary223219 -Ref: Field Splitting Summary-Footnote-1226350 -Node: Constant Size226451 -Node: Splitting By Content231057 -Ref: Splitting By Content-Footnote-1235130 -Node: Multiple Line235170 -Ref: Multiple Line-Footnote-1241059 -Node: Getline241238 -Node: Plain Getline243449 -Node: Getline/Variable246089 -Node: Getline/File247236 -Node: Getline/Variable/File248620 -Ref: Getline/Variable/File-Footnote-1250221 -Node: Getline/Pipe250308 -Node: Getline/Variable/Pipe252991 -Node: Getline/Coprocess254122 -Node: Getline/Variable/Coprocess255374 -Node: Getline Notes256113 -Node: Getline Summary258905 -Ref: table-getline-variants259317 -Node: Read Timeout260146 -Ref: Read Timeout-Footnote-1263960 -Node: Command-line directories264018 -Node: Input Summary264922 -Node: Input Exercises268174 -Node: Printing268902 -Node: Print270679 -Node: Print Examples272136 -Node: Output Separators274915 -Node: OFMT276933 -Node: Printf278287 -Node: Basic Printf279072 -Node: Control Letters280643 -Node: Format Modifiers284627 -Node: Printf Examples290634 -Node: Redirection293116 -Node: Special FD299955 -Ref: Special FD-Footnote-1303112 -Node: Special Files303186 -Node: Other Inherited Files303802 -Node: Special Network304802 -Node: Special Caveats305663 -Node: Close Files And Pipes306614 -Ref: Close Files And Pipes-Footnote-1313793 -Ref: Close Files And Pipes-Footnote-2313941 -Node: Output Summary314091 -Node: Output Exercises315087 -Node: Expressions315767 -Node: Values316952 -Node: Constants317628 -Node: Scalar Constants318308 -Ref: Scalar Constants-Footnote-1319167 -Node: Nondecimal-numbers319417 -Node: Regexp Constants322417 -Node: Using Constant Regexps322942 -Node: Variables326080 -Node: Using Variables326735 -Node: Assignment Options328645 -Node: Conversion330520 -Node: Strings And Numbers331044 -Ref: Strings And Numbers-Footnote-1334108 -Node: Locale influences conversions334217 -Ref: table-locale-affects336962 -Node: All Operators337550 -Node: Arithmetic Ops338180 -Node: Concatenation340685 -Ref: Concatenation-Footnote-1343504 -Node: Assignment Ops343610 -Ref: table-assign-ops348593 -Node: Increment Ops349871 -Node: Truth Values and Conditions353309 -Node: Truth Values354392 -Node: Typing and Comparison355441 -Node: Variable Typing356234 -Node: Comparison Operators359886 -Ref: table-relational-ops360296 -Node: POSIX String Comparison363811 -Ref: POSIX String Comparison-Footnote-1364883 -Node: Boolean Ops365021 -Ref: Boolean Ops-Footnote-1369500 -Node: Conditional Exp369591 -Node: Function Calls371318 -Node: Precedence375198 -Node: Locales378866 -Node: Expressions Summary380497 -Node: Patterns and Actions383071 -Node: Pattern Overview384191 -Node: Regexp Patterns385870 -Node: Expression Patterns386413 -Node: Ranges390193 -Node: BEGIN/END393299 -Node: Using BEGIN/END394061 -Ref: Using BEGIN/END-Footnote-1396798 -Node: I/O And BEGIN/END396904 -Node: BEGINFILE/ENDFILE399218 -Node: Empty402119 -Node: Using Shell Variables402436 -Node: Action Overview404712 -Node: Statements407039 -Node: If Statement408887 -Node: While Statement410385 -Node: Do Statement412413 -Node: For Statement413555 -Node: Switch Statement416710 -Node: Break Statement419098 -Node: Continue Statement421139 -Node: Next Statement422964 -Node: Nextfile Statement425344 -Node: Exit Statement427974 -Node: Built-in Variables430377 -Node: User-modified431510 -Ref: User-modified-Footnote-1439190 -Node: Auto-set439252 -Ref: Auto-set-Footnote-1452282 -Ref: Auto-set-Footnote-2452487 -Node: ARGC and ARGV452543 -Node: Pattern Action Summary456747 -Node: Arrays459174 -Node: Array Basics460503 -Node: Array Intro461347 -Ref: figure-array-elements463311 -Ref: Array Intro-Footnote-1465835 -Node: Reference to Elements465963 -Node: Assigning Elements468413 -Node: Array Example468904 -Node: Scanning an Array470662 -Node: Controlling Scanning473678 -Ref: Controlling Scanning-Footnote-1478867 -Node: Numeric Array Subscripts479183 -Node: Uninitialized Subscripts481368 -Node: Delete482985 -Ref: Delete-Footnote-1485729 -Node: Multidimensional485786 -Node: Multiscanning488881 -Node: Arrays of Arrays490470 -Node: Arrays Summary495231 -Node: Functions497336 -Node: Built-in498209 -Node: Calling Built-in499287 -Node: Numeric Functions501275 -Ref: Numeric Functions-Footnote-1505297 -Ref: Numeric Functions-Footnote-2505654 -Ref: Numeric Functions-Footnote-3505702 -Node: String Functions505971 -Ref: String Functions-Footnote-1529443 -Ref: String Functions-Footnote-2529572 -Ref: String Functions-Footnote-3529820 -Node: Gory Details529907 -Ref: table-sub-escapes531688 -Ref: table-sub-proposed533208 -Ref: table-posix-sub534572 -Ref: table-gensub-escapes536112 -Ref: Gory Details-Footnote-1536944 -Node: I/O Functions537095 -Ref: I/O Functions-Footnote-1544196 -Node: Time Functions544343 -Ref: Time Functions-Footnote-1554812 -Ref: Time Functions-Footnote-2554880 -Ref: Time Functions-Footnote-3555038 -Ref: Time Functions-Footnote-4555149 -Ref: Time Functions-Footnote-5555261 -Ref: Time Functions-Footnote-6555488 -Node: Bitwise Functions555754 -Ref: table-bitwise-ops556316 -Ref: Bitwise Functions-Footnote-1560624 -Node: Type Functions560793 -Node: I18N Functions561942 -Node: User-defined563587 -Node: Definition Syntax564391 -Ref: Definition Syntax-Footnote-1569797 -Node: Function Example569866 -Ref: Function Example-Footnote-1572783 -Node: Function Caveats572805 -Node: Calling A Function573323 -Node: Variable Scope574278 -Node: Pass By Value/Reference577266 -Node: Return Statement580776 -Node: Dynamic Typing583760 -Node: Indirect Calls584689 -Ref: Indirect Calls-Footnote-1595993 -Node: Functions Summary596121 -Node: Library Functions598820 -Ref: Library Functions-Footnote-1602438 -Ref: Library Functions-Footnote-2602581 -Node: Library Names602752 -Ref: Library Names-Footnote-1606212 -Ref: Library Names-Footnote-2606432 -Node: General Functions606518 -Node: Strtonum Function607621 -Node: Assert Function610641 -Node: Round Function613965 -Node: Cliff Random Function615506 -Node: Ordinal Functions616522 -Ref: Ordinal Functions-Footnote-1619587 -Ref: Ordinal Functions-Footnote-2619839 -Node: Join Function620050 -Ref: Join Function-Footnote-1621821 -Node: Getlocaltime Function622021 -Node: Readfile Function625762 -Node: Shell Quoting627732 -Node: Data File Management629133 -Node: Filetrans Function629765 -Node: Rewind Function633824 -Node: File Checking635209 -Ref: File Checking-Footnote-1636537 -Node: Empty Files636738 -Node: Ignoring Assigns638717 -Node: Getopt Function640268 -Ref: Getopt Function-Footnote-1651728 -Node: Passwd Functions651931 -Ref: Passwd Functions-Footnote-1660782 -Node: Group Functions660870 -Ref: Group Functions-Footnote-1668773 -Node: Walking Arrays668986 -Node: Library Functions Summary670589 -Node: Library Exercises671990 -Node: Sample Programs673270 -Node: Running Examples674040 -Node: Clones674768 -Node: Cut Program675992 -Node: Egrep Program685722 -Ref: Egrep Program-Footnote-1693226 -Node: Id Program693336 -Node: Split Program696980 -Ref: Split Program-Footnote-1700426 -Node: Tee Program700554 -Node: Uniq Program703341 -Node: Wc Program710762 -Ref: Wc Program-Footnote-1715010 -Node: Miscellaneous Programs715102 -Node: Dupword Program716315 -Node: Alarm Program718346 -Node: Translate Program723150 -Ref: Translate Program-Footnote-1727714 -Node: Labels Program727984 -Ref: Labels Program-Footnote-1731333 -Node: Word Sorting731417 -Node: History Sorting735487 -Node: Extract Program737323 -Node: Simple Sed744855 -Node: Igawk Program747917 -Ref: Igawk Program-Footnote-1762243 -Ref: Igawk Program-Footnote-2762444 -Ref: Igawk Program-Footnote-3762566 -Node: Anagram Program762681 -Node: Signature Program765743 -Node: Programs Summary766990 -Node: Programs Exercises768183 -Ref: Programs Exercises-Footnote-1772314 -Node: Advanced Features772405 -Node: Nondecimal Data774353 -Node: Array Sorting775943 -Node: Controlling Array Traversal776640 -Ref: Controlling Array Traversal-Footnote-1784971 -Node: Array Sorting Functions785089 -Ref: Array Sorting Functions-Footnote-1788981 -Node: Two-way I/O789175 -Ref: Two-way I/O-Footnote-1794119 -Ref: Two-way I/O-Footnote-2794305 -Node: TCP/IP Networking794387 -Node: Profiling797259 -Node: Advanced Features Summary804803 -Node: Internationalization806736 -Node: I18N and L10N808216 -Node: Explaining gettext808902 -Ref: Explaining gettext-Footnote-1813931 -Ref: Explaining gettext-Footnote-2814115 -Node: Programmer i18n814280 -Ref: Programmer i18n-Footnote-1819146 -Node: Translator i18n819195 -Node: String Extraction819989 -Ref: String Extraction-Footnote-1821120 -Node: Printf Ordering821206 -Ref: Printf Ordering-Footnote-1823992 -Node: I18N Portability824056 -Ref: I18N Portability-Footnote-1826505 -Node: I18N Example826568 -Ref: I18N Example-Footnote-1829368 -Node: Gawk I18N829440 -Node: I18N Summary830078 -Node: Debugger831417 -Node: Debugging832439 -Node: Debugging Concepts832880 -Node: Debugging Terms834737 -Node: Awk Debugging837312 -Node: Sample Debugging Session838204 -Node: Debugger Invocation838724 -Node: Finding The Bug840108 -Node: List of Debugger Commands846583 -Node: Breakpoint Control847915 -Node: Debugger Execution Control851607 -Node: Viewing And Changing Data854971 -Node: Execution Stack858336 -Node: Debugger Info859974 -Node: Miscellaneous Debugger Commands863991 -Node: Readline Support869183 -Node: Limitations870075 -Node: Debugging Summary872172 -Node: Arbitrary Precision Arithmetic873340 -Node: Computer Arithmetic874756 -Ref: table-numeric-ranges878357 -Ref: Computer Arithmetic-Footnote-1879216 -Node: Math Definitions879273 -Ref: table-ieee-formats882560 -Ref: Math Definitions-Footnote-1883164 -Node: MPFR features883269 -Node: FP Math Caution884940 -Ref: FP Math Caution-Footnote-1885990 -Node: Inexactness of computations886359 -Node: Inexact representation887307 -Node: Comparing FP Values888662 -Node: Errors accumulate889735 -Node: Getting Accuracy891168 -Node: Try To Round893827 -Node: Setting precision894726 -Ref: table-predefined-precision-strings895410 -Node: Setting the rounding mode897204 -Ref: table-gawk-rounding-modes897568 -Ref: Setting the rounding mode-Footnote-1901022 -Node: Arbitrary Precision Integers901201 -Ref: Arbitrary Precision Integers-Footnote-1904192 -Node: POSIX Floating Point Problems904341 -Ref: POSIX Floating Point Problems-Footnote-1908217 -Node: Floating point summary908255 -Node: Dynamic Extensions910447 -Node: Extension Intro911999 -Node: Plugin License913265 -Node: Extension Mechanism Outline914062 -Ref: figure-load-extension914490 -Ref: figure-register-new-function915970 -Ref: figure-call-new-function916974 -Node: Extension API Description918960 -Node: Extension API Functions Introduction920410 -Node: General Data Types925246 -Ref: General Data Types-Footnote-1930933 -Node: Memory Allocation Functions931232 -Ref: Memory Allocation Functions-Footnote-1934062 -Node: Constructor Functions934158 -Node: Registration Functions935892 -Node: Extension Functions936577 -Node: Exit Callback Functions938873 -Node: Extension Version String940121 -Node: Input Parsers940771 -Node: Output Wrappers950586 -Node: Two-way processors955102 -Node: Printing Messages957306 -Ref: Printing Messages-Footnote-1958383 -Node: Updating `ERRNO'958535 -Node: Requesting Values959275 -Ref: table-value-types-returned960003 -Node: Accessing Parameters960961 -Node: Symbol Table Access962192 -Node: Symbol table by name962706 -Node: Symbol table by cookie964686 -Ref: Symbol table by cookie-Footnote-1968825 -Node: Cached values968888 -Ref: Cached values-Footnote-1972392 -Node: Array Manipulation972483 -Ref: Array Manipulation-Footnote-1973581 -Node: Array Data Types973620 -Ref: Array Data Types-Footnote-1976277 -Node: Array Functions976369 -Node: Flattening Arrays980223 -Node: Creating Arrays987110 -Node: Extension API Variables991877 -Node: Extension Versioning992513 -Node: Extension API Informational Variables994414 -Node: Extension API Boilerplate995502 -Node: Finding Extensions999318 -Node: Extension Example999878 -Node: Internal File Description1000650 -Node: Internal File Ops1004717 -Ref: Internal File Ops-Footnote-11016375 -Node: Using Internal File Ops1016515 -Ref: Using Internal File Ops-Footnote-11018898 -Node: Extension Samples1019171 -Node: Extension Sample File Functions1020695 -Node: Extension Sample Fnmatch1028297 -Node: Extension Sample Fork1029779 -Node: Extension Sample Inplace1030992 -Node: Extension Sample Ord1032667 -Node: Extension Sample Readdir1033503 -Ref: table-readdir-file-types1034379 -Node: Extension Sample Revout1035190 -Node: Extension Sample Rev2way1035781 -Node: Extension Sample Read write array1036522 -Node: Extension Sample Readfile1038461 -Node: Extension Sample Time1039556 -Node: Extension Sample API Tests1040905 -Node: gawkextlib1041396 -Node: Extension summary1044046 -Node: Extension Exercises1047728 -Node: Language History1048450 -Node: V7/SVR3.11050107 -Node: SVR41052288 -Node: POSIX1053733 -Node: BTL1055122 -Node: POSIX/GNU1055856 -Node: Feature History1061425 -Node: Common Extensions1074523 -Node: Ranges and Locales1075847 -Ref: Ranges and Locales-Footnote-11080486 -Ref: Ranges and Locales-Footnote-21080513 -Ref: Ranges and Locales-Footnote-31080747 -Node: Contributors1080968 -Node: History summary1086508 -Node: Installation1087877 -Node: Gawk Distribution1088833 -Node: Getting1089317 -Node: Extracting1090141 -Node: Distribution contents1091783 -Node: Unix Installation1097500 -Node: Quick Installation1098117 -Node: Additional Configuration Options1100548 -Node: Configuration Philosophy1102288 -Node: Non-Unix Installation1104639 -Node: PC Installation1105097 -Node: PC Binary Installation1106423 -Node: PC Compiling1108271 -Ref: PC Compiling-Footnote-11111292 -Node: PC Testing1111397 -Node: PC Using1112573 -Node: Cygwin1116688 -Node: MSYS1117511 -Node: VMS Installation1118009 -Node: VMS Compilation1118801 -Ref: VMS Compilation-Footnote-11120023 -Node: VMS Dynamic Extensions1120081 -Node: VMS Installation Details1121765 -Node: VMS Running1124017 -Node: VMS GNV1126858 -Node: VMS Old Gawk1127592 -Node: Bugs1128062 -Node: Other Versions1131966 -Node: Installation summary1138179 -Node: Notes1139235 -Node: Compatibility Mode1140100 -Node: Additions1140882 -Node: Accessing The Source1141807 -Node: Adding Code1143243 -Node: New Ports1149415 -Node: Derived Files1153897 -Ref: Derived Files-Footnote-11159372 -Ref: Derived Files-Footnote-21159406 -Ref: Derived Files-Footnote-31160002 -Node: Future Extensions1160116 -Node: Implementation Limitations1160722 -Node: Extension Design1161970 -Node: Old Extension Problems1163124 -Ref: Old Extension Problems-Footnote-11164641 -Node: Extension New Mechanism Goals1164698 -Ref: Extension New Mechanism Goals-Footnote-11168058 -Node: Extension Other Design Decisions1168247 -Node: Extension Future Growth1170355 -Node: Old Extension Mechanism1171191 -Node: Notes summary1172953 -Node: Basic Concepts1174139 -Node: Basic High Level1174820 -Ref: figure-general-flow1175092 -Ref: figure-process-flow1175691 -Ref: Basic High Level-Footnote-11178920 -Node: Basic Data Typing1179105 -Node: Glossary1182433 -Node: Copying1207591 -Node: GNU Free Documentation License1245147 -Node: Index1270283 +Node: Foreword446598 +Node: Preface48031 +Ref: Preface-Footnote-150902 +Ref: Preface-Footnote-251009 +Ref: Preface-Footnote-351242 +Node: History51384 +Node: Names53730 +Ref: Names-Footnote-154824 +Node: This Manual54970 +Ref: This Manual-Footnote-161457 +Node: Conventions61557 +Node: Manual History63895 +Ref: Manual History-Footnote-166877 +Ref: Manual History-Footnote-266918 +Node: How To Contribute66992 +Node: Acknowledgments68121 +Node: Getting Started72925 +Node: Running gawk75358 +Node: One-shot76548 +Node: Read Terminal77796 +Node: Long79823 +Node: Executable Scripts81339 +Ref: Executable Scripts-Footnote-184128 +Node: Comments84231 +Node: Quoting86713 +Node: DOS Quoting92237 +Node: Sample Data Files92912 +Node: Very Simple95507 +Node: Two Rules100405 +Node: More Complex102291 +Node: Statements/Lines105153 +Ref: Statements/Lines-Footnote-1109608 +Node: Other Features109873 +Node: When110804 +Ref: When-Footnote-1112558 +Node: Intro Summary112623 +Node: Invoking Gawk113506 +Node: Command Line115020 +Node: Options115818 +Ref: Options-Footnote-1131749 +Node: Other Arguments131774 +Node: Naming Standard Input134722 +Node: Environment Variables135815 +Node: AWKPATH Variable136373 +Ref: AWKPATH Variable-Footnote-1139676 +Ref: AWKPATH Variable-Footnote-2139721 +Node: AWKLIBPATH Variable139981 +Node: Other Environment Variables141124 +Node: Exit Status144852 +Node: Include Files145528 +Node: Loading Shared Libraries149125 +Node: Obsolete150552 +Node: Undocumented151249 +Node: Invoking Summary151516 +Node: Regexp153180 +Node: Regexp Usage154634 +Node: Escape Sequences156671 +Node: Regexp Operators162682 +Ref: Regexp Operators-Footnote-1170108 +Ref: Regexp Operators-Footnote-2170255 +Node: Bracket Expressions170353 +Ref: table-char-classes172368 +Node: Leftmost Longest175292 +Node: Computed Regexps176594 +Node: GNU Regexp Operators179991 +Node: Case-sensitivity183664 +Ref: Case-sensitivity-Footnote-1186549 +Ref: Case-sensitivity-Footnote-2186784 +Node: Regexp Summary186892 +Node: Reading Files188359 +Node: Records190453 +Node: awk split records191186 +Node: gawk split records196101 +Ref: gawk split records-Footnote-1200641 +Node: Fields200678 +Ref: Fields-Footnote-1203454 +Node: Nonconstant Fields203540 +Ref: Nonconstant Fields-Footnote-1205783 +Node: Changing Fields205987 +Node: Field Separators211916 +Node: Default Field Splitting214621 +Node: Regexp Field Splitting215738 +Node: Single Character Fields219088 +Node: Command Line Field Separator220147 +Node: Full Line Fields223359 +Ref: Full Line Fields-Footnote-1224888 +Ref: Full Line Fields-Footnote-2224934 +Node: Field Splitting Summary225035 +Node: Constant Size227109 +Node: Splitting By Content231698 +Ref: Splitting By Content-Footnote-1235753 +Node: Multiple Line235793 +Ref: Multiple Line-Footnote-1241679 +Node: Getline241858 +Node: Plain Getline244070 +Node: Getline/Variable246710 +Node: Getline/File247858 +Node: Getline/Variable/File249242 +Ref: Getline/Variable/File-Footnote-1250845 +Node: Getline/Pipe250932 +Node: Getline/Variable/Pipe253615 +Node: Getline/Coprocess254746 +Node: Getline/Variable/Coprocess255998 +Node: Getline Notes256737 +Node: Getline Summary259529 +Ref: table-getline-variants259941 +Node: Read Timeout260770 +Ref: Read Timeout-Footnote-1264589 +Node: Command-line directories264647 +Node: Input Summary265552 +Node: Input Exercises268805 +Node: Printing269533 +Node: Print271310 +Node: Print Examples272767 +Node: Output Separators275546 +Node: OFMT277564 +Node: Printf278918 +Node: Basic Printf279703 +Node: Control Letters281272 +Node: Format Modifiers285256 +Node: Printf Examples291257 +Node: Redirection293743 +Node: Special FD300584 +Ref: Special FD-Footnote-1303744 +Node: Special Files303818 +Node: Other Inherited Files304435 +Node: Special Network305435 +Node: Special Caveats306297 +Node: Close Files And Pipes307248 +Ref: Close Files And Pipes-Footnote-1314430 +Ref: Close Files And Pipes-Footnote-2314578 +Node: Output Summary314728 +Node: Output Exercises315726 +Node: Expressions316406 +Node: Values317591 +Node: Constants318269 +Node: Scalar Constants318960 +Ref: Scalar Constants-Footnote-1319819 +Node: Nondecimal-numbers320069 +Node: Regexp Constants323087 +Node: Using Constant Regexps323612 +Node: Variables326755 +Node: Using Variables327410 +Node: Assignment Options329321 +Node: Conversion331196 +Node: Strings And Numbers331720 +Ref: Strings And Numbers-Footnote-1334785 +Node: Locale influences conversions334894 +Ref: table-locale-affects337641 +Node: All Operators338229 +Node: Arithmetic Ops338859 +Node: Concatenation341364 +Ref: Concatenation-Footnote-1344183 +Node: Assignment Ops344289 +Ref: table-assign-ops349268 +Node: Increment Ops350540 +Node: Truth Values and Conditions353978 +Node: Truth Values355063 +Node: Typing and Comparison356112 +Node: Variable Typing356922 +Node: Comparison Operators360575 +Ref: table-relational-ops360985 +Node: POSIX String Comparison364480 +Ref: POSIX String Comparison-Footnote-1365552 +Node: Boolean Ops365690 +Ref: Boolean Ops-Footnote-1370169 +Node: Conditional Exp370260 +Node: Function Calls371987 +Node: Precedence375867 +Node: Locales379528 +Node: Expressions Summary381160 +Node: Patterns and Actions383720 +Node: Pattern Overview384840 +Node: Regexp Patterns386519 +Node: Expression Patterns387062 +Node: Ranges390843 +Node: BEGIN/END393949 +Node: Using BEGIN/END394710 +Ref: Using BEGIN/END-Footnote-1397444 +Node: I/O And BEGIN/END397550 +Node: BEGINFILE/ENDFILE399864 +Node: Empty402765 +Node: Using Shell Variables403082 +Node: Action Overview405355 +Node: Statements407681 +Node: If Statement409529 +Node: While Statement411024 +Node: Do Statement413053 +Node: For Statement414197 +Node: Switch Statement417354 +Node: Break Statement419736 +Node: Continue Statement421777 +Node: Next Statement423604 +Node: Nextfile Statement425985 +Node: Exit Statement428615 +Node: Built-in Variables431018 +Node: User-modified432151 +Ref: User-modified-Footnote-1439832 +Node: Auto-set439894 +Ref: Auto-set-Footnote-1452929 +Ref: Auto-set-Footnote-2453134 +Node: ARGC and ARGV453190 +Node: Pattern Action Summary457408 +Node: Arrays459835 +Node: Array Basics461164 +Node: Array Intro462008 +Ref: figure-array-elements463972 +Ref: Array Intro-Footnote-1466498 +Node: Reference to Elements466626 +Node: Assigning Elements469078 +Node: Array Example469569 +Node: Scanning an Array471327 +Node: Controlling Scanning474343 +Ref: Controlling Scanning-Footnote-1479539 +Node: Numeric Array Subscripts479855 +Node: Uninitialized Subscripts482040 +Node: Delete483657 +Ref: Delete-Footnote-1486400 +Node: Multidimensional486457 +Node: Multiscanning489554 +Node: Arrays of Arrays491143 +Node: Arrays Summary495902 +Node: Functions497994 +Node: Built-in498867 +Node: Calling Built-in499945 +Node: Numeric Functions501936 +Ref: Numeric Functions-Footnote-1505953 +Ref: Numeric Functions-Footnote-2506310 +Ref: Numeric Functions-Footnote-3506358 +Node: String Functions506630 +Ref: String Functions-Footnote-1530105 +Ref: String Functions-Footnote-2530234 +Ref: String Functions-Footnote-3530482 +Node: Gory Details530569 +Ref: table-sub-escapes532350 +Ref: table-sub-proposed533870 +Ref: table-posix-sub535234 +Ref: table-gensub-escapes536770 +Ref: Gory Details-Footnote-1537602 +Node: I/O Functions537753 +Ref: I/O Functions-Footnote-1544971 +Node: Time Functions545118 +Ref: Time Functions-Footnote-1555606 +Ref: Time Functions-Footnote-2555674 +Ref: Time Functions-Footnote-3555832 +Ref: Time Functions-Footnote-4555943 +Ref: Time Functions-Footnote-5556055 +Ref: Time Functions-Footnote-6556282 +Node: Bitwise Functions556548 +Ref: table-bitwise-ops557110 +Ref: Bitwise Functions-Footnote-1561419 +Node: Type Functions561588 +Node: I18N Functions562739 +Node: User-defined564384 +Node: Definition Syntax565189 +Ref: Definition Syntax-Footnote-1570596 +Node: Function Example570667 +Ref: Function Example-Footnote-1573586 +Node: Function Caveats573608 +Node: Calling A Function574126 +Node: Variable Scope575084 +Node: Pass By Value/Reference578072 +Node: Return Statement581567 +Node: Dynamic Typing584548 +Node: Indirect Calls585477 +Ref: Indirect Calls-Footnote-1596779 +Node: Functions Summary596907 +Node: Library Functions599609 +Ref: Library Functions-Footnote-1603218 +Ref: Library Functions-Footnote-2603361 +Node: Library Names603532 +Ref: Library Names-Footnote-1606986 +Ref: Library Names-Footnote-2607209 +Node: General Functions607295 +Node: Strtonum Function608398 +Node: Assert Function611420 +Node: Round Function614744 +Node: Cliff Random Function616285 +Node: Ordinal Functions617301 +Ref: Ordinal Functions-Footnote-1620364 +Ref: Ordinal Functions-Footnote-2620616 +Node: Join Function620827 +Ref: Join Function-Footnote-1622596 +Node: Getlocaltime Function622796 +Node: Readfile Function626540 +Node: Shell Quoting628510 +Node: Data File Management629911 +Node: Filetrans Function630543 +Node: Rewind Function634599 +Node: File Checking635986 +Ref: File Checking-Footnote-1637318 +Node: Empty Files637519 +Node: Ignoring Assigns639498 +Node: Getopt Function641049 +Ref: Getopt Function-Footnote-1652511 +Node: Passwd Functions652711 +Ref: Passwd Functions-Footnote-1661560 +Node: Group Functions661648 +Ref: Group Functions-Footnote-1669542 +Node: Walking Arrays669755 +Node: Library Functions Summary671358 +Node: Library Exercises672759 +Node: Sample Programs674039 +Node: Running Examples674809 +Node: Clones675537 +Node: Cut Program676761 +Node: Egrep Program686480 +Ref: Egrep Program-Footnote-1693978 +Node: Id Program694088 +Node: Split Program697733 +Ref: Split Program-Footnote-1701181 +Node: Tee Program701309 +Node: Uniq Program704098 +Node: Wc Program711517 +Ref: Wc Program-Footnote-1715767 +Node: Miscellaneous Programs715861 +Node: Dupword Program717074 +Node: Alarm Program719105 +Node: Translate Program723909 +Ref: Translate Program-Footnote-1728474 +Node: Labels Program728744 +Ref: Labels Program-Footnote-1732095 +Node: Word Sorting732179 +Node: History Sorting736250 +Node: Extract Program738086 +Node: Simple Sed745611 +Node: Igawk Program748679 +Ref: Igawk Program-Footnote-1763003 +Ref: Igawk Program-Footnote-2763204 +Ref: Igawk Program-Footnote-3763326 +Node: Anagram Program763441 +Node: Signature Program766498 +Node: Programs Summary767745 +Node: Programs Exercises768938 +Ref: Programs Exercises-Footnote-1773069 +Node: Advanced Features773160 +Node: Nondecimal Data775108 +Node: Array Sorting776698 +Node: Controlling Array Traversal777395 +Ref: Controlling Array Traversal-Footnote-1785728 +Node: Array Sorting Functions785846 +Ref: Array Sorting Functions-Footnote-1789735 +Node: Two-way I/O789931 +Ref: Two-way I/O-Footnote-1794872 +Ref: Two-way I/O-Footnote-2795058 +Node: TCP/IP Networking795140 +Node: Profiling798013 +Node: Advanced Features Summary805560 +Node: Internationalization807493 +Node: I18N and L10N808973 +Node: Explaining gettext809659 +Ref: Explaining gettext-Footnote-1814684 +Ref: Explaining gettext-Footnote-2814868 +Node: Programmer i18n815033 +Ref: Programmer i18n-Footnote-1819899 +Node: Translator i18n819948 +Node: String Extraction820742 +Ref: String Extraction-Footnote-1821873 +Node: Printf Ordering821959 +Ref: Printf Ordering-Footnote-1824745 +Node: I18N Portability824809 +Ref: I18N Portability-Footnote-1827264 +Node: I18N Example827327 +Ref: I18N Example-Footnote-1830130 +Node: Gawk I18N830202 +Node: I18N Summary830840 +Node: Debugger832179 +Node: Debugging833201 +Node: Debugging Concepts833642 +Node: Debugging Terms835495 +Node: Awk Debugging838067 +Node: Sample Debugging Session838961 +Node: Debugger Invocation839481 +Node: Finding The Bug840865 +Node: List of Debugger Commands847340 +Node: Breakpoint Control848673 +Node: Debugger Execution Control852369 +Node: Viewing And Changing Data855733 +Node: Execution Stack859111 +Node: Debugger Info860748 +Node: Miscellaneous Debugger Commands864765 +Node: Readline Support869794 +Node: Limitations870686 +Node: Debugging Summary872800 +Node: Arbitrary Precision Arithmetic873968 +Node: Computer Arithmetic875384 +Ref: table-numeric-ranges878982 +Ref: Computer Arithmetic-Footnote-1879841 +Node: Math Definitions879898 +Ref: table-ieee-formats883186 +Ref: Math Definitions-Footnote-1883790 +Node: MPFR features883895 +Node: FP Math Caution885566 +Ref: FP Math Caution-Footnote-1886616 +Node: Inexactness of computations886985 +Node: Inexact representation887944 +Node: Comparing FP Values889301 +Node: Errors accumulate890383 +Node: Getting Accuracy891816 +Node: Try To Round894478 +Node: Setting precision895377 +Ref: table-predefined-precision-strings896061 +Node: Setting the rounding mode897850 +Ref: table-gawk-rounding-modes898214 +Ref: Setting the rounding mode-Footnote-1901669 +Node: Arbitrary Precision Integers901848 +Ref: Arbitrary Precision Integers-Footnote-1904834 +Node: POSIX Floating Point Problems904983 +Ref: POSIX Floating Point Problems-Footnote-1908856 +Node: Floating point summary908894 +Node: Dynamic Extensions911088 +Node: Extension Intro912640 +Node: Plugin License913906 +Node: Extension Mechanism Outline914703 +Ref: figure-load-extension915131 +Ref: figure-register-new-function916611 +Ref: figure-call-new-function917615 +Node: Extension API Description919601 +Node: Extension API Functions Introduction921051 +Node: General Data Types925875 +Ref: General Data Types-Footnote-1931614 +Node: Memory Allocation Functions931913 +Ref: Memory Allocation Functions-Footnote-1934752 +Node: Constructor Functions934848 +Node: Registration Functions936582 +Node: Extension Functions937267 +Node: Exit Callback Functions939564 +Node: Extension Version String940812 +Node: Input Parsers941477 +Node: Output Wrappers951354 +Node: Two-way processors955869 +Node: Printing Messages958073 +Ref: Printing Messages-Footnote-1959149 +Node: Updating `ERRNO'959301 +Node: Requesting Values960041 +Ref: table-value-types-returned960769 +Node: Accessing Parameters961726 +Node: Symbol Table Access962957 +Node: Symbol table by name963471 +Node: Symbol table by cookie965452 +Ref: Symbol table by cookie-Footnote-1969596 +Node: Cached values969659 +Ref: Cached values-Footnote-1973158 +Node: Array Manipulation973249 +Ref: Array Manipulation-Footnote-1974347 +Node: Array Data Types974384 +Ref: Array Data Types-Footnote-1977039 +Node: Array Functions977131 +Node: Flattening Arrays980985 +Node: Creating Arrays987877 +Node: Extension API Variables992646 +Node: Extension Versioning993282 +Node: Extension API Informational Variables995183 +Node: Extension API Boilerplate996271 +Node: Finding Extensions1000080 +Node: Extension Example1000640 +Node: Internal File Description1001412 +Node: Internal File Ops1005479 +Ref: Internal File Ops-Footnote-11017149 +Node: Using Internal File Ops1017289 +Ref: Using Internal File Ops-Footnote-11019672 +Node: Extension Samples1019945 +Node: Extension Sample File Functions1021471 +Node: Extension Sample Fnmatch1029109 +Node: Extension Sample Fork1030600 +Node: Extension Sample Inplace1031815 +Node: Extension Sample Ord1033490 +Node: Extension Sample Readdir1034326 +Ref: table-readdir-file-types1035202 +Node: Extension Sample Revout1036013 +Node: Extension Sample Rev2way1036603 +Node: Extension Sample Read write array1037343 +Node: Extension Sample Readfile1039283 +Node: Extension Sample Time1040378 +Node: Extension Sample API Tests1041727 +Node: gawkextlib1042218 +Node: Extension summary1044855 +Node: Extension Exercises1048532 +Node: Language History1049254 +Node: V7/SVR3.11050910 +Node: SVR41053091 +Node: POSIX1054536 +Node: BTL1055925 +Node: POSIX/GNU1056659 +Node: Feature History1062223 +Node: Common Extensions1075321 +Node: Ranges and Locales1076645 +Ref: Ranges and Locales-Footnote-11081263 +Ref: Ranges and Locales-Footnote-21081290 +Ref: Ranges and Locales-Footnote-31081524 +Node: Contributors1081745 +Node: History summary1087286 +Node: Installation1088656 +Node: Gawk Distribution1089602 +Node: Getting1090086 +Node: Extracting1090909 +Node: Distribution contents1092544 +Node: Unix Installation1098261 +Node: Quick Installation1098878 +Node: Additional Configuration Options1101302 +Node: Configuration Philosophy1103040 +Node: Non-Unix Installation1105409 +Node: PC Installation1105867 +Node: PC Binary Installation1107186 +Node: PC Compiling1109034 +Ref: PC Compiling-Footnote-11112055 +Node: PC Testing1112164 +Node: PC Using1113340 +Node: Cygwin1117455 +Node: MSYS1118278 +Node: VMS Installation1118778 +Node: VMS Compilation1119570 +Ref: VMS Compilation-Footnote-11120792 +Node: VMS Dynamic Extensions1120850 +Node: VMS Installation Details1122534 +Node: VMS Running1124786 +Node: VMS GNV1127622 +Node: VMS Old Gawk1128356 +Node: Bugs1128826 +Node: Other Versions1132709 +Node: Installation summary1139131 +Node: Notes1140187 +Node: Compatibility Mode1141052 +Node: Additions1141834 +Node: Accessing The Source1142759 +Node: Adding Code1144195 +Node: New Ports1150360 +Node: Derived Files1154842 +Ref: Derived Files-Footnote-11160317 +Ref: Derived Files-Footnote-21160351 +Ref: Derived Files-Footnote-31160947 +Node: Future Extensions1161061 +Node: Implementation Limitations1161667 +Node: Extension Design1162915 +Node: Old Extension Problems1164069 +Ref: Old Extension Problems-Footnote-11165586 +Node: Extension New Mechanism Goals1165643 +Ref: Extension New Mechanism Goals-Footnote-11169003 +Node: Extension Other Design Decisions1169192 +Node: Extension Future Growth1171300 +Node: Old Extension Mechanism1172136 +Node: Notes summary1173898 +Node: Basic Concepts1175084 +Node: Basic High Level1175765 +Ref: figure-general-flow1176037 +Ref: figure-process-flow1176636 +Ref: Basic High Level-Footnote-11179865 +Node: Basic Data Typing1180050 +Node: Glossary1183378 +Node: Copying1208536 +Node: GNU Free Documentation License1246092 +Node: Index1271228  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 52fd2003..7573c993 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -56,7 +56,7 @@ @set PATCHLEVEL 2 @ifset FOR_PRINT -@set TITLE Effective AWK Programming +@set TITLE Effective Awk Programming @end ifset @ifclear FOR_PRINT @set TITLE GAWK: Effective AWK Programming @@ -175,12 +175,24 @@ @macro DBREF{text} @ref{\text\} @end macro +@macro DBXREF{text} +@xref{\text\} +@end macro +@macro DBPXREF{text} +@pxref{\text\} +@end macro @end ifdocbook @ifnotdocbook @macro DBREF{text} @ref{\text\}, @end macro +@macro DBXREF{text} +@xref{\text\}, +@end macro +@macro DBPXREF{text} +@pxref{\text\}, +@end macro @end ifnotdocbook @ifclear FOR_PRINT @@ -315,7 +327,7 @@ A copy of the license is included in the section entitled A copy of the license may be found on the Internet at @uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html, -the GNU Project's web site}. +the GNU Project's website}. @end ifset @enumerate a @@ -383,10 +395,10 @@ ISBN 1-882114-28-0 @* @sp 9 @center @i{To my parents, for their love, and for the wonderful example they set for me.} @sp 1 -@center @i{To my wife Miriam, for making me complete. +@center @i{To my wife, Miriam, for making me complete. Thank you for building your life together with me.} @sp 1 -@center @i{To our children Chana, Rivka, Nachum and Malka, for enrichening our lives in innumerable ways.} +@center @i{To our children, Chana, Rivka, Nachum, and Malka, for enrichening our lives in innumerable ways.} @sp 1 @w{ } @page @@ -1075,7 +1087,7 @@ for enrichening our lives in innumerable ways. Author of mawk - March, 2001 + March 2001 @end docbook @@ -1087,21 +1099,23 @@ The circumstances started a couple of years earlier. I was working at a new job and noticed an unplugged Unix computer sitting in the corner. No one knew how to use it, and neither did I. However, -a couple of days later it was running, and +a couple of days later, it was running, and I was @code{root} and the one-and-only user. That day, I began the transition from statistician to Unix programmer. On one of many trips to the library or bookstore in search of -books on Unix, I found the gray AWK book, a.k.a.@: Aho, Kernighan and -Weinberger, @cite{The AWK Programming Language}, Addison-Wesley, -1988. AWK's simple programming paradigm---find a pattern in the +books on Unix, I found the gray AWK book, a.k.a.@: +Alfred V.@: Aho, Brian W.@: Kernighan, and +Peter J.@: Weinberger's @cite{The AWK Programming Language} (Addison-Wesley, +1988). @command{awk}'s simple programming paradigm---find a pattern in the input and then perform an action---often reduced complex or tedious data manipulations to a few lines of code. I was excited to try my hand at programming in AWK. Alas, the @command{awk} on my computer was a limited version of the -language described in the AWK book. I discovered that my computer -had ``old @command{awk}'' and the AWK book described ``new @command{awk}.'' +language described in the gray book. I discovered that my computer +had ``old @command{awk}'' and the book described +``new @command{awk}.'' I learned that this was typical; the old version refused to step aside or relinquish its name. If a system had a new @command{awk}, it was invariably called @command{nawk}, and few systems had it. @@ -1119,7 +1133,7 @@ My Unix system started out unplugged from the wall; it certainly was not plugged into a network. So, oblivious to the existence of @command{gawk} and the Unix community in general, and desiring a new @command{awk}, I wrote my own, called @command{mawk}. -Before I was finished I knew about @command{gawk}, +Before I was finished, I knew about @command{gawk}, but it was too late to stop, so I eventually posted to a @code{comp.sources} newsgroup. @@ -1128,7 +1142,7 @@ from Arnold introducing himself. He suggested we share design and algorithms and attached a draft of the POSIX standard so that I could update @command{mawk} to support language extensions added -after publication of the AWK book. +after publication of @cite{The AWK Programming Language}. Frankly, if our roles had been reversed, I would not have been so open and we probably would @@ -1147,7 +1161,7 @@ standard. On the other hand, the novice AWK programmer can study a wealth of practical programs that emphasize the power of AWK's basic idioms: -data driven control-flow, pattern matching with regular expressions, +data-driven control flow, pattern matching with regular expressions, and associative arrays. Those looking for something new can try out @command{gawk}'s interface to network protocols via special @file{/inet} files. @@ -1208,7 +1222,7 @@ AWK or want to learn how, then read this book. @display Michael Brennan Author of @command{mawk} -March, 2001 +March 2001 @end display @end ifnotdocbook @@ -1226,7 +1240,7 @@ March, 2001 Author of mawk - October, 2014 + October 2014 @end docbook @@ -1260,7 +1274,7 @@ details, and as expected, many examples to help you learn the ins and outs. @display Michael Brennan Author of @command{mawk} -October, 2014 +October 2014 @end display @end ifnotdocbook @@ -1280,9 +1294,9 @@ October, 2014 Arnold Robbins Nof Ayalon - ISRAEL + Israel - December, 2014 + December 2014 @end docbook @@ -1294,7 +1308,7 @@ The @command{awk} utility interprets a special-purpose programming language that makes it easy to handle simple data-reformatting jobs. The GNU implementation of @command{awk} is called @command{gawk}; if you -invoke it with the proper options or environment variables +invoke it with the proper options or environment variables, it is fully compatible with the POSIX@footnote{The 2008 POSIX standard is accessible online at @w{@url{http://www.opengroup.org/onlinepubs/9699919799/}.}} @@ -1401,10 +1415,10 @@ has been removed.} @unnumberedsec History of @command{awk} and @command{gawk} @cindex recipe for a programming language @cindex programming language, recipe for -@cindex sidebar, Recipe For A Programming Language +@cindex sidebar, Recipe for a Programming Language @ifdocbook @docbook -Recipe For A Programming Language +Recipe for a Programming Language @end docbook @@ -1426,7 +1440,7 @@ more parts C. Document very well and release. @ifnotdocbook @cartouche -@center @b{Recipe For A Programming Language} +@center @b{Recipe for a Programming Language} @@ -1448,7 +1462,7 @@ more parts C. Document very well and release. @cindex Kernighan, Brian @cindex @command{awk}, history of The name @command{awk} comes from the initials of its designers: Alfred V.@: -Aho, Peter J.@: Weinberger and Brian W.@: Kernighan. The original version of +Aho, Peter J.@: Weinberger, and Brian W.@: Kernighan. The original version of @command{awk} was written in 1977 at AT&T Bell Laboratories. In 1985, a new version made the programming language more powerful, introducing user-defined functions, multiple input @@ -1474,7 +1488,7 @@ Circa 1994, I became the primary maintainer. Current development focuses on bug fixes, performance improvements, standards compliance and, occasionally, new features. -In May of 1997, J@"urgen Kahrs felt the need for network access +In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding features to do this for @command{gawk}. At that time, he also wrote the bulk of @@ -1487,7 +1501,7 @@ John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as @command{gawk} @value{PVERSION} 4.0, in 2011. -@xref{Contributors}, +@DBXREF{Contributors} for a full list of those who made important contributions to @command{gawk}. @node Names @@ -1497,7 +1511,7 @@ for a full list of those who made important contributions to @command{gawk}. The @command{awk} language has evolved over the years. Full details are provided in @ref{Language History}. The language described in this @value{DOCUMENT} -is often referred to as ``new @command{awk}''. +is often referred to as ``new @command{awk}.'' By analogy, the original version of @command{awk} is referred to as ``old @command{awk}.'' @@ -1576,12 +1590,15 @@ Most of the time, the examples use complete @command{awk} programs. Some of the more advanced sections show only the part of the @command{awk} program that illustrates the concept being described. -While this @value{DOCUMENT} is aimed principally at people who have not been +Although this @value{DOCUMENT} is aimed principally at people who have not been exposed to @command{awk}, there is a lot of information here that even the @command{awk} expert should find useful. In particular, the description of POSIX @command{awk} and the example programs in -@ref{Library Functions}, and in +@ref{Library Functions}, and +@ifnotdocbook +in +@end ifnotdocbook @ref{Sample Programs}, should be of interest. @@ -1589,22 +1606,30 @@ This @value{DOCUMENT} is split into several parts, as follows: @c FULLXREF ON +@itemize @value{BULLET} +@item Part I describes the @command{awk} language and @command{gawk} program in detail. It starts with the basics, and continues through all of the features of @command{awk}. It contains the following chapters: +@c nested +@itemize @value{MINUS} +@item @ref{Getting Started}, provides the essentials you need to know to begin using @command{awk}. +@item @ref{Invoking Gawk}, describes how to run @command{gawk}, the meaning of its command-line options, and how it finds @command{awk} program source files. +@item @ref{Regexp}, introduces regular expressions in general, and in particular the flavors supported by POSIX @command{awk} and @command{gawk}. +@item @ref{Reading Files}, describes how @command{awk} reads your data. It introduces the concepts of records and fields, as well @@ -1612,46 +1637,62 @@ as the @code{getline} command. I/O redirection is first described here. Network I/O is also briefly introduced here. +@item @ref{Printing}, describes how @command{awk} programs can produce output with @code{print} and @code{printf}. +@item @ref{Expressions}, describes expressions, which are the basic building blocks for getting most things done in a program. +@item @ref{Patterns and Actions}, describes how to write patterns for matching records, actions for doing something when a record is matched, and the predefined variables @command{awk} and @command{gawk} use. +@item @ref{Arrays}, covers @command{awk}'s one-and-only data structure: associative arrays. Deleting array elements and whole arrays is also described, as well as sorting arrays in @command{gawk}. It also describes how @command{gawk} provides arrays of arrays. +@item @ref{Functions}, describes the built-in functions @command{awk} and @command{gawk} provide, as well as how to define your own functions. It also discusses how @command{gawk} lets you call functions indirectly. +@end itemize +@item Part II shows how to use @command{awk} and @command{gawk} for problem solving. There is lots of code here for you to read and learn from. It contains the following chapters: +@c nested +@itemize @value{MINUS} +@item @ref{Library Functions}, which provides a number of functions meant to be used from main @command{awk} programs. +@item @ref{Sample Programs}, which provides many sample @command{awk} programs. +@end itemize Reading these two chapters allows you to see @command{awk} solving real problems. +@item Part III focuses on features specific to @command{gawk}. It contains the following chapters: +@c nested +@itemize @value{MINUS} +@item @ref{Advanced Features}, describes a number of advanced features. Of particular note @@ -1660,18 +1701,24 @@ have two-way communications with another process, perform TCP/IP networking, and profile your @command{awk} programs. +@item @ref{Internationalization}, describes special features for translating program messages into different languages at runtime. +@item @ref{Debugger}, describes the @command{gawk} debugger. +@item @ref{Arbitrary Precision Arithmetic}, describes advanced arithmetic facilities. +@item @ref{Dynamic Extensions}, describes how to add new variables and functions to @command{gawk} by writing extensions in C or C++. +@end itemize +@item @ifclear FOR_PRINT Part IV provides the appendices, the Glossary, and two licenses that cover the @command{gawk} source code and this @value{DOCUMENT}, respectively. @@ -1682,11 +1729,14 @@ Part IV provides the following appendices, including the GNU General Public License: @end ifset +@itemize @value{MINUS} +@item @ref{Language History}, describes how the @command{awk} language has evolved since its first release to present. It also describes how @command{gawk} has acquired features over time. +@item @ref{Installation}, describes how to get @command{gawk}, how to compile it on POSIX-compatible systems, @@ -1694,17 +1744,22 @@ and how to compile and use it on different non-POSIX systems. It also describes how to report bugs in @command{gawk} and where to get other freely available @command{awk} implementations. +@end itemize @ifset FOR_PRINT - +@itemize @value{MINUS} +@item @ref{Copying}, presents the license that covers the @command{gawk} source code. +@end itemize The version of this @value{DOCUMENT} distributed with @command{gawk} contains additional appendices and other end material. To save space, we have omitted them from the printed edition. You may find them online, as follows: +@itemize @value{BULLET} +@item @uref{http://www.gnu.org/software/gawk/manual/html_node/Notes.html, The appendix on implementation notes} describes how to disable @command{gawk}'s extensions, how to contribute @@ -1712,44 +1767,54 @@ new code to @command{gawk}, where to find information on some possible future directions for @command{gawk} development, and the design decisions behind the extension API. +@item @uref{http://www.gnu.org/software/gawk/manual/html_node/Basic-Concepts.html, The appendix on basic concepts} provides some very cursory background material for those who are completely unfamiliar with computer programming. +@item @uref{http://www.gnu.org/software/gawk/manual/html_node/Glossary.html, The Glossary} -defines most, if not all, the significant terms used +defines most, if not all of, the significant terms used throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. +@item @uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html, The GNU FDL} is the license that covers this @value{DOCUMENT}. +@end itemize Some of the chapters have exercise sections; these have also been omitted from the print edition but are available online. @end ifset @ifclear FOR_PRINT +@itemize @value{MINUS} +@item @ref{Notes}, describes how to disable @command{gawk}'s extensions, as well as how to contribute new code to @command{gawk}, and some possible future directions for @command{gawk} development. +@item @ref{Basic Concepts}, provides some very cursory background material for those who are completely unfamiliar with computer programming. -The @ref{Glossary}, defines most, if not all, the significant terms used +The @ref{Glossary}, defines most, if not all of, the significant terms used throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. +@item @ref{Copying}, and @ref{GNU Free Documentation License}, present the licenses that cover the @command{gawk} source code and this @value{DOCUMENT}, respectively. +@end itemize @end ifclear +@end itemize @c FULLXREF OFF @@ -1812,7 +1877,7 @@ pressing the @kbd{d} key and finally releasing both keys. For the sake of brevity, throughout this @value{DOCUMENT}, we refer to Brian Kernighan's version of @command{awk} as ``BWK @command{awk}.'' -(@xref{Other Versions}, for information on his and other versions.) +(@DBXREF{Other Versions} for information on his and other versions.) @ifset FOR_PRINT @quotation NOTE @@ -1828,7 +1893,7 @@ Cautionary or warning notes look like this. @unnumberedsubsec Dark Corners @cindex Kernighan, Brian @quotation -@i{Dark corners are basically fractal --- no matter how much +@i{Dark corners are basically fractal---no matter how much you illuminate, there's always a smaller but darker one.} @author Brian Kernighan @end quotation @@ -1898,7 +1963,7 @@ The GPL applies to the C language source code for @command{gawk}. To find out more about the FSF and the GNU Project online, see @uref{http://www.gnu.org, the GNU Project's home page}. This @value{DOCUMENT} may also be read from -@uref{http://www.gnu.org/software/gawk/manual/, their web site}. +@uref{http://www.gnu.org/software/gawk/manual/, GNU's website}. @ifclear FOR_PRINT A shell, an editor (Emacs), highly portable optimizing C, C++, and @@ -1935,10 +2000,10 @@ License in @ref{GNU Free Documentation License}.) @cindex Close, Diane The @value{DOCUMENT} itself has gone through multiple previous editions. Paul Rubin wrote the very first draft of @cite{The GAWK Manual}; -it was around 40 pages in size. +it was around 40 pages long. Diane Close and Richard Stallman improved it, yielding a version that was -around 90 pages long and barely described the original, ``old'' +around 90 pages and barely described the original, ``old'' version of @command{awk}. I started working with that version in the fall of 1988. @@ -1971,17 +2036,17 @@ and the major new additions are @ref{Arbitrary Precision Arithmetic}, and @ref{Dynamic Extensions}. This @value{DOCUMENT} will undoubtedly continue to evolve. If you -find an error in this @value{DOCUMENT}, please report it! @xref{Bugs}, +find an error in this @value{DOCUMENT}, please report it! @DBXREF{Bugs} for information on submitting problem reports electronically. @ifset FOR_PRINT @c fakenode --- for prepinfo @unnumberedsec How to Stay Current -It may be you have a version of @command{gawk} which is newer than the +You may have a newer version of @command{gawk} than the one described here. To find out what has changed, you should first look at the @file{NEWS} file in the @command{gawk} -distribution, which provides a high level summary of what changed in +distribution, which provides a high-level summary of what changed in each release. You can then look at the @uref{http://www.gnu.org/software/gawk/manual/, @@ -2006,13 +2071,13 @@ contributed code: the archive did not grow and the domain went unused for several years. Late in 2008, a volunteer took on the task of setting up -an @command{awk}-related web site---@uref{http://awk.info}---and did a very +an @command{awk}-related website---@uref{http://awk.info}---and did a very nice job. If you have written an interesting @command{awk} program, or have written a @command{gawk} extension that you would like to share with the rest of the world, please see @uref{http://awk.info/?contribute} for how to -contribute it to the web site. +contribute it to the website. @ignore As of this writing, this website is in search of a maintainer; please @@ -2159,7 +2224,7 @@ portable program it is today. It has been and continues to be a pleasure working with this team of fine people. Notable code and documentation contributions were made by -a number of people. @xref{Contributors}, for the full list. +a number of people. @DBXREF{Contributors} for the full list. @ifset FOR_PRINT @cindex Oram, Andy @@ -2178,7 +2243,7 @@ the Texinfo markup language sane. @cindex Kernighan, Brian @cindex Brennan, Michael @cindex Day, Robert P.J.@: -Robert P.J.@: Day, Michael Brennan and Brian Kernighan kindly acted as +Robert P.J.@: Day, Michael Brennan, and Brian Kernighan kindly acted as reviewers for the 2015 edition of this @value{DOCUMENT}. Their feedback helped improve the final work. @@ -2190,7 +2255,7 @@ or its documentation without his help. Brian is in a class by himself as a programmer and technical author. I have to thank him (yet again) for his ongoing friendship -and the role model he has been for me for close to 30 years! +and for being a role model to me for close to 30 years! Having him as a reviewer is an exciting privilege. It has also been extremely humbling@enddots{} @@ -2211,8 +2276,8 @@ take advantage of those opportunities. @noindent Arnold Robbins @* Nof Ayalon @* -ISRAEL @* -December, 2014 +Israel @* +December 2014 @end iftex @ifnotinfo @@ -2229,31 +2294,31 @@ following chapters: @itemize @value{BULLET} @item -@ref{Getting Started}. +@ref{Getting Started} @item -@ref{Invoking Gawk}. +@ref{Invoking Gawk} @item -@ref{Regexp}. +@ref{Regexp} @item -@ref{Reading Files}. +@ref{Reading Files} @item -@ref{Printing}. +@ref{Printing} @item -@ref{Expressions}. +@ref{Expressions} @item -@ref{Patterns and Actions}. +@ref{Patterns and Actions} @item -@ref{Arrays}. +@ref{Arrays} @item -@ref{Functions}. +@ref{Functions} @end itemize @end ifdocbook @@ -2268,17 +2333,17 @@ following chapters: The basic function of @command{awk} is to search files for lines (or other units of text) that contain certain patterns. When a line matches one of the patterns, @command{awk} performs specified actions on that line. -@command{awk} keeps processing input lines in this way until it reaches +@command{awk} continues to process input lines in this way until it reaches the end of the input files. @cindex @command{awk}, uses for @cindex programming languages@comma{} data-driven vs.@: procedural @cindex @command{awk} programs Programs in @command{awk} are different from programs in most other languages, -because @command{awk} programs are @dfn{data-driven}; that is, you describe -the data you want to work with and then what to do when you find it. +because @command{awk} programs are @dfn{data driven} (i.e., you describe +the data you want to work with and then what to do when you find it). Most other languages are @dfn{procedural}; you have to describe, in great -detail, every step the program is to take. When working with procedural +detail, every step the program should take. When working with procedural languages, it is usually much harder to clearly describe the data your program will process. For this reason, @command{awk} programs are often refreshingly easy to @@ -2288,9 +2353,9 @@ read and write. @cindex rule, definition of When you run @command{awk}, you specify an @command{awk} @dfn{program} that tells @command{awk} what to do. The program consists of a series of -@dfn{rules}. (It may also contain @dfn{function definitions}, -an advanced feature that we will ignore for now. -@xref{User-defined}.) Each rule specifies one +@dfn{rules} (it may also contain @dfn{function definitions}, +an advanced feature that we will ignore for now; +@pxref{User-defined}). Each rule specifies one pattern to search for and one action to perform upon finding the pattern. @@ -2390,10 +2455,11 @@ programs from shell scripts, because it avoids the need for a separate file for the @command{awk} program. A self-contained shell script is more reliable because there are no other files to misplace. +Later in this chapter, +@ifdocbook +the section +@end ifdocbook @ref{Very Simple}, -@ifnotinfo -later in this @value{CHAPTER}, -@end ifnotinfo presents several short, self-contained programs. @@ -2452,7 +2518,7 @@ startup file. This next simple @command{awk} program emulates the @command{cat} utility; it copies whatever you type on the -keyboard to its standard output (why this works is explained shortly). +keyboard to its standard output (why this works is explained shortly): @example $ @kbd{awk '@{ print @}'} @@ -2537,7 +2603,7 @@ affect the execution of the @command{awk} program but it does make Once you have learned @command{awk}, you may want to write self-contained @command{awk} scripts, using the @samp{#!} script mechanism. You can do this on many systems.@footnote{The @samp{#!} mechanism works on -GNU/Linux systems, BSD-based systems and commercial Unix systems.} +GNU/Linux systems, BSD-based systems, and commercial Unix systems.} For example, you could update the file @file{advice} to look like this: @example @@ -2581,7 +2647,7 @@ according to the instructions in your program. (This is different from a @dfn{compiled} language such as C, where your program is first compiled into machine code that is executed directly by your system's processor.) The @command{awk} utility is thus termed an @dfn{interpreter}. -Many modern languages are interperted. +Many modern languages are interpreted. The line beginning with @samp{#!} lists the full @value{FN} of an interpreter to run and a single optional initial command-line argument @@ -2631,7 +2697,7 @@ according to the instructions in your program. (This is different from a @dfn{compiled} language such as C, where your program is first compiled into machine code that is executed directly by your system's processor.) The @command{awk} utility is thus termed an @dfn{interpreter}. -Many modern languages are interperted. +Many modern languages are interpreted. The line beginning with @samp{#!} lists the full @value{FN} of an interpreter to run and a single optional initial command-line argument @@ -2678,14 +2744,14 @@ can explain what the program does and how it works. Nearly all programming languages have provisions for comments, as programs are typically hard to understand without them. -In the @command{awk} language, a comment starts with the sharp sign +In the @command{awk} language, a comment starts with the number sign character (@samp{#}) and continues to the end of the line. The @samp{#} does not have to be the first character on the line. The -@command{awk} language ignores the rest of a line following a sharp sign. +@command{awk} language ignores the rest of a line following a number sign. For example, we could have put the following into @file{advice}: @example -# This program prints a nice friendly message. It helps +# This program prints a nice, friendly message. It helps # keep novice users from being afraid of the computer. BEGIN @{ print "Don't Panic!" @} @end example @@ -2701,7 +2767,8 @@ when reading it at a later time. @quotation CAUTION As mentioned in @ref{One-shot}, -you can enclose small to medium programs in single quotes, in order to keep +you can enclose short to medium-sized programs in single quotes, +in order to keep your shell scripts self-contained. When doing so, @emph{don't} put an apostrophe (i.e., a single quote) into a comment (or anywhere else in your program). The shell interprets the quote as the closing @@ -2730,7 +2797,7 @@ $ @kbd{awk '@{ print "hello" @} # let's be cute'} @cindex @code{\} (backslash) @cindex backslash (@code{\}) Putting a backslash before the single quote in @samp{let's} wouldn't help, -since backslashes are not special inside single quotes. +because backslashes are not special inside single quotes. The next @value{SUBSECTION} describes the shell's quoting rules. @end quotation @@ -2742,7 +2809,7 @@ The next @value{SUBSECTION} describes the shell's quoting rules. * DOS Quoting:: Quoting in Windows Batch Files. @end menu -For short to medium length @command{awk} programs, it is most convenient +For short to medium-length @command{awk} programs, it is most convenient to enter the program on the @command{awk} command line. This is best done by enclosing the entire program in single quotes. This is true whether you are entering the program interactively at @@ -2766,8 +2833,8 @@ or empty, string. The null string is character data that has no value. In other words, it is empty. It is written in @command{awk} programs like this: @code{""}. In the shell, it can be written using single -or double quotes: @code{""} or @code{''}. While the null string has -no characters in it, it does exist. Consider this command: +or double quotes: @code{""} or @code{''}. Although the null string has +no characters in it, it does exist. For example, consider this command: @example $ @kbd{echo ""} @@ -2777,8 +2844,7 @@ $ @kbd{echo ""} Here, the @command{echo} utility receives a single argument, even though that argument has no characters in it. In the rest of this @value{DOCUMENT}, we use the terms @dfn{null string} and @dfn{empty string} -interchangeably. Now, on to the quoting rules. - +interchangeably. Now, on to the quoting rules: @itemize @value{BULLET} @item @@ -2801,7 +2867,7 @@ The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is @emph{impossible} to embed a single quote inside single-quoted text. Refer back to -@ref{Comments}, +@DBREF{Comments} for an example of what happens if you try. @item @@ -2811,7 +2877,7 @@ Double quotes protect most things between the opening and closing quotes. The shell does at least variable and command substitution on the quoted text. Different shells may do additional kinds of processing on double-quoted text. -Since certain characters within double-quoted text are processed by the shell, +Because certain characters within double-quoted text are processed by the shell, they must be @dfn{escaped} within the text. Of note are the characters @samp{$}, @samp{`}, @samp{\}, and @samp{"}, all of which must be preceded by a backslash within double-quoted text if they are to be passed on literally @@ -2873,7 +2939,7 @@ $ @kbd{awk 'BEGIN @{ print "Here is a single quote <'"'"'>" @}'} @noindent This program consists of three concatenated quoted strings. The first and the -third are single-quoted, the second is double-quoted. +third are single quoted, the second is double quoted. This can be ``simplified'' to: @@ -2918,7 +2984,7 @@ escapes mean. A fourth option is to use command-line variable assignment, like this: @example -$ awk -v sq="'" 'BEGIN @{ print "Here is a single quote <" sq ">" @}' +$ @kbd{awk -v sq="'" 'BEGIN @{ print "Here is a single quote <" sq ">" @}'} @print{} Here is a single quote <'> @end example @@ -2989,7 +3055,7 @@ information about monthly shipments. In both files, each line is considered to be one @dfn{record}. In @file{mail-list}, each record contains the name of a person, -his/her phone number, his/her email-address, and a code for their relationship +his/her phone number, his/her email address, and a code for his/her relationship with the author of the list. The columns are aligned using spaces. An @samp{A} in the last column @@ -3110,8 +3176,8 @@ empty action that does nothing (i.e., no lines are printed). Many practical @command{awk} programs are just a line or two. Following is a collection of useful, short programs to get you started. Some of these programs contain constructs that haven't been covered yet. (The description -of the program will give you a good idea of what is going on, but please -read the rest of the @value{DOCUMENT} to become an @command{awk} expert!) +of the program will give you a good idea of what is going on, but you'll +need to read the rest of the @value{DOCUMENT} to become an @command{awk} expert!) Most of the examples use a @value{DF} named @file{data}. This is just a placeholder; if you use these programs yourself, substitute your own @value{FN}s for @file{data}. @@ -3152,7 +3218,7 @@ expand data | awk '@{ if (x < length($0)) x = length($0) @} @end example This example differs slightly from the previous one: -The input is processed by the @command{expand} utility to change TABs +the input is processed by the @command{expand} utility to change TABs into spaces, so the widths compared are actually the right-margin columns, as opposed to the number of input characters on each line. @@ -3406,7 +3472,7 @@ lines in the middle of a regular expression or a string. with the C shell.} It works for @command{awk} programs in files and for one-shot programs, @emph{provided} you are using a POSIX-compliant shell, such as the Unix Bourne shell or Bash. But the C shell behaves -differently! There, you must use two backslashes in a row, followed by +differently! There you must use two backslashes in a row, followed by a newline. Note also that when using the C shell, @emph{every} newline in your @command{awk} program must be escaped with a backslash. To illustrate: @@ -3447,9 +3513,9 @@ starts a comment, it ignores @emph{everything} on the rest of the line. For example: @example -$ gawk 'BEGIN @{ print "dont panic" # a friendly \ -> BEGIN rule -> @}' +$ @kbd{gawk 'BEGIN @{ print "dont panic" # a friendly \} +> @kbd{ BEGIN rule} +> @kbd{@}'} @error{} gawk: cmd. line:2: BEGIN rule @error{} gawk: cmd. line:2: ^ syntax error @end example @@ -3499,7 +3565,7 @@ and array sorting. As we develop our presentation of the @command{awk} language, we introduce most of the variables and many of the functions. They are described -systematically in @ref{Built-in Variables}, and in +systematically in @DBREF{Built-in Variables} and in @ref{Built-in}. @node When @@ -3533,8 +3599,8 @@ eight-bit microprocessors, @end ifset and a microcode assembler for a special-purpose Prolog computer. -While the original @command{awk}'s capabilities were strained by tasks -of such complexity, modern versions are more capable. +The original @command{awk}'s capabilities were strained by tasks +of such complexity, but modern versions are more capable. @cindex @command{awk} programs, complex If you find yourself writing @command{awk} scripts of more than, say, @@ -3589,7 +3655,7 @@ a comma, open brace, question mark, colon, This @value{CHAPTER} covers how to run @command{awk}, both POSIX-standard and @command{gawk}-specific command-line options, and what @command{awk} and -@command{gawk} do with non-option arguments. +@command{gawk} do with nonoption arguments. It then proceeds to cover how @command{gawk} searches for source files, reading standard input along with other files, @command{gawk}'s environment variables, @command{gawk}'s exit status, using include files, @@ -3633,7 +3699,7 @@ enclosed in [@dots{}] in these templates are optional: @cindex GNU long options @cindex long options @cindex options, long -Besides traditional one-letter POSIX-style options, @command{gawk} also +In addition to traditional one-letter POSIX-style options, @command{gawk} also supports GNU long options. @cindex dark corner, invoking @command{awk} @@ -3696,7 +3762,7 @@ Set the @code{FS} variable to @var{fs} @cindex @option{--file} option @cindex @command{awk} programs, location of Read @command{awk} program source from @var{source-file} -instead of in the first non-option argument. +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 each specified @var{source-file}. @@ -3956,7 +4022,7 @@ care to search for all occurrences of each inappropriate construct. As @itemx @option{--bignum} @cindex @option{-M} option @cindex @option{--bignum} option -Force arbitrary precision arithmetic on numbers. This option has no effect +Force arbitrary-precision arithmetic on numbers. This option has no effect if @command{gawk} is not compiled to use the GNU MPFR and MP libraries (@pxref{Arbitrary Precision Arithmetic}). @@ -3972,10 +4038,8 @@ values in input data (@pxref{Nondecimal Data}). @quotation CAUTION -This option can severely break old programs. -Use with care. - -This option may disappear in a future version of @command{gawk}. +This option can severely break old programs. Use with care. Also note +that this option may disappear in a future version of @command{gawk}. @end quotation @item @option{-N} @@ -4009,7 +4073,7 @@ pretty-print the program and not run it. @cindex @option{--optimize} option @cindex @option{-O} option Enable some optimizations on the internal representation of the program. -At the moment this includes just simple constant folding. +At the moment, this includes just simple constant folding. @item @option{-p}[@var{file}] @itemx @option{--profile}[@code{=}@var{file}] @@ -4086,8 +4150,8 @@ Allow interval expressions (@pxref{Regexp Operators}) in regexps. This is now @command{gawk}'s default behavior. -Nevertheless, this option remains both for backward compatibility, -and for use in combination with @option{--traditional}. +Nevertheless, this option remains (both for backward compatibility +and for use in combination with @option{--traditional}). @item @option{-S} @itemx @option{--sandbox} @@ -4140,7 +4204,7 @@ If it is, @command{awk} reads its program source from all of the named files, as if they had been concatenated together into one big file. This is useful for creating libraries of @command{awk} functions. These functions can be written once and then retrieved from a standard place, instead -of having to be included into each individual program. +of having to be included in each individual program. The @option{-i} option is similar in this regard. (As mentioned in @ref{Definition Syntax}, @@ -4151,7 +4215,7 @@ if the program is entered at the keyboard, by specifying @samp{-f /dev/tty}. After typing your program, type @kbd{Ctrl-d} (the end-of-file character) to terminate it. (You may also use @samp{-f -} to read program source from the standard -input but then you will not be able to also use the standard input as a +input, but then you will not be able to also use the standard input as a source of data.) Because it is clumsy using the standard @command{awk} mechanisms to mix @@ -4164,7 +4228,7 @@ options may also be used multiple times on the command line. @cindex @option{-e} option If no @option{-f} or @option{-e} option is specified, then @command{gawk} -uses the first non-option command-line argument as the text of the +uses the first nonoption command-line argument as the text of the program source code. @cindex @env{POSIXLY_CORRECT} environment variable @@ -4231,7 +4295,7 @@ All the command-line arguments are made available to your @command{awk} program and the program text (if present) are omitted from @code{ARGV}. All other arguments, including variable assignments, are included. As each element of @code{ARGV} is processed, @command{gawk} -sets the variable @code{ARGIND} to the index in @code{ARGV} of the +sets @code{ARGIND} to the index in @code{ARGV} of the current element. @c FIXME: One day, move the ARGC and ARGV node closer to here. @@ -4408,7 +4472,7 @@ value of @env{AWKPATH}. @code{ENVIRON["AWKPATH"]}. This provides access to the actual search path value from within an @command{awk} program. -While you can change @code{ENVIRON["AWKPATH"]} within your @command{awk} +Although you can change @code{ENVIRON["AWKPATH"]} within your @command{awk} program, this has no effect on the running program's behavior. This makes sense: the @env{AWKPATH} environment variable is used to find the program source files. Once your program is running, all the files have been @@ -4444,7 +4508,7 @@ path value from within an @command{awk} program. A number of other environment variables affect @command{gawk}'s behavior, but they are more specialized. Those in the following -list are meant to be used by regular users. +list are meant to be used by regular users: @table @env @item GAWK_MSEC_SLEEP @@ -4464,7 +4528,7 @@ retry a two-way TCP/IP (socket) connection before giving up. @xref{TCP/IP Networking}. @item POSIXLY_CORRECT -Causes @command{gawk} to switch to POSIX compatibility +Causes @command{gawk} to switch to POSIX-compatibility mode, disabling all traditional and GNU extensions. @xref{Options}. @end table @@ -4496,11 +4560,11 @@ for debugging problems on filesystems on non-POSIX operating systems where I/O is performed in records, not in blocks. @item GAWK_MSG_SRC -If this variable exists, @command{gawk} includes the file -name and line number within the @command{gawk} source code +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, since there are multiple places which produce the +message, as there are multiple places which produce the same warning or error message. @item GAWK_NO_DFA @@ -4512,8 +4576,8 @@ supposed to be differences, but occasionally theory and practice don't coordinate with each other.) @item GAWK_NO_PP_RUN -If this variable exists, then when invoked with the @option{--pretty-print} -option, @command{gawk} skips running the program. +When @command{gawk} is invoked with the @option{--pretty-print} option, +it will not run the program if this environment variable exists. @quotation CAUTION This variable will not survive into the next major release. @@ -4552,11 +4616,11 @@ If an error occurs, @command{gawk} exits with the value of the C constant @code{EXIT_FAILURE}. This is usually one. If @command{gawk} exits because of a fatal error, the exit -status is 2. On non-POSIX systems, this value may be mapped +status is two. On non-POSIX systems, this value may be mapped to @code{EXIT_FAILURE}. @node Include Files -@section Including Other Files Into Your Program +@section Including Other Files into Your Program @c Panos Papadopoulos contributed the original @c text for this section. @@ -4605,9 +4669,9 @@ $ @kbd{gawk -f test2} @print{} This is script test2. @end example -@code{gawk} runs the @file{test2} script which includes @file{test1} +@code{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 +keyword. So, to include external @command{awk} source files, you just use @code{@@include} followed by the name of the file to be included, enclosed in double quotes. @@ -4644,26 +4708,26 @@ The @value{FN} can, of course, be a pathname. For example: @end example @noindent -or: +and: @example @@include "/usr/awklib/network" @end example @noindent -are valid. The @env{AWKPATH} environment variable can be of great +are both valid. The @env{AWKPATH} environment variable can be of great value when using @code{@@include}. The same rules for the use of the @env{AWKPATH} variable in command-line file searches (@pxref{AWKPATH Variable}) apply to @code{@@include} also. This is very helpful in constructing @command{gawk} function libraries. -If you have a large script with useful, general purpose @command{awk} +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} environment variable accordingly and then using @code{@@include} with -just the file part of the full pathname. Of course you can have more +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 environment is, the more directories you may need to organize the files to be included. @@ -4681,7 +4745,7 @@ searched first for source files, before searching in @env{AWKPATH}, and this also applies to files named with @code{@@include}. @node Loading Shared Libraries -@section Loading Dynamic Extensions Into Your Program +@section Loading Dynamic Extensions into Your Program This @value{SECTION} describes a feature that is specific to @command{gawk}. @@ -4691,7 +4755,7 @@ This @value{SECTION} describes a feature that is specific to @command{gawk}. The @code{@@load} keyword can be used to read external @command{awk} extensions (stored as system shared libraries). This allows you to link in compiled code that may offer superior -performance and/or give you access to extended capabilities not supported +performance and/or give you access to extended capabilities not supported by the @command{awk} language. The @env{AWKLIBPATH} variable is used to search for the extension. Using @code{@@load} is completely equivalent to using the @option{-l} command-line option. @@ -4699,7 +4763,7 @@ to using the @option{-l} command-line option. If the extension is not initially found in @env{AWKLIBPATH}, another search is conducted after appending the platform's default shared library suffix to the @value{FN}. For example, on GNU/Linux systems, the suffix -@samp{.so} is used. +@samp{.so} is used: @example $ @kbd{gawk '@@load "ordchr"; BEGIN @{print chr(65)@}'} @@ -4834,13 +4898,13 @@ The three standard options for all versions of @command{awk} are and many others, as well as corresponding GNU-style long options. @item -Non-option command-line arguments are usually treated as @value{FN}s, +Nonoption command-line arguments are usually treated as @value{FN}s, unless they have the form @samp{@var{var}=@var{value}}, in which case they are taken as variable assignments to be performed at that point in processing the input. @item -All non-option command-line arguments, excluding the program text, +All nonoption command-line arguments, excluding the program text, are placed in the @code{ARGV} array. Adjusting @code{ARGC} and @code{ARGV} affects how @command{awk} processes input. @@ -4889,7 +4953,7 @@ belongs to that set. The simplest regular expression is a sequence of letters, numbers, or both. Such a regexp matches any string that contains that sequence. Thus, the regexp @samp{foo} matches any string containing @samp{foo}. -Therefore, the pattern @code{/foo/} matches any input record containing +Thus, the pattern @code{/foo/} matches any input record containing the three adjacent characters @samp{foo} @emph{anywhere} in the record. Other kinds of regexps let you specify more complicated classes of strings. @@ -4952,17 +5016,16 @@ and @samp{!~} perform regular expression comparisons. Expressions using these operators can be used as patterns, or in @code{if}, @code{while}, @code{for}, and @code{do} statements. (@xref{Statements}.) -For example: +For example, the following is true if the expression @var{exp} (taken +as a string) matches @var{regexp}: @example @var{exp} ~ /@var{regexp}/ @end example @noindent -is true if the expression @var{exp} (taken as a string) -matches @var{regexp}. The following example matches, or selects, -all input records with the uppercase letter @samp{J} somewhere in the -first field: +This example matches, or selects, all input records with the uppercase +letter @samp{J} somewhere in the first field: @example $ @kbd{awk '$1 ~ /J/' inventory-shipped} @@ -5032,9 +5095,9 @@ string or regexp. Thus, the string whose contents are the two characters @samp{"} and @samp{\} must be written @code{"\"\\"}. Other escape sequences represent unprintable characters -such as TAB or newline. While there is nothing to stop you from entering most +such as TAB or newline. There is nothing to stop you from entering most unprintable characters directly in a string constant or regexp constant, -they may look ugly. +but they may look ugly. The following list presents all the escape sequences used in @command{awk} and @@ -5107,7 +5170,7 @@ undefined results. (The @samp{\x} escape sequence is not allowed in POSIX @command{awk}.) @quotation CAUTION -The next major relase of @command{gawk} will change, such +The next major release of @command{gawk} will change, such that a maximum of two hexadecimal digits following the @samp{\x} will be used. @end quotation @@ -5119,7 +5182,7 @@ A literal slash (necessary for regexp constants only). This sequence is used when you want to write a regexp constant that contains a slash (such as @code{/.*:\/home\/[[:alnum:]]+:.*/}; the @samp{[[:alnum:]]} -notation is discussed shortly, in @ref{Bracket Expressions}). +notation is discussed in @ref{Bracket Expressions}). Because the regexp is delimited by slashes, you need to escape any slash that is part of the pattern, in order to tell @command{awk} to keep processing the rest of the regexp. @@ -5142,7 +5205,7 @@ with a backslash have special meaning in regexps. In a regexp, a backslash before any character that is not in the previous list and not listed in -@ref{GNU Regexp Operators}, +@DBREF{GNU Regexp Operators} means that the next character should be taken literally, even if it would normally be a regexp operator. For example, @code{/a\+b/} matches the three characters @samp{a+b}. @@ -5153,25 +5216,7 @@ characters @samp{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. -To summarize: - -@itemize @value{BULLET} -@item -The escape sequences in the list above are always processed first, -for both string constants and regexp constants. This happens very early, -as soon as @command{awk} reads your program. - -@item -@command{gawk} processes both regexp constants and dynamic regexps -(@pxref{Computed Regexps}), -for the special operators listed in -@ref{GNU Regexp Operators}. - -@item -A backslash before any other character means to treat that character -literally. -@end itemize - +@c 11/2014: Moved so as to not stack sidebars @cindex sidebar, Backslash Before Regular Characters @ifdocbook @docbook @@ -5256,6 +5301,25 @@ In such implementations, typing @code{"a\qc"} is the same as typing @end cartouche @end ifnotdocbook +To summarize: + +@itemize @value{BULLET} +@item +The escape sequences in the preceding list are always processed first, +for both string constants and regexp constants. This happens very early, +as soon as @command{awk} reads your program. + +@item +@command{gawk} processes both regexp constants and dynamic regexps +(@pxref{Computed Regexps}), +for the special operators listed in +@ref{GNU Regexp Operators}. + +@item +A backslash before any other character means to treat that character +literally. +@end itemize + @cindex sidebar, Escape Sequences for Metacharacters @ifdocbook @docbook @@ -5337,7 +5401,7 @@ sequences and that are not listed in the following stand for themselves: @cindex backslash (@code{\}), regexp operator @cindex @code{\} (backslash), regexp operator @item @code{\} -This is used to suppress the special meaning of a character when +This suppresses the special meaning of a character when matching. For example, @samp{\$} matches the character @samp{$}. @@ -5346,8 +5410,9 @@ matches the character @samp{$}. @cindex @code{^} (caret), regexp operator @cindex caret (@code{^}), regexp operator @item @code{^} -This matches the beginning of a string. For example, @samp{^@@chapter} -matches @samp{@@chapter} at the beginning of a string and can be used +This matches the beginning of a string. @samp{^@@chapter} +matches @samp{@@chapter} at the beginning of a string, +for example, and can be used to identify chapter beginnings in Texinfo source files. The @samp{^} is known as an @dfn{anchor}, because it anchors the pattern to match only at the beginning of the string. @@ -5453,7 +5518,7 @@ 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: -@samp{(ph)*} matches @samp{ph}, @samp{phph}, @samp{phphph} and so on. +@samp{(ph)*} matches @samp{ph}, @samp{phph}, @samp{phphph}, and so on. Second, @samp{*} finds as many repetitions as possible. If the text to be matched is @samp{phhhhhhhhhhhhhhooey}, @samp{ph*} matches all of @@ -5553,7 +5618,7 @@ expressions are not available in regular expressions. @cindex range expressions (regexps) @cindex character lists in regular expression -As mentioned earlier, a bracket expression matches any character amongst +As mentioned earlier, a bracket expression matches any character among those listed between the opening and closing square brackets. Within a bracket expression, a @dfn{range expression} consists of two @@ -5611,23 +5676,23 @@ a keyword denoting the class, and @samp{:]}. POSIX standard. @float Table,table-char-classes -@caption{POSIX Character Classes} +@caption{POSIX character classes} @multitable @columnfractions .15 .85 @headitem Class @tab Meaning -@item @code{[:alnum:]} @tab Alphanumeric characters. -@item @code{[:alpha:]} @tab Alphabetic characters. -@item @code{[:blank:]} @tab Space and TAB characters. -@item @code{[:cntrl:]} @tab Control characters. -@item @code{[:digit:]} @tab Numeric characters. -@item @code{[:graph:]} @tab Characters that are both printable and visible. -(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, -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. -@item @code{[:xdigit:]} @tab Characters that are hexadecimal digits. +@item @code{[:alnum:]} @tab Alphanumeric characters +@item @code{[:alpha:]} @tab Alphabetic characters +@item @code{[:blank:]} @tab Space and TAB characters +@item @code{[:cntrl:]} @tab Control characters +@item @code{[:digit:]} @tab Numeric characters +@item @code{[:graph:]} @tab Characters that are both printable and visible +(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 +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 +@item @code{[:xdigit:]} @tab Characters that are hexadecimal digits @end multitable @end float @@ -5642,7 +5707,7 @@ and numeric characters in your character set. @c Thanks to @c Date: Tue, 01 Jul 2014 07:39:51 +0200 @c From: Hermann Peifer -Some utilities that match regular expressions provide a non-standard +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 all values numerically between zero and 127, which is the defined @@ -5833,7 +5898,7 @@ $ @kbd{awk '$0 ~ "[ \t\n]"'} @error{} ]... @error{} source line number 1 @error{} context is -@error{} $0 ~ "[ >>> \t\n]" <<< +@error{} $0 ~ "[ >>> \t\n]" <<< @end example @cindex newlines, in regexp constants @@ -5871,7 +5936,7 @@ $ @kbd{awk '$0 ~ "[ \t\n]"'} @error{} ]... @error{} source line number 1 @error{} context is -@error{} $0 ~ "[ >>> \t\n]" <<< +@error{} $0 ~ "[ >>> \t\n]" <<< @end example @cindex newlines, in regexp constants @@ -5982,9 +6047,9 @@ word-constituent characters. For example, @cindex regular expressions, operators, for buffers @cindex operators, string-matching, for buffers There are two other operators that work on buffers. In Emacs, a -@dfn{buffer} is, naturally, an Emacs buffer. For other programs, -@command{gawk}'s regexp library routines consider the entire -string to match as the buffer. +@dfn{buffer} is, naturally, an Emacs buffer. +Other GNU programs, including @command{gawk}, +consider the entire string to match as the buffer. The operators are: @table @code @@ -6045,16 +6110,16 @@ in @ref{Regexp Operators}. @end ifnottex @item @code{--posix} -Only POSIX regexps are supported; the GNU operators are not special +Match only POSIX regexps; the GNU operators are not special (e.g., @samp{\w} matches a literal @samp{w}). Interval expressions are allowed. @cindex Brian Kernighan's @command{awk} @item @code{--traditional} -Traditional Unix @command{awk} regexps are matched. The GNU operators +Match traditional Unix @command{awk} regexps. The GNU operators are not special, and interval expressions are not available. -The POSIX character classes (@samp{[[:alnum:]]}, etc.) are supported, -as BWK @command{awk} supports them. +Because BWK @command{awk} supports them, +the POSIX character classes (@samp{[[:alnum:]]}, etc.) are available. Characters described by octal and hexadecimal escape sequences are treated literally, even if they represent regexp metacharacters. @@ -6114,7 +6179,7 @@ When @code{IGNORECASE} is not zero, @emph{all} regexp and string operations ignore case. Changing the value of @code{IGNORECASE} dynamically controls the -case-sensitivity of the program as it runs. Case is significant by +case sensitivity of the program as it runs. Case is significant by default because @code{IGNORECASE} (like most variables) is initialized to zero: @@ -6127,7 +6192,7 @@ if (x ~ /ab/) @dots{} # now it will succeed @end example In general, you cannot use @code{IGNORECASE} to make certain rules -case-insensitive and other rules case-sensitive, because there is no +case insensitive and other rules case sensitive, as there is no straightforward way to set @code{IGNORECASE} just for the pattern of a particular rule.@footnote{Experienced C and C++ programmers will note @@ -6138,13 +6203,13 @@ and However, this is somewhat obscure and we don't recommend it.} To do this, use either bracket expressions or @code{tolower()}. However, one thing you can do with @code{IGNORECASE} only is dynamically turn -case-sensitivity on or off for all the rules at once. +case sensitivity on or off for all the rules at once. @code{IGNORECASE} can be set on the command line or in a @code{BEGIN} rule (@pxref{Other Arguments}; also @pxref{Using BEGIN/END}). Setting @code{IGNORECASE} from the command line is a way to make -a program case-insensitive without having to edit it. +a program case insensitive without having to edit it. @c @cindex ISO 8859-1 @c @cindex ISO Latin-1 @@ -6181,12 +6246,12 @@ in conditional expressions, or as part of matching expressions using the @samp{~} and @samp{!~} operators. @item -Escape sequences let you represent non-printable characters and +Escape sequences let you represent nonprintable characters and also let you represent regexp metacharacters as literal characters to be matched. @item -Regexp operators provide grouping, alternation and repetition. +Regexp operators provide grouping, alternation, and repetition. @item Bracket expressions give you a shorthand for specifying sets @@ -6201,8 +6266,8 @@ the match, such as for text substitution and when the record separator is a regexp. @item -Matching expressions may use dynamic regexps, that is, string values -treated as regular expressions. +Matching expressions may use dynamic regexps (i.e., string values +treated as regular expressions). @item @command{gawk}'s @code{IGNORECASE} variable lets you control the @@ -6276,7 +6341,7 @@ used with it do not have to be named on the @command{awk} command line @command{awk} divides the input for your program into records and fields. It keeps track of the number of records that have been read so far from the current input file. This value is stored in a predefined variable -called @code{FNR} which is reset to zero every time a new file is started. +called @code{FNR}, which is reset to zero every time a new file is started. Another predefined variable, @code{NR}, records the total number of input records read so far from all @value{DF}s. It starts at zero, but is never automatically reset to zero. @@ -6287,7 +6352,7 @@ never automatically reset to zero. @end menu @node awk split records -@subsection Record Splitting With Standard @command{awk} +@subsection Record Splitting with Standard @command{awk} @cindex separators, for records @cindex record separators @@ -6304,7 +6369,7 @@ the value of @code{RS} can be changed in the @command{awk} program with the assignment operator, @samp{=} (@pxref{Assignment Ops}). The new record-separator character should be enclosed in quotation marks, -which indicate a string constant. Often the right time to do this is +which indicate a string constant. Often, the right time to do this is at the beginning of execution, before any input is processed, so that the very first record is read with the proper separator. To do this, use the special @code{BEGIN} pattern @@ -6318,7 +6383,7 @@ 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 +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 @command{awk} program (the action with no pattern) prints each record. Because each @code{print} statement adds a newline at the end of @@ -6366,7 +6431,7 @@ $ @kbd{awk 'BEGIN @{ RS = "u" @}} @print{} m@@ny @print{} .ed @print{} R -@print{} +@print{} @end example @noindent @@ -6412,7 +6477,7 @@ being fully POSIX-compliant (@pxref{Options}). Then, the following (extreme) pipeline prints a surprising @samp{1}: @example -$ echo | gawk --posix 'BEGIN @{ RS = "a" @} ; @{ print NF @}' +$ @kbd{echo | gawk --posix 'BEGIN @{ RS = "a" @} ; @{ print NF @}'} @print{} 1 @end example @@ -6434,7 +6499,7 @@ The empty string @code{""} (a string without any characters) has a special meaning as the value of @code{RS}. It means that records are separated by one or more blank lines and nothing else. -@xref{Multiple Line}, for more details. +@DBXREF{Multiple Line} for more details. If you change the value of @code{RS} in the middle of an @command{awk} run, the new value is used to delimit subsequent records, but the record @@ -6454,7 +6519,7 @@ sets the variable @code{RT} to the text in the input that matched @code{RS}. @node gawk split records -@subsection Record Splitting With @command{gawk} +@subsection Record Splitting with @command{gawk} @cindex common extensions, @code{RS} as a regexp @cindex extensions, common@comma{} @code{RS} as a regexp @@ -6498,11 +6563,11 @@ $ @kbd{echo record 1 AAAA record 2 BBBB record 3 |} The square brackets delineate the contents of @code{RT}, letting you see the leading and trailing whitespace. The final value of @code{RT} is a newline. -@xref{Simple Sed}, for a more useful example +@DBXREF{Simple Sed} for a more useful example of @code{RS} as a regexp and @code{RT}. If you set @code{RS} to a regular expression that allows optional -trailing text, such as @samp{RS = "abc(XYZ)?"} it is possible, due +trailing text, such as @samp{RS = "abc(XYZ)?"}, it is possible, due to implementation constraints, that @command{gawk} may match the leading part of the regular expression, but not the trailing part, particularly if the input text that could match the trailing part is fairly long. @@ -6570,9 +6635,9 @@ character as a record separator. However, this is a special case: @cindex records, treating files as @cindex treating files, as single records -@xref{Readfile Function}, for an interesting way to read -whole files. If you are using @command{gawk}, see @ref{Extension Sample -Readfile}, for another option. +@DBXREF{Readfile Function} for an interesting way to read +whole files. If you are using @command{gawk}, see @DBREF{Extension Sample +Readfile} for another option. @docbook @@ -6621,9 +6686,9 @@ character as a record separator. However, this is a special case: @cindex records, treating files as @cindex treating files, as single records -@xref{Readfile Function}, for an interesting way to read -whole files. If you are using @command{gawk}, see @ref{Extension Sample -Readfile}, for another option. +@DBXREF{Readfile Function} for an interesting way to read +whole files. If you are using @command{gawk}, see @DBREF{Extension Sample +Readfile} for another option. @end cartouche @end ifnotdocbook @c ENDOFRANGE inspl @@ -6646,9 +6711,9 @@ called @dfn{fields}. By default, fields are separated by @dfn{whitespace}, like words in a line. Whitespace in @command{awk} means any string of one or more spaces, TABs, or newlines;@footnote{In POSIX @command{awk}, newlines are not -considered whitespace for separating fields.} other characters, such as -formfeed, vertical tab, etc., that are -considered whitespace by other languages, are @emph{not} considered +considered whitespace for separating fields.} other characters +that are considered whitespace by other languages +(such as formfeed, vertical tab, etc.) are @emph{not} considered whitespace by @command{awk}. The purpose of fields is to make it more convenient for you to refer to @@ -6665,7 +6730,7 @@ 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. -@code{$127} is the one hundred twenty-seventh field in the record.) +@code{$127} is the 127th field in the record.) For example, suppose the following is a line of input: @example @@ -6735,7 +6800,7 @@ awk '@{ print $NR @}' @noindent Recall that @code{NR} is the number of records read so far: one in the -first record, two in the second, etc. So this example prints the first +first record, two in the second, and so on. So this example prints the first field of the first record, the second field of the second record, and so on. For the twentieth record, field number 20 is printed; most likely, the record has fewer than 20 fields, so this prints a blank line. @@ -6752,7 +6817,7 @@ 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, since @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 @@ -6826,7 +6891,7 @@ $ @kbd{awk '@{ $2 = $2 - 10; print $0 @}' inventory-shipped} @dots{} @end example -It is also possible to also assign contents to fields that are out +It is also possible to assign contents to fields that are out of range. For example: @example @@ -6877,9 +6942,9 @@ else @noindent should print @samp{everything is normal}, because @code{NF+1} is certain -to be out of range. (@xref{If Statement}, +to be out of range. (@DBXREF{If Statement} for more information about @command{awk}'s @code{if-else} statements. -@xref{Typing and Comparison}, +@DBXREF{Typing and Comparison} for more information about the @samp{!=} operator.) It is important to note that making an assignment to an existing field @@ -6919,8 +6984,8 @@ after the new value of @code{NF} and recomputes @code{$0}. Here is an example: @example -$ echo a b c d e f | awk '@{ print "NF =", NF; -> NF = 3; print $0 @}' +$ @kbd{echo a b c d e f | awk '@{ print "NF =", NF;} +> @kbd{ NF = 3; print $0 @}'} @print{} NF = 6 @print{} a b c @end example @@ -6969,7 +7034,7 @@ in a record simply by setting @code{FS} and @code{OFS}, and then expecting a plain @samp{print} or @samp{print $0} to print the modified record. -But this does not work, since nothing was done to change the record +But this does not work, because nothing was done to change the record itself. Instead, you must force the record to be rebuilt, typically with a statement such as @samp{$1 = $1}, as described earlier. @@ -6994,7 +7059,7 @@ in a record simply by setting @code{FS} and @code{OFS}, and then expecting a plain @samp{print} or @samp{print $0} to print the modified record. -But this does not work, since nothing was done to change the record +But this does not work, because nothing was done to change the record itself. Instead, you must force the record to be rebuilt, typically with a statement such as @samp{$1 = $1}, as described earlier. @end cartouche @@ -7047,7 +7112,7 @@ the Unix Bourne shell, @command{sh}, or Bash). @cindex @code{FS} variable, changing value of The value of @code{FS} can be changed in the @command{awk} program with the assignment operator, @samp{=} (@pxref{Assignment Ops}). -Often the right time to do this is at the beginning of execution +Often, the right time to do this is at the beginning of execution before any input has been processed, so that the very first record is read with the proper separator. To do this, use the special @code{BEGIN} pattern @@ -7203,7 +7268,7 @@ statement prints the new @code{$0}. @cindex dark corner, @code{^}, in @code{FS} There is an additional subtlety to be aware of when using regular expressions for field splitting. -It is not well-specified in the POSIX standard, or anywhere else, what @samp{^} +It is not well specified in the POSIX standard, or anywhere else, what @samp{^} means when splitting fields. Does the @samp{^} match only at the beginning of the entire record? Or is each field separator a new string? It turns out that different @command{awk} versions answer this question differently, and you @@ -7369,11 +7434,11 @@ awk -F: '$5 == ""' /etc/passwd @end example @node Full Line Fields -@subsection Making The Full Line Be A Single Field +@subsection Making the Full Line Be a Single Field Occasionally, it's useful to treat the whole input line as a single field. This can be done easily and portably simply by -setting @code{FS} to @code{"\n"} (a newline).@footnote{Thanks to +setting @code{FS} to @code{"\n"} (a newline):@footnote{Thanks to Andrew Schorr for this tip.} @example @@ -7383,42 +7448,6 @@ awk -F'\n' '@var{program}' @var{files @dots{}} @noindent When you do this, @code{$1} is the same as @code{$0}. -@node Field Splitting Summary -@subsection Field-Splitting Summary - -It is important to remember that when you assign a string constant -as the value of @code{FS}, it undergoes normal @command{awk} string -processing. For example, with Unix @command{awk} and @command{gawk}, -the assignment @samp{FS = "\.."} assigns the character string @code{".."} -to @code{FS} (the backslash is stripped). This creates a regexp meaning -``fields are separated by occurrences of any two characters.'' -If instead you want fields to be separated by a literal period followed -by any single character, use @samp{FS = "\\.."}. - -The following list summarizes how fields are split, based on the value -of @code{FS} (@samp{==} means ``is equal to''): - -@table @code -@item FS == " " -Fields are separated by runs of whitespace. Leading and trailing -whitespace are ignored. This is the default. - -@item FS == @var{any other single character} -Fields are separated by each occurrence of the character. Multiple -successive occurrences delimit empty fields, as do leading and -trailing occurrences. -The character can even be a regexp metacharacter; it does not need -to be escaped. - -@item FS == @var{regexp} -Fields are separated by occurrences of characters that match @var{regexp}. -Leading and trailing matches of @var{regexp} delimit empty fields. - -@item FS == "" -Each individual character in the record becomes a separate field. -(This is a common extension; it is not specified by the POSIX standard.) -@end table - @cindex sidebar, Changing @code{FS} Does Not Affect the Fields @ifdocbook @docbook @@ -7523,6 +7552,42 @@ root:nSijPlPhZZwgE:0:0:Root:/: @end cartouche @end ifnotdocbook +@node Field Splitting Summary +@subsection Field-Splitting Summary + +It is important to remember that when you assign a string constant +as the value of @code{FS}, it undergoes normal @command{awk} string +processing. For example, with Unix @command{awk} and @command{gawk}, +the assignment @samp{FS = "\.."} assigns the character string @code{".."} +to @code{FS} (the backslash is stripped). This creates a regexp meaning +``fields are separated by occurrences of any two characters.'' +If instead you want fields to be separated by a literal period followed +by any single character, use @samp{FS = "\\.."}. + +The following list summarizes how fields are split, based on the value +of @code{FS} (@samp{==} means ``is equal to''): + +@table @code +@item FS == " " +Fields are separated by runs of whitespace. Leading and trailing +whitespace are ignored. This is the default. + +@item FS == @var{any other single character} +Fields are separated by each occurrence of the character. Multiple +successive occurrences delimit empty fields, as do leading and +trailing occurrences. +The character can even be a regexp metacharacter; it does not need +to be escaped. + +@item FS == @var{regexp} +Fields are separated by occurrences of characters that match @var{regexp}. +Leading and trailing matches of @var{regexp} delimit empty fields. + +@item FS == "" +Each individual character in the record becomes a separate field. +(This is a common extension; it is not specified by the POSIX standard.) +@end table + @cindex sidebar, @code{FS} and @code{IGNORECASE} @ifdocbook @docbook @@ -7546,7 +7611,7 @@ print $1 @noindent The output is @samp{aCa}. If you really want to split fields on an alphabetic character while ignoring case, use a regexp that will -do it for you. E.g., @samp{FS = "[c]"}. In this case, @code{IGNORECASE} +do it for you (e.g., @samp{FS = "[c]"}). In this case, @code{IGNORECASE} will take effect. @docbook @@ -7576,7 +7641,7 @@ print $1 @noindent The output is @samp{aCa}. If you really want to split fields on an alphabetic character while ignoring case, use a regexp that will -do it for you. E.g., @samp{FS = "[c]"}. In this case, @code{IGNORECASE} +do it for you (e.g., @samp{FS = "[c]"}). In this case, @code{IGNORECASE} will take effect. @end cartouche @end ifnotdocbook @@ -7587,20 +7652,20 @@ will take effect. @node Constant Size @section Reading Fixed-Width Data -@quotation NOTE +@cindex data, fixed-width +@cindex fixed-width data +@cindex advanced features, fixed-width data + +@c O'Reilly doesn't like it as a note the first thing in the section. This @value{SECTION} discusses an advanced feature of @command{gawk}. If you are a novice @command{awk} user, you might want to skip it on the first reading. -@end quotation -@cindex data, fixed-width -@cindex fixed-width data -@cindex advanced features, fixed-width data -@command{gawk} provides a facility for dealing with -fixed-width fields with no distinctive field separator. For example, -data of this nature arises in the input for old Fortran programs where -numbers are run together, or in the output of programs that did not -anticipate the use of their output as input for other programs. +@command{gawk} provides a facility for dealing with fixed-width fields +with no distinctive field separator. For example, data of this nature +arises in the input for old Fortran programs where numbers are run +together, or in the output of programs that did not anticipate the use +of their output as input for other programs. An example of the latter is a table where all the columns are lined up by the use of a variable number of spaces and @emph{empty fields are just @@ -7639,15 +7704,10 @@ dave ttyq4 26Jun9115days 46 46 wnewmail @end group @end example -The following program takes the above input, converts the idle time to +The following program takes this input, converts the idle time to number of seconds, and prints out the first two fields and the calculated idle time: -@quotation NOTE -This program uses a number of @command{awk} features that -haven't been introduced yet. -@end quotation - @example BEGIN @{ FIELDWIDTHS = "9 6 10 6 7 7 35" @} NR > 2 @{ @@ -7666,6 +7726,11 @@ NR > 2 @{ @} @end example +@quotation NOTE +The preceding program uses a number of @command{awk} features that +haven't been introduced yet. +@end quotation + Running the program on the data produces the following results: @example @@ -7711,17 +7776,16 @@ else This information is useful when writing a function that needs to temporarily change @code{FS} or @code{FIELDWIDTHS}, read some records, and then restore the original settings -(@pxref{Passwd Functions}, +(@DBPXREF{Passwd Functions} for an example of such a function). @node Splitting By Content -@section Defining Fields By Content +@section Defining Fields by Content -@quotation NOTE +@c O'Reilly doesn't like it as a note the first thing in the section. This @value{SECTION} discusses an advanced feature of @command{gawk}. If you are a novice @command{awk} user, you might want to skip it on the first reading. -@end quotation @cindex advanced features, specifying field content Normally, when using @code{FS}, @command{gawk} defines the fields as the @@ -7732,12 +7796,12 @@ However, there are times when you really want to define the fields by what they are, and not by what they are not. The most notorious such case -is so-called @dfn{comma separated value} (CSV) data. Many spreadsheet programs, +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 -one of the fields contains an @emph{embedded} comma. While there is no -formal standard specification for CSV data@footnote{At least, we don't know of one.}, +one of the fields contains an @emph{embedded} comma. Although there is no +formal standard specification for CSV data,@footnote{At least, we don't know of one.} in such cases, most programs embed the field in double quotes. So we might have data like this: @@ -7753,7 +7817,7 @@ The @code{FPAT} variable offers a solution for cases like this. The value of @code{FPAT} should be a string that provides a regular expression. This regular expression describes the contents of each field. -In the case of CSV data as presented above, each field is either ``anything that +In the case of CSV data as presented here, each field is either ``anything that is not a comma,'' or ``a double quote, anything that is not a double quote, and a closing double quote.'' If written as a regular expression constant (@pxref{Regexp}), @@ -7818,10 +7882,10 @@ will be @code{"FPAT"} if content-based field splitting is being used. @quotation NOTE Some programs export CSV data that contains embedded newlines between the double quotes. @command{gawk} provides no way to deal with this. -Since there is no formal specification for CSV data, there isn't much +Because no formal specification for CSV data exists, there isn't much more to be done; the @code{FPAT} mechanism provides an elegant solution for the majority -of cases, and the @command{gawk} developers are satisfied with that. +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 @@ -7975,7 +8039,7 @@ $ @kbd{awk -f addrs.awk addresses} @dots{} @end example -@xref{Labels Program}, for a more realistic program that deals with +@DBXREF{Labels Program} for a more realistic program dealing with address lists. The following list summarizes how records are split, based on the value of @ifinfo @@ -8070,7 +8134,7 @@ represents a shell command. @quotation NOTE When @option{--sandbox} is specified (@pxref{Options}), -reading lines from files, pipes and coprocesses is disabled. +reading lines from files, pipes, and coprocesses is disabled. @end quotation @menu @@ -8213,7 +8277,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. @@ -8267,7 +8331,7 @@ you want your program to be portable to all @command{awk} implementations. Use @samp{getline @var{var} < @var{file}} to read input from the file -@var{file}, and put it in the variable @var{var}. As above, @var{file} +@var{file}, and put it in the variable @var{var}. As earlier, @var{file} is a string-valued expression that specifies the file from which to read. In this version of @code{getline}, none of the predefined variables are @@ -8303,7 +8367,7 @@ One deficiency of this program is that it does not process nested @code{@@include} statements (i.e., @code{@@include} statements in included files) the way a true macro preprocessor would. -@xref{Igawk Program}, for a program +@DBXREF{Igawk Program} for a program that does handle nested @code{@@include} statements. @node Getline/Pipe @@ -8602,7 +8666,7 @@ and whether the variant is standard or a @command{gawk} extension. Note: for each variant, @command{gawk} sets the @code{RT} predefined variable. @float Table,table-getline-variants -@caption{@code{getline} Variants and What They Set} +@caption{@code{getline} variants and what they set} @multitable @columnfractions .33 .38 .27 @headitem Variant @tab Effect @tab @command{awk} / @command{gawk} @item @code{getline} @tab Sets @code{$0}, @code{NF}, @code{FNR}, @code{NR}, and @code{RT} @tab @command{awk} @@ -8620,7 +8684,7 @@ Note: for each variant, @command{gawk} sets the @code{RT} predefined variable. @c ENDOFRANGE infir @node Read Timeout -@section Reading Input With A Timeout +@section Reading Input with a Timeout @cindex timeout, reading input @cindex differences in @command{awk} and @command{gawk}, read timeouts @@ -8628,7 +8692,7 @@ 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 +on a per input, command, or connection basis, by setting a special element in the @code{PROCINFO} array (@pxref{Auto-set}): @example @@ -8702,11 +8766,11 @@ You should not assume that the read operation will block exactly after the tenth record has been printed. It is possible that @command{gawk} will read and buffer more than one record's worth of data the first time. Because of this, changing the value -of timeout like in the above example is not very useful. +of timeout like in the preceding example is not very useful. @end quotation -If the @code{PROCINFO} element is not present and the environment -variable @env{GAWK_READ_TIMEOUT} exists, +If the @code{PROCINFO} element is not present and the +@env{GAWK_READ_TIMEOUT} environment variable exists, @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 @@ -8727,7 +8791,7 @@ or the attempt to open a FIFO special file for reading can block indefinitely until some other process opens it for writing. @node Command-line directories -@section Directories On The Command Line +@section Directories on the Command Line @cindex differences in @command{awk} and @command{gawk}, command-line directories @cindex directories, command-line @cindex command line, directories on @@ -8742,14 +8806,14 @@ command line, but otherwise ignores it. This makes it easier to use shell wildcards with your @command{awk} program: @example -$ @kbd{gawk -f whizprog.awk *} @ii{Directories could kill this progam} +$ @kbd{gawk -f whizprog.awk *} @ii{Directories could kill this program} @end example If either of the @option{--posix} or @option{--traditional} options is given, then @command{gawk} reverts to treating a directory on the command line as a fatal error. -@xref{Extension Sample Readdir}, for a way to treat directories +@DBXREF{Extension Sample Readdir} for a way to treat directories as usable data from an @command{awk} program. @node Input Summary @@ -8776,7 +8840,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 record 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. @@ -8790,7 +8854,7 @@ greater than @code{NF} creates the field and rebuilds the record, using thing. Decrementing @code{NF} throws away fields and rebuilds the record. @item -Field splitting is more complicated than record splitting. +Field splitting is more complicated than record splitting: @multitable @columnfractions .40 .45 .15 @headitem Field separator value @tab Fields are split @dots{} @tab @command{awk} / @command{gawk} @@ -8863,7 +8927,7 @@ The @code{print} statement is not limited when computing @emph{which} values to print. However, with two exceptions, you cannot specify @emph{how} to print them---how many columns, whether to use exponential notation or not, and so on. -(For the exceptions, @pxref{Output Separators}, and +(For the exceptions, @DBPXREF{Output Separators} and @ref{OFMT}.) For printing with specifications, you need the @code{printf} statement (@pxref{Printf}). @@ -9060,14 +9124,14 @@ separated by single spaces. However, this doesn't need to be the case; a single space is simply the default. Any string of characters may be used as the @dfn{output field separator} by setting the predefined variable @code{OFS}. The initial value of this variable -is the string @w{@code{" "}}---that is, a single space. +is the string @w{@code{" "}} (i.e., a single space). -The output from an entire @code{print} statement is called an -@dfn{output record}. Each @code{print} statement outputs one output -record, and then outputs a string called the @dfn{output record separator} -(or @code{ORS}). The initial -value of @code{ORS} is the string @code{"\n"}; i.e., a newline -character. Thus, each @code{print} statement normally makes a separate line. +The output from an entire @code{print} statement is called an @dfn{output +record}. Each @code{print} statement outputs one output record, and +then outputs a string called the @dfn{output record separator} (or +@code{ORS}). The initial value of @code{ORS} is the string @code{"\n"} +(i.e., a newline character). Thus, each @code{print} statement normally +makes a separate line. @cindex output, records @cindex output record separator, See @code{ORS} variable @@ -9090,27 +9154,27 @@ newline: $ @kbd{awk 'BEGIN @{ OFS = ";"; ORS = "\n\n" @}} > @kbd{@{ print $1, $2 @}' mail-list} @print{} Amelia;555-5553 -@print{} +@print{} @print{} Anthony;555-3412 -@print{} +@print{} @print{} Becky;555-7685 -@print{} +@print{} @print{} Bill;555-1675 -@print{} +@print{} @print{} Broderick;555-0542 -@print{} +@print{} @print{} Camilla;555-2912 -@print{} +@print{} @print{} Fabius;555-1234 -@print{} +@print{} @print{} Julie;555-6699 -@print{} +@print{} @print{} Martin;555-6480 -@print{} +@print{} @print{} Samuel;555-3430 -@print{} +@print{} @print{} Jean-Paul;555-2127 -@print{} +@print{} @end example If the value of @code{ORS} does not contain a newline, the program's output @@ -9191,7 +9255,7 @@ printf @var{format}, @var{item1}, @var{item2}, @dots{} @end example @noindent -As print @code{print}, the entire list of arguments may optionally be +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, it can be confused with an output redirection (@pxref{Redirection}). @@ -9299,7 +9363,7 @@ which follow the decimal point. (The @samp{4.3} represents two modifiers, discussed in the next @value{SUBSECTION}.) -On systems supporting IEEE 754 floating point format, values +On systems supporting IEEE 754 floating-point format, values representing negative infinity are formatted as @samp{-inf} or @samp{-infinity}, @@ -9330,7 +9394,7 @@ Print a string. @item @code{%u} Print an unsigned decimal integer. (This format is of marginal use, because all numbers in @command{awk} -are floating-point; it is provided primarily for compatibility with C.) +are floating point; it is provided primarily for compatibility with C.) @item @code{%x}, @code{%X} Print an unsigned hexadecimal integer; @@ -9423,7 +9487,7 @@ says to always supply a sign for numeric conversions, even if the data to format is positive. The @samp{+} overrides the space modifier. @item # -Use an ``alternate form'' for certain control letters. +Use an ``alternative form'' for certain control letters. For @code{%o}, supply a leading zero. For @code{%x} and @code{%X}, supply a leading @code{0x} or @samp{0X} for a nonzero result. @@ -9440,7 +9504,7 @@ value to print. @item ' A single quote or apostrophe character is a POSIX extension to ISO C. -It indicates that the integer part of a floating point value, or the +It indicates that the integer part of a floating-point value, or the entire part of an integer decimal value, should have a thousands-separator character in it. This only works in locales that support such characters. For example: @@ -9521,7 +9585,7 @@ prints @samp{foob}. @end table The C library @code{printf}'s dynamic @var{width} and @var{prec} -capability (for example, @code{"%*.*s"}) is supported. Instead of +capability (e.g., @code{"%*.*s"}) is supported. Instead of supplying explicit @var{width} and/or @var{prec} values in the format string, they are passed in the argument list. For example: @@ -9621,7 +9685,7 @@ awk 'BEGIN @{ print "Name Number" @{ printf "%-10s %s\n", $1, $2 @}' mail-list @end example -The above example mixes @code{print} and @code{printf} statements in +The preceding example mixes @code{print} and @code{printf} statements in the same program. Using just @code{printf} statements can produce the same results: @@ -9768,7 +9832,7 @@ close(report) The @code{close()} function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to it. -@xref{Close Files And Pipes}, +@DBXREF{Close Files And Pipes} for more information. This example also illustrates the use of a variable to represent @@ -9792,9 +9856,9 @@ but subsidiary to, the @command{awk} program. This feature is a @command{gawk} extension, and is not available in POSIX @command{awk}. -@xref{Getline/Coprocess}, +@DBXREF{Getline/Coprocess} for a brief discussion. -@xref{Two-way I/O}, +@DBXREF{Two-way I/O} for a more complete discussion. @end table @@ -9818,7 +9882,7 @@ print "Avoid improbability generators" >> "guide.txt" @noindent 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, since the output file +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 for the same file is definitely poor style, and is confusing to readers @@ -9872,7 +9936,7 @@ The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. -@xref{Shell Quoting}, for a function that can help in generating +@DBXREF{Shell Quoting} for a function that can help in generating command lines to be fed to the shell. @docbook @@ -9907,7 +9971,7 @@ The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. -@xref{Shell Quoting}, for a function that can help in generating +@DBXREF{Shell Quoting} for a function that can help in generating command lines to be fed to the shell. @end cartouche @end ifnotdocbook @@ -9973,7 +10037,7 @@ that happens, writing to the screen is not correct. In fact, if terminal at all. Then opening @file{/dev/tty} fails. -@command{gawk}, BWK @command{awk} and @command{mawk} provide +@command{gawk}, BWK @command{awk}, and @command{mawk} provide special @value{FN}s for accessing the three standard streams. If the @value{FN} matches one of these special names when @command{gawk} (or one of the others) redirects input or output, then it directly uses @@ -10016,7 +10080,7 @@ It is a common error to omit the quotes, which leads to confusing results. @command{gawk} does not treat these @value{FN}s as special when -in POSIX compatibility mode. However, since BWK @command{awk} +in POSIX-compatibility mode. However, because BWK @command{awk} supports them, @command{gawk} does support them even when invoked with the @option{--traditional} option (@pxref{Options}). @@ -10025,7 +10089,7 @@ invoked with the @option{--traditional} option (@pxref{Options}). @c STARTOFRANGE gfn @cindex @command{gawk}, file names in -Besides access to standard input, stanard output, and standard error, +Besides access to standard input, standard output, and standard error, @command{gawk} provides access to any open file descriptor. Additionally, there are special @value{FN}s reserved for TCP/IP networking. @@ -10074,7 +10138,7 @@ This is done using a special @value{FN} of the form: @file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}} @end example -The @var{net-type} is one of @samp{inet}, @samp{inet4} or @samp{inet6}. +The @var{net-type} is one of @samp{inet}, @samp{inet4}, or @samp{inet6}. The @var{protocol} is one of @samp{tcp} or @samp{udp}, and the other fields represent the other essential pieces of information for making a networking connection. @@ -10263,7 +10327,7 @@ is not closed and released until @code{close()} is called or @command{awk} exits. @code{close()} silently does nothing if given an argument that -does not represent a file, pipe or coprocess that was opened with +does not represent a file, pipe, or coprocess that was opened with a redirection. In such a case, it returns a negative value, indicating an error. In addition, @command{gawk} sets @code{ERRNO} to a string indicating the error. @@ -10302,9 +10366,10 @@ which describes it in more detail and gives an example. @cindex Unix @command{awk}, @code{close()} function and In many older versions of Unix @command{awk}, the @code{close()} function -is actually a statement. It is a syntax error to try and use the return -value from @code{close()}: +is actually a statement. @value{DARKCORNER} +It is a syntax error to try and use the return +value from @code{close()}: @example command = "@dots{}" @@ -10358,9 +10423,10 @@ when closing a pipe. @cindex Unix @command{awk}, @code{close()} function and In many older versions of Unix @command{awk}, the @code{close()} function -is actually a statement. It is a syntax error to try and use the return -value from @code{close()}: +is actually a statement. @value{DARKCORNER} +It is a syntax error to try and use the return +value from @code{close()}: @example command = "@dots{}" @@ -10424,11 +10490,11 @@ Output from both @code{print} and @code{printf} may be redirected to files, pipes, and coprocesses. @item -@command{gawk} provides special file names for access to standard input, -output and error, and for network communications. +@command{gawk} provides special @value{FN}s for access to standard input, +output, and error, and for network communications. @item -Use @code{close()} to close open file, pipe and coprocess redirections. +Use @code{close()} to close open file, pipe, and coprocess redirections. For coprocesses, it is possible to close only one direction of the communications. @@ -10496,7 +10562,7 @@ combinations of these with various operators. @end menu @node Values -@section Constants, Variables and Conversions +@section Constants, Variables, and Conversions Expressions are built up from values and the operations performed upon them. This @value{SECTION} describes the elementary objects @@ -10522,7 +10588,7 @@ string, and regular expression. Each is used in the appropriate context when you need a data value that isn't going to change. Numeric constants can -have different forms, but are stored identically internally. +have different forms, but are internally stored in an identical manner. @menu * Scalar Constants:: Numeric and string constants. @@ -10538,7 +10604,7 @@ have different forms, but are stored identically internally. A @dfn{numeric constant} stands for a number. This number can be an integer, a decimal fraction, or a number in scientific (exponential) notation.@footnote{The internal representation of all numbers, -including integers, uses double precision floating-point numbers. +including integers, uses double-precision floating-point numbers. On most modern systems, these are in IEEE 754 standard format. @xref{Arbitrary Precision Arithmetic}, for much more information.} Here are some examples of numeric constants that all @@ -10552,7 +10618,7 @@ have the same value: @cindex string constants A string constant consists of a sequence of characters enclosed in -double-quotation marks. For example: +double quotation marks. For example: @example "parrot" @@ -10574,13 +10640,13 @@ implementations may have difficulty with some character codes. @cindex numbers, octal @cindex numbers, hexadecimal -In @command{awk}, all numbers are in decimal; i.e., base 10. Many other +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, etc. +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. -In hexadecimal, there are 16 digits. Since the everyday 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} @@ -10632,11 +10698,12 @@ you can use the @code{strtonum()} function 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 @ref{Bitwise Functions}, +see @DBREF{Bitwise Functions} for more information. -Unlike some early C implementations, @samp{8} and @samp{9} are not valid -in octal constants; e.g., @command{gawk} treats @samp{018} as decimal 18: +Unlike 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: @example $ @kbd{gawk 'BEGIN @{ print "021 is", 021 ; print 018 @}'} @@ -10722,7 +10789,7 @@ matched. However, regexp constants (such as @code{/foo/}) may be used like simple expressions. When a regexp constant appears by itself, it has the same meaning as if it appeared -in a pattern, i.e., @samp{($0 ~ /foo/)} +in a pattern (i.e., @samp{($0 ~ /foo/)}). @value{DARKCORNER} @xref{Expression Patterns}. This means that the following two code segments: @@ -10819,7 +10886,7 @@ either @code{sub()} or @code{gsub()}. However, what really happens is that the @code{pat} parameter is 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, since passing a truth value in +a parameter to a user-defined function, because passing a truth value in this way is probably not what was intended. @c ENDOFRANGE rec @@ -10859,7 +10926,7 @@ variable's current value. Variables are given new values with @dfn{decrement operators}. @xref{Assignment Ops}. In addition, the @code{sub()} and @code{gsub()} functions can -change a variable's value, and the @code{match()}, @code{split()} +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}. @@ -10867,7 +10934,7 @@ array parameters. @xref{String Functions}. @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 -record). @xref{Built-in Variables}, for a list of the predefined variables. +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 @command{awk}. All predefined variables' names are entirely uppercase. @@ -10908,7 +10975,7 @@ as in the following: the variable is set at the very beginning, even before the @code{BEGIN} rules execute. The @option{-v} option and its assignment must precede all the @value{FN} arguments, as well as the program text. -(@xref{Options}, for more information about +(@DBXREF{Options} for more information about the @option{-v} option.) Otherwise, the variable assignment is performed at a time determined by its position among the input file arguments---after the processing of the @@ -10948,7 +11015,7 @@ sequences @node Conversion @subsection Conversion of Strings and Numbers -Number to string and string to number conversion are generally +Number-to-string and string-to-number conversion are generally straightforward. There can be subtleties to be aware of; this @value{SECTION} discusses this important facet of @command{awk}. @@ -10959,7 +11026,7 @@ this @value{SECTION} discusses this important facet of @command{awk}. @end menu @node Strings And Numbers -@subsubsection How @command{awk} Converts Between Strings And Numbers +@subsubsection How @command{awk} Converts Between Strings and Numbers @cindex converting, strings to numbers @cindex strings, converting @@ -10990,7 +11057,7 @@ string, concatenate that number with the empty string, @code{""}. To force a string to be converted to a number, add zero to that string. A string is converted to a number by interpreting any numeric prefix of the string as numerals: -@code{"2.5"} converts to 2.5, @code{"1e3"} converts to 1000, and @code{"25fix"} +@code{"2.5"} converts to 2.5, @code{"1e3"} converts to 1,000, and @code{"25fix"} has a numeric value of 25. Strings that can't be interpreted as valid numbers convert to zero. @@ -11030,10 +11097,10 @@ b = a "" @code{b} has the value @code{"12"}, not @code{"12.00"}. @value{DARKCORNER} -@cindex sidebar, Pre-POSIX @command{awk} Used @code{OFMT} For String Conversion +@cindex sidebar, Pre-POSIX @command{awk} Used @code{OFMT} for String Conversion @ifdocbook @docbook -Pre-POSIX @command{awk} Used @code{OFMT} For String Conversion +Pre-POSIX @command{awk} Used @code{OFMT} for String Conversion @end docbook @cindex POSIX @command{awk}, @code{OFMT} variable and @@ -11047,7 +11114,7 @@ specifies the output format to use when printing numbers with @code{print}. conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. -@xref{Print}, for more information on the @code{print} statement. +@DBXREF{Print} for more information on the @code{print} statement. @docbook @@ -11056,7 +11123,7 @@ of cases, old @command{awk} programs do not change their behavior. @ifnotdocbook @cartouche -@center @b{Pre-POSIX @command{awk} Used @code{OFMT} For String Conversion} +@center @b{Pre-POSIX @command{awk} Used @code{OFMT} for String Conversion} @cindex POSIX @command{awk}, @code{OFMT} variable and @@ -11070,7 +11137,7 @@ specifies the output format to use when printing numbers with @code{print}. conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. -@xref{Print}, for more information on the @code{print} statement. +@DBXREF{Print} for more information on the @code{print} statement. @end cartouche @end ifnotdocbook @@ -11093,7 +11160,7 @@ The POSIX standard says that @command{awk} always uses the period as the decimal point when reading the @command{awk} program source code, and for command-line variable assignments (@pxref{Other Arguments}). However, when interpreting input data, for @code{print} and @code{printf} output, -and for number to string conversion, the local decimal point character +and for number-to-string conversion, the local decimal point character is used. @value{DARKCORNER} In all cases, numbers in source code and in input data cannot have a thousands separator. Here are some examples indicating the difference in behavior, on a GNU/Linux system: @@ -11118,7 +11185,7 @@ as the full number including the fractional part, 4.321. Some earlier versions of @command{gawk} fully complied with this aspect of the standard. However, many users in non-English locales complained -about this behavior, since their data used a period as the decimal +about this behavior, because their data used a period as the decimal 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 @@ -11131,7 +11198,7 @@ point character is used and when a period is used. Some of these features have not been described yet. @float Table,table-locale-affects -@caption{Locale Decimal Point versus A Period} +@caption{Locale decimal point versus a period} @multitable @columnfractions .15 .20 .45 @headitem Feature @tab Default @tab @option{--posix} or @option{--use-lc-numeric} @item @code{%'g} @tab Use locale @tab Use locale @@ -11141,13 +11208,13 @@ 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 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}. @node All Operators -@section Operators: Doing Something With Values +@section Operators: Doing Something with Values This @value{SECTION} introduces the @dfn{operators} which make use of the values provided by constants and variables. @@ -11226,7 +11293,7 @@ Multiplication. Division; because all numbers in @command{awk} are floating-point numbers, the result is @emph{not} rounded to an integer---@samp{3 / 4} has the value 0.75. (It is a common mistake, especially for C programmers, -to forget that @emph{all} numbers in @command{awk} are floating-point, +to forget that @emph{all} numbers in @command{awk} are floating point, and that division of integer-looking constants produces a real number, not an integer.) @@ -11311,7 +11378,7 @@ $ @kbd{awk '@{ print "Field number one:" $1 @}' mail-list} @cindex troubleshooting, string concatenation Because string concatenation does not have an explicit operator, it is -often necessary to insure that it happens at the right time by using +often necessary to ensure that it happens at the right time by using parentheses to enclose the items to concatenate. For example, you might expect that the following code fragment concatenates @code{file} and @code{name}: @@ -11573,7 +11640,14 @@ The indices of @code{bar} are practically guaranteed to be different, because @code{rand()} returns different values each time it is called. (Arrays and the @code{rand()} function haven't been covered yet. @xref{Arrays}, -and see @ref{Numeric Functions}, for more information). +and +@ifnotdocbook +@DBPXREF{Numeric Functions} +@end ifnotdocbook +@ifdocbook +@DBREF{Numeric Functions} +@end ifdocbook +for more information). This example illustrates an important fact about assignment operators: the lefthand expression is only evaluated @emph{once}. @@ -11606,20 +11680,20 @@ to a number. @cindex @code{*} (asterisk), @code{**=} operator @cindex asterisk (@code{*}), @code{**=} operator @float Table,table-assign-ops -@caption{Arithmetic Assignment Operators} +@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} @value{COMMONEXT} @end multitable @end float @@ -11655,7 +11729,7 @@ This is most notable in some commercial @command{awk} versions. For example: @example -$ awk /==/ /dev/null +$ @kbd{awk /==/ /dev/null} @error{} awk: syntax error at source line 1 @error{} context is @error{} >>> /= <<< @@ -11701,7 +11775,7 @@ This is most notable in some commercial @command{awk} versions. For example: @example -$ awk /==/ /dev/null +$ @kbd{awk /==/ /dev/null} @error{} awk: syntax error at source line 1 @error{} context is @error{} >>> /= <<< @@ -11754,7 +11828,7 @@ but with the side effect of incrementing it. The post-increment @samp{foo++} is nearly the same as writing @samp{(foo += 1) - 1}. It is not perfectly equivalent because all numbers in -@command{awk} are floating-point---in floating-point, @samp{foo + 1 - 1} does +@command{awk} are floating point---in floating point, @samp{foo + 1 - 1} does not necessarily equal @code{foo}. But the difference is minute as long as you stick to numbers that are fairly small (less than @iftex @@ -11917,8 +11991,8 @@ You should avoid such things in your own programs. @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. @@ -11974,7 +12048,7 @@ the string constant @code{"0"} is actually true, because it is non-null. @subsection Variable Typing and Comparison Expressions @quotation @i{The Guide is definitive. Reality is frequently inaccurate.} -@author The Hitchhiker's Guide to the Galaxy +@author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy} @end quotation @c STARTOFRANGE comex @@ -12002,7 +12076,7 @@ compares variables. @end menu @node Variable Typing -@subsubsection String Type Versus Numeric Type +@subsubsection String Type versus Numeric Type @cindex numeric, strings @cindex strings, numeric @@ -12028,7 +12102,7 @@ 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 +@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. @@ -12229,18 +12303,18 @@ operators}, which are a superset of those in C. @cindex exclamation point (@code{!}), @code{!~} operator @cindex @code{in} operator @float Table,table-relational-ops -@caption{Relational Operators} +@caption{Relational operators} @multitable @columnfractions .25 .75 @headitem Expression @tab Result -@item @var{x} @code{<} @var{y} @tab True if @var{x} is less than @var{y}. -@item @var{x} @code{<=} @var{y} @tab True if @var{x} is less than or equal to @var{y}. -@item @var{x} @code{>} @var{y} @tab True if @var{x} is greater than @var{y}. -@item @var{x} @code{>=} @var{y} @tab True if @var{x} is greater than or equal to @var{y}. -@item @var{x} @code{==} @var{y} @tab True if @var{x} is equal to @var{y}. -@item @var{x} @code{!=} @var{y} @tab True if @var{x} is not equal to @var{y}. -@item @var{x} @code{~} @var{y} @tab True if the string @var{x} matches the regexp denoted by @var{y}. -@item @var{x} @code{!~} @var{y} @tab True if the string @var{x} does not match the regexp denoted by @var{y}. -@item @var{subscript} @code{in} @var{array} @tab True if the array @var{array} has an element with the subscript @var{subscript}. +@item @var{x} @code{<} @var{y} @tab True if @var{x} is less than @var{y} +@item @var{x} @code{<=} @var{y} @tab True if @var{x} is less than or equal to @var{y} +@item @var{x} @code{>} @var{y} @tab True if @var{x} is greater than @var{y} +@item @var{x} @code{>=} @var{y} @tab True if @var{x} is greater than or equal to @var{y} +@item @var{x} @code{==} @var{y} @tab True if @var{x} is equal to @var{y} +@item @var{x} @code{!=} @var{y} @tab True if @var{x} is not equal to @var{y} +@item @var{x} @code{~} @var{y} @tab True if the string @var{x} matches the regexp denoted by @var{y} +@item @var{x} @code{!~} @var{y} @tab True if the string @var{x} does not match the regexp denoted by @var{y} +@item @var{subscript} @code{in} @var{array} @tab True if the array @var{array} has an element with the subscript @var{subscript} @end multitable @end float @@ -12278,24 +12352,24 @@ The following list of expressions illustrates the kinds of comparisons @table @code @item 1.5 <= 2.0 -numeric comparison (true) +Numeric comparison (true) @item "abc" >= "xyz" -string comparison (false) +String comparison (false) @item 1.5 != " +2" -string comparison (true) +String comparison (true) @item "1e2" < "3" -string comparison (true) +String comparison (true) @item a = 2; b = "2" @itemx a == b -string comparison (true) +String comparison (true) @item a = 2; b = " +2" @itemx a == b -string comparison (false) +String comparison (false) @end table In this example: @@ -12348,7 +12422,7 @@ dynamic regexp (@pxref{Regexp Usage}; also @cindex @command{awk}, regexp constants and @cindex regexp constants A constant regular -expression in slashes by itself is also an expression. The regexp +expression in slashes by itself is also an expression. @code{/@var{regexp}/} is an abbreviation for the following comparison expression: @example @@ -12362,7 +12436,7 @@ One special place where @code{/foo/} is @emph{not} an abbreviation for where this is discussed in more detail. @node POSIX String Comparison -@subsubsection String Comparison With POSIX Rules +@subsubsection String Comparison with POSIX Rules The POSIX standard says that string comparison is performed based on the locale's @dfn{collating order}. This is the order in which @@ -12618,13 +12692,13 @@ 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 available in every @command{awk} program. The @code{sqrt()} function is one -of these. @xref{Built-in}, for a list of built-in +of these. @DBXREF{Built-in} for a list of built-in functions and their descriptions. In addition, you can define functions for use in your program. -@xref{User-defined}, +@DBXREF{User-defined} for instructions on how to do this. Finally, @command{gawk} lets you write functions in C or C++ -that may be called from your program: see @ref{Dynamic Extensions}. +that may be called from your program (@pxref{Dynamic Extensions}). @cindex arguments, in function calls The way to use a function is with a @dfn{function call} expression, @@ -12643,7 +12717,7 @@ rand() @ii{no arguments} @cindex troubleshooting, function call syntax @quotation CAUTION -Do not put any space between the function name and the open-parenthesis! +Do not put any space between the function name and the opening parenthesis! A user-defined function name looks just like the name of a variable---a space would make the expression look like concatenation of a variable with an expression inside parentheses. @@ -12664,7 +12738,7 @@ Some of the built-in functions have one or more optional arguments. If those arguments are not supplied, the functions use a reasonable default value. -@xref{Built-in}, for full details. If arguments +@DBXREF{Built-in} for full details. If arguments are omitted in calls to user-defined functions, then those arguments are treated as local variables. Such local variables act like the empty string if referenced where a string value is required, @@ -12819,7 +12893,7 @@ Multiplication, division, remainder. @item @code{+ -} Addition, subtraction. -@item String Concatenation +@item String concatenation There is no special symbol for concatenation. The operands are simply written side by side (@pxref{Concatenation}). @@ -12858,7 +12932,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 (for example, @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)}. @@ -12916,7 +12990,7 @@ For maximum portability, do not use them. @c ENDOFRANGE oppr @node Locales -@section Where You Are Makes A Difference +@section Where You Are Makes a Difference @cindex locale, definition of Modern systems support the notion of @dfn{locales}: a way to tell the @@ -12936,7 +13010,7 @@ character}, to find the record terminator. Locales can affect how dates and times are formatted (@pxref{Time Functions}). For example, a common way to abbreviate the date September -4, 2015 in the United States is ``9/4/15.'' In many countries in +4, 2015, in the United States is ``9/4/15.'' In many countries in Europe, however, it is abbreviated ``4.9.15.'' Thus, the @code{%x} specification in a @code{"US"} locale might produce @samp{9/4/15}, while in a @code{"EUROPE"} locale, it might produce @samp{4.9.15}. @@ -12955,13 +13029,13 @@ in @ref{Conversion}. @itemize @value{BULLET} @item Expressions are the basic elements of computation in programs. They are -built from constants, variables, function calls and combinations of the +built from constants, variables, function calls, and combinations of the various kinds of values with operators. @item @command{awk} supplies three kinds of constants: numeric, string, and regexp. @command{gawk} lets you specify numeric constants in octal -and hexadecimal (bases 8 and 16) in addition to decimal (base 10). +and hexadecimal (bases 8 and 16) as well as decimal (base 10). In certain contexts, a standalone regexp constant such as @code{/foo/} has the same meaning as @samp{$0 ~ /foo/}. @@ -13003,8 +13077,8 @@ or numeric). Function calls return a value which 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 later on in this -@value{DOCUMENT}. +built-in and user-defined functions; this is described in +@ref{Functions}. @item Operator precedence specifies the order in which operations are performed, @@ -13217,7 +13291,7 @@ The subexpressions of a Boolean operator in a pattern can be constant regular expressions, comparisons, or any other @command{awk} expressions. Range patterns are not expressions, so they cannot appear inside Boolean patterns. Likewise, the special patterns @code{BEGIN}, @code{END}, -@code{BEGINFILE} and @code{ENDFILE}, +@code{BEGINFILE}, and @code{ENDFILE}, which never match any input record, are not expressions and cannot appear inside Boolean patterns. @@ -13328,7 +13402,7 @@ They supply startup and cleanup actions for @command{awk} programs. @code{BEGIN} and @code{END} rules must have actions; there is no default action for these rules because there is no current record when they run. @code{BEGIN} and @code{END} rules are often referred to as -``@code{BEGIN} and @code{END} blocks'' by long-time @command{awk} +``@code{BEGIN} and @code{END} blocks'' by longtime @command{awk} programmers. @menu @@ -13359,7 +13433,7 @@ $ @kbd{awk '} This program finds the number of records in the input file @file{mail-list} that contain the string @samp{li}. The @code{BEGIN} rule prints a title for the report. There is no need to use the @code{BEGIN} rule to -initialize the counter @code{n} to zero, since @command{awk} does this +initialize the counter @code{n} to zero, as @command{awk} does this automatically (@pxref{Variables}). The second rule increments the variable @code{n} every time a record containing the pattern @samp{li} is read. The @code{END} rule @@ -13387,7 +13461,7 @@ The order in which library functions are named on the command line controls the order in which their @code{BEGIN} and @code{END} rules are executed. Therefore, you have to be careful when writing such rules in library files so that the order in which they are executed doesn't matter. -@xref{Options}, for more information on +@DBXREF{Options} for more information on using library functions. @xref{Library Functions}, for a number of useful library functions. @@ -13436,11 +13510,11 @@ of Unix @command{awk} do not. The third point follows from the first two. The meaning of @samp{print} inside a @code{BEGIN} or @code{END} rule is the same as always: @samp{print $0}. If @code{$0} is the null string, then this prints an -empty record. Many long time @command{awk} programmers use an unadorned +empty record. Many longtime @command{awk} programmers use an unadorned @samp{print} in @code{BEGIN} and @code{END} rules, to mean @samp{@w{print ""}}, relying on @code{$0} being null. Although one might generally get away with this in @code{BEGIN} rules, it is a very bad idea in @code{END} rules, -at least in @command{gawk}. It is also poor style, since if an empty +at least in @command{gawk}. It is also poor style, because if an empty line is needed in the output, the program should print one explicitly. @cindex @code{next} statement, @code{BEGIN}/@code{END} patterns and @@ -13450,9 +13524,14 @@ line is needed in the output, the program should print one explicitly. Finally, the @code{next} and @code{nextfile} statements are not allowed in a @code{BEGIN} rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements -are not valid in an @code{END} rule, since all the input has been read. -(@xref{Next Statement}, and see -@ref{Nextfile Statement}.) +are not valid in an @code{END} rule, because all the input has been read. +(@DBXREF{Next Statement} and +@ifnotdocbook +@DBPXREF{Nextfile Statement}.) +@end ifnotdocbook +@ifdocbook +@DBREF{Nextfile Statement}.) +@end ifdocbook @c ENDOFRANGE beg @c ENDOFRANGE end @@ -13605,9 +13684,9 @@ 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 messy. It requires a good understanding of the shell's quoting rules @@ -13636,7 +13715,7 @@ The assignment @samp{-v pat="$pattern"} still requires double quotes, in case there is whitespace in the value of @code{$pattern}. The @command{awk} variable @code{pat} could be named @code{pattern} too, but that would be more confusing. Using a variable also -provides more flexibility, since the variable can be used anywhere inside +provides more flexibility, as the variable can be used anywhere inside the program---for printing, as an array subscript, or for any other use---without requiring the quoting tricks at every point in the program. @@ -13709,7 +13788,7 @@ is used in order to put several statements together in the body of an Use the @code{getline} command (@pxref{Getline}). Also supplied in @command{awk} are the @code{next} -statement (@pxref{Next Statement}), +statement (@pxref{Next Statement}) and the @code{nextfile} statement (@pxref{Nextfile Statement}). @@ -13797,7 +13876,7 @@ else print "x is odd" @end example -In this example, if the expression @samp{x % 2 == 0} is true (that is, +In this example, if the expression @samp{x % 2 == 0} is true (i.e., if the value of @code{x} is evenly divisible by two), then the first @code{print} statement is executed; otherwise, the second @code{print} statement is executed. @@ -13876,7 +13955,7 @@ 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 +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. @@ -13923,7 +14002,7 @@ The following is an example of a @code{do} statement: @noindent This program prints each input record 10 times. However, it isn't a very -realistic example, since in this case an ordinary @code{while} would do +realistic example, because in this case an ordinary @code{while} would do just as well. This situation reflects actual experience; only occasionally is there a real use for a @code{do} statement. @@ -14020,7 +14099,7 @@ very common in loops. It can be easier to think of this counting as part of looping rather than as something to do inside the loop. @cindex @code{in} operator -There is an alternate version of the @code{for} loop, for iterating over +There is an alternative version of the @code{for} loop, for iterating over all the indices of an array: @example @@ -14029,7 +14108,7 @@ for (i in array) @end example @noindent -@xref{Scanning an Array}, +@DBXREF{Scanning an Array} for more information on this version of the @code{for} loop. @node Switch Statement @@ -14049,7 +14128,7 @@ are checked for a match in the order they are defined. If no suitable Each @code{case} contains a single constant, be it numeric, string, or regexp. The @code{switch} expression is evaluated, and then each -@code{case}'s constant is compared against the result in turn. The type of constant +@code{case}'s constant is compared against the result in turn. The type of constant determines the comparison: numeric or string do the usual comparisons. A regexp constant does a regular expression match against the string value of the original expression. The general form of the @code{switch} @@ -14096,9 +14175,9 @@ while ((c = getopt(ARGC, ARGV, "aksx")) != -1) @{ @} @end example -Note that if none of the statements specified above halt execution +Note that if none of the statements specified here halt execution of a matched @code{case} statement, execution falls through to the -next @code{case} until execution halts. In the above example, the +next @code{case} until execution halts. In this example, the @code{case} for @code{"?"} falls through to the @code{default} case, which is to call a function named @code{usage()}. (The @code{getopt()} function being called here is @@ -14225,7 +14304,7 @@ BEGIN @{ @end example @noindent -This program loops forever once @code{x} reaches 5, since +This program loops forever once @code{x} reaches 5, because the increment (@samp{x++}) is never reached. @c @cindex @code{continue}, outside of loops @@ -14286,7 +14365,7 @@ Because of the @code{next} statement, the program's subsequent rules won't see the bad record. The error message is redirected to the standard error output stream, as error messages should be. -For more detail see +For more detail, see @ref{Special Files}. If the @code{next} statement causes the end of the input to be reached, @@ -14352,7 +14431,7 @@ rule to skip over a file that would otherwise cause @command{gawk} to exit with a fatal error. In this case, @code{ENDFILE} rules are not executed. @xref{BEGINFILE/ENDFILE}. -While one might think that @samp{close(FILENAME)} would accomplish +Although it might seem that @samp{close(FILENAME)} would accomplish the same as @code{nextfile}, this isn't true. @code{close()} is reserved for closing files, pipes, and coprocesses that are opened with redirections. It is not related to the main processing that @@ -14360,7 +14439,7 @@ opened with redirections. It is not related to the main processing that @quotation NOTE For many years, @code{nextfile} was a -common extension. In September, 2012, it was accepted for +common extension. In September 2012, it was accepted for inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=607, the Austin Group website}. @end quotation @@ -14409,7 +14488,7 @@ 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 the @code{END} rule. -@xref{Assert Function}, +@DBXREF{Assert Function} for an example that does this. @cindex dark corner, @code{exit} statement @@ -14420,7 +14499,7 @@ In the case where an argument is supplied to a first @code{exit} statement, and then @code{exit} is called a second time from an @code{END} rule with no argument, @command{awk} uses the previously supplied exit value. @value{DARKCORNER} -@xref{Exit Status}, for more information. +@DBXREF{Exit Status} for more information. @cindex programming conventions, @code{exit} statement For example, suppose an error condition occurs that is difficult or @@ -14480,7 +14559,7 @@ their areas of activity. @end menu @node User-modified -@subsection Built-in Variables That Control @command{awk} +@subsection Built-In Variables That Control @command{awk} @c STARTOFRANGE bvaru @cindex predefined variables, user-modifiable @c STARTOFRANGE nmbv @@ -14537,7 +14616,7 @@ A space-separated list of columns that tells @command{gawk} how to split input with fixed columnar boundaries. Assigning a value to @code{FIELDWIDTHS} overrides the use of @code{FS} and @code{FPAT} for field splitting. -@xref{Constant Size}, for more information. +@DBXREF{Constant Size} for more information. @cindex @command{gawk}, @code{FPAT} variable in @cindex @code{FPAT} variable @@ -14549,7 +14628,7 @@ A regular expression (as a string) that tells @command{gawk} to create the fields based on text that matches the regular expression. Assigning a value to @code{FPAT} overrides the use of @code{FS} and @code{FIELDWIDTHS} for field splitting. -@xref{Splitting By Content}, for more information. +@DBXREF{Splitting By Content} for more information. @cindex @code{FS} variable @cindex separators, field @@ -14659,12 +14738,12 @@ character. (@xref{Output Separators}.) @cindex @code{PREC} variable @item PREC # -The working precision of arbitrary precision floating-point numbers, +The working precision of arbitrary-precision floating-point numbers, 53 bits by default (@pxref{Setting precision}). @cindex @code{ROUNDMODE} variable @item ROUNDMODE # -The rounding mode to use for arbitrary precision arithmetic on +The rounding mode to use for arbitrary-precision arithmetic on numbers, by default @code{"N"} (@samp{roundTiesToEven} in the IEEE 754 standard; @pxref{Setting the rounding mode}). @@ -14706,7 +14785,7 @@ really accesses @code{foo["A\034B"]} Used for internationalization of programs at the @command{awk} level. It sets the default text domain for specially marked string constants in the source text, as well as for the -@code{dcgettext()}, @code{dcngettext()} and @code{bindtextdomain()} functions +@code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()} functions (@pxref{Internationalization}). The default value of @code{TEXTDOMAIN} is @code{"messages"}. @end table @@ -14716,7 +14795,7 @@ The default value of @code{TEXTDOMAIN} is @code{"messages"}. @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 @@ -14729,7 +14808,7 @@ information to your program. The variables that are specific to @command{gawk} are marked with a pound sign (@samp{#}). These variables are @command{gawk} extensions. In other @command{awk} implementations or if @command{gawk} is in compatibility -mode (@pxref{Options}), they are not special. +mode (@pxref{Options}), they are not special: @c @asis for docbook @table @asis @@ -14770,7 +14849,7 @@ method of accessing command-line arguments. The value of @code{ARGV[0]} can vary from system to system. Also, you should note that the program text is @emph{not} included in @code{ARGV}, nor are any of @command{awk}'s command-line options. -@xref{ARGC and ARGV}, for information +@DBXREF{ARGC and ARGV} for information about how @command{awk} uses these variables. @value{DARKCORNER} @@ -14808,8 +14887,13 @@ Some operating systems may not have environment variables. On such systems, the @code{ENVIRON} array is empty (except for @w{@code{ENVIRON["AWKPATH"]}} and @w{@code{ENVIRON["AWKLIBPATH"]}}; -@pxref{AWKPATH Variable}, and +@DBPXREF{AWKPATH Variable} and +@ifdocbook +@DBREF{AWKLIBPATH Variable}). +@end ifdocbook +@ifnotdocbook @pxref{AWKLIBPATH Variable}). +@end ifnotdocbook @cindex @command{gawk}, @code{ERRNO} variable in @cindex @code{ERRNO} variable @@ -14838,7 +14922,7 @@ The name of the current input file. When no @value{DF}s are listed on the command line, @command{awk} reads from the standard input and @code{FILENAME} is set to @code{"-"}. @code{FILENAME} changes each time a new file is read (@pxref{Reading Files}). Inside a @code{BEGIN} -rule, the value of @code{FILENAME} is @code{""}, since there are no input +rule, the value of @code{FILENAME} is @code{""}, because there are no input files being processed yet.@footnote{Some early implementations of Unix @command{awk} initialized @code{FILENAME} to @code{"-"}, even if there were @value{DF}s to be processed. This behavior was incorrect and should @@ -14870,7 +14954,7 @@ current record. @xref{Changing Fields}. @cindex differences in @command{awk} and @command{gawk}, @code{FUNCTAB} variable @item @code{FUNCTAB #} An array whose indices and corresponding values are the names of all -the built-in, user-defined and extension functions in the program. +the built-in, user-defined, and extension functions in the program. @quotation NOTE Attempting to use the @code{delete} statement with the @code{FUNCTAB} @@ -14964,7 +15048,7 @@ The parent process ID of the current process. If this element exists in @code{PROCINFO}, its value controls the order in which array indices will be processed by @samp{for (@var{indx} in @var{array})} loops. -Since this is an advanced feature, we defer the +This is an advanced feature, so we defer the full description until later; see @ref{Scanning an Array}. @@ -14984,10 +15068,10 @@ The version of @command{gawk}. The following additional elements in the array are available to provide information about the MPFR and GMP libraries -if your version of @command{gawk} supports arbitrary precision arithmetic -(@pxref{Arbitrary Precision Arithmetic}): +if your version of @command{gawk} supports arbitrary-precision arithmetic +(@pxref{Arbitrary Precision Arithmetic}): -@table @code +@table @code @cindex version of GNU MPFR library @item PROCINFO["mpfr_version"] The version of the GNU MPFR library. @@ -15035,7 +15119,7 @@ The @code{PROCINFO} array has the following additional uses: @item It may be used to provide a timeout when reading from any open input file, pipe, or coprocess. -@xref{Read Timeout}, for more information. +@DBXREF{Read Timeout} for more information. @item It may be used to cause coprocesses to communicate over pseudo-ttys @@ -15280,8 +15364,14 @@ use the @code{delete} statement to remove elements from All of these actions are typically done in the @code{BEGIN} rule, before actual processing of the input begins. -@xref{Split Program}, and see -@ref{Tee Program}, for examples +@DBXREF{Split Program} and +@ifnotdocbook +@DBPXREF{Tee Program} +@end ifnotdocbook +@ifdocbook +@DBREF{Tee Program} +@end ifdocbook +for examples of each way of removing elements from @code{ARGV}. To actually get options into an @command{awk} program, @@ -15293,7 +15383,7 @@ awk -f myprog.awk -- -v -q file1 file2 @dots{} @end example The following fragment processes @code{ARGV} in order to examine, and -then remove, the above command-line options: +then remove, the previously mentioned command-line options: @example BEGIN @{ @@ -15329,14 +15419,21 @@ gawk -f myprog.awk -q -v file1 file2 @dots{} @noindent Because @option{-q} is not a valid @command{gawk} option, it and the following @option{-v} are passed on to the @command{awk} program. -(@xref{Getopt Function}, for an @command{awk} library function that +(@DBXREF{Getopt Function} for an @command{awk} library function that parses command-line options.) When designing your program, you should choose options that don't -conflict with @command{gawk}'s, since it will process any options +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 -(@pxref{Executable Scripts}, and @pxref{Options}). +(@DBXREF{Executable Scripts} +and +@ifnotdocbook +@DBPXREF{Options}). +@end ifnotdocbook +@ifdocbook +@DBREF{Options}). +@end ifdocbook @node Pattern Action Summary @section Summary @@ -15502,7 +15599,7 @@ as shown in @inlineraw{docbook, }: @ifnotdocbook @float Figure,figure-array-elements -@caption{A Contiguous Array} +@caption{A contiguous array} @ifinfo @center @image{array-elements, , , Basic Program Stages, txt} @end ifinfo @@ -15514,7 +15611,7 @@ as shown in @inlineraw{docbook, }: @docbook
-A Contiguous Array +A contiguous array @@ -15533,7 +15630,7 @@ position with zero elements before it. @cindex associative arrays @cindex arrays, associative Arrays in @command{awk} are different---they are @dfn{associative}. This means -that each array is a collection of pairs: an index and its corresponding +that each array is a collection of pairs---an index and its corresponding array element value: @ifnotdocbook @@ -15714,7 +15811,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, since @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 @@ -15799,7 +15896,7 @@ This expression tests whether the particular index @var{indx} exists, without the side effect of creating that element if it is not present. The expression has the value one (true) if @code{@var{array}[@var{indx}]} exists and zero (false) if it does not exist. -(We use @var{indx} here, since @samp{index} is the name of a built-in +(We use @var{indx} here, because @samp{index} is the name of a built-in function.) For example, this statement tests whether the array @code{frequencies} contains the index @samp{2}: @@ -15942,7 +16039,7 @@ the word as 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. -@xref{String Functions}, +@DBXREF{String Functions} for more information on the built-in function @code{length()}. @example @@ -15965,7 +16062,7 @@ END @{ @end example @noindent -@xref{Word Sorting}, +@DBXREF{Word Sorting} for a more detailed example of this type. @cindex arrays, elements, order of access by @code{in} operator @@ -16020,7 +16117,7 @@ $ @kbd{nawk -f loopcheck.awk} @end example @node Controlling Scanning -@subsection Using Predefined Array Scanning Orders With @command{gawk} +@subsection Using Predefined Array Scanning Orders with @command{gawk} This @value{SUBSECTION} describes a feature that is specific to @command{gawk}. @@ -16045,7 +16142,7 @@ We describe this now. @item Set @code{PROCINFO["sorted_in"]} to the name of a user-defined function to use for comparison of array elements. This advanced feature -is described later, in @ref{Array Sorting}. +is described later in @ref{Array Sorting}. @end itemize @cindex @code{PROCINFO}, values of @code{sorted_in} @@ -16063,7 +16160,7 @@ the index is @code{"10"} rather than numeric 10.) @item "@@ind_num_asc" Order by indices in ascending order but force them to be treated as numbers in the process. -Any index with a non-numeric value will end up positioned as if it were zero. +Any index with a non-numeric value will end up positioned as if it were zero. @item "@@val_type_asc" Order by element values in ascending order (rather than by indices). @@ -16075,11 +16172,11 @@ which in turn come before all subarrays. @pxref{Arrays of Arrays}.) @item "@@val_str_asc" -Order by element values in ascending order (rather than by indices). Scalar values are +Order by element values in ascending order (rather than by indices). Scalar values are compared as strings. Subarrays, if present, come out last. @item "@@val_num_asc" -Order by element values in ascending order (rather than by indices). Scalar values are +Order by element values in ascending order (rather than by indices). Scalar values are compared as numbers. Subarrays, if present, come out last. When numeric values are equal, the string values are used to provide an ordering: this guarantees consistent results across different @@ -16140,11 +16237,11 @@ $ @kbd{gawk '} When sorting an array by element values, if a value happens to be a subarray then it is considered to be greater than any string or numeric value, regardless of what the subarray itself contains, -and all subarrays are treated as being equal to each other. Their +and all subarrays are treated as being equal to each other. Their order relative to each other is determined by their index strings. Here are some additional things to bear in mind about sorted -array traversal. +array traversal: @itemize @value{BULLET} @item @@ -16164,7 +16261,7 @@ if (save_sorted) @end example @item -As mentioned, the default array traversal order is represented by +As already mentioned, the default array traversal order is represented by @code{"@@unsorted"}. You can also get the default behavior by assigning the null string to @code{PROCINFO["sorted_in"]} or by just deleting the @code{"sorted_in"} element from the @code{PROCINFO} array with @@ -16209,7 +16306,7 @@ The program then changes the value of @code{CONVFMT}. The test @samp{(xyz in data)} generates a new string value from @code{xyz}---this time @code{"12.15"}---because the value of @code{CONVFMT} only allows two significant digits. This test fails, -since @code{"12.15"} is different from @code{"12.153"}. +because @code{"12.15"} is different from @code{"12.153"}. @cindex converting integer array subscripts @cindex integer array indices @@ -16227,19 +16324,19 @@ for (i = 1; i <= maxsub; i++) The ``integer values always convert to strings as integers'' rule has an additional consequence for array indexing. Octal and hexadecimal constants +@ifnotdocbook (@pxref{Nondecimal-numbers}) +@end ifnotdocbook +@ifdocbook +(covered in @pref{Nondecimal-numbers}) +@end ifdocbook are converted internally into numbers, and their original form -is forgotten. -This means, for example, that -@code{array[17]}, -@code{array[021]}, -and -@code{array[0x11]} -all refer to the same element! +is forgotten. This means, for example, that @code{array[17]}, +@code{array[021]}, and @code{array[0x11]} all refer to the same element! As with many things in @command{awk}, the majority of the time things work as you would expect them to. But it is useful to have a precise -knowledge of the actual rules since they can sometimes have a subtle +knowledge of the actual rules, as they can sometimes have a subtle effect on your programs. @node Uninitialized Subscripts @@ -16382,7 +16479,7 @@ by a number of other implementations. @cindex Brian Kernighan's @command{awk} @quotation NOTE For many years, using @code{delete} without a subscript was a common -extension. In September, 2012, it was accepted for inclusion into the +extension. In September 2012, it was accepted for inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=544, the Austin Group website}. @end quotation @@ -16424,7 +16521,7 @@ a = 3 @cindex subscripts in arrays, multidimensional @cindex arrays, multidimensional -A multidimensional array is an array in which an element is identified +A @dfn{multidimensional array} is an array in which an element is identified by a sequence of indices instead of a single index. For example, a two-dimensional array requires two indices. The usual way (in many languages, including @command{awk}) to refer to an element of a @@ -16466,7 +16563,7 @@ stored as @samp{foo["a@@b@@c"]}. @cindex @code{in} operator, index existence in multidimensional arrays To test whether a particular index sequence exists in a multidimensional array, use the same operator (@code{in}) that is -used for single dimensional arrays. Write the whole sequence of indices +used for single-dimensional arrays. Write the whole sequence of indices in parentheses, separated by commas, as the left operand: @example @@ -16590,7 +16687,7 @@ 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 -separated by commas (that is, a regular @command{awk} simulated +separated by commas (i.e., a regular @command{awk} simulated multidimensional subscript). So the following is valid in @command{gawk}: @@ -16608,8 +16705,8 @@ is itself an array and not a scalar: @example a[4] = "An element in a jagged array" @end example - -The terms @dfn{dimension}, @dfn{row} and @dfn{column} are + +The terms @dfn{dimension}, @dfn{row}, and @dfn{column} are meaningless when applied to such an array, but we will use ``dimension'' henceforth to imply the maximum number of indices needed to refer to an existing element. The @@ -16665,14 +16762,14 @@ The @samp{for (item in array)} statement (@pxref{Scanning an Array}) 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) +(i.e., in which each first-level element is itself an +array, not necessarily of the same length) you could use the following code: @example for (i in array) for (j in array[i]) - print array[i][j] + print array[i][j] @end example The @code{isarray()} function (@pxref{Type Functions}) @@ -16682,7 +16779,7 @@ lets you test if an array element is itself an array: for (i in array) @{ if (isarray(array[i]) @{ for (j in array[i]) @{ - print array[i][j] + print array[i][j] @} @} else @@ -16692,7 +16789,7 @@ for (i in array) @{ If the structure of a jagged array of arrays is known in advance, you can often devise workarounds using control statements. For example, -the following code prints the elements of our main array @code{a}: +the following code prints the elements of our main array @code{a}: @example for (i in a) @{ @@ -16702,13 +16799,13 @@ for (i in a) @{ print a[i][j][k] @} else print a[i][j] - @} + @} @} @end example @noindent -@xref{Walking Arrays}, for a user-defined function that ``walks'' an -arbitrarily-dimensioned array of arrays. +@DBXREF{Walking Arrays} for a user-defined function that ``walks'' an +arbitrarily dimensioned array of arrays. Recall that a reference to an uninitialized array element yields a value of @code{""}, the null string. This has one important implication when you @@ -16758,8 +16855,9 @@ special predefined values to @code{PROCINFO["sorted_in"]}. @item Use @samp{delete @var{array}[@var{indx}]} to delete an individual element. -You may also use @samp{delete @var{array}} to delete all of the elements -in the array. This latter feature has been a common extension for many +To delete all of the elements in an array, +use @samp{delete @var{array}}. +This latter feature has been a common extension for many years and is now standard, but may not be supported by all commercial versions of @command{awk}. @@ -16812,7 +16910,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 @@ -16835,7 +16933,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 @@ -16845,7 +16943,7 @@ is a call to the function @code{atan2()} and has two arguments. @cindex programming conventions, functions, calling @cindex whitespace, functions@comma{} calling Whitespace is ignored between the built-in function name and the -open parenthesis, but nonetheless it is good practice to avoid using whitespace +opening parenthesis, but nonetheless it is good practice to avoid using whitespace there. User-defined functions do not permit whitespace in this way, and it is easier to avoid mistakes by following a simple convention that always works---no whitespace after a function name. @@ -16925,7 +17023,6 @@ depends on your machine's floating-point representation. @cindex round to nearest integer Return the nearest integer to @var{x}, located between @var{x} and zero and truncated toward zero. - For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)} is @minus{}3, and @code{int(-3)} is @minus{}3 as well. @@ -17015,7 +17112,7 @@ for generating random numbers to the value @var{x}. Each seed value leads to a particular sequence of random numbers.@footnote{Computer-generated random numbers really are not truly random. They are technically known as ``pseudorandom.'' This means -that while the numbers in a sequence appear to be random, you can in +that although the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again.} Thus, if the seed is set to the same value a second time, the same sequence of random numbers is produced again. @@ -17065,7 +17162,7 @@ doing index calculations, particularly if you are used to C. In the following list, optional parameters are enclosed in square brackets@w{ ([ ]).} Several functions perform string substitution; the full discussion is provided in the description of the @code{sub()} function, which comes -towards the end since the list is presented alphabetically. +toward the end, because the list is presented alphabetically. Those functions that are specific to @command{gawk} are marked with a pound sign (@samp{#}). They are not available in compatibility mode @@ -17091,10 +17188,10 @@ These two functions are similar in behavior, so they are described together. @quotation NOTE -The following description ignores the third argument, @var{how}, since it +The following description ignores the third argument, @var{how}, as it requires understanding features that we have not discussed yet. Thus, the discussion here is a deliberate simplification. (We do provide all -the details later on: @xref{Array Sorting Functions}, for the full story.) +the details later on; see @DBREF{Array Sorting Functions} for the full story.) @end quotation Both functions return the number of elements in the array @var{source}. @@ -17341,7 +17438,7 @@ at which that substring begins (one, if it starts at the beginning of The @var{regexp} argument may be either a regexp constant (@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -17434,7 +17531,7 @@ $ @kbd{echo foooobazbarrrrr |} @end example There may not be subscripts for the start and index for every parenthesized -subexpression, since 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}). @@ -17481,15 +17578,15 @@ 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]}. +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 -return value of -@code{split()} (that is, the number of elements in @var{array}). +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}). The @code{split()} function splits strings into pieces in a manner similar to the way input lines are split into fields. For example: @@ -17525,7 +17622,7 @@ 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} @@ -17539,7 +17636,7 @@ the third argument to be a regexp constant (@code{/abc/}) as well as a string. @value{DARKCORNER} The POSIX standard allows this as well. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between using a string constant or a regexp constant, and the implications for writing your program correctly. @@ -17590,7 +17687,7 @@ Using the @code{strtonum()} function is @emph{not} the same as adding zero to a string value; the automatic coercion of strings to numbers works only for decimal data, not for octal or hexadecimal.@footnote{Unless you use the @option{--non-decimal-data} option, which isn't recommended. -@xref{Nondecimal Data}, for more information.} +@DBXREF{Nondecimal Data} for more information.} Note also that @code{strtonum()} uses the current locale's decimal point for recognizing numbers (@pxref{Locales}). @@ -17608,7 +17705,7 @@ Return the number of substitutions made (zero or one). The @var{regexp} argument may be either a regexp constant (@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -17827,7 +17924,7 @@ Although this makes a certain amount of sense, it can be surprising. @node Gory Details -@subsubsection More About @samp{\} and @samp{&} with @code{sub()}, @code{gsub()}, and @code{gensub()} +@subsubsection More about @samp{\} and @samp{&} with @code{sub()}, @code{gsub()}, and @code{gensub()} @cindex escape processing, @code{gsub()}/@code{gensub()}/@code{sub()} functions @cindex @code{sub()} function, escape processing @@ -17874,7 +17971,7 @@ through unchanged. This is illustrated in @ref{table-sub-escapes}. @c Thank to Karl Berry for help with the TeX stuff. @float Table,table-sub-escapes -@caption{Historical Escape Sequence Processing for @code{sub()} and @code{gsub()}} +@caption{Historical escape sequence processing for @code{sub()} and @code{gsub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -17946,7 +18043,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{GNU @command{awk} rules for @code{sub()} and backslash} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -18009,7 +18106,7 @@ by anything else is not special; the @samp{\} is placed straight into the output These rules are presented in @ref{table-posix-sub}. @float Table,table-posix-sub -@caption{POSIX Rules For @code{sub()} And @code{gsub()}} +@caption{POSIX rules for @code{sub()} and @code{gsub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -18058,12 +18155,12 @@ 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, -it continued to follow the proposed rules, since +it continued to follow the proposed rules, as that had been its behavior for many years. When @value{PVERSION} 4.0.0 was released, the @command{gawk} maintainer made the POSIX rules the default, breaking well over a decade's worth -of backwards compatibility.@footnote{This was rather naive of him, despite +of backward compatibility.@footnote{This was rather naive of him, despite there being a note in this section indicating that the next major version would move to the POSIX rules.} Needless to say, this was a bad idea, and as of @value{PVERSION} 4.0.1, @command{gawk} resumed its historical @@ -18078,7 +18175,7 @@ appears in the generated text and the @samp{\} does not, as shown in @ref{table-gensub-escapes}. @float Table,table-gensub-escapes -@caption{Escape Sequence Processing For @code{gensub()}} +@caption{Escape sequence processing for @code{gensub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -18145,7 +18242,7 @@ Optional parameters are enclosed in square brackets ([ ]): Close the file @var{filename} for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess or pipe is closed. -@xref{Close Files And Pipes}, +@DBXREF{Close Files And Pipes} for more information. When closing a coprocess, it is occasionally useful to first close @@ -18169,13 +18266,13 @@ a pipe or coprocess. @cindex buffers, flushing @cindex output, buffering -Many utility programs @dfn{buffer} their output; i.e., they save information +Many utility programs @dfn{buffer} their output (i.e., they save information to write to a disk file or the screen in memory until there is enough -for it to be worthwhile to send the data to the output device. +for it to be worthwhile to send the data to the output device). This is often more efficient than writing 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; that is, -write the information to its destination, even if a buffer is not full. +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 @command{gawk} to flush its buffers. @@ -18183,11 +18280,11 @@ buffers its output and the @code{fflush()} function forces @cindex extensions, common@comma{} @code{fflush()} function @cindex Brian Kernighan's @command{awk} Brian Kernighan added @code{fflush()} to his @command{awk} in April -of 1992. For two decades, it was a common extension. In December, +1992. For two decades, it was a common extension. In December 2012, it was accepted for inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=634, the Austin Group website}. -POSIX standardizes @code{fflush()} as follows: If there +POSIX standardizes @code{fflush()} as follows: if there is no argument, or if the argument is the null string (@w{@code{""}}), then @command{awk} flushes the buffers for @emph{all} open output files and pipes. @@ -18219,53 +18316,6 @@ a file or pipe that was opened for reading (such as with @code{getline}), or if @var{filename} is not an open file, pipe, or coprocess. In such a case, @code{fflush()} returns @minus{}1, as well. -@item @code{system(@var{command})} -@cindexawkfunc{system} -@cindex invoke shell command -@cindex interacting with other programs -Execute the operating-system -command @var{command} and then return to the @command{awk} program. -Return @var{command}'s exit status. - -For example, if the following fragment of code is put in your @command{awk} -program: - -@example -END @{ - system("date | mail -s 'awk run done' root") -@} -@end example - -@noindent -the system administrator is sent mail when the @command{awk} program -finishes processing input and begins its end-of-input processing. - -Note that redirecting @code{print} or @code{printf} into a pipe is often -enough to accomplish your task. If you need to run many commands, it -is more efficient to simply print them down a pipeline to the shell: - -@example -while (@var{more stuff to do}) - print @var{command} | "/bin/sh" -close("/bin/sh") -@end example - -@noindent -@cindex troubleshooting, @code{system()} function -@cindex @option{--sandbox} option, disabling @code{system()} function -However, if your @command{awk} -program is interactive, @code{system()} is useful for running large -self-contained programs, such as a shell or an editor. -Some operating systems cannot implement the @code{system()} function. -@code{system()} causes a fatal error if it is not supported. - -@quotation NOTE -When @option{--sandbox} is specified, the @code{system()} function is disabled -(@pxref{Options}). -@end quotation - -@end table - @cindex sidebar, Interactive Versus Noninteractive Buffering @ifdocbook @docbook @@ -18275,15 +18325,15 @@ When @option{--sandbox} is specified, the @code{system()} function is disabled @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 -with a user sitting at a keyboard.@footnote{A program is interactive +upon whether 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.} @c Thanks to Walter.Mecky@dresdnerbank.de for this example, and for @c motivating me to write this section. -Interactive programs generally @dfn{line buffer} their output; i.e., they -write out every line. Noninteractive programs wait until they have +Interactive programs generally @dfn{line buffer} their output (i.e., they +write out every line). Noninteractive programs wait until they have a full buffer, which may be many lines of output. Here is an example of the difference: @@ -18326,15 +18376,15 @@ 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 -with a user sitting at a keyboard.@footnote{A program is interactive +upon whether 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.} @c Thanks to Walter.Mecky@dresdnerbank.de for this example, and for @c motivating me to write this section. -Interactive programs generally @dfn{line buffer} their output; i.e., they -write out every line. Noninteractive programs wait until they have +Interactive programs generally @dfn{line buffer} their output (i.e., they +write out every line). Noninteractive programs wait until they have a full buffer, which may be many lines of output. Here is an example of the difference: @@ -18366,6 +18416,53 @@ it is all buffered and sent down the pipe to @command{cat} in one shot. @end cartouche @end ifnotdocbook +@item @code{system(@var{command})} +@cindexawkfunc{system} +@cindex invoke shell command +@cindex interacting with other programs +Execute the operating-system +command @var{command} and then return to the @command{awk} program. +Return @var{command}'s exit status. + +For example, if the following fragment of code is put in your @command{awk} +program: + +@example +END @{ + system("date | mail -s 'awk run done' root") +@} +@end example + +@noindent +the system administrator is sent mail when the @command{awk} program +finishes processing input and begins its end-of-input processing. + +Note that redirecting @code{print} or @code{printf} into a pipe is often +enough to accomplish your task. If you need to run many commands, it +is more efficient to simply print them down a pipeline to the shell: + +@example +while (@var{more stuff to do}) + print @var{command} | "/bin/sh" +close("/bin/sh") +@end example + +@noindent +@cindex troubleshooting, @code{system()} function +@cindex @option{--sandbox} option, disabling @code{system()} function +However, if your @command{awk} +program is interactive, @code{system()} is useful for running large +self-contained programs, such as a shell or an editor. +Some operating systems cannot implement the @code{system()} function. +@code{system()} causes a fatal error if it is not supported. + +@quotation NOTE +When @option{--sandbox} is specified, the @code{system()} function is disabled +(@pxref{Options}). +@end quotation + +@end table + @cindex sidebar, Controlling Output Buffering with @code{system()} @ifdocbook @docbook @@ -18389,7 +18486,7 @@ system("") # flush output @command{gawk} treats this use of the @code{system()} function as a special case and is smart enough not to run a shell (or other command interpreter) with the empty command. Therefore, with @command{gawk}, this -idiom is not only useful, it is also efficient. While this method should work +idiom is not only useful, it is also efficient. Although this method should work with other @command{awk} implementations, it does not necessarily avoid starting an unnecessary shell. (Other implementations may only flush the buffer associated with the standard output and not necessarily @@ -18454,7 +18551,7 @@ system("") # flush output @command{gawk} treats this use of the @code{system()} function as a special case and is smart enough not to run a shell (or other command interpreter) with the empty command. Therefore, with @command{gawk}, this -idiom is not only useful, it is also efficient. While this method should work +idiom is not only useful, it is also efficient. Although this method should work with other @command{awk} implementations, it does not necessarily avoid starting an unnecessary shell. (Other implementations may only flush the buffer associated with the standard output and not necessarily @@ -18594,14 +18691,14 @@ Mean Time). Otherwise, the value is formatted for the local time zone. The @var{timestamp} is in the same format as the value returned by the @code{systime()} function. If no @var{timestamp} argument is supplied, @command{gawk} uses the current time of day as the timestamp. -If no @var{format} argument is supplied, @code{strftime()} uses +Without a @var{format} argument, @code{strftime()} uses the value of @code{PROCINFO["strftime"]} as the format string (@pxref{Built-in Variables}). The default string value is @code{@w{"%a %b %e %H:%M:%S %Z %Y"}}. This format string produces output that is equivalent to that of the @command{date} utility. You can assign a new value to @code{PROCINFO["strftime"]} to -change the default format; see below for the various format directives. +change the default format; see the following list for the various format directives. @item @code{systime()} @cindexgawkfunc{systime} @@ -18678,9 +18775,9 @@ This is the ISO 8601 date format. @item %g The year modulo 100 of the ISO 8601 week number, as a decimal number (00--99). -For example, January 1, 2012 is in week 53 of 2011. Thus, the year +For example, January 1, 2012, is in week 53 of 2011. Thus, the year of its ISO 8601 week number is 2011, even though its year is 2012. -Similarly, December 31, 2012 is in week 1 of 2013. Thus, the year +Similarly, December 31, 2012, is in week 1 of 2013. Thus, the year of its ISO week number is 2013, even though its year is 2012. @item %G @@ -18776,7 +18873,7 @@ no time zone is determinable. @item %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH @itemx %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy -``Alternate representations'' for the specifications +``Alternative representations'' for the specifications that use only the second letter (@code{%c}, @code{%C}, and so on).@footnote{If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to ``internationalize'' @@ -18789,7 +18886,7 @@ Other internationalization features are described in A literal @samp{%}. @end table -If a conversion specifier is not one of the above, the behavior is +If a conversion specifier is not one of those just listed, the behavior is undefined.@footnote{This is because ISO C leaves the behavior of the C version of @code{strftime()} undefined and @command{gawk} uses the system's version of @code{strftime()} if it's there. @@ -18833,7 +18930,7 @@ The date in VMS format (e.g., @samp{20-JUN-1991}). @end table @c ENDOFRANGE strf -Additionally, the alternate representations are recognized but their +Additionally, the alternative representations are recognized but their normal representations are used. @cindex @code{date} utility, POSIX @@ -18847,7 +18944,7 @@ interprets the current time according to the format specifiers in the string. For example: @example -$ date '+Today is %A, %B %d, %Y.' +$ @kbd{date '+Today is %A, %B %d, %Y.'} @print{} Today is Monday, September 22, 2014. @end example @@ -18911,8 +19008,10 @@ each successive pair of bits in the operands. Three common operations are bitwise AND, OR, and XOR. The operations are described in @ref{table-bitwise-ops}. +@c 11/2014: Postprocessing turns the docbook informaltable +@c into a table. Hurray for scripting! @float Table,table-bitwise-ops -@caption{Bitwise Operations} +@caption{Bitwise operations} @ifnottex @ifnotdocbook @display @@ -19080,7 +19179,7 @@ Return the value of @var{val}, shifted right by @var{count} bits. Return the bitwise XOR of the arguments. There must be at least two. @end table -For all of these functions, first the double precision floating-point value is +For all of these functions, first the double-precision floating-point value is converted to the widest C unsigned integer type, then the bitwise operation is performed. If the result cannot be represented exactly as a C @code{double}, leading nonzero bits are removed one by one until it can be represented @@ -19179,7 +19278,7 @@ Otherwise, a @code{"0"} is added. The value is then shifted right by one bit and the loop continues until there are no more 1 bits. -If the initial value is zero it returns a simple @code{"0"}. +If the initial value is zero, it returns a simple @code{"0"}. Otherwise, at the end, it pads the value with zeros to represent multiples of 8-bit quantities. This is typical in modern computers. @@ -19216,8 +19315,8 @@ an array or not. The second is inside the body of a user-defined function array or not. @quotation NOTE -Using @code{isarray()} at the global level to test -variables makes no sense. Since you are the one writing the program, you +Using @code{isarray()} at the global level to test +variables makes no sense. Because you are the one writing the program, you are supposed to know if your variables are arrays or not. And in fact, due to the way @command{gawk} works, if you pass the name of a variable that has not been previously used to @code{isarray()}, @command{gawk} @@ -19285,7 +19384,7 @@ The default value for @var{category} is @code{"LC_MESSAGES"}. Complicated @command{awk} programs can often be simplified by defining your own functions. User-defined functions can be called just like built-in ones (@pxref{Function Calls}), but it is up to you to define -them, i.e., to tell @command{awk} what they should do. +them (i.e., to tell @command{awk} what they should do). @menu * Definition Syntax:: How to write definitions and what they mean. @@ -19424,13 +19523,13 @@ func foo() @{ a = sqrt($1) ; print a @} @end example @noindent -Instead it defines a rule that, for each record, concatenates the value +Instead, it defines a rule that, for each record, concatenates the value of the variable @samp{func} with the return value of the function @samp{foo}. If the resulting string is non-null, the action is executed. This is probably not what is desired. (@command{awk} accepts this input as syntactically valid, because functions may be used before they are defined in @command{awk} programs.@footnote{This program won't actually run, -since @code{foo()} is undefined.}) +because @code{foo()} is undefined.}) @cindex portability, functions@comma{} defining To ensure that your @command{awk} programs are portable, always use the @@ -19501,7 +19600,7 @@ The following is an example of a recursive function. It takes a string as an input parameter and returns the string in backwards order. Recursive functions must always have a test that stops the recursion. In this case, the recursion terminates when the input string is -already empty. +already empty: @c 8/2014: Thanks to Mike Brennan for the improved formulation @cindex @code{rev()} user-defined function @@ -19549,7 +19648,7 @@ function ctime(ts, format) @end example You might think that @code{ctime()} could use @code{PROCINFO["strftime"]} -for its format string. That would be a mistake, since @code{ctime()} is +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 @@ -19570,7 +19669,7 @@ the function. @end menu @node Calling A Function -@subsubsection Writing A Function Call +@subsubsection Writing a Function Call A function call consists of the function name followed by the arguments in parentheses. @command{awk} expressions are what you write in the @@ -19585,7 +19684,7 @@ foo(x y, "lose", 4 * z) @quotation CAUTION Whitespace characters (spaces and TABs) are not allowed -between the function name and the open-parenthesis of the argument list. +between the function name and the opening parenthesis of the argument list. If you write whitespace by mistake, @command{awk} might think that you mean to concatenate a variable with an expression in parentheses. However, it notices that you used a function name and not a variable name, and reports @@ -19625,7 +19724,7 @@ function foo(j) print "foo's i=" i @} -BEGIN @{ +BEGIN @{ i = 10 print "top's i=" i foo(0) @@ -19648,13 +19747,13 @@ top's i=3 @end example If you want @code{i} to be local to both @code{foo()} and @code{bar()} do as -follows (the extra-space before @code{i} is a coding convention to +follows (the extra space before @code{i} is a coding convention to indicate that @code{i} is a local variable, not an argument): @example function bar( i) @{ - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) print "bar's i=" i @} @@ -19666,10 +19765,10 @@ function foo(j, i) print "foo's i=" i @} -BEGIN @{ +BEGIN @{ i = 10 print "top's i=" i - foo(0) + foo(0) print "top's i=" i @} @end example @@ -19728,21 +19827,16 @@ At level 2, index 2 is found in a @end example @node Pass By Value/Reference -@subsubsection Passing Function Arguments By Value Or By Reference +@subsubsection Passing Function Arguments by Value Or by Reference In @command{awk}, when you declare a function, there is no way to declare explicitly whether the arguments are passed @dfn{by value} or @dfn{by reference}. -Instead the passing convention is determined at runtime when +Instead, the passing convention is determined at runtime when the function is called according to the following rule: - -@itemize -@item -If the argument is an array variable, then it is passed by reference, -@item -Otherwise the argument is passed by value. -@end itemize +if the argument is an array variable, then it is passed by reference. +Otherwise, the argument is passed by value. @cindex call by value Passing an argument by value means that when a function is called, it @@ -19845,7 +19939,13 @@ If @option{--lint} is specified Some @command{awk} implementations generate a runtime error if you use either the @code{next} statement or the @code{nextfile} statement -(@pxref{Next Statement}, also @pxref{Nextfile Statement}) +(@pxref{Next Statement}, and +@ifdocbook +@ref{Nextfile Statement}) +@end ifdocbook +@ifnotdocbook +@pxref{Nextfile Statement}) +@end ifnotdocbook inside a user-defined function. @command{gawk} does not have this limitation. @c ENDOFRANGE fudc @@ -19901,8 +20001,8 @@ function maxelt(vec, i, ret) @noindent You call @code{maxelt()} with one argument, which is an array name. The local variables @code{i} and @code{ret} are not intended to be arguments; -while there is nothing to stop you from passing more than one argument -to @code{maxelt()}, the results would be strange. The extra space before +there is nothing to stop you from passing more than one argument +to @code{maxelt()} but the results would be strange. The extra space before @code{i} in the function parameter list indicates that @code{i} and @code{ret} are local variables. You should follow this convention when defining functions. @@ -20039,8 +20139,8 @@ variable as the @emph{name} of the function to call. @cindex indirect function calls, @code{@@}-notation @cindex function calls, indirect, @code{@@}-notation for The syntax is similar to that of a regular function call: an identifier -immediately followed by a left parenthesis, any arguments, and then -a closing right parenthesis, with the addition of a leading @samp{@@} +immediately followed by an opening parenthesis, any arguments, and then +a closing parenthesis, with the addition of a leading @samp{@@} character: @example @@ -20049,7 +20149,7 @@ result = @@the_func() # calls the sum() function @end example Here is a full program that processes the previously shown data, -using indirect function calls. +using indirect function calls: @example @c file eg/prog/indirectcall.awk @@ -20090,7 +20190,7 @@ function sum(first, last, ret, i) These two functions expect to work on fields; thus the parameters @code{first} and @code{last} indicate where in the fields to start and end. -Otherwise they perform the expected computations and are not unusual. +Otherwise they perform the expected computations and are not unusual: @example @c file eg/prog/indirectcall.awk @@ -20135,11 +20235,11 @@ $ @kbd{gawk -f indirectcall.awk class_data1} @print{} Biology 101: @print{} sum: <352.8> @print{} average: <88.2> -@print{} +@print{} @print{} Chemistry 305: @print{} sum: <356.4> @print{} average: <89.1> -@print{} +@print{} @print{} English 401: @print{} sum: <376.1> @print{} average: <94.025> @@ -20261,7 +20361,7 @@ function do_sort(first, last, compare, data, i, retval) retval = data[1] for (i = 2; i in data; i++) retval = retval " " data[i] - + return retval @} @c endfile @@ -20307,13 +20407,13 @@ $ @kbd{gawk -f quicksort.awk -f indirectcall.awk class_data2} @print{} average: <88.2> @print{} sort: <78.5 87.0 92.4 94.9> @print{} rsort: <94.9 92.4 87.0 78.5> -@print{} +@print{} @print{} Chemistry 305: @print{} sum: <356.4> @print{} average: <89.1> @print{} sort: <75.2 88.2 94.7 98.3> @print{} rsort: <98.3 94.7 88.2 75.2> -@print{} +@print{} @print{} English 401: @print{} sum: <376.1> @print{} average: <94.025> @@ -20416,7 +20516,7 @@ functions. POSIX @command{awk} provides three kinds of built-in functions: numeric, string, and I/O. @command{gawk} provides functions that sort arrays, work with values representing time, do bit manipulation, determine variable -type (array vs.@: scalar), and internationalize and localize programs. +type (array versus scalar), and internationalize and localize programs. @command{gawk} also provides several extensions to some of standard functions, typically in the form of additional arguments. @@ -20472,7 +20572,7 @@ program. This is equivalent to function pointers in C and C++. @c ENDOFRANGE funcud @ifnotinfo -@part @value{PART2}Problem Solving With @command{awk} +@part @value{PART2}Problem Solving with @command{awk} @end ifnotinfo @ifdocbook @@ -20482,10 +20582,10 @@ It contains the following chapters: @itemize @value{BULLET} @item -@ref{Library Functions}. +@ref{Library Functions} @item -@ref{Sample Programs}. +@ref{Sample Programs} @end itemize @end ifdocbook @@ -20546,9 +20646,9 @@ and would like to contribute them to the @command{awk} user community, see @cindex portability, example programs The programs in this @value{CHAPTER} and in @ref{Sample Programs}, -freely use features that are @command{gawk}-specific. +freely use @command{gawk}-specific features. Rewriting these programs for different implementations of @command{awk} -is pretty straightforward. +is pretty straightforward: @itemize @value{BULLET} @item @@ -20618,7 +20718,7 @@ Library functions often need to have global variables that they can use to preserve state information between calls to the function---for example, @code{getopt()}'s variable @code{_opti} (@pxref{Getopt Function}). -Such variables are called @dfn{private}, since the only functions that need to +Such variables are called @dfn{private}, as the only functions that need to use them are the ones in the library. When writing a library function, you should try to choose names for your @@ -20640,10 +20740,10 @@ In addition, several of the library functions use a prefix that helps indicate what function or set of functions use the variables---for example, @code{_pw_byname()} in the user database routines (@pxref{Passwd Functions}). -This convention is recommended, since it even further decreases the +This convention is recommended, as it even further decreases the chance of inadvertent conflict among variable names. Note that this convention is used equally well for variable names and for private -function names.@footnote{While all the library routines could have +function names.@footnote{Although all the library routines could have been rewritten to use this convention, this was not done, in order to show how our own @command{awk} programming style has evolved and to provide some basis for this discussion.} @@ -20716,7 +20816,7 @@ programming use. @end menu @node Strtonum Function -@subsection Converting Strings To Numbers +@subsection Converting Strings to Numbers The @code{strtonum()} function (@pxref{String Functions}) is a @command{gawk} extension. The following function @@ -20784,7 +20884,7 @@ function mystrtonum(str, ret, n, i, k, c) # a[6] = "1.e3" # a[7] = "1.32" # a[8] = "1.32E2" -# +# # for (i = 1; i in a; i++) # print a[i], strtonum(a[i]), mystrtonum(a[i]) # @} @@ -20798,7 +20898,7 @@ string. It sets @code{k} to the index in @code{"1234567"} of the current octal digit. The return value will either be the same number as the digit, or zero if the character is not there, which will be true for a @samp{0}. -This is safe, since the regexp test in the @code{if} ensures that +This is safe, because the regexp test in the @code{if} ensures that only octal values are converted. Similar logic applies to the code that checks for and converts a @@ -21145,7 +21245,7 @@ is always 1. This means that on those systems, characters have numeric values from 128 to 255. Finally, large mainframe systems use the EBCDIC character set, which uses all 256 values. -While there are other character sets in use on some older systems, +There are other character sets in use on some older systems, but they are not really worth worrying about: @example @@ -21199,7 +21299,7 @@ Good function design is important; this function needs to be general but it should also have a reasonable default behavior. It is called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array indices are numeric---a reasonable -assumption since the array was likely created with @code{split()} +assumption, as the array was likely created with @code{split()} (@pxref{String Functions}): @cindex @code{join()} user-defined function @@ -21252,7 +21352,7 @@ more difficult than they really need to be.} The @code{systime()} and @code{strftime()} functions described in @DBREF{Time Functions} provide the minimum functionality necessary for dealing with the time of day -in human readable form. While @code{strftime()} is extensive, the control +in human-readable form. Although @code{strftime()} is extensive, the control formats are not necessarily easy to remember or intuitively obvious when reading a program. @@ -21343,7 +21443,7 @@ allowed the user to supply an optional timestamp value to use instead of the current time. @node Readfile Function -@subsection Reading A Whole File At Once +@subsection Reading a Whole File At Once Often, it is convenient to have the entire contents of a file available in memory as a single string. A straightforward but naive way to @@ -21403,7 +21503,7 @@ will never match if the file has contents. @command{gawk} reads data from the file into @code{tmp} attempting to match @code{RS}. The match fails after each read, but fails quickly, such that @command{gawk} fills @code{tmp} with the entire contents of the file. -(@xref{Records}, for information on @code{RT} and @code{RS}.) +(@DBXREF{Records} for information on @code{RT} and @code{RS}.) In the case that @code{file} is empty, the return value is the null string. Thus calling code may use something like: @@ -21421,7 +21521,7 @@ test would be @samp{contents == ""}. also reads an entire file into memory. @node Shell Quoting -@subsection Quoting Strings to Pass to The Shell +@subsection Quoting Strings to Pass to the Shell @c included by permission @ignore @@ -21463,7 +21563,7 @@ chmod -w file.flac Note the need for shell quoting. The function @code{shell_quote()} does it. @code{SINGLE} is the one-character string @code{"'"} and -@code{QSINGLE} is the three-character string @code{"\"'\""}. +@code{QSINGLE} is the three-character string @code{"\"'\""}: @example @c file eg/lib/shellquote.awk @@ -21523,7 +21623,7 @@ command-line @value{DF}s. @cindex files, managing, data file boundaries @cindex files, initialization and cleanup -The @code{BEGIN} and @code{END} rules are each executed exactly once at +The @code{BEGIN} and @code{END} rules are each executed exactly once, at the beginning and end of your @command{awk} program, respectively (@pxref{BEGIN/END}). We (the @command{gawk} authors) once had a user who mistakenly thought that the @@ -21595,7 +21695,7 @@ The following version solves the problem: @example @c file eg/lib/ftrans.awk -# ftrans.awk --- handle data file transitions +# ftrans.awk --- handle datafile transitions # # user supplies beginfile() and endfile() functions @c endfile @@ -21623,10 +21723,10 @@ END @{ endfile(_filename_) @} shows how this library function can be used and how it simplifies writing the main program. -@cindex sidebar, So Why Does @command{gawk} have @code{BEGINFILE} and @code{ENDFILE}? +@cindex sidebar, So Why Does @command{gawk} Have @code{BEGINFILE} and @code{ENDFILE}? @ifdocbook @docbook -So Why Does @command{gawk} have @code{BEGINFILE} and @code{ENDFILE}? +So Why Does @command{gawk} Have @code{BEGINFILE} and @code{ENDFILE}? @end docbook @@ -21636,7 +21736,7 @@ functions can do the job, why does @command{gawk} have Good question. Normally, if @command{awk} cannot open a file, this causes an immediate fatal error. In this case, there is no way for a -user-defined function to deal with the problem, since the mechanism for +user-defined function to deal with the problem, as the mechanism for calling it relies on the file being open and at the first record. Thus, the main reason for @code{BEGINFILE} is to give you a ``hook'' to catch files that cannot be processed. @code{ENDFILE} exists for symmetry, @@ -21649,7 +21749,7 @@ and because it provides an easy way to do per-file cleanup processing. @ifnotdocbook @cartouche -@center @b{So Why Does @command{gawk} have @code{BEGINFILE} and @code{ENDFILE}?} +@center @b{So Why Does @command{gawk} Have @code{BEGINFILE} and @code{ENDFILE}?} @@ -21659,7 +21759,7 @@ functions can do the job, why does @command{gawk} have Good question. Normally, if @command{awk} cannot open a file, this causes an immediate fatal error. In this case, there is no way for a -user-defined function to deal with the problem, since the mechanism for +user-defined function to deal with the problem, as the mechanism for calling it relies on the file being open and at the first record. Thus, the main reason for @code{BEGINFILE} is to give you a ``hook'' to catch files that cannot be processed. @code{ENDFILE} exists for symmetry, @@ -21718,8 +21818,8 @@ The @code{rewind()} function relies on the @code{ARGIND} variable (@pxref{Auto-set}), which is specific to @command{gawk}. It also relies on the @code{nextfile} keyword (@pxref{Nextfile Statement}). Because of this, you should not call it from an @code{ENDFILE} rule. -(This isn't necessary anyway, since as soon as an @code{ENDFILE} rule -finishes @command{gawk} goes to the next file!) +(This isn't necessary anyway, because @command{gawk} goes to the next +file as soon as an @code{ENDFILE} rule finishes!) @node File Checking @subsection Checking for Readable @value{DDF}s @@ -21767,19 +21867,19 @@ BEGIN @{ @cindex troubleshooting, @code{getline} function This works, because the @code{getline} won't be fatal. Removing the element from @code{ARGV} with @code{delete} -skips the file (since it's no longer in the list). +skips the file (because it's no longer in the list). See also @ref{ARGC and ARGV}. -The regular expression check purposely does not use character classes +Because @command{awk} variable names only allow the English letters, +the regular expression check purposely does not use character classes such as @samp{[:alpha:]} and @samp{[:alnum:]} (@pxref{Bracket Expressions}) -since @command{awk} variable names only allow the English letters. @node Empty Files @subsection Checking for Zero-length Files All known @command{awk} implementations silently skip over zero-length files. -This is a by-product of @command{awk}'s implicit +This is a by-product of @command{awk}'s implicit read-a-record-and-match-against-the-rules loop: when @command{awk} tries to read a record from an empty file, it immediately receives an end of file indication, closes the file, and proceeds on to the next @@ -21915,12 +22015,12 @@ are left alone. @c STARTOFRANGE clibf @cindex functions, library, C library @cindex arguments, processing -Most utilities on POSIX compatible systems take options on +Most utilities on POSIX-compatible systems take options on the command line that can be used to change the way a program behaves. @command{awk} is an example of such a program (@pxref{Options}). -Often, options take @dfn{arguments}; i.e., data that the program needs to -correctly obey the command-line option. For example, @command{awk}'s +Often, options take @dfn{arguments} (i.e., data that the program needs to +correctly obey the command-line option). For example, @command{awk}'s @option{-F} option requires a string to use as the field separator. The first occurrence on the command line of either @option{--} or a string that does not begin with @samp{-} ends the options. @@ -22024,7 +22124,7 @@ necessary for accessing individual characters (@pxref{String Functions}).@footnote{This function was written before @command{gawk} acquired the ability to split strings into single characters using @code{""} as the separator. -We have left it alone, since using @code{substr()} is more portable.} +We have left it alone, as using @code{substr()} is more portable.} The discussion that follows walks through the code a bit at a time: @@ -22192,9 +22292,9 @@ next element in @code{argv}. If neither condition is true, then only on the next call to @code{getopt()}. The @code{BEGIN} rule initializes both @code{Opterr} and @code{Optind} to one. -@code{Opterr} is set to one, since the default behavior is for @code{getopt()} +@code{Opterr} is set to one, because the default behavior is for @code{getopt()} to print a diagnostic message upon seeing an invalid option. @code{Optind} -is set to one, since there's no reason to look at the program name, which is +is set to one, because there's no reason to look at the program name, which is in @code{ARGV[0]}: @example @@ -22244,16 +22344,22 @@ etc., as its own options. @quotation NOTE After @code{getopt()} is through, -user level code must clear out all the elements of @code{ARGV} from 1 +user-level code must clear out all the elements of @code{ARGV} from 1 to @code{Optind}, so that @command{awk} does not try to process the command-line options as @value{FN}s. @end quotation Using @samp{#!} with the @option{-E} option may help avoid conflicts between your program's options and @command{gawk}'s options, -since @option{-E} causes @command{gawk} to abandon processing of +as @option{-E} causes @command{gawk} to abandon processing of further options -(@pxref{Executable Scripts}, and @pxref{Options}). +(@DBPXREF{Executable Scripts} and +@ifnotdocbook +@pxref{Options}). +@end ifnotdocbook +@ifdocbook +@ref{Options}). +@end ifdocbook Several of the sample programs presented in @ref{Sample Programs}, @@ -22283,7 +22389,7 @@ However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This @value{SECTION} presents a suite of functions for retrieving information from the -user database. @xref{Group Functions}, +user database. @DBXREF{Group Functions} for a similar suite that retrieves information from the group database. @cindex @code{getpwent()} function (C library) @@ -22302,7 +22408,7 @@ The ``password'' comes from the original user database file, encrypted passwords (hence the name). @cindex @command{pwcat} program -While an @command{awk} program could simply read @file{/etc/passwd} +Although an @command{awk} program could simply read @file{/etc/passwd} directly, this file may not contain complete information about the system's set of users.@footnote{It is often the case that password information is stored in a network database.} To be sure you are able to @@ -22397,12 +22503,12 @@ The user's encrypted password. This may not be available on some systems. @item User-ID The user's numeric user ID number. -(On some systems it's a C @code{long}, and not an @code{int}. Thus +(On some systems, it's a C @code{long}, and not an @code{int}. Thus we cast it to @code{long} for all cases.) @item Group-ID The user's numeric group ID number. -(Similar comments about @code{long} vs.@: @code{int} apply here.) +(Similar comments about @code{long} versus @code{int} apply here.) @item Full name The user's full name, and perhaps other information associated with the @@ -22503,7 +22609,7 @@ The function @code{_pw_init()} fills three copies of the user information into three associative arrays. The arrays are indexed by username (@code{_pw_byname}), by user ID number (@code{_pw_byuid}), and by order of occurrence (@code{_pw_bycount}). -The variable @code{_pw_inited} is used for efficiency, since @code{_pw_init()} +The variable @code{_pw_inited} is used for efficiency, as @code{_pw_init()} needs to be called only once. @cindex @code{PROCINFO} array, testing the field splitting @@ -22512,7 +22618,7 @@ Because this function uses @code{getline} to read information from @command{pwcat}, it first saves the values of @code{FS}, @code{RS}, and @code{$0}. It notes in the variable @code{using_fw} whether field splitting with @code{FIELDWIDTHS} is in effect or not. -Doing so is necessary, since these functions could be called +Doing so is necessary, as these functions could be called from anywhere within a user's program, and the user may have his or her own way of splitting records and fields. This makes it possible to restore the correct @@ -22614,7 +22720,7 @@ In turn, calling @code{_pw_init()} is not too expensive, because the once. If you are worried about squeezing every last cycle out of your @command{awk} program, the check of @code{_pw_inited} could be moved out of @code{_pw_init()} and duplicated in all the other functions. In practice, -this is not necessary, since most @command{awk} programs are I/O-bound, +this is not necessary, as most @command{awk} programs are I/O-bound, and such a change would clutter up the code. The @command{id} program in @DBREF{Id Program} @@ -22753,7 +22859,7 @@ the association of name to number must be unique within the file. we cast it to @code{long} for all cases.) @item Group Member List -A comma-separated list of user names. These users are members of the group. +A comma-separated list of usernames. These users are members of the group. Modern Unix systems allow users to be members of several groups simultaneously. If your system does, then there are elements @code{"group1"} through @code{"group@var{N}"} in @code{PROCINFO} @@ -22868,7 +22974,7 @@ is being used, and to restore the appropriate field splitting mechanism. The group information is stored is several associative arrays. The arrays are indexed by group name (@code{@w{_gr_byname}}), by group ID number (@code{@w{_gr_bygid}}), and by position in the database (@code{@w{_gr_bycount}}). -There is an additional array indexed by user name (@code{@w{_gr_groupsbyuser}}), +There is an additional array indexed by username (@code{@w{_gr_groupsbyuser}}), which is a space-separated list of groups to which each user belongs. Unlike the user database, it is possible to have multiple records in the @@ -22881,7 +22987,7 @@ tvpeople:*:101:david,conan,tom,joan @end example For this reason, @code{_gr_init()} looks to see if a group name or -group ID number is already seen. If it is, then the user names are +group ID number is already seen. If it is, the usernames are simply concatenated onto the previous list of users.@footnote{There is actually a subtle problem with the code just presented. Suppose that the first time there were no names. This code adds the names with @@ -22927,7 +23033,7 @@ function getgrgid(gid) @cindex @code{getgruser()} function (C library) The @code{getgruser()} function does not have a C counterpart. It takes a -user name and returns the list of groups that have the user as a member: +username and returns the list of groups that have the user as a member: @cindex @code{getgruser()} function, user-defined @example @@ -23070,7 +23176,7 @@ The functions presented here fit into the following categories: @c nested list @table @asis @item General problems -Number to string conversion, assertions, rounding, random number +Number-to-string conversion, assertions, rounding, random number generation, converting characters to numbers, joining strings, getting easily usable time-of-day information, and reading a whole file in one shot. @@ -23130,7 +23236,7 @@ ARGIND != Argind @{ @} END @{ if (ARGIND < ARGC - 1) - ARGIND = ARGC - 1 + ARGIND = ARGC - 1 if (ARGIND > Argind) for (Argind++; Argind <= ARGIND; Argind++) zerofile(ARGV[Argind], Argind) @@ -23266,7 +23372,7 @@ The programs are presented in alphabetical order. @end menu @node Cut Program -@subsection Cutting out Fields and Columns +@subsection Cutting Out Fields and Columns @cindex @command{cut} utility @c STARTOFRANGE cut @@ -23543,7 +23649,7 @@ function set_charlist( field, i, j, f, g, n, m, t, @c endfile @end example -Next is the rule that actually processes the data. If the @option{-s} option +Next is the rule that processes the data. If the @option{-s} option is given, then @code{suppress} is true. The first @code{if} statement makes sure that the input record does have the field separator. If @command{cut} is processing fields, @code{suppress} is true, and the field @@ -23575,9 +23681,9 @@ written out between the fields: @end example This version of @command{cut} relies on @command{gawk}'s @code{FIELDWIDTHS} -variable to do the character-based cutting. While it is possible in +variable to do the character-based cutting. It is possible in other @command{awk} implementations to use @code{substr()} -(@pxref{String Functions}), +(@pxref{String Functions}), but it is also extremely painful. The @code{FIELDWIDTHS} variable supplies an elegant solution to the problem of picking the input line apart by characters. @@ -23722,7 +23828,7 @@ matched lines in the output: @c endfile @end example -The last two lines are commented out, since they are not needed in +The last two lines are commented out, as they are not needed in @command{gawk}. They should be uncommented if you have to use another version of @command{awk}. @@ -23732,7 +23838,7 @@ into lowercase if the @option{-i} option is specified.@footnote{It also introduces a subtle bug; if a match happens, we output the translated line, not the original.} The rule is -commented out since it is not necessary with @command{gawk}: +commented out as it is not necessary with @command{gawk}: @example @c file eg/prog/egrep.awk @@ -23869,7 +23975,7 @@ function usage() @c ENDOFRANGE egrep @node Id Program -@subsection Printing out User Information +@subsection Printing Out User Information @cindex printing, user information @cindex users, information about, printing @@ -23984,7 +24090,7 @@ function pr_first_field(str, a) The test in the @code{for} loop is worth noting. Any supplementary groups in the @code{PROCINFO} array have the indices @code{"group1"} through @code{"group@var{N}"} for some -@var{N}, i.e., the total number of supplementary groups. +@var{N} (i.e., the total number of supplementary groups). However, we don't know in advance how many of these groups there are. @@ -24024,10 +24130,10 @@ aims to demonstrate.} By default, the output files are named @file{xaa}, @file{xab}, and so on. Each file has -1000 lines in it, with the likely exception of the last file. To change the +1,000 lines in it, with the likely exception of the last file. To change the number of lines in each file, supply a number on the command line -preceded with a minus; e.g., @samp{-500} for files with 500 lines in them -instead of 1000. To change the name of the output files to something like +preceded with a minus (e.g., @samp{-500} for files with 500 lines in them +instead of 1,000). To change the name of the output files to something like @file{myfileaa}, @file{myfileab}, and so on, supply an additional argument that specifies the @value{FN} prefix. @@ -24075,7 +24181,7 @@ BEGIN @{ @} # test argv in case reading from stdin instead of file if (i in ARGV) - i++ # skip data file name + i++ # skip datafile name if (i in ARGV) @{ outfile = ARGV[i] ARGV[i] = "" @@ -24169,8 +24275,8 @@ truncating them and starting over. The @code{BEGIN} rule first makes a copy of all the command-line arguments into an array named @code{copy}. -@code{ARGV[0]} is not copied, since it is not needed. -@code{tee} cannot use @code{ARGV} directly, since @command{awk} attempts to +@code{ARGV[0]} is not needed, so it is not copied. +@code{tee} cannot use @code{ARGV} directly, because @command{awk} attempts to process each @value{FN} in @code{ARGV} as input data. @cindex flag variables @@ -24219,7 +24325,7 @@ BEGIN @{ @c endfile @end example -The following single rule does all the work. Since there is no pattern, it is +The following single rule does all the work. Because there is no pattern, it is executed for each line of input. The body of the rule simply prints the line into each file on the command line, and then to the standard output: @@ -24250,7 +24356,7 @@ for (i in copy) @end example @noindent -This is more concise but it is also less efficient. The @samp{if} is +This is more concise, but it is also less efficient. The @samp{if} is tested for each record and for each output file. By duplicating the loop body, the @samp{if} is only tested once for each input record. If there are @var{N} input records and @var{M} output files, the first method only @@ -24470,10 +24576,10 @@ The second rule does the work. The variable @code{equal} is one or zero, depending upon the results of @code{are_equal()}'s comparison. If @command{uniq} is counting repeated lines, and the lines are equal, then it increments the @code{count} variable. Otherwise, it prints the line and resets @code{count}, -since the two lines are not equal. +because the two lines are not equal. If @command{uniq} is not counting, and if the lines are equal, @code{count} is incremented. -Nothing is printed, since the point is to remove duplicates. +Nothing is printed, as the point is to remove duplicates. Otherwise, if @command{uniq} is counting repeated lines and more than one line is seen, or if @command{uniq} is counting nonrepeated lines and only one line is seen, then the line is printed, and @code{count} @@ -24542,7 +24648,7 @@ Brian Kernighan suggests that ``an alternative approach to state machines is to just read the input into an array, then use indexing. It's almost always easier code, and for most inputs where you would use this, just -as fast.'' Consider how to rewrite the logic to follow this +as fast.'' Consider how to rewrite the logic to follow this suggestion. @end ifset @@ -24594,7 +24700,7 @@ Count only characters. @end table Implementing @command{wc} in @command{awk} is particularly elegant, -since @command{awk} does a lot of the work for us; it splits lines into +because @command{awk} does a lot of the work for us; it splits lines into words (i.e., fields) and counts them, it counts lines (i.e., records), and it can easily tell us how long a line is. @@ -24699,7 +24805,7 @@ function endfile(file) @end example There is one rule that is executed for each line. It adds the length of -the record, plus one, to @code{chars}.@footnote{Since @command{gawk} +the record, plus one, to @code{chars}.@footnote{Because @command{gawk} understands multibyte locales, this code counts characters, not bytes.} Adding one plus the record length is needed because the newline character separating records (the value @@ -25047,8 +25153,8 @@ often used to map uppercase letters into lowercase for further processing: @command{tr} requires two lists of characters.@footnote{On some older systems, including Solaris, the system version of @command{tr} may require that the lists be written as range expressions enclosed in square brackets -(@samp{[a-z]}) and quoted, to prevent the shell from attempting a file -name expansion. This is not a feature.} When processing the input, the +(@samp{[a-z]}) and quoted, to prevent the shell from attempting a +@value{FN} expansion. This is not a feature.} When processing the input, the first character in the first list is replaced with the first character in the second list, the second character in the first list is replaced with the second character in the second list, and so on. If there are @@ -25163,9 +25269,9 @@ BEGIN @{ @c endfile @end example -While it is possible to do character transliteration in a user-level -function, it is not necessarily efficient, and we (the @command{gawk} -authors) started to consider adding a built-in function. However, +It is possible to do character transliteration in a user-level +function, but it is not necessarily efficient, and we (the @command{gawk} +developers) started to consider adding a built-in function. However, shortly after writing this program, we learned that Brian Kernighan had added the @code{toupper()} and @code{tolower()} functions to his @command{awk} (@pxref{String Functions}). These functions handle the @@ -25209,7 +25315,7 @@ the @code{line} array and printing the page when 20 labels have been read. The @code{BEGIN} rule simply sets @code{RS} to the empty string, so that @command{awk} splits records at blank lines (@pxref{Records}). -It sets @code{MAXLINES} to 100, since 100 is the maximum number +It sets @code{MAXLINES} to 100, because 100 is the maximum number of lines on the page @iftex (@math{20 @cdot 5 = 100}). @@ -25366,9 +25472,9 @@ useful on real text files: @item The @command{awk} language considers upper- and lowercase characters to be distinct. Therefore, ``bartender'' and ``Bartender'' are not treated -as the same word. This is undesirable, since in normal text, words -are capitalized if they begin sentences, and a frequency analyzer should not -be sensitive to capitalization. +as the same word. This is undesirable, because words are capitalized +if they begin sentences in normal text, and a frequency analyzer should +not be sensitive to capitalization. @item Words are detected using the @command{awk} convention that fields are @@ -25549,7 +25655,7 @@ The nodes and @ref{Sample Programs}, are the top level nodes for a large number of @command{awk} programs. @end ifinfo -If you want to experiment with these programs, it is tedious to have to type +If you want to experiment with these programs, it is tedious to type them in by hand. Here we present a program that can extract parts of a Texinfo input file into separate files. @@ -25627,7 +25733,7 @@ It also prints some final advice: @@example @@c file examples/messages.awk -END @@@{ print "Always avoid bored archeologists!" @@@} +END @@@{ print "Always avoid bored archaeologists!" @@@} @@c end file @@end example @dots{} @@ -25799,7 +25905,7 @@ The @command{sed} utility is a stream editor, a program that reads a stream of data, makes changes to it, and passes it on. It is often used to make global changes to a large file or to a stream of data generated by a pipeline of commands. -While @command{sed} is a complicated program in its own right, its most common +Although @command{sed} is a complicated program in its own right, its most common use is to perform global substitutions in the middle of a pipeline: @example @@ -25808,7 +25914,7 @@ use is to perform global substitutions in the middle of a pipeline: Here, @samp{s/old/new/g} tells @command{sed} to look for the regexp @samp{old} on each input line and globally replace it with the text -@samp{new}, i.e., all the occurrences on a line. This is similar to +@samp{new} (i.e., all the occurrences on a line). This is similar to @command{awk}'s @code{gsub()} function (@pxref{String Functions}). @@ -25892,7 +25998,7 @@ not treated as @value{FN}s (@pxref{ARGC and ARGV}). The @code{usage()} function prints an error message and exits. -Finally, the single rule handles the printing scheme outlined above, +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 @@ -25936,8 +26042,8 @@ BEGIN @{ The following program, @file{igawk.sh}, provides this service. It simulates @command{gawk}'s searching of the @env{AWKPATH} variable -and also allows @dfn{nested} includes; i.e., a file that is included -with @code{@@include} can contain further @code{@@include} statements. +and also allows @dfn{nested} includes (i.e., a file that is included +with @code{@@include} can contain further @code{@@include} statements). @command{igawk} makes an effort to only include files once, so that nested includes don't accidentally include a library function twice. @@ -25967,10 +26073,10 @@ Literal text, provided with @option{-e} or @option{--source}. This text is just appended directly. @item -Source @value{FN}s, provided with @option{-f}. We use a neat trick and append -@samp{@@include @var{filename}} to the shell variable's contents. Since the file-inclusion -program works the way @command{gawk} does, this gets the text -of the file included into the program at the correct point. +Source @value{FN}s, provided with @option{-f}. We use a neat trick and +append @samp{@@include @var{filename}} to the shell variable's contents. +Because the file-inclusion program works the way @command{gawk} does, this +gets the text of the file included in the program at the correct point. @end enumerate @item @@ -26269,9 +26375,10 @@ EOF @c endfile @end example -The shell construct @samp{@var{command} << @var{marker}} is called a @dfn{here document}. -Everything in the shell script up to the @var{marker} is fed to @var{command} as input. -The shell processes the contents of the here document for variable and command substitution +The shell construct @samp{@var{command} << @var{marker}} is called +a @dfn{here document}. Everything in the shell script up to the +@var{marker} is fed to @var{command} as input. The shell processes +the contents of the here document for variable and command substitution (and possibly other things as well, depending upon the shell). The shell construct @samp{$(@dots{})} is called @dfn{command substitution}. @@ -26286,14 +26393,16 @@ It's done in these steps: @enumerate @item Run @command{gawk} with the @code{@@include}-processing program (the -value of the @code{expand_prog} shell variable) on standard input. +value of the @code{expand_prog} shell variable) reading standard input. @item -Standard input is the contents of the user's program, from the shell variable @code{program}. -Its contents are fed to @command{gawk} via a here document. +Standard input is the contents of the user's program, +from the shell variable @code{program}. +Feed its contents to @command{gawk} via a here document. @item -The results of this processing are saved in the shell variable @code{processed_program} by using command substitution. +Save the results of this processing in the shell variable +@code{processed_program} by using command substitution. @end enumerate The last step is to call @command{gawk} with the expanded program, @@ -26369,7 +26478,7 @@ of @command{awk} programs as Web CGI scripts.} @c ENDOFRANGE igawk @node Anagram Program -@subsection Finding Anagrams From A Dictionary +@subsection Finding Anagrams from a Dictionary @cindex anagrams, finding An interesting programming challenge is to @@ -26378,17 +26487,17 @@ word list (such as @file{/usr/share/dict/words} on many GNU/Linux systems). One word is an anagram of another if both words contain the same letters -(for example, ``babbling'' and ``blabbing''). +(e.g., ``babbling'' and ``blabbing''). -Column 2, Problem C of Jon Bentley's @cite{Programming Pearls}, second -edition, presents an elegant algorithm. The idea is to give words that +Column 2, Problem C, of Jon Bentley's @cite{Programming Pearls}, Second +Edition, presents an elegant algorithm. The idea is to give words that are anagrams a common signature, sort all the words together by their signature, and then print them. Dr.@: Bentley observes that taking the letters in each word and sorting them produces that common signature. 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. +in sorted order: @c STARTOFRANGE anagram @cindex @code{anagram.awk} program @@ -26460,7 +26569,7 @@ function word2key(word, a, i, n, result) Finally, the @code{END} rule traverses the array and prints out the anagram lists. It sends the output -to the system @command{sort} command, since otherwise +to the system @command{sort} command because otherwise the anagrams would appear in arbitrary order: @example @@ -26488,21 +26597,21 @@ Here is some partial output when the program is run: @example $ @kbd{gawk -f anagram.awk /usr/share/dict/words | grep '^b'} @dots{} -babbled blabbed -babbler blabber brabble -babblers blabbers brabbles -babbling blabbing -babbly blabby -babel bable -babels beslab -babery yabber +babbled blabbed +babbler blabber brabble +babblers blabbers brabbles +babbling blabbing +babbly blabby +babel bable +babels beslab +babery yabber @dots{} @end example @c ENDOFRANGE anagram @node Signature Program -@subsection And Now For Something Completely Different +@subsection And Now for Something Completely Different @cindex signature program @cindex Brini, Davide @@ -26542,28 +26651,28 @@ Subject: The GNU Awk User's Guide, Section 13.3.11 From: "Chris Johansen" Message-ID: -Arnold, you don't know me, but we have a tenuous connection. My wife is +Arnold, you don't know me, but we have a tenuous connection. My wife is Barbara A. Field, FAIA, GIT '65 (B. Arch.). -I have had a couple of paper copies of "Effective Awk Programming" for -years, and now I'm going through a Kindle version of "The GNU Awk User's -Guide" again. When I got to section 13.3.11, I reformatted and lightly +I have had a couple of paper copies of "Effective Awk Programming" for +years, and now I'm going through a Kindle version of "The GNU Awk User's +Guide" again. When I got to section 13.3.11, I reformatted and lightly commented Davide Brin's signature script to understand its workings. -It occurs to me that this might have pedagogical value as an example -(although imperfect) of the value of whitespace and comments, and a -starting point for that discussion. It certainly helped _me_ understand -what's going on. You are welcome to it, as-is or modified (subject to +It occurs to me that this might have pedagogical value as an example +(although imperfect) of the value of whitespace and comments, and a +starting point for that discussion. It certainly helped _me_ understand +what's going on. You are welcome to it, as-is or modified (subject to Davide's constraints, of course, which I think I have met). -If I were to include it in a future edition, I would put it at some -distance from section 13.3.11, say, as a note or an appendix, so as not to +If I were to include it in a future edition, I would put it at some +distance from section 13.3.11, say, as a note or an appendix, so as not to be a "spoiler" to the puzzle. Best regards, --- +-- Chris Johansen {johansen at main dot nc dot us} - . . . collapsing the probability wave function, sending ripples of + . . . collapsing the probability wave function, sending ripples of certainty through the space-time continuum. @@ -26572,7 +26681,7 @@ certainty through the space-time continuum. # From "13.3.11 And Now For Something Completely Different" # http://www.gnu.org/software/gawk/manual/html_node/Signature-Program.html#Signature-Program -# Copyright © 2008 Davide Brini +# Copyright © 2008 Davide Brini # Copying and distribution of the code published in this page, with # or without modification, are permitted in any medium without @@ -26691,7 +26800,7 @@ Brian Kernighan suggests that ``an alternative approach to state machines is to just read the input into an array, then use indexing. It's almost always easier code, and for most inputs where you would use this, just -as fast.'' Rewrite the logic to follow this +as fast.'' Rewrite the logic to follow this suggestion. @@ -26792,7 +26901,7 @@ the use of the external @command{sort} utility. @c EXCLUDE END @ifnotinfo -@part @value{PART3}Moving Beyond Standard @command{awk} With @command{gawk} +@part @value{PART3}Moving Beyond Standard @command{awk} with @command{gawk} @end ifnotinfo @ifdocbook @@ -26801,19 +26910,19 @@ It contains the following chapters: @itemize @value{BULLET} @item -@ref{Advanced Features}. +@ref{Advanced Features} @item -@ref{Internationalization}. +@ref{Internationalization} @item -@ref{Debugger}. +@ref{Debugger} @item -@ref{Arbitrary Precision Arithmetic}. +@ref{Arbitrary Precision Arithmetic} @item -@ref{Dynamic Extensions}. +@ref{Dynamic Extensions} @end itemize @end ifdocbook @@ -26972,7 +27081,7 @@ in a particular order that you, the programmer, choose. @command{gawk} lets you do this. @DBREF{Controlling Scanning} describes how you can assign special, -pre-defined values to @code{PROCINFO["sorted_in"]} in order to +predefined values to @code{PROCINFO["sorted_in"]} in order to control the order in which @command{gawk} traverses an array during a @code{for} loop. @@ -26996,7 +27105,7 @@ Here, @var{i1} and @var{i2} are the indices, and @var{v1} and @var{v2} are the corresponding values of the two elements being compared. Either @var{v1} or @var{v2}, or both, can be arrays if the array being traversed contains subarrays as values. -(@xref{Arrays of Arrays}, for more information about subarrays.) +(@DBXREF{Arrays of Arrays} for more information about subarrays.) The three possible return values are interpreted as follows: @table @code @@ -27039,7 +27148,7 @@ function cmp_str_val(i1, v1, i2, v2) The third comparison function makes all numbers, and numeric strings without -any leading or trailing spaces, come out first during loop traversal: +any leading or trailing spaces, come out first during loop traversal: @example function cmp_num_str_val(i1, v1, i2, v2, n1, n2) @@ -27047,10 +27156,10 @@ function cmp_num_str_val(i1, v1, i2, v2, n1, n2) # numbers before string value comparison, ascending order n1 = v1 + 0 n2 = v2 + 0 - if (n1 == v1) + if (n1 == v1) return (n2 == v2) ? (n1 - n2) : -1 else if (n2 == v2) - return 1 + return 1 return (v1 < v2) ? -1 : (v1 != v2) @} @end example @@ -27065,7 +27174,7 @@ BEGIN @{ data[10] = "one" data[100] = 100 data[20] = "two" - + f[1] = "cmp_num_idx" f[2] = "cmp_str_val" f[3] = "cmp_num_str_val" @@ -27089,14 +27198,14 @@ $ @kbd{gawk -f compdemo.awk} @print{} data[10] = one @print{} data[20] = two @print{} data[100] = 100 -@print{} +@print{} @print{} Sort function: cmp_str_val @ii{Sort by element values as strings} @print{} data[one] = 10 @print{} data[100] = 100 @ii{String 100 is less than string 20} @print{} data[two] = 20 @print{} data[10] = one @print{} data[20] = two -@print{} +@print{} @print{} Sort function: cmp_num_str_val @ii{Sort all numeric values before all strings} @print{} data[one] = 10 @print{} data[two] = 20 @@ -27107,7 +27216,7 @@ $ @kbd{gawk -f compdemo.awk} Consider sorting the entries of a GNU/Linux system password file according to login name. The following program sorts records -by a specific field position and can be used for this purpose: +by a specific field position and can be used for this purpose: @example # passwd-sort.awk --- simple program to sort by field position @@ -27153,7 +27262,7 @@ $ @kbd{gawk -v POS=1 -F: -f sort.awk /etc/passwd} The comparison should normally always return the same value when given a specific pair of array elements as its arguments. If inconsistent -results are returned then the order is undefined. This behavior can be +results are returned, then the order is undefined. This behavior can be exploited to introduce random order into otherwise seemingly ordered data: @@ -27165,7 +27274,7 @@ function cmp_randomize(i1, v1, i2, v2) @} @end example -As mentioned above, the order of the indices is arbitrary if two +As already mentioned, the order of the indices is arbitrary if two elements compare equal. This is usually not a problem, but letting the tied elements come out in arbitrary order can be an issue, especially when comparing item values. The partial ordering of the equal elements @@ -27206,10 +27315,10 @@ When string comparisons are made during a sort, either for element values where one or both aren't numbers, or for element indices handled as strings, the value of @code{IGNORECASE} (@pxref{Built-in Variables}) controls whether -the comparisons treat corresponding uppercase and lowercase letters as +the comparisons treat corresponding upper- and lowercase letters as equivalent or distinct. -Another point to keep in mind is that in the case of subarrays +Another point to keep in mind is that in the case of subarrays, the element values can themselves be arrays; a production comparison function should use the @code{isarray()} function (@pxref{Type Functions}), @@ -27217,7 +27326,7 @@ to check for this, and choose a defined sorting order for subarrays. All sorting based on @code{PROCINFO["sorted_in"]} is disabled in POSIX mode, -since the @code{PROCINFO} array is not special in that case. +because the @code{PROCINFO} array is not special in that case. As a side note, sorting the array indices before traversing the array has been reported to add 15% to 20% overhead to the @@ -27238,8 +27347,8 @@ sorted array traversal is not the default. @cindex @code{asorti()} function (@command{gawk}), arrays@comma{} sorting @cindex sort function, arrays, sorting In most @command{awk} implementations, sorting an array requires writing -a @code{sort()} function. While this can be educational for exploring -different sorting algorithms, usually that's not the point of the program. +a @code{sort()} function. This can be educational for exploring +different sorting algorithms, but usually that's not the point of the program. @command{gawk} provides the built-in @code{asort()} and @code{asorti()} functions (@pxref{String Functions}) for sorting arrays. For example: @@ -27335,8 +27444,8 @@ Because @code{IGNORECASE} affects string comparisons, the value of @code{IGNORECASE} also affects sorting for both @code{asort()} and @code{asorti()}. Note also that the locale's sorting order does @emph{not} come into play; comparisons are based on character values only.@footnote{This -is true because locale-based comparison occurs only when in POSIX -compatibility mode, and since @code{asort()} and @code{asorti()} are +is true because locale-based comparison occurs only when in +POSIX-compatibility mode, and because @code{asort()} and @code{asorti()} are @command{gawk} extensions, they are not available in that case.} @node Two-way I/O @@ -27412,7 +27521,7 @@ remain more difficult to use than two-way pipes.} @c 8/2014 @cindex @command{csh} utility, @code{|&} operator, comparison with However, with @command{gawk}, it is possible to open a @emph{two-way} pipe to another process. The second process is -termed a @dfn{coprocess}, since it runs in parallel with @command{gawk}. +termed a @dfn{coprocess}, as it runs in parallel with @command{gawk}. The two-way connection is created using the @samp{|&} operator (borrowed from the Korn shell, @command{ksh}):@footnote{This is very different from the same operator in the C shell and in Bash.} @@ -27572,7 +27681,7 @@ You can think of this as just a @emph{very long} two-way pipeline to a coprocess. The way @command{gawk} decides that you want to use TCP/IP networking is by recognizing special @value{FN}s that begin with one of @samp{/inet/}, -@samp{/inet4/} or @samp{/inet6/}. +@samp{/inet4/}, or @samp{/inet6/}. The full syntax of the special @value{FN} is @file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}}. @@ -27601,7 +27710,7 @@ or @samp{http}, in which case @command{gawk} attempts to determine the predefined port number using the C @code{getaddrinfo()} function. @item remote-host -The IP address or fully-qualified domain name of the Internet +The IP address or fully qualified domain name of the Internet host to which you want to connect. @item remote-port @@ -27675,12 +27784,12 @@ gawk --profile=myprog.prof -f myprog.awk data1 data2 @end example @noindent -In the above example, @command{gawk} places the profile in +In the preceding example, @command{gawk} places the profile in @file{myprog.prof} instead of in @file{awkprof.out}. -Here is a sample session showing a simple @command{awk} program, its input data, and the -results from running @command{gawk} with the @option{--profile} option. -First, the @command{awk} program: +Here is a sample session showing a simple @command{awk} program, +its input data, and the results from running @command{gawk} with the +@option{--profile} option. First, the @command{awk} program: @example BEGIN @{ print "First BEGIN rule" @} @@ -27838,7 +27947,7 @@ the body of an @code{if}, @code{else}, or loop is only a single statement. @item Parentheses are used only where needed, as indicated by the structure of the program and the precedence rules. -For example, @samp{(3 + 5) * 4} means add three plus five, then multiply +For example, @samp{(3 + 5) * 4} means add three and five, then multiply the total by four. However, @samp{3 + 5 * 4} has no parentheses, and means @samp{3 + (5 * 4)}. @@ -28097,8 +28206,7 @@ following steps, in this order: @enumerate @item -The programmer goes -through the source for all of @command{guide}'s components +The programmer reviews the source for all of @command{guide}'s components and marks each string that is a candidate for translation. For example, @code{"`-F': option required"} is a good candidate for translation. A table with strings of option names is not (e.g., @command{gawk}'s @@ -28218,8 +28326,8 @@ if necessary. (It is almost never necessary to supply a different category.) @cindex sorting characters in different languages @cindex @code{LC_COLLATE} locale category @item LC_COLLATE -Text-collation information; i.e., how different characters -and/or groups of characters sort in a given language. +Text-collation information (i.e., how different characters +and/or groups of characters sort in a given language). @cindex @code{LC_CTYPE} locale category @item LC_CTYPE @@ -28438,7 +28546,7 @@ BEGIN @{ @end enumerate -@xref{I18N Example}, +@DBXREF{I18N Example} for an example program showing the steps to create and use translations from @command{awk}. @@ -28499,7 +28607,7 @@ second argument to @code{dcngettext()}.@footnote{The You should distribute the generated @file{.pot} file with your @command{awk} program; translators will eventually use it to provide you translations that you can also then distribute. -@xref{I18N Example}, +@DBXREF{I18N Example} for the full list of steps to go through to create and test translations for @command{guide}. @c ENDOFRANGE portobfi @@ -28627,7 +28735,7 @@ change: @cindex @code{TEXTDOMAIN} variable, portability and @item Assignments to @code{TEXTDOMAIN} won't have any effect, -since @code{TEXTDOMAIN} is not special in other @command{awk} implementations. +because @code{TEXTDOMAIN} is not special in other @command{awk} implementations. @item Non-GNU versions of @command{awk} treat marked strings @@ -28675,8 +28783,8 @@ enough arguments are supplied in the function call. Many versions of underlying C library version of @code{sprintf()}, but only one format and argument at a time. What happens if a positional specification is used is anybody's guess. -However, since the positional specifications are primarily for use in -@emph{translated} format strings, and since non-GNU @command{awk}s never +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 @@ -28739,7 +28847,7 @@ called ``Hippy.'' Ah, well.} @example @group -$ cp guide.pot guide-mellow.po +$ @kbd{cp guide.pot guide-mellow.po} @var{Add translations to} guide-mellow.po @dots{} @end group @end example @@ -28765,7 +28873,7 @@ msgstr "Like, the scoop is" The next step is to make the directory to hold the binary message object file and then to create the @file{guide.mo} file. We pretend that our file is to be used in the @code{en_US.UTF-8} locale, -since we have to use a locale name known to the C @command{gettext} routines. +because we have to use a locale name known to the C @command{gettext} routines. The directory layout shown here is standard for GNU @command{gettext} on GNU/Linux systems. Other versions of @command{gettext} may use a different layout: @@ -28802,7 +28910,7 @@ $ @kbd{gawk -f guide.awk} @print{} Pardon me, Zaphod who? @end example -If the three replacement functions for @code{dcgettext()}, @code{dcngettext()} +If the three replacement functions for @code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()} (@pxref{I18N Portability}) are in a file named @file{libintl.awk}, @@ -28904,7 +29012,7 @@ how to use @command{gawk} for debugging your program is easy. @end menu @node Debugging -@section Introduction to The @command{gawk} Debugger +@section Introduction to the @command{gawk} Debugger This @value{SECTION} introduces debugging in general and begins the discussion of debugging in @command{gawk}. @@ -28922,8 +29030,8 @@ the discussion of debugging in @command{gawk}. ahead to the next section on the specific features of the @command{gawk} debugger.) -Of course, a debugging program cannot remove bugs for you, since it has -no way of knowing what you or your users consider a ``bug'' and what is a +Of course, a debugging program cannot remove bugs for you, because it has +no way of knowing what you or your users consider a ``bug'' versus a ``feature.'' (Sometimes, we humans have a hard time with this ourselves.) In that case, what can you expect from such a tool? The answer to that depends on the language being debugged, but in general, you can expect at @@ -28944,7 +29052,7 @@ having to change your source files. @item The chance to see the values of data in the program at any point in execution, and also to change that data on the fly, to see how that -affects what happens afterwards. (This often includes the ability +affects what happens afterward. (This often includes the ability to look at internal data structures besides the variables you actually defined in your code.) @@ -28964,11 +29072,11 @@ functional program that you or someone else wrote). Before diving in to the details, we need to introduce several important concepts that apply to just about all debuggers. The following list defines terms used throughout the rest of -this @value{CHAPTER}. +this @value{CHAPTER}: @table @dfn @cindex stack frame -@item Stack Frame +@item Stack frame Programs generally call functions during the course of their execution. One function can call another, or a function can call itself (recursion). You can view the chain of called functions (main program calls A, which @@ -29003,7 +29111,7 @@ as many breakpoints as you like. A watchpoint is similar to a breakpoint. The difference is that breakpoints are oriented around the code: stop when a certain point in the code is reached. A watchpoint, however, specifies that program execution -should stop when a @emph{data value} is changed. This is useful, since +should stop when a @emph{data value} is changed. This is useful, as sometimes it happens that a variable receives an erroneous value, and it's hard to track down where this happens just by looking at the code. By using a watchpoint, you can stop whenever a variable is assigned to, @@ -29017,13 +29125,13 @@ Debugging an @command{awk} program has some specific aspects that are not shared with other programming languages. First of all, the fact that @command{awk} programs usually take input -line-by-line from a file or files and operate on those lines using specific +line by line from a file or files and operate on those lines using specific rules makes it especially useful to organize viewing the execution of the program in terms of these rules. As we will see, each @command{awk} rule is treated almost like a function call, with its own specific block of instructions. -In addition, since @command{awk} is by design a very concise language, +In addition, because @command{awk} is by design a very concise language, it is easy to lose sight of everything that is going on ``inside'' each line of @command{awk} code. The debugger provides the opportunity to look at the individual primitive instructions carried out @@ -29150,7 +29258,7 @@ gawk> @kbd{bt} @end example This tells us that @code{are_equal()} was called by the main program at -line 88 of @file{uniq.awk}. (This is not a big surprise, since this +line 88 of @file{uniq.awk}. (This is not a big surprise, because this is the only call to @code{are_equal()} in the program, but in more complex programs, knowing who called a function and with what parameters can be the key to finding the source of the problem.) @@ -29167,7 +29275,7 @@ gawk> @kbd{p n} @end example @noindent -In this case, @code{n} is an uninitialized local variable, since the +In this case, @code{n} is an uninitialized local variable, because the function was called without arguments (@pxref{Function Calls}). A more useful variable to display might be the current record: @@ -29178,8 +29286,8 @@ gawk> @kbd{p $0} @end example @noindent -This might be a bit puzzling at first since this is the second line of -our test input above. Let's look at @code{NR}: +This might be a bit puzzling at first, as this is the second line of +our test input. Let's look at @code{NR}: @example gawk> @kbd{p NR} @@ -29219,7 +29327,7 @@ gawk> @kbd{n} This tells us that @command{gawk} is now ready to execute line 66, which decides whether to give the lines the special ``field skipping'' treatment indicated by the @option{-1} command-line option. (Notice that we skipped -from where we were before at line 63 to here, since the condition in line 63 +from where we were before at line 63 to here, because the condition in line 63 @samp{if (fcount == 0 && charcount == 0)} was false.) Continuing to step, we now get to the splitting of the current and @@ -29249,7 +29357,7 @@ gawk> @kbd{p n m alast aline} This is kind of disappointing, though. All we found out is that there are five elements in @code{alast}; @code{m} and @code{aline} don't have -values since we are at line 68 but haven't executed it yet. +values because we are at line 68 but haven't executed it yet. This information is useful enough (we now know that none of the words were accidentally left out), but what if we want to see inside the array? @@ -29358,8 +29466,9 @@ show the abbreviation on a second description line. A debugger command name may also be truncated if that partial name is unambiguous. The debugger has the built-in capability to automatically repeat the previous command just by hitting @key{Enter}. -This works for the commands @code{list}, @code{next}, @code{nexti}, @code{step}, @code{stepi} -and @code{continue} executed without any argument. +This works for the commands @code{list}, @code{next}, @code{nexti}, +@code{step}, @code{stepi}, and @code{continue} executed without any +argument. @menu * Breakpoint Control:: Control of Breakpoints. @@ -29374,9 +29483,9 @@ and @code{continue} executed without any argument. @node Breakpoint Control @subsection Control of Breakpoints -As we saw above, the first thing you probably want to do in a debugging -session is to get your breakpoints set up, since otherwise your program -will just run as if it was not under the debugger. The commands for +As we saw earlier, the first thing you probably want to do in a debugging +session is to get your breakpoints set up, because your program +will otherwise just run as if it was not under the debugger. The commands for controlling breakpoints are: @table @asis @@ -29447,8 +29556,8 @@ that the debugger evaluates whenever the breakpoint or watchpoint is reached. If the condition is true, then the debugger stops execution and prompts for a command. Otherwise, the debugger continues executing the program. If the condition expression is -not specified, any existing condition is removed; i.e., the breakpoint or -watchpoint is made unconditional. +not specified, any existing condition is removed (i.e., the breakpoint or +watchpoint is made unconditional). @cindex debugger commands, @code{d} (@code{delete}) @cindex debugger commands, @code{delete} @@ -29589,7 +29698,7 @@ Execute one (or @var{count}) instruction(s), stepping over function calls. @item @code{return} [@var{value}] Cancel execution of a function call. If @var{value} (either a string or a number) is specified, it is used as the function's return value. If used in a -frame other than the innermost one (the currently executing function, i.e., +frame other than the innermost one (the currently executing function; i.e., frame number 0), discard all inner frames in addition to the selected one, and the caller of that frame becomes the innermost frame. @@ -29655,7 +29764,7 @@ gawk> @kbd{display x} @end example @noindent -displays the assigned item number, the variable name and its current value. +This displays the assigned item number, the variable name, and its current value. If the display variable refers to a function parameter, it is silently deleted from the list as soon as the execution reaches a context where no such variable of the given name exists. @@ -29723,7 +29832,7 @@ or field. String values must be enclosed between double quotes (@code{"}@dots{}@code{"}). You can also set special @command{awk} variables, such as @code{FS}, -@code{NF}, @code{NR}, etc. +@code{NF}, @code{NR}, and son on. @cindex debugger commands, @code{w} (@code{watch}) @cindex debugger commands, @code{watch} @@ -29786,7 +29895,7 @@ Print a backtrace of all function calls (stack frames), or innermost @var{count} frames if @var{count} > 0. Print the outermost @var{count} frames if @var{count} < 0. The backtrace displays the name and arguments to each function, the source @value{FN}, and the line number. -The alias @code{where} for @code{backtrace} is provided for long-time +The alias @code{where} for @code{backtrace} is provided for longtime GDB users who may be used to that command. @cindex debugger commands, @code{down} @@ -29815,7 +29924,7 @@ Then select and print the frame. @end table @node Debugger Info -@subsection Obtaining Information about the Program and the Debugger State +@subsection Obtaining Information About the Program and the Debugger State Besides looking at the values of variables, there is often a need to get other sorts of information about the state of your program and of the @@ -29983,51 +30092,51 @@ partial dump of Davide Brini's obfuscated code @smallexample gawk> @kbd{dump} @print{} # BEGIN -@print{} -@print{} [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] -@print{} [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc280] Op_match : -@print{} [ 1:0xfcc1e0] Op_store_var : O -@print{} [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc320] Op_equal : -@print{} [ 1:0xfcc200] Op_store_var : o -@print{} [ 1:0xfcc380] Op_push : o -@print{} [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER] -@print{} [ 1:0xfcc220] Op_push_lhs : o [do_reference = true] -@print{} [ 1:0xfcc300] Op_assign_plus : -@print{} [ :0xfcc2c0] Op_pop : -@print{} [ 1:0xfcc400] Op_push : O -@print{} [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR] -@print{} [ :0xfcc4a0] Op_no_op : -@print{} [ 1:0xfcc480] Op_push : O -@print{} [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0] -@print{} [ 1:0xfcc3c0] Op_store_var : x -@print{} [ 1:0xfcc440] Op_push_lhs : X [do_reference = true] -@print{} [ 1:0xfcc3a0] Op_postincrement : -@print{} [ 1:0xfcc4e0] Op_push : x -@print{} [ 1:0xfcc540] Op_push : o -@print{} [ 1:0xfcc500] Op_plus : -@print{} [ 1:0xfcc580] Op_push : o -@print{} [ 1:0xfcc560] Op_plus : -@print{} [ 1:0xfcc460] Op_leq : -@print{} [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0] -@print{} [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR] -@print{} [ :0xfcc660] Op_no_op : -@print{} [ 1:0xfcc520] Op_assign_concat : c -@print{} [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440] -@print{} -@dots{} -@print{} +@print{} +@print{} [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] +@print{} [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc280] Op_match : +@print{} [ 1:0xfcc1e0] Op_store_var : O +@print{} [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc320] Op_equal : +@print{} [ 1:0xfcc200] Op_store_var : o +@print{} [ 1:0xfcc380] Op_push : o +@print{} [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER] +@print{} [ 1:0xfcc220] Op_push_lhs : o [do_reference = true] +@print{} [ 1:0xfcc300] Op_assign_plus : +@print{} [ :0xfcc2c0] Op_pop : +@print{} [ 1:0xfcc400] Op_push : O +@print{} [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR] +@print{} [ :0xfcc4a0] Op_no_op : +@print{} [ 1:0xfcc480] Op_push : O +@print{} [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0] +@print{} [ 1:0xfcc3c0] Op_store_var : x +@print{} [ 1:0xfcc440] Op_push_lhs : X [do_reference = true] +@print{} [ 1:0xfcc3a0] Op_postincrement : +@print{} [ 1:0xfcc4e0] Op_push : x +@print{} [ 1:0xfcc540] Op_push : o +@print{} [ 1:0xfcc500] Op_plus : +@print{} [ 1:0xfcc580] Op_push : o +@print{} [ 1:0xfcc560] Op_plus : +@print{} [ 1:0xfcc460] Op_leq : +@print{} [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0] +@print{} [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR] +@print{} [ :0xfcc660] Op_no_op : +@print{} [ 1:0xfcc520] Op_assign_concat : c +@print{} [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440] +@print{} +@dots{} +@print{} @print{} [ 2:0xfcc5a0] Op_K_printf : [expr_count = 17] [redir_type = ""] -@print{} [ :0xfcc140] Op_no_op : -@print{} [ :0xfcc1c0] Op_atexit : -@print{} [ :0xfcc640] Op_stop : -@print{} [ :0xfcc180] Op_no_op : -@print{} [ :0xfcd150] Op_after_beginfile : -@print{} [ :0xfcc160] Op_no_op : -@print{} [ :0xfcc1a0] Op_after_endfile : +@print{} [ :0xfcc140] Op_no_op : +@print{} [ :0xfcc1c0] Op_atexit : +@print{} [ :0xfcc640] Op_stop : +@print{} [ :0xfcc180] Op_no_op : +@print{} [ :0xfcd150] Op_after_beginfile : +@print{} [ :0xfcc160] Op_no_op : +@print{} [ :0xfcc1a0] Op_after_endfile : gawk> @end smallexample @@ -30084,7 +30193,7 @@ function @var{function}. This command may change the current source file. @itemx @code{q} Exit the debugger. Debugging is great fun, but sometimes we all have to tend to other obligations in life, and sometimes we find the bug, -and are free to go on to the next one! As we saw above, if you are +and are free to go on to the next one! As we saw earlier, if you are running a program, the debugger warns you if you accidentally type @samp{q} or @samp{quit}, to make sure you really want to quit. @@ -30161,7 +30270,7 @@ If you perused the dump of opcodes in @ref{Miscellaneous Debugger Commands} (or if you are already familiar with @command{gawk} internals), you will realize that much of the internal manipulation of data in @command{gawk}, as in many interpreters, is done on a stack. -@code{Op_push}, @code{Op_pop}, etc., are the ``bread and butter'' of +@code{Op_push}, @code{Op_pop}, and the like, are the ``bread and butter'' of most @command{gawk} code. Unfortunately, as of now, the @command{gawk} @@ -30175,8 +30284,8 @@ change back to obscure, perhaps more optimal code later. @item There is no way to look ``inside'' the process of compiling regular expressions to see if you got it right. As an @command{awk} -programmer, you are expected to know what @code{/[^[:alnum:][:blank:]]/} -means. +programmer, you are expected to know the meaning of +@code{/[^[:alnum:][:blank:]]/}. @item The @command{gawk} debugger is designed to be used by running a program (with all its @@ -30228,7 +30337,7 @@ and editing. @end itemize @node Arbitrary Precision Arithmetic -@chapter Arithmetic and Arbitrary Precision Arithmetic with @command{gawk} +@chapter Arithmetic and Arbitrary-Precision Arithmetic with @command{gawk} @cindex arbitrary precision @cindex multiple precision @cindex infinite precision @@ -30238,9 +30347,9 @@ This @value{CHAPTER} introduces some basic concepts relating to how computers do arithmetic and defines some important terms. It then proceeds to describe floating-point arithmetic, which is what @command{awk} uses for all its computations, including a -discussion of arbitrary precision floating point arithmetic, which is +discussion of arbitrary-precision floating-point arithmetic, which is a feature available only in @command{gawk}. It continues on to present -arbitrary precision integers, and concludes with a description of some +arbitrary-precision integers, and concludes with a description of some points where @command{gawk} and the POSIX standard are not quite in agreement. @@ -30303,51 +30412,51 @@ The disadvantage is that their range is limited. @cindex integers, unsigned In computers, integer values come in two flavors: @dfn{signed} and @dfn{unsigned}. Signed values may be negative or positive, whereas -unsigned values are always positive (that is, greater than or equal +unsigned values are always positive (i.e., greater than or equal to zero). In computer systems, integer arithmetic is exact, but the possible range of values is limited. Integer arithmetic is generally faster than -floating point arithmetic. +floating-point arithmetic. -@item Floating point arithmetic +@item Floating-point arithmetic Floating-point numbers represent what were called in school ``real'' -numbers; i.e., those that have a fractional part, such as 3.1415927. +numbers (i.e., those that have a fractional part, such as 3.1415927). The advantage to floating-point numbers is that they can represent a much larger range of values than can integers. The disadvantage is that there are numbers that they cannot represent exactly. -Modern systems support floating point arithmetic in hardware, with a +Modern systems support floating-point arithmetic in hardware, with a limited range of values. There are software libraries that allow -the use of arbitrary precision floating point calculations. +the use of arbitrary-precision floating-point calculations. -POSIX @command{awk} uses @dfn{double precision} floating-point numbers, which -can hold more digits than @dfn{single precision} floating-point numbers. -@command{gawk} has facilities for performing arbitrary precision floating -point arithmetic, which we describe in more detail shortly. +POSIX @command{awk} uses @dfn{double-precision} floating-point numbers, which +can hold more digits than @dfn{single-precision} floating-point numbers. +@command{gawk} has facilities for performing arbitrary-precision +floating-point arithmetic, which we describe in more detail shortly. @end table -Computers work with integer and floating point values of different -ranges. Integer values are usually either 32 or 64 bits in size. Single -precision floating point values occupy 32 bits, whereas double precision -floating point values occupy 64 bits. Floating point values are always +Computers work with integer and floating-point values of different +ranges. Integer values are usually either 32 or 64 bits in size. +Single-precision floating-point values occupy 32 bits, whereas double-precision +floating-point values occupy 64 bits. Floating-point values are always signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. @float Table,table-numeric-ranges -@caption{Value Ranges for Different Numeric Representations} +@caption{Value ranges for different numeric representations} @multitable @columnfractions .34 .33 .33 @headitem Numeric representation @tab Minimum value @tab Maximum value @item 32-bit signed integer @tab @minus{}2,147,483,648 @tab 2,147,483,647 @item 32-bit unsigned integer @tab 0 @tab 4,294,967,295 @item 64-bit signed integer @tab @minus{}9,223,372,036,854,775,808 @tab 9,223,372,036,854,775,807 @item 64-bit unsigned integer @tab 0 @tab 18,446,744,073,709,551,615 -@item Single precision floating point (approximate) @tab @code{1.175494e-38} @tab @code{3.402823e+38} -@item Double precision floating point (approximate) @tab @code{2.225074e-308} @tab @code{1.797693e+308} +@item Single-precision floating point (approximate) @tab @code{1.175494e-38} @tab @code{3.402823e+38} +@item Double-precision floating point (approximate) @tab @code{2.225074e-308} @tab @code{1.797693e+308} @end multitable @end float @node Math Definitions -@section Other Stuff To Know +@section Other Stuff to Know The rest of this @value{CHAPTER} uses a number of terms. Here are some informal definitions that should help you work your way through the material @@ -30424,7 +30533,7 @@ How numbers are rounded up or down when necessary. More details are provided later. @item Significand -A floating point value consists the significand multiplied by 10 +A floating-point value consists the significand multiplied by 10 to the power of the exponent. For example, in @code{1.2345e67}, the significand is @code{1.2345}. @@ -30442,19 +30551,19 @@ on some of those terms. On modern systems, floating-point hardware uses the representation and operations defined by the IEEE 754 standard. Three of the standard IEEE 754 types are 32-bit single precision, -64-bit double precision and 128-bit quadruple precision. +64-bit double precision, and 128-bit quadruple precision. The standard also specifies extended precision formats to allow greater precisions and larger exponent ranges. -(@command{awk} uses only the 64-bit double precision format.) +(@command{awk} uses only the 64-bit double-precision format.) @ref{table-ieee-formats} lists the precision and exponent field values for the basic IEEE 754 binary formats: @float Table,table-ieee-formats -@caption{Basic IEEE Format Values} +@caption{Basic IEEE format values} @multitable @columnfractions .20 .20 .20 .20 .20 @headitem Name @tab Total bits @tab Precision @tab Minimum exponent @tab Maximum exponent -@item Single @tab 32 @tab 24 @tab @minus{}126 @tab +127 +@item Single @tab 32 @tab 24 @tab @minus{}126 @tab +127 @item Double @tab 64 @tab 53 @tab @minus{}1022 @tab +1023 @item Quadruple @tab 128 @tab 113 @tab @minus{}16382 @tab +16383 @end multitable @@ -30466,14 +30575,14 @@ one extra bit of significand. @end quotation @node MPFR features -@section Arbitrary Precision Arithmetic Features In @command{gawk} +@section Arbitrary-Precision Arithmetic Features in @command{gawk} -By default, @command{gawk} uses the double precision floating-point values +By default, @command{gawk} uses the double-precision floating-point values supplied by the hardware of the system it runs on. However, if it was -compiled to do so, @command{gawk} uses the @uref{http://www.mpfr.org -GNU MPFR} and @uref{http://gmplib.org, GNU MP} (GMP) libraries for arbitrary -precision arithmetic on numbers. You can see if MPFR support is available -like so: +compiled to do so, @command{gawk} uses the @uref{http://www.mpfr.org, +GNU MPFR} and @uref{http://gmplib.org, GNU MP} (GMP) libraries for +arbitrary-precision arithmetic on numbers. You can see if MPFR support +is available like so: @example $ @kbd{gawk --version} @@ -30501,11 +30610,11 @@ Two predefined variables, @code{PREC} and @code{ROUNDMODE}, provide control over the working precision and the rounding mode. The precision and the rounding mode are set globally for every operation to follow. -@xref{Setting precision}, and @ref{Setting the rounding mode}, +@DBXREF{Setting precision} and @DBREF{Setting the rounding mode} for more information. @node FP Math Caution -@section Floating Point Arithmetic: Caveat Emptor! +@section Floating-Point Arithmetic: Caveat Emptor! @quotation @i{Math class is tough!} @@ -30538,17 +30647,17 @@ rely just on what we tell you. @end menu @node Inexactness of computations -@subsection Floating Point Arithmetic Is Not Exact +@subsection Floating-Point Arithmetic Is Not Exact Binary floating-point representations and arithmetic are inexact. Simple values like 0.1 cannot be precisely represented using binary floating-point numbers, and the limited precision of floating-point numbers means that slight changes in the order of operations or the precision of intermediate storage -can change the result. To make matters worse, with arbitrary precision -floating-point, you can set the precision before starting a computation, -but then you cannot be sure of the number of significant decimal places -in the final result. +can change the result. To make matters worse, with arbitrary-precision +floating-point arithmetic, you can set the precision before starting a +computation, but then you cannot be sure of the number of significant +decimal places in the final result. @menu * Inexact representation:: Numbers are not exactly represented. @@ -30570,7 +30679,7 @@ y = 0.425 Unlike the number in @code{y}, the number stored in @code{x} is exactly representable -in binary since it can be written as a finite sum of one or +in binary because it can be written as a finite sum of one or more fractions whose denominators are all powers of two. When @command{gawk} reads a floating-point number from program source, it automatically rounds that number to whatever @@ -30596,7 +30705,7 @@ Because the underlying representation can be a little bit off from the exact val comparing floating-point values to see if they are exactly equal is generally a bad idea. Here is an example where it does not work like you would expect: -@example +@example $ @kbd{gawk 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} @print{} 0 @end example @@ -30605,7 +30714,7 @@ The general wisdom when comparing floating-point values is to see if they are within some small range of each other (called a @dfn{delta}, or @dfn{tolerance}). You have to decide how small a delta is important to you. Code to do -this looks something like this: +this looks something like the following: @example delta = 0.00001 # for example @@ -30625,7 +30734,7 @@ else The loss of accuracy during a single computation with floating-point numbers usually isn't enough to worry about. However, if you compute a -value which is the result of a sequence of floating point operations, +value which is the result of a sequence of floating-point operations, the error can accumulate and greatly affect the computation itself. Here is an attempt to compute the value of @value{PI} using one of its many series representations: @@ -30671,9 +30780,9 @@ $ @kbd{gawk 'BEGIN @{} @end example @node Getting Accuracy -@subsection Getting The Accuracy You Need +@subsection Getting the Accuracy You Need -Can arbitrary precision arithmetic give exact results? There are +Can arbitrary-precision arithmetic give exact results? There are no easy answers. The standard rules of algebra often do not apply when using floating-point arithmetic. Among other things, the distributive and associative laws @@ -30682,12 +30791,12 @@ for your computation. Rounding error, cumulative precision loss and underflow are often troublesome. When @command{gawk} tests the expressions @samp{0.1 + 12.2} and -@samp{12.3} for equality using the machine double precision arithmetic, +@samp{12.3} for equality using the machine double-precision arithmetic, it decides that they are not equal! (@xref{Comparing FP Values}.) You can get the result you want by increasing the precision; 56 bits in this case does the job: -@example +@example $ @kbd{gawk -M -v PREC=56 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} @print{} 1 @end example @@ -30696,7 +30805,7 @@ If adding more bits is good, perhaps adding even more bits of precision is better? Here is what happens if we use an even larger value of @code{PREC}: -@example +@example $ @kbd{gawk -M -v PREC=201 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} @print{} 0 @end example @@ -30705,15 +30814,15 @@ This is not a bug in @command{gawk} or in the MPFR library. It is easy to forget that the finite number of bits used to store the value is often just an approximation after proper rounding. The test for equality succeeds if and only if @emph{all} bits in the two operands -are exactly the same. Since this is not necessarily true after floating-point +are exactly the same. Because this is not necessarily true after floating-point computations with a particular precision and effective rounding mode, a straight test for equality may not work. Instead, compare the two numbers to see if they are within the desirable delta of each other. In applications where 15 or fewer decimal places suffice, -hardware double precision arithmetic can be adequate, and is usually much faster. +hardware double-precision arithmetic can be adequate, and is usually much faster. But you need to keep in mind that every floating-point operation -can suffer a new rounding error with catastrophic consequences as illustrated +can suffer a new rounding error with catastrophic consequences, as illustrated by our earlier attempt to compute the value of @value{PI}. Extra precision can greatly enhance the stability and the accuracy of your computation in such cases. @@ -30737,9 +30846,9 @@ an arbitrarily large value for @code{PREC}. Reformulation of the problem at hand is often the correct approach in such situations. @node Try To Round -@subsection Try A Few Extra Bits of Precision and Rounding +@subsection Try a Few Extra Bits of Precision and Rounding -Instead of arbitrary precision floating-point arithmetic, +Instead of arbitrary-precision floating-point arithmetic, often all you need is an adjustment of your logic or a different order for the operations in your calculation. The stability and the accuracy of the computation of @value{PI} @@ -30751,7 +30860,7 @@ simple algebraic transformation: @end example @noindent -After making this, change the program converges to +After making this change, the program converges to @value{PI} in under 30 iterations: @example @@ -30767,7 +30876,7 @@ $ @kbd{gawk -f pi2.awk} @end example @node Setting precision -@subsection Setting The Precision +@subsection Setting the Precision @command{gawk} uses a global working precision; it does not keep track of the precision or accuracy of individual numbers. Performing an arithmetic @@ -30779,14 +30888,14 @@ shown in @ref{table-predefined-precision-strings}, to emulate an IEEE 754 binary format. @float Table,table-predefined-precision-strings -@caption{Predefined Precision Strings For @code{PREC}} +@caption{Predefined precision strings for @code{PREC}} @multitable {@code{"double"}} {12345678901234567890123456789012345} @headitem @code{PREC} @tab IEEE 754 Binary Format -@item @code{"half"} @tab 16-bit half-precision. -@item @code{"single"} @tab Basic 32-bit single precision. -@item @code{"double"} @tab Basic 64-bit double precision. -@item @code{"quad"} @tab Basic 128-bit quadruple precision. -@item @code{"oct"} @tab 256-bit octuple precision. +@item @code{"half"} @tab 16-bit half-precision +@item @code{"single"} @tab Basic 32-bit single precision +@item @code{"double"} @tab Basic 64-bit double precision +@item @code{"quad"} @tab Basic 128-bit quadruple precision +@item @code{"oct"} @tab 256-bit octuple precision @end multitable @end float @@ -30817,7 +30926,7 @@ differences among various ways to print a floating-point constant: @example $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 0.1) @}'} -@print{} 0.1000000000000000055511151 +@print{} 0.1000000000000000055511151 $ @kbd{gawk -M -v PREC=113 'BEGIN @{ printf("%0.25f\n", 0.1) @}'} @print{} 0.1000000000000000000000000 $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", "0.1") @}'} @@ -30827,7 +30936,7 @@ $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 1/10) @}'} @end example @node Setting the rounding mode -@subsection Setting The Rounding Mode +@subsection Setting the Rounding Mode The @code{ROUNDMODE} variable provides program level control over the rounding mode. @@ -30835,7 +30944,7 @@ The correspondence between @code{ROUNDMODE} and the IEEE rounding modes is shown in @ref{table-gawk-rounding-modes}. @float Table,table-gawk-rounding-modes -@caption{@command{gawk} Rounding Modes} +@caption{@command{gawk} rounding modes} @multitable @columnfractions .45 .30 .25 @headitem Rounding Mode @tab IEEE Name @tab @code{ROUNDMODE} @item Round to nearest, ties to even @tab @code{roundTiesToEven} @tab @code{"N"} or @code{"n"} @@ -30850,7 +30959,7 @@ rounding modes is shown in @ref{table-gawk-rounding-modes}. selects the IEEE 754 rounding mode @code{roundTiesToEven}. In @ref{table-gawk-rounding-modes}, the value @code{"A"} selects @code{roundTiesToAway}. This is only available if your version of the -MPFR library supports it; otherwise setting @code{ROUNDMODE} to @code{"A"} +MPFR library supports it; otherwise, setting @code{ROUNDMODE} to @code{"A"} has no effect. The default mode @code{roundTiesToEven} is the most preferred, @@ -30921,14 +31030,14 @@ accumulation of round-off error, look for a significant difference in output when you change the rounding mode to be sure. @node Arbitrary Precision Integers -@section Arbitrary Precision Integer Arithmetic with @command{gawk} +@section Arbitrary-Precision Integer Arithmetic with @command{gawk} @cindex integers, arbitrary precision @cindex arbitrary precision integers When given the @option{-M} option, -@command{gawk} performs all integer arithmetic using GMP arbitrary -precision integers. Any number that looks like an integer in a source -or @value{DF} is stored as an arbitrary precision integer. The size +@command{gawk} performs all integer arithmetic using GMP arbitrary-precision +integers. Any number that looks like an integer in a source +or @value{DF} is stored as an arbitrary-precision integer. The size of the integer is limited only by the available memory. For example, the following computes @iftex @@ -30943,7 +31052,7 @@ the following computes 5432, @c @end docbook the result of which is beyond the -limits of ordinary hardware double precision floating point values: +limits of ordinary hardware double-precision floating-point values: @example $ @kbd{gawk -M 'BEGIN @{} @@ -30955,7 +31064,7 @@ $ @kbd{gawk -M 'BEGIN @{} @print{} 62060698786608744707 ... 92256259918212890625 @end example -If instead you were to compute the same value using arbitrary precision +If instead you were to compute the same value using arbitrary-precision floating-point values, the precision needed for correct output (using the formula @iftex @@ -31000,10 +31109,10 @@ floating-point results exactly. You can either increase the precision @samp{2.0} with an integer, to perform all computations using integer arithmetic to get the correct output. -Sometimes @command{gawk} must implicitly convert an arbitrary precision -integer into an arbitrary precision floating-point value. This is +Sometimes @command{gawk} must implicitly convert an arbitrary-precision +integer into an arbitrary-precision floating-point value. This is primarily because the MPFR library does not always provide the relevant -interface to process arbitrary precision integers or mixed-mode numbers +interface to process arbitrary-precision integers or mixed-mode numbers as needed by an operation or function. In such a case, the precision is set to the minimum value necessary for exact conversion, and the working precision is not used for this purpose. If this is not what you need or @@ -31021,7 +31130,7 @@ to begin with: gawk -M 'BEGIN @{ n = 13.0; print n % 2.0 @}' @end example -Note that for the particular example above, it is likely best +Note that for this particular example, it is likely best to just use the following: @example @@ -31043,13 +31152,13 @@ should support additional features. These features are: @itemize @value{BULLET} @item -Interpretation of floating point data values specified in hexadecimal +Interpretation of floating-point data values specified in hexadecimal notation (e.g., @code{0xDEADBEEF}). (Note: data values, @emph{not} source code constants.) @item -Support for the special IEEE 754 floating point values ``Not A Number'' -(NaN), positive Infinity (``inf'') and negative Infinity (``@minus{}inf''). +Support for the special IEEE 754 floating-point values ``Not A Number'' +(NaN), positive Infinity (``inf''), and negative Infinity (``@minus{}inf''). In particular, the format for these values is as specified by the ISO 1999 C standard, which ignores case and can allow implementation-dependent additional characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}. @@ -31060,8 +31169,8 @@ practice: @itemize @value{BULLET} @item -The @command{gawk} maintainer feels that supporting hexadecimal floating -point values, in particular, is ugly, and was never intended by the +The @command{gawk} maintainer feels that supporting hexadecimal +floating-point values, in particular, is ugly, and was never intended by the original designers to be part of the language. @item @@ -31075,10 +31184,10 @@ interpretation of the standard, which requires a certain amount of intended by the standard developers. In other words, ``we see how you got where you are, but we don't think that that's where you want to be.'' -Recognizing the above issues, but attempting to provide compatibility +Recognizing these issues, but attempting to provide compatibility with the earlier versions of the standard, the 2008 POSIX standard added explicit wording to allow, but not require, -that @command{awk} support hexadecimal floating point values and +that @command{awk} support hexadecimal floating-point values and special values for ``Not A Number'' and infinity. Although the @command{gawk} maintainer continues to feel that @@ -31135,12 +31244,12 @@ Thus @samp{+nan} and @samp{+NaN} are the same. @itemize @value{BULLET} @item Most computer arithmetic is done using either integers or floating-point -values. Standard @command{awk} uses double precision +values. Standard @command{awk} uses double-precision floating-point values. @item -In the early 1990's, Barbie mistakenly said ``Math class is tough!'' -While math isn't tough, floating-point arithmetic isn't the same +In the early 1990s, Barbie mistakenly said ``Math class is tough!'' +Although math isn't tough, floating-point arithmetic isn't the same as pencil and paper math, and care must be taken: @c nested list @@ -31173,7 +31282,7 @@ arithmetic. Use @code{PREC} to set the precision in bits, and @item With @option{-M}, @command{gawk} performs -arbitrary precision integer arithmetic using the GMP library. +arbitrary-precision integer arithmetic using the GMP library. This is faster and more space efficient than using MPFR for the same calculations. @@ -31186,7 +31295,7 @@ It pays to be aware of them. Overall, there is no need to be unduly suspicious about the results from floating-point arithmetic. The lesson to remember is that floating-point arithmetic is always more complex than arithmetic using pencil and -paper. In order to take advantage of the power of computer floating-point, +paper. In order to take advantage of the power of computer floating point, you need to know its limitations and work within them. For most casual use of floating-point arithmetic, you will often get the expected result if you simply round the display of your final results to the correct number @@ -31250,8 +31359,8 @@ C library routines that could be of use. As with most software, ``the sky is the limit;'' if you can imagine something that you might want to do and can write in C or C++, you can write an extension to do it! -Extensions are written in C or C++, using the @dfn{Application Programming -Interface} (API) defined for this purpose by the @command{gawk} +Extensions are written in C or C++, using the @dfn{application programming +interface} (API) defined for this purpose by the @command{gawk} developers. The rest of this @value{CHAPTER} explains the facilities that the API provides and how to use them, and presents a small example extension. In addition, it documents @@ -31288,7 +31397,7 @@ int plugin_is_GPL_compatible; @end example @node Extension Mechanism Outline -@section At A High Level How It Works +@section How It Works at a High Level Communication between @command{gawk} and an extension is two-way. First, when an extension @@ -31303,22 +31412,22 @@ This is shown in @inlineraw{docbook, }. @ifnotdocbook @float Figure,figure-load-extension -@caption{Loading The Extension} +@caption{Loading the extension} @c FIXME: One day, it should not be necessary to have two cases, @c but rather just the one without the "txt" final argument. @c This applies to the other figures as well. @ifinfo -@center @image{api-figure1, , , Loading The Extension, txt} +@center @image{api-figure1, , , Loading the extension, txt} @end ifinfo @ifnotinfo -@center @image{api-figure1, , , Loading The Extension} +@center @image{api-figure1, , , Loading the extension} @end ifnotinfo @end float @end ifnotdocbook @docbook
-Loading The Extension +Loading the extension @@ -31338,19 +31447,19 @@ This is shown in @inlineraw{docbook, -Registering A New Function +Registering a new function @@ -31371,7 +31480,7 @@ This is shown in @inlineraw{docbook, } @ifnotdocbook @float Figure,figure-call-new-function -@caption{Calling The New Function} +@caption{Calling the new function} @ifinfo @center @image{api-figure3, , , Calling the new function, txt} @end ifinfo @@ -31383,7 +31492,7 @@ This is shown in @inlineraw{docbook, } @docbook
-Calling The New Function +Calling the new function @@ -31419,10 +31528,9 @@ The API also provides major and minor version numbers, so that an extension can check if the @command{gawk} it is loaded with supports the facilities it was compiled with. (Version mismatches ``shouldn't'' happen, but we all know how @emph{that} goes.) -@xref{Extension Versioning}, for details. +@DBXREF{Extension Versioning} for details. @end itemize - @node Extension API Description @section API Description @cindex extension API @@ -31464,20 +31572,23 @@ Allocating, reallocating, and releasing memory. @item Registration functions. You may register: + +@c nested list @itemize @value{MINUS} @item -extension functions, +Extension functions @item -exit callbacks, +Exit callbacks @item -a version string, +A version string @item -input parsers, +Input parsers @item -output wrappers, +Output wrappers @item -and two-way processors. +Two-way processors @end itemize + All of these are discussed in detail, later in this @value{CHAPTER}. @item @@ -31524,7 +31635,7 @@ Some points about using the API: @itemize @value{BULLET} @item -The following types and/or macros and/or functions are referenced +The following types, macros, and/or functions are referenced in @file{gawkapi.h}. For correct use, you must therefore include the corresponding standard header file @emph{before} including @file{gawkapi.h}: @@ -31538,7 +31649,7 @@ corresponding standard header file @emph{before} including @file{gawkapi.h}: @item @code{memset()} @tab @code{} @item @code{size_t} @tab @code{} @item @code{struct stat} @tab @code{} -@end multitable +@end multitable Due to portability concerns, especially to systems that are not fully standards-compliant, it is your responsibility @@ -31570,7 +31681,7 @@ and is managed by @command{gawk} from then on. The API defines several simple @code{struct}s that map values as seen from @command{awk}. A value can be a @code{double}, a string, or an array (as in multidimensional arrays, or when creating a new array). -String values maintain both pointer and length since embedded @sc{nul} +String values maintain both pointer and length, because embedded @sc{nul} characters are allowed. @quotation NOTE @@ -31595,14 +31706,14 @@ so that the extension can, e.g., print an error message @c The table there should be presented here @end itemize -While you may call the API functions by using the function pointers -directly, the interface is not so pretty. To make extension code look +You may call the API functions by using the function pointers +directly, but the interface is not so pretty. To make extension code look more like regular code, the @file{gawkapi.h} header file defines several macros that you should use in your code. This @value{SECTION} presents the macros as if they were functions. @node General Data Types -@subsection General Purpose Data Types +@subsection General-Purpose Data Types @cindex Robbins, Arnold @cindex Ramey, Chet @@ -31617,9 +31728,10 @@ can accommodate both love and hate.} @author Chet Ramey @end quotation -The extension API defines a number of simple types and structures for general -purpose use. Additional, more specialized, data structures are introduced -in subsequent @value{SECTION}s, together with the functions that use them. +The extension API defines a number of simple types and structures for +general-purpose use. Additional, more specialized, data structures are +introduced in subsequent @value{SECTION}s, together with the functions +that use them. @table @code @item typedef void *awk_ext_id_t; @@ -31646,8 +31758,9 @@ A simple boolean type. This represents a mutable string. @command{gawk} owns the memory pointed to if it supplied the value. Otherwise, it takes ownership of the memory pointed to. -@strong{Such memory must come from calling one of the -@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()} functions!} +@emph{Such memory must come from calling one of the +@code{gawk_malloc()}, @code{gawk_calloc()}, or +@code{gawk_realloc()} functions!} As mentioned earlier, strings are maintained using the current multibyte encoding. @@ -31673,7 +31786,7 @@ It is used in the following @code{struct}. @itemx @ @ @ @ @ @ @ @ awk_value_cookie_t@ vc; @itemx @ @ @ @ @} u; @itemx @} awk_value_t; -An ``@command{awk} value.'' +An ``@command{awk} value.'' The @code{val_type} member indicates what kind of value the @code{union} holds, and each member is of the appropriate type. @@ -31686,13 +31799,14 @@ These macros make accessing the fields of the @code{awk_value_t} more readable. @item typedef void *awk_scalar_t; -Scalars can be represented as an opaque type. These values are obtained from -@command{gawk} and then passed back into it. This is discussed in a general fashion below, -and in more detail in @ref{Symbol table by cookie}. +Scalars can be represented as an opaque type. These values are obtained +from @command{gawk} and then passed back into it. This is discussed +in a general fashion in the text following this list, and in more detail in +@ref{Symbol table by cookie}. @item typedef void *awk_value_cookie_t; A ``value cookie'' is an opaque type representing a cached value. -This is also discussed in a general fashion below, +This is also discussed in a general fashion in the text following this list, and in more detail in @ref{Cached values}. @end table @@ -31702,7 +31816,7 @@ Scalar values in @command{awk} are either numbers or strings. The indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings -require more work. Since @command{gawk} allows embedded @sc{nul} bytes +require more work. Because @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a data-pointer and length. This is the @code{awk_string_t} type. @@ -31715,13 +31829,13 @@ itself be an array. Discussion of arrays is delayed until The various macros listed earlier make it easier to use the elements of the @code{union} as if they were fields in a @code{struct}; this is a common coding practice in C. Such code is easier to write and to -read, however it remains @emph{your} responsibility to make sure that +read, but it remains @emph{your} responsibility to make sure that the @code{val_type} member correctly reflects the type of the value in the @code{awk_value_t}. Conceptually, the first three members of the @code{union} (number, string, and array) are all that is needed for working with @command{awk} values. -However, since the API provides routines for accessing and changing +However, because the API provides routines for accessing and changing the value of global scalar variables only by using the variable's name, there is a performance penalty: @command{gawk} must find the variable each time it is accessed and changed. This turns out to be a real issue, @@ -31761,7 +31875,7 @@ The API provides a number of @dfn{memory allocation} functions for allocating memory that can be passed to @command{gawk}, as well as a number of convenience macros. This @value{SUBSECTION} presents them all as function prototypes, in -the way that extension code would use them. +the way that extension code would use them: @table @code @item void *gawk_malloc(size_t size); @@ -31806,7 +31920,8 @@ The arguments to this macro are as follows: The pointer variable to point at the allocated storage. @item type -The type of the pointer variable, used to create a cast for the call to @code{gawk_malloc()}. +The type of the pointer variable. This is used to create a cast for +the call to @code{gawk_malloc()}. @item size The total number of bytes to be allocated. @@ -31841,7 +31956,7 @@ The arguments are the same as for the @code{emalloc()} macro. The API provides a number of @dfn{constructor} functions for creating string and numeric values, as well as a number of convenience macros. This @value{SUBSECTION} presents them all as function prototypes, in -the way that extension code would use them. +the way that extension code would use them: @table @code @item static inline awk_value_t * @@ -31920,8 +32035,8 @@ This is a pointer to the C function that provides the extension's functionality. The function must fill in @code{*result} with either a number or a string. @command{gawk} takes ownership of any string memory. -As mentioned earlier, string memory @strong{must} come from one of @code{gawk_malloc()}, -@code{gawk_calloc()} or @code{gawk_realloc()}. +As mentioned earlier, string memory @strong{must} come from one of +@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The @code{num_actual_args} argument tells the C function how many actual parameters were passed from the calling @command{awk} code. @@ -31956,7 +32071,7 @@ Such functions are useful if you have general ``cleanup'' tasks that should be performed in your extension (such as closing database connections or other resource deallocations). You can register such -a function with @command{gawk} using the following function. +a function with @command{gawk} using the following function: @table @code @item void awk_atexit(void (*funcp)(void *data, int exit_status), @@ -31977,8 +32092,9 @@ the function pointed to by @code{funcp}. @end table @end table -Exit callback functions are called in Last-In-First-Out (LIFO) order---that is, in -the reverse order in which they are registered with @command{gawk}. +Exit callback functions are called in last-in-first-out (LIFO) +order---that is, in the reverse order in which they are registered with +@command{gawk}. @node Extension Version String @subsubsection Registering An Extension Version String @@ -31989,7 +32105,7 @@ version of your extension, with @command{gawk}, as follows: @table @code @item void register_ext_version(const char *version); Register the string pointed to by @code{version} with @command{gawk}. -@command{gawk} does @emph{not} copy the @code{version} string, so +Note that @command{gawk} does @emph{not} copy the @code{version} string, so it should not be changed. @end table @@ -32071,7 +32187,7 @@ appropriately. @item When your extension is loaded, register your input parser with @command{gawk} using the @code{register_input_parser()} API function -(described below). +(described next). @end enumerate An @code{awk_input_buf_t} looks like this: @@ -32101,7 +32217,7 @@ The name of the file. @item int fd; A file descriptor for the file. If @command{gawk} was able to -open the file, then @code{fd} will @emph{not} be equal to +open the file, then @code{fd} will @emph{not} be equal to @code{INVALID_HANDLE}. Otherwise, it will. @item struct stat sbuf; @@ -32115,15 +32231,15 @@ The decision can be made based upon @command{gawk} state (the value of a variable defined previously by the extension and set by @command{awk} code), the name of the file, whether or not the file descriptor is valid, the information -in the @code{struct stat}, or any combination of the above. +in the @code{struct stat}, or any combination of these factors. Once @code{@var{XXX}_can_take_file()} has returned true, and @command{gawk} has decided to use your input parser, it calls @code{@var{XXX}_take_control_of()}. That function then fills one of either the @code{get_record} field or the @code{read_func} field in the @code{awk_input_buf_t}. It must also ensure that @code{fd} is @emph{not} -set to @code{INVALID_HANDLE}. All of the fields that may be filled by -@code{@var{XXX}_take_control_of()} are as follows: +set to @code{INVALID_HANDLE}. The following list describes the fields that +may be filled by @code{@var{XXX}_take_control_of()}: @table @code @item void *opaque; @@ -32138,13 +32254,13 @@ is not required to use this pointer. @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ size_t *rt_len); This function pointer should point to a function that creates the input records. Said function is the core of the input parser. Its behavior -is described below. +is described in the text following this list. @item ssize_t (*read_func)(); This function pointer should point to function that has the same behavior as the standard POSIX @code{read()} system call. It is an alternative to the @code{get_record} pointer. Its behavior -is also described below. +is also described in the text following this list. @item void (*close_func)(struct awk_input *iobuf); This function pointer should point to a function that does @@ -32282,7 +32398,7 @@ values, etc.) within @command{gawk}. The function pointed to by this field is called when @command{gawk} decides to let the output wrapper take control of the file. It should fill in appropriate members of the @code{awk_output_buf_t} structure, -as described below, and return true if successful, false otherwise. +as described next, and return true if successful, false otherwise. @item awk_const struct output_wrapper *awk_const next; This is for use by @command{gawk}; @@ -32425,9 +32541,9 @@ Register the two-way processor pointed to by @code{two_way_processor} with @cindex messages from extensions You can print different kinds of warning messages from your -extension, as described below. Note that for these functions, +extension, as described here. Note that for these functions, you must pass in the extension id received from @command{gawk} -when the extension was loaded.@footnote{Because the API uses only ISO C 90 +when the extension was loaded:@footnote{Because the API uses only ISO C 90 features, it cannot make use of the ISO C 99 variadic macro feature to hide that parameter. More's the pity.} @@ -32484,7 +32600,7 @@ value type, as appropriate. This behavior is summarized in @ref{table-value-types-returned}. @float Table,table-value-types-returned -@caption{API Value Types Returned} +@caption{API value types returned} @docbook @@ -32496,7 +32612,7 @@ value type, as appropriate. This behavior is summarized in - Type of Actual Value: + Type of Actual Value @@ -32532,7 +32648,7 @@ value type, as appropriate. This behavior is summarized in false - Requested: + Requested Scalar Scalar Scalar @@ -32563,7 +32679,7 @@ value type, as appropriate. This behavior is summarized in @ifnotplaintext @ifnotdocbook @multitable @columnfractions .50 .50 -@headitem @tab Type of Actual Value: +@headitem @tab Type of Actual Value @end multitable @c 10/2014: Thanks to Karl Berry for this bit to reduce the space: @tex @@ -32574,7 +32690,7 @@ value type, as appropriate. This behavior is summarized in @item @tab @b{String} @tab String @tab String @tab false @tab false @item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab false @tab false @item @b{Type} @tab @b{Array} @tab false @tab false @tab Array @tab false -@item @b{Requested:} @tab @b{Scalar} @tab Scalar @tab Scalar @tab false @tab false +@item @b{Requested} @tab @b{Scalar} @tab Scalar @tab Scalar @tab false @tab false @item @tab @b{Undefined} @tab String @tab Number @tab Array @tab Undefined @item @tab @b{Value Cookie} @tab false @tab false @tab false @tab false @end multitable @@ -32628,7 +32744,7 @@ indicates the type of value expected. @item awk_bool_t set_argument(size_t count, awk_array_t array); Convert a parameter that was undefined into an array; this provides call-by-reference for arrays. Return false if @code{count} is too big, -or if the argument's type is not undefined. @xref{Array Manipulation}, +or if the argument's type is not undefined. @DBXREF{Array Manipulation} for more information on creating arrays. @end table @@ -32683,7 +32799,7 @@ cannot change any of those variables. @quotation CAUTION It is possible for the lookup of @code{PROCINFO} to fail. This happens if the @command{awk} program being run does not reference @code{PROCINFO}; -in this case @command{gawk} doesn't bother to create the array and +in this case, @command{gawk} doesn't bother to create the array and populate it. @end quotation @@ -32693,9 +32809,9 @@ populate it. A @dfn{scalar cookie} is an opaque handle that provides access to a global variable or array. It is an optimization that avoids looking up variables in @command{gawk}'s symbol table every time -access is needed. This was discussed earlier, in @ref{General Data Types}. +access is needed. This was discussed earlier in @ref{General Data Types}. -The following functions let you work with scalar cookies. +The following functions let you work with scalar cookies: @table @code @item awk_bool_t sym_lookup_scalar(awk_scalar_t cookie, @@ -32740,18 +32856,21 @@ do_magic(int nargs, awk_value_t *result) @noindent This code looks (and is) simple and straightforward. So what's the problem? -Consider what happens if @command{awk}-level code associated with your -extension calls the @code{magic()} function (implemented in C by @code{do_magic()}), -once per record, while processing hundreds of thousands or millions of records. -The @code{MAGIC_VAR} variable is looked up in the symbol table once or twice per function call! +Well, consider what happens if @command{awk}-level code associated +with your extension calls the @code{magic()} function (implemented in +C by @code{do_magic()}), once per record, while processing hundreds +of thousands or millions of records. The @code{MAGIC_VAR} variable is +looked up in the symbol table once or twice per function call! -The symbol table lookup is really pure overhead; it is considerably more efficient -to get a cookie that represents the variable, and use that to get the variable's -value and update it as needed.@footnote{The difference is measurable and quite real. Trust us.} +The symbol table lookup is really pure overhead; it is considerably +more efficient to get a cookie that represents the variable, and use +that to get the variable's value and update it as needed.@footnote{The +difference is measurable and quite real. Trust us.} -Thus, the way to use cookies is as follows. First, install your extension's variable -in @command{gawk}'s symbol table using @code{sym_update()}, as usual. Then get a -scalar cookie for the variable using @code{sym_lookup()}: +Thus, the way to use cookies is as follows. First, install +your extension's variable in @command{gawk}'s symbol table using +@code{sym_update()}, as usual. Then get a scalar cookie for the variable +using @code{sym_lookup()}: @example static awk_scalar_t magic_var_cookie; /* cookie for MAGIC_VAR */ @@ -32814,7 +32933,7 @@ or @code{sym_update_scalar()}, as you like. However, you can understand the point of cached values if you remember that @emph{every} string value's storage @emph{must} come from @code{gawk_malloc()}, -@code{gawk_calloc()} or @code{gawk_realloc()}. +@code{gawk_calloc()}, or @code{gawk_realloc()}. If you have 20 variables, all of which have the same string value, you must create 20 identical copies of the string.@footnote{Numeric values are clearly less problematic, requiring only a C @code{double} to store.} @@ -32825,11 +32944,11 @@ is what the routines in this section let you do. The functions are as follows: @table @code @item awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result); -Create a cached string or numeric value from @code{value} for efficient later -assignment. -Only values of type @code{AWK_NUMBER} and @code{AWK_STRING} are allowed. Any other type -is rejected. While @code{AWK_UNDEFINED} could be allowed, doing so would -result in inferior performance. +Create a cached string or numeric value from @code{value} for +efficient later assignment. Only values of type @code{AWK_NUMBER} +and @code{AWK_STRING} are allowed. Any other type is rejected. +@code{AWK_UNDEFINED} could be allowed, but doing so would result in +inferior performance. @item awk_bool_t release_value(awk_value_cookie_t vc); Release the memory associated with a value cookie obtained @@ -32850,7 +32969,7 @@ my_extension_init() size_t long_string_len; /* code from earlier */ - @dots{} + @dots{} /* @dots{} fill in long_string and long_string_len @dots{} */ make_malloced_string(long_string, long_string_len, & value); create_value(& value, & answer_cookie); /* create cookie */ @@ -32880,7 +32999,7 @@ do_magic(int nargs, awk_value_t *result) @end example @noindent -Using value cookies in this way saves considerable storage, since all of +Using value cookies in this way saves considerable storage, as all of @code{VAR1} through @code{VAR100} share the same value. You might be wondering, ``Is this sharing problematic? @@ -32902,7 +33021,7 @@ you should release any cached values that you created, using @subsection Array Manipulation @cindex array manipulation in extensions -The primary data structure@footnote{Okay, the only data structure.} in @command{awk} +The primary data structure@footnote{OK, the only data structure.} in @command{awk} is the associative array (@pxref{Arrays}). Extensions need to be able to manipulate @command{awk} arrays. The API provides a number of data structures for working with arrays, @@ -32923,7 +33042,7 @@ both work with and create true arrays of arrays (@pxref{General Data Types}). @node Array Data Types @subsubsection Array Data Types -The data types associated with arrays are listed below. +The data types associated with arrays are as follows: @table @code @item typedef void *awk_array_t; @@ -33042,7 +33161,7 @@ The following functions relate to arrays as a whole: @table @code @item awk_array_t create_array(void); Create a new array to which elements may be added. -@xref{Creating Arrays}, for a discussion of how to +@DBXREF{Creating Arrays} for a discussion of how to create a new array and add elements to it. @item awk_bool_t clear_array(awk_array_t a_cookie); @@ -33077,7 +33196,7 @@ The function returns true upon success, false otherwise. @node Flattening Arrays @subsubsection Working With All The Elements of an Array -To @dfn{flatten} an array is create a structure that +To @dfn{flatten} an array is to create a structure that represents the full array in a fashion that makes it easy for C code to traverse the entire array. Test code in @file{extension/testext.c} does this, and also serves @@ -33245,7 +33364,7 @@ code) once you have called @code{release_flattened_array()}: @} @end example -Finally, since everything was successful, the function sets the +Finally, because everything was successful, the function sets the return value to success, and returns: @example @@ -33280,7 +33399,7 @@ code can access them and manipulate them. There are two important points about creating arrays from extension code: -@enumerate 1 +@itemize @value{BULLET} @item You must install a new array into @command{gawk}'s symbol table immediately upon creating it. Once you have done so, @@ -33322,7 +33441,7 @@ new_array = val.array_cookie; /* YOU MUST DO THIS */ If installing an array as a subarray, you must also retrieve the value of the array cookie after the call to @code{set_element()}. -@end enumerate +@end itemize The following C code is a simple test extension to create an array with two regular elements and with a subarray. The leading @code{#include} @@ -33441,7 +33560,7 @@ dl_load_func(func_table, testarray, "") @end ignore @end example -Here is sample script that loads the extension +Here is a sample script that loads the extension and then dumps the array: @example @@ -33471,7 +33590,7 @@ $ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk} @end example @noindent -(@xref{Finding Extensions}, for more information on the +(@DBXREF{Finding Extensions} for more information on the @env{AWKLIBPATH} environment variable.) @node Extension API Variables @@ -33583,8 +33702,8 @@ The others should not change during execution. As mentioned earlier (@pxref{Extension Mechanism Outline}), the function definitions as presented are really macros. To use these macros, your extension must provide a small amount of boilerplate code (variables and -functions) towards the top of your source file, using pre-defined names -as described below. The boilerplate needed is also provided in comments +functions) toward the top of your source file, using predefined names +as described here. The boilerplate needed is also provided in comments in the @file{gawkapi.h} header file: @example @@ -33672,7 +33791,7 @@ This macro expands to a @code{dl_load()} function that performs all the necessary initializations. @end table -The point of the all the variables and arrays is to let the +The point of all the variables and arrays is to let the @code{dl_load()} function (from the @code{dl_load_func()} macro) do all the standard work. It does the following: @@ -33707,7 +33826,7 @@ Compiled extensions have to be installed in a directory where built in the default fashion, the directory in which to find extensions is @file{/usr/local/lib/gawk}. You can also specify a search path with a list of directories to search for compiled extensions. -@xref{AWKLIBPATH Variable}, for more information. +@DBXREF{AWKLIBPATH Variable} for more information. @node Extension Example @section Example: Some File Functions @@ -33715,7 +33834,7 @@ path with a list of directories to search for compiled extensions. @quotation @i{No matter where you go, there you are.} -@author Buckaroo Bonzai +@author Buckaroo Banzai @end quotation @c It's enough to show chdir and stat, no need for fts @@ -33888,9 +34007,9 @@ in the @command{gawk} distribution for the complete version.} The file includes a number of standard header files, and then includes the @file{gawkapi.h} header file which provides the API definitions. -Those are followed by the necessary variable declarations +Those are followed by the necessary variable declarations to make use of the API macros and boilerplate code -(@pxref{Extension API Boilerplate}). +(@pxref{Extension API Boilerplate}): @example #ifdef HAVE_CONFIG_H @@ -33931,7 +34050,7 @@ that implements it is called @code{do_foo()}. The function should have two arguments: the first is an @code{int} usually called @code{nargs}, that represents the number of actual arguments for the function. The second is a pointer to an @code{awk_value_t}, usually named -@code{result}. +@code{result}: @example /* do_chdir --- provide dynamically loaded chdir() function for gawk */ @@ -33951,13 +34070,13 @@ do_chdir(int nargs, awk_value_t *result) @end example The @code{newdir} -variable represents the new directory to change to, retrieved +variable represents the new directory to change to, which is retrieved with @code{get_argument()}. Note that the first argument is numbered zero. If the argument is retrieved successfully, the function calls the @code{chdir()} system call. If the @code{chdir()} fails, @code{ERRNO} -is updated. +is updated: @example if (get_argument(0, AWK_STRING, & newdir)) @{ @@ -34158,7 +34277,7 @@ of @code{stat()}) to get the file information, in case the file is a symbolic link. However, if there were three arguments, @code{statfunc} is set point to @code{stat()}, instead. -Here is the @code{do_stat()} function. It starts with +Here is the @code{do_stat()} function, which starts with variable declarations and argument checking: @ignore @@ -34273,7 +34392,7 @@ dl_load_func(func_table, filefuncs, "") And that's it! @node Using Internal File Ops -@subsection Integrating The Extensions +@subsection Integrating the Extensions @cindex @command{gawk}, interpreter@comma{} adding code to Now that the code is written, it must be possible to add it at @@ -34282,9 +34401,9 @@ code must be compiled. Assuming that the functions are in a file named @file{filefuncs.c}, and @var{idir} is the location of the @file{gawkapi.h} header file, the following steps@footnote{In practice, you would probably want to -use the GNU Autotools---Automake, Autoconf, Libtool, and @command{gettext}---to +use the GNU Autotools (Automake, Autoconf, Libtool, and @command{gettext}) to configure and build your libraries. Instructions for doing so are beyond -the scope of this @value{DOCUMENT}. @xref{gawkextlib}, for Internet links to +the scope of this @value{DOCUMENT}. @DBXREF{gawkextlib} for Internet links to the tools.} create a GNU/Linux shared library: @example @@ -34292,7 +34411,7 @@ $ @kbd{gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -I@var{idir} filefuncs.c} $ @kbd{gcc -o filefuncs.so -shared filefuncs.o} @end example -Once the library exists, it is loaded by using the @code{@@load} keyword. +Once the library exists, it is loaded by using the @code{@@load} keyword: @example # file testff.awk @@ -34356,13 +34475,14 @@ $ @kbd{AWKLIBPATH=$PWD gawk -f testff.awk} @end example @node Extension Samples -@section The Sample Extensions In The @command{gawk} Distribution +@section The Sample Extensions in the @command{gawk} Distribution @cindex extensions distributed with @command{gawk} This @value{SECTION} provides brief overviews of the sample extensions that come in the @command{gawk} distribution. Some of them are intended -for production use, such the @code{filefuncs}, @code{readdir} and @code{inplace} extensions. -Others mainly provide example code that shows how to use the extension API. +for production use (e.g., the @code{filefuncs}, @code{readdir} and +@code{inplace} extensions). Others mainly provide example code that +shows how to use the extension API. @menu * Extension Sample File Functions:: The file functions sample. @@ -34383,9 +34503,9 @@ Others mainly provide example code that shows how to use the extension API. @end menu @node Extension Sample File Functions -@subsection File Related Functions +@subsection File-Related Functions -The @code{filefuncs} extension provides three different functions, as follows: +The @code{filefuncs} extension provides three different functions, as follows. The usage is: @table @asis @@ -34396,7 +34516,7 @@ This is how you load the extension. @item @code{result = chdir("/some/directory")} The @code{chdir()} function is a direct hook to the @code{chdir()} system call to change the current directory. It returns zero -upon success or less than zero upon error. In the latter case it updates +upon success or less than zero upon error. In the latter case, it updates @code{ERRNO}. @cindex @code{stat()} extension function @@ -34404,7 +34524,7 @@ upon success or less than zero upon error. In the latter case it updates The @code{stat()} function provides a hook into the @code{stat()} system call. It returns zero upon success or less than zero upon error. -In the latter case it updates @code{ERRNO}. +In the latter case, it updates @code{ERRNO}. By default, it uses the @code{lstat()} system call. However, if passed a third argument, it uses @code{stat()} instead. @@ -34451,8 +34571,8 @@ Not all systems support all file types. @tab All @item @code{flags = or(FTS_PHYSICAL, ...)} @itemx @code{result = fts(pathlist, flags, filedata)} Walk the file trees provided in @code{pathlist} and fill in the -@code{filedata} array as described below. @code{flags} is the bitwise -OR of several predefined values, also described below. +@code{filedata} array as described next. @code{flags} is the bitwise +OR of several predefined values, also described in a moment. Return zero if there were no errors, otherwise return @minus{}1. @end table @@ -34500,7 +34620,7 @@ whether or not @code{FTS_LOGICAL} is set. By default, the C library @code{fts()} routines do not return entries for @file{.} (dot) and @file{..} (dot-dot). This option causes entries for dot-dot to also be included. (The extension always includes an entry -for dot, see below.) +for dot; more on this in a moment.) @item FTS_XDEV During a traversal, do not cross onto a different mounted filesystem. @@ -34510,7 +34630,7 @@ During a traversal, do not cross onto a different mounted filesystem. The @code{filedata} array is first cleared. Then, @code{fts()} creates an element in @code{filedata} for every element in @code{pathlist}. The index is the name of the directory or file given in @code{pathlist}. -The element for this index is itself an array. There are two cases. +The element for this index is itself an array. There are two cases: @c nested table @table @emph @@ -34536,8 +34656,8 @@ contain an element named @code{"error"}, which is a string describing the error. @item The path is a directory In this case, the array contains one element for each entry in the -directory. If an entry is a file, that element is as for files, just -described. If the entry is a directory, that element is (recursively), +directory. If an entry is a file, that element is the same as for files, just +described. If the entry is a directory, that element is (recursively) an array describing the subdirectory. If @code{FTS_SEEDOT} was provided in the flags, then there will also be an element named @code{".."}. This element will be an array containing the data as provided by @code{stat()}. @@ -34556,8 +34676,8 @@ The @code{fts()} extension does not exactly mimic the interface of the C library @code{fts()} routines, choosing instead to provide an interface that is based on associative arrays, which is more comfortable to use from an @command{awk} program. This includes the -lack of a comparison function, since @command{gawk} already provides -powerful array sorting facilities. While an @code{fts_read()}-like +lack of a comparison function, because @command{gawk} already provides +powerful array sorting facilities. Although an @code{fts_read()}-like interface could have been provided, this felt less natural than simply creating a multidimensional array to represent the file hierarchy and its information. @@ -34567,7 +34687,7 @@ See @file{test/fts.awk} in the @command{gawk} distribution for an example use of the @code{fts()} extension function. @node Extension Sample Fnmatch -@subsection Interface To @code{fnmatch()} +@subsection Interface to @code{fnmatch()} This extension provides an interface to the C library @code{fnmatch()} function. The usage is: @@ -34580,10 +34700,10 @@ This is how you load the extension. @item result = fnmatch(pattern, string, flags) The return value is zero on success, @code{FNM_NOMATCH} if the string did not match the pattern, or -a different non-zero value if an error occurred. +a different nonzero value if an error occurred. @end table -Besides the @code{fnmatch()} function, the @code{fnmatch} extension +In addition to the @code{fnmatch()} function, the @code{fnmatch} extension adds one constant (@code{FNM_NOMATCH}), and an array of flag values named @code{FNM}. @@ -34601,7 +34721,7 @@ Either zero, or the bitwise OR of one or more of the flags in the @code{FNM} array. @end table -The flags are follows: +The flags are as follows: @multitable @columnfractions .25 .75 @headitem Array element @tab Corresponding flag defined by @code{fnmatch()} @@ -34624,9 +34744,9 @@ if (fnmatch("*.a", "foo.c", flags) == FNM_NOMATCH) @end example @node Extension Sample Fork -@subsection Interface To @code{fork()}, @code{wait()} and @code{waitpid()} +@subsection Interface to @code{fork()}, @code{wait()}, and @code{waitpid()} -The @code{fork} extension adds three functions, as follows. +The @code{fork} extension adds three functions, as follows: @table @code @item @@load "fork" @@ -34724,7 +34844,7 @@ $ @kbd{gawk -i inplace -v INPLACE_SUFFIX=.bak '@{ gsub(/foo/, "bar") @}} @subsection Character and Numeric values: @code{ord()} and @code{chr()} The @code{ordchr} extension adds two functions, named -@code{ord()} and @code{chr()}, as follows. +@code{ord()} and @code{chr()}, as follows: @table @code @item @@load "ordchr" @@ -34772,7 +34892,7 @@ indicating the type of the file. The letters and their corresponding file types are shown in @ref{table-readdir-file-types}. @float Table,table-readdir-file-types -@caption{File Types Returned By The @code{readdir} Extension} +@caption{File types returned by the @code{readdir} extension} @multitable @columnfractions .1 .9 @headitem Letter @tab File Type @item @code{b} @tab Block device @@ -34809,7 +34929,7 @@ BEGIN @{ FS = "/" @} @subsection Reversing Output The @code{revoutput} extension adds a simple output wrapper that reverses -the characters in each output line. It's main purpose is to show how to +the characters in each output line. Its main purpose is to show how to write an output wrapper, although it may be mildly amusing for the unwary. Here is an example: @@ -34831,7 +34951,7 @@ The output from this program is: The @code{revtwoway} extension adds a simple two-way processor that reverses the characters in each line sent to it for reading back by -the @command{awk} program. It's main purpose is to show how to write +the @command{awk} program. Its main purpose is to show how to write a two-way processor, although it may also be mildly amusing. The following example shows how to use it: @@ -34858,7 +34978,7 @@ is: @samp{cinap t'nod}. @node Extension Sample Read write array -@subsection Dumping and Restoring An Array +@subsection Dumping and Restoring an Array The @code{rwarray} extension adds two functions, named @code{writea()} and @code{reada()}, as follows: @@ -34884,7 +35004,7 @@ Here too, the return value is one on success and zero upon failure. The array created by @code{reada()} is identical to that written by @code{writea()} in the sense that the contents are the same. However, -due to implementation issues, the array traversal order of the recreated +due to implementation issues, the array traversal order of the re-created array is likely to be different from that of the original array. As array traversal order in @command{awk} is by default undefined, this is (technically) not a problem. If you need to guarantee a particular traversal @@ -34892,7 +35012,7 @@ order, use the array sorting features in @command{gawk} to do so (@pxref{Array Sorting}). The file contains binary data. All integral values are written in network -byte order. However, double precision floating-point values are written +byte order. However, double-precision floating-point values are written as native binary data. Thus, arrays containing only string data can theoretically be dumped on systems with one byte order and restored on systems with a different one, but this has not been tried. @@ -34908,7 +35028,7 @@ ret = reada("arraydump.bin", array) @end example @node Extension Sample Readfile -@subsection Reading An Entire File +@subsection Reading an Entire File The @code{readfile} extension adds a single function named @code{readfile()}, and an input parser: @@ -34955,7 +35075,7 @@ This is how you load the extension. @cindex @code{gettimeofday()} extension function @item the_time = gettimeofday() Return the time in seconds that has elapsed since 1970-01-01 UTC as a -floating point value. If the time is unavailable on this platform, return +floating-point value. If the time is unavailable on this platform, return @minus{}1 and set @code{ERRNO}. The returned time should have sub-second precision, but the actual precision may vary based on the platform. If the standard C @code{gettimeofday()} system call is available on this @@ -34998,22 +35118,22 @@ As of this writing, there are five extensions: @itemize @value{BULLET} @item -GD graphics library extension. +GD graphics library extension @item -PDF extension. +PDF extension @item -PostgreSQL extension. +PostgreSQL extension @item -MPFR library extension. -This provides access to a number of MPFR functions which @command{gawk}'s -native MPFR support does not. +MPFR library extension +(this provides access to a number of MPFR functions which @command{gawk}'s +native MPFR support does not) @item XML parser extension, using the @uref{http://expat.sourceforge.net, Expat} -XML parsing library. +XML parsing library @end itemize @cindex @command{git} utility @@ -35064,9 +35184,9 @@ to install both @command{gawk} and @code{gawkextlib}, depending upon how your system works. If you write an extension that you wish to share with other -@command{gawk} users, please consider doing so through the +@command{gawk} users, consider doing so through the @code{gawkextlib} project. -See the project's web site for more information. +See the project's website for more information. @node Extension summary @section Summary @@ -35074,7 +35194,7 @@ See the project's web site for more information. @itemize @value{BULLET} @item You can write extensions (sometimes called plug-ins) for @command{gawk} -in C or C++ using the Application Programming Interface (API) defined +in C or C++ using the application programming interface (API) defined by the @command{gawk} developers. @item @@ -35105,44 +35225,44 @@ API function pointers are provided for the following kinds of operations: @itemize @value{BULLET} @item -Allocating, reallocating, and releasing memory. +Allocating, reallocating, and releasing memory @item -Registration functions. You may register +Registration functions (you may register extension functions, exit callbacks, a version string, input parsers, output wrappers, -and two-way processors. +and two-way processors) @item -Printing fatal, warning, and ``lint'' warning messages. +Printing fatal, warning, and ``lint'' warning messages @item -Updating @code{ERRNO}, or unsetting it. +Updating @code{ERRNO}, or unsetting it @item Accessing parameters, including converting an undefined parameter into -an array. +an array @item -Symbol table access: retrieving a global variable, creating one, -or changing one. +Symbol table access (retrieving a global variable, creating one, +or changing one) @item Creating and releasing cached values; this provides an efficient way to use values for multiple variables and -can be a big performance win. +can be a big performance win @item -Manipulating arrays: -retrieving, adding, deleting, and modifying elements; +Manipulating arrays +(retrieving, adding, deleting, and modifying elements; getting the count of elements in an array; creating a new array; clearing an array; and -flattening an array for easy C style looping over all its indices and elements. +flattening an array for easy C style looping over all its indices and elements) @end itemize @item @@ -35221,34 +35341,34 @@ and the Glossary: @end ifclear @ifset FOR_PRINT -Part IV contains two appendices and the license that +Part IV contains three appendices, the last of which is the license that covers the @command{gawk} source code: @end ifset @itemize @value{BULLET} @item -@ref{Language History}. +@ref{Language History} @item -@ref{Installation}. +@ref{Installation} @ifclear FOR_PRINT @item -@ref{Notes}. +@ref{Notes} @item -@ref{Basic Concepts}. +@ref{Basic Concepts} @item -@ref{Glossary}. +@ref{Glossary} @end ifclear @item -@ref{Copying}. +@ref{Copying} @ifclear FOR_PRINT @item -@ref{GNU Free Documentation License}. +@ref{GNU Free Documentation License} @end ifclear @end itemize @end ifdocbook @@ -35257,7 +35377,7 @@ covers the @command{gawk} source code: @appendix The Evolution of the @command{awk} Language This @value{DOCUMENT} describes the GNU implementation of @command{awk}, -which follows the POSIX specification. Many long-time @command{awk} +which follows the POSIX specification. Many longtime @command{awk} users learned @command{awk} programming with the original @command{awk} implementation in Version 7 Unix. (This implementation was the basis for @command{awk} in Berkeley Unix, through 4.3-Reno. Subsequent versions @@ -35492,7 +35612,7 @@ The ability to delete all of an array at once with @samp{delete @var{array}} @end itemize -@xref{Common Extensions}, for a list of common extensions +@DBXREF{Common Extensions} for a list of common extensions not permitted by the POSIX standard. The 2008 POSIX standard can be found online at @@ -35512,7 +35632,7 @@ has made his version available via his home page (@pxref{Other Versions}). This @value{SECTION} describes common extensions that -originally appeared in his version of @command{awk}. +originally appeared in his version of @command{awk}: @itemize @value{BULLET} @item @@ -35538,7 +35658,7 @@ or array elements through it. @end ignore @end itemize -@xref{Common Extensions}, for a full list of the extensions +@DBXREF{Common Extensions} for a full list of the extensions available in his @command{awk}. @node POSIX/GNU @@ -35594,7 +35714,7 @@ The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr} and @item The @file{/inet}, @file{/inet4}, and @samp{/inet6} special files for TCP/IP networking using @samp{|&} to specify which version of the -IP protocol to use. +IP protocol to use (@pxref{TCP/IP Networking}). @end itemize @@ -35642,7 +35762,7 @@ New keywords: @itemize @value{MINUS} @item -The @code{BEGINFILE} and @code{ENDFILE} special patterns. +The @code{BEGINFILE} and @code{ENDFILE} special patterns (@pxref{BEGINFILE/ENDFILE}). @item @@ -35679,7 +35799,7 @@ making translations easier @item The @code{split()} function's additional optional fourth -argument which is an array to hold the text of the field separators. +argument which is an array to hold the text of the field separators (@pxref{String Functions}). @end itemize @@ -36442,7 +36562,7 @@ load @command{awk} library files. @item The @option{-l} and @option{--load} options load compiled dynamic extensions. -@item +@item The @option{-M} and @option{--bignum} options enable MPFR. @item @@ -36481,7 +36601,7 @@ The dynamic extension interface was completely redone @cindex extensions, @command{mawk} The following table summarizes the common extensions supported by @command{gawk}, Brian Kernighan's @command{awk}, and @command{mawk}, -the three most widely-used freely available versions of @command{awk} +the three most widely used freely available versions of @command{awk} (@pxref{Other Versions}). @multitable {@file{/dev/stderr} special file} {BWK Awk} {Mawk} {GNU Awk} {Now standard} @@ -36499,7 +36619,7 @@ the three most widely-used freely available versions of @command{awk} @item @code{func} keyword @tab X @tab @tab X @tab @item @code{BINMODE} variable @tab @tab X @tab X @tab @item @code{RS} as regexp @tab @tab X @tab X @tab -@item Time related functions @tab @tab X @tab X @tab +@item Time-related functions @tab @tab X @tab X @tab @end multitable @node Ranges and Locales @@ -36515,7 +36635,7 @@ the first character in the range and the last character in the range, inclusive. Ordering was based on the numeric value of each character in the machine's native character set. Thus, on ASCII-based systems, @samp{[a-z]} matched all the lowercase letters, and only the lowercase -letters, since the numeric values for the letters from @samp{a} through +letters, as the numeric values for the letters from @samp{a} through @samp{z} were contiguous. (On an EBCDIC system, the range @samp{[a-z]} includes additional, non-alphabetic characters as well.) @@ -36526,8 +36646,8 @@ that @samp{[A-Z]} was the ``correct'' way to match uppercase letters. And indeed, this was true.@footnote{And Life was good.} The 1992 POSIX standard introduced the idea of locales (@pxref{Locales}). -Since many locales include other letters besides the plain twenty-six -letters of the American English alphabet, the POSIX standard added +Because many locales include other letters besides the plain 26 +letters of the English alphabet, the POSIX standard added character classes (@pxref{Bracket Expressions}) as a way to match different kinds of characters besides the traditional ones in the ASCII character set. @@ -36544,7 +36664,7 @@ In other words, these locales sort characters in dictionary order, and @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]}; instead it might be equivalent to @samp{[ABCXYabcdxyz]}, for example. -This point needs to be emphasized: Much literature teaches that you should +This point needs to be emphasized: much literature teaches that you should use @samp{[a-z]} to match a lowercase character. But on systems with non-ASCII locales, this also matches all of the uppercase characters except @samp{A} or @samp{Z}! This was a continuous cause of confusion, even well @@ -36560,7 +36680,7 @@ $ @kbd{echo something1234abc | gawk-3.1.8 '@{ sub("[A-Z]*$", ""); print @}'} @end example @noindent -This output is unexpected, since the @samp{bc} at the end of +This output is unexpected, as the @samp{bc} at the end of @samp{something1234abc} should not normally match @samp{[A-Z]*}. This result is due to the locale setting (and thus you may not see it on your system). @@ -36582,7 +36702,7 @@ like ``why does @samp{[A-Z]} match lowercase letters?!?'' @cindex Berry, Karl This situation existed for close to 10 years, if not more, and the @command{gawk} maintainer grew weary of trying to explain that -@command{gawk} was being nicely standards-compliant, and that the issue +@command{gawk} was being nicely standards compliant, and that the issue was in the user's locale. During the development of @value{PVERSION} 4.0, he modified @command{gawk} to always treat ranges in the original, pre-POSIX fashion, unless @option{--posix} was used (@pxref{Options}).@footnote{And @@ -36795,7 +36915,7 @@ Michael Benzinger contributed the initial code for @code{switch} statements. @cindex McPhee, Patrick Patrick T.J.@: McPhee contributed the code for dynamic loading in Windows32 environments. -(This is no longer supported) +(This is no longer supported.) @item @cindex Wallin, Anders @@ -36819,7 +36939,7 @@ into a byte-code interpreter, including the debugger. The addition of true arrays of arrays. @item -The additional modifications for support of arbitrary precision arithmetic. +The additional modifications for support of arbitrary-precision arithmetic. @item The initial text of @@ -36875,7 +36995,7 @@ helping David Trueman, and as the primary maintainer since around 1994. @itemize @value{BULLET} @item The @command{awk} language has evolved over time. The first release -was with V7 Unix circa 1978. In 1987 for System V Release 3.1, +was with V7 Unix circa 1978. In 1987, for System V Release 3.1, major additions, including user-defined functions, were made to the language. Additional changes were made for System V Release 4, in 1989. Since then, further minor changes happen under the auspices of the @@ -36917,8 +37037,8 @@ This appendix provides instructions for installing @command{gawk} on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are contributed. -@xref{Bugs}, -for the electronic mail addresses of the people who maintain +@DBXREF{Bugs} +for the email addresses of the people who maintain the respective ports. @menu @@ -36972,7 +37092,7 @@ wget http://ftp.gnu.org/gnu/gawk/gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz The GNU software archive is mirrored around the world. The up-to-date list of mirror sites is available from -@uref{http://www.gnu.org/order/ftp.html, the main FSF web site}. +@uref{http://www.gnu.org/order/ftp.html, the main FSF website}. Try to use one of the mirrors; they will be less busy, and you can usually find one closer to your site. @@ -36983,7 +37103,7 @@ different compression programs: @command{gzip}, @command{bzip2}, and @command{xz}. For simplicity, the rest of these instructions assume you are using the one compressed with the GNU Zip program, @code{gzip}. -Once you have the distribution (for example, +Once you have the distribution (e.g., @file{gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz}), use @code{gzip} to expand the file and then use @code{tar} to extract it. You can use the following @@ -37076,7 +37196,7 @@ as a list of things that the POSIX standard should describe but does not. @item doc/awkforai.txt Pointers to the original draft of a short article describing why @command{gawk} is a good language for -Artificial Intelligence (AI) programming. +artificial intelligence (AI) programming. @item doc/bc_notes A brief description of @command{gawk}'s ``byte code'' internals. @@ -37182,7 +37302,7 @@ source file for this @value{DOCUMENT}. It also contains a @file{Makefile.in} fil The library functions from @ref{Library Functions}, and the @command{igawk} program from -@ref{Igawk Program}, +@DBREF{Igawk Program} are included as ready-to-use files in the @command{gawk} distribution. They are installed as part of the installation process. The rest of the programs in this @value{DOCUMENT} are available in appropriate @@ -37201,11 +37321,11 @@ Files needed for building @command{gawk} under MS-Windows @ifclear FOR_PRINT and OS/2 @end ifclear -(@pxref{PC Installation}, for details). +(@DBPXREF{PC Installation} for details). @item vms/* Files needed for building @command{gawk} under Vax/VMS and OpenVMS -(@pxref{VMS Installation}, for details). +(@DBPXREF{VMS Installation} for details). @item test/* A test suite for @@ -37217,7 +37337,7 @@ be confident of a successful port. @c ENDOFRANGE gawdis @node Unix Installation -@appendixsec Compiling and Installing @command{gawk} on Unix-like Systems +@appendixsec Compiling and Installing @command{gawk} on Unix-Like Systems Usually, you can compile and install @command{gawk} by typing only two commands. However, if you use an unusual system, you may need @@ -37230,7 +37350,7 @@ to configure @command{gawk} for your system yourself. @end menu @node Quick Installation -@appendixsubsec Compiling @command{gawk} for Unix-like Systems +@appendixsubsec Compiling @command{gawk} for Unix-Like Systems The normal installation steps should work on all modern commercial Unix-derived systems, GNU/Linux, BSD-based systems, and the Cygwin @@ -37247,7 +37367,7 @@ described fully in @cite{Autoconf---Generating Automatic Configuration Scripts}, which can be found online at @uref{http://www.gnu.org/software/autoconf/manual/index.html, -the Free Software Foundation's web site}.) +the Free Software Foundation's website}.) @end ifnotinfo @ifinfo (The Autoconf software is described fully starting with @@ -37294,7 +37414,7 @@ run @samp{make check}. All of the tests should succeed. If these steps do not work, or if any of the tests fail, check the files in the @file{README_d} directory to see if you've found a known problem. If the failure is not described there, -please send in a bug report (@pxref{Bugs}). +send in a bug report (@pxref{Bugs}). Of course, once you've built @command{gawk}, it is likely that you will wish to install it. To do so, you need to run the command @samp{make @@ -37358,7 +37478,7 @@ function for deficient systems. @end table Use the command @samp{./configure --help} to see the full list of -options that @command{configure} supplies. +options supplied by @command{configure}. @node Configuration Philosophy @appendixsubsec The Configuration Process @@ -37392,19 +37512,19 @@ facts about your operating system. For example, there may not be an @cindex @code{custom.h} file It is possible for your C compiler to lie to @command{configure}. It may do so by not exiting with an error when a library function is not -available. To get around this, edit the file @file{custom.h}. +available. To get around this, edit the @file{custom.h} file. Use an @samp{#ifdef} that is appropriate for your system, and either @code{#define} any constants that @command{configure} should have defined but didn't, or @code{#undef} any constants that @command{configure} defined and -should not have. @file{custom.h} is automatically included by -@file{config.h}. +should not have. The @file{custom.h} file is automatically included by +the @file{config.h} file. It is also possible that the @command{configure} program generated by Autoconf will not work on your system in some other fashion. -If you do have a problem, the file @file{configure.ac} is the input for +If you do have a problem, the @file{configure.ac} file is the input for Autoconf. You may be able to change this file and generate a new version of @command{configure} that works on your system -(@pxref{Bugs}, +(@DBPXREF{Bugs} for information on how to report problems in configuring @command{gawk}). The same mechanism may be used to send in updates to @file{configure.ac} and/or @file{custom.h}. @@ -37444,7 +37564,7 @@ The limitations of MS-DOS (and MS-DOS shells under the other operating systems) has meant that various ``DOS extenders'' are often used with programs such as @command{gawk}. The varying capabilities of Microsoft Windows 3.1 and Windows32 can add to the confusion. For an overview -of the considerations, please refer to @file{README_d/README.pc} in +of the considerations, refer to @file{README_d/README.pc} in the distribution. @menu @@ -37607,7 +37727,7 @@ Ancient OS/2 ports of GNU @command{make} are not able to handle the Makefiles of this package. If you encounter any problems with @command{make}, try GNU Make 3.79.1 or later versions. You should find the latest version on -@uref{ftp://hobbes.nmsu.edu/pub/os2/}.@footnote{As of May, 2014, +@uref{ftp://hobbes.nmsu.edu/pub/os2/}.@footnote{As of November 2014, this site is still there, but the author could not find a package for GNU Make.} @end quotation @@ -37817,7 +37937,7 @@ need to use the @code{BINMODE} variable. This can cause problems with other Unix-like components that have been ported to MS-Windows that expect @command{gawk} to do automatic -translation of @code{"\r\n"}, since it won't. +translation of @code{"\r\n"}, because it won't. @node VMS Installation @appendixsubsec Compiling and Installing @command{gawk} on Vax/VMS and OpenVMS @@ -37881,14 +38001,14 @@ The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha and IA64 VMS 8.4 used HP C 7.3.@footnote{The IA64 architecture is also known as ``Itanium.''} -@xref{VMS GNV}, for information on building +@DBXREF{VMS GNV} for information on building @command{gawk} as a PCSI kit that is compatible with the GNV product. @node VMS Dynamic Extensions @appendixsubsubsec Compiling @command{gawk} Dynamic Extensions on VMS The extensions that have been ported to VMS can be built using one of -the following commands. +the following commands: @example $ @kbd{MMS/DESCRIPTION=[.vms]descrip.mms extensions} @@ -37905,7 +38025,7 @@ $ @kbd{MMK/DESCRIPTION=[.vms]descrip.mms extensions} or a logical name to find the dynamic extensions. Dynamic extensions need to be compiled with the same compiler options for -floating point, pointer size, and symbol name handling as were used +floating-point, pointer size, and symbol name handling as were used to compile @command{gawk} itself. Alpha and Itanium should use IEEE floating point. The pointer size is 32 bits, and the symbol name handling should be exact case with CRC shortening for @@ -38035,7 +38155,7 @@ Note that uppercase and mixed-case text must be quoted. The VMS port of @command{gawk} includes a @code{DCL}-style interface in addition to the original shell-style interface (see the help entry for details). One side effect of dual command-line parsing is that if there is only a -single parameter (as in the quoted string program above), the command +single parameter (as in the quoted string program), the command becomes ambiguous. To work around this, the normally optional @option{--} flag is required to force Unix-style parsing rather than @code{DCL} parsing. If any other dash-type options (or multiple parameters such as @value{DF}s to @@ -38155,10 +38275,10 @@ recommend compiling and using the current version. @node Bugs @appendixsec Reporting Problems and Bugs -@cindex archeologists +@cindex archaeologists @quotation -@i{There is nothing more dangerous than a bored archeologist.} -@author The Hitchhiker's Guide to the Galaxy +@i{There is nothing more dangerous than a bored archaeologist.} +@author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy} @end quotation @c the radio show, not the book. :-) @@ -38167,10 +38287,10 @@ recommend compiling and using the current version. @c STARTOFRANGE tblgawb @cindex troubleshooting, @command{gawk}, bug reports If you have problems with @command{gawk} or think that you have found a bug, -please report it to the developers; we cannot promise to do anything +report it to the developers; we cannot promise to do anything but we might well want to fix it. -Before reporting a bug, please make sure you have really found a genuine bug. +Before reporting a bug, make sure you have really found a genuine bug. Carefully reread the documentation and see if it says you can do what you're trying to do. If it's not clear whether you should be able to do something or not, report that too; it's a bug in the documentation! @@ -38183,7 +38303,7 @@ the compiler you used to compile @command{gawk}, and the exact results @command{gawk} gave you. Also say what you expected to occur; this helps us decide whether the problem is really in the documentation. -Please include the version number of @command{gawk} you are using. +Make sure to include the version number of @command{gawk} you are using. You can get this information with the command @samp{gawk --version}. @cindex @code{bug-gawk@@gnu.org} bug reporting address @@ -38195,7 +38315,7 @@ Once you have a precise problem description, send email to The @command{gawk} maintainers subscribe to this address and thus they will receive your bug report. Although you can send mail to the maintainers directly, -the bug reporting address is preferred since the +the bug reporting address is preferred because the email list is archived at the GNU Project. @emph{All email must be in English. This is the only language understood in common by all the maintainers.} @@ -38204,19 +38324,19 @@ understood in common by all the maintainers.} @quotation CAUTION Do @emph{not} try to report bugs in @command{gawk} by posting to the Usenet/Internet newsgroup @code{comp.lang.awk}. -While the @command{gawk} developers do occasionally read this newsgroup, -there is no guarantee that we will see your posting. The steps described -above are the only official recognized way for reporting bugs. +The @command{gawk} developers do occasionally read this newsgroup, +but there is no guarantee that we will see your posting. The steps described +here are the only officially recognized way for reporting bugs. Really. @end quotation @quotation NOTE Many distributions of GNU/Linux and the various BSD-based operating systems have their own bug reporting systems. If you report a bug using your distribution's -bug reporting system, @emph{please} also send a copy to +bug reporting system, you should also send a copy to @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org}. -This is for two reasons. First, while some distributions forward +This is for two reasons. First, although some distributions forward bug reports ``upstream'' to the GNU mailing list, many don't, so there is a good chance that the @command{gawk} maintainers won't even see the bug report! Second, mail to the GNU list is archived, and having everything at the GNU project @@ -38227,8 +38347,8 @@ Non-bug suggestions are always welcome as well. If you have questions about things that are unclear in the documentation or are just obscure features, ask on the bug list; we will try to help you out if we can. -If you find bugs in one of the non-Unix ports of @command{gawk}, please -send an electronic mail message to the bug list, with a copy to the +If you find bugs in one of the non-Unix ports of @command{gawk}, +send an email to the bug list, with a copy to the person who maintains that port. They are named in the following list, as well as in the @file{README} file in the @command{gawk} distribution. Information in the @file{README} file should be considered authoritative @@ -38259,7 +38379,7 @@ The people maintaining the various @command{gawk} ports are: @item z/OS (OS/390) @tab Dave Pitts, @EMAIL{dpitts@@cozx.com,dpitts at cozx dot com}. @end multitable -If your bug is also reproducible under Unix, please send a copy of your +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 @@ -38303,7 +38423,7 @@ This @value{SECTION} briefly describes where to get them: Brian Kernighan, one of the original designers of Unix @command{awk}, has made his implementation of @command{awk} freely available. -You can retrieve this version via the World Wide Web from +You can retrieve this version via @uref{http://www.cs.princeton.edu/~bwk, his home page}. It is available in several archive formats: @@ -38326,7 +38446,7 @@ git clone git://github.com/onetrueawk/awk bwkawk @end example @noindent -The above command creates a copy of the @uref{http://www.git-scm.com, Git} +This command creates a copy of the @uref{http://www.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}. @@ -38334,9 +38454,13 @@ directory named @file{awk}. This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely. -@xref{Common Extensions}, +@DBXREF{Common Extensions} for a list of extensions in this @command{awk} that are not in POSIX @command{awk}. +As a side note, Dan Bornstein has created a Git repository tracking +all the versions of BWK @command{awk} that he could find. It's +available at @uref{git://github.com/onetrueawk/awk}. + @cindex Brennan, Michael @cindex @command{mawk} utility @cindex source code, @command{mawk} @@ -38366,7 +38490,7 @@ Once you have it, is similar to @command{gawk}'s (@pxref{Unix Installation}). -@xref{Common Extensions}, +@DBXREF{Common Extensions} for a list of extensions in @command{mawk} that are not in POSIX @command{awk}. @cindex Sumner, Andrew @@ -38428,8 +38552,8 @@ has not been done, at least to our knowledge. @cindex Illumos @cindex Illumos, POSIX-compliant @command{awk} @cindex source code, Illumos @command{awk} -The source code used to be available from the OpenSolaris web site. -However, that project was ended and the web site shut down. Fortunately, the +The source code used to be available from the OpenSolaris website. +However, that project was ended and the website shut down. Fortunately, the @uref{http://wiki.illumos.org/display/illumos/illumos+Home, Illumos project} makes this implementation available. You can view the files one at a time from @uref{https://github.com/joyent/illumos-joyent/blob/master/usr/src/cmd/awk_xpg4}. @@ -38448,7 +38572,7 @@ from POSIX @command{awk}. More information is available on the @cindex libmawk @cindex source code, libmawk This is an embeddable @command{awk} interpreter derived from -@command{mawk}. For more information see +@command{mawk}. For more information, see @uref{http://repo.hu/projects/libmawk/}. @item @code{pawk} @@ -38462,7 +38586,7 @@ modified version of BWK @command{awk}, described earlier.) @item @w{QSE Awk} @cindex QSE Awk @cindex source code, QSE Awk -This is an embeddable @command{awk} interpreter. For more information +This is an embeddable @command{awk} interpreter. For more information, see @uref{http://code.google.com/p/qse/} and @uref{http://awk.info/?tools/qse}. @item @command{QTawk} @@ -38477,9 +38601,10 @@ including the manual and a download link. The project may also be frozen; no new code changes have been made since approximately 2008. -@item Other Versions -See also the @uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, -Wikipedia article}, for information on additional versions. +@item Other versions +See also the ``Versions and Implementations'' section of the +@uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, +Wikipedia article} for information on additional versions. @end table @c ENDOFRANGE awkim @@ -38681,7 +38806,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, web site}. +@uref{http://www.gnu.org/prep/standards_toc.html, website}. Texinfo, Info, and DVI versions are also available.) @cindex @command{gawk}, coding style in @@ -40547,7 +40672,7 @@ record or a string. @end docbook @c This file is intended to be included within another document, -@c hence no sectioning command or @node. +@c hence no sectioning command or @node. @display Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} @@ -40769,7 +40894,7 @@ terms of section 4, provided that you also meet all of these conditions: @enumerate a -@item +@item The work must carry prominent notices stating that you modified it, and giving a relevant date. @@ -41219,7 +41344,7 @@ state the exclusion of warranty; and each file should have at least the ``copyright'' line and a pointer to where the full notice is found. @smallexample -@var{one line to give the program's name and a brief idea of what it does.} +@var{one line to give the program's name and a brief idea of what it does.} Copyright (C) @var{year} @var{name of author} This program is free software: you can redistribute it and/or modify @@ -41242,7 +41367,7 @@ If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: @smallexample -@var{program} Copyright (C) @var{year} @var{name of author} +@var{program} Copyright (C) @var{year} @var{name of author} This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details. -- cgit v1.2.3 From 73c561d03b0e9a4f2d0bc10d943ec73e002ea48b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 17 Nov 2014 11:47:13 +0200 Subject: Small typo fix in doc. --- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/gawk.texi b/doc/gawk.texi index 7573c993..0ab4737b 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -16328,7 +16328,7 @@ Octal and hexadecimal constants (@pxref{Nondecimal-numbers}) @end ifnotdocbook @ifdocbook -(covered in @pref{Nondecimal-numbers}) +(covered in @ref{Nondecimal-numbers}) @end ifdocbook are converted internally into numbers, and their original form is forgotten. This means, for example, that @code{array[17]}, diff --git a/doc/gawktexi.in b/doc/gawktexi.in index c883faea..3e908813 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -15611,7 +15611,7 @@ Octal and hexadecimal constants (@pxref{Nondecimal-numbers}) @end ifnotdocbook @ifdocbook -(covered in @pref{Nondecimal-numbers}) +(covered in @ref{Nondecimal-numbers}) @end ifdocbook are converted internally into numbers, and their original form is forgotten. This means, for example, that @code{array[17]}, -- cgit v1.2.3 From 46fb38d70fe250f318fb95a6083beaceaaf5155d Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 17 Nov 2014 16:49:25 +0200 Subject: Final copyedit changes applied. --- doc/gawk.info | 2 +- doc/gawk.texi | 3 ++- doc/gawktexi.in | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/gawk.info b/doc/gawk.info index e01a794b..a318498b 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -28376,7 +28376,7 @@ QSE Awk since approximately 2008. Other versions - See also the "Versions and Implementations" section of the + See also the "Versions and implementations" section of the Wikipedia article (http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations) for information on additional versions. diff --git a/doc/gawk.texi b/doc/gawk.texi index 0ab4737b..a1781700 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -2230,6 +2230,7 @@ a number of people. @DBXREF{Contributors} for the full list. @cindex Oram, Andy Thanks to Andy Oram, of O'Reilly Media, for initiating the fourth edition and for his support during the work. +Thanks to Jasmine Kwityn for her copy-editing work. @end ifset Thanks to Michael Brennan for the Foreword. @@ -38602,7 +38603,7 @@ The project may also be frozen; no new code changes have been made since approximately 2008. @item Other versions -See also the ``Versions and Implementations'' section of the +See also the ``Versions and implementations'' section of the @uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, Wikipedia article} for information on additional versions. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 3e908813..1ea028d4 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -2197,6 +2197,7 @@ a number of people. @DBXREF{Contributors} for the full list. @cindex Oram, Andy Thanks to Andy Oram, of O'Reilly Media, for initiating the fourth edition and for his support during the work. +Thanks to Jasmine Kwityn for her copy-editing work. @end ifset Thanks to Michael Brennan for the Foreword. @@ -37695,7 +37696,7 @@ The project may also be frozen; no new code changes have been made since approximately 2008. @item Other versions -See also the ``Versions and Implementations'' section of the +See also the ``Versions and implementations'' section of the @uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, Wikipedia article} for information on additional versions. -- cgit v1.2.3 From 624caa19ebb5b5a19046f0b0deb96b2e6c093685 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 17 Nov 2014 17:05:14 +0200 Subject: Add runtime check to run old code. Easier to debug/test. --- awk.h | 2 ++ interpret.h | 47 ++++++++++++++++++++++++++++++----------------- main.c | 5 +++++ 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/awk.h b/awk.h index 9b72a53c..e788a5a8 100644 --- a/awk.h +++ b/awk.h @@ -1056,6 +1056,8 @@ extern bool field0_valid; extern int do_flags; +extern bool do_old_mem; /* XXX temporary */ + extern SRCFILE *srcfiles; /* source files */ enum do_flag_values { diff --git a/interpret.h b/interpret.h index 83ccbfc5..9910ea72 100644 --- a/interpret.h +++ b/interpret.h @@ -340,12 +340,16 @@ uninitialized_scalar: lhs = r_get_field(t1, (Func_ptr *) 0, true); decr_sp(); DEREF(t1); - /* only for $0, up ref count */ - if (*lhs == fields_arr[0]) { - r = *lhs; - UPREF(r); - } else + if (do_old_mem) { r = dupnode(*lhs); + } else { + /* only for $0, up ref count */ + if (*lhs == fields_arr[0]) { + r = *lhs; + UPREF(r); + } else + r = dupnode(*lhs); + } PUSH(r); break; @@ -654,21 +658,30 @@ mod: lhs = get_lhs(pc->memory, false); unref(*lhs); r = pc->initval; /* constant initializer */ - if (r != NULL) { - UPREF(r); - *lhs = r; - } else { - r = POP_SCALAR(); - - /* if was a field, turn it into a var */ - if ((r->flags & FIELD) == 0) { + if (do_old_mem) { + if (r == NULL) + *lhs = POP_SCALAR(); + else { + UPREF(r); *lhs = r; - } else if (r->valref == 1) { - r->flags &= ~FIELD; + } + } else { + if (r != NULL) { + UPREF(r); *lhs = r; } else { - *lhs = dupnode(r); - DEREF(r); + r = POP_SCALAR(); + + /* if was a field, turn it into a var */ + if ((r->flags & FIELD) == 0) { + *lhs = r; + } else if (r->valref == 1) { + r->flags &= ~FIELD; + *lhs = r; + } else { + *lhs = dupnode(r); + DEREF(r); + } } } break; diff --git a/main.c b/main.c index ddda1d66..a2bdf1bc 100644 --- a/main.c +++ b/main.c @@ -170,6 +170,8 @@ GETGROUPS_T *groupset; /* current group set */ int ngroups; /* size of said set */ #endif +bool do_old_mem = false; /* XXX temporary */ + void (*lintfunc)(const char *mesg, ...) = r_warning; /* Sorted by long option name! */ @@ -231,6 +233,9 @@ main(int argc, char **argv) #endif /* HAVE_MTRACE */ #endif /* HAVE_MCHECK_H */ + if (getenv("OLDMEM") != NULL) + do_old_mem = true; /* XXX temporary */ + myname = gawk_name(argv[0]); os_arg_fixup(&argc, &argv); /* emulate redirection, expand wildcards */ -- cgit v1.2.3 From ac7bcb4c8cdc07f974205709616fda91a447c0f1 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 17 Nov 2014 17:25:05 +0200 Subject: Add unfield code in several spots. --- interpret.h | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/interpret.h b/interpret.h index 9910ea72..2901f60e 100644 --- a/interpret.h +++ b/interpret.h @@ -23,7 +23,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - +#define UNFIELD(l, r) \ +{ \ + /* if was a field, turn it into a var */ \ + if ((r->flags & FIELD) == 0) { \ + l = r; \ + } else if (r->valref == 1) { \ + r->flags &= ~FIELD; \ + l = r; \ + } else { \ + l = dupnode(r); \ + DEREF(r); \ + } \ +} int r_interpret(INSTRUCTION *code) { @@ -640,7 +652,12 @@ mod: } unref(*lhs); - *lhs = POP_SCALAR(); + if (do_old_mem) { + *lhs = POP_SCALAR(); + } else { + r = POP_SCALAR(); + UNFIELD(*lhs, r); + } /* execute post-assignment routine if any */ if (t1->astore != NULL) @@ -671,17 +688,7 @@ mod: *lhs = r; } else { r = POP_SCALAR(); - - /* if was a field, turn it into a var */ - if ((r->flags & FIELD) == 0) { - *lhs = r; - } else if (r->valref == 1) { - r->flags &= ~FIELD; - *lhs = r; - } else { - *lhs = dupnode(r); - DEREF(r); - } + UNFIELD(*lhs, r); } } break; @@ -698,7 +705,12 @@ mod: decr_sp(); DEREF(t1); unref(*lhs); - *lhs = POP_SCALAR(); + if (do_old_mem) { + *lhs = POP_SCALAR(); + } else { + r = POP_SCALAR(); + UNFIELD(*lhs, r); + } assert(assign != NULL); assign(); } @@ -752,8 +764,13 @@ mod: lhs = POP_ADDRESS(); r = TOP_SCALAR(); unref(*lhs); - *lhs = r; - UPREF(r); + if (do_old_mem) { + *lhs = r; + UPREF(r); + } else { + UPREF(r); + UNFIELD(*lhs, r); + } REPLACE(r); break; -- cgit v1.2.3 From 84feadf5595d1bde46d9e93357fe6b094697ac22 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 19 Nov 2014 17:33:21 +0200 Subject: Document that RFC 4180 describes CSV data. --- doc/ChangeLog | 4 + doc/gawk.info | 937 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 10 +- doc/gawktexi.in | 10 +- 4 files changed, 485 insertions(+), 476 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7288fb77..1e53c5b7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-11-19 Arnold D. Robbins + + * gawktexi.in: Update that RFC 4180 documents CSV data. + 2014-11-17 Arnold D. Robbins * gawktexi.in: Copyedits applied. diff --git a/doc/gawk.info b/doc/gawk.info index a318498b..6026b543 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -5179,9 +5179,8 @@ what they are, and not by what they are not. 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 one of the fields -contains an _embedded_ comma. Although there is no formal standard -specification for CSV data,(1) in such cases, most programs embed the -field in double quotes. So we might have data like this: +contains an _embedded_ comma. In such cases, most programs embed the +field in double quotes.(1) So we might have data like this: Robbins,Arnold,"1234 A Pretty Street, NE",MyTown,MyState,12345-6789,USA @@ -5264,7 +5263,9 @@ based on which of the three variables--`FS', `FIELDWIDTHS', and ---------- Footnotes ---------- - (1) At least, we don't know of one. + (1) The CSV format lacked a formal standard definition for many +years. RFC 4180 (http://www.ietf.org/rfc/rfc4180.txt) standardizes the +most common practices.  File: gawk.info, Node: Multiple Line, Next: Getline, Prev: Splitting By Content, Up: Reading Files @@ -32657,7 +32658,7 @@ Index * forward slash (/), patterns and: Expression Patterns. (line 24) * FPAT variable <1>: User-modified. (line 43) * FPAT variable: Splitting By Content. - (line 26) + (line 25) * frame debugger command: Execution Stack. (line 27) * Free Documentation License (FDL): GNU Free Documentation License. (line 7) @@ -32767,7 +32768,7 @@ Index * gawk, format-control characters: Control Letters. (line 18) * gawk, FPAT variable in <1>: User-modified. (line 43) * gawk, FPAT variable in: Splitting By Content. - (line 26) + (line 25) * gawk, FUNCTAB array in: Auto-set. (line 116) * gawk, function arguments and: Calling Built-in. (line 16) * gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42) @@ -34380,467 +34381,467 @@ Ref: Full Line Fields-Footnote-2224934 Node: Field Splitting Summary225035 Node: Constant Size227109 Node: Splitting By Content231698 -Ref: Splitting By Content-Footnote-1235753 -Node: Multiple Line235793 -Ref: Multiple Line-Footnote-1241679 -Node: Getline241858 -Node: Plain Getline244070 -Node: Getline/Variable246710 -Node: Getline/File247858 -Node: Getline/Variable/File249242 -Ref: Getline/Variable/File-Footnote-1250845 -Node: Getline/Pipe250932 -Node: Getline/Variable/Pipe253615 -Node: Getline/Coprocess254746 -Node: Getline/Variable/Coprocess255998 -Node: Getline Notes256737 -Node: Getline Summary259529 -Ref: table-getline-variants259941 -Node: Read Timeout260770 -Ref: Read Timeout-Footnote-1264589 -Node: Command-line directories264647 -Node: Input Summary265552 -Node: Input Exercises268805 -Node: Printing269533 -Node: Print271310 -Node: Print Examples272767 -Node: Output Separators275546 -Node: OFMT277564 -Node: Printf278918 -Node: Basic Printf279703 -Node: Control Letters281272 -Node: Format Modifiers285256 -Node: Printf Examples291257 -Node: Redirection293743 -Node: Special FD300584 -Ref: Special FD-Footnote-1303744 -Node: Special Files303818 -Node: Other Inherited Files304435 -Node: Special Network305435 -Node: Special Caveats306297 -Node: Close Files And Pipes307248 -Ref: Close Files And Pipes-Footnote-1314430 -Ref: Close Files And Pipes-Footnote-2314578 -Node: Output Summary314728 -Node: Output Exercises315726 -Node: Expressions316406 -Node: Values317591 -Node: Constants318269 -Node: Scalar Constants318960 -Ref: Scalar Constants-Footnote-1319819 -Node: Nondecimal-numbers320069 -Node: Regexp Constants323087 -Node: Using Constant Regexps323612 -Node: Variables326755 -Node: Using Variables327410 -Node: Assignment Options329321 -Node: Conversion331196 -Node: Strings And Numbers331720 -Ref: Strings And Numbers-Footnote-1334785 -Node: Locale influences conversions334894 -Ref: table-locale-affects337641 -Node: All Operators338229 -Node: Arithmetic Ops338859 -Node: Concatenation341364 -Ref: Concatenation-Footnote-1344183 -Node: Assignment Ops344289 -Ref: table-assign-ops349268 -Node: Increment Ops350540 -Node: Truth Values and Conditions353978 -Node: Truth Values355063 -Node: Typing and Comparison356112 -Node: Variable Typing356922 -Node: Comparison Operators360575 -Ref: table-relational-ops360985 -Node: POSIX String Comparison364480 -Ref: POSIX String Comparison-Footnote-1365552 -Node: Boolean Ops365690 -Ref: Boolean Ops-Footnote-1370169 -Node: Conditional Exp370260 -Node: Function Calls371987 -Node: Precedence375867 -Node: Locales379528 -Node: Expressions Summary381160 -Node: Patterns and Actions383720 -Node: Pattern Overview384840 -Node: Regexp Patterns386519 -Node: Expression Patterns387062 -Node: Ranges390843 -Node: BEGIN/END393949 -Node: Using BEGIN/END394710 -Ref: Using BEGIN/END-Footnote-1397444 -Node: I/O And BEGIN/END397550 -Node: BEGINFILE/ENDFILE399864 -Node: Empty402765 -Node: Using Shell Variables403082 -Node: Action Overview405355 -Node: Statements407681 -Node: If Statement409529 -Node: While Statement411024 -Node: Do Statement413053 -Node: For Statement414197 -Node: Switch Statement417354 -Node: Break Statement419736 -Node: Continue Statement421777 -Node: Next Statement423604 -Node: Nextfile Statement425985 -Node: Exit Statement428615 -Node: Built-in Variables431018 -Node: User-modified432151 -Ref: User-modified-Footnote-1439832 -Node: Auto-set439894 -Ref: Auto-set-Footnote-1452929 -Ref: Auto-set-Footnote-2453134 -Node: ARGC and ARGV453190 -Node: Pattern Action Summary457408 -Node: Arrays459835 -Node: Array Basics461164 -Node: Array Intro462008 -Ref: figure-array-elements463972 -Ref: Array Intro-Footnote-1466498 -Node: Reference to Elements466626 -Node: Assigning Elements469078 -Node: Array Example469569 -Node: Scanning an Array471327 -Node: Controlling Scanning474343 -Ref: Controlling Scanning-Footnote-1479539 -Node: Numeric Array Subscripts479855 -Node: Uninitialized Subscripts482040 -Node: Delete483657 -Ref: Delete-Footnote-1486400 -Node: Multidimensional486457 -Node: Multiscanning489554 -Node: Arrays of Arrays491143 -Node: Arrays Summary495902 -Node: Functions497994 -Node: Built-in498867 -Node: Calling Built-in499945 -Node: Numeric Functions501936 -Ref: Numeric Functions-Footnote-1505953 -Ref: Numeric Functions-Footnote-2506310 -Ref: Numeric Functions-Footnote-3506358 -Node: String Functions506630 -Ref: String Functions-Footnote-1530105 -Ref: String Functions-Footnote-2530234 -Ref: String Functions-Footnote-3530482 -Node: Gory Details530569 -Ref: table-sub-escapes532350 -Ref: table-sub-proposed533870 -Ref: table-posix-sub535234 -Ref: table-gensub-escapes536770 -Ref: Gory Details-Footnote-1537602 -Node: I/O Functions537753 -Ref: I/O Functions-Footnote-1544971 -Node: Time Functions545118 -Ref: Time Functions-Footnote-1555606 -Ref: Time Functions-Footnote-2555674 -Ref: Time Functions-Footnote-3555832 -Ref: Time Functions-Footnote-4555943 -Ref: Time Functions-Footnote-5556055 -Ref: Time Functions-Footnote-6556282 -Node: Bitwise Functions556548 -Ref: table-bitwise-ops557110 -Ref: Bitwise Functions-Footnote-1561419 -Node: Type Functions561588 -Node: I18N Functions562739 -Node: User-defined564384 -Node: Definition Syntax565189 -Ref: Definition Syntax-Footnote-1570596 -Node: Function Example570667 -Ref: Function Example-Footnote-1573586 -Node: Function Caveats573608 -Node: Calling A Function574126 -Node: Variable Scope575084 -Node: Pass By Value/Reference578072 -Node: Return Statement581567 -Node: Dynamic Typing584548 -Node: Indirect Calls585477 -Ref: Indirect Calls-Footnote-1596779 -Node: Functions Summary596907 -Node: Library Functions599609 -Ref: Library Functions-Footnote-1603218 -Ref: Library Functions-Footnote-2603361 -Node: Library Names603532 -Ref: Library Names-Footnote-1606986 -Ref: Library Names-Footnote-2607209 -Node: General Functions607295 -Node: Strtonum Function608398 -Node: Assert Function611420 -Node: Round Function614744 -Node: Cliff Random Function616285 -Node: Ordinal Functions617301 -Ref: Ordinal Functions-Footnote-1620364 -Ref: Ordinal Functions-Footnote-2620616 -Node: Join Function620827 -Ref: Join Function-Footnote-1622596 -Node: Getlocaltime Function622796 -Node: Readfile Function626540 -Node: Shell Quoting628510 -Node: Data File Management629911 -Node: Filetrans Function630543 -Node: Rewind Function634599 -Node: File Checking635986 -Ref: File Checking-Footnote-1637318 -Node: Empty Files637519 -Node: Ignoring Assigns639498 -Node: Getopt Function641049 -Ref: Getopt Function-Footnote-1652511 -Node: Passwd Functions652711 -Ref: Passwd Functions-Footnote-1661560 -Node: Group Functions661648 -Ref: Group Functions-Footnote-1669542 -Node: Walking Arrays669755 -Node: Library Functions Summary671358 -Node: Library Exercises672759 -Node: Sample Programs674039 -Node: Running Examples674809 -Node: Clones675537 -Node: Cut Program676761 -Node: Egrep Program686480 -Ref: Egrep Program-Footnote-1693978 -Node: Id Program694088 -Node: Split Program697733 -Ref: Split Program-Footnote-1701181 -Node: Tee Program701309 -Node: Uniq Program704098 -Node: Wc Program711517 -Ref: Wc Program-Footnote-1715767 -Node: Miscellaneous Programs715861 -Node: Dupword Program717074 -Node: Alarm Program719105 -Node: Translate Program723909 -Ref: Translate Program-Footnote-1728474 -Node: Labels Program728744 -Ref: Labels Program-Footnote-1732095 -Node: Word Sorting732179 -Node: History Sorting736250 -Node: Extract Program738086 -Node: Simple Sed745611 -Node: Igawk Program748679 -Ref: Igawk Program-Footnote-1763003 -Ref: Igawk Program-Footnote-2763204 -Ref: Igawk Program-Footnote-3763326 -Node: Anagram Program763441 -Node: Signature Program766498 -Node: Programs Summary767745 -Node: Programs Exercises768938 -Ref: Programs Exercises-Footnote-1773069 -Node: Advanced Features773160 -Node: Nondecimal Data775108 -Node: Array Sorting776698 -Node: Controlling Array Traversal777395 -Ref: Controlling Array Traversal-Footnote-1785728 -Node: Array Sorting Functions785846 -Ref: Array Sorting Functions-Footnote-1789735 -Node: Two-way I/O789931 -Ref: Two-way I/O-Footnote-1794872 -Ref: Two-way I/O-Footnote-2795058 -Node: TCP/IP Networking795140 -Node: Profiling798013 -Node: Advanced Features Summary805560 -Node: Internationalization807493 -Node: I18N and L10N808973 -Node: Explaining gettext809659 -Ref: Explaining gettext-Footnote-1814684 -Ref: Explaining gettext-Footnote-2814868 -Node: Programmer i18n815033 -Ref: Programmer i18n-Footnote-1819899 -Node: Translator i18n819948 -Node: String Extraction820742 -Ref: String Extraction-Footnote-1821873 -Node: Printf Ordering821959 -Ref: Printf Ordering-Footnote-1824745 -Node: I18N Portability824809 -Ref: I18N Portability-Footnote-1827264 -Node: I18N Example827327 -Ref: I18N Example-Footnote-1830130 -Node: Gawk I18N830202 -Node: I18N Summary830840 -Node: Debugger832179 -Node: Debugging833201 -Node: Debugging Concepts833642 -Node: Debugging Terms835495 -Node: Awk Debugging838067 -Node: Sample Debugging Session838961 -Node: Debugger Invocation839481 -Node: Finding The Bug840865 -Node: List of Debugger Commands847340 -Node: Breakpoint Control848673 -Node: Debugger Execution Control852369 -Node: Viewing And Changing Data855733 -Node: Execution Stack859111 -Node: Debugger Info860748 -Node: Miscellaneous Debugger Commands864765 -Node: Readline Support869794 -Node: Limitations870686 -Node: Debugging Summary872800 -Node: Arbitrary Precision Arithmetic873968 -Node: Computer Arithmetic875384 -Ref: table-numeric-ranges878982 -Ref: Computer Arithmetic-Footnote-1879841 -Node: Math Definitions879898 -Ref: table-ieee-formats883186 -Ref: Math Definitions-Footnote-1883790 -Node: MPFR features883895 -Node: FP Math Caution885566 -Ref: FP Math Caution-Footnote-1886616 -Node: Inexactness of computations886985 -Node: Inexact representation887944 -Node: Comparing FP Values889301 -Node: Errors accumulate890383 -Node: Getting Accuracy891816 -Node: Try To Round894478 -Node: Setting precision895377 -Ref: table-predefined-precision-strings896061 -Node: Setting the rounding mode897850 -Ref: table-gawk-rounding-modes898214 -Ref: Setting the rounding mode-Footnote-1901669 -Node: Arbitrary Precision Integers901848 -Ref: Arbitrary Precision Integers-Footnote-1904834 -Node: POSIX Floating Point Problems904983 -Ref: POSIX Floating Point Problems-Footnote-1908856 -Node: Floating point summary908894 -Node: Dynamic Extensions911088 -Node: Extension Intro912640 -Node: Plugin License913906 -Node: Extension Mechanism Outline914703 -Ref: figure-load-extension915131 -Ref: figure-register-new-function916611 -Ref: figure-call-new-function917615 -Node: Extension API Description919601 -Node: Extension API Functions Introduction921051 -Node: General Data Types925875 -Ref: General Data Types-Footnote-1931614 -Node: Memory Allocation Functions931913 -Ref: Memory Allocation Functions-Footnote-1934752 -Node: Constructor Functions934848 -Node: Registration Functions936582 -Node: Extension Functions937267 -Node: Exit Callback Functions939564 -Node: Extension Version String940812 -Node: Input Parsers941477 -Node: Output Wrappers951354 -Node: Two-way processors955869 -Node: Printing Messages958073 -Ref: Printing Messages-Footnote-1959149 -Node: Updating `ERRNO'959301 -Node: Requesting Values960041 -Ref: table-value-types-returned960769 -Node: Accessing Parameters961726 -Node: Symbol Table Access962957 -Node: Symbol table by name963471 -Node: Symbol table by cookie965452 -Ref: Symbol table by cookie-Footnote-1969596 -Node: Cached values969659 -Ref: Cached values-Footnote-1973158 -Node: Array Manipulation973249 -Ref: Array Manipulation-Footnote-1974347 -Node: Array Data Types974384 -Ref: Array Data Types-Footnote-1977039 -Node: Array Functions977131 -Node: Flattening Arrays980985 -Node: Creating Arrays987877 -Node: Extension API Variables992646 -Node: Extension Versioning993282 -Node: Extension API Informational Variables995183 -Node: Extension API Boilerplate996271 -Node: Finding Extensions1000080 -Node: Extension Example1000640 -Node: Internal File Description1001412 -Node: Internal File Ops1005479 -Ref: Internal File Ops-Footnote-11017149 -Node: Using Internal File Ops1017289 -Ref: Using Internal File Ops-Footnote-11019672 -Node: Extension Samples1019945 -Node: Extension Sample File Functions1021471 -Node: Extension Sample Fnmatch1029109 -Node: Extension Sample Fork1030600 -Node: Extension Sample Inplace1031815 -Node: Extension Sample Ord1033490 -Node: Extension Sample Readdir1034326 -Ref: table-readdir-file-types1035202 -Node: Extension Sample Revout1036013 -Node: Extension Sample Rev2way1036603 -Node: Extension Sample Read write array1037343 -Node: Extension Sample Readfile1039283 -Node: Extension Sample Time1040378 -Node: Extension Sample API Tests1041727 -Node: gawkextlib1042218 -Node: Extension summary1044855 -Node: Extension Exercises1048532 -Node: Language History1049254 -Node: V7/SVR3.11050910 -Node: SVR41053091 -Node: POSIX1054536 -Node: BTL1055925 -Node: POSIX/GNU1056659 -Node: Feature History1062223 -Node: Common Extensions1075321 -Node: Ranges and Locales1076645 -Ref: Ranges and Locales-Footnote-11081263 -Ref: Ranges and Locales-Footnote-21081290 -Ref: Ranges and Locales-Footnote-31081524 -Node: Contributors1081745 -Node: History summary1087286 -Node: Installation1088656 -Node: Gawk Distribution1089602 -Node: Getting1090086 -Node: Extracting1090909 -Node: Distribution contents1092544 -Node: Unix Installation1098261 -Node: Quick Installation1098878 -Node: Additional Configuration Options1101302 -Node: Configuration Philosophy1103040 -Node: Non-Unix Installation1105409 -Node: PC Installation1105867 -Node: PC Binary Installation1107186 -Node: PC Compiling1109034 -Ref: PC Compiling-Footnote-11112055 -Node: PC Testing1112164 -Node: PC Using1113340 -Node: Cygwin1117455 -Node: MSYS1118278 -Node: VMS Installation1118778 -Node: VMS Compilation1119570 -Ref: VMS Compilation-Footnote-11120792 -Node: VMS Dynamic Extensions1120850 -Node: VMS Installation Details1122534 -Node: VMS Running1124786 -Node: VMS GNV1127622 -Node: VMS Old Gawk1128356 -Node: Bugs1128826 -Node: Other Versions1132709 -Node: Installation summary1139131 -Node: Notes1140187 -Node: Compatibility Mode1141052 -Node: Additions1141834 -Node: Accessing The Source1142759 -Node: Adding Code1144195 -Node: New Ports1150360 -Node: Derived Files1154842 -Ref: Derived Files-Footnote-11160317 -Ref: Derived Files-Footnote-21160351 -Ref: Derived Files-Footnote-31160947 -Node: Future Extensions1161061 -Node: Implementation Limitations1161667 -Node: Extension Design1162915 -Node: Old Extension Problems1164069 -Ref: Old Extension Problems-Footnote-11165586 -Node: Extension New Mechanism Goals1165643 -Ref: Extension New Mechanism Goals-Footnote-11169003 -Node: Extension Other Design Decisions1169192 -Node: Extension Future Growth1171300 -Node: Old Extension Mechanism1172136 -Node: Notes summary1173898 -Node: Basic Concepts1175084 -Node: Basic High Level1175765 -Ref: figure-general-flow1176037 -Ref: figure-process-flow1176636 -Ref: Basic High Level-Footnote-11179865 -Node: Basic Data Typing1180050 -Node: Glossary1183378 -Node: Copying1208536 -Node: GNU Free Documentation License1246092 -Node: Index1271228 +Ref: Splitting By Content-Footnote-1235689 +Node: Multiple Line235852 +Ref: Multiple Line-Footnote-1241738 +Node: Getline241917 +Node: Plain Getline244129 +Node: Getline/Variable246769 +Node: Getline/File247917 +Node: Getline/Variable/File249301 +Ref: Getline/Variable/File-Footnote-1250904 +Node: Getline/Pipe250991 +Node: Getline/Variable/Pipe253674 +Node: Getline/Coprocess254805 +Node: Getline/Variable/Coprocess256057 +Node: Getline Notes256796 +Node: Getline Summary259588 +Ref: table-getline-variants260000 +Node: Read Timeout260829 +Ref: Read Timeout-Footnote-1264648 +Node: Command-line directories264706 +Node: Input Summary265611 +Node: Input Exercises268864 +Node: Printing269592 +Node: Print271369 +Node: Print Examples272826 +Node: Output Separators275605 +Node: OFMT277623 +Node: Printf278977 +Node: Basic Printf279762 +Node: Control Letters281331 +Node: Format Modifiers285315 +Node: Printf Examples291316 +Node: Redirection293802 +Node: Special FD300643 +Ref: Special FD-Footnote-1303803 +Node: Special Files303877 +Node: Other Inherited Files304494 +Node: Special Network305494 +Node: Special Caveats306356 +Node: Close Files And Pipes307307 +Ref: Close Files And Pipes-Footnote-1314489 +Ref: Close Files And Pipes-Footnote-2314637 +Node: Output Summary314787 +Node: Output Exercises315785 +Node: Expressions316465 +Node: Values317650 +Node: Constants318328 +Node: Scalar Constants319019 +Ref: Scalar Constants-Footnote-1319878 +Node: Nondecimal-numbers320128 +Node: Regexp Constants323146 +Node: Using Constant Regexps323671 +Node: Variables326814 +Node: Using Variables327469 +Node: Assignment Options329380 +Node: Conversion331255 +Node: Strings And Numbers331779 +Ref: Strings And Numbers-Footnote-1334844 +Node: Locale influences conversions334953 +Ref: table-locale-affects337700 +Node: All Operators338288 +Node: Arithmetic Ops338918 +Node: Concatenation341423 +Ref: Concatenation-Footnote-1344242 +Node: Assignment Ops344348 +Ref: table-assign-ops349327 +Node: Increment Ops350599 +Node: Truth Values and Conditions354037 +Node: Truth Values355122 +Node: Typing and Comparison356171 +Node: Variable Typing356981 +Node: Comparison Operators360634 +Ref: table-relational-ops361044 +Node: POSIX String Comparison364539 +Ref: POSIX String Comparison-Footnote-1365611 +Node: Boolean Ops365749 +Ref: Boolean Ops-Footnote-1370228 +Node: Conditional Exp370319 +Node: Function Calls372046 +Node: Precedence375926 +Node: Locales379587 +Node: Expressions Summary381219 +Node: Patterns and Actions383779 +Node: Pattern Overview384899 +Node: Regexp Patterns386578 +Node: Expression Patterns387121 +Node: Ranges390902 +Node: BEGIN/END394008 +Node: Using BEGIN/END394769 +Ref: Using BEGIN/END-Footnote-1397503 +Node: I/O And BEGIN/END397609 +Node: BEGINFILE/ENDFILE399923 +Node: Empty402824 +Node: Using Shell Variables403141 +Node: Action Overview405414 +Node: Statements407740 +Node: If Statement409588 +Node: While Statement411083 +Node: Do Statement413112 +Node: For Statement414256 +Node: Switch Statement417413 +Node: Break Statement419795 +Node: Continue Statement421836 +Node: Next Statement423663 +Node: Nextfile Statement426044 +Node: Exit Statement428674 +Node: Built-in Variables431077 +Node: User-modified432210 +Ref: User-modified-Footnote-1439891 +Node: Auto-set439953 +Ref: Auto-set-Footnote-1452988 +Ref: Auto-set-Footnote-2453193 +Node: ARGC and ARGV453249 +Node: Pattern Action Summary457467 +Node: Arrays459894 +Node: Array Basics461223 +Node: Array Intro462067 +Ref: figure-array-elements464031 +Ref: Array Intro-Footnote-1466557 +Node: Reference to Elements466685 +Node: Assigning Elements469137 +Node: Array Example469628 +Node: Scanning an Array471386 +Node: Controlling Scanning474402 +Ref: Controlling Scanning-Footnote-1479598 +Node: Numeric Array Subscripts479914 +Node: Uninitialized Subscripts482099 +Node: Delete483716 +Ref: Delete-Footnote-1486459 +Node: Multidimensional486516 +Node: Multiscanning489613 +Node: Arrays of Arrays491202 +Node: Arrays Summary495961 +Node: Functions498053 +Node: Built-in498926 +Node: Calling Built-in500004 +Node: Numeric Functions501995 +Ref: Numeric Functions-Footnote-1506012 +Ref: Numeric Functions-Footnote-2506369 +Ref: Numeric Functions-Footnote-3506417 +Node: String Functions506689 +Ref: String Functions-Footnote-1530164 +Ref: String Functions-Footnote-2530293 +Ref: String Functions-Footnote-3530541 +Node: Gory Details530628 +Ref: table-sub-escapes532409 +Ref: table-sub-proposed533929 +Ref: table-posix-sub535293 +Ref: table-gensub-escapes536829 +Ref: Gory Details-Footnote-1537661 +Node: I/O Functions537812 +Ref: I/O Functions-Footnote-1545030 +Node: Time Functions545177 +Ref: Time Functions-Footnote-1555665 +Ref: Time Functions-Footnote-2555733 +Ref: Time Functions-Footnote-3555891 +Ref: Time Functions-Footnote-4556002 +Ref: Time Functions-Footnote-5556114 +Ref: Time Functions-Footnote-6556341 +Node: Bitwise Functions556607 +Ref: table-bitwise-ops557169 +Ref: Bitwise Functions-Footnote-1561478 +Node: Type Functions561647 +Node: I18N Functions562798 +Node: User-defined564443 +Node: Definition Syntax565248 +Ref: Definition Syntax-Footnote-1570655 +Node: Function Example570726 +Ref: Function Example-Footnote-1573645 +Node: Function Caveats573667 +Node: Calling A Function574185 +Node: Variable Scope575143 +Node: Pass By Value/Reference578131 +Node: Return Statement581626 +Node: Dynamic Typing584607 +Node: Indirect Calls585536 +Ref: Indirect Calls-Footnote-1596838 +Node: Functions Summary596966 +Node: Library Functions599668 +Ref: Library Functions-Footnote-1603277 +Ref: Library Functions-Footnote-2603420 +Node: Library Names603591 +Ref: Library Names-Footnote-1607045 +Ref: Library Names-Footnote-2607268 +Node: General Functions607354 +Node: Strtonum Function608457 +Node: Assert Function611479 +Node: Round Function614803 +Node: Cliff Random Function616344 +Node: Ordinal Functions617360 +Ref: Ordinal Functions-Footnote-1620423 +Ref: Ordinal Functions-Footnote-2620675 +Node: Join Function620886 +Ref: Join Function-Footnote-1622655 +Node: Getlocaltime Function622855 +Node: Readfile Function626599 +Node: Shell Quoting628569 +Node: Data File Management629970 +Node: Filetrans Function630602 +Node: Rewind Function634658 +Node: File Checking636045 +Ref: File Checking-Footnote-1637377 +Node: Empty Files637578 +Node: Ignoring Assigns639557 +Node: Getopt Function641108 +Ref: Getopt Function-Footnote-1652570 +Node: Passwd Functions652770 +Ref: Passwd Functions-Footnote-1661619 +Node: Group Functions661707 +Ref: Group Functions-Footnote-1669601 +Node: Walking Arrays669814 +Node: Library Functions Summary671417 +Node: Library Exercises672818 +Node: Sample Programs674098 +Node: Running Examples674868 +Node: Clones675596 +Node: Cut Program676820 +Node: Egrep Program686539 +Ref: Egrep Program-Footnote-1694037 +Node: Id Program694147 +Node: Split Program697792 +Ref: Split Program-Footnote-1701240 +Node: Tee Program701368 +Node: Uniq Program704157 +Node: Wc Program711576 +Ref: Wc Program-Footnote-1715826 +Node: Miscellaneous Programs715920 +Node: Dupword Program717133 +Node: Alarm Program719164 +Node: Translate Program723968 +Ref: Translate Program-Footnote-1728533 +Node: Labels Program728803 +Ref: Labels Program-Footnote-1732154 +Node: Word Sorting732238 +Node: History Sorting736309 +Node: Extract Program738145 +Node: Simple Sed745670 +Node: Igawk Program748738 +Ref: Igawk Program-Footnote-1763062 +Ref: Igawk Program-Footnote-2763263 +Ref: Igawk Program-Footnote-3763385 +Node: Anagram Program763500 +Node: Signature Program766557 +Node: Programs Summary767804 +Node: Programs Exercises768997 +Ref: Programs Exercises-Footnote-1773128 +Node: Advanced Features773219 +Node: Nondecimal Data775167 +Node: Array Sorting776757 +Node: Controlling Array Traversal777454 +Ref: Controlling Array Traversal-Footnote-1785787 +Node: Array Sorting Functions785905 +Ref: Array Sorting Functions-Footnote-1789794 +Node: Two-way I/O789990 +Ref: Two-way I/O-Footnote-1794931 +Ref: Two-way I/O-Footnote-2795117 +Node: TCP/IP Networking795199 +Node: Profiling798072 +Node: Advanced Features Summary805619 +Node: Internationalization807552 +Node: I18N and L10N809032 +Node: Explaining gettext809718 +Ref: Explaining gettext-Footnote-1814743 +Ref: Explaining gettext-Footnote-2814927 +Node: Programmer i18n815092 +Ref: Programmer i18n-Footnote-1819958 +Node: Translator i18n820007 +Node: String Extraction820801 +Ref: String Extraction-Footnote-1821932 +Node: Printf Ordering822018 +Ref: Printf Ordering-Footnote-1824804 +Node: I18N Portability824868 +Ref: I18N Portability-Footnote-1827323 +Node: I18N Example827386 +Ref: I18N Example-Footnote-1830189 +Node: Gawk I18N830261 +Node: I18N Summary830899 +Node: Debugger832238 +Node: Debugging833260 +Node: Debugging Concepts833701 +Node: Debugging Terms835554 +Node: Awk Debugging838126 +Node: Sample Debugging Session839020 +Node: Debugger Invocation839540 +Node: Finding The Bug840924 +Node: List of Debugger Commands847399 +Node: Breakpoint Control848732 +Node: Debugger Execution Control852428 +Node: Viewing And Changing Data855792 +Node: Execution Stack859170 +Node: Debugger Info860807 +Node: Miscellaneous Debugger Commands864824 +Node: Readline Support869853 +Node: Limitations870745 +Node: Debugging Summary872859 +Node: Arbitrary Precision Arithmetic874027 +Node: Computer Arithmetic875443 +Ref: table-numeric-ranges879041 +Ref: Computer Arithmetic-Footnote-1879900 +Node: Math Definitions879957 +Ref: table-ieee-formats883245 +Ref: Math Definitions-Footnote-1883849 +Node: MPFR features883954 +Node: FP Math Caution885625 +Ref: FP Math Caution-Footnote-1886675 +Node: Inexactness of computations887044 +Node: Inexact representation888003 +Node: Comparing FP Values889360 +Node: Errors accumulate890442 +Node: Getting Accuracy891875 +Node: Try To Round894537 +Node: Setting precision895436 +Ref: table-predefined-precision-strings896120 +Node: Setting the rounding mode897909 +Ref: table-gawk-rounding-modes898273 +Ref: Setting the rounding mode-Footnote-1901728 +Node: Arbitrary Precision Integers901907 +Ref: Arbitrary Precision Integers-Footnote-1904893 +Node: POSIX Floating Point Problems905042 +Ref: POSIX Floating Point Problems-Footnote-1908915 +Node: Floating point summary908953 +Node: Dynamic Extensions911147 +Node: Extension Intro912699 +Node: Plugin License913965 +Node: Extension Mechanism Outline914762 +Ref: figure-load-extension915190 +Ref: figure-register-new-function916670 +Ref: figure-call-new-function917674 +Node: Extension API Description919660 +Node: Extension API Functions Introduction921110 +Node: General Data Types925934 +Ref: General Data Types-Footnote-1931673 +Node: Memory Allocation Functions931972 +Ref: Memory Allocation Functions-Footnote-1934811 +Node: Constructor Functions934907 +Node: Registration Functions936641 +Node: Extension Functions937326 +Node: Exit Callback Functions939623 +Node: Extension Version String940871 +Node: Input Parsers941536 +Node: Output Wrappers951413 +Node: Two-way processors955928 +Node: Printing Messages958132 +Ref: Printing Messages-Footnote-1959208 +Node: Updating `ERRNO'959360 +Node: Requesting Values960100 +Ref: table-value-types-returned960828 +Node: Accessing Parameters961785 +Node: Symbol Table Access963016 +Node: Symbol table by name963530 +Node: Symbol table by cookie965511 +Ref: Symbol table by cookie-Footnote-1969655 +Node: Cached values969718 +Ref: Cached values-Footnote-1973217 +Node: Array Manipulation973308 +Ref: Array Manipulation-Footnote-1974406 +Node: Array Data Types974443 +Ref: Array Data Types-Footnote-1977098 +Node: Array Functions977190 +Node: Flattening Arrays981044 +Node: Creating Arrays987936 +Node: Extension API Variables992705 +Node: Extension Versioning993341 +Node: Extension API Informational Variables995242 +Node: Extension API Boilerplate996330 +Node: Finding Extensions1000139 +Node: Extension Example1000699 +Node: Internal File Description1001471 +Node: Internal File Ops1005538 +Ref: Internal File Ops-Footnote-11017208 +Node: Using Internal File Ops1017348 +Ref: Using Internal File Ops-Footnote-11019731 +Node: Extension Samples1020004 +Node: Extension Sample File Functions1021530 +Node: Extension Sample Fnmatch1029168 +Node: Extension Sample Fork1030659 +Node: Extension Sample Inplace1031874 +Node: Extension Sample Ord1033549 +Node: Extension Sample Readdir1034385 +Ref: table-readdir-file-types1035261 +Node: Extension Sample Revout1036072 +Node: Extension Sample Rev2way1036662 +Node: Extension Sample Read write array1037402 +Node: Extension Sample Readfile1039342 +Node: Extension Sample Time1040437 +Node: Extension Sample API Tests1041786 +Node: gawkextlib1042277 +Node: Extension summary1044914 +Node: Extension Exercises1048591 +Node: Language History1049313 +Node: V7/SVR3.11050969 +Node: SVR41053150 +Node: POSIX1054595 +Node: BTL1055984 +Node: POSIX/GNU1056718 +Node: Feature History1062282 +Node: Common Extensions1075380 +Node: Ranges and Locales1076704 +Ref: Ranges and Locales-Footnote-11081322 +Ref: Ranges and Locales-Footnote-21081349 +Ref: Ranges and Locales-Footnote-31081583 +Node: Contributors1081804 +Node: History summary1087345 +Node: Installation1088715 +Node: Gawk Distribution1089661 +Node: Getting1090145 +Node: Extracting1090968 +Node: Distribution contents1092603 +Node: Unix Installation1098320 +Node: Quick Installation1098937 +Node: Additional Configuration Options1101361 +Node: Configuration Philosophy1103099 +Node: Non-Unix Installation1105468 +Node: PC Installation1105926 +Node: PC Binary Installation1107245 +Node: PC Compiling1109093 +Ref: PC Compiling-Footnote-11112114 +Node: PC Testing1112223 +Node: PC Using1113399 +Node: Cygwin1117514 +Node: MSYS1118337 +Node: VMS Installation1118837 +Node: VMS Compilation1119629 +Ref: VMS Compilation-Footnote-11120851 +Node: VMS Dynamic Extensions1120909 +Node: VMS Installation Details1122593 +Node: VMS Running1124845 +Node: VMS GNV1127681 +Node: VMS Old Gawk1128415 +Node: Bugs1128885 +Node: Other Versions1132768 +Node: Installation summary1139190 +Node: Notes1140246 +Node: Compatibility Mode1141111 +Node: Additions1141893 +Node: Accessing The Source1142818 +Node: Adding Code1144254 +Node: New Ports1150419 +Node: Derived Files1154901 +Ref: Derived Files-Footnote-11160376 +Ref: Derived Files-Footnote-21160410 +Ref: Derived Files-Footnote-31161006 +Node: Future Extensions1161120 +Node: Implementation Limitations1161726 +Node: Extension Design1162974 +Node: Old Extension Problems1164128 +Ref: Old Extension Problems-Footnote-11165645 +Node: Extension New Mechanism Goals1165702 +Ref: Extension New Mechanism Goals-Footnote-11169062 +Node: Extension Other Design Decisions1169251 +Node: Extension Future Growth1171359 +Node: Old Extension Mechanism1172195 +Node: Notes summary1173957 +Node: Basic Concepts1175143 +Node: Basic High Level1175824 +Ref: figure-general-flow1176096 +Ref: figure-process-flow1176695 +Ref: Basic High Level-Footnote-11179924 +Node: Basic Data Typing1180109 +Node: Glossary1183437 +Node: Copying1208595 +Node: GNU Free Documentation License1246151 +Node: Index1271287  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index a1781700..4da01e05 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -7801,10 +7801,12 @@ 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 -one of the fields contains an @emph{embedded} comma. Although there is no -formal standard specification for CSV data,@footnote{At least, we don't know of one.} -in such cases, most programs embed the field in double quotes. So we might -have data like this: +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: @example @c file eg/misc/addresses.csv diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 1ea028d4..7979b0ad 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -7402,10 +7402,12 @@ 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 -one of the fields contains an @emph{embedded} comma. Although there is no -formal standard specification for CSV data,@footnote{At least, we don't know of one.} -in such cases, most programs embed the field in double quotes. So we might -have data like this: +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: @example @c file eg/misc/addresses.csv -- cgit v1.2.3 From fed291bee8b64bddbb27537b1ab104cf93b8de01 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 19 Nov 2014 17:35:31 +0200 Subject: Update Japanese translation. --- po/ja.gmo | Bin 47970 -> 52559 bytes po/ja.po | 290 +++++++++++++++++++++++++++----------------------------------- 2 files changed, 126 insertions(+), 164 deletions(-) diff --git a/po/ja.gmo b/po/ja.gmo index d1ef30cc..64b16819 100644 Binary files a/po/ja.gmo and b/po/ja.gmo differ diff --git a/po/ja.po b/po/ja.po index ae5b61c8..19321711 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,15 +1,15 @@ # Japanese messages for gawk. -# Copyright (C) 2003, 2011 Free Software Foundation, Inc. +# Copyright (C) 2003, 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # Makoto Hosoya , 2003. -# Yasuaki Taniguchi , 2011. +# Yasuaki Taniguchi , 2011, 2014. # msgid "" msgstr "" -"Project-Id-Version: gawk 4.0.0\n" +"Project-Id-Version: gawk 4.1.0b\n" "Report-Msgid-Bugs-To: arnold@skeeve.com\n" "POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2011-07-17 08:28+0900\n" +"PO-Revision-Date: 2014-11-07 12:26+0000\n" "Last-Translator: Yasuaki Taniguchi \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -55,9 +55,8 @@ msgid "attempt to use scalar `%s[\"%.*s\"]' as an array" msgstr "スカラー `%s[\"%.*s\"]' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" #: array.c:776 -#, fuzzy msgid "adump: first argument not an array" -msgstr "adump: 引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" +msgstr "adump: 第一引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" #: array.c:815 msgid "asort: second argument not an array" @@ -250,9 +249,9 @@ msgid "can't open source file `%s' for reading (%s)" msgstr "ソースファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" #: awkgram.y:2384 awkgram.y:2509 -#, fuzzy, c-format +#, c-format msgid "can't open shared library `%s' for reading (%s)" -msgstr "ソースファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" +msgstr "共有ライブラリ `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" #: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 msgid "reason unknown" @@ -269,9 +268,9 @@ msgid "already included source file `%s'" msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™" #: awkgram.y:2409 -#, fuzzy, c-format +#, c-format msgid "already loaded shared library `%s'" -msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™" +msgstr "共有ライブラリ `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™" #: awkgram.y:2444 msgid "@include is a gawk extension" @@ -282,14 +281,12 @@ msgid "empty filename after @include" msgstr "@include ã®å¾Œã«ç©ºã®ãƒ•ァイルåãŒã‚りã¾ã™" #: awkgram.y:2494 -#, fuzzy msgid "@load is a gawk extension" -msgstr "@include 㯠gawk æ‹¡å¼µã§ã™" +msgstr "@load 㯠gawk æ‹¡å¼µã§ã™" #: awkgram.y:2500 -#, fuzzy msgid "empty filename after @load" -msgstr "@include ã®å¾Œã«ç©ºã®ãƒ•ァイルåãŒã‚りã¾ã™" +msgstr "@load ã®å¾Œã«ç©ºã®ãƒ•ァイルåãŒã‚りã¾ã™" #: awkgram.y:2634 msgid "empty program text on command line" @@ -684,9 +681,8 @@ msgid "too many arguments supplied for format string" msgstr "æ›¸å¼æ–‡å­—列ã«ä¸Žãˆã‚‰ã‚Œã¦ã„る引数ãŒå¤šã™ãŽã¾ã™" #: builtin.c:1634 -#, fuzzy msgid "sprintf: no arguments" -msgstr "printf: 引数ãŒã‚りã¾ã›ã‚“" +msgstr "sprintf: 引数ãŒã‚りã¾ã›ã‚“" #: builtin.c:1657 builtin.c:1668 msgid "printf: no arguments" @@ -834,19 +830,19 @@ msgid "lshift: received non-numeric second argument" msgstr "lshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" #: builtin.c:3038 -#, fuzzy, c-format +#, c-format msgid "lshift(%f, %f): negative values will give strange results" -msgstr "lshift(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "lshift(%f, %f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3040 -#, fuzzy, c-format +#, c-format msgid "lshift(%f, %f): fractional values will be truncated" -msgstr "lshift(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +msgstr "lshift(%f, %f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #: builtin.c:3042 -#, fuzzy, c-format +#, c-format msgid "lshift(%f, %f): too large shift value will give strange results" -msgstr "lshift(%lf, %lf): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "lshift(%f, %f): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3067 msgid "rshift: received non-numeric first argument" @@ -857,29 +853,28 @@ msgid "rshift: received non-numeric second argument" msgstr "rshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" #: builtin.c:3075 -#, fuzzy, c-format +#, c-format msgid "rshift(%f, %f): negative values will give strange results" -msgstr "rshift(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "rshift(%f, %f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3077 -#, fuzzy, c-format +#, c-format msgid "rshift(%f, %f): fractional values will be truncated" -msgstr "rshift(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +msgstr "rshift(%f, %f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #: builtin.c:3079 -#, fuzzy, c-format +#, c-format msgid "rshift(%f, %f): too large shift value will give strange results" -msgstr "rshift(%lf, %lf): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "rshift(%f, %f): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3104 mpfr.c:968 -#, fuzzy msgid "and: called with less than two arguments" -msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" +msgstr "and: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" #: builtin.c:3109 -#, fuzzy, c-format +#, c-format msgid "and: argument %d is non-numeric" -msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" +msgstr "and: 引数 %d ãŒéžæ•°å€¤ã§ã™" #: builtin.c:3113 #, fuzzy, c-format @@ -887,14 +882,13 @@ msgid "and: argument %d negative value %g will give strange results" msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3136 mpfr.c:1000 -#, fuzzy msgid "or: called with less than two arguments" -msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" +msgstr "or: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" #: builtin.c:3141 -#, fuzzy, c-format +#, c-format msgid "or: argument %d is non-numeric" -msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" +msgstr "or: 引数 %d ãŒéžæ•°å€¤ã§ã™" #: builtin.c:3145 #, fuzzy, c-format @@ -904,12 +898,12 @@ msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™ #: builtin.c:3167 mpfr.c:1031 #, fuzzy msgid "xor: called with less than two arguments" -msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" +msgstr "xor: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" #: builtin.c:3173 -#, fuzzy, c-format +#, c-format msgid "xor: argument %d is non-numeric" -msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" +msgstr "xor: 引数 %d ãŒéžæ•°å€¤ã§ã™" #: builtin.c:3177 #, fuzzy, c-format @@ -921,14 +915,14 @@ msgid "compl: received non-numeric argument" msgstr "compl: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" #: builtin.c:3208 -#, fuzzy, c-format +#, c-format msgid "compl(%f): negative value will give strange results" -msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "compl(%f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3210 -#, fuzzy, c-format +#, c-format msgid "compl(%f): fractional value will be truncated" -msgstr "compl(%lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +msgstr "compl(%f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #: builtin.c:3379 #, c-format @@ -941,24 +935,24 @@ msgid "Type (g)awk statement(s). End with the command \"end\"\n" msgstr "" #: command.y:289 -#, fuzzy, c-format +#, c-format msgid "invalid frame number: %d" -msgstr "無効ãªç¯„囲終了ã§ã™" +msgstr "無効ãªãƒ•レーム番å·ã§ã™: %d" #: command.y:295 #, fuzzy, c-format msgid "info: invalid option - \"%s\"" -msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n" +msgstr "info: 無効ãªã‚ªãƒ—ション - \"%s\"" #: command.y:321 #, c-format msgid "source \"%s\": already sourced." -msgstr "" +msgstr "source \"%s\": æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦(source)ã„ã¾ã™ã€‚" #: command.y:326 #, c-format msgid "save \"%s\": command not permitted." -msgstr "" +msgstr "save \"%s\": コマンドã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“。" #: command.y:339 msgid "Can't use command `commands' for breakpoint/watchpoint commands" @@ -966,11 +960,11 @@ msgstr "" #: command.y:341 msgid "no breakpoint/watchpoint has been set yet" -msgstr "" +msgstr "ã¾ã ä¸€ã¤ã‚‚ブレークãƒã‚¤ãƒ³ãƒˆ/ウオッãƒãƒã‚¤ãƒ³ãƒˆã¯è¨­å®šã•れã¦ã„ã¾ã›ã‚“" #: command.y:343 msgid "invalid breakpoint/watchpoint number" -msgstr "" +msgstr "無効ãªãƒ–レークãƒã‚¤ãƒ³ãƒˆ/ウオッãƒãƒã‚¤ãƒ³ãƒˆç•ªå·ã§ã™" #: command.y:348 #, c-format @@ -991,51 +985,49 @@ msgid "`silent' valid only in command `commands'" msgstr "" #: command.y:373 -#, fuzzy, c-format +#, c-format msgid "trace: invalid option - \"%s\"" -msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n" +msgstr "trace: 無効ãªã‚ªãƒ—ション - \"%s\"" #: command.y:387 msgid "condition: invalid breakpoint/watchpoint number" msgstr "" #: command.y:449 -#, fuzzy msgid "argument not a string" -msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" +msgstr "å¼•æ•°ãŒæ–‡å­—列ã§ã¯ã‚りã¾ã›ã‚“" #: command.y:459 command.y:464 #, c-format msgid "option: invalid parameter - \"%s\"" -msgstr "" +msgstr "option: 無効ãªãƒ‘ラメーター - \"%s\"" #: command.y:474 #, c-format msgid "no such function - \"%s\"" -msgstr "" +msgstr "ãã®ã‚ˆã†ãªé–¢æ•°ã¯ã‚りã¾ã›ã‚“ - \"%s\"" #: command.y:531 -#, fuzzy, c-format +#, c-format msgid "enable: invalid option - \"%s\"" -msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n" +msgstr "enable: 無効ãªã‚ªãƒ—ション - \"%s\"" #: command.y:597 -#, fuzzy, c-format +#, c-format msgid "invalid range specification: %d - %d" -msgstr "無効ãªç¯„囲終了ã§ã™" +msgstr "無効ãªç¯„囲指定: %d - %d" #: command.y:659 -#, fuzzy msgid "non-numeric value for field number" -msgstr "フィールド指定ã«ä¸æ˜Žãªå€¤ãŒã‚りã¾ã™: %d\n" +msgstr "フィールド番å·ã«å¯¾ã—ã¦éžæ•°å€¤ãŒæŒ‡å®šã•れã¦ã„ã¾ã™" #: command.y:680 command.y:687 msgid "non-numeric value found, numeric expected" -msgstr "" +msgstr "éžæ•°å€¤ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚数値ãŒäºˆæœŸã•れã¾ã™ã€‚" #: command.y:712 command.y:718 msgid "non-zero integer value" -msgstr "" +msgstr "éžã‚¼ãƒ­æ•´æ•°" #: command.y:817 msgid "" @@ -1243,9 +1235,8 @@ msgid "%s" msgstr "" #: command.y:1284 -#, fuzzy msgid "invalid character" -msgstr "無効ãªç…§åˆæ–‡å­—ã§ã™" +msgstr "ç„¡åŠ¹ãªæ–‡å­—ã§ã™" #: command.y:1455 #, c-format @@ -1417,9 +1408,9 @@ msgid "" msgstr "" #: debug.c:1029 -#, fuzzy, c-format +#, c-format msgid "no symbol `%s' in current context\n" -msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“" +msgstr "" #: debug.c:1041 debug.c:1427 #, fuzzy, c-format @@ -1709,7 +1700,7 @@ msgstr "" #: debug.c:3424 #, fuzzy, c-format msgid "element not in array\n" -msgstr "delete: é…列 `%2$s' 内ã«ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ `%1$s' ãŒã‚りã¾ã›ã‚“" +msgstr "adump: 引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" #: debug.c:3424 #, c-format @@ -1754,14 +1745,13 @@ msgid "invalid number" msgstr "" #: debug.c:5381 -#, fuzzy, c-format +#, c-format msgid "`%s' not allowed in current context; statement ignored" -msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“" +msgstr "" #: debug.c:5389 -#, fuzzy msgid "`return' not allowed in current context; statement ignored" -msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“" +msgstr "" #: debug.c:5590 #, c-format @@ -2002,32 +1992,31 @@ msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: 関数 `%s' ã®å¼•æ•°ã®æ•°ãŒè² ã§ã™" #: ext.c:276 -#, fuzzy msgid "extension: missing function name" msgstr "extension: 関数åãŒã‚りã¾ã›ã‚“" #: ext.c:279 ext.c:283 -#, fuzzy, c-format +#, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: 関数å `%2$s' ã®ä¸­ã§ä¸æ­£ãªæ–‡å­— `%1$c' ãŒä½¿ç”¨ã•れã¦ã„ã¾ã™" #: ext.c:291 -#, fuzzy, c-format +#, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: 関数 `%s' ã‚’å†å®šç¾©ã§ãã¾ã›ã‚“" #: ext.c:295 -#, fuzzy, c-format +#, c-format msgid "extension: function `%s' already defined" msgstr "extension: 関数 `%s' ã¯æ—¢ã«å®šç¾©ã•れã¦ã„ã¾ã™" #: ext.c:299 -#, fuzzy, c-format +#, c-format msgid "extension: function name `%s' previously defined" -msgstr "関数å `%s' ã¯å‰ã«å®šç¾©ã•れã¦ã„ã¾ã™" +msgstr "extension: 関数å `%s' ã¯å‰ã«å®šç¾©ã•れã¦ã„ã¾ã™" #: ext.c:301 -#, fuzzy, c-format +#, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: gawk ã«çµ„ã¿è¾¼ã¾ã‚Œã¦ã„ã‚‹ `%s' ã¯é–¢æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" @@ -2076,9 +2065,9 @@ msgid "stat: bad parameters" msgstr "%s: 仮引数ã§ã™\n" #: extension/filefuncs.c:533 -#, fuzzy, c-format +#, c-format msgid "fts init: could not create variable %s" -msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–りã¾ã—ãŸ" +msgstr "" #: extension/filefuncs.c:554 #, fuzzy @@ -2094,9 +2083,8 @@ msgid "fill_stat_element: could not set element" msgstr "" #: extension/filefuncs.c:597 -#, fuzzy msgid "fill_path_element: could not set element" -msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–りã¾ã—ãŸ" +msgstr "" #: extension/filefuncs.c:613 msgid "fill_error_element: could not set element" @@ -2108,9 +2096,8 @@ msgstr "" #: extension/filefuncs.c:670 extension/filefuncs.c:717 #: extension/filefuncs.c:735 -#, fuzzy msgid "fts-process: could not set element" -msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–りã¾ã—ãŸ" +msgstr "" #: extension/filefuncs.c:784 #, fuzzy @@ -2133,9 +2120,8 @@ msgid "fts: bad third parameter" msgstr "%s: 仮引数ã§ã™\n" #: extension/filefuncs.c:806 -#, fuzzy msgid "fts: could not flatten array\n" -msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™" +msgstr "" #: extension/filefuncs.c:824 msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah." @@ -2234,9 +2220,9 @@ msgid "inplace_begin: Cannot stat `%s' (%s)" msgstr "致命的: extension: `%s' ã‚’é–‹ãã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ (%s)\n" #: extension/inplace.c:158 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: `%s' is not a regular file" -msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™" +msgstr "" #: extension/inplace.c:169 #, c-format @@ -2379,7 +2365,7 @@ msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" #: extension/rwarray.c:293 #, fuzzy, c-format msgid "do_reada: argument 1 is not an array\n" -msgstr "match: 第三引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" +msgstr "adump: 引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" #: extension/rwarray.c:337 #, c-format @@ -3288,17 +3274,17 @@ msgstr "" #: mpfr.c:857 #, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" -msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: mpfr.c:863 #, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" -msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +msgstr "and(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #: mpfr.c:878 #, fuzzy, c-format msgid "%s: argument #%d negative value %Zd will give strange results" -msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: msg.c:68 #, c-format @@ -3490,50 +3476,27 @@ msgstr "以å‰ã«æ­£è¦è¡¨ç¾ãŒã‚りã¾ã›ã‚“" msgid "can not pop main context" msgstr "" -#, fuzzy -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "`[%c-%c]' å½¢å¼ã®ç¯„囲ã¯ãƒ­ã‚±ãƒ¼ãƒ«ä¾å­˜ã§ã™" - -#, fuzzy -#~ msgid "[s]printf called with no arguments" -#~ msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" - -#~ msgid "`-m[fr]' option irrelevant in gawk" -#~ msgstr "gawk ã§ã¯ã‚ªãƒ—ション `-m[fr]' ã«åŠ¹æžœã¯ã‚りã¾ã›ã‚“。" - -#~ msgid "-m option usage: `-m[fr] nnn'" -#~ msgstr "-m オプションã®ä½¿ç”¨æ³•: `-m[fr] 数値'" - -#, fuzzy -#~ msgid "%s: received non-numeric first argument" -#~ msgstr "or: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" - -#, fuzzy -#~ msgid "%s: received non-numeric second argument" -#~ msgstr "or: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" +#~ msgid "attempt to use function `%s' as an array" +#~ msgstr "関数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" -#, fuzzy -#~ msgid "%s(%Rg, ..): negative values will give strange results" -#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" +#~ msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„è¦ç´  `%s[\"%.*s\"]' ã¸ã®å‚ç…§ã§ã™" -#, fuzzy -#~ msgid "%s(%Rg, ..): fractional values will be truncated" -#~ msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +#~ msgid "subscript of array `%s' is null string" +#~ msgstr "é…列 `%s' ã®æ·»å­—㌠NULL 文字列ã§ã™" -#, fuzzy -#~ msgid "%s(%Zd, ..): negative values will give strange results" -#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +#~ msgid "%s: empty (null)\n" +#~ msgstr "%s: 空 (null)\n" -#, fuzzy -#~ msgid "%s(.., %Rg): negative values will give strange results" -#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +#~ msgid "%s: empty (zero)\n" +#~ msgstr "%s: 空 (zero)\n" -#, fuzzy -#~ msgid "%s(.., %Zd): negative values will give strange results" -#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +#~ msgid "%s: table_size = %d, array_size = %d\n" +#~ msgstr "" +#~ "%s: テーブルサイズ (table_size) = %d, é…列サイズ (array_size) = %d\n" -#~ msgid "`%s' is a Bell Labs extension" -#~ msgstr "`%s' ã¯ãƒ™ãƒ«ç ”究所ã«ã‚ˆã‚‹æ‹¡å¼µã§ã™" +#~ msgid "%s: array_ref to %s\n" +#~ msgstr "%s: %s ã¸ã®é…列å‚ç…§ (array_ref) ã§ã™\n" #~ msgid "`nextfile' is a gawk extension" #~ msgstr "`nextfile' 㯠gawk æ‹¡å¼µã§ã™" @@ -3541,14 +3504,29 @@ msgstr "" #~ msgid "`delete array' is a gawk extension" #~ msgstr "`delete array' 㯠gawk æ‹¡å¼µã§ã™" +#~ msgid "use of non-array as array" +#~ msgstr "é…列ã§ãªã„ã‚‚ã®ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã—ã¦ã„ã¾ã™" + +#~ msgid "`%s' is a Bell Labs extension" +#~ msgstr "`%s' ã¯ãƒ™ãƒ«ç ”究所ã«ã‚ˆã‚‹æ‹¡å¼µã§ã™" + #~ msgid "and: received non-numeric first argument" #~ msgstr "and: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" #~ msgid "and: received non-numeric second argument" #~ msgstr "and: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#~ msgid "and(%lf, %lf): fractional values will be truncated" -#~ msgstr "and(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +#~ msgid "or: received non-numeric first argument" +#~ msgstr "or: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" + +#~ msgid "or: received non-numeric second argument" +#~ msgstr "or: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" + +#~ msgid "or(%lf, %lf): negative values will give strange results" +#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" + +#~ msgid "or(%lf, %lf): fractional values will be truncated" +#~ msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #~ msgid "xor: received non-numeric first argument" #~ msgstr "xor: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" @@ -3559,37 +3537,12 @@ msgstr "" #~ msgid "xor(%lf, %lf): fractional values will be truncated" #~ msgstr "xor(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" -#~ msgid "Operation Not Supported" -#~ msgstr "ã“ã®æ“作ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“" - -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "関数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" - -#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" -#~ msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„è¦ç´  `%s[\"%.*s\"]' ã¸ã®å‚ç…§ã§ã™" - -#~ msgid "subscript of array `%s' is null string" -#~ msgstr "é…列 `%s' ã®æ·»å­—㌠NULL 文字列ã§ã™" - -#~ msgid "%s: empty (null)\n" -#~ msgstr "%s: 空 (null)\n" - -#~ msgid "%s: empty (zero)\n" -#~ msgstr "%s: 空 (zero)\n" - -#~ msgid "%s: table_size = %d, array_size = %d\n" -#~ msgstr "" -#~ "%s: テーブルサイズ (table_size) = %d, é…列サイズ (array_size) = %d\n" - -#~ msgid "%s: array_ref to %s\n" -#~ msgstr "%s: %s ã¸ã®é…列å‚ç…§ (array_ref) ã§ã™\n" - -#~ msgid "use of non-array as array" -#~ msgstr "é…列ã§ãªã„ã‚‚ã®ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã—ã¦ã„ã¾ã™" - #~ msgid "can't use function name `%s' as variable or array" #~ msgstr "関数å `%s' ã¯å¤‰æ•°ã¾ãŸã¯é…列ã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" +#~ msgid "assignment is not allowed to result of builtin function" +#~ msgstr "çµ„è¾¼é–¢æ•°ã®æˆ»ã‚Šå€¤ã¸ã®ä»£å…¥ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" + #~ msgid "assignment used in conditional context" #~ msgstr "æ¡ä»¶ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆå†…ã§ä»£å…¥ãŒä½¿ç”¨ã•れã¾ã—ãŸ" @@ -3620,11 +3573,20 @@ msgstr "" #~ msgid "Sorry, don't know how to interpret `%s'" #~ msgstr "申ã—訳ã‚りã¾ã›ã‚“㌠`%s' ã‚’ã©ã®ã‚ˆã†ã«è§£é‡ˆã™ã‚‹ã‹åˆ†ã‹ã‚Šã¾ã›ã‚“" +#~ msgid "Operation Not Supported" +#~ msgstr "ã“ã®æ“作ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“" + +#~ msgid "`-m[fr]' option irrelevant in gawk" +#~ msgstr "gawk ã§ã¯ã‚ªãƒ—ション `-m[fr]' ã«åŠ¹æžœã¯ã‚りã¾ã›ã‚“。" + +#~ msgid "-m option usage: `-m[fr] nnn'" +#~ msgstr "-m オプションã®ä½¿ç”¨æ³•: `-m[fr] 数値'" + #~ msgid "\t-R file\t\t\t--command=file\n" #~ msgstr "\t-R file\t\t\t--command=file\n" #~ msgid "could not find groups: %s" #~ msgstr "グループãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“: %s" -#~ msgid "assignment is not allowed to result of builtin function" -#~ msgstr "çµ„è¾¼é–¢æ•°ã®æˆ»ã‚Šå€¤ã¸ã®ä»£å…¥ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" +#~ msgid "range of the form `[%c-%c]' is locale dependant" +#~ msgstr "`[%c-%c]' å½¢å¼ã®ç¯„囲ã¯ãƒ­ã‚±ãƒ¼ãƒ«ä¾å­˜ã§ã™" -- cgit v1.2.3 From f862e8fe648ed66662417bc37b20980fe7780eec Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 19 Nov 2014 17:33:21 +0200 Subject: Document that RFC 4180 describes CSV data. --- doc/ChangeLog | 4 + doc/gawk.info | 937 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 10 +- doc/gawktexi.in | 10 +- 4 files changed, 485 insertions(+), 476 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7288fb77..1e53c5b7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-11-19 Arnold D. Robbins + + * gawktexi.in: Update that RFC 4180 documents CSV data. + 2014-11-17 Arnold D. Robbins * gawktexi.in: Copyedits applied. diff --git a/doc/gawk.info b/doc/gawk.info index a318498b..6026b543 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -5179,9 +5179,8 @@ what they are, and not by what they are not. 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 one of the fields -contains an _embedded_ comma. Although there is no formal standard -specification for CSV data,(1) in such cases, most programs embed the -field in double quotes. So we might have data like this: +contains an _embedded_ comma. In such cases, most programs embed the +field in double quotes.(1) So we might have data like this: Robbins,Arnold,"1234 A Pretty Street, NE",MyTown,MyState,12345-6789,USA @@ -5264,7 +5263,9 @@ based on which of the three variables--`FS', `FIELDWIDTHS', and ---------- Footnotes ---------- - (1) At least, we don't know of one. + (1) The CSV format lacked a formal standard definition for many +years. RFC 4180 (http://www.ietf.org/rfc/rfc4180.txt) standardizes the +most common practices.  File: gawk.info, Node: Multiple Line, Next: Getline, Prev: Splitting By Content, Up: Reading Files @@ -32657,7 +32658,7 @@ Index * forward slash (/), patterns and: Expression Patterns. (line 24) * FPAT variable <1>: User-modified. (line 43) * FPAT variable: Splitting By Content. - (line 26) + (line 25) * frame debugger command: Execution Stack. (line 27) * Free Documentation License (FDL): GNU Free Documentation License. (line 7) @@ -32767,7 +32768,7 @@ Index * gawk, format-control characters: Control Letters. (line 18) * gawk, FPAT variable in <1>: User-modified. (line 43) * gawk, FPAT variable in: Splitting By Content. - (line 26) + (line 25) * gawk, FUNCTAB array in: Auto-set. (line 116) * gawk, function arguments and: Calling Built-in. (line 16) * gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42) @@ -34380,467 +34381,467 @@ Ref: Full Line Fields-Footnote-2224934 Node: Field Splitting Summary225035 Node: Constant Size227109 Node: Splitting By Content231698 -Ref: Splitting By Content-Footnote-1235753 -Node: Multiple Line235793 -Ref: Multiple Line-Footnote-1241679 -Node: Getline241858 -Node: Plain Getline244070 -Node: Getline/Variable246710 -Node: Getline/File247858 -Node: Getline/Variable/File249242 -Ref: Getline/Variable/File-Footnote-1250845 -Node: Getline/Pipe250932 -Node: Getline/Variable/Pipe253615 -Node: Getline/Coprocess254746 -Node: Getline/Variable/Coprocess255998 -Node: Getline Notes256737 -Node: Getline Summary259529 -Ref: table-getline-variants259941 -Node: Read Timeout260770 -Ref: Read Timeout-Footnote-1264589 -Node: Command-line directories264647 -Node: Input Summary265552 -Node: Input Exercises268805 -Node: Printing269533 -Node: Print271310 -Node: Print Examples272767 -Node: Output Separators275546 -Node: OFMT277564 -Node: Printf278918 -Node: Basic Printf279703 -Node: Control Letters281272 -Node: Format Modifiers285256 -Node: Printf Examples291257 -Node: Redirection293743 -Node: Special FD300584 -Ref: Special FD-Footnote-1303744 -Node: Special Files303818 -Node: Other Inherited Files304435 -Node: Special Network305435 -Node: Special Caveats306297 -Node: Close Files And Pipes307248 -Ref: Close Files And Pipes-Footnote-1314430 -Ref: Close Files And Pipes-Footnote-2314578 -Node: Output Summary314728 -Node: Output Exercises315726 -Node: Expressions316406 -Node: Values317591 -Node: Constants318269 -Node: Scalar Constants318960 -Ref: Scalar Constants-Footnote-1319819 -Node: Nondecimal-numbers320069 -Node: Regexp Constants323087 -Node: Using Constant Regexps323612 -Node: Variables326755 -Node: Using Variables327410 -Node: Assignment Options329321 -Node: Conversion331196 -Node: Strings And Numbers331720 -Ref: Strings And Numbers-Footnote-1334785 -Node: Locale influences conversions334894 -Ref: table-locale-affects337641 -Node: All Operators338229 -Node: Arithmetic Ops338859 -Node: Concatenation341364 -Ref: Concatenation-Footnote-1344183 -Node: Assignment Ops344289 -Ref: table-assign-ops349268 -Node: Increment Ops350540 -Node: Truth Values and Conditions353978 -Node: Truth Values355063 -Node: Typing and Comparison356112 -Node: Variable Typing356922 -Node: Comparison Operators360575 -Ref: table-relational-ops360985 -Node: POSIX String Comparison364480 -Ref: POSIX String Comparison-Footnote-1365552 -Node: Boolean Ops365690 -Ref: Boolean Ops-Footnote-1370169 -Node: Conditional Exp370260 -Node: Function Calls371987 -Node: Precedence375867 -Node: Locales379528 -Node: Expressions Summary381160 -Node: Patterns and Actions383720 -Node: Pattern Overview384840 -Node: Regexp Patterns386519 -Node: Expression Patterns387062 -Node: Ranges390843 -Node: BEGIN/END393949 -Node: Using BEGIN/END394710 -Ref: Using BEGIN/END-Footnote-1397444 -Node: I/O And BEGIN/END397550 -Node: BEGINFILE/ENDFILE399864 -Node: Empty402765 -Node: Using Shell Variables403082 -Node: Action Overview405355 -Node: Statements407681 -Node: If Statement409529 -Node: While Statement411024 -Node: Do Statement413053 -Node: For Statement414197 -Node: Switch Statement417354 -Node: Break Statement419736 -Node: Continue Statement421777 -Node: Next Statement423604 -Node: Nextfile Statement425985 -Node: Exit Statement428615 -Node: Built-in Variables431018 -Node: User-modified432151 -Ref: User-modified-Footnote-1439832 -Node: Auto-set439894 -Ref: Auto-set-Footnote-1452929 -Ref: Auto-set-Footnote-2453134 -Node: ARGC and ARGV453190 -Node: Pattern Action Summary457408 -Node: Arrays459835 -Node: Array Basics461164 -Node: Array Intro462008 -Ref: figure-array-elements463972 -Ref: Array Intro-Footnote-1466498 -Node: Reference to Elements466626 -Node: Assigning Elements469078 -Node: Array Example469569 -Node: Scanning an Array471327 -Node: Controlling Scanning474343 -Ref: Controlling Scanning-Footnote-1479539 -Node: Numeric Array Subscripts479855 -Node: Uninitialized Subscripts482040 -Node: Delete483657 -Ref: Delete-Footnote-1486400 -Node: Multidimensional486457 -Node: Multiscanning489554 -Node: Arrays of Arrays491143 -Node: Arrays Summary495902 -Node: Functions497994 -Node: Built-in498867 -Node: Calling Built-in499945 -Node: Numeric Functions501936 -Ref: Numeric Functions-Footnote-1505953 -Ref: Numeric Functions-Footnote-2506310 -Ref: Numeric Functions-Footnote-3506358 -Node: String Functions506630 -Ref: String Functions-Footnote-1530105 -Ref: String Functions-Footnote-2530234 -Ref: String Functions-Footnote-3530482 -Node: Gory Details530569 -Ref: table-sub-escapes532350 -Ref: table-sub-proposed533870 -Ref: table-posix-sub535234 -Ref: table-gensub-escapes536770 -Ref: Gory Details-Footnote-1537602 -Node: I/O Functions537753 -Ref: I/O Functions-Footnote-1544971 -Node: Time Functions545118 -Ref: Time Functions-Footnote-1555606 -Ref: Time Functions-Footnote-2555674 -Ref: Time Functions-Footnote-3555832 -Ref: Time Functions-Footnote-4555943 -Ref: Time Functions-Footnote-5556055 -Ref: Time Functions-Footnote-6556282 -Node: Bitwise Functions556548 -Ref: table-bitwise-ops557110 -Ref: Bitwise Functions-Footnote-1561419 -Node: Type Functions561588 -Node: I18N Functions562739 -Node: User-defined564384 -Node: Definition Syntax565189 -Ref: Definition Syntax-Footnote-1570596 -Node: Function Example570667 -Ref: Function Example-Footnote-1573586 -Node: Function Caveats573608 -Node: Calling A Function574126 -Node: Variable Scope575084 -Node: Pass By Value/Reference578072 -Node: Return Statement581567 -Node: Dynamic Typing584548 -Node: Indirect Calls585477 -Ref: Indirect Calls-Footnote-1596779 -Node: Functions Summary596907 -Node: Library Functions599609 -Ref: Library Functions-Footnote-1603218 -Ref: Library Functions-Footnote-2603361 -Node: Library Names603532 -Ref: Library Names-Footnote-1606986 -Ref: Library Names-Footnote-2607209 -Node: General Functions607295 -Node: Strtonum Function608398 -Node: Assert Function611420 -Node: Round Function614744 -Node: Cliff Random Function616285 -Node: Ordinal Functions617301 -Ref: Ordinal Functions-Footnote-1620364 -Ref: Ordinal Functions-Footnote-2620616 -Node: Join Function620827 -Ref: Join Function-Footnote-1622596 -Node: Getlocaltime Function622796 -Node: Readfile Function626540 -Node: Shell Quoting628510 -Node: Data File Management629911 -Node: Filetrans Function630543 -Node: Rewind Function634599 -Node: File Checking635986 -Ref: File Checking-Footnote-1637318 -Node: Empty Files637519 -Node: Ignoring Assigns639498 -Node: Getopt Function641049 -Ref: Getopt Function-Footnote-1652511 -Node: Passwd Functions652711 -Ref: Passwd Functions-Footnote-1661560 -Node: Group Functions661648 -Ref: Group Functions-Footnote-1669542 -Node: Walking Arrays669755 -Node: Library Functions Summary671358 -Node: Library Exercises672759 -Node: Sample Programs674039 -Node: Running Examples674809 -Node: Clones675537 -Node: Cut Program676761 -Node: Egrep Program686480 -Ref: Egrep Program-Footnote-1693978 -Node: Id Program694088 -Node: Split Program697733 -Ref: Split Program-Footnote-1701181 -Node: Tee Program701309 -Node: Uniq Program704098 -Node: Wc Program711517 -Ref: Wc Program-Footnote-1715767 -Node: Miscellaneous Programs715861 -Node: Dupword Program717074 -Node: Alarm Program719105 -Node: Translate Program723909 -Ref: Translate Program-Footnote-1728474 -Node: Labels Program728744 -Ref: Labels Program-Footnote-1732095 -Node: Word Sorting732179 -Node: History Sorting736250 -Node: Extract Program738086 -Node: Simple Sed745611 -Node: Igawk Program748679 -Ref: Igawk Program-Footnote-1763003 -Ref: Igawk Program-Footnote-2763204 -Ref: Igawk Program-Footnote-3763326 -Node: Anagram Program763441 -Node: Signature Program766498 -Node: Programs Summary767745 -Node: Programs Exercises768938 -Ref: Programs Exercises-Footnote-1773069 -Node: Advanced Features773160 -Node: Nondecimal Data775108 -Node: Array Sorting776698 -Node: Controlling Array Traversal777395 -Ref: Controlling Array Traversal-Footnote-1785728 -Node: Array Sorting Functions785846 -Ref: Array Sorting Functions-Footnote-1789735 -Node: Two-way I/O789931 -Ref: Two-way I/O-Footnote-1794872 -Ref: Two-way I/O-Footnote-2795058 -Node: TCP/IP Networking795140 -Node: Profiling798013 -Node: Advanced Features Summary805560 -Node: Internationalization807493 -Node: I18N and L10N808973 -Node: Explaining gettext809659 -Ref: Explaining gettext-Footnote-1814684 -Ref: Explaining gettext-Footnote-2814868 -Node: Programmer i18n815033 -Ref: Programmer i18n-Footnote-1819899 -Node: Translator i18n819948 -Node: String Extraction820742 -Ref: String Extraction-Footnote-1821873 -Node: Printf Ordering821959 -Ref: Printf Ordering-Footnote-1824745 -Node: I18N Portability824809 -Ref: I18N Portability-Footnote-1827264 -Node: I18N Example827327 -Ref: I18N Example-Footnote-1830130 -Node: Gawk I18N830202 -Node: I18N Summary830840 -Node: Debugger832179 -Node: Debugging833201 -Node: Debugging Concepts833642 -Node: Debugging Terms835495 -Node: Awk Debugging838067 -Node: Sample Debugging Session838961 -Node: Debugger Invocation839481 -Node: Finding The Bug840865 -Node: List of Debugger Commands847340 -Node: Breakpoint Control848673 -Node: Debugger Execution Control852369 -Node: Viewing And Changing Data855733 -Node: Execution Stack859111 -Node: Debugger Info860748 -Node: Miscellaneous Debugger Commands864765 -Node: Readline Support869794 -Node: Limitations870686 -Node: Debugging Summary872800 -Node: Arbitrary Precision Arithmetic873968 -Node: Computer Arithmetic875384 -Ref: table-numeric-ranges878982 -Ref: Computer Arithmetic-Footnote-1879841 -Node: Math Definitions879898 -Ref: table-ieee-formats883186 -Ref: Math Definitions-Footnote-1883790 -Node: MPFR features883895 -Node: FP Math Caution885566 -Ref: FP Math Caution-Footnote-1886616 -Node: Inexactness of computations886985 -Node: Inexact representation887944 -Node: Comparing FP Values889301 -Node: Errors accumulate890383 -Node: Getting Accuracy891816 -Node: Try To Round894478 -Node: Setting precision895377 -Ref: table-predefined-precision-strings896061 -Node: Setting the rounding mode897850 -Ref: table-gawk-rounding-modes898214 -Ref: Setting the rounding mode-Footnote-1901669 -Node: Arbitrary Precision Integers901848 -Ref: Arbitrary Precision Integers-Footnote-1904834 -Node: POSIX Floating Point Problems904983 -Ref: POSIX Floating Point Problems-Footnote-1908856 -Node: Floating point summary908894 -Node: Dynamic Extensions911088 -Node: Extension Intro912640 -Node: Plugin License913906 -Node: Extension Mechanism Outline914703 -Ref: figure-load-extension915131 -Ref: figure-register-new-function916611 -Ref: figure-call-new-function917615 -Node: Extension API Description919601 -Node: Extension API Functions Introduction921051 -Node: General Data Types925875 -Ref: General Data Types-Footnote-1931614 -Node: Memory Allocation Functions931913 -Ref: Memory Allocation Functions-Footnote-1934752 -Node: Constructor Functions934848 -Node: Registration Functions936582 -Node: Extension Functions937267 -Node: Exit Callback Functions939564 -Node: Extension Version String940812 -Node: Input Parsers941477 -Node: Output Wrappers951354 -Node: Two-way processors955869 -Node: Printing Messages958073 -Ref: Printing Messages-Footnote-1959149 -Node: Updating `ERRNO'959301 -Node: Requesting Values960041 -Ref: table-value-types-returned960769 -Node: Accessing Parameters961726 -Node: Symbol Table Access962957 -Node: Symbol table by name963471 -Node: Symbol table by cookie965452 -Ref: Symbol table by cookie-Footnote-1969596 -Node: Cached values969659 -Ref: Cached values-Footnote-1973158 -Node: Array Manipulation973249 -Ref: Array Manipulation-Footnote-1974347 -Node: Array Data Types974384 -Ref: Array Data Types-Footnote-1977039 -Node: Array Functions977131 -Node: Flattening Arrays980985 -Node: Creating Arrays987877 -Node: Extension API Variables992646 -Node: Extension Versioning993282 -Node: Extension API Informational Variables995183 -Node: Extension API Boilerplate996271 -Node: Finding Extensions1000080 -Node: Extension Example1000640 -Node: Internal File Description1001412 -Node: Internal File Ops1005479 -Ref: Internal File Ops-Footnote-11017149 -Node: Using Internal File Ops1017289 -Ref: Using Internal File Ops-Footnote-11019672 -Node: Extension Samples1019945 -Node: Extension Sample File Functions1021471 -Node: Extension Sample Fnmatch1029109 -Node: Extension Sample Fork1030600 -Node: Extension Sample Inplace1031815 -Node: Extension Sample Ord1033490 -Node: Extension Sample Readdir1034326 -Ref: table-readdir-file-types1035202 -Node: Extension Sample Revout1036013 -Node: Extension Sample Rev2way1036603 -Node: Extension Sample Read write array1037343 -Node: Extension Sample Readfile1039283 -Node: Extension Sample Time1040378 -Node: Extension Sample API Tests1041727 -Node: gawkextlib1042218 -Node: Extension summary1044855 -Node: Extension Exercises1048532 -Node: Language History1049254 -Node: V7/SVR3.11050910 -Node: SVR41053091 -Node: POSIX1054536 -Node: BTL1055925 -Node: POSIX/GNU1056659 -Node: Feature History1062223 -Node: Common Extensions1075321 -Node: Ranges and Locales1076645 -Ref: Ranges and Locales-Footnote-11081263 -Ref: Ranges and Locales-Footnote-21081290 -Ref: Ranges and Locales-Footnote-31081524 -Node: Contributors1081745 -Node: History summary1087286 -Node: Installation1088656 -Node: Gawk Distribution1089602 -Node: Getting1090086 -Node: Extracting1090909 -Node: Distribution contents1092544 -Node: Unix Installation1098261 -Node: Quick Installation1098878 -Node: Additional Configuration Options1101302 -Node: Configuration Philosophy1103040 -Node: Non-Unix Installation1105409 -Node: PC Installation1105867 -Node: PC Binary Installation1107186 -Node: PC Compiling1109034 -Ref: PC Compiling-Footnote-11112055 -Node: PC Testing1112164 -Node: PC Using1113340 -Node: Cygwin1117455 -Node: MSYS1118278 -Node: VMS Installation1118778 -Node: VMS Compilation1119570 -Ref: VMS Compilation-Footnote-11120792 -Node: VMS Dynamic Extensions1120850 -Node: VMS Installation Details1122534 -Node: VMS Running1124786 -Node: VMS GNV1127622 -Node: VMS Old Gawk1128356 -Node: Bugs1128826 -Node: Other Versions1132709 -Node: Installation summary1139131 -Node: Notes1140187 -Node: Compatibility Mode1141052 -Node: Additions1141834 -Node: Accessing The Source1142759 -Node: Adding Code1144195 -Node: New Ports1150360 -Node: Derived Files1154842 -Ref: Derived Files-Footnote-11160317 -Ref: Derived Files-Footnote-21160351 -Ref: Derived Files-Footnote-31160947 -Node: Future Extensions1161061 -Node: Implementation Limitations1161667 -Node: Extension Design1162915 -Node: Old Extension Problems1164069 -Ref: Old Extension Problems-Footnote-11165586 -Node: Extension New Mechanism Goals1165643 -Ref: Extension New Mechanism Goals-Footnote-11169003 -Node: Extension Other Design Decisions1169192 -Node: Extension Future Growth1171300 -Node: Old Extension Mechanism1172136 -Node: Notes summary1173898 -Node: Basic Concepts1175084 -Node: Basic High Level1175765 -Ref: figure-general-flow1176037 -Ref: figure-process-flow1176636 -Ref: Basic High Level-Footnote-11179865 -Node: Basic Data Typing1180050 -Node: Glossary1183378 -Node: Copying1208536 -Node: GNU Free Documentation License1246092 -Node: Index1271228 +Ref: Splitting By Content-Footnote-1235689 +Node: Multiple Line235852 +Ref: Multiple Line-Footnote-1241738 +Node: Getline241917 +Node: Plain Getline244129 +Node: Getline/Variable246769 +Node: Getline/File247917 +Node: Getline/Variable/File249301 +Ref: Getline/Variable/File-Footnote-1250904 +Node: Getline/Pipe250991 +Node: Getline/Variable/Pipe253674 +Node: Getline/Coprocess254805 +Node: Getline/Variable/Coprocess256057 +Node: Getline Notes256796 +Node: Getline Summary259588 +Ref: table-getline-variants260000 +Node: Read Timeout260829 +Ref: Read Timeout-Footnote-1264648 +Node: Command-line directories264706 +Node: Input Summary265611 +Node: Input Exercises268864 +Node: Printing269592 +Node: Print271369 +Node: Print Examples272826 +Node: Output Separators275605 +Node: OFMT277623 +Node: Printf278977 +Node: Basic Printf279762 +Node: Control Letters281331 +Node: Format Modifiers285315 +Node: Printf Examples291316 +Node: Redirection293802 +Node: Special FD300643 +Ref: Special FD-Footnote-1303803 +Node: Special Files303877 +Node: Other Inherited Files304494 +Node: Special Network305494 +Node: Special Caveats306356 +Node: Close Files And Pipes307307 +Ref: Close Files And Pipes-Footnote-1314489 +Ref: Close Files And Pipes-Footnote-2314637 +Node: Output Summary314787 +Node: Output Exercises315785 +Node: Expressions316465 +Node: Values317650 +Node: Constants318328 +Node: Scalar Constants319019 +Ref: Scalar Constants-Footnote-1319878 +Node: Nondecimal-numbers320128 +Node: Regexp Constants323146 +Node: Using Constant Regexps323671 +Node: Variables326814 +Node: Using Variables327469 +Node: Assignment Options329380 +Node: Conversion331255 +Node: Strings And Numbers331779 +Ref: Strings And Numbers-Footnote-1334844 +Node: Locale influences conversions334953 +Ref: table-locale-affects337700 +Node: All Operators338288 +Node: Arithmetic Ops338918 +Node: Concatenation341423 +Ref: Concatenation-Footnote-1344242 +Node: Assignment Ops344348 +Ref: table-assign-ops349327 +Node: Increment Ops350599 +Node: Truth Values and Conditions354037 +Node: Truth Values355122 +Node: Typing and Comparison356171 +Node: Variable Typing356981 +Node: Comparison Operators360634 +Ref: table-relational-ops361044 +Node: POSIX String Comparison364539 +Ref: POSIX String Comparison-Footnote-1365611 +Node: Boolean Ops365749 +Ref: Boolean Ops-Footnote-1370228 +Node: Conditional Exp370319 +Node: Function Calls372046 +Node: Precedence375926 +Node: Locales379587 +Node: Expressions Summary381219 +Node: Patterns and Actions383779 +Node: Pattern Overview384899 +Node: Regexp Patterns386578 +Node: Expression Patterns387121 +Node: Ranges390902 +Node: BEGIN/END394008 +Node: Using BEGIN/END394769 +Ref: Using BEGIN/END-Footnote-1397503 +Node: I/O And BEGIN/END397609 +Node: BEGINFILE/ENDFILE399923 +Node: Empty402824 +Node: Using Shell Variables403141 +Node: Action Overview405414 +Node: Statements407740 +Node: If Statement409588 +Node: While Statement411083 +Node: Do Statement413112 +Node: For Statement414256 +Node: Switch Statement417413 +Node: Break Statement419795 +Node: Continue Statement421836 +Node: Next Statement423663 +Node: Nextfile Statement426044 +Node: Exit Statement428674 +Node: Built-in Variables431077 +Node: User-modified432210 +Ref: User-modified-Footnote-1439891 +Node: Auto-set439953 +Ref: Auto-set-Footnote-1452988 +Ref: Auto-set-Footnote-2453193 +Node: ARGC and ARGV453249 +Node: Pattern Action Summary457467 +Node: Arrays459894 +Node: Array Basics461223 +Node: Array Intro462067 +Ref: figure-array-elements464031 +Ref: Array Intro-Footnote-1466557 +Node: Reference to Elements466685 +Node: Assigning Elements469137 +Node: Array Example469628 +Node: Scanning an Array471386 +Node: Controlling Scanning474402 +Ref: Controlling Scanning-Footnote-1479598 +Node: Numeric Array Subscripts479914 +Node: Uninitialized Subscripts482099 +Node: Delete483716 +Ref: Delete-Footnote-1486459 +Node: Multidimensional486516 +Node: Multiscanning489613 +Node: Arrays of Arrays491202 +Node: Arrays Summary495961 +Node: Functions498053 +Node: Built-in498926 +Node: Calling Built-in500004 +Node: Numeric Functions501995 +Ref: Numeric Functions-Footnote-1506012 +Ref: Numeric Functions-Footnote-2506369 +Ref: Numeric Functions-Footnote-3506417 +Node: String Functions506689 +Ref: String Functions-Footnote-1530164 +Ref: String Functions-Footnote-2530293 +Ref: String Functions-Footnote-3530541 +Node: Gory Details530628 +Ref: table-sub-escapes532409 +Ref: table-sub-proposed533929 +Ref: table-posix-sub535293 +Ref: table-gensub-escapes536829 +Ref: Gory Details-Footnote-1537661 +Node: I/O Functions537812 +Ref: I/O Functions-Footnote-1545030 +Node: Time Functions545177 +Ref: Time Functions-Footnote-1555665 +Ref: Time Functions-Footnote-2555733 +Ref: Time Functions-Footnote-3555891 +Ref: Time Functions-Footnote-4556002 +Ref: Time Functions-Footnote-5556114 +Ref: Time Functions-Footnote-6556341 +Node: Bitwise Functions556607 +Ref: table-bitwise-ops557169 +Ref: Bitwise Functions-Footnote-1561478 +Node: Type Functions561647 +Node: I18N Functions562798 +Node: User-defined564443 +Node: Definition Syntax565248 +Ref: Definition Syntax-Footnote-1570655 +Node: Function Example570726 +Ref: Function Example-Footnote-1573645 +Node: Function Caveats573667 +Node: Calling A Function574185 +Node: Variable Scope575143 +Node: Pass By Value/Reference578131 +Node: Return Statement581626 +Node: Dynamic Typing584607 +Node: Indirect Calls585536 +Ref: Indirect Calls-Footnote-1596838 +Node: Functions Summary596966 +Node: Library Functions599668 +Ref: Library Functions-Footnote-1603277 +Ref: Library Functions-Footnote-2603420 +Node: Library Names603591 +Ref: Library Names-Footnote-1607045 +Ref: Library Names-Footnote-2607268 +Node: General Functions607354 +Node: Strtonum Function608457 +Node: Assert Function611479 +Node: Round Function614803 +Node: Cliff Random Function616344 +Node: Ordinal Functions617360 +Ref: Ordinal Functions-Footnote-1620423 +Ref: Ordinal Functions-Footnote-2620675 +Node: Join Function620886 +Ref: Join Function-Footnote-1622655 +Node: Getlocaltime Function622855 +Node: Readfile Function626599 +Node: Shell Quoting628569 +Node: Data File Management629970 +Node: Filetrans Function630602 +Node: Rewind Function634658 +Node: File Checking636045 +Ref: File Checking-Footnote-1637377 +Node: Empty Files637578 +Node: Ignoring Assigns639557 +Node: Getopt Function641108 +Ref: Getopt Function-Footnote-1652570 +Node: Passwd Functions652770 +Ref: Passwd Functions-Footnote-1661619 +Node: Group Functions661707 +Ref: Group Functions-Footnote-1669601 +Node: Walking Arrays669814 +Node: Library Functions Summary671417 +Node: Library Exercises672818 +Node: Sample Programs674098 +Node: Running Examples674868 +Node: Clones675596 +Node: Cut Program676820 +Node: Egrep Program686539 +Ref: Egrep Program-Footnote-1694037 +Node: Id Program694147 +Node: Split Program697792 +Ref: Split Program-Footnote-1701240 +Node: Tee Program701368 +Node: Uniq Program704157 +Node: Wc Program711576 +Ref: Wc Program-Footnote-1715826 +Node: Miscellaneous Programs715920 +Node: Dupword Program717133 +Node: Alarm Program719164 +Node: Translate Program723968 +Ref: Translate Program-Footnote-1728533 +Node: Labels Program728803 +Ref: Labels Program-Footnote-1732154 +Node: Word Sorting732238 +Node: History Sorting736309 +Node: Extract Program738145 +Node: Simple Sed745670 +Node: Igawk Program748738 +Ref: Igawk Program-Footnote-1763062 +Ref: Igawk Program-Footnote-2763263 +Ref: Igawk Program-Footnote-3763385 +Node: Anagram Program763500 +Node: Signature Program766557 +Node: Programs Summary767804 +Node: Programs Exercises768997 +Ref: Programs Exercises-Footnote-1773128 +Node: Advanced Features773219 +Node: Nondecimal Data775167 +Node: Array Sorting776757 +Node: Controlling Array Traversal777454 +Ref: Controlling Array Traversal-Footnote-1785787 +Node: Array Sorting Functions785905 +Ref: Array Sorting Functions-Footnote-1789794 +Node: Two-way I/O789990 +Ref: Two-way I/O-Footnote-1794931 +Ref: Two-way I/O-Footnote-2795117 +Node: TCP/IP Networking795199 +Node: Profiling798072 +Node: Advanced Features Summary805619 +Node: Internationalization807552 +Node: I18N and L10N809032 +Node: Explaining gettext809718 +Ref: Explaining gettext-Footnote-1814743 +Ref: Explaining gettext-Footnote-2814927 +Node: Programmer i18n815092 +Ref: Programmer i18n-Footnote-1819958 +Node: Translator i18n820007 +Node: String Extraction820801 +Ref: String Extraction-Footnote-1821932 +Node: Printf Ordering822018 +Ref: Printf Ordering-Footnote-1824804 +Node: I18N Portability824868 +Ref: I18N Portability-Footnote-1827323 +Node: I18N Example827386 +Ref: I18N Example-Footnote-1830189 +Node: Gawk I18N830261 +Node: I18N Summary830899 +Node: Debugger832238 +Node: Debugging833260 +Node: Debugging Concepts833701 +Node: Debugging Terms835554 +Node: Awk Debugging838126 +Node: Sample Debugging Session839020 +Node: Debugger Invocation839540 +Node: Finding The Bug840924 +Node: List of Debugger Commands847399 +Node: Breakpoint Control848732 +Node: Debugger Execution Control852428 +Node: Viewing And Changing Data855792 +Node: Execution Stack859170 +Node: Debugger Info860807 +Node: Miscellaneous Debugger Commands864824 +Node: Readline Support869853 +Node: Limitations870745 +Node: Debugging Summary872859 +Node: Arbitrary Precision Arithmetic874027 +Node: Computer Arithmetic875443 +Ref: table-numeric-ranges879041 +Ref: Computer Arithmetic-Footnote-1879900 +Node: Math Definitions879957 +Ref: table-ieee-formats883245 +Ref: Math Definitions-Footnote-1883849 +Node: MPFR features883954 +Node: FP Math Caution885625 +Ref: FP Math Caution-Footnote-1886675 +Node: Inexactness of computations887044 +Node: Inexact representation888003 +Node: Comparing FP Values889360 +Node: Errors accumulate890442 +Node: Getting Accuracy891875 +Node: Try To Round894537 +Node: Setting precision895436 +Ref: table-predefined-precision-strings896120 +Node: Setting the rounding mode897909 +Ref: table-gawk-rounding-modes898273 +Ref: Setting the rounding mode-Footnote-1901728 +Node: Arbitrary Precision Integers901907 +Ref: Arbitrary Precision Integers-Footnote-1904893 +Node: POSIX Floating Point Problems905042 +Ref: POSIX Floating Point Problems-Footnote-1908915 +Node: Floating point summary908953 +Node: Dynamic Extensions911147 +Node: Extension Intro912699 +Node: Plugin License913965 +Node: Extension Mechanism Outline914762 +Ref: figure-load-extension915190 +Ref: figure-register-new-function916670 +Ref: figure-call-new-function917674 +Node: Extension API Description919660 +Node: Extension API Functions Introduction921110 +Node: General Data Types925934 +Ref: General Data Types-Footnote-1931673 +Node: Memory Allocation Functions931972 +Ref: Memory Allocation Functions-Footnote-1934811 +Node: Constructor Functions934907 +Node: Registration Functions936641 +Node: Extension Functions937326 +Node: Exit Callback Functions939623 +Node: Extension Version String940871 +Node: Input Parsers941536 +Node: Output Wrappers951413 +Node: Two-way processors955928 +Node: Printing Messages958132 +Ref: Printing Messages-Footnote-1959208 +Node: Updating `ERRNO'959360 +Node: Requesting Values960100 +Ref: table-value-types-returned960828 +Node: Accessing Parameters961785 +Node: Symbol Table Access963016 +Node: Symbol table by name963530 +Node: Symbol table by cookie965511 +Ref: Symbol table by cookie-Footnote-1969655 +Node: Cached values969718 +Ref: Cached values-Footnote-1973217 +Node: Array Manipulation973308 +Ref: Array Manipulation-Footnote-1974406 +Node: Array Data Types974443 +Ref: Array Data Types-Footnote-1977098 +Node: Array Functions977190 +Node: Flattening Arrays981044 +Node: Creating Arrays987936 +Node: Extension API Variables992705 +Node: Extension Versioning993341 +Node: Extension API Informational Variables995242 +Node: Extension API Boilerplate996330 +Node: Finding Extensions1000139 +Node: Extension Example1000699 +Node: Internal File Description1001471 +Node: Internal File Ops1005538 +Ref: Internal File Ops-Footnote-11017208 +Node: Using Internal File Ops1017348 +Ref: Using Internal File Ops-Footnote-11019731 +Node: Extension Samples1020004 +Node: Extension Sample File Functions1021530 +Node: Extension Sample Fnmatch1029168 +Node: Extension Sample Fork1030659 +Node: Extension Sample Inplace1031874 +Node: Extension Sample Ord1033549 +Node: Extension Sample Readdir1034385 +Ref: table-readdir-file-types1035261 +Node: Extension Sample Revout1036072 +Node: Extension Sample Rev2way1036662 +Node: Extension Sample Read write array1037402 +Node: Extension Sample Readfile1039342 +Node: Extension Sample Time1040437 +Node: Extension Sample API Tests1041786 +Node: gawkextlib1042277 +Node: Extension summary1044914 +Node: Extension Exercises1048591 +Node: Language History1049313 +Node: V7/SVR3.11050969 +Node: SVR41053150 +Node: POSIX1054595 +Node: BTL1055984 +Node: POSIX/GNU1056718 +Node: Feature History1062282 +Node: Common Extensions1075380 +Node: Ranges and Locales1076704 +Ref: Ranges and Locales-Footnote-11081322 +Ref: Ranges and Locales-Footnote-21081349 +Ref: Ranges and Locales-Footnote-31081583 +Node: Contributors1081804 +Node: History summary1087345 +Node: Installation1088715 +Node: Gawk Distribution1089661 +Node: Getting1090145 +Node: Extracting1090968 +Node: Distribution contents1092603 +Node: Unix Installation1098320 +Node: Quick Installation1098937 +Node: Additional Configuration Options1101361 +Node: Configuration Philosophy1103099 +Node: Non-Unix Installation1105468 +Node: PC Installation1105926 +Node: PC Binary Installation1107245 +Node: PC Compiling1109093 +Ref: PC Compiling-Footnote-11112114 +Node: PC Testing1112223 +Node: PC Using1113399 +Node: Cygwin1117514 +Node: MSYS1118337 +Node: VMS Installation1118837 +Node: VMS Compilation1119629 +Ref: VMS Compilation-Footnote-11120851 +Node: VMS Dynamic Extensions1120909 +Node: VMS Installation Details1122593 +Node: VMS Running1124845 +Node: VMS GNV1127681 +Node: VMS Old Gawk1128415 +Node: Bugs1128885 +Node: Other Versions1132768 +Node: Installation summary1139190 +Node: Notes1140246 +Node: Compatibility Mode1141111 +Node: Additions1141893 +Node: Accessing The Source1142818 +Node: Adding Code1144254 +Node: New Ports1150419 +Node: Derived Files1154901 +Ref: Derived Files-Footnote-11160376 +Ref: Derived Files-Footnote-21160410 +Ref: Derived Files-Footnote-31161006 +Node: Future Extensions1161120 +Node: Implementation Limitations1161726 +Node: Extension Design1162974 +Node: Old Extension Problems1164128 +Ref: Old Extension Problems-Footnote-11165645 +Node: Extension New Mechanism Goals1165702 +Ref: Extension New Mechanism Goals-Footnote-11169062 +Node: Extension Other Design Decisions1169251 +Node: Extension Future Growth1171359 +Node: Old Extension Mechanism1172195 +Node: Notes summary1173957 +Node: Basic Concepts1175143 +Node: Basic High Level1175824 +Ref: figure-general-flow1176096 +Ref: figure-process-flow1176695 +Ref: Basic High Level-Footnote-11179924 +Node: Basic Data Typing1180109 +Node: Glossary1183437 +Node: Copying1208595 +Node: GNU Free Documentation License1246151 +Node: Index1271287  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index a1781700..4da01e05 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -7801,10 +7801,12 @@ 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 -one of the fields contains an @emph{embedded} comma. Although there is no -formal standard specification for CSV data,@footnote{At least, we don't know of one.} -in such cases, most programs embed the field in double quotes. So we might -have data like this: +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: @example @c file eg/misc/addresses.csv diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 1ea028d4..7979b0ad 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -7402,10 +7402,12 @@ 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 -one of the fields contains an @emph{embedded} comma. Although there is no -formal standard specification for CSV data,@footnote{At least, we don't know of one.} -in such cases, most programs embed the field in double quotes. So we might -have data like this: +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: @example @c file eg/misc/addresses.csv -- cgit v1.2.3 From 80561e40fab798717fe2d0c217ccaf96e1025def Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 19 Nov 2014 17:35:31 +0200 Subject: Update Japanese translation. --- po/ja.gmo | Bin 47970 -> 52559 bytes po/ja.po | 290 +++++++++++++++++++++++++++----------------------------------- 2 files changed, 126 insertions(+), 164 deletions(-) diff --git a/po/ja.gmo b/po/ja.gmo index d1ef30cc..64b16819 100644 Binary files a/po/ja.gmo and b/po/ja.gmo differ diff --git a/po/ja.po b/po/ja.po index ae5b61c8..19321711 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,15 +1,15 @@ # Japanese messages for gawk. -# Copyright (C) 2003, 2011 Free Software Foundation, Inc. +# Copyright (C) 2003, 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # Makoto Hosoya , 2003. -# Yasuaki Taniguchi , 2011. +# Yasuaki Taniguchi , 2011, 2014. # msgid "" msgstr "" -"Project-Id-Version: gawk 4.0.0\n" +"Project-Id-Version: gawk 4.1.0b\n" "Report-Msgid-Bugs-To: arnold@skeeve.com\n" "POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2011-07-17 08:28+0900\n" +"PO-Revision-Date: 2014-11-07 12:26+0000\n" "Last-Translator: Yasuaki Taniguchi \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -55,9 +55,8 @@ msgid "attempt to use scalar `%s[\"%.*s\"]' as an array" msgstr "スカラー `%s[\"%.*s\"]' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" #: array.c:776 -#, fuzzy msgid "adump: first argument not an array" -msgstr "adump: 引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" +msgstr "adump: 第一引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" #: array.c:815 msgid "asort: second argument not an array" @@ -250,9 +249,9 @@ msgid "can't open source file `%s' for reading (%s)" msgstr "ソースファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" #: awkgram.y:2384 awkgram.y:2509 -#, fuzzy, c-format +#, c-format msgid "can't open shared library `%s' for reading (%s)" -msgstr "ソースファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" +msgstr "共有ライブラリ `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" #: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 msgid "reason unknown" @@ -269,9 +268,9 @@ msgid "already included source file `%s'" msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™" #: awkgram.y:2409 -#, fuzzy, c-format +#, c-format msgid "already loaded shared library `%s'" -msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™" +msgstr "共有ライブラリ `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™" #: awkgram.y:2444 msgid "@include is a gawk extension" @@ -282,14 +281,12 @@ msgid "empty filename after @include" msgstr "@include ã®å¾Œã«ç©ºã®ãƒ•ァイルåãŒã‚りã¾ã™" #: awkgram.y:2494 -#, fuzzy msgid "@load is a gawk extension" -msgstr "@include 㯠gawk æ‹¡å¼µã§ã™" +msgstr "@load 㯠gawk æ‹¡å¼µã§ã™" #: awkgram.y:2500 -#, fuzzy msgid "empty filename after @load" -msgstr "@include ã®å¾Œã«ç©ºã®ãƒ•ァイルåãŒã‚りã¾ã™" +msgstr "@load ã®å¾Œã«ç©ºã®ãƒ•ァイルåãŒã‚りã¾ã™" #: awkgram.y:2634 msgid "empty program text on command line" @@ -684,9 +681,8 @@ msgid "too many arguments supplied for format string" msgstr "æ›¸å¼æ–‡å­—列ã«ä¸Žãˆã‚‰ã‚Œã¦ã„る引数ãŒå¤šã™ãŽã¾ã™" #: builtin.c:1634 -#, fuzzy msgid "sprintf: no arguments" -msgstr "printf: 引数ãŒã‚りã¾ã›ã‚“" +msgstr "sprintf: 引数ãŒã‚りã¾ã›ã‚“" #: builtin.c:1657 builtin.c:1668 msgid "printf: no arguments" @@ -834,19 +830,19 @@ msgid "lshift: received non-numeric second argument" msgstr "lshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" #: builtin.c:3038 -#, fuzzy, c-format +#, c-format msgid "lshift(%f, %f): negative values will give strange results" -msgstr "lshift(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "lshift(%f, %f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3040 -#, fuzzy, c-format +#, c-format msgid "lshift(%f, %f): fractional values will be truncated" -msgstr "lshift(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +msgstr "lshift(%f, %f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #: builtin.c:3042 -#, fuzzy, c-format +#, c-format msgid "lshift(%f, %f): too large shift value will give strange results" -msgstr "lshift(%lf, %lf): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "lshift(%f, %f): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3067 msgid "rshift: received non-numeric first argument" @@ -857,29 +853,28 @@ msgid "rshift: received non-numeric second argument" msgstr "rshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" #: builtin.c:3075 -#, fuzzy, c-format +#, c-format msgid "rshift(%f, %f): negative values will give strange results" -msgstr "rshift(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "rshift(%f, %f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3077 -#, fuzzy, c-format +#, c-format msgid "rshift(%f, %f): fractional values will be truncated" -msgstr "rshift(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +msgstr "rshift(%f, %f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #: builtin.c:3079 -#, fuzzy, c-format +#, c-format msgid "rshift(%f, %f): too large shift value will give strange results" -msgstr "rshift(%lf, %lf): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "rshift(%f, %f): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3104 mpfr.c:968 -#, fuzzy msgid "and: called with less than two arguments" -msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" +msgstr "and: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" #: builtin.c:3109 -#, fuzzy, c-format +#, c-format msgid "and: argument %d is non-numeric" -msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" +msgstr "and: 引数 %d ãŒéžæ•°å€¤ã§ã™" #: builtin.c:3113 #, fuzzy, c-format @@ -887,14 +882,13 @@ msgid "and: argument %d negative value %g will give strange results" msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3136 mpfr.c:1000 -#, fuzzy msgid "or: called with less than two arguments" -msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" +msgstr "or: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" #: builtin.c:3141 -#, fuzzy, c-format +#, c-format msgid "or: argument %d is non-numeric" -msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" +msgstr "or: 引数 %d ãŒéžæ•°å€¤ã§ã™" #: builtin.c:3145 #, fuzzy, c-format @@ -904,12 +898,12 @@ msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™ #: builtin.c:3167 mpfr.c:1031 #, fuzzy msgid "xor: called with less than two arguments" -msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" +msgstr "xor: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" #: builtin.c:3173 -#, fuzzy, c-format +#, c-format msgid "xor: argument %d is non-numeric" -msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" +msgstr "xor: 引数 %d ãŒéžæ•°å€¤ã§ã™" #: builtin.c:3177 #, fuzzy, c-format @@ -921,14 +915,14 @@ msgid "compl: received non-numeric argument" msgstr "compl: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" #: builtin.c:3208 -#, fuzzy, c-format +#, c-format msgid "compl(%f): negative value will give strange results" -msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "compl(%f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: builtin.c:3210 -#, fuzzy, c-format +#, c-format msgid "compl(%f): fractional value will be truncated" -msgstr "compl(%lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +msgstr "compl(%f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #: builtin.c:3379 #, c-format @@ -941,24 +935,24 @@ msgid "Type (g)awk statement(s). End with the command \"end\"\n" msgstr "" #: command.y:289 -#, fuzzy, c-format +#, c-format msgid "invalid frame number: %d" -msgstr "無効ãªç¯„囲終了ã§ã™" +msgstr "無効ãªãƒ•レーム番å·ã§ã™: %d" #: command.y:295 #, fuzzy, c-format msgid "info: invalid option - \"%s\"" -msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n" +msgstr "info: 無効ãªã‚ªãƒ—ション - \"%s\"" #: command.y:321 #, c-format msgid "source \"%s\": already sourced." -msgstr "" +msgstr "source \"%s\": æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦(source)ã„ã¾ã™ã€‚" #: command.y:326 #, c-format msgid "save \"%s\": command not permitted." -msgstr "" +msgstr "save \"%s\": コマンドã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“。" #: command.y:339 msgid "Can't use command `commands' for breakpoint/watchpoint commands" @@ -966,11 +960,11 @@ msgstr "" #: command.y:341 msgid "no breakpoint/watchpoint has been set yet" -msgstr "" +msgstr "ã¾ã ä¸€ã¤ã‚‚ブレークãƒã‚¤ãƒ³ãƒˆ/ウオッãƒãƒã‚¤ãƒ³ãƒˆã¯è¨­å®šã•れã¦ã„ã¾ã›ã‚“" #: command.y:343 msgid "invalid breakpoint/watchpoint number" -msgstr "" +msgstr "無効ãªãƒ–レークãƒã‚¤ãƒ³ãƒˆ/ウオッãƒãƒã‚¤ãƒ³ãƒˆç•ªå·ã§ã™" #: command.y:348 #, c-format @@ -991,51 +985,49 @@ msgid "`silent' valid only in command `commands'" msgstr "" #: command.y:373 -#, fuzzy, c-format +#, c-format msgid "trace: invalid option - \"%s\"" -msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n" +msgstr "trace: 無効ãªã‚ªãƒ—ション - \"%s\"" #: command.y:387 msgid "condition: invalid breakpoint/watchpoint number" msgstr "" #: command.y:449 -#, fuzzy msgid "argument not a string" -msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" +msgstr "å¼•æ•°ãŒæ–‡å­—列ã§ã¯ã‚りã¾ã›ã‚“" #: command.y:459 command.y:464 #, c-format msgid "option: invalid parameter - \"%s\"" -msgstr "" +msgstr "option: 無効ãªãƒ‘ラメーター - \"%s\"" #: command.y:474 #, c-format msgid "no such function - \"%s\"" -msgstr "" +msgstr "ãã®ã‚ˆã†ãªé–¢æ•°ã¯ã‚りã¾ã›ã‚“ - \"%s\"" #: command.y:531 -#, fuzzy, c-format +#, c-format msgid "enable: invalid option - \"%s\"" -msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n" +msgstr "enable: 無効ãªã‚ªãƒ—ション - \"%s\"" #: command.y:597 -#, fuzzy, c-format +#, c-format msgid "invalid range specification: %d - %d" -msgstr "無効ãªç¯„囲終了ã§ã™" +msgstr "無効ãªç¯„囲指定: %d - %d" #: command.y:659 -#, fuzzy msgid "non-numeric value for field number" -msgstr "フィールド指定ã«ä¸æ˜Žãªå€¤ãŒã‚りã¾ã™: %d\n" +msgstr "フィールド番å·ã«å¯¾ã—ã¦éžæ•°å€¤ãŒæŒ‡å®šã•れã¦ã„ã¾ã™" #: command.y:680 command.y:687 msgid "non-numeric value found, numeric expected" -msgstr "" +msgstr "éžæ•°å€¤ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚数値ãŒäºˆæœŸã•れã¾ã™ã€‚" #: command.y:712 command.y:718 msgid "non-zero integer value" -msgstr "" +msgstr "éžã‚¼ãƒ­æ•´æ•°" #: command.y:817 msgid "" @@ -1243,9 +1235,8 @@ msgid "%s" msgstr "" #: command.y:1284 -#, fuzzy msgid "invalid character" -msgstr "無効ãªç…§åˆæ–‡å­—ã§ã™" +msgstr "ç„¡åŠ¹ãªæ–‡å­—ã§ã™" #: command.y:1455 #, c-format @@ -1417,9 +1408,9 @@ msgid "" msgstr "" #: debug.c:1029 -#, fuzzy, c-format +#, c-format msgid "no symbol `%s' in current context\n" -msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“" +msgstr "" #: debug.c:1041 debug.c:1427 #, fuzzy, c-format @@ -1709,7 +1700,7 @@ msgstr "" #: debug.c:3424 #, fuzzy, c-format msgid "element not in array\n" -msgstr "delete: é…列 `%2$s' 内ã«ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ `%1$s' ãŒã‚りã¾ã›ã‚“" +msgstr "adump: 引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" #: debug.c:3424 #, c-format @@ -1754,14 +1745,13 @@ msgid "invalid number" msgstr "" #: debug.c:5381 -#, fuzzy, c-format +#, c-format msgid "`%s' not allowed in current context; statement ignored" -msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“" +msgstr "" #: debug.c:5389 -#, fuzzy msgid "`return' not allowed in current context; statement ignored" -msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“" +msgstr "" #: debug.c:5590 #, c-format @@ -2002,32 +1992,31 @@ msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: 関数 `%s' ã®å¼•æ•°ã®æ•°ãŒè² ã§ã™" #: ext.c:276 -#, fuzzy msgid "extension: missing function name" msgstr "extension: 関数åãŒã‚りã¾ã›ã‚“" #: ext.c:279 ext.c:283 -#, fuzzy, c-format +#, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: 関数å `%2$s' ã®ä¸­ã§ä¸æ­£ãªæ–‡å­— `%1$c' ãŒä½¿ç”¨ã•れã¦ã„ã¾ã™" #: ext.c:291 -#, fuzzy, c-format +#, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: 関数 `%s' ã‚’å†å®šç¾©ã§ãã¾ã›ã‚“" #: ext.c:295 -#, fuzzy, c-format +#, c-format msgid "extension: function `%s' already defined" msgstr "extension: 関数 `%s' ã¯æ—¢ã«å®šç¾©ã•れã¦ã„ã¾ã™" #: ext.c:299 -#, fuzzy, c-format +#, c-format msgid "extension: function name `%s' previously defined" -msgstr "関数å `%s' ã¯å‰ã«å®šç¾©ã•れã¦ã„ã¾ã™" +msgstr "extension: 関数å `%s' ã¯å‰ã«å®šç¾©ã•れã¦ã„ã¾ã™" #: ext.c:301 -#, fuzzy, c-format +#, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: gawk ã«çµ„ã¿è¾¼ã¾ã‚Œã¦ã„ã‚‹ `%s' ã¯é–¢æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" @@ -2076,9 +2065,9 @@ msgid "stat: bad parameters" msgstr "%s: 仮引数ã§ã™\n" #: extension/filefuncs.c:533 -#, fuzzy, c-format +#, c-format msgid "fts init: could not create variable %s" -msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–りã¾ã—ãŸ" +msgstr "" #: extension/filefuncs.c:554 #, fuzzy @@ -2094,9 +2083,8 @@ msgid "fill_stat_element: could not set element" msgstr "" #: extension/filefuncs.c:597 -#, fuzzy msgid "fill_path_element: could not set element" -msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–りã¾ã—ãŸ" +msgstr "" #: extension/filefuncs.c:613 msgid "fill_error_element: could not set element" @@ -2108,9 +2096,8 @@ msgstr "" #: extension/filefuncs.c:670 extension/filefuncs.c:717 #: extension/filefuncs.c:735 -#, fuzzy msgid "fts-process: could not set element" -msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–りã¾ã—ãŸ" +msgstr "" #: extension/filefuncs.c:784 #, fuzzy @@ -2133,9 +2120,8 @@ msgid "fts: bad third parameter" msgstr "%s: 仮引数ã§ã™\n" #: extension/filefuncs.c:806 -#, fuzzy msgid "fts: could not flatten array\n" -msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™" +msgstr "" #: extension/filefuncs.c:824 msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah." @@ -2234,9 +2220,9 @@ msgid "inplace_begin: Cannot stat `%s' (%s)" msgstr "致命的: extension: `%s' ã‚’é–‹ãã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ (%s)\n" #: extension/inplace.c:158 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: `%s' is not a regular file" -msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™" +msgstr "" #: extension/inplace.c:169 #, c-format @@ -2379,7 +2365,7 @@ msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" #: extension/rwarray.c:293 #, fuzzy, c-format msgid "do_reada: argument 1 is not an array\n" -msgstr "match: 第三引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" +msgstr "adump: 引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" #: extension/rwarray.c:337 #, c-format @@ -3288,17 +3274,17 @@ msgstr "" #: mpfr.c:857 #, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" -msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: mpfr.c:863 #, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" -msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +msgstr "and(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #: mpfr.c:878 #, fuzzy, c-format msgid "%s: argument #%d negative value %Zd will give strange results" -msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" #: msg.c:68 #, c-format @@ -3490,50 +3476,27 @@ msgstr "以å‰ã«æ­£è¦è¡¨ç¾ãŒã‚りã¾ã›ã‚“" msgid "can not pop main context" msgstr "" -#, fuzzy -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "`[%c-%c]' å½¢å¼ã®ç¯„囲ã¯ãƒ­ã‚±ãƒ¼ãƒ«ä¾å­˜ã§ã™" - -#, fuzzy -#~ msgid "[s]printf called with no arguments" -#~ msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" - -#~ msgid "`-m[fr]' option irrelevant in gawk" -#~ msgstr "gawk ã§ã¯ã‚ªãƒ—ション `-m[fr]' ã«åŠ¹æžœã¯ã‚りã¾ã›ã‚“。" - -#~ msgid "-m option usage: `-m[fr] nnn'" -#~ msgstr "-m オプションã®ä½¿ç”¨æ³•: `-m[fr] 数値'" - -#, fuzzy -#~ msgid "%s: received non-numeric first argument" -#~ msgstr "or: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" - -#, fuzzy -#~ msgid "%s: received non-numeric second argument" -#~ msgstr "or: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" +#~ msgid "attempt to use function `%s' as an array" +#~ msgstr "関数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" -#, fuzzy -#~ msgid "%s(%Rg, ..): negative values will give strange results" -#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" +#~ msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„è¦ç´  `%s[\"%.*s\"]' ã¸ã®å‚ç…§ã§ã™" -#, fuzzy -#~ msgid "%s(%Rg, ..): fractional values will be truncated" -#~ msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +#~ msgid "subscript of array `%s' is null string" +#~ msgstr "é…列 `%s' ã®æ·»å­—㌠NULL 文字列ã§ã™" -#, fuzzy -#~ msgid "%s(%Zd, ..): negative values will give strange results" -#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +#~ msgid "%s: empty (null)\n" +#~ msgstr "%s: 空 (null)\n" -#, fuzzy -#~ msgid "%s(.., %Rg): negative values will give strange results" -#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +#~ msgid "%s: empty (zero)\n" +#~ msgstr "%s: 空 (zero)\n" -#, fuzzy -#~ msgid "%s(.., %Zd): negative values will give strange results" -#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" +#~ msgid "%s: table_size = %d, array_size = %d\n" +#~ msgstr "" +#~ "%s: テーブルサイズ (table_size) = %d, é…列サイズ (array_size) = %d\n" -#~ msgid "`%s' is a Bell Labs extension" -#~ msgstr "`%s' ã¯ãƒ™ãƒ«ç ”究所ã«ã‚ˆã‚‹æ‹¡å¼µã§ã™" +#~ msgid "%s: array_ref to %s\n" +#~ msgstr "%s: %s ã¸ã®é…列å‚ç…§ (array_ref) ã§ã™\n" #~ msgid "`nextfile' is a gawk extension" #~ msgstr "`nextfile' 㯠gawk æ‹¡å¼µã§ã™" @@ -3541,14 +3504,29 @@ msgstr "" #~ msgid "`delete array' is a gawk extension" #~ msgstr "`delete array' 㯠gawk æ‹¡å¼µã§ã™" +#~ msgid "use of non-array as array" +#~ msgstr "é…列ã§ãªã„ã‚‚ã®ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã—ã¦ã„ã¾ã™" + +#~ msgid "`%s' is a Bell Labs extension" +#~ msgstr "`%s' ã¯ãƒ™ãƒ«ç ”究所ã«ã‚ˆã‚‹æ‹¡å¼µã§ã™" + #~ msgid "and: received non-numeric first argument" #~ msgstr "and: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" #~ msgid "and: received non-numeric second argument" #~ msgstr "and: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#~ msgid "and(%lf, %lf): fractional values will be truncated" -#~ msgstr "and(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" +#~ msgid "or: received non-numeric first argument" +#~ msgstr "or: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" + +#~ msgid "or: received non-numeric second argument" +#~ msgstr "or: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" + +#~ msgid "or(%lf, %lf): negative values will give strange results" +#~ msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" + +#~ msgid "or(%lf, %lf): fractional values will be truncated" +#~ msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" #~ msgid "xor: received non-numeric first argument" #~ msgstr "xor: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" @@ -3559,37 +3537,12 @@ msgstr "" #~ msgid "xor(%lf, %lf): fractional values will be truncated" #~ msgstr "xor(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" -#~ msgid "Operation Not Supported" -#~ msgstr "ã“ã®æ“作ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“" - -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "関数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" - -#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" -#~ msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„è¦ç´  `%s[\"%.*s\"]' ã¸ã®å‚ç…§ã§ã™" - -#~ msgid "subscript of array `%s' is null string" -#~ msgstr "é…列 `%s' ã®æ·»å­—㌠NULL 文字列ã§ã™" - -#~ msgid "%s: empty (null)\n" -#~ msgstr "%s: 空 (null)\n" - -#~ msgid "%s: empty (zero)\n" -#~ msgstr "%s: 空 (zero)\n" - -#~ msgid "%s: table_size = %d, array_size = %d\n" -#~ msgstr "" -#~ "%s: テーブルサイズ (table_size) = %d, é…列サイズ (array_size) = %d\n" - -#~ msgid "%s: array_ref to %s\n" -#~ msgstr "%s: %s ã¸ã®é…列å‚ç…§ (array_ref) ã§ã™\n" - -#~ msgid "use of non-array as array" -#~ msgstr "é…列ã§ãªã„ã‚‚ã®ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã—ã¦ã„ã¾ã™" - #~ msgid "can't use function name `%s' as variable or array" #~ msgstr "関数å `%s' ã¯å¤‰æ•°ã¾ãŸã¯é…列ã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" +#~ msgid "assignment is not allowed to result of builtin function" +#~ msgstr "çµ„è¾¼é–¢æ•°ã®æˆ»ã‚Šå€¤ã¸ã®ä»£å…¥ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" + #~ msgid "assignment used in conditional context" #~ msgstr "æ¡ä»¶ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆå†…ã§ä»£å…¥ãŒä½¿ç”¨ã•れã¾ã—ãŸ" @@ -3620,11 +3573,20 @@ msgstr "" #~ msgid "Sorry, don't know how to interpret `%s'" #~ msgstr "申ã—訳ã‚りã¾ã›ã‚“㌠`%s' ã‚’ã©ã®ã‚ˆã†ã«è§£é‡ˆã™ã‚‹ã‹åˆ†ã‹ã‚Šã¾ã›ã‚“" +#~ msgid "Operation Not Supported" +#~ msgstr "ã“ã®æ“作ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“" + +#~ msgid "`-m[fr]' option irrelevant in gawk" +#~ msgstr "gawk ã§ã¯ã‚ªãƒ—ション `-m[fr]' ã«åŠ¹æžœã¯ã‚りã¾ã›ã‚“。" + +#~ msgid "-m option usage: `-m[fr] nnn'" +#~ msgstr "-m オプションã®ä½¿ç”¨æ³•: `-m[fr] 数値'" + #~ msgid "\t-R file\t\t\t--command=file\n" #~ msgstr "\t-R file\t\t\t--command=file\n" #~ msgid "could not find groups: %s" #~ msgstr "グループãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“: %s" -#~ msgid "assignment is not allowed to result of builtin function" -#~ msgstr "çµ„è¾¼é–¢æ•°ã®æˆ»ã‚Šå€¤ã¸ã®ä»£å…¥ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" +#~ msgid "range of the form `[%c-%c]' is locale dependant" +#~ msgstr "`[%c-%c]' å½¢å¼ã®ç¯„囲ã¯ãƒ­ã‚±ãƒ¼ãƒ«ä¾å­˜ã§ã™" -- cgit v1.2.3 From 90001d0580cdba35ed3813396a095bd9f5a9345e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 19 Nov 2014 18:45:44 +0200 Subject: Upgrade infrastructure (automake, gettext, libtool). --- ChangeLog | 11 ++ Makefile.in | 22 ++- NEWS | 2 + aclocal.m4 | 122 +++++++++++- awklib/Makefile.in | 7 +- compile | 347 ++++++++++++++++++++++++++++++++++ config.rpath | 16 +- configure | 422 ++++++++++++++++++++++++++++++++++-------- configure.ac | 4 +- doc/Makefile.in | 11 +- extension/Makefile.in | 27 ++- extension/aclocal.m4 | 127 ++++++++++++- extension/build-aux/compile | 347 ++++++++++++++++++++++++++++++++++ extension/build-aux/ltmain.sh | 354 +++++++++++++++++++++++------------ extension/configure | 249 +++++++++++++++++++++---- extension/m4/libtool.m4 | 96 +++++++--- extension/m4/ltoptions.m4 | 2 +- extension/m4/ltsugar.m4 | 7 +- extension/m4/ltversion.m4 | 12 +- extension/m4/lt~obsolete.m4 | 7 +- m4/ChangeLog | 11 ++ m4/gettext.m4 | 58 ++++-- m4/iconv.m4 | 110 ++++++++--- m4/lib-ld.m4 | 77 ++++---- m4/lib-link.m4 | 43 +++-- m4/lib-prefix.m4 | 2 +- m4/nls.m4 | 2 +- m4/po.m4 | 36 ++-- m4/progtest.m4 | 21 +-- po/ChangeLog | 5 + po/Makefile.in.in | 53 ++++-- po/Makevars | 39 +++- po/Makevars.template | 37 ++++ po/Rules-quot | 15 +- test/Makefile.in | 3 +- 35 files changed, 2233 insertions(+), 471 deletions(-) create mode 100755 compile create mode 100755 extension/build-aux/compile diff --git a/ChangeLog b/ChangeLog index 67b36937..fddd2879 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2014-11-19 Arnold D. Robbins + + Infrastructure upgrades: + + * Automake 1.14.1, Gettext 0.19.3, Libtool 2.4.3. + * compile, extension/build-aux/compile: New files. + +2014-11-19 gettextize + + * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.3. + 2014-11-16 Arnold D. Robbins * interpret.h: Revert change of 2014-11-11 since it breaks diff --git a/Makefile.in b/Makefile.in index 39143e2e..3f19f5fd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -107,7 +107,7 @@ 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 \ + command.c depcomp ylwrap $(include_HEADERS) COPYING 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 \ @@ -363,6 +363,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ @@ -588,8 +589,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/configh.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -689,14 +690,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) @@ -910,10 +911,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives 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: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -955,9 +962,10 @@ distcheck: dist && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ diff --git a/NEWS b/NEWS index d6a69af4..673c1cda 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,8 @@ 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. + XX. A number of bugs have been fixed. See the ChangeLog. Changes from 4.1.0 to 4.1.1 diff --git a/aclocal.m4 b/aclocal.m4 index 4099cd7e..8907206b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -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.13' +[am__api_version='1.14' 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.13.4], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,7 +51,7 @@ 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.13.4])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -418,6 +418,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -526,7 +532,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) 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 @@ -534,7 +581,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -716,6 +762,70 @@ 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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. diff --git a/awklib/Makefile.in b/awklib/Makefile.in index eb707f6c..8555206c 100644 --- a/awklib/Makefile.in +++ b/awklib/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -277,6 +277,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ @@ -479,14 +480,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique diff --git a/compile b/compile new file mode 100755 index 00000000..531136b0 --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.rpath b/config.rpath index ab6fd995..b625621f 100755 --- a/config.rpath +++ b/config.rpath @@ -367,11 +367,7 @@ else dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; - freebsd2.2*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - freebsd2*) + freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; @@ -548,13 +544,11 @@ case "$host_os" in dgux*) library_names_spec='$libname$shrext' ;; + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' + ;; freebsd* | dragonfly*) - case "$host_os" in - freebsd[123]*) - library_names_spec='$libname$shrext$versuffix' ;; - *) - library_names_spec='$libname$shrext' ;; - esac + library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' diff --git a/configure b/configure index 555cba29..e80e21c3 100755 --- a/configure +++ b/configure @@ -657,6 +657,7 @@ GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS +SED pkgextensiondir acl_shlibext LN_S @@ -1420,7 +1421,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-whiny-user-strftime Force use of included version of strftime for deficient systems - --with-gnu-ld assume the C compiler uses GNU ld default=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 @@ -2591,7 +2592,7 @@ then fi -am__api_version='1.13' +am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -3157,6 +3158,47 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi @@ -4118,6 +4160,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -5366,6 +5467,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -6027,6 +6187,75 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } @@ -6043,7 +6272,7 @@ $as_echo "$USE_NLS" >&6; } - GETTEXT_MACRO_VERSION=0.18 + GETTEXT_MACRO_VERSION=0.19 @@ -6051,15 +6280,14 @@ $as_echo "$USE_NLS" >&6; } # 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 + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, @@ -6174,15 +6402,14 @@ 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 + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, @@ -6252,15 +6479,14 @@ 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 + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, @@ -6344,6 +6570,7 @@ fi prefix="$acl_save_prefix" + # 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 @@ -6354,21 +6581,21 @@ 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 + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } 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; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -6378,11 +6605,11 @@ $as_echo_n "checking for ld used by GCC... " >&6; } 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 + # Canonicalize the pathname 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" @@ -6407,23 +6634,26 @@ 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-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" 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. + # but apparently some variants of GNU ld 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 + case `"$acl_cv_path_LD" -v 2>&1 &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. + # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 @@ -6631,7 +6863,7 @@ fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -7160,15 +7392,19 @@ if eval \${$gt_func_gnugettext_libc+:} false; then : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include $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; } @@ -7226,14 +7462,16 @@ else am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include #include + int main () { iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); ; return 0; } @@ -7248,14 +7486,16 @@ rm -f core conftest.err conftest.$ac_objext \ LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include #include + int main () { iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); ; return 0; } @@ -7279,15 +7519,17 @@ if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else - am_save_LIBS="$LIBS" + 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 + + 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. */ @@ -7296,6 +7538,7 @@ else #include int main () { + int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { @@ -7312,7 +7555,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 1; + iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from @@ -7331,7 +7575,27 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + 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 char buf[2] = { (char)0xDE, (char)0xAD }; + 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, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ @@ -7350,7 +7614,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) - return 1; + result |= 8; + iconv_close (cd_88591_to_utf8); } } #endif @@ -7364,8 +7629,8 @@ int main () && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; + result |= 16; + return result; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -7482,7 +7747,7 @@ fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -7880,6 +8145,7 @@ else LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include $gt_revision_test_code extern int _nl_msg_cat_cntr; @@ -7888,11 +8154,14 @@ extern "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; } @@ -7908,6 +8177,7 @@ rm -f core conftest.err conftest.$ac_objext \ LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include $gt_revision_test_code extern int _nl_msg_cat_cntr; @@ -7916,19 +8186,22 @@ extern "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" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ @@ -9540,7 +9813,7 @@ fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -12461,7 +12734,7 @@ $as_echo X"$file" | 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_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. @@ -12477,7 +12750,8 @@ $as_echo X"$file" | 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" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/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 @@ -12488,12 +12762,12 @@ $as_echo X"$file" | 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. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES diff --git a/configure.ac b/configure.ac index ed7e3ccd..618dd7dc 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ then fi AC_PREREQ(2.69) -AM_INIT_AUTOMAKE([1.13 dist-xz dist-lzip]) +AM_INIT_AUTOMAKE([1.14 dist-xz dist-lzip]) AC_CONFIG_MACRO_DIR([m4]) @@ -138,7 +138,7 @@ AC_LANG([C]) dnl initialize GNU gettext AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.18.1]) +AM_GNU_GETTEXT_VERSION([0.19.3]) AM_LANGINFO_CODESET gt_LC_MESSAGES diff --git a/doc/Makefile.in b/doc/Makefile.in index abaf5601..b8743d28 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -276,6 +276,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ @@ -451,13 +452,9 @@ $(am__aclocal_m4_deps): $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ - rm -rf $@; \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ - exit 1; \ + rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/gawk.info: gawk.texi gawk.dvi: gawk.texi diff --git a/extension/Makefile.in b/extension/Makefile.in index e08c6de2..2596d282 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -107,10 +107,10 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(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/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 \ + 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 \ @@ -627,8 +627,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/configh.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -738,14 +738,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -993,10 +993,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives 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: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -1038,9 +1044,10 @@ distcheck: dist && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ diff --git a/extension/aclocal.m4 b/extension/aclocal.m4 index 7e987650..cd7f9c16 100644 --- a/extension/aclocal.m4 +++ b/extension/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -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.13' +[am__api_version='1.14' 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.13.4], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,7 +51,7 @@ 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.13.4])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -76,7 +76,8 @@ AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [am_cv_ar_interface=ar + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) @@ -93,7 +94,7 @@ AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], fi rm -f conftest.lib libconftest.a ]) - ]) + AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) @@ -477,6 +478,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -585,7 +592,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) 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 @@ -593,7 +641,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -775,6 +822,70 @@ 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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. diff --git a/extension/build-aux/compile b/extension/build-aux/compile new file mode 100755 index 00000000..531136b0 --- /dev/null +++ b/extension/build-aux/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/extension/build-aux/ltmain.sh b/extension/build-aux/ltmain.sh index a50a21a6..555b7637 100644 --- a/extension/build-aux/ltmain.sh +++ b/extension/build-aux/ltmain.sh @@ -1,10 +1,12 @@ #! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.2.418 +# libtool (GNU libtool) 2.4.3 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 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. @@ -29,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.2.418 -package_revision=2.4.2.418 +VERSION=2.4.3 +package_revision=2.4.3 ## ------ ## @@ -62,12 +64,12 @@ package_revision=2.4.2.418 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2013-08-23.20; # UTC +scriptversion=2014-01-03.01; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 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. @@ -147,47 +149,157 @@ nl=' ' IFS="$sp $nl" -# There are still modern systems that have problems with 'echo' mis- -# handling backslashes, among others, so make sure $bs_echo is set to a -# command that correctly interprets backslashes. -# (this code from Autoconf 2.68) - -# Printing a long string crashes Solaris 7 /usr/bin/printf. -bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo -bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then - bs_echo='print -r --' - bs_echo_n='print -rn --' -elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then - bs_echo='printf %s\n' - bs_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then - bs_echo_body='eval /usr/ucb/echo -n "$1$nl"' - bs_echo_n='/usr/ucb/echo -n' - else - bs_echo_body='eval expr "X$1" : "X\\(.*\\)"' - bs_echo_n_body='eval - arg=$1; - case $arg in #( - *"$nl"*) - expr "X$arg" : "X\\(.*\\)$nl"; - arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$nl" - ' - export bs_echo_n_body - bs_echo_n='sh -c $bs_echo_n_body bs_echo' - fi - export bs_echo_body - bs_echo='sh -c $bs_echo_body bs_echo' +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## @@ -198,16 +310,14 @@ fi # in the command search PATH. : ${CP="cp -f"} -: ${ECHO="$bs_echo"} -: ${EGREP="grep -E"} -: ${FGREP="grep -F"} -: ${GREP="grep"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} @@ -298,13 +408,13 @@ exit_status=$EXIT_SUCCESS progpath=$0 # The name of this program. -progname=`$bs_echo "$progpath" |$SED "$sed_basename"` +progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) - progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"` + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; @@ -498,7 +608,7 @@ func_append_uniq () { $debug_cmd - eval _G_current_value='`$bs_echo $'$1'`' + eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in @@ -611,7 +721,7 @@ func_echo () IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS - $bs_echo "$progname: $_G_line" + $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } @@ -645,17 +755,17 @@ func_echo_infix_1 () for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { - _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"` - _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"` + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done - _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS - $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS @@ -1232,56 +1342,40 @@ func_sort_ver () { $debug_cmd - ver1=$1 - ver2=$2 + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} - # Split on '.' and compare each component. - i=1 - while :; do - p1=`echo "$ver1" |cut -d. -f$i` - p2=`echo "$ver2" |cut -d. -f$i` - if test ! "$p1"; then - echo "$1 $2" - break - elif test ! "$p2"; then - echo "$2 $1" - break - elif test ! "$p1" = "$p2"; then - if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison - echo "$2 $1" - elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison - echo "$1 $2" - else # numeric, then lexicographic comparison - lp=`printf "$p1\n$p2\n" |sort -n |tail -n1` - if test "$lp" = "$p2"; then - echo "$1 $2" - else - echo "$2 $1" - fi - fi - break - fi - i=`expr $i + 1` - done +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. -scriptversion=2012-10-21.11; # UTC +scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 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. @@ -1421,7 +1515,7 @@ func_remove_hook () { $debug_cmd - eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`' + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } @@ -1698,9 +1792,9 @@ func_validate_options () -## ------------------## +## ----------------- ## ## Helper functions. ## -## ------------------## +## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. @@ -1714,8 +1808,8 @@ func_fatal_help () { $debug_cmd - eval \$bs_echo \""Usage: $usage"\" - eval \$bs_echo \""$fatal_help"\" + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } @@ -1729,7 +1823,7 @@ func_help () $debug_cmd func_usage_message - $bs_echo "$long_help_message" + $ECHO "$long_help_message" exit 0 } @@ -1816,7 +1910,7 @@ func_usage () $debug_cmd func_usage_message - $bs_echo "Run '$progname --help |${PAGER-more}' for full usage" + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } @@ -1828,7 +1922,7 @@ func_usage_message () { $debug_cmd - eval \$bs_echo \""Usage: $usage"\" + eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ @@ -1837,7 +1931,7 @@ func_usage_message () h /^Written by/q' < "$progpath" echo - eval \$bs_echo \""$usage_message"\" + eval \$ECHO \""$usage_message"\" } @@ -1849,7 +1943,7 @@ func_version () $debug_cmd printf '%s\n' "$progname $scriptversion" - $SED -n '/^##/q + $SED -n ' /(C)/!b go :more /\./!{ @@ -1877,13 +1971,13 @@ func_version () # Local variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.2.418' +scriptversion='(GNU libtool) 2.4.3' # func_echo ARG... @@ -1900,7 +1994,7 @@ func_echo () IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS - $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line" + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } @@ -1969,7 +2063,7 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.2.418 + version: $progname (GNU libtool) 2.4.3 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2315,7 +2409,9 @@ libtool_validate_options () test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) + # 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*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; @@ -2386,6 +2482,14 @@ $1 _LTECHO_EOF' } +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out @@ -2393,8 +2497,7 @@ _LTECHO_EOF' func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file @@ -2426,7 +2529,8 @@ func_lalib_unsafe_p () # determined imposters. func_ltwrapper_script_p () { - func_lalib_p "$1" + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file @@ -3696,7 +3800,7 @@ if $opt_help; then for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do @@ -3704,7 +3808,7 @@ if $opt_help; then func_mode_help done } | - sed '1d + $SED '1d /^When reporting/,/^Report/{ H d @@ -3894,7 +3998,7 @@ func_mode_finish () else tmpdir=`func_mktempdir` for lib in $libs; do - sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done @@ -4449,7 +4553,7 @@ func_generate_dlsyms () my_outputname=$1 my_originator=$2 my_pic_p=${3-false} - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then @@ -5322,7 +5426,7 @@ func_exec_program () if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else - $ECHO \"\$relink_command_output\" >&2 + \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi @@ -5554,7 +5658,12 @@ void lt_dump_script (FILE *f); EOF cat <&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3623,7 +3685,7 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } INSTALL="$ac_aux_dir/install-sh -c" export INSTALL -am__api_version='1.13' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3795,9 +3857,6 @@ 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` - if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) @@ -4351,6 +4410,47 @@ fi +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 @@ -6562,7 +6662,13 @@ $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_ar_interface=ar + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; @@ -6593,6 +6699,11 @@ if ac_fn_c_try_compile "$LINENO"; then : fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 @@ -6854,8 +6965,8 @@ esac -macro_version='2.4.2.418' -macro_revision='2.4.2.418' +macro_version='2.4.2.458.26-92994' +macro_revision='2.4.3' @@ -7244,8 +7355,13 @@ else # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; @@ -9003,6 +9119,71 @@ $as_echo "${lt_sysroot:-no}" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; @@ -9987,7 +10168,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) + 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; @@ -15282,6 +15463,7 @@ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_ lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' @@ -15402,6 +15584,7 @@ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ +lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ @@ -16319,39 +16502,34 @@ $as_echo X"$file" | cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 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. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # The names of the tagged configurations supported by this script. @@ -16510,6 +16688,9 @@ nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + # The name of the directory that contains temporary libtool files. objdir=$objdir diff --git a/extension/m4/libtool.m4 b/extension/m4/libtool.m4 index 4bc6b22c..068f0d8b 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-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2014 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -8,33 +8,27 @@ # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. +# Copyright (C) 2014 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. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . ]) # serial 58 LT_INIT @@ -65,7 +59,7 @@ esac # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -175,6 +169,7 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our @@ -715,12 +710,13 @@ _LT_CONFIG_SAVE_COMMANDS([ cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. -# + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + _LT_COPYING _LT_LIBTOOL_TAGS @@ -1047,7 +1043,7 @@ _LT_EOF case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) + 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; @@ -3221,6 +3217,43 @@ _LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD +# _LT_PATH_DD +# ----------- +# find a working dd +m4_defun([_LT_PATH_DD], +[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies @@ -3476,8 +3509,13 @@ else # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; diff --git a/extension/m4/ltoptions.m4 b/extension/m4/ltoptions.m4 index 50c77236..de6520ed 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-2013 Free Software +# Copyright (C) 2004-2005, 2007-2009, 2011-2014 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff --git a/extension/m4/ltsugar.m4 b/extension/m4/ltsugar.m4 index 9000a057..da4ac6b3 100644 --- a/extension/m4/ltsugar.m4 +++ b/extension/m4/ltsugar.m4 @@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2014 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ m4_define([_lt_join], # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -44,7 +45,7 @@ m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different diff --git a/extension/m4/ltversion.m4 b/extension/m4/ltversion.m4 index daeb0af7..3535ff40 100644 --- a/extension/m4/ltversion.m4 +++ b/extension/m4/ltversion.m4 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2014 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 4038 ltversion.m4 +# serial 4105 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2.418]) -m4_define([LT_PACKAGE_REVISION], [2.4.2.418]) +m4_define([LT_PACKAGE_VERSION], [2.4.2.458.26-92994]) +m4_define([LT_PACKAGE_REVISION], [2.4.3]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2.418' -macro_revision='2.4.2.418' +[macro_version='2.4.2.458.26-92994' +macro_revision='2.4.3' _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 c573da90..6975098b 100644 --- a/extension/m4/lt~obsolete.m4 +++ b/extension/m4/lt~obsolete.m4 @@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2014 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -25,7 +26,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff --git a/m4/ChangeLog b/m4/ChangeLog index 17c482cb..9ef76c4f 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,14 @@ +2014-11-19 gettextize + + * gettext.m4: Upgrade to gettext-0.19.3. + * iconv.m4: Upgrade to gettext-0.19.3. + * lib-ld.m4: Upgrade to gettext-0.19.3. + * lib-link.m4: Upgrade to gettext-0.19.3. + * lib-prefix.m4: Upgrade to gettext-0.19.3. + * nls.m4: Upgrade to gettext-0.19.3. + * po.m4: Upgrade to gettext-0.19.3. + * progtest.m4: Upgrade to gettext-0.19.3. + 2014-10-30 Arnold D. Robbins * readline.m4: Enable cross compiling. Thanks to diff --git a/m4/gettext.m4 b/m4/gettext.m4 index f84e6a5d..be247bf7 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 63 (gettext-0.18) -dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. +# gettext.m4 serial 66 (gettext-0.18.2) +dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -35,7 +35,7 @@ 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 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 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 @@ -97,7 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT], AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) - dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. + dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. @@ -157,12 +157,18 @@ changequote([,])dnl fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], - [AC_TRY_LINK([#include + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $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], +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"])]) @@ -183,35 +189,47 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. - AC_TRY_LINK([#include + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $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 ("")], +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 + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $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" - ]) +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"]) diff --git a/m4/iconv.m4 b/m4/iconv.m4 index e2041b9b..4b29c5f2 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial 11 (gettext-0.18.1) -dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. +# iconv.m4 serial 18 (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, dnl with or without modifications, as long as this notice is preserved. @@ -30,27 +30,35 @@ AC_DEFUN([AM_ICONV_LINK], 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. + dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE 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 -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[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 -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[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" @@ -58,16 +66,19 @@ AC_DEFUN([AM_ICONV_LINK], ]) 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. + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include int main () { + int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { @@ -84,7 +95,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 1; + iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from @@ -103,7 +115,27 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + 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 char buf[2] = { (char)0xDE, (char)0xAD }; + 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, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ @@ -122,7 +154,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) - return 1; + result |= 8; + iconv_close (cd_88591_to_utf8); } } #endif @@ -136,13 +169,19 @@ int main () && 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 + 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]) + esac +changequote([,])dnl + ]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in @@ -183,32 +222,47 @@ m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])) + [m4_ifdef([gl_00GNULIB], + [[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([ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include extern #ifdef __cplusplus "C" #endif -#if defined(__STDC__) || defined(__cplusplus) +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif -], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) + ]], + [[]])], + [am_cv_proto_iconv_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.]) + dnl Also substitute ICONV_CONST in the gnulib generated . + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + ]) fi ]) diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 index ebb30528..ddc569f7 100644 --- a/m4/lib-ld.m4 +++ b/m4/lib-ld.m4 @@ -1,50 +1,56 @@ -# lib-ld.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. +# lib-ld.m4 serial 6 +dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +[# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 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 + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) + AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -54,11 +60,11 @@ if test "$GCC" = yes; then 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 + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname 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" @@ -79,23 +85,26 @@ else fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" 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. + # but apparently some variants of GNU ld 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 + case `"$acl_cv_path_LD" -v 2>&1 = 2.61 supports dots in --with options. - pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ @@ -242,7 +245,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 index 1601ceae..31f49e40 100644 --- a/m4/lib-prefix.m4 +++ b/m4/lib-prefix.m4 @@ -1,5 +1,5 @@ # lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2005, 2008-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/nls.m4 b/m4/nls.m4 index 003704c4..53cdc8be 100644 --- a/m4/nls.m4 +++ b/m4/nls.m4 @@ -1,5 +1,5 @@ # nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/po.m4 b/m4/po.m4 index 2c9532f0..84659ea5 100644 --- a/m4/po.m4 +++ b/m4/po.m4 @@ -1,5 +1,5 @@ -# po.m4 serial 17 (gettext-0.18) -dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. +# po.m4 serial 22 (gettext-0.19) +dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,7 +17,7 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ([2.50]) +AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], @@ -25,11 +25,12 @@ 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 + AC_REQUIRE([AC_PROG_SED])dnl 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]) + AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -102,7 +103,7 @@ changequote([,])dnl 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_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. @@ -118,7 +119,8 @@ changequote([,])dnl 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" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/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 @@ -129,12 +131,12 @@ changequote([,])dnl 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. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES @@ -226,7 +228,7 @@ AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|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. @@ -254,6 +256,7 @@ EOT fi # A sed script that extracts the value of VARIABLE from a Makefile. + tab=`printf '\t'` sed_x_variable=' # Test if the hold space is empty. x @@ -261,9 +264,9 @@ s/P/P/ x ta # Yes it was empty. Look if we have the expected variable definition. -/^[ ]*VARIABLE[ ]*=/{ +/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{ # Seen the first line of the variable definition. - s/^[ ]*VARIABLE[ ]*=// + s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=// ba } bd @@ -315,7 +318,7 @@ changequote([,])dnl 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. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) @@ -405,14 +408,15 @@ changequote([,])dnl 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" + tab=`printf '\t'` 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" <> "$ac_file.tmp" <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 + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, diff --git a/po/ChangeLog b/po/ChangeLog index a9cca765..022e5326 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,8 @@ +2014-11-19 gettextize + + * Makefile.in.in: Upgrade to gettext-0.19.3. + * Rules-quot: Upgrade to gettext-0.19.3. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 83d8838a..65184f65 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -8,13 +8,14 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.18 -GETTEXT_MACRO_VERSION = 0.18 +# Origin: gettext-0.19 +GETTEXT_MACRO_VERSION = 0.19 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +SED = @SED@ SHELL = /bin/sh @SET_MAKE@ @@ -76,6 +77,16 @@ POTFILES = \ CATALOGS = @CATALOGS@ +POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot +POFILESDEPS_yes = $(POFILESDEPS_) +POFILESDEPS_no = +POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) + +DISTFILESDEPS_ = update-po +DISTFILESDEPS_yes = $(DISTFILESDEPS_) +DISTFILESDEPS_no = +DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) + # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: @@ -96,14 +107,14 @@ CATALOGS = @CATALOGS@ mv t-$@ $@ -all: check-macro-version all-@USE_NLS@ +all: all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. -check-macro-version: - @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } @@ -123,6 +134,7 @@ check-macro-version: # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot + @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ @@ -137,11 +149,29 @@ stamp-po: $(srcdir)/$(DOMAIN).pot # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed - if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ - package_gnu='GNU '; \ + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ + -size -10000000c -exec grep 'GNU @PACKAGE@' \ + /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ else \ - package_gnu=''; \ + package_prefix=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ @@ -161,7 +191,7 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --package-name="$${package_gnu}@PACKAGE@" \ + --package-name="$${package_prefix}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ @@ -189,9 +219,10 @@ $(srcdir)/$(DOMAIN).pot: # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. -$(POFILES): $(srcdir)/$(DOMAIN).pot +$(POFILES): $(POFILESDEPS) @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ + test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ @@ -352,7 +383,7 @@ maintainer-clean: distclean distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: - $(MAKE) update-po + test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) diff --git a/po/Makevars b/po/Makevars index c5a271db..4293de4e 100644 --- a/po/Makevars +++ b/po/Makevars @@ -20,6 +20,13 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = + # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines @@ -34,8 +41,38 @@ COPYRIGHT_HOLDER = Free Software Foundation, Inc. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. -MSGID_BUGS_ADDRESS = arnold@skeeve.com +MSGID_BUGS_ADDRESS = bug-gawk@gnu.org # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +# This tells whether or not to regenerate a PO file when $(DOMAIN).pot +# has changed. Possible values are "yes" and "no". Set this to no if +# the POT file is checked in the repository and the version control +# program ignores timestamps. +PO_DEPENDS_ON_POT = yes + +# This tells whether or not to forcibly update $(DOMAIN).pot and +# regenerate PO files on "make dist". Possible values are "yes" and +# "no". Set this to no if the POT file and PO files are maintained +# externally. +DIST_DEPENDS_ON_UPDATE_PO = yes diff --git a/po/Makevars.template b/po/Makevars.template index 32692ab4..0648ec75 100644 --- a/po/Makevars.template +++ b/po/Makevars.template @@ -20,6 +20,13 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = + # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines @@ -39,3 +46,33 @@ MSGID_BUGS_ADDRESS = # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +# This tells whether or not to regenerate a PO file when $(DOMAIN).pot +# has changed. Possible values are "yes" and "no". Set this to no if +# the POT file is checked in the repository and the version control +# program ignores timestamps. +PO_DEPENDS_ON_POT = yes + +# This tells whether or not to forcibly update $(DOMAIN).pot and +# regenerate PO files on "make dist". Possible values are "yes" and +# "no". Set this to no if the POT file and PO files are maintained +# externally. +DIST_DEPENDS_ON_UPDATE_PO = yes diff --git a/po/Rules-quot b/po/Rules-quot index af524879..9dc96307 100644 --- a/po/Rules-quot +++ b/po/Rules-quot @@ -1,3 +1,4 @@ +# This file, Rules-quot, can be copied and used freely without restrictions. # Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot @@ -14,13 +15,23 @@ en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ - if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ - if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ + | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ + { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ + $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ + ;; \ + *) \ + $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ + ;; \ + esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ + ; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ diff --git a/test/Makefile.in b/test/Makefile.in index a337288b..62dd0666 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -205,6 +205,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ -- cgit v1.2.3 From e13c76601a232b24c99a452d8f3403f87f069c22 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 19 Nov 2014 18:48:53 +0200 Subject: Bump version. --- configure | 20 ++++++++++---------- configure.ac | 2 +- pc/config.h | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/configure b/configure index e80e21c3..77a80dff 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU Awk 4.1.1a. +# Generated by GNU Autoconf 2.69 for GNU Awk 4.1.1b. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GNU Awk' PACKAGE_TARNAME='gawk' -PACKAGE_VERSION='4.1.1a' -PACKAGE_STRING='GNU Awk 4.1.1a' +PACKAGE_VERSION='4.1.1b' +PACKAGE_STRING='GNU Awk 4.1.1b' PACKAGE_BUGREPORT='bug-gawk@gnu.org' PACKAGE_URL='http://www.gnu.org/software/gawk/' @@ -1326,7 +1326,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Awk 4.1.1a to adapt to many kinds of systems. +\`configure' configures GNU Awk 4.1.1b to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1396,7 +1396,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Awk 4.1.1a:";; + short | recursive ) echo "Configuration of GNU Awk 4.1.1b:";; esac cat <<\_ACEOF @@ -1515,7 +1515,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU Awk configure 4.1.1a +GNU Awk configure 4.1.1b generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2224,7 +2224,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Awk $as_me 4.1.1a, which was +It was created by GNU Awk $as_me 4.1.1b, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3107,7 +3107,7 @@ fi # Define the identity of the package. PACKAGE='gawk' - VERSION='4.1.1a' + VERSION='4.1.1b' cat >>confdefs.h <<_ACEOF @@ -11824,7 +11824,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU Awk $as_me 4.1.1a, which was +This file was extended by GNU Awk $as_me 4.1.1b, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11892,7 +11892,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU Awk config.status 4.1.1a +GNU Awk config.status 4.1.1b configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 618dd7dc..5667b7c6 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ dnl dnl Process this file with autoconf to produce a configure script. -AC_INIT([GNU Awk], 4.1.1a, bug-gawk@gnu.org, gawk) +AC_INIT([GNU Awk], 4.1.1b, bug-gawk@gnu.org, gawk) # This is a hack. Different versions of install on different systems # are just too different. Chuck it and use install-sh. diff --git a/pc/config.h b/pc/config.h index 04024007..ffd67112 100644 --- a/pc/config.h +++ b/pc/config.h @@ -429,7 +429,7 @@ #define PACKAGE_NAME "GNU Awk" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "GNU Awk 4.1.1a" +#define PACKAGE_STRING "GNU Awk 4.1.1b" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gawk" @@ -438,7 +438,7 @@ #define PACKAGE_URL "http://www.gnu.org/software/gawk/" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.1.1a" +#define PACKAGE_VERSION "4.1.1b" /* Define to 1 if *printf supports %F format */ #undef PRINTF_HAS_F_FORMAT @@ -500,7 +500,7 @@ /* Version number of package */ -#define VERSION "4.1.1a" +#define VERSION "4.1.1b" /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE -- cgit v1.2.3 From 2ef8920a5dfb2d1975deecb83e8239d90a58600c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 21 Nov 2014 10:25:23 +0200 Subject: Update to xalloc. --- ChangeLog | 9 +++++++++ gawkmisc.c | 5 +++-- xalloc.h | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fddd2879..bf1461d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2014-11-20 Paul Eggert + + Port to systems where malloc (0) and/or realloc(P, 0) returns NULL. + * gawkmisc.c (xmalloc): + * xalloc.h (realloc): + Do not fail if malloc(0) or realloc(P, 0) returns NULL. + Fail only when the allocator returns null when attempting to + allocate a nonzero number of bytes. + 2014-11-19 Arnold D. Robbins Infrastructure upgrades: diff --git a/gawkmisc.c b/gawkmisc.c index a729d88d..fff5cc56 100644 --- a/gawkmisc.c +++ b/gawkmisc.c @@ -51,7 +51,8 @@ extern pointer xmalloc(size_t bytes); /* get rid of gcc warning */ pointer xmalloc(size_t bytes) { - pointer p; - emalloc(p, pointer, bytes, "xmalloc"); + pointer p = malloc(bytes); + if (!p && bytes) + xalloc_die (); return p; } diff --git a/xalloc.h b/xalloc.h index 0d169cf9..5ee45164 100644 --- a/xalloc.h +++ b/xalloc.h @@ -156,7 +156,7 @@ void * xrealloc(void *p, size_t size) { void *new_p = realloc(p, size); - if (new_p == 0) + if (!new_p && size) xalloc_die (); return new_p; -- cgit v1.2.3 From d8035c3f7d40d741d7be27e323dcad5757a32759 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 21 Nov 2014 10:39:53 +0200 Subject: Some minor cleanups. --- ChangeLog | 5 +++++ NOTES | 26 -------------------------- main.c | 3 +-- 3 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 NOTES diff --git a/ChangeLog b/ChangeLog index bf1461d9..a053ca66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-21 Arnold D. Robbins + + * main.c: Remove a debugging // comment. + * NOTES: Removed. + 2014-11-20 Paul Eggert Port to systems where malloc (0) and/or realloc(P, 0) returns NULL. diff --git a/NOTES b/NOTES deleted file mode 100644 index f7dee5ca..00000000 --- a/NOTES +++ /dev/null @@ -1,26 +0,0 @@ -Page 18. OK to move the sidebar although having it at the opening -is sort of like the opening quotes I have in other places; it's meant -to be humorous. - -Page 10 - references to 'Chapter 10' and 'Chapter 11' have been left -alone since they are links and I can't do it that way in texinfo anyway. - -Appendices vs. Appendixes: I have left it as the former; the latter -looks totally wrong to me. - -Numbers: I use the style where values from zero to nine are spelled -out and from 10 up they're written with digits. (I forget what the -Chicago Manual of Style calls this.) So I've rejected those changes. - -C heads - I have not lowercased them; this would be incorrect -for the Texinfo, so I've marked them as Rejected but with a reply -in the PDF to please do this during production. - -Literal layout blocks not being indented - I used literal layout to get -the brackets, which indicate optional stuff, in Roman. I think that if you -simply fix the style sheets to indent those blocks, we should be in better -shape. - -ADD STUFF ON danfuzz repo. - -At page 482. diff --git a/main.c b/main.c index ddda1d66..1323330c 100644 --- a/main.c +++ b/main.c @@ -492,8 +492,7 @@ main(int argc, char **argv) if (use_lc_numeric) setlocale(LC_NUMERIC, locale); #endif -// fprintf(stderr, "locale is <%s>\n", locale); fflush(stderr); - + init_io(); output_fp = stdout; -- cgit v1.2.3 From e9f1827fcd3a45cbf5a6df93d9e177e3151e1f56 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 21 Nov 2014 10:40:56 +0200 Subject: Update id test in pc/Makefile.tst. --- pc/ChangeLog | 4 ++++ pc/Makefile.tst | 1 + 2 files changed, 5 insertions(+) diff --git a/pc/ChangeLog b/pc/ChangeLog index 03159c1e..218621eb 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,7 @@ +2014-11-21 Arnold D. Robbins + + * Makefile.tst (id): Add an 'expect to fail for DJGPP' message. + 2014-11-13 Scott Deifik * Makefile.tst: Sync with mainline. diff --git a/pc/Makefile.tst b/pc/Makefile.tst index 8ab15987..79d01ad9 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -2259,6 +2259,7 @@ icasers: id: @echo $@ + @echo Expect id to fail with DJGPP. @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -- cgit v1.2.3 From f49b0b03937c6edfdfba5cfc229557dcfe56b2c7 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 21 Nov 2014 10:47:53 +0200 Subject: Revert changes to xmalloc. --- ChangeLog | 5 +++++ gawkmisc.c | 5 ++--- xalloc.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a053ca66..2162c9c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,11 @@ * main.c: Remove a debugging // comment. * NOTES: Removed. + Unrelated: + + Revert changes of 2014-11-20 from Paul Eggert. Causes failures + on z/OS. + 2014-11-20 Paul Eggert Port to systems where malloc (0) and/or realloc(P, 0) returns NULL. diff --git a/gawkmisc.c b/gawkmisc.c index fff5cc56..a729d88d 100644 --- a/gawkmisc.c +++ b/gawkmisc.c @@ -51,8 +51,7 @@ extern pointer xmalloc(size_t bytes); /* get rid of gcc warning */ pointer xmalloc(size_t bytes) { - pointer p = malloc(bytes); - if (!p && bytes) - xalloc_die (); + pointer p; + emalloc(p, pointer, bytes, "xmalloc"); return p; } diff --git a/xalloc.h b/xalloc.h index 5ee45164..0d169cf9 100644 --- a/xalloc.h +++ b/xalloc.h @@ -156,7 +156,7 @@ void * xrealloc(void *p, size_t size) { void *new_p = realloc(p, size); - if (!new_p && size) + if (new_p == 0) xalloc_die (); return new_p; -- cgit v1.2.3 From a398513aadb70b98e6e0ad04e5821ea0b6eca00c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 21 Nov 2014 10:53:34 +0200 Subject: Remove OLDMEM checks, preparatory to merging. --- awk.h | 2 -- interpret.h | 58 ++++++++++++++++------------------------------------------ main.c | 5 ----- 3 files changed, 16 insertions(+), 49 deletions(-) diff --git a/awk.h b/awk.h index e788a5a8..9b72a53c 100644 --- a/awk.h +++ b/awk.h @@ -1056,8 +1056,6 @@ extern bool field0_valid; extern int do_flags; -extern bool do_old_mem; /* XXX temporary */ - extern SRCFILE *srcfiles; /* source files */ enum do_flag_values { diff --git a/interpret.h b/interpret.h index 2901f60e..b16dc126 100644 --- a/interpret.h +++ b/interpret.h @@ -352,16 +352,12 @@ uninitialized_scalar: lhs = r_get_field(t1, (Func_ptr *) 0, true); decr_sp(); DEREF(t1); - if (do_old_mem) { + /* only for $0, up ref count */ + if (*lhs == fields_arr[0]) { + r = *lhs; + UPREF(r); + } else r = dupnode(*lhs); - } else { - /* only for $0, up ref count */ - if (*lhs == fields_arr[0]) { - r = *lhs; - UPREF(r); - } else - r = dupnode(*lhs); - } PUSH(r); break; @@ -652,12 +648,8 @@ mod: } unref(*lhs); - if (do_old_mem) { - *lhs = POP_SCALAR(); - } else { - r = POP_SCALAR(); - UNFIELD(*lhs, r); - } + r = POP_SCALAR(); + UNFIELD(*lhs, r); /* execute post-assignment routine if any */ if (t1->astore != NULL) @@ -675,21 +667,12 @@ mod: lhs = get_lhs(pc->memory, false); unref(*lhs); r = pc->initval; /* constant initializer */ - if (do_old_mem) { - if (r == NULL) - *lhs = POP_SCALAR(); - else { - UPREF(r); - *lhs = r; - } + if (r != NULL) { + UPREF(r); + *lhs = r; } else { - if (r != NULL) { - UPREF(r); - *lhs = r; - } else { - r = POP_SCALAR(); - UNFIELD(*lhs, r); - } + r = POP_SCALAR(); + UNFIELD(*lhs, r); } break; @@ -705,12 +688,8 @@ mod: decr_sp(); DEREF(t1); unref(*lhs); - if (do_old_mem) { - *lhs = POP_SCALAR(); - } else { - r = POP_SCALAR(); - UNFIELD(*lhs, r); - } + r = POP_SCALAR(); + UNFIELD(*lhs, r); assert(assign != NULL); assign(); } @@ -764,13 +743,8 @@ mod: lhs = POP_ADDRESS(); r = TOP_SCALAR(); unref(*lhs); - if (do_old_mem) { - *lhs = r; - UPREF(r); - } else { - UPREF(r); - UNFIELD(*lhs, r); - } + UPREF(r); + UNFIELD(*lhs, r); REPLACE(r); break; diff --git a/main.c b/main.c index 69e536f6..1323330c 100644 --- a/main.c +++ b/main.c @@ -170,8 +170,6 @@ GETGROUPS_T *groupset; /* current group set */ int ngroups; /* size of said set */ #endif -bool do_old_mem = false; /* XXX temporary */ - void (*lintfunc)(const char *mesg, ...) = r_warning; /* Sorted by long option name! */ @@ -233,9 +231,6 @@ main(int argc, char **argv) #endif /* HAVE_MTRACE */ #endif /* HAVE_MCHECK_H */ - if (getenv("OLDMEM") != NULL) - do_old_mem = true; /* XXX temporary */ - myname = gawk_name(argv[0]); os_arg_fixup(&argc, &argv); /* emulate redirection, expand wildcards */ -- cgit v1.2.3 From 1fc15398cbd381b83e20bca3913c12ee7aa34bd4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 21 Nov 2014 10:55:21 +0200 Subject: Update ChangeLog for memory fixes. --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2162c9c0..bf73f3df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,11 @@ Revert changes of 2014-11-20 from Paul Eggert. Causes failures on z/OS. + Unrelated: Avoid unnecessary copying of $0. + + * interpret.h (UNFIELD): New macro. + (r_interpret): Use it where *lhs is assigned to. + 2014-11-20 Paul Eggert Port to systems where malloc (0) and/or realloc(P, 0) returns NULL. -- cgit v1.2.3 From 838f65088cda84edc2df609d3e388acb3c8eb13d Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 22 Nov 2014 20:38:31 +0200 Subject: Dork around with xmalloc for z/OS. --- ChangeLog | 8 ++++++++ awk.h | 45 ++++++++++++++++++++++++++++++++++++--------- gawkmisc.c | 2 ++ 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf73f3df..c24ecd3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-11-22 Arnold D. Robbins + + * awk.h (emalloc, realloc): Redefine in terms of ... + (emalloc_real, eralloc_real): New static inline functions. + (fatal): Move definition up. + * gawkmisc.c (xmalloc): If count is zero, make it one for older + mallocs that require size > 0 (such as z/OS). + 2014-11-21 Arnold D. Robbins * main.c: Remove a debugging // comment. diff --git a/awk.h b/awk.h index 9b72a53c..84c8ca0e 100644 --- a/awk.h +++ b/awk.h @@ -1245,13 +1245,42 @@ DEREF(NODE *r) #define cant_happen() r_fatal("internal error line %d, file: %s", \ __LINE__, __FILE__) -#define emalloc(var,ty,x,str) (void)((var=(ty)malloc((size_t)(x))) ||\ - (fatal(_("%s: %s: can't allocate %ld bytes of memory (%s)"),\ - (str), #var, (long) (x), strerror(errno)),0)) -#define erealloc(var,ty,x,str) (void)((var = (ty)realloc((char *)var, (size_t)(x))) \ - ||\ - (fatal(_("%s: %s: can't allocate %ld bytes of memory (%s)"),\ - (str), #var, (long) (x), strerror(errno)),0)) +#define fatal set_loc(__FILE__, __LINE__), r_fatal + +static inline void * +emalloc_real(size_t count, const char *where, const char *var, const char *file, int line) +{ + void *ret; + + if (count == 0) + fatal("%s:%d: emalloc called with zero bytes", file, line); + + ret = (void *) malloc(count); + if (ret == NULL) + fatal(_("%s:%d:%s: %s: can't allocate %ld bytes of memory (%s)"), + file, line, where, var, (long) count, strerror(errno)); + + return ret; +} + +static inline void * +erealloc_real(void *ptr, size_t count, const char *where, const char *var, const char *file, int line) +{ + void *ret; + + if (count == 0) + fatal("%s:%d: erealloc called with zero bytes", file, line); + + ret = (void *) realloc(ptr, count); + if (ret == NULL) + fatal(_("%s:%d:%s: %s: can't reallocate %ld bytes of memory (%s)"), + file, line, where, var, (long) count, strerror(errno)); + + return ret; +} + +#define emalloc(var,ty,x,str) (void) (var = (ty) emalloc_real((size_t)(x), str, #var, __FILE__, __LINE__)) +#define erealloc(var,ty,x,str) (void) (var = (ty) erealloc_real((void *) var, (size_t)(x), str, #var, __FILE__, __LINE__)) #define efree(p) free(p) @@ -1285,8 +1314,6 @@ force_number(NODE *n) #endif /* GAWKDEBUG */ -#define fatal set_loc(__FILE__, __LINE__), r_fatal - extern jmp_buf fatal_tag; extern bool fatal_tag_valid; diff --git a/gawkmisc.c b/gawkmisc.c index a729d88d..0172a810 100644 --- a/gawkmisc.c +++ b/gawkmisc.c @@ -52,6 +52,8 @@ pointer xmalloc(size_t bytes) { pointer p; + if (bytes == 0) + bytes = 1; /* avoid dfa.c mishegos */ emalloc(p, pointer, bytes, "xmalloc"); return p; } -- cgit v1.2.3 From 2513062a4c89b0b60c3717d506fce841d44d871e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 23 Nov 2014 19:56:27 +0200 Subject: Fix compile problems and warnings on current GCC (4.9.2). --- ChangeLog | 5 +++ awk.h | 126 ++++++++++++++++++++++++++-------------------------- extension/ChangeLog | 5 +++ extension/inplace.c | 8 +++- 4 files changed, 79 insertions(+), 65 deletions(-) diff --git a/ChangeLog b/ChangeLog index c24ecd3f..f47aeded 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-23 Arnold D. Robbins + + * awk.h: Move all inline functions to the bottom of the file. + Keeps modern GCC happier. + 2014-11-22 Arnold D. Robbins * awk.h (emalloc, realloc): Redefine in terms of ... diff --git a/awk.h b/awk.h index 84c8ca0e..3abad6f8 100644 --- a/awk.h +++ b/awk.h @@ -1245,74 +1245,12 @@ DEREF(NODE *r) #define cant_happen() r_fatal("internal error line %d, file: %s", \ __LINE__, __FILE__) -#define fatal set_loc(__FILE__, __LINE__), r_fatal - -static inline void * -emalloc_real(size_t count, const char *where, const char *var, const char *file, int line) -{ - void *ret; - - if (count == 0) - fatal("%s:%d: emalloc called with zero bytes", file, line); - - ret = (void *) malloc(count); - if (ret == NULL) - fatal(_("%s:%d:%s: %s: can't allocate %ld bytes of memory (%s)"), - file, line, where, var, (long) count, strerror(errno)); - - return ret; -} - -static inline void * -erealloc_real(void *ptr, size_t count, const char *where, const char *var, const char *file, int line) -{ - void *ret; - - if (count == 0) - fatal("%s:%d: erealloc called with zero bytes", file, line); - - ret = (void *) realloc(ptr, count); - if (ret == NULL) - fatal(_("%s:%d:%s: %s: can't reallocate %ld bytes of memory (%s)"), - file, line, where, var, (long) count, strerror(errno)); - - return ret; -} - #define emalloc(var,ty,x,str) (void) (var = (ty) emalloc_real((size_t)(x), str, #var, __FILE__, __LINE__)) #define erealloc(var,ty,x,str) (void) (var = (ty) erealloc_real((void *) var, (size_t)(x), str, #var, __FILE__, __LINE__)) #define efree(p) free(p) -static inline NODE * -force_string(NODE *s) -{ - if ((s->flags & STRCUR) != 0 - && (s->stfmt == -1 || s->stfmt == CONVFMTidx) - ) - return s; - return format_val(CONVFMT, CONVFMTidx, s); -} - -#ifdef GAWKDEBUG -#define unref r_unref -#define force_number str2number -#else /* not GAWKDEBUG */ - -static inline void -unref(NODE *r) -{ - if (r != NULL && --r->valref <= 0) - r_unref(r); -} - -static inline NODE * -force_number(NODE *n) -{ - return (n->flags & NUMCUR) ? n : str2number(n); -} - -#endif /* GAWKDEBUG */ +#define fatal set_loc(__FILE__, __LINE__), r_fatal extern jmp_buf fatal_tag; extern bool fatal_tag_valid; @@ -1800,3 +1738,65 @@ dupnode(NODE *n) return r_dupnode(n); } #endif + +static inline NODE * +force_string(NODE *s) +{ + if ((s->flags & STRCUR) != 0 + && (s->stfmt == -1 || s->stfmt == CONVFMTidx) + ) + return s; + return format_val(CONVFMT, CONVFMTidx, s); +} + +#ifdef GAWKDEBUG +#define unref r_unref +#define force_number str2number +#else /* not GAWKDEBUG */ + +static inline void +unref(NODE *r) +{ + if (r != NULL && --r->valref <= 0) + r_unref(r); +} + +static inline NODE * +force_number(NODE *n) +{ + return (n->flags & NUMCUR) ? n : str2number(n); +} + +#endif /* GAWKDEBUG */ + +static inline void * +emalloc_real(size_t count, const char *where, const char *var, const char *file, int line) +{ + void *ret; + + if (count == 0) + fatal("%s:%d: emalloc called with zero bytes", file, line); + + ret = (void *) malloc(count); + if (ret == NULL) + fatal(_("%s:%d:%s: %s: can't allocate %ld bytes of memory (%s)"), + file, line, where, var, (long) count, strerror(errno)); + + return ret; +} + +static inline void * +erealloc_real(void *ptr, size_t count, const char *where, const char *var, const char *file, int line) +{ + void *ret; + + if (count == 0) + fatal("%s:%d: erealloc called with zero bytes", file, line); + + ret = (void *) realloc(ptr, count); + if (ret == NULL) + fatal(_("%s:%d:%s: %s: can't reallocate %ld bytes of memory (%s)"), + file, line, where, var, (long) count, strerror(errno)); + + return ret; +} diff --git a/extension/ChangeLog b/extension/ChangeLog index 940f7f15..41c8a0e4 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2014-11-23 Arnold D. Robbins + + * inplace.c (do_inplace_begin): Jump through hoops to silence + GCC warnings about return value of chown. + 2014-10-12 Arnold D. Robbins * Makefile.am (uninstall-so): Remove *.lib too, per suggestion diff --git a/extension/inplace.c b/extension/inplace.c index 8a7375c4..0693ad92 100644 --- a/extension/inplace.c +++ b/extension/inplace.c @@ -170,8 +170,12 @@ do_inplace_begin(int nargs, awk_value_t *result) state.tname, strerror(errno)); /* N.B. chown/chmod should be more portable than fchown/fchmod */ - if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) - (void) chown(state.tname, -1, sbuf.st_gid); + if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) { + /* jumping through hoops to silence gcc. :-( */ + int junk; + junk = chown(state.tname, -1, sbuf.st_gid); + junk = junk; + } if (chmod(state.tname, sbuf.st_mode) < 0) fatal(ext_id, _("inplace_begin: chmod failed (%s)"), -- cgit v1.2.3 From 723446ecab4a6c88ff129d61e360f70bf17a718b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 23 Nov 2014 20:02:53 +0200 Subject: Update doc on environment vars. --- NEWS | 3 +- doc/ChangeLog | 5 + doc/gawk.info | 804 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 6 + doc/gawktexi.in | 6 + 5 files changed, 424 insertions(+), 400 deletions(-) diff --git a/NEWS b/NEWS index b0d0f5f2..84505cf7 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,8 @@ Changes from 4.1.x to 4.2.0 1. If not in POSIX mode, changes to ENVIRON are reflected into gawk's environment, affecting any programs run by system() - or for piped redirections. + or for piped redirections. This can also affect built-in routines, such + as mktime(), which is typically influenced by the TZ environment variable. 2. The series of numbers returned by rand() should now be "more random" than previously. Gawk's rand() remains repeatable; you will diff --git a/doc/ChangeLog b/doc/ChangeLog index 837d76bd..fea9d17a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2014-11-23 Arnold D. Robbins + + * gawktexi.in: Update that TZ env. var can influnce mktime + in running program. Thanks to Hermann Peifer. + 2014-11-19 Arnold D. Robbins * gawktexi.in: Update that RFC 4180 documents CSV data. diff --git a/doc/gawk.info b/doc/gawk.info index 56f945f5..6ffc5dc1 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -10328,6 +10328,12 @@ Options::), they are not special: `ENVIRON["PATH"]"', which is the search path for finding executable programs. + This can also affect the running `gawk' program, since some of the + built-in functions may pay attention to certain environment + variables. The most notable instance of this is `mktime()' (*note + Time Functions::), which pays attention the value of the `TZ' + environment variable on many systems. + Some operating systems may not have environment variables. On such systems, the `ENVIRON' array is empty (except for `ENVIRON["AWKPATH"]' and `ENVIRON["AWKLIBPATH"]'; *note AWKPATH @@ -32230,9 +32236,9 @@ Index (line 143) * dark corner, exit statement: Exit Statement. (line 30) * dark corner, field separators: Full Line Fields. (line 22) -* dark corner, FILENAME variable <1>: Auto-set. (line 98) +* dark corner, FILENAME variable <1>: Auto-set. (line 104) * dark corner, FILENAME variable: Getline Notes. (line 19) -* dark corner, FNR/NR variables: Auto-set. (line 322) +* dark corner, FNR/NR variables: Auto-set. (line 328) * dark corner, format-control characters: Control Letters. (line 18) * dark corner, FS as null string: Single Character Fields. (line 20) @@ -32421,12 +32427,12 @@ Index (line 81) * differences in awk and gawk, command-line directories: Command-line directories. (line 6) -* differences in awk and gawk, ERRNO variable: Auto-set. (line 82) +* differences in awk and gawk, ERRNO variable: Auto-set. (line 88) * differences in awk and gawk, error messages: Special FD. (line 19) * differences in awk and gawk, FIELDWIDTHS variable: User-modified. (line 37) * differences in awk and gawk, FPAT variable: User-modified. (line 43) -* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 124) +* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 130) * differences in awk and gawk, function arguments (gawk): Calling Built-in. (line 16) * differences in awk and gawk, getline command: Getline. (line 19) @@ -32449,7 +32455,7 @@ Index (line 263) * differences in awk and gawk, print/printf statements: Format Modifiers. (line 13) -* differences in awk and gawk, PROCINFO array: Auto-set. (line 138) +* differences in awk and gawk, PROCINFO array: Auto-set. (line 144) * differences in awk and gawk, read timeouts: Read Timeout. (line 6) * differences in awk and gawk, record separators: awk split records. (line 125) @@ -32459,7 +32465,7 @@ Index (line 26) * differences in awk and gawk, RS/RT variables: gawk split records. (line 58) -* differences in awk and gawk, RT variable: Auto-set. (line 273) +* differences in awk and gawk, RT variable: Auto-set. (line 279) * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. @@ -32467,7 +32473,7 @@ Index * differences in awk and gawk, strings: Scalar Constants. (line 20) * differences in awk and gawk, strings, storing: gawk split records. (line 77) -* differences in awk and gawk, SYMTAB variable: Auto-set. (line 277) +* differences in awk and gawk, SYMTAB variable: Auto-set. (line 283) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. (line 151) * differences in awk and gawk, trunc-mod operation: Arithmetic Ops. @@ -32508,8 +32514,8 @@ Index * dynamically loaded extensions: Dynamic Extensions. (line 6) * e debugger command (alias for enable): Breakpoint Control. (line 73) * EBCDIC: Ordinal Functions. (line 45) -* effective group ID of gawk user: Auto-set. (line 143) -* effective user ID of gawk user: Auto-set. (line 147) +* effective group ID of gawk user: Auto-set. (line 149) +* effective user ID of gawk user: Auto-set. (line 153) * egrep utility <1>: Egrep Program. (line 6) * egrep utility: Bracket Expressions. (line 26) * egrep.awk program: Egrep Program. (line 54) @@ -32564,13 +32570,13 @@ Index (line 11) * EREs (Extended Regular Expressions): Bracket Expressions. (line 26) * ERRNO variable <1>: TCP/IP Networking. (line 54) -* ERRNO variable: Auto-set. (line 82) +* ERRNO variable: Auto-set. (line 88) * ERRNO variable, with BEGINFILE pattern: BEGINFILE/ENDFILE. (line 26) * ERRNO variable, with close() function: Close Files And Pipes. (line 141) * ERRNO variable, with getline command: Getline. (line 19) * error handling: Special FD. (line 19) -* error handling, ERRNO variable and: Auto-set. (line 82) +* error handling, ERRNO variable and: Auto-set. (line 88) * error output: Special FD. (line 6) * escape processing, gsub()/gensub()/sub() functions: Gory Details. (line 6) @@ -32624,7 +32630,7 @@ Index (line 6) * extension API version: Extension Versioning. (line 6) -* extension API, version number: Auto-set. (line 240) +* extension API, version number: Auto-set. (line 246) * extension example: Extension Example. (line 6) * extension registration: Registration Functions. (line 6) @@ -32705,7 +32711,7 @@ Index * file names, distinguishing: Auto-set. (line 56) * file names, in compatibility mode: Special Caveats. (line 9) * file names, standard streams in gawk: Special FD. (line 48) -* FILENAME variable <1>: Auto-set. (line 98) +* FILENAME variable <1>: Auto-set. (line 104) * FILENAME variable: Reading Files. (line 6) * FILENAME variable, getline, setting with: Getline Notes. (line 19) * filenames, assignments as: Ignoring Assigns. (line 6) @@ -32773,9 +32779,9 @@ Index * flush buffered output: I/O Functions. (line 28) * fnmatch() extension function: Extension Sample Fnmatch. (line 12) -* FNR variable <1>: Auto-set. (line 108) +* FNR variable <1>: Auto-set. (line 114) * FNR variable: Records. (line 6) -* FNR variable, changing: Auto-set. (line 322) +* FNR variable, changing: Auto-set. (line 328) * for statement: For Statement. (line 6) * for statement, looping over arrays: Scanning an Array. (line 20) * fork() extension function: Extension Sample Fork. @@ -32825,7 +32831,7 @@ Index * FSF (Free Software Foundation): Manual History. (line 6) * fts() extension function: Extension Sample File Functions. (line 61) -* FUNCTAB array: Auto-set. (line 124) +* FUNCTAB array: Auto-set. (line 130) * function calls: Function Calls. (line 6) * function calls, indirect: Indirect Calls. (line 6) * function calls, indirect, @-notation for: Indirect Calls. (line 47) @@ -32875,7 +32881,7 @@ Index * G-d: Acknowledgments. (line 94) * Garfinkle, Scott: Contributors. (line 34) * gawk program, dynamic profiling: Profiling. (line 178) -* gawk version: Auto-set. (line 215) +* gawk version: Auto-set. (line 221) * gawk, ARGIND variable in: Other Arguments. (line 15) * gawk, awk and <1>: This Manual. (line 14) * gawk, awk and: Preface. (line 21) @@ -32893,7 +32899,7 @@ Index * gawk, distribution: Distribution contents. (line 6) * gawk, ERRNO variable in <1>: TCP/IP Networking. (line 54) -* gawk, ERRNO variable in <2>: Auto-set. (line 82) +* gawk, ERRNO variable in <2>: Auto-set. (line 88) * gawk, ERRNO variable in <3>: BEGINFILE/ENDFILE. (line 26) * gawk, ERRNO variable in <4>: Close Files And Pipes. (line 141) @@ -32910,7 +32916,7 @@ Index * gawk, FPAT variable in <1>: User-modified. (line 43) * gawk, FPAT variable in: Splitting By Content. (line 25) -* gawk, FUNCTAB array in: Auto-set. (line 124) +* gawk, FUNCTAB array in: Auto-set. (line 130) * gawk, function arguments and: Calling Built-in. (line 16) * gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42) * gawk, IGNORECASE variable in <1>: Array Sorting Functions. @@ -32942,7 +32948,7 @@ Index * gawk, predefined variables and: Built-in Variables. (line 14) * gawk, PROCINFO array in <1>: Two-way I/O. (line 99) * gawk, PROCINFO array in <2>: Time Functions. (line 47) -* gawk, PROCINFO array in: Auto-set. (line 138) +* gawk, PROCINFO array in: Auto-set. (line 144) * gawk, regexp constants and: Using Constant Regexps. (line 28) * gawk, regular expressions, case sensitivity: Case-sensitivity. @@ -32950,14 +32956,14 @@ Index * gawk, regular expressions, operators: GNU Regexp Operators. (line 6) * gawk, regular expressions, precedence: Regexp Operators. (line 161) -* gawk, RT variable in <1>: Auto-set. (line 273) +* gawk, RT variable in <1>: Auto-set. (line 279) * gawk, RT variable in <2>: Multiple Line. (line 129) * gawk, RT variable in: awk split records. (line 125) * gawk, See Also awk: Preface. (line 34) * gawk, source code, obtaining: Getting. (line 6) * gawk, splitting fields and: Constant Size. (line 87) * gawk, string-translation functions: I18N Functions. (line 6) -* gawk, SYMTAB array in: Auto-set. (line 277) +* gawk, SYMTAB array in: Auto-set. (line 283) * gawk, TEXTDOMAIN variable in: User-modified. (line 151) * gawk, timestamps: Time Functions. (line 6) * gawk, uses for: Preface. (line 34) @@ -33049,7 +33055,7 @@ Index * Grigera, Juan: Contributors. (line 57) * group database, reading: Group Functions. (line 6) * group file: Group Functions. (line 6) -* group ID of gawk user: Auto-set. (line 188) +* group ID of gawk user: Auto-set. (line 194) * groups, information about: Group Functions. (line 6) * gsub <1>: String Functions. (line 140) * gsub: Using Constant Regexps. @@ -33344,7 +33350,7 @@ Index * 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 229) +* maximum precision supported by MPFR library: Auto-set. (line 235) * McIlroy, Doug: Glossary. (line 149) * McPhee, Patrick: Contributors. (line 100) * message object files: Explaining gettext. (line 42) @@ -33357,7 +33363,7 @@ Index * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) * metacharacters, escape sequences for: Escape Sequences. (line 139) -* minimum precision supported by MPFR library: Auto-set. (line 232) +* minimum precision supported by MPFR library: Auto-set. (line 238) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 104) @@ -33406,7 +33412,7 @@ Index (line 47) * nexti debugger command: Debugger Execution Control. (line 49) -* NF variable <1>: Auto-set. (line 113) +* NF variable <1>: Auto-set. (line 119) * NF variable: Fields. (line 33) * NF variable, decrementing: Changing Fields. (line 107) * ni debugger command (alias for nexti): Debugger Execution Control. @@ -33415,9 +33421,9 @@ Index * non-existent array elements: Reference to Elements. (line 23) * not Boolean-logic operator: Boolean Ops. (line 6) -* NR variable <1>: Auto-set. (line 133) +* NR variable <1>: Auto-set. (line 139) * NR variable: Records. (line 6) -* NR variable, changing: Auto-set. (line 322) +* NR variable, changing: Auto-set. (line 328) * null strings <1>: Basic Data Typing. (line 26) * null strings <2>: Truth Values. (line 6) * null strings <3>: Regexp Field Splitting. @@ -33531,7 +33537,7 @@ Index * p debugger command (alias for print): Viewing And Changing Data. (line 36) * Papadopoulos, Panos: Contributors. (line 128) -* parent process ID of gawk process: Auto-set. (line 197) +* parent process ID of gawk process: Auto-set. (line 203) * parentheses (), in a profile: Profiling. (line 146) * parentheses (), regexp operator: Regexp Operators. (line 81) * password file: Passwd Functions. (line 16) @@ -33697,24 +33703,24 @@ Index * printing, unduplicated lines of text: Uniq Program. (line 6) * printing, user information: Id Program. (line 6) * private variables: Library Names. (line 11) -* process group idIDof gawk process: Auto-set. (line 191) -* process ID of gawk process: Auto-set. (line 194) +* process group idIDof gawk process: Auto-set. (line 197) +* process ID of gawk process: Auto-set. (line 200) * processes, two-way communications with: Two-way I/O. (line 6) * processing data: Basic High Level. (line 6) * PROCINFO array <1>: Passwd Functions. (line 6) * PROCINFO array <2>: Time Functions. (line 47) -* PROCINFO array: Auto-set. (line 138) +* PROCINFO array: Auto-set. (line 144) * PROCINFO array, and communications via ptys: Two-way I/O. (line 99) * PROCINFO array, and group membership: Group Functions. (line 6) * PROCINFO array, and user and group ID numbers: Id Program. (line 15) * PROCINFO array, testing the field splitting: Passwd Functions. (line 154) -* PROCINFO array, uses: Auto-set. (line 250) +* PROCINFO array, uses: Auto-set. (line 256) * PROCINFO, values of sorted_in: Controlling Scanning. (line 26) * profiling awk programs: Profiling. (line 6) * profiling awk programs, dynamically: Profiling. (line 178) -* program identifiers: Auto-set. (line 156) +* program identifiers: Auto-set. (line 162) * program, definition of: Getting Started. (line 21) * programming conventions, --non-decimal-data option: Nondecimal Data. (line 35) @@ -33872,7 +33878,7 @@ Index * right shift: Bitwise Functions. (line 53) * right shift, bitwise: Bitwise Functions. (line 32) * Ritchie, Dennis: Basic Data Typing. (line 54) -* RLENGTH variable: Auto-set. (line 260) +* RLENGTH variable: Auto-set. (line 266) * RLENGTH variable, match() function and: String Functions. (line 228) * Robbins, Arnold <1>: Future Extensions. (line 6) * Robbins, Arnold <2>: Bugs. (line 70) @@ -33898,9 +33904,9 @@ Index * RS variable: awk split records. (line 12) * RS variable, multiline records and: Multiple Line. (line 17) * rshift: Bitwise Functions. (line 53) -* RSTART variable: Auto-set. (line 266) +* RSTART variable: Auto-set. (line 272) * RSTART variable, match() function and: String Functions. (line 228) -* RT variable <1>: Auto-set. (line 273) +* RT variable <1>: Auto-set. (line 279) * RT variable <2>: Multiple Line. (line 129) * RT variable: awk split records. (line 125) * Rubin, Paul <1>: Contributors. (line 15) @@ -33920,7 +33926,7 @@ Index * scanning arrays: Scanning an Array. (line 6) * scanning multidimensional arrays: Multiscanning. (line 11) * Schorr, Andrew <1>: Contributors. (line 133) -* Schorr, Andrew <2>: Auto-set. (line 305) +* Schorr, Andrew <2>: Auto-set. (line 311) * Schorr, Andrew: Acknowledgments. (line 60) * Schreiber, Bert: Acknowledgments. (line 38) * Schreiber, Rita: Acknowledgments. (line 38) @@ -34003,7 +34009,7 @@ Index (line 106) * sidebar, Changing FS Does Not Affect the Fields: Full Line Fields. (line 14) -* sidebar, Changing NR and FNR: Auto-set. (line 320) +* sidebar, Changing NR and FNR: Auto-set. (line 326) * sidebar, Controlling Output Buffering with system(): I/O Functions. (line 138) * sidebar, Escape Sequences for Metacharacters: Escape Sequences. @@ -34165,9 +34171,9 @@ Index * substr: String Functions. (line 481) * substring: String Functions. (line 481) * Sumner, Andrew: Other Versions. (line 68) -* supplementary groups of gawk process: Auto-set. (line 245) +* supplementary groups of gawk process: Auto-set. (line 251) * switch statement: Switch Statement. (line 6) -* SYMTAB array: Auto-set. (line 277) +* SYMTAB array: Auto-set. (line 283) * syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops. (line 148) * system: I/O Functions. (line 106) @@ -34344,10 +34350,10 @@ Index * variables, uninitialized, as array subscripts: Uninitialized Subscripts. (line 6) * variables, user-defined: Variables. (line 6) -* version of gawk: Auto-set. (line 215) -* version of gawk extension API: Auto-set. (line 240) -* version of GNU MP library: Auto-set. (line 226) -* version of GNU MPFR library: Auto-set. (line 222) +* version of gawk: Auto-set. (line 221) +* version of gawk extension API: Auto-set. (line 246) +* version of GNU MP library: Auto-set. (line 232) +* version of GNU MPFR library: Auto-set. (line 228) * vertical bar (|): Regexp Operators. (line 70) * vertical bar (|), | operator (I/O) <1>: Precedence. (line 65) * vertical bar (|), | operator (I/O): Getline/Pipe. (line 9) @@ -34637,359 +34643,359 @@ Node: Built-in Variables431230 Node: User-modified432363 Ref: User-modified-Footnote-1440044 Node: Auto-set440106 -Ref: Auto-set-Footnote-1453478 -Ref: Auto-set-Footnote-2453683 -Node: ARGC and ARGV453739 -Node: Pattern Action Summary457957 -Node: Arrays460384 -Node: Array Basics461713 -Node: Array Intro462557 -Ref: figure-array-elements464521 -Ref: Array Intro-Footnote-1467047 -Node: Reference to Elements467175 -Node: Assigning Elements469627 -Node: Array Example470118 -Node: Scanning an Array471876 -Node: Controlling Scanning474892 -Ref: Controlling Scanning-Footnote-1480088 -Node: Numeric Array Subscripts480404 -Node: Uninitialized Subscripts482589 -Node: Delete484206 -Ref: Delete-Footnote-1486949 -Node: Multidimensional487006 -Node: Multiscanning490103 -Node: Arrays of Arrays491692 -Node: Arrays Summary496451 -Node: Functions498543 -Node: Built-in499416 -Node: Calling Built-in500494 -Node: Numeric Functions502485 -Ref: Numeric Functions-Footnote-1507304 -Ref: Numeric Functions-Footnote-2507661 -Ref: Numeric Functions-Footnote-3507709 -Node: String Functions507981 -Ref: String Functions-Footnote-1531456 -Ref: String Functions-Footnote-2531585 -Ref: String Functions-Footnote-3531833 -Node: Gory Details531920 -Ref: table-sub-escapes533701 -Ref: table-sub-proposed535221 -Ref: table-posix-sub536585 -Ref: table-gensub-escapes538121 -Ref: Gory Details-Footnote-1538953 -Node: I/O Functions539104 -Ref: I/O Functions-Footnote-1546322 -Node: Time Functions546469 -Ref: Time Functions-Footnote-1556957 -Ref: Time Functions-Footnote-2557025 -Ref: Time Functions-Footnote-3557183 -Ref: Time Functions-Footnote-4557294 -Ref: Time Functions-Footnote-5557406 -Ref: Time Functions-Footnote-6557633 -Node: Bitwise Functions557899 -Ref: table-bitwise-ops558461 -Ref: Bitwise Functions-Footnote-1562770 -Node: Type Functions562939 -Node: I18N Functions564090 -Node: User-defined565735 -Node: Definition Syntax566540 -Ref: Definition Syntax-Footnote-1571947 -Node: Function Example572018 -Ref: Function Example-Footnote-1574937 -Node: Function Caveats574959 -Node: Calling A Function575477 -Node: Variable Scope576435 -Node: Pass By Value/Reference579423 -Node: Return Statement582918 -Node: Dynamic Typing585899 -Node: Indirect Calls586828 -Ref: Indirect Calls-Footnote-1598130 -Node: Functions Summary598258 -Node: Library Functions600960 -Ref: Library Functions-Footnote-1604569 -Ref: Library Functions-Footnote-2604712 -Node: Library Names604883 -Ref: Library Names-Footnote-1608337 -Ref: Library Names-Footnote-2608560 -Node: General Functions608646 -Node: Strtonum Function609749 -Node: Assert Function612771 -Node: Round Function616095 -Node: Cliff Random Function617636 -Node: Ordinal Functions618652 -Ref: Ordinal Functions-Footnote-1621715 -Ref: Ordinal Functions-Footnote-2621967 -Node: Join Function622178 -Ref: Join Function-Footnote-1623947 -Node: Getlocaltime Function624147 -Node: Readfile Function627891 -Node: Shell Quoting629861 -Node: Data File Management631262 -Node: Filetrans Function631894 -Node: Rewind Function635950 -Node: File Checking637337 -Ref: File Checking-Footnote-1638669 -Node: Empty Files638870 -Node: Ignoring Assigns640849 -Node: Getopt Function642400 -Ref: Getopt Function-Footnote-1653862 -Node: Passwd Functions654062 -Ref: Passwd Functions-Footnote-1662911 -Node: Group Functions662999 -Ref: Group Functions-Footnote-1670893 -Node: Walking Arrays671106 -Node: Library Functions Summary672709 -Node: Library Exercises674110 -Node: Sample Programs675390 -Node: Running Examples676160 -Node: Clones676888 -Node: Cut Program678112 -Node: Egrep Program687831 -Ref: Egrep Program-Footnote-1695329 -Node: Id Program695439 -Node: Split Program699084 -Ref: Split Program-Footnote-1702532 -Node: Tee Program702660 -Node: Uniq Program705449 -Node: Wc Program712868 -Ref: Wc Program-Footnote-1717118 -Node: Miscellaneous Programs717212 -Node: Dupword Program718425 -Node: Alarm Program720456 -Node: Translate Program725260 -Ref: Translate Program-Footnote-1729825 -Node: Labels Program730095 -Ref: Labels Program-Footnote-1733446 -Node: Word Sorting733530 -Node: History Sorting737601 -Node: Extract Program739437 -Node: Simple Sed746962 -Node: Igawk Program750030 -Ref: Igawk Program-Footnote-1764354 -Ref: Igawk Program-Footnote-2764555 -Ref: Igawk Program-Footnote-3764677 -Node: Anagram Program764792 -Node: Signature Program767849 -Node: Programs Summary769096 -Node: Programs Exercises770289 -Ref: Programs Exercises-Footnote-1774420 -Node: Advanced Features774511 -Node: Nondecimal Data776459 -Node: Array Sorting778049 -Node: Controlling Array Traversal778746 -Ref: Controlling Array Traversal-Footnote-1787079 -Node: Array Sorting Functions787197 -Ref: Array Sorting Functions-Footnote-1791086 -Node: Two-way I/O791282 -Ref: Two-way I/O-Footnote-1796223 -Ref: Two-way I/O-Footnote-2796409 -Node: TCP/IP Networking796491 -Node: Profiling799364 -Node: Advanced Features Summary807641 -Node: Internationalization809574 -Node: I18N and L10N811054 -Node: Explaining gettext811740 -Ref: Explaining gettext-Footnote-1816765 -Ref: Explaining gettext-Footnote-2816949 -Node: Programmer i18n817114 -Ref: Programmer i18n-Footnote-1821980 -Node: Translator i18n822029 -Node: String Extraction822823 -Ref: String Extraction-Footnote-1823954 -Node: Printf Ordering824040 -Ref: Printf Ordering-Footnote-1826826 -Node: I18N Portability826890 -Ref: I18N Portability-Footnote-1829345 -Node: I18N Example829408 -Ref: I18N Example-Footnote-1832211 -Node: Gawk I18N832283 -Node: I18N Summary832921 -Node: Debugger834260 -Node: Debugging835282 -Node: Debugging Concepts835723 -Node: Debugging Terms837576 -Node: Awk Debugging840148 -Node: Sample Debugging Session841042 -Node: Debugger Invocation841562 -Node: Finding The Bug842946 -Node: List of Debugger Commands849421 -Node: Breakpoint Control850754 -Node: Debugger Execution Control854450 -Node: Viewing And Changing Data857814 -Node: Execution Stack861192 -Node: Debugger Info862829 -Node: Miscellaneous Debugger Commands866846 -Node: Readline Support871875 -Node: Limitations872767 -Node: Debugging Summary874881 -Node: Arbitrary Precision Arithmetic876049 -Node: Computer Arithmetic877465 -Ref: table-numeric-ranges881063 -Ref: Computer Arithmetic-Footnote-1881922 -Node: Math Definitions881979 -Ref: table-ieee-formats885267 -Ref: Math Definitions-Footnote-1885871 -Node: MPFR features885976 -Node: FP Math Caution887647 -Ref: FP Math Caution-Footnote-1888697 -Node: Inexactness of computations889066 -Node: Inexact representation890025 -Node: Comparing FP Values891382 -Node: Errors accumulate892464 -Node: Getting Accuracy893897 -Node: Try To Round896559 -Node: Setting precision897458 -Ref: table-predefined-precision-strings898142 -Node: Setting the rounding mode899931 -Ref: table-gawk-rounding-modes900295 -Ref: Setting the rounding mode-Footnote-1903750 -Node: Arbitrary Precision Integers903929 -Ref: Arbitrary Precision Integers-Footnote-1908828 -Node: POSIX Floating Point Problems908977 -Ref: POSIX Floating Point Problems-Footnote-1912850 -Node: Floating point summary912888 -Node: Dynamic Extensions915082 -Node: Extension Intro916634 -Node: Plugin License917900 -Node: Extension Mechanism Outline918697 -Ref: figure-load-extension919125 -Ref: figure-register-new-function920605 -Ref: figure-call-new-function921609 -Node: Extension API Description923595 -Node: Extension API Functions Introduction925045 -Node: General Data Types929869 -Ref: General Data Types-Footnote-1935608 -Node: Memory Allocation Functions935907 -Ref: Memory Allocation Functions-Footnote-1938746 -Node: Constructor Functions938842 -Node: Registration Functions940576 -Node: Extension Functions941261 -Node: Exit Callback Functions943558 -Node: Extension Version String944806 -Node: Input Parsers945471 -Node: Output Wrappers955348 -Node: Two-way processors959863 -Node: Printing Messages962067 -Ref: Printing Messages-Footnote-1963143 -Node: Updating `ERRNO'963295 -Node: Requesting Values964035 -Ref: table-value-types-returned964763 -Node: Accessing Parameters965720 -Node: Symbol Table Access966951 -Node: Symbol table by name967465 -Node: Symbol table by cookie969446 -Ref: Symbol table by cookie-Footnote-1973590 -Node: Cached values973653 -Ref: Cached values-Footnote-1977152 -Node: Array Manipulation977243 -Ref: Array Manipulation-Footnote-1978341 -Node: Array Data Types978378 -Ref: Array Data Types-Footnote-1981033 -Node: Array Functions981125 -Node: Flattening Arrays984979 -Node: Creating Arrays991871 -Node: Extension API Variables996640 -Node: Extension Versioning997276 -Node: Extension API Informational Variables999177 -Node: Extension API Boilerplate1000265 -Node: Finding Extensions1004074 -Node: Extension Example1004634 -Node: Internal File Description1005406 -Node: Internal File Ops1009473 -Ref: Internal File Ops-Footnote-11021143 -Node: Using Internal File Ops1021283 -Ref: Using Internal File Ops-Footnote-11023666 -Node: Extension Samples1023939 -Node: Extension Sample File Functions1025465 -Node: Extension Sample Fnmatch1033103 -Node: Extension Sample Fork1034594 -Node: Extension Sample Inplace1035809 -Node: Extension Sample Ord1037484 -Node: Extension Sample Readdir1038320 -Ref: table-readdir-file-types1039196 -Node: Extension Sample Revout1040007 -Node: Extension Sample Rev2way1040597 -Node: Extension Sample Read write array1041337 -Node: Extension Sample Readfile1043277 -Node: Extension Sample Time1044372 -Node: Extension Sample API Tests1045721 -Node: gawkextlib1046212 -Node: Extension summary1048849 -Node: Extension Exercises1052526 -Node: Language History1053248 -Node: V7/SVR3.11054904 -Node: SVR41057085 -Node: POSIX1058530 -Node: BTL1059919 -Node: POSIX/GNU1060653 -Node: Feature History1066277 -Node: Common Extensions1079375 -Node: Ranges and Locales1080699 -Ref: Ranges and Locales-Footnote-11085317 -Ref: Ranges and Locales-Footnote-21085344 -Ref: Ranges and Locales-Footnote-31085578 -Node: Contributors1085799 -Node: History summary1091340 -Node: Installation1092710 -Node: Gawk Distribution1093656 -Node: Getting1094140 -Node: Extracting1094963 -Node: Distribution contents1096598 -Node: Unix Installation1102663 -Node: Quick Installation1103346 -Node: Shell Startup Files1105757 -Node: Additional Configuration Options1106836 -Node: Configuration Philosophy1108575 -Node: Non-Unix Installation1110944 -Node: PC Installation1111402 -Node: PC Binary Installation1112721 -Node: PC Compiling1114569 -Ref: PC Compiling-Footnote-11117590 -Node: PC Testing1117699 -Node: PC Using1118875 -Node: Cygwin1122990 -Node: MSYS1123813 -Node: VMS Installation1124313 -Node: VMS Compilation1125105 -Ref: VMS Compilation-Footnote-11126327 -Node: VMS Dynamic Extensions1126385 -Node: VMS Installation Details1128069 -Node: VMS Running1130321 -Node: VMS GNV1133157 -Node: VMS Old Gawk1133891 -Node: Bugs1134361 -Node: Other Versions1138244 -Node: Installation summary1144666 -Node: Notes1145722 -Node: Compatibility Mode1146587 -Node: Additions1147369 -Node: Accessing The Source1148294 -Node: Adding Code1149730 -Node: New Ports1155895 -Node: Derived Files1160377 -Ref: Derived Files-Footnote-11165852 -Ref: Derived Files-Footnote-21165886 -Ref: Derived Files-Footnote-31166482 -Node: Future Extensions1166596 -Node: Implementation Limitations1167202 -Node: Extension Design1168450 -Node: Old Extension Problems1169604 -Ref: Old Extension Problems-Footnote-11171121 -Node: Extension New Mechanism Goals1171178 -Ref: Extension New Mechanism Goals-Footnote-11174538 -Node: Extension Other Design Decisions1174727 -Node: Extension Future Growth1176835 -Node: Old Extension Mechanism1177671 -Node: Notes summary1179433 -Node: Basic Concepts1180619 -Node: Basic High Level1181300 -Ref: figure-general-flow1181572 -Ref: figure-process-flow1182171 -Ref: Basic High Level-Footnote-11185400 -Node: Basic Data Typing1185585 -Node: Glossary1188913 -Node: Copying1214071 -Node: GNU Free Documentation License1251627 -Node: Index1276763 +Ref: Auto-set-Footnote-1453798 +Ref: Auto-set-Footnote-2454003 +Node: ARGC and ARGV454059 +Node: Pattern Action Summary458277 +Node: Arrays460704 +Node: Array Basics462033 +Node: Array Intro462877 +Ref: figure-array-elements464841 +Ref: Array Intro-Footnote-1467367 +Node: Reference to Elements467495 +Node: Assigning Elements469947 +Node: Array Example470438 +Node: Scanning an Array472196 +Node: Controlling Scanning475212 +Ref: Controlling Scanning-Footnote-1480408 +Node: Numeric Array Subscripts480724 +Node: Uninitialized Subscripts482909 +Node: Delete484526 +Ref: Delete-Footnote-1487269 +Node: Multidimensional487326 +Node: Multiscanning490423 +Node: Arrays of Arrays492012 +Node: Arrays Summary496771 +Node: Functions498863 +Node: Built-in499736 +Node: Calling Built-in500814 +Node: Numeric Functions502805 +Ref: Numeric Functions-Footnote-1507624 +Ref: Numeric Functions-Footnote-2507981 +Ref: Numeric Functions-Footnote-3508029 +Node: String Functions508301 +Ref: String Functions-Footnote-1531776 +Ref: String Functions-Footnote-2531905 +Ref: String Functions-Footnote-3532153 +Node: Gory Details532240 +Ref: table-sub-escapes534021 +Ref: table-sub-proposed535541 +Ref: table-posix-sub536905 +Ref: table-gensub-escapes538441 +Ref: Gory Details-Footnote-1539273 +Node: I/O Functions539424 +Ref: I/O Functions-Footnote-1546642 +Node: Time Functions546789 +Ref: Time Functions-Footnote-1557277 +Ref: Time Functions-Footnote-2557345 +Ref: Time Functions-Footnote-3557503 +Ref: Time Functions-Footnote-4557614 +Ref: Time Functions-Footnote-5557726 +Ref: Time Functions-Footnote-6557953 +Node: Bitwise Functions558219 +Ref: table-bitwise-ops558781 +Ref: Bitwise Functions-Footnote-1563090 +Node: Type Functions563259 +Node: I18N Functions564410 +Node: User-defined566055 +Node: Definition Syntax566860 +Ref: Definition Syntax-Footnote-1572267 +Node: Function Example572338 +Ref: Function Example-Footnote-1575257 +Node: Function Caveats575279 +Node: Calling A Function575797 +Node: Variable Scope576755 +Node: Pass By Value/Reference579743 +Node: Return Statement583238 +Node: Dynamic Typing586219 +Node: Indirect Calls587148 +Ref: Indirect Calls-Footnote-1598450 +Node: Functions Summary598578 +Node: Library Functions601280 +Ref: Library Functions-Footnote-1604889 +Ref: Library Functions-Footnote-2605032 +Node: Library Names605203 +Ref: Library Names-Footnote-1608657 +Ref: Library Names-Footnote-2608880 +Node: General Functions608966 +Node: Strtonum Function610069 +Node: Assert Function613091 +Node: Round Function616415 +Node: Cliff Random Function617956 +Node: Ordinal Functions618972 +Ref: Ordinal Functions-Footnote-1622035 +Ref: Ordinal Functions-Footnote-2622287 +Node: Join Function622498 +Ref: Join Function-Footnote-1624267 +Node: Getlocaltime Function624467 +Node: Readfile Function628211 +Node: Shell Quoting630181 +Node: Data File Management631582 +Node: Filetrans Function632214 +Node: Rewind Function636270 +Node: File Checking637657 +Ref: File Checking-Footnote-1638989 +Node: Empty Files639190 +Node: Ignoring Assigns641169 +Node: Getopt Function642720 +Ref: Getopt Function-Footnote-1654182 +Node: Passwd Functions654382 +Ref: Passwd Functions-Footnote-1663231 +Node: Group Functions663319 +Ref: Group Functions-Footnote-1671213 +Node: Walking Arrays671426 +Node: Library Functions Summary673029 +Node: Library Exercises674430 +Node: Sample Programs675710 +Node: Running Examples676480 +Node: Clones677208 +Node: Cut Program678432 +Node: Egrep Program688151 +Ref: Egrep Program-Footnote-1695649 +Node: Id Program695759 +Node: Split Program699404 +Ref: Split Program-Footnote-1702852 +Node: Tee Program702980 +Node: Uniq Program705769 +Node: Wc Program713188 +Ref: Wc Program-Footnote-1717438 +Node: Miscellaneous Programs717532 +Node: Dupword Program718745 +Node: Alarm Program720776 +Node: Translate Program725580 +Ref: Translate Program-Footnote-1730145 +Node: Labels Program730415 +Ref: Labels Program-Footnote-1733766 +Node: Word Sorting733850 +Node: History Sorting737921 +Node: Extract Program739757 +Node: Simple Sed747282 +Node: Igawk Program750350 +Ref: Igawk Program-Footnote-1764674 +Ref: Igawk Program-Footnote-2764875 +Ref: Igawk Program-Footnote-3764997 +Node: Anagram Program765112 +Node: Signature Program768169 +Node: Programs Summary769416 +Node: Programs Exercises770609 +Ref: Programs Exercises-Footnote-1774740 +Node: Advanced Features774831 +Node: Nondecimal Data776779 +Node: Array Sorting778369 +Node: Controlling Array Traversal779066 +Ref: Controlling Array Traversal-Footnote-1787399 +Node: Array Sorting Functions787517 +Ref: Array Sorting Functions-Footnote-1791406 +Node: Two-way I/O791602 +Ref: Two-way I/O-Footnote-1796543 +Ref: Two-way I/O-Footnote-2796729 +Node: TCP/IP Networking796811 +Node: Profiling799684 +Node: Advanced Features Summary807961 +Node: Internationalization809894 +Node: I18N and L10N811374 +Node: Explaining gettext812060 +Ref: Explaining gettext-Footnote-1817085 +Ref: Explaining gettext-Footnote-2817269 +Node: Programmer i18n817434 +Ref: Programmer i18n-Footnote-1822300 +Node: Translator i18n822349 +Node: String Extraction823143 +Ref: String Extraction-Footnote-1824274 +Node: Printf Ordering824360 +Ref: Printf Ordering-Footnote-1827146 +Node: I18N Portability827210 +Ref: I18N Portability-Footnote-1829665 +Node: I18N Example829728 +Ref: I18N Example-Footnote-1832531 +Node: Gawk I18N832603 +Node: I18N Summary833241 +Node: Debugger834580 +Node: Debugging835602 +Node: Debugging Concepts836043 +Node: Debugging Terms837896 +Node: Awk Debugging840468 +Node: Sample Debugging Session841362 +Node: Debugger Invocation841882 +Node: Finding The Bug843266 +Node: List of Debugger Commands849741 +Node: Breakpoint Control851074 +Node: Debugger Execution Control854770 +Node: Viewing And Changing Data858134 +Node: Execution Stack861512 +Node: Debugger Info863149 +Node: Miscellaneous Debugger Commands867166 +Node: Readline Support872195 +Node: Limitations873087 +Node: Debugging Summary875201 +Node: Arbitrary Precision Arithmetic876369 +Node: Computer Arithmetic877785 +Ref: table-numeric-ranges881383 +Ref: Computer Arithmetic-Footnote-1882242 +Node: Math Definitions882299 +Ref: table-ieee-formats885587 +Ref: Math Definitions-Footnote-1886191 +Node: MPFR features886296 +Node: FP Math Caution887967 +Ref: FP Math Caution-Footnote-1889017 +Node: Inexactness of computations889386 +Node: Inexact representation890345 +Node: Comparing FP Values891702 +Node: Errors accumulate892784 +Node: Getting Accuracy894217 +Node: Try To Round896879 +Node: Setting precision897778 +Ref: table-predefined-precision-strings898462 +Node: Setting the rounding mode900251 +Ref: table-gawk-rounding-modes900615 +Ref: Setting the rounding mode-Footnote-1904070 +Node: Arbitrary Precision Integers904249 +Ref: Arbitrary Precision Integers-Footnote-1909148 +Node: POSIX Floating Point Problems909297 +Ref: POSIX Floating Point Problems-Footnote-1913170 +Node: Floating point summary913208 +Node: Dynamic Extensions915402 +Node: Extension Intro916954 +Node: Plugin License918220 +Node: Extension Mechanism Outline919017 +Ref: figure-load-extension919445 +Ref: figure-register-new-function920925 +Ref: figure-call-new-function921929 +Node: Extension API Description923915 +Node: Extension API Functions Introduction925365 +Node: General Data Types930189 +Ref: General Data Types-Footnote-1935928 +Node: Memory Allocation Functions936227 +Ref: Memory Allocation Functions-Footnote-1939066 +Node: Constructor Functions939162 +Node: Registration Functions940896 +Node: Extension Functions941581 +Node: Exit Callback Functions943878 +Node: Extension Version String945126 +Node: Input Parsers945791 +Node: Output Wrappers955668 +Node: Two-way processors960183 +Node: Printing Messages962387 +Ref: Printing Messages-Footnote-1963463 +Node: Updating `ERRNO'963615 +Node: Requesting Values964355 +Ref: table-value-types-returned965083 +Node: Accessing Parameters966040 +Node: Symbol Table Access967271 +Node: Symbol table by name967785 +Node: Symbol table by cookie969766 +Ref: Symbol table by cookie-Footnote-1973910 +Node: Cached values973973 +Ref: Cached values-Footnote-1977472 +Node: Array Manipulation977563 +Ref: Array Manipulation-Footnote-1978661 +Node: Array Data Types978698 +Ref: Array Data Types-Footnote-1981353 +Node: Array Functions981445 +Node: Flattening Arrays985299 +Node: Creating Arrays992191 +Node: Extension API Variables996960 +Node: Extension Versioning997596 +Node: Extension API Informational Variables999497 +Node: Extension API Boilerplate1000585 +Node: Finding Extensions1004394 +Node: Extension Example1004954 +Node: Internal File Description1005726 +Node: Internal File Ops1009793 +Ref: Internal File Ops-Footnote-11021463 +Node: Using Internal File Ops1021603 +Ref: Using Internal File Ops-Footnote-11023986 +Node: Extension Samples1024259 +Node: Extension Sample File Functions1025785 +Node: Extension Sample Fnmatch1033423 +Node: Extension Sample Fork1034914 +Node: Extension Sample Inplace1036129 +Node: Extension Sample Ord1037804 +Node: Extension Sample Readdir1038640 +Ref: table-readdir-file-types1039516 +Node: Extension Sample Revout1040327 +Node: Extension Sample Rev2way1040917 +Node: Extension Sample Read write array1041657 +Node: Extension Sample Readfile1043597 +Node: Extension Sample Time1044692 +Node: Extension Sample API Tests1046041 +Node: gawkextlib1046532 +Node: Extension summary1049169 +Node: Extension Exercises1052846 +Node: Language History1053568 +Node: V7/SVR3.11055224 +Node: SVR41057405 +Node: POSIX1058850 +Node: BTL1060239 +Node: POSIX/GNU1060973 +Node: Feature History1066597 +Node: Common Extensions1079695 +Node: Ranges and Locales1081019 +Ref: Ranges and Locales-Footnote-11085637 +Ref: Ranges and Locales-Footnote-21085664 +Ref: Ranges and Locales-Footnote-31085898 +Node: Contributors1086119 +Node: History summary1091660 +Node: Installation1093030 +Node: Gawk Distribution1093976 +Node: Getting1094460 +Node: Extracting1095283 +Node: Distribution contents1096918 +Node: Unix Installation1102983 +Node: Quick Installation1103666 +Node: Shell Startup Files1106077 +Node: Additional Configuration Options1107156 +Node: Configuration Philosophy1108895 +Node: Non-Unix Installation1111264 +Node: PC Installation1111722 +Node: PC Binary Installation1113041 +Node: PC Compiling1114889 +Ref: PC Compiling-Footnote-11117910 +Node: PC Testing1118019 +Node: PC Using1119195 +Node: Cygwin1123310 +Node: MSYS1124133 +Node: VMS Installation1124633 +Node: VMS Compilation1125425 +Ref: VMS Compilation-Footnote-11126647 +Node: VMS Dynamic Extensions1126705 +Node: VMS Installation Details1128389 +Node: VMS Running1130641 +Node: VMS GNV1133477 +Node: VMS Old Gawk1134211 +Node: Bugs1134681 +Node: Other Versions1138564 +Node: Installation summary1144986 +Node: Notes1146042 +Node: Compatibility Mode1146907 +Node: Additions1147689 +Node: Accessing The Source1148614 +Node: Adding Code1150050 +Node: New Ports1156215 +Node: Derived Files1160697 +Ref: Derived Files-Footnote-11166172 +Ref: Derived Files-Footnote-21166206 +Ref: Derived Files-Footnote-31166802 +Node: Future Extensions1166916 +Node: Implementation Limitations1167522 +Node: Extension Design1168770 +Node: Old Extension Problems1169924 +Ref: Old Extension Problems-Footnote-11171441 +Node: Extension New Mechanism Goals1171498 +Ref: Extension New Mechanism Goals-Footnote-11174858 +Node: Extension Other Design Decisions1175047 +Node: Extension Future Growth1177155 +Node: Old Extension Mechanism1177991 +Node: Notes summary1179753 +Node: Basic Concepts1180939 +Node: Basic High Level1181620 +Ref: figure-general-flow1181892 +Ref: figure-process-flow1182491 +Ref: Basic High Level-Footnote-11185720 +Node: Basic Data Typing1185905 +Node: Glossary1189233 +Node: Copying1214391 +Node: GNU Free Documentation License1251947 +Node: Index1277083  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 00f2fa5c..7c9beae6 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -14896,6 +14896,12 @@ that it creates. You should therefore be especially careful if you modify @code{ENVIRON["PATH"]"}, which is the search path for finding executable programs. +This can also affect the running @command{gawk} program, since some of the +built-in functions may pay attention to certain environment variables. +The most notable instance of this is @code{mktime()} (@pxref{Time +Functions}), which pays attention the value of the @env{TZ} environment +variable on many systems. + Some operating systems may not have environment variables. On such systems, the @code{ENVIRON} array is empty (except for @w{@code{ENVIRON["AWKPATH"]}} and diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 758fe14a..391405e4 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -14225,6 +14225,12 @@ that it creates. You should therefore be especially careful if you modify @code{ENVIRON["PATH"]"}, which is the search path for finding executable programs. +This can also affect the running @command{gawk} program, since some of the +built-in functions may pay attention to certain environment variables. +The most notable instance of this is @code{mktime()} (@pxref{Time +Functions}), which pays attention the value of the @env{TZ} environment +variable on many systems. + Some operating systems may not have environment variables. On such systems, the @code{ENVIRON} array is empty (except for @w{@code{ENVIRON["AWKPATH"]}} and -- cgit v1.2.3 From 7efd4d794abbbd1b6abc2110cd43fd7896e0cb47 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 25 Nov 2014 21:43:58 +0200 Subject: Improve warnings in gensub. --- ChangeLog | 5 +++++ builtin.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f47aeded..175c9298 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-25 Arnold D. Robbins + + * builtin.c (do_sub): For gensub, add more warnings for invalid + third argument. + 2014-11-23 Arnold D. Robbins * awk.h: Move all inline functions to the bottom of the file. diff --git a/builtin.c b/builtin.c index 75e4f580..3aeee744 100644 --- a/builtin.c +++ b/builtin.c @@ -2696,6 +2696,8 @@ do_sub(int nargs, unsigned int flags) if ((t1->flags & NUMCUR) != 0) goto set_how_many; + warning(_("gensub: third argument of `%.*s' treated as 1"), + (int) t1->stlen, t1->stptr); how_many = 1; } } else { @@ -2708,8 +2710,8 @@ set_how_many: how_many = d; else how_many = LONG_MAX; - if (d == 0) - warning(_("gensub: third argument of 0 treated as 1")); + if (d <= 0) + warning(_("gensub: third argument of %g treated as 1"), d); } DEREF(t1); -- cgit v1.2.3 From 5dd46ec03bb3dc945d2f084726aaba79a83e6340 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 26 Nov 2014 08:29:52 +0200 Subject: Fixes for new gensub warnings. --- ChangeLog | 4 ++++ builtin.c | 4 ++-- test/ChangeLog | 4 ++++ test/gensub2.ok | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 175c9298..5dc79045 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-11-26 Arnold D. Robbins + + * builtin.c (do_sub): Improve wording of gensub warnings. + 2014-11-25 Arnold D. Robbins * builtin.c (do_sub): For gensub, add more warnings for invalid diff --git a/builtin.c b/builtin.c index 3aeee744..53210c4d 100644 --- a/builtin.c +++ b/builtin.c @@ -2696,7 +2696,7 @@ do_sub(int nargs, unsigned int flags) if ((t1->flags & NUMCUR) != 0) goto set_how_many; - warning(_("gensub: third argument of `%.*s' treated as 1"), + warning(_("gensub: third argument `%.*s' treated as 1"), (int) t1->stlen, t1->stptr); how_many = 1; } @@ -2711,7 +2711,7 @@ set_how_many: else how_many = LONG_MAX; if (d <= 0) - warning(_("gensub: third argument of %g treated as 1"), d); + warning(_("gensub: third argument %g treated as 1"), d); } DEREF(t1); diff --git a/test/ChangeLog b/test/ChangeLog index 633fef51..854c1379 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-11-26 Arnold D. Robbins + + * gensub2.ok: Update after code changes. + 2014-11-16 Arnold D. Robbins * Makefile.am (sortglos): New test. diff --git a/test/gensub2.ok b/test/gensub2.ok index 89824140..318f940c 100644 --- a/test/gensub2.ok +++ b/test/gensub2.ok @@ -1,3 +1,4 @@ xy xy +gawk: gensub2.awk:4: warning: gensub: third argument `a' treated as 1 yx -- cgit v1.2.3 From 0d9a32b95e932fb47ddfb100056aa6fe527da595 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 26 Nov 2014 20:13:16 +0200 Subject: Fix test/Gentests. --- test/ChangeLog | 4 ++++ test/Gentests | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/ChangeLog b/test/ChangeLog index 854c1379..a8d12fd7 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-11-26 Arnold D. Robbins + + * Gentests: Fix gensub call after adding warning. + 2014-11-26 Arnold D. Robbins * gensub2.ok: Update after code changes. diff --git a/test/Gentests b/test/Gentests index 460edbae..5a7aaa09 100755 --- a/test/Gentests +++ b/test/Gentests @@ -123,7 +123,7 @@ END { printf "WARNING: --lint-old target `%s' is missing.\n", x > "/dev/stderr" for (x in files) if (!(x in unused) && \ - !(gensub(/\.(awk|in)$/,"","",x) in targets)) + !(gensub(/\.(awk|in)$/,"",1,x) in targets)) printf "WARNING: unused file `%s'.\n", x > "/dev/stderr" } -- cgit v1.2.3 From 932e27e10312e5b84afc551bbcd16551b0770f0e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 5 Dec 2014 13:24:40 +0200 Subject: Minor fixes and updates to the manual. --- doc/ChangeLog | 4 + doc/gawk.info | 1112 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 33 +- doc/gawktexi.in | 31 +- 4 files changed, 596 insertions(+), 584 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 1e53c5b7..96c48a39 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-05 Arnold D. Robbins + + * gawktexi.in: Various minor fixes and updates. + 2014-11-19 Arnold D. Robbins * gawktexi.in: Update that RFC 4180 documents CSV data. diff --git a/doc/gawk.info b/doc/gawk.info index 6026b543..f77d742e 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -1341,7 +1341,7 @@ continues to be a pleasure working with this team of fine people. Notable code and documentation contributions were made by a number of people. *Note Contributors::, for the full list. - Thanks to Michael Brennan for the Foreword. + Thanks to Michael Brennan for the Forewords. Thanks to Patrice Dumas for the new `makeinfo' program. Thanks to Karl Berry who continues to work to keep the Texinfo markup language @@ -4989,7 +4989,7 @@ which usually prints: on an incorrect implementation of `awk', while `gawk' prints the full first line of the file, something like: - root:nSijPlPhZZwgE:0:0:Root:/: + root:x:0:0:Root:/: ---------- Footnotes ---------- @@ -5242,7 +5242,7 @@ being used. NOTE: Some programs export CSV data that contains embedded newlines between the double quotes. `gawk' provides no way to - deal with this. Because no formal specification for CSV data + deal with this. Even though a formal specification for CSV data exists, there isn't much more to be done; the `FPAT' mechanism provides an elegant solution for the majority of cases, and the `gawk' developers are satisfied with that. @@ -5809,7 +5809,7 @@ in mind: * Using `FILENAME' with `getline' (`getline < FILENAME') is likely to be a source for confusion. `awk' opens a separate input stream from the current input file. However, by not using a variable, - `$0' and `NR' are still updated. If you're doing this, it's + `$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 trying to accomplish. @@ -5928,7 +5928,7 @@ input to arrive: PROCINFO[Service, "READ_TIMEOUT"] = 1000 while ((Service |& getline) > 0) { print $0 - PROCINFO[S, "READ_TIMEOUT"] -= 100 + PROCINFO[Service, "READ_TIMEOUT"] -= 100 } NOTE: You should not assume that the read operation will block @@ -15839,7 +15839,7 @@ Login shell A few lines representative of `pwcat''s output are as follows: $ pwcat - -| root:3Ov02d5VaUPB6:0:1:Operator:/:/bin/sh + -| root:x:0:1:Operator:/:/bin/sh -| nobody:*:65534:65534::/: -| daemon:*:1:1::/: -| sys:*:2:2::/:/bin/csh @@ -25908,7 +25908,7 @@ provides a number of `gawk' extensions, including one for processing XML files. This is the evolution of the original `xgawk' (XML `gawk') project. - As of this writing, there are five extensions: + As of this writing, there are six extensions: * GD graphics library extension @@ -25919,6 +25919,8 @@ project. * MPFR library extension (this provides access to a number of MPFR functions which `gawk''s native MPFR support does not) + * Redis extension + * XML parser extension, using the Expat (http://expat.sourceforge.net) XML parsing library @@ -29401,6 +29403,11 @@ Action pattern matches an input record, `awk' executes the rule's action. Actions are always enclosed in braces. (*Note Action Overview::.) +Ada + A programming language originally defined by the U.S. Department of + Defense for embedded programming. It was designed to enforce good + Software Engineering practices. + Amazing `awk' Assembler Henry Spencer at the University of Toronto wrote a retargetable assembler completely as `sed' and `awk' scripts. It is thousands @@ -29409,11 +29416,6 @@ Amazing `awk' Assembler been better written in another language. You can get it from `http://awk.info/?awk100/aaa'. -Ada - A programming language originally defined by the U.S. Department of - Defense for embedded programming. It was designed to enforce good - Software Engineering practices. - Amazingly Workable Formatter (`awf') Henry Spencer at the University of Toronto wrote a formatter that accepts a large subset of the `nroff -ms' and `nroff -man' @@ -31516,7 +31518,7 @@ Index * actions, control statements in: Statements. (line 6) * actions, default: Very Simple. (line 34) * actions, empty: Very Simple. (line 39) -* Ada programming language: Glossary. (line 19) +* Ada programming language: Glossary. (line 11) * adding, features to gawk: Adding Code. (line 6) * adding, fields: Changing Fields. (line 53) * advanced features, fixed-width data: Constant Size. (line 6) @@ -31534,7 +31536,7 @@ Index * algorithms: Basic High Level. (line 68) * allocating memory for extensions: Memory Allocation Functions. (line 6) -* amazing awk assembler (aaa): Glossary. (line 11) +* amazing awk assembler (aaa): Glossary. (line 16) * amazingly workable formatter (awf): Glossary. (line 24) * ambiguity, syntactic: /= operator vs. /=.../ regexp constant: Assignment Ops. (line 148) @@ -32464,7 +32466,7 @@ Index (line 99) * exp: Numeric Functions. (line 18) * expand utility: Very Simple. (line 72) -* Expat XML parser library: gawkextlib. (line 31) +* Expat XML parser library: gawkextlib. (line 33) * exponent: Numeric Functions. (line 18) * expressions: Expressions. (line 6) * expressions, as patterns: Expression Patterns. (line 6) @@ -32878,7 +32880,7 @@ Index * git utility <2>: Accessing The Source. (line 10) * git utility <3>: Other Versions. (line 29) -* git utility: gawkextlib. (line 25) +* git utility: gawkextlib. (line 27) * Git, use of for gawk source code: Derived Files. (line 6) * GNITS mailing list: Acknowledgments. (line 52) * GNU awk, See gawk: Preface. (line 51) @@ -33584,7 +33586,7 @@ Index * programming conventions, private variable names: Library Names. (line 23) * programming language, recipe for: History. (line 6) -* programming languages, Ada: Glossary. (line 19) +* programming languages, Ada: Glossary. (line 11) * programming languages, data-driven vs. procedural: Getting Started. (line 12) * programming languages, Java: Glossary. (line 379) @@ -33789,7 +33791,7 @@ Index * search paths, for source files: AWKPATH Variable. (line 6) * searching, files for regular expressions: Egrep Program. (line 6) * searching, for words: Dupword Program. (line 6) -* sed utility <1>: Glossary. (line 11) +* sed utility <1>: Glossary. (line 16) * sed utility <2>: Simple Sed. (line 6) * sed utility: Full Line Fields. (line 22) * seeding random number generator: Numeric Functions. (line 63) @@ -33933,7 +33935,7 @@ Index * source code, Solaris awk: Other Versions. (line 100) * source files, search path for: Programs Exercises. (line 70) * sparse arrays: Array Intro. (line 72) -* Spencer, Henry: Glossary. (line 11) +* Spencer, Henry: Glossary. (line 16) * split: String Functions. (line 316) * split string into array: String Functions. (line 297) * split utility: Split Program. (line 6) @@ -34307,541 +34309,541 @@ Ref: Manual History-Footnote-166877 Ref: Manual History-Footnote-266918 Node: How To Contribute66992 Node: Acknowledgments68121 -Node: Getting Started72925 -Node: Running gawk75358 -Node: One-shot76548 -Node: Read Terminal77796 -Node: Long79823 -Node: Executable Scripts81339 -Ref: Executable Scripts-Footnote-184128 -Node: Comments84231 -Node: Quoting86713 -Node: DOS Quoting92237 -Node: Sample Data Files92912 -Node: Very Simple95507 -Node: Two Rules100405 -Node: More Complex102291 -Node: Statements/Lines105153 -Ref: Statements/Lines-Footnote-1109608 -Node: Other Features109873 -Node: When110804 -Ref: When-Footnote-1112558 -Node: Intro Summary112623 -Node: Invoking Gawk113506 -Node: Command Line115020 -Node: Options115818 -Ref: Options-Footnote-1131749 -Node: Other Arguments131774 -Node: Naming Standard Input134722 -Node: Environment Variables135815 -Node: AWKPATH Variable136373 -Ref: AWKPATH Variable-Footnote-1139676 -Ref: AWKPATH Variable-Footnote-2139721 -Node: AWKLIBPATH Variable139981 -Node: Other Environment Variables141124 -Node: Exit Status144852 -Node: Include Files145528 -Node: Loading Shared Libraries149125 -Node: Obsolete150552 -Node: Undocumented151249 -Node: Invoking Summary151516 -Node: Regexp153180 -Node: Regexp Usage154634 -Node: Escape Sequences156671 -Node: Regexp Operators162682 -Ref: Regexp Operators-Footnote-1170108 -Ref: Regexp Operators-Footnote-2170255 -Node: Bracket Expressions170353 -Ref: table-char-classes172368 -Node: Leftmost Longest175292 -Node: Computed Regexps176594 -Node: GNU Regexp Operators179991 -Node: Case-sensitivity183664 -Ref: Case-sensitivity-Footnote-1186549 -Ref: Case-sensitivity-Footnote-2186784 -Node: Regexp Summary186892 -Node: Reading Files188359 -Node: Records190453 -Node: awk split records191186 -Node: gawk split records196101 -Ref: gawk split records-Footnote-1200641 -Node: Fields200678 -Ref: Fields-Footnote-1203454 -Node: Nonconstant Fields203540 -Ref: Nonconstant Fields-Footnote-1205783 -Node: Changing Fields205987 -Node: Field Separators211916 -Node: Default Field Splitting214621 -Node: Regexp Field Splitting215738 -Node: Single Character Fields219088 -Node: Command Line Field Separator220147 -Node: Full Line Fields223359 -Ref: Full Line Fields-Footnote-1224888 -Ref: Full Line Fields-Footnote-2224934 -Node: Field Splitting Summary225035 -Node: Constant Size227109 -Node: Splitting By Content231698 -Ref: Splitting By Content-Footnote-1235689 -Node: Multiple Line235852 -Ref: Multiple Line-Footnote-1241738 -Node: Getline241917 -Node: Plain Getline244129 -Node: Getline/Variable246769 -Node: Getline/File247917 -Node: Getline/Variable/File249301 -Ref: Getline/Variable/File-Footnote-1250904 -Node: Getline/Pipe250991 -Node: Getline/Variable/Pipe253674 -Node: Getline/Coprocess254805 -Node: Getline/Variable/Coprocess256057 -Node: Getline Notes256796 -Node: Getline Summary259588 -Ref: table-getline-variants260000 -Node: Read Timeout260829 -Ref: Read Timeout-Footnote-1264648 -Node: Command-line directories264706 -Node: Input Summary265611 -Node: Input Exercises268864 -Node: Printing269592 -Node: Print271369 -Node: Print Examples272826 -Node: Output Separators275605 -Node: OFMT277623 -Node: Printf278977 -Node: Basic Printf279762 -Node: Control Letters281331 -Node: Format Modifiers285315 -Node: Printf Examples291316 -Node: Redirection293802 -Node: Special FD300643 -Ref: Special FD-Footnote-1303803 -Node: Special Files303877 -Node: Other Inherited Files304494 -Node: Special Network305494 -Node: Special Caveats306356 -Node: Close Files And Pipes307307 -Ref: Close Files And Pipes-Footnote-1314489 -Ref: Close Files And Pipes-Footnote-2314637 -Node: Output Summary314787 -Node: Output Exercises315785 -Node: Expressions316465 -Node: Values317650 -Node: Constants318328 -Node: Scalar Constants319019 -Ref: Scalar Constants-Footnote-1319878 -Node: Nondecimal-numbers320128 -Node: Regexp Constants323146 -Node: Using Constant Regexps323671 -Node: Variables326814 -Node: Using Variables327469 -Node: Assignment Options329380 -Node: Conversion331255 -Node: Strings And Numbers331779 -Ref: Strings And Numbers-Footnote-1334844 -Node: Locale influences conversions334953 -Ref: table-locale-affects337700 -Node: All Operators338288 -Node: Arithmetic Ops338918 -Node: Concatenation341423 -Ref: Concatenation-Footnote-1344242 -Node: Assignment Ops344348 -Ref: table-assign-ops349327 -Node: Increment Ops350599 -Node: Truth Values and Conditions354037 -Node: Truth Values355122 -Node: Typing and Comparison356171 -Node: Variable Typing356981 -Node: Comparison Operators360634 -Ref: table-relational-ops361044 -Node: POSIX String Comparison364539 -Ref: POSIX String Comparison-Footnote-1365611 -Node: Boolean Ops365749 -Ref: Boolean Ops-Footnote-1370228 -Node: Conditional Exp370319 -Node: Function Calls372046 -Node: Precedence375926 -Node: Locales379587 -Node: Expressions Summary381219 -Node: Patterns and Actions383779 -Node: Pattern Overview384899 -Node: Regexp Patterns386578 -Node: Expression Patterns387121 -Node: Ranges390902 -Node: BEGIN/END394008 -Node: Using BEGIN/END394769 -Ref: Using BEGIN/END-Footnote-1397503 -Node: I/O And BEGIN/END397609 -Node: BEGINFILE/ENDFILE399923 -Node: Empty402824 -Node: Using Shell Variables403141 -Node: Action Overview405414 -Node: Statements407740 -Node: If Statement409588 -Node: While Statement411083 -Node: Do Statement413112 -Node: For Statement414256 -Node: Switch Statement417413 -Node: Break Statement419795 -Node: Continue Statement421836 -Node: Next Statement423663 -Node: Nextfile Statement426044 -Node: Exit Statement428674 -Node: Built-in Variables431077 -Node: User-modified432210 -Ref: User-modified-Footnote-1439891 -Node: Auto-set439953 -Ref: Auto-set-Footnote-1452988 -Ref: Auto-set-Footnote-2453193 -Node: ARGC and ARGV453249 -Node: Pattern Action Summary457467 -Node: Arrays459894 -Node: Array Basics461223 -Node: Array Intro462067 -Ref: figure-array-elements464031 -Ref: Array Intro-Footnote-1466557 -Node: Reference to Elements466685 -Node: Assigning Elements469137 -Node: Array Example469628 -Node: Scanning an Array471386 -Node: Controlling Scanning474402 -Ref: Controlling Scanning-Footnote-1479598 -Node: Numeric Array Subscripts479914 -Node: Uninitialized Subscripts482099 -Node: Delete483716 -Ref: Delete-Footnote-1486459 -Node: Multidimensional486516 -Node: Multiscanning489613 -Node: Arrays of Arrays491202 -Node: Arrays Summary495961 -Node: Functions498053 -Node: Built-in498926 -Node: Calling Built-in500004 -Node: Numeric Functions501995 -Ref: Numeric Functions-Footnote-1506012 -Ref: Numeric Functions-Footnote-2506369 -Ref: Numeric Functions-Footnote-3506417 -Node: String Functions506689 -Ref: String Functions-Footnote-1530164 -Ref: String Functions-Footnote-2530293 -Ref: String Functions-Footnote-3530541 -Node: Gory Details530628 -Ref: table-sub-escapes532409 -Ref: table-sub-proposed533929 -Ref: table-posix-sub535293 -Ref: table-gensub-escapes536829 -Ref: Gory Details-Footnote-1537661 -Node: I/O Functions537812 -Ref: I/O Functions-Footnote-1545030 -Node: Time Functions545177 -Ref: Time Functions-Footnote-1555665 -Ref: Time Functions-Footnote-2555733 -Ref: Time Functions-Footnote-3555891 -Ref: Time Functions-Footnote-4556002 -Ref: Time Functions-Footnote-5556114 -Ref: Time Functions-Footnote-6556341 -Node: Bitwise Functions556607 -Ref: table-bitwise-ops557169 -Ref: Bitwise Functions-Footnote-1561478 -Node: Type Functions561647 -Node: I18N Functions562798 -Node: User-defined564443 -Node: Definition Syntax565248 -Ref: Definition Syntax-Footnote-1570655 -Node: Function Example570726 -Ref: Function Example-Footnote-1573645 -Node: Function Caveats573667 -Node: Calling A Function574185 -Node: Variable Scope575143 -Node: Pass By Value/Reference578131 -Node: Return Statement581626 -Node: Dynamic Typing584607 -Node: Indirect Calls585536 -Ref: Indirect Calls-Footnote-1596838 -Node: Functions Summary596966 -Node: Library Functions599668 -Ref: Library Functions-Footnote-1603277 -Ref: Library Functions-Footnote-2603420 -Node: Library Names603591 -Ref: Library Names-Footnote-1607045 -Ref: Library Names-Footnote-2607268 -Node: General Functions607354 -Node: Strtonum Function608457 -Node: Assert Function611479 -Node: Round Function614803 -Node: Cliff Random Function616344 -Node: Ordinal Functions617360 -Ref: Ordinal Functions-Footnote-1620423 -Ref: Ordinal Functions-Footnote-2620675 -Node: Join Function620886 -Ref: Join Function-Footnote-1622655 -Node: Getlocaltime Function622855 -Node: Readfile Function626599 -Node: Shell Quoting628569 -Node: Data File Management629970 -Node: Filetrans Function630602 -Node: Rewind Function634658 -Node: File Checking636045 -Ref: File Checking-Footnote-1637377 -Node: Empty Files637578 -Node: Ignoring Assigns639557 -Node: Getopt Function641108 -Ref: Getopt Function-Footnote-1652570 -Node: Passwd Functions652770 -Ref: Passwd Functions-Footnote-1661619 -Node: Group Functions661707 -Ref: Group Functions-Footnote-1669601 -Node: Walking Arrays669814 -Node: Library Functions Summary671417 -Node: Library Exercises672818 -Node: Sample Programs674098 -Node: Running Examples674868 -Node: Clones675596 -Node: Cut Program676820 -Node: Egrep Program686539 -Ref: Egrep Program-Footnote-1694037 -Node: Id Program694147 -Node: Split Program697792 -Ref: Split Program-Footnote-1701240 -Node: Tee Program701368 -Node: Uniq Program704157 -Node: Wc Program711576 -Ref: Wc Program-Footnote-1715826 -Node: Miscellaneous Programs715920 -Node: Dupword Program717133 -Node: Alarm Program719164 -Node: Translate Program723968 -Ref: Translate Program-Footnote-1728533 -Node: Labels Program728803 -Ref: Labels Program-Footnote-1732154 -Node: Word Sorting732238 -Node: History Sorting736309 -Node: Extract Program738145 -Node: Simple Sed745670 -Node: Igawk Program748738 -Ref: Igawk Program-Footnote-1763062 -Ref: Igawk Program-Footnote-2763263 -Ref: Igawk Program-Footnote-3763385 -Node: Anagram Program763500 -Node: Signature Program766557 -Node: Programs Summary767804 -Node: Programs Exercises768997 -Ref: Programs Exercises-Footnote-1773128 -Node: Advanced Features773219 -Node: Nondecimal Data775167 -Node: Array Sorting776757 -Node: Controlling Array Traversal777454 -Ref: Controlling Array Traversal-Footnote-1785787 -Node: Array Sorting Functions785905 -Ref: Array Sorting Functions-Footnote-1789794 -Node: Two-way I/O789990 -Ref: Two-way I/O-Footnote-1794931 -Ref: Two-way I/O-Footnote-2795117 -Node: TCP/IP Networking795199 -Node: Profiling798072 -Node: Advanced Features Summary805619 -Node: Internationalization807552 -Node: I18N and L10N809032 -Node: Explaining gettext809718 -Ref: Explaining gettext-Footnote-1814743 -Ref: Explaining gettext-Footnote-2814927 -Node: Programmer i18n815092 -Ref: Programmer i18n-Footnote-1819958 -Node: Translator i18n820007 -Node: String Extraction820801 -Ref: String Extraction-Footnote-1821932 -Node: Printf Ordering822018 -Ref: Printf Ordering-Footnote-1824804 -Node: I18N Portability824868 -Ref: I18N Portability-Footnote-1827323 -Node: I18N Example827386 -Ref: I18N Example-Footnote-1830189 -Node: Gawk I18N830261 -Node: I18N Summary830899 -Node: Debugger832238 -Node: Debugging833260 -Node: Debugging Concepts833701 -Node: Debugging Terms835554 -Node: Awk Debugging838126 -Node: Sample Debugging Session839020 -Node: Debugger Invocation839540 -Node: Finding The Bug840924 -Node: List of Debugger Commands847399 -Node: Breakpoint Control848732 -Node: Debugger Execution Control852428 -Node: Viewing And Changing Data855792 -Node: Execution Stack859170 -Node: Debugger Info860807 -Node: Miscellaneous Debugger Commands864824 -Node: Readline Support869853 -Node: Limitations870745 -Node: Debugging Summary872859 -Node: Arbitrary Precision Arithmetic874027 -Node: Computer Arithmetic875443 -Ref: table-numeric-ranges879041 -Ref: Computer Arithmetic-Footnote-1879900 -Node: Math Definitions879957 -Ref: table-ieee-formats883245 -Ref: Math Definitions-Footnote-1883849 -Node: MPFR features883954 -Node: FP Math Caution885625 -Ref: FP Math Caution-Footnote-1886675 -Node: Inexactness of computations887044 -Node: Inexact representation888003 -Node: Comparing FP Values889360 -Node: Errors accumulate890442 -Node: Getting Accuracy891875 -Node: Try To Round894537 -Node: Setting precision895436 -Ref: table-predefined-precision-strings896120 -Node: Setting the rounding mode897909 -Ref: table-gawk-rounding-modes898273 -Ref: Setting the rounding mode-Footnote-1901728 -Node: Arbitrary Precision Integers901907 -Ref: Arbitrary Precision Integers-Footnote-1904893 -Node: POSIX Floating Point Problems905042 -Ref: POSIX Floating Point Problems-Footnote-1908915 -Node: Floating point summary908953 -Node: Dynamic Extensions911147 -Node: Extension Intro912699 -Node: Plugin License913965 -Node: Extension Mechanism Outline914762 -Ref: figure-load-extension915190 -Ref: figure-register-new-function916670 -Ref: figure-call-new-function917674 -Node: Extension API Description919660 -Node: Extension API Functions Introduction921110 -Node: General Data Types925934 -Ref: General Data Types-Footnote-1931673 -Node: Memory Allocation Functions931972 -Ref: Memory Allocation Functions-Footnote-1934811 -Node: Constructor Functions934907 -Node: Registration Functions936641 -Node: Extension Functions937326 -Node: Exit Callback Functions939623 -Node: Extension Version String940871 -Node: Input Parsers941536 -Node: Output Wrappers951413 -Node: Two-way processors955928 -Node: Printing Messages958132 -Ref: Printing Messages-Footnote-1959208 -Node: Updating `ERRNO'959360 -Node: Requesting Values960100 -Ref: table-value-types-returned960828 -Node: Accessing Parameters961785 -Node: Symbol Table Access963016 -Node: Symbol table by name963530 -Node: Symbol table by cookie965511 -Ref: Symbol table by cookie-Footnote-1969655 -Node: Cached values969718 -Ref: Cached values-Footnote-1973217 -Node: Array Manipulation973308 -Ref: Array Manipulation-Footnote-1974406 -Node: Array Data Types974443 -Ref: Array Data Types-Footnote-1977098 -Node: Array Functions977190 -Node: Flattening Arrays981044 -Node: Creating Arrays987936 -Node: Extension API Variables992705 -Node: Extension Versioning993341 -Node: Extension API Informational Variables995242 -Node: Extension API Boilerplate996330 -Node: Finding Extensions1000139 -Node: Extension Example1000699 -Node: Internal File Description1001471 -Node: Internal File Ops1005538 -Ref: Internal File Ops-Footnote-11017208 -Node: Using Internal File Ops1017348 -Ref: Using Internal File Ops-Footnote-11019731 -Node: Extension Samples1020004 -Node: Extension Sample File Functions1021530 -Node: Extension Sample Fnmatch1029168 -Node: Extension Sample Fork1030659 -Node: Extension Sample Inplace1031874 -Node: Extension Sample Ord1033549 -Node: Extension Sample Readdir1034385 -Ref: table-readdir-file-types1035261 -Node: Extension Sample Revout1036072 -Node: Extension Sample Rev2way1036662 -Node: Extension Sample Read write array1037402 -Node: Extension Sample Readfile1039342 -Node: Extension Sample Time1040437 -Node: Extension Sample API Tests1041786 -Node: gawkextlib1042277 -Node: Extension summary1044914 -Node: Extension Exercises1048591 -Node: Language History1049313 -Node: V7/SVR3.11050969 -Node: SVR41053150 -Node: POSIX1054595 -Node: BTL1055984 -Node: POSIX/GNU1056718 -Node: Feature History1062282 -Node: Common Extensions1075380 -Node: Ranges and Locales1076704 -Ref: Ranges and Locales-Footnote-11081322 -Ref: Ranges and Locales-Footnote-21081349 -Ref: Ranges and Locales-Footnote-31081583 -Node: Contributors1081804 -Node: History summary1087345 -Node: Installation1088715 -Node: Gawk Distribution1089661 -Node: Getting1090145 -Node: Extracting1090968 -Node: Distribution contents1092603 -Node: Unix Installation1098320 -Node: Quick Installation1098937 -Node: Additional Configuration Options1101361 -Node: Configuration Philosophy1103099 -Node: Non-Unix Installation1105468 -Node: PC Installation1105926 -Node: PC Binary Installation1107245 -Node: PC Compiling1109093 -Ref: PC Compiling-Footnote-11112114 -Node: PC Testing1112223 -Node: PC Using1113399 -Node: Cygwin1117514 -Node: MSYS1118337 -Node: VMS Installation1118837 -Node: VMS Compilation1119629 -Ref: VMS Compilation-Footnote-11120851 -Node: VMS Dynamic Extensions1120909 -Node: VMS Installation Details1122593 -Node: VMS Running1124845 -Node: VMS GNV1127681 -Node: VMS Old Gawk1128415 -Node: Bugs1128885 -Node: Other Versions1132768 -Node: Installation summary1139190 -Node: Notes1140246 -Node: Compatibility Mode1141111 -Node: Additions1141893 -Node: Accessing The Source1142818 -Node: Adding Code1144254 -Node: New Ports1150419 -Node: Derived Files1154901 -Ref: Derived Files-Footnote-11160376 -Ref: Derived Files-Footnote-21160410 -Ref: Derived Files-Footnote-31161006 -Node: Future Extensions1161120 -Node: Implementation Limitations1161726 -Node: Extension Design1162974 -Node: Old Extension Problems1164128 -Ref: Old Extension Problems-Footnote-11165645 -Node: Extension New Mechanism Goals1165702 -Ref: Extension New Mechanism Goals-Footnote-11169062 -Node: Extension Other Design Decisions1169251 -Node: Extension Future Growth1171359 -Node: Old Extension Mechanism1172195 -Node: Notes summary1173957 -Node: Basic Concepts1175143 -Node: Basic High Level1175824 -Ref: figure-general-flow1176096 -Ref: figure-process-flow1176695 -Ref: Basic High Level-Footnote-11179924 -Node: Basic Data Typing1180109 -Node: Glossary1183437 -Node: Copying1208595 -Node: GNU Free Documentation License1246151 -Node: Index1271287 +Node: Getting Started72926 +Node: Running gawk75359 +Node: One-shot76549 +Node: Read Terminal77797 +Node: Long79824 +Node: Executable Scripts81340 +Ref: Executable Scripts-Footnote-184129 +Node: Comments84232 +Node: Quoting86714 +Node: DOS Quoting92238 +Node: Sample Data Files92913 +Node: Very Simple95508 +Node: Two Rules100406 +Node: More Complex102292 +Node: Statements/Lines105154 +Ref: Statements/Lines-Footnote-1109609 +Node: Other Features109874 +Node: When110805 +Ref: When-Footnote-1112559 +Node: Intro Summary112624 +Node: Invoking Gawk113507 +Node: Command Line115021 +Node: Options115819 +Ref: Options-Footnote-1131750 +Node: Other Arguments131775 +Node: Naming Standard Input134723 +Node: Environment Variables135816 +Node: AWKPATH Variable136374 +Ref: AWKPATH Variable-Footnote-1139677 +Ref: AWKPATH Variable-Footnote-2139722 +Node: AWKLIBPATH Variable139982 +Node: Other Environment Variables141125 +Node: Exit Status144853 +Node: Include Files145529 +Node: Loading Shared Libraries149126 +Node: Obsolete150553 +Node: Undocumented151250 +Node: Invoking Summary151517 +Node: Regexp153181 +Node: Regexp Usage154635 +Node: Escape Sequences156672 +Node: Regexp Operators162683 +Ref: Regexp Operators-Footnote-1170109 +Ref: Regexp Operators-Footnote-2170256 +Node: Bracket Expressions170354 +Ref: table-char-classes172369 +Node: Leftmost Longest175293 +Node: Computed Regexps176595 +Node: GNU Regexp Operators179992 +Node: Case-sensitivity183665 +Ref: Case-sensitivity-Footnote-1186550 +Ref: Case-sensitivity-Footnote-2186785 +Node: Regexp Summary186893 +Node: Reading Files188360 +Node: Records190454 +Node: awk split records191187 +Node: gawk split records196102 +Ref: gawk split records-Footnote-1200642 +Node: Fields200679 +Ref: Fields-Footnote-1203455 +Node: Nonconstant Fields203541 +Ref: Nonconstant Fields-Footnote-1205784 +Node: Changing Fields205988 +Node: Field Separators211917 +Node: Default Field Splitting214622 +Node: Regexp Field Splitting215739 +Node: Single Character Fields219089 +Node: Command Line Field Separator220148 +Node: Full Line Fields223360 +Ref: Full Line Fields-Footnote-1224877 +Ref: Full Line Fields-Footnote-2224923 +Node: Field Splitting Summary225024 +Node: Constant Size227098 +Node: Splitting By Content231687 +Ref: Splitting By Content-Footnote-1235681 +Node: Multiple Line235844 +Ref: Multiple Line-Footnote-1241730 +Node: Getline241909 +Node: Plain Getline244121 +Node: Getline/Variable246761 +Node: Getline/File247909 +Node: Getline/Variable/File249293 +Ref: Getline/Variable/File-Footnote-1250896 +Node: Getline/Pipe250983 +Node: Getline/Variable/Pipe253666 +Node: Getline/Coprocess254797 +Node: Getline/Variable/Coprocess256049 +Node: Getline Notes256788 +Node: Getline Summary259580 +Ref: table-getline-variants259992 +Node: Read Timeout260821 +Ref: Read Timeout-Footnote-1264646 +Node: Command-line directories264704 +Node: Input Summary265609 +Node: Input Exercises268862 +Node: Printing269590 +Node: Print271367 +Node: Print Examples272824 +Node: Output Separators275603 +Node: OFMT277621 +Node: Printf278975 +Node: Basic Printf279760 +Node: Control Letters281329 +Node: Format Modifiers285313 +Node: Printf Examples291314 +Node: Redirection293800 +Node: Special FD300641 +Ref: Special FD-Footnote-1303801 +Node: Special Files303875 +Node: Other Inherited Files304492 +Node: Special Network305492 +Node: Special Caveats306354 +Node: Close Files And Pipes307305 +Ref: Close Files And Pipes-Footnote-1314487 +Ref: Close Files And Pipes-Footnote-2314635 +Node: Output Summary314785 +Node: Output Exercises315783 +Node: Expressions316463 +Node: Values317648 +Node: Constants318326 +Node: Scalar Constants319017 +Ref: Scalar Constants-Footnote-1319876 +Node: Nondecimal-numbers320126 +Node: Regexp Constants323144 +Node: Using Constant Regexps323669 +Node: Variables326812 +Node: Using Variables327467 +Node: Assignment Options329378 +Node: Conversion331253 +Node: Strings And Numbers331777 +Ref: Strings And Numbers-Footnote-1334842 +Node: Locale influences conversions334951 +Ref: table-locale-affects337698 +Node: All Operators338286 +Node: Arithmetic Ops338916 +Node: Concatenation341421 +Ref: Concatenation-Footnote-1344240 +Node: Assignment Ops344346 +Ref: table-assign-ops349325 +Node: Increment Ops350597 +Node: Truth Values and Conditions354035 +Node: Truth Values355120 +Node: Typing and Comparison356169 +Node: Variable Typing356979 +Node: Comparison Operators360632 +Ref: table-relational-ops361042 +Node: POSIX String Comparison364537 +Ref: POSIX String Comparison-Footnote-1365609 +Node: Boolean Ops365747 +Ref: Boolean Ops-Footnote-1370226 +Node: Conditional Exp370317 +Node: Function Calls372044 +Node: Precedence375924 +Node: Locales379585 +Node: Expressions Summary381217 +Node: Patterns and Actions383777 +Node: Pattern Overview384897 +Node: Regexp Patterns386576 +Node: Expression Patterns387119 +Node: Ranges390900 +Node: BEGIN/END394006 +Node: Using BEGIN/END394767 +Ref: Using BEGIN/END-Footnote-1397501 +Node: I/O And BEGIN/END397607 +Node: BEGINFILE/ENDFILE399921 +Node: Empty402822 +Node: Using Shell Variables403139 +Node: Action Overview405412 +Node: Statements407738 +Node: If Statement409586 +Node: While Statement411081 +Node: Do Statement413110 +Node: For Statement414254 +Node: Switch Statement417411 +Node: Break Statement419793 +Node: Continue Statement421834 +Node: Next Statement423661 +Node: Nextfile Statement426042 +Node: Exit Statement428672 +Node: Built-in Variables431075 +Node: User-modified432208 +Ref: User-modified-Footnote-1439889 +Node: Auto-set439951 +Ref: Auto-set-Footnote-1452986 +Ref: Auto-set-Footnote-2453191 +Node: ARGC and ARGV453247 +Node: Pattern Action Summary457465 +Node: Arrays459892 +Node: Array Basics461221 +Node: Array Intro462065 +Ref: figure-array-elements464029 +Ref: Array Intro-Footnote-1466555 +Node: Reference to Elements466683 +Node: Assigning Elements469135 +Node: Array Example469626 +Node: Scanning an Array471384 +Node: Controlling Scanning474400 +Ref: Controlling Scanning-Footnote-1479596 +Node: Numeric Array Subscripts479912 +Node: Uninitialized Subscripts482097 +Node: Delete483714 +Ref: Delete-Footnote-1486457 +Node: Multidimensional486514 +Node: Multiscanning489611 +Node: Arrays of Arrays491200 +Node: Arrays Summary495959 +Node: Functions498051 +Node: Built-in498924 +Node: Calling Built-in500002 +Node: Numeric Functions501993 +Ref: Numeric Functions-Footnote-1506010 +Ref: Numeric Functions-Footnote-2506367 +Ref: Numeric Functions-Footnote-3506415 +Node: String Functions506687 +Ref: String Functions-Footnote-1530162 +Ref: String Functions-Footnote-2530291 +Ref: String Functions-Footnote-3530539 +Node: Gory Details530626 +Ref: table-sub-escapes532407 +Ref: table-sub-proposed533927 +Ref: table-posix-sub535291 +Ref: table-gensub-escapes536827 +Ref: Gory Details-Footnote-1537659 +Node: I/O Functions537810 +Ref: I/O Functions-Footnote-1545028 +Node: Time Functions545175 +Ref: Time Functions-Footnote-1555663 +Ref: Time Functions-Footnote-2555731 +Ref: Time Functions-Footnote-3555889 +Ref: Time Functions-Footnote-4556000 +Ref: Time Functions-Footnote-5556112 +Ref: Time Functions-Footnote-6556339 +Node: Bitwise Functions556605 +Ref: table-bitwise-ops557167 +Ref: Bitwise Functions-Footnote-1561476 +Node: Type Functions561645 +Node: I18N Functions562796 +Node: User-defined564441 +Node: Definition Syntax565246 +Ref: Definition Syntax-Footnote-1570653 +Node: Function Example570724 +Ref: Function Example-Footnote-1573643 +Node: Function Caveats573665 +Node: Calling A Function574183 +Node: Variable Scope575141 +Node: Pass By Value/Reference578129 +Node: Return Statement581624 +Node: Dynamic Typing584605 +Node: Indirect Calls585534 +Ref: Indirect Calls-Footnote-1596836 +Node: Functions Summary596964 +Node: Library Functions599666 +Ref: Library Functions-Footnote-1603275 +Ref: Library Functions-Footnote-2603418 +Node: Library Names603589 +Ref: Library Names-Footnote-1607043 +Ref: Library Names-Footnote-2607266 +Node: General Functions607352 +Node: Strtonum Function608455 +Node: Assert Function611477 +Node: Round Function614801 +Node: Cliff Random Function616342 +Node: Ordinal Functions617358 +Ref: Ordinal Functions-Footnote-1620421 +Ref: Ordinal Functions-Footnote-2620673 +Node: Join Function620884 +Ref: Join Function-Footnote-1622653 +Node: Getlocaltime Function622853 +Node: Readfile Function626597 +Node: Shell Quoting628567 +Node: Data File Management629968 +Node: Filetrans Function630600 +Node: Rewind Function634656 +Node: File Checking636043 +Ref: File Checking-Footnote-1637375 +Node: Empty Files637576 +Node: Ignoring Assigns639555 +Node: Getopt Function641106 +Ref: Getopt Function-Footnote-1652568 +Node: Passwd Functions652768 +Ref: Passwd Functions-Footnote-1661605 +Node: Group Functions661693 +Ref: Group Functions-Footnote-1669587 +Node: Walking Arrays669800 +Node: Library Functions Summary671403 +Node: Library Exercises672804 +Node: Sample Programs674084 +Node: Running Examples674854 +Node: Clones675582 +Node: Cut Program676806 +Node: Egrep Program686525 +Ref: Egrep Program-Footnote-1694023 +Node: Id Program694133 +Node: Split Program697778 +Ref: Split Program-Footnote-1701226 +Node: Tee Program701354 +Node: Uniq Program704143 +Node: Wc Program711562 +Ref: Wc Program-Footnote-1715812 +Node: Miscellaneous Programs715906 +Node: Dupword Program717119 +Node: Alarm Program719150 +Node: Translate Program723954 +Ref: Translate Program-Footnote-1728519 +Node: Labels Program728789 +Ref: Labels Program-Footnote-1732140 +Node: Word Sorting732224 +Node: History Sorting736295 +Node: Extract Program738131 +Node: Simple Sed745656 +Node: Igawk Program748724 +Ref: Igawk Program-Footnote-1763048 +Ref: Igawk Program-Footnote-2763249 +Ref: Igawk Program-Footnote-3763371 +Node: Anagram Program763486 +Node: Signature Program766543 +Node: Programs Summary767790 +Node: Programs Exercises768983 +Ref: Programs Exercises-Footnote-1773114 +Node: Advanced Features773205 +Node: Nondecimal Data775153 +Node: Array Sorting776743 +Node: Controlling Array Traversal777440 +Ref: Controlling Array Traversal-Footnote-1785773 +Node: Array Sorting Functions785891 +Ref: Array Sorting Functions-Footnote-1789780 +Node: Two-way I/O789976 +Ref: Two-way I/O-Footnote-1794917 +Ref: Two-way I/O-Footnote-2795103 +Node: TCP/IP Networking795185 +Node: Profiling798058 +Node: Advanced Features Summary805605 +Node: Internationalization807538 +Node: I18N and L10N809018 +Node: Explaining gettext809704 +Ref: Explaining gettext-Footnote-1814729 +Ref: Explaining gettext-Footnote-2814913 +Node: Programmer i18n815078 +Ref: Programmer i18n-Footnote-1819944 +Node: Translator i18n819993 +Node: String Extraction820787 +Ref: String Extraction-Footnote-1821918 +Node: Printf Ordering822004 +Ref: Printf Ordering-Footnote-1824790 +Node: I18N Portability824854 +Ref: I18N Portability-Footnote-1827309 +Node: I18N Example827372 +Ref: I18N Example-Footnote-1830175 +Node: Gawk I18N830247 +Node: I18N Summary830885 +Node: Debugger832224 +Node: Debugging833246 +Node: Debugging Concepts833687 +Node: Debugging Terms835540 +Node: Awk Debugging838112 +Node: Sample Debugging Session839006 +Node: Debugger Invocation839526 +Node: Finding The Bug840910 +Node: List of Debugger Commands847385 +Node: Breakpoint Control848718 +Node: Debugger Execution Control852414 +Node: Viewing And Changing Data855778 +Node: Execution Stack859156 +Node: Debugger Info860793 +Node: Miscellaneous Debugger Commands864810 +Node: Readline Support869839 +Node: Limitations870731 +Node: Debugging Summary872845 +Node: Arbitrary Precision Arithmetic874013 +Node: Computer Arithmetic875429 +Ref: table-numeric-ranges879027 +Ref: Computer Arithmetic-Footnote-1879886 +Node: Math Definitions879943 +Ref: table-ieee-formats883231 +Ref: Math Definitions-Footnote-1883835 +Node: MPFR features883940 +Node: FP Math Caution885611 +Ref: FP Math Caution-Footnote-1886661 +Node: Inexactness of computations887030 +Node: Inexact representation887989 +Node: Comparing FP Values889346 +Node: Errors accumulate890428 +Node: Getting Accuracy891861 +Node: Try To Round894523 +Node: Setting precision895422 +Ref: table-predefined-precision-strings896106 +Node: Setting the rounding mode897895 +Ref: table-gawk-rounding-modes898259 +Ref: Setting the rounding mode-Footnote-1901714 +Node: Arbitrary Precision Integers901893 +Ref: Arbitrary Precision Integers-Footnote-1904879 +Node: POSIX Floating Point Problems905028 +Ref: POSIX Floating Point Problems-Footnote-1908901 +Node: Floating point summary908939 +Node: Dynamic Extensions911133 +Node: Extension Intro912685 +Node: Plugin License913951 +Node: Extension Mechanism Outline914748 +Ref: figure-load-extension915176 +Ref: figure-register-new-function916656 +Ref: figure-call-new-function917660 +Node: Extension API Description919646 +Node: Extension API Functions Introduction921096 +Node: General Data Types925920 +Ref: General Data Types-Footnote-1931659 +Node: Memory Allocation Functions931958 +Ref: Memory Allocation Functions-Footnote-1934797 +Node: Constructor Functions934893 +Node: Registration Functions936627 +Node: Extension Functions937312 +Node: Exit Callback Functions939609 +Node: Extension Version String940857 +Node: Input Parsers941522 +Node: Output Wrappers951399 +Node: Two-way processors955914 +Node: Printing Messages958118 +Ref: Printing Messages-Footnote-1959194 +Node: Updating `ERRNO'959346 +Node: Requesting Values960086 +Ref: table-value-types-returned960814 +Node: Accessing Parameters961771 +Node: Symbol Table Access963002 +Node: Symbol table by name963516 +Node: Symbol table by cookie965497 +Ref: Symbol table by cookie-Footnote-1969641 +Node: Cached values969704 +Ref: Cached values-Footnote-1973203 +Node: Array Manipulation973294 +Ref: Array Manipulation-Footnote-1974392 +Node: Array Data Types974429 +Ref: Array Data Types-Footnote-1977084 +Node: Array Functions977176 +Node: Flattening Arrays981030 +Node: Creating Arrays987922 +Node: Extension API Variables992691 +Node: Extension Versioning993327 +Node: Extension API Informational Variables995228 +Node: Extension API Boilerplate996316 +Node: Finding Extensions1000125 +Node: Extension Example1000685 +Node: Internal File Description1001457 +Node: Internal File Ops1005524 +Ref: Internal File Ops-Footnote-11017194 +Node: Using Internal File Ops1017334 +Ref: Using Internal File Ops-Footnote-11019717 +Node: Extension Samples1019990 +Node: Extension Sample File Functions1021516 +Node: Extension Sample Fnmatch1029154 +Node: Extension Sample Fork1030645 +Node: Extension Sample Inplace1031860 +Node: Extension Sample Ord1033535 +Node: Extension Sample Readdir1034371 +Ref: table-readdir-file-types1035247 +Node: Extension Sample Revout1036058 +Node: Extension Sample Rev2way1036648 +Node: Extension Sample Read write array1037388 +Node: Extension Sample Readfile1039328 +Node: Extension Sample Time1040423 +Node: Extension Sample API Tests1041772 +Node: gawkextlib1042263 +Node: Extension summary1044921 +Node: Extension Exercises1048598 +Node: Language History1049320 +Node: V7/SVR3.11050976 +Node: SVR41053157 +Node: POSIX1054602 +Node: BTL1055991 +Node: POSIX/GNU1056725 +Node: Feature History1062289 +Node: Common Extensions1075387 +Node: Ranges and Locales1076711 +Ref: Ranges and Locales-Footnote-11081329 +Ref: Ranges and Locales-Footnote-21081356 +Ref: Ranges and Locales-Footnote-31081590 +Node: Contributors1081811 +Node: History summary1087352 +Node: Installation1088722 +Node: Gawk Distribution1089668 +Node: Getting1090152 +Node: Extracting1090975 +Node: Distribution contents1092610 +Node: Unix Installation1098327 +Node: Quick Installation1098944 +Node: Additional Configuration Options1101368 +Node: Configuration Philosophy1103106 +Node: Non-Unix Installation1105475 +Node: PC Installation1105933 +Node: PC Binary Installation1107252 +Node: PC Compiling1109100 +Ref: PC Compiling-Footnote-11112121 +Node: PC Testing1112230 +Node: PC Using1113406 +Node: Cygwin1117521 +Node: MSYS1118344 +Node: VMS Installation1118844 +Node: VMS Compilation1119636 +Ref: VMS Compilation-Footnote-11120858 +Node: VMS Dynamic Extensions1120916 +Node: VMS Installation Details1122600 +Node: VMS Running1124852 +Node: VMS GNV1127688 +Node: VMS Old Gawk1128422 +Node: Bugs1128892 +Node: Other Versions1132775 +Node: Installation summary1139197 +Node: Notes1140253 +Node: Compatibility Mode1141118 +Node: Additions1141900 +Node: Accessing The Source1142825 +Node: Adding Code1144261 +Node: New Ports1150426 +Node: Derived Files1154908 +Ref: Derived Files-Footnote-11160383 +Ref: Derived Files-Footnote-21160417 +Ref: Derived Files-Footnote-31161013 +Node: Future Extensions1161127 +Node: Implementation Limitations1161733 +Node: Extension Design1162981 +Node: Old Extension Problems1164135 +Ref: Old Extension Problems-Footnote-11165652 +Node: Extension New Mechanism Goals1165709 +Ref: Extension New Mechanism Goals-Footnote-11169069 +Node: Extension Other Design Decisions1169258 +Node: Extension Future Growth1171366 +Node: Old Extension Mechanism1172202 +Node: Notes summary1173964 +Node: Basic Concepts1175150 +Node: Basic High Level1175831 +Ref: figure-general-flow1176103 +Ref: figure-process-flow1176702 +Ref: Basic High Level-Footnote-11179931 +Node: Basic Data Typing1180116 +Node: Glossary1183444 +Node: Copying1208602 +Node: GNU Free Documentation License1246158 +Node: Index1271294  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 4da01e05..66174009 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -2233,7 +2233,7 @@ the fourth edition and for his support during the work. Thanks to Jasmine Kwityn for her copy-editing work. @end ifset -Thanks to Michael Brennan for the Foreword. +Thanks to Michael Brennan for the Forewords. @cindex Duman, Patrice @cindex Berry, Karl @@ -7495,7 +7495,7 @@ on an incorrect implementation of @command{awk}, while @command{gawk} prints the full first line of the file, something like: @example -root:nSijPlPhZZwgE:0:0:Root:/: +root:x:0:0:Root:/: @end example @docbook @@ -7548,7 +7548,7 @@ on an incorrect implementation of @command{awk}, while @command{gawk} prints the full first line of the file, something like: @example -root:nSijPlPhZZwgE:0:0:Root:/: +root:x:0:0:Root:/: @end example @end cartouche @end ifnotdocbook @@ -7885,7 +7885,7 @@ will be @code{"FPAT"} if content-based field splitting is being used. @quotation NOTE Some programs export CSV data that contains embedded newlines between the double quotes. @command{gawk} provides no way to deal with this. -Because no formal specification for CSV data exists, there isn't much +Even though a formal specification for CSV data exists, there isn't much more to be done; the @code{FPAT} mechanism provides an elegant solution for the majority of cases, and the @command{gawk} developers are satisfied with that. @@ -8617,7 +8617,7 @@ Using @code{FILENAME} with @code{getline} is likely to be a source for confusion. @command{awk} opens a separate input stream from the current input file. However, by not using a variable, @code{$0} -and @code{NR} are still updated. If you're doing this, it's +and @code{NF} are still updated. If you're doing this, it's probably by accident, and you should reconsider what it is you're trying to accomplish. @@ -8760,7 +8760,7 @@ for the input to arrive: PROCINFO[Service, "READ_TIMEOUT"] = 1000 while ((Service |& getline) > 0) @{ print $0 - PROCINFO[S, "READ_TIMEOUT"] -= 100 + PROCINFO[Service, "READ_TIMEOUT"] -= 100 @} @end example @@ -22533,7 +22533,7 @@ A few lines representative of @command{pwcat}'s output are as follows: @cindex Robbins, Miriam @example $ @kbd{pwcat} -@print{} root:3Ov02d5VaUPB6:0:1:Operator:/:/bin/sh +@print{} root:x:0:1:Operator:/:/bin/sh @print{} nobody:*:65534:65534::/: @print{} daemon:*:1:1::/: @print{} sys:*:2:2::/:/bin/csh @@ -35117,7 +35117,7 @@ project provides a number of @command{gawk} extensions, including one for processing XML files. This is the evolution of the original @command{xgawk} (XML @command{gawk}) project. -As of this writing, there are five extensions: +As of this writing, there are six extensions: @itemize @value{BULLET} @item @@ -35134,6 +35134,9 @@ MPFR library extension (this provides access to a number of MPFR functions which @command{gawk}'s native MPFR support does not) +@item +Redis extension + @item XML parser extension, using the @uref{http://expat.sourceforge.net, Expat} XML parsing library @@ -39894,6 +39897,13 @@ pattern matches an input record, @command{awk} executes the rule's action. Actions are always enclosed in braces. (@xref{Action Overview}.) +@cindex Ada programming language +@cindex programming languages, Ada +@item Ada +A programming language originally defined by the U.S.@: Department of +Defense for embedded programming. It was designed to enforce good +Software Engineering practices. + @cindex Spencer, Henry @cindex @command{sed} utility @cindex amazing @command{awk} assembler (@command{aaa}) @@ -39905,13 +39915,6 @@ microcomputers. It is a good example of a program that would have been better written in another language. You can get it from @uref{http://awk.info/?awk100/aaa}. -@cindex Ada programming language -@cindex programming languages, Ada -@item Ada -A programming language originally defined by the U.S.@: Department of -Defense for embedded programming. It was designed to enforce good -Software Engineering practices. - @cindex amazingly workable formatter (@command{awf}) @cindex @command{awf} (amazingly workable formatter) program @item Amazingly Workable Formatter (@command{awf}) diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 7979b0ad..0f07e210 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -2200,7 +2200,7 @@ the fourth edition and for his support during the work. Thanks to Jasmine Kwityn for her copy-editing work. @end ifset -Thanks to Michael Brennan for the Foreword. +Thanks to Michael Brennan for the Forewords. @cindex Duman, Patrice @cindex Berry, Karl @@ -7186,7 +7186,7 @@ on an incorrect implementation of @command{awk}, while @command{gawk} prints the full first line of the file, something like: @example -root:nSijPlPhZZwgE:0:0:Root:/: +root:x:0:0:Root:/: @end example @end sidebar @@ -7486,7 +7486,7 @@ will be @code{"FPAT"} if content-based field splitting is being used. @quotation NOTE Some programs export CSV data that contains embedded newlines between the double quotes. @command{gawk} provides no way to deal with this. -Because no formal specification for CSV data exists, there isn't much +Even though a formal specification for CSV data exists, there isn't much more to be done; the @code{FPAT} mechanism provides an elegant solution for the majority of cases, and the @command{gawk} developers are satisfied with that. @@ -8218,7 +8218,7 @@ Using @code{FILENAME} with @code{getline} is likely to be a source for confusion. @command{awk} opens a separate input stream from the current input file. However, by not using a variable, @code{$0} -and @code{NR} are still updated. If you're doing this, it's +and @code{NF} are still updated. If you're doing this, it's probably by accident, and you should reconsider what it is you're trying to accomplish. @@ -8361,7 +8361,7 @@ for the input to arrive: PROCINFO[Service, "READ_TIMEOUT"] = 1000 while ((Service |& getline) > 0) @{ print $0 - PROCINFO[S, "READ_TIMEOUT"] -= 100 + PROCINFO[Service, "READ_TIMEOUT"] -= 100 @} @end example @@ -21626,7 +21626,7 @@ A few lines representative of @command{pwcat}'s output are as follows: @cindex Robbins, Miriam @example $ @kbd{pwcat} -@print{} root:3Ov02d5VaUPB6:0:1:Operator:/:/bin/sh +@print{} root:x:0:1:Operator:/:/bin/sh @print{} nobody:*:65534:65534::/: @print{} daemon:*:1:1::/: @print{} sys:*:2:2::/:/bin/csh @@ -34210,7 +34210,7 @@ project provides a number of @command{gawk} extensions, including one for processing XML files. This is the evolution of the original @command{xgawk} (XML @command{gawk}) project. -As of this writing, there are five extensions: +As of this writing, there are six extensions: @itemize @value{BULLET} @item @@ -34227,6 +34227,9 @@ MPFR library extension (this provides access to a number of MPFR functions which @command{gawk}'s native MPFR support does not) +@item +Redis extension + @item XML parser extension, using the @uref{http://expat.sourceforge.net, Expat} XML parsing library @@ -38987,6 +38990,13 @@ pattern matches an input record, @command{awk} executes the rule's action. Actions are always enclosed in braces. (@xref{Action Overview}.) +@cindex Ada programming language +@cindex programming languages, Ada +@item Ada +A programming language originally defined by the U.S.@: Department of +Defense for embedded programming. It was designed to enforce good +Software Engineering practices. + @cindex Spencer, Henry @cindex @command{sed} utility @cindex amazing @command{awk} assembler (@command{aaa}) @@ -38998,13 +39008,6 @@ microcomputers. It is a good example of a program that would have been better written in another language. You can get it from @uref{http://awk.info/?awk100/aaa}. -@cindex Ada programming language -@cindex programming languages, Ada -@item Ada -A programming language originally defined by the U.S.@: Department of -Defense for embedded programming. It was designed to enforce good -Software Engineering practices. - @cindex amazingly workable formatter (@command{awf}) @cindex @command{awf} (amazingly workable formatter) program @item Amazingly Workable Formatter (@command{awf}) -- cgit v1.2.3 From 3ceedbd1f9a0a1444d13aa64cd85db28cb17d219 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 5 Dec 2014 13:38:43 +0200 Subject: More info on CGI. --- doc/gawk.info | 1040 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 8 +- doc/gawktexi.in | 8 +- 3 files changed, 537 insertions(+), 519 deletions(-) diff --git a/doc/gawk.info b/doc/gawk.info index f77d742e..3e2ae355 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -2538,8 +2538,8 @@ The following list describes options mandated by the POSIX standard: applications that pass arguments through the URL; using this option prevents a malicious (or other) user from passing in options, assignments, or `awk' source code (via `-e') to the CGI - application. This option should be used with `#!' scripts (*note - Executable Scripts::), like so: + application.(1) This option should be used with `#!' scripts + (*note Executable Scripts::), like so: #! /usr/local/bin/gawk -E @@ -2756,7 +2756,7 @@ you would add these lines to the `.profile' file in your home directory: POSIXLY_CORRECT=true export POSIXLY_CORRECT - For a C shell-compatible shell,(1) you would add this line to the + For a C shell-compatible shell,(2) you would add this line to the `.login' file in your home directory: setenv POSIXLY_CORRECT true @@ -2767,7 +2767,12 @@ environments. ---------- Footnotes ---------- - (1) Not recommended. + (1) For more detail, please see Section 4.4 of RFC 3875 +(http://www.ietf.org/rfc/rfc3875). Also see the explanatory note sent +to the `gawk' bug mailing list +(http://lists.gnu.org/archive/html/bug-gawk/2014-11/msg00022.html). + + (2) Not recommended.  File: gawk.info, Node: Other Arguments, Next: Naming Standard Input, Prev: Options, Up: Invoking Gawk @@ -34332,518 +34337,519 @@ Node: Intro Summary112624 Node: Invoking Gawk113507 Node: Command Line115021 Node: Options115819 -Ref: Options-Footnote-1131750 -Node: Other Arguments131775 -Node: Naming Standard Input134723 -Node: Environment Variables135816 -Node: AWKPATH Variable136374 -Ref: AWKPATH Variable-Footnote-1139677 -Ref: AWKPATH Variable-Footnote-2139722 -Node: AWKLIBPATH Variable139982 -Node: Other Environment Variables141125 -Node: Exit Status144853 -Node: Include Files145529 -Node: Loading Shared Libraries149126 -Node: Obsolete150553 -Node: Undocumented151250 -Node: Invoking Summary151517 -Node: Regexp153181 -Node: Regexp Usage154635 -Node: Escape Sequences156672 -Node: Regexp Operators162683 -Ref: Regexp Operators-Footnote-1170109 -Ref: Regexp Operators-Footnote-2170256 -Node: Bracket Expressions170354 -Ref: table-char-classes172369 -Node: Leftmost Longest175293 -Node: Computed Regexps176595 -Node: GNU Regexp Operators179992 -Node: Case-sensitivity183665 -Ref: Case-sensitivity-Footnote-1186550 -Ref: Case-sensitivity-Footnote-2186785 -Node: Regexp Summary186893 -Node: Reading Files188360 -Node: Records190454 -Node: awk split records191187 -Node: gawk split records196102 -Ref: gawk split records-Footnote-1200642 -Node: Fields200679 -Ref: Fields-Footnote-1203455 -Node: Nonconstant Fields203541 -Ref: Nonconstant Fields-Footnote-1205784 -Node: Changing Fields205988 -Node: Field Separators211917 -Node: Default Field Splitting214622 -Node: Regexp Field Splitting215739 -Node: Single Character Fields219089 -Node: Command Line Field Separator220148 -Node: Full Line Fields223360 -Ref: Full Line Fields-Footnote-1224877 -Ref: Full Line Fields-Footnote-2224923 -Node: Field Splitting Summary225024 -Node: Constant Size227098 -Node: Splitting By Content231687 -Ref: Splitting By Content-Footnote-1235681 -Node: Multiple Line235844 -Ref: Multiple Line-Footnote-1241730 -Node: Getline241909 -Node: Plain Getline244121 -Node: Getline/Variable246761 -Node: Getline/File247909 -Node: Getline/Variable/File249293 -Ref: Getline/Variable/File-Footnote-1250896 -Node: Getline/Pipe250983 -Node: Getline/Variable/Pipe253666 -Node: Getline/Coprocess254797 -Node: Getline/Variable/Coprocess256049 -Node: Getline Notes256788 -Node: Getline Summary259580 -Ref: table-getline-variants259992 -Node: Read Timeout260821 -Ref: Read Timeout-Footnote-1264646 -Node: Command-line directories264704 -Node: Input Summary265609 -Node: Input Exercises268862 -Node: Printing269590 -Node: Print271367 -Node: Print Examples272824 -Node: Output Separators275603 -Node: OFMT277621 -Node: Printf278975 -Node: Basic Printf279760 -Node: Control Letters281329 -Node: Format Modifiers285313 -Node: Printf Examples291314 -Node: Redirection293800 -Node: Special FD300641 -Ref: Special FD-Footnote-1303801 -Node: Special Files303875 -Node: Other Inherited Files304492 -Node: Special Network305492 -Node: Special Caveats306354 -Node: Close Files And Pipes307305 -Ref: Close Files And Pipes-Footnote-1314487 -Ref: Close Files And Pipes-Footnote-2314635 -Node: Output Summary314785 -Node: Output Exercises315783 -Node: Expressions316463 -Node: Values317648 -Node: Constants318326 -Node: Scalar Constants319017 -Ref: Scalar Constants-Footnote-1319876 -Node: Nondecimal-numbers320126 -Node: Regexp Constants323144 -Node: Using Constant Regexps323669 -Node: Variables326812 -Node: Using Variables327467 -Node: Assignment Options329378 -Node: Conversion331253 -Node: Strings And Numbers331777 -Ref: Strings And Numbers-Footnote-1334842 -Node: Locale influences conversions334951 -Ref: table-locale-affects337698 -Node: All Operators338286 -Node: Arithmetic Ops338916 -Node: Concatenation341421 -Ref: Concatenation-Footnote-1344240 -Node: Assignment Ops344346 -Ref: table-assign-ops349325 -Node: Increment Ops350597 -Node: Truth Values and Conditions354035 -Node: Truth Values355120 -Node: Typing and Comparison356169 -Node: Variable Typing356979 -Node: Comparison Operators360632 -Ref: table-relational-ops361042 -Node: POSIX String Comparison364537 -Ref: POSIX String Comparison-Footnote-1365609 -Node: Boolean Ops365747 -Ref: Boolean Ops-Footnote-1370226 -Node: Conditional Exp370317 -Node: Function Calls372044 -Node: Precedence375924 -Node: Locales379585 -Node: Expressions Summary381217 -Node: Patterns and Actions383777 -Node: Pattern Overview384897 -Node: Regexp Patterns386576 -Node: Expression Patterns387119 -Node: Ranges390900 -Node: BEGIN/END394006 -Node: Using BEGIN/END394767 -Ref: Using BEGIN/END-Footnote-1397501 -Node: I/O And BEGIN/END397607 -Node: BEGINFILE/ENDFILE399921 -Node: Empty402822 -Node: Using Shell Variables403139 -Node: Action Overview405412 -Node: Statements407738 -Node: If Statement409586 -Node: While Statement411081 -Node: Do Statement413110 -Node: For Statement414254 -Node: Switch Statement417411 -Node: Break Statement419793 -Node: Continue Statement421834 -Node: Next Statement423661 -Node: Nextfile Statement426042 -Node: Exit Statement428672 -Node: Built-in Variables431075 -Node: User-modified432208 -Ref: User-modified-Footnote-1439889 -Node: Auto-set439951 -Ref: Auto-set-Footnote-1452986 -Ref: Auto-set-Footnote-2453191 -Node: ARGC and ARGV453247 -Node: Pattern Action Summary457465 -Node: Arrays459892 -Node: Array Basics461221 -Node: Array Intro462065 -Ref: figure-array-elements464029 -Ref: Array Intro-Footnote-1466555 -Node: Reference to Elements466683 -Node: Assigning Elements469135 -Node: Array Example469626 -Node: Scanning an Array471384 -Node: Controlling Scanning474400 -Ref: Controlling Scanning-Footnote-1479596 -Node: Numeric Array Subscripts479912 -Node: Uninitialized Subscripts482097 -Node: Delete483714 -Ref: Delete-Footnote-1486457 -Node: Multidimensional486514 -Node: Multiscanning489611 -Node: Arrays of Arrays491200 -Node: Arrays Summary495959 -Node: Functions498051 -Node: Built-in498924 -Node: Calling Built-in500002 -Node: Numeric Functions501993 -Ref: Numeric Functions-Footnote-1506010 -Ref: Numeric Functions-Footnote-2506367 -Ref: Numeric Functions-Footnote-3506415 -Node: String Functions506687 -Ref: String Functions-Footnote-1530162 -Ref: String Functions-Footnote-2530291 -Ref: String Functions-Footnote-3530539 -Node: Gory Details530626 -Ref: table-sub-escapes532407 -Ref: table-sub-proposed533927 -Ref: table-posix-sub535291 -Ref: table-gensub-escapes536827 -Ref: Gory Details-Footnote-1537659 -Node: I/O Functions537810 -Ref: I/O Functions-Footnote-1545028 -Node: Time Functions545175 -Ref: Time Functions-Footnote-1555663 -Ref: Time Functions-Footnote-2555731 -Ref: Time Functions-Footnote-3555889 -Ref: Time Functions-Footnote-4556000 -Ref: Time Functions-Footnote-5556112 -Ref: Time Functions-Footnote-6556339 -Node: Bitwise Functions556605 -Ref: table-bitwise-ops557167 -Ref: Bitwise Functions-Footnote-1561476 -Node: Type Functions561645 -Node: I18N Functions562796 -Node: User-defined564441 -Node: Definition Syntax565246 -Ref: Definition Syntax-Footnote-1570653 -Node: Function Example570724 -Ref: Function Example-Footnote-1573643 -Node: Function Caveats573665 -Node: Calling A Function574183 -Node: Variable Scope575141 -Node: Pass By Value/Reference578129 -Node: Return Statement581624 -Node: Dynamic Typing584605 -Node: Indirect Calls585534 -Ref: Indirect Calls-Footnote-1596836 -Node: Functions Summary596964 -Node: Library Functions599666 -Ref: Library Functions-Footnote-1603275 -Ref: Library Functions-Footnote-2603418 -Node: Library Names603589 -Ref: Library Names-Footnote-1607043 -Ref: Library Names-Footnote-2607266 -Node: General Functions607352 -Node: Strtonum Function608455 -Node: Assert Function611477 -Node: Round Function614801 -Node: Cliff Random Function616342 -Node: Ordinal Functions617358 -Ref: Ordinal Functions-Footnote-1620421 -Ref: Ordinal Functions-Footnote-2620673 -Node: Join Function620884 -Ref: Join Function-Footnote-1622653 -Node: Getlocaltime Function622853 -Node: Readfile Function626597 -Node: Shell Quoting628567 -Node: Data File Management629968 -Node: Filetrans Function630600 -Node: Rewind Function634656 -Node: File Checking636043 -Ref: File Checking-Footnote-1637375 -Node: Empty Files637576 -Node: Ignoring Assigns639555 -Node: Getopt Function641106 -Ref: Getopt Function-Footnote-1652568 -Node: Passwd Functions652768 -Ref: Passwd Functions-Footnote-1661605 -Node: Group Functions661693 -Ref: Group Functions-Footnote-1669587 -Node: Walking Arrays669800 -Node: Library Functions Summary671403 -Node: Library Exercises672804 -Node: Sample Programs674084 -Node: Running Examples674854 -Node: Clones675582 -Node: Cut Program676806 -Node: Egrep Program686525 -Ref: Egrep Program-Footnote-1694023 -Node: Id Program694133 -Node: Split Program697778 -Ref: Split Program-Footnote-1701226 -Node: Tee Program701354 -Node: Uniq Program704143 -Node: Wc Program711562 -Ref: Wc Program-Footnote-1715812 -Node: Miscellaneous Programs715906 -Node: Dupword Program717119 -Node: Alarm Program719150 -Node: Translate Program723954 -Ref: Translate Program-Footnote-1728519 -Node: Labels Program728789 -Ref: Labels Program-Footnote-1732140 -Node: Word Sorting732224 -Node: History Sorting736295 -Node: Extract Program738131 -Node: Simple Sed745656 -Node: Igawk Program748724 -Ref: Igawk Program-Footnote-1763048 -Ref: Igawk Program-Footnote-2763249 -Ref: Igawk Program-Footnote-3763371 -Node: Anagram Program763486 -Node: Signature Program766543 -Node: Programs Summary767790 -Node: Programs Exercises768983 -Ref: Programs Exercises-Footnote-1773114 -Node: Advanced Features773205 -Node: Nondecimal Data775153 -Node: Array Sorting776743 -Node: Controlling Array Traversal777440 -Ref: Controlling Array Traversal-Footnote-1785773 -Node: Array Sorting Functions785891 -Ref: Array Sorting Functions-Footnote-1789780 -Node: Two-way I/O789976 -Ref: Two-way I/O-Footnote-1794917 -Ref: Two-way I/O-Footnote-2795103 -Node: TCP/IP Networking795185 -Node: Profiling798058 -Node: Advanced Features Summary805605 -Node: Internationalization807538 -Node: I18N and L10N809018 -Node: Explaining gettext809704 -Ref: Explaining gettext-Footnote-1814729 -Ref: Explaining gettext-Footnote-2814913 -Node: Programmer i18n815078 -Ref: Programmer i18n-Footnote-1819944 -Node: Translator i18n819993 -Node: String Extraction820787 -Ref: String Extraction-Footnote-1821918 -Node: Printf Ordering822004 -Ref: Printf Ordering-Footnote-1824790 -Node: I18N Portability824854 -Ref: I18N Portability-Footnote-1827309 -Node: I18N Example827372 -Ref: I18N Example-Footnote-1830175 -Node: Gawk I18N830247 -Node: I18N Summary830885 -Node: Debugger832224 -Node: Debugging833246 -Node: Debugging Concepts833687 -Node: Debugging Terms835540 -Node: Awk Debugging838112 -Node: Sample Debugging Session839006 -Node: Debugger Invocation839526 -Node: Finding The Bug840910 -Node: List of Debugger Commands847385 -Node: Breakpoint Control848718 -Node: Debugger Execution Control852414 -Node: Viewing And Changing Data855778 -Node: Execution Stack859156 -Node: Debugger Info860793 -Node: Miscellaneous Debugger Commands864810 -Node: Readline Support869839 -Node: Limitations870731 -Node: Debugging Summary872845 -Node: Arbitrary Precision Arithmetic874013 -Node: Computer Arithmetic875429 -Ref: table-numeric-ranges879027 -Ref: Computer Arithmetic-Footnote-1879886 -Node: Math Definitions879943 -Ref: table-ieee-formats883231 -Ref: Math Definitions-Footnote-1883835 -Node: MPFR features883940 -Node: FP Math Caution885611 -Ref: FP Math Caution-Footnote-1886661 -Node: Inexactness of computations887030 -Node: Inexact representation887989 -Node: Comparing FP Values889346 -Node: Errors accumulate890428 -Node: Getting Accuracy891861 -Node: Try To Round894523 -Node: Setting precision895422 -Ref: table-predefined-precision-strings896106 -Node: Setting the rounding mode897895 -Ref: table-gawk-rounding-modes898259 -Ref: Setting the rounding mode-Footnote-1901714 -Node: Arbitrary Precision Integers901893 -Ref: Arbitrary Precision Integers-Footnote-1904879 -Node: POSIX Floating Point Problems905028 -Ref: POSIX Floating Point Problems-Footnote-1908901 -Node: Floating point summary908939 -Node: Dynamic Extensions911133 -Node: Extension Intro912685 -Node: Plugin License913951 -Node: Extension Mechanism Outline914748 -Ref: figure-load-extension915176 -Ref: figure-register-new-function916656 -Ref: figure-call-new-function917660 -Node: Extension API Description919646 -Node: Extension API Functions Introduction921096 -Node: General Data Types925920 -Ref: General Data Types-Footnote-1931659 -Node: Memory Allocation Functions931958 -Ref: Memory Allocation Functions-Footnote-1934797 -Node: Constructor Functions934893 -Node: Registration Functions936627 -Node: Extension Functions937312 -Node: Exit Callback Functions939609 -Node: Extension Version String940857 -Node: Input Parsers941522 -Node: Output Wrappers951399 -Node: Two-way processors955914 -Node: Printing Messages958118 -Ref: Printing Messages-Footnote-1959194 -Node: Updating `ERRNO'959346 -Node: Requesting Values960086 -Ref: table-value-types-returned960814 -Node: Accessing Parameters961771 -Node: Symbol Table Access963002 -Node: Symbol table by name963516 -Node: Symbol table by cookie965497 -Ref: Symbol table by cookie-Footnote-1969641 -Node: Cached values969704 -Ref: Cached values-Footnote-1973203 -Node: Array Manipulation973294 -Ref: Array Manipulation-Footnote-1974392 -Node: Array Data Types974429 -Ref: Array Data Types-Footnote-1977084 -Node: Array Functions977176 -Node: Flattening Arrays981030 -Node: Creating Arrays987922 -Node: Extension API Variables992691 -Node: Extension Versioning993327 -Node: Extension API Informational Variables995228 -Node: Extension API Boilerplate996316 -Node: Finding Extensions1000125 -Node: Extension Example1000685 -Node: Internal File Description1001457 -Node: Internal File Ops1005524 -Ref: Internal File Ops-Footnote-11017194 -Node: Using Internal File Ops1017334 -Ref: Using Internal File Ops-Footnote-11019717 -Node: Extension Samples1019990 -Node: Extension Sample File Functions1021516 -Node: Extension Sample Fnmatch1029154 -Node: Extension Sample Fork1030645 -Node: Extension Sample Inplace1031860 -Node: Extension Sample Ord1033535 -Node: Extension Sample Readdir1034371 -Ref: table-readdir-file-types1035247 -Node: Extension Sample Revout1036058 -Node: Extension Sample Rev2way1036648 -Node: Extension Sample Read write array1037388 -Node: Extension Sample Readfile1039328 -Node: Extension Sample Time1040423 -Node: Extension Sample API Tests1041772 -Node: gawkextlib1042263 -Node: Extension summary1044921 -Node: Extension Exercises1048598 -Node: Language History1049320 -Node: V7/SVR3.11050976 -Node: SVR41053157 -Node: POSIX1054602 -Node: BTL1055991 -Node: POSIX/GNU1056725 -Node: Feature History1062289 -Node: Common Extensions1075387 -Node: Ranges and Locales1076711 -Ref: Ranges and Locales-Footnote-11081329 -Ref: Ranges and Locales-Footnote-21081356 -Ref: Ranges and Locales-Footnote-31081590 -Node: Contributors1081811 -Node: History summary1087352 -Node: Installation1088722 -Node: Gawk Distribution1089668 -Node: Getting1090152 -Node: Extracting1090975 -Node: Distribution contents1092610 -Node: Unix Installation1098327 -Node: Quick Installation1098944 -Node: Additional Configuration Options1101368 -Node: Configuration Philosophy1103106 -Node: Non-Unix Installation1105475 -Node: PC Installation1105933 -Node: PC Binary Installation1107252 -Node: PC Compiling1109100 -Ref: PC Compiling-Footnote-11112121 -Node: PC Testing1112230 -Node: PC Using1113406 -Node: Cygwin1117521 -Node: MSYS1118344 -Node: VMS Installation1118844 -Node: VMS Compilation1119636 -Ref: VMS Compilation-Footnote-11120858 -Node: VMS Dynamic Extensions1120916 -Node: VMS Installation Details1122600 -Node: VMS Running1124852 -Node: VMS GNV1127688 -Node: VMS Old Gawk1128422 -Node: Bugs1128892 -Node: Other Versions1132775 -Node: Installation summary1139197 -Node: Notes1140253 -Node: Compatibility Mode1141118 -Node: Additions1141900 -Node: Accessing The Source1142825 -Node: Adding Code1144261 -Node: New Ports1150426 -Node: Derived Files1154908 -Ref: Derived Files-Footnote-11160383 -Ref: Derived Files-Footnote-21160417 -Ref: Derived Files-Footnote-31161013 -Node: Future Extensions1161127 -Node: Implementation Limitations1161733 -Node: Extension Design1162981 -Node: Old Extension Problems1164135 -Ref: Old Extension Problems-Footnote-11165652 -Node: Extension New Mechanism Goals1165709 -Ref: Extension New Mechanism Goals-Footnote-11169069 -Node: Extension Other Design Decisions1169258 -Node: Extension Future Growth1171366 -Node: Old Extension Mechanism1172202 -Node: Notes summary1173964 -Node: Basic Concepts1175150 -Node: Basic High Level1175831 -Ref: figure-general-flow1176103 -Ref: figure-process-flow1176702 -Ref: Basic High Level-Footnote-11179931 -Node: Basic Data Typing1180116 -Node: Glossary1183444 -Node: Copying1208602 -Node: GNU Free Documentation License1246158 -Node: Index1271294 +Ref: Options-Footnote-1131752 +Ref: Options-Footnote-2131981 +Node: Other Arguments132006 +Node: Naming Standard Input134954 +Node: Environment Variables136047 +Node: AWKPATH Variable136605 +Ref: AWKPATH Variable-Footnote-1139908 +Ref: AWKPATH Variable-Footnote-2139953 +Node: AWKLIBPATH Variable140213 +Node: Other Environment Variables141356 +Node: Exit Status145084 +Node: Include Files145760 +Node: Loading Shared Libraries149357 +Node: Obsolete150784 +Node: Undocumented151481 +Node: Invoking Summary151748 +Node: Regexp153412 +Node: Regexp Usage154866 +Node: Escape Sequences156903 +Node: Regexp Operators162914 +Ref: Regexp Operators-Footnote-1170340 +Ref: Regexp Operators-Footnote-2170487 +Node: Bracket Expressions170585 +Ref: table-char-classes172600 +Node: Leftmost Longest175524 +Node: Computed Regexps176826 +Node: GNU Regexp Operators180223 +Node: Case-sensitivity183896 +Ref: Case-sensitivity-Footnote-1186781 +Ref: Case-sensitivity-Footnote-2187016 +Node: Regexp Summary187124 +Node: Reading Files188591 +Node: Records190685 +Node: awk split records191418 +Node: gawk split records196333 +Ref: gawk split records-Footnote-1200873 +Node: Fields200910 +Ref: Fields-Footnote-1203686 +Node: Nonconstant Fields203772 +Ref: Nonconstant Fields-Footnote-1206015 +Node: Changing Fields206219 +Node: Field Separators212148 +Node: Default Field Splitting214853 +Node: Regexp Field Splitting215970 +Node: Single Character Fields219320 +Node: Command Line Field Separator220379 +Node: Full Line Fields223591 +Ref: Full Line Fields-Footnote-1225108 +Ref: Full Line Fields-Footnote-2225154 +Node: Field Splitting Summary225255 +Node: Constant Size227329 +Node: Splitting By Content231918 +Ref: Splitting By Content-Footnote-1235912 +Node: Multiple Line236075 +Ref: Multiple Line-Footnote-1241961 +Node: Getline242140 +Node: Plain Getline244352 +Node: Getline/Variable246992 +Node: Getline/File248140 +Node: Getline/Variable/File249524 +Ref: Getline/Variable/File-Footnote-1251127 +Node: Getline/Pipe251214 +Node: Getline/Variable/Pipe253897 +Node: Getline/Coprocess255028 +Node: Getline/Variable/Coprocess256280 +Node: Getline Notes257019 +Node: Getline Summary259811 +Ref: table-getline-variants260223 +Node: Read Timeout261052 +Ref: Read Timeout-Footnote-1264877 +Node: Command-line directories264935 +Node: Input Summary265840 +Node: Input Exercises269093 +Node: Printing269821 +Node: Print271598 +Node: Print Examples273055 +Node: Output Separators275834 +Node: OFMT277852 +Node: Printf279206 +Node: Basic Printf279991 +Node: Control Letters281560 +Node: Format Modifiers285544 +Node: Printf Examples291545 +Node: Redirection294031 +Node: Special FD300872 +Ref: Special FD-Footnote-1304032 +Node: Special Files304106 +Node: Other Inherited Files304723 +Node: Special Network305723 +Node: Special Caveats306585 +Node: Close Files And Pipes307536 +Ref: Close Files And Pipes-Footnote-1314718 +Ref: Close Files And Pipes-Footnote-2314866 +Node: Output Summary315016 +Node: Output Exercises316014 +Node: Expressions316694 +Node: Values317879 +Node: Constants318557 +Node: Scalar Constants319248 +Ref: Scalar Constants-Footnote-1320107 +Node: Nondecimal-numbers320357 +Node: Regexp Constants323375 +Node: Using Constant Regexps323900 +Node: Variables327043 +Node: Using Variables327698 +Node: Assignment Options329609 +Node: Conversion331484 +Node: Strings And Numbers332008 +Ref: Strings And Numbers-Footnote-1335073 +Node: Locale influences conversions335182 +Ref: table-locale-affects337929 +Node: All Operators338517 +Node: Arithmetic Ops339147 +Node: Concatenation341652 +Ref: Concatenation-Footnote-1344471 +Node: Assignment Ops344577 +Ref: table-assign-ops349556 +Node: Increment Ops350828 +Node: Truth Values and Conditions354266 +Node: Truth Values355351 +Node: Typing and Comparison356400 +Node: Variable Typing357210 +Node: Comparison Operators360863 +Ref: table-relational-ops361273 +Node: POSIX String Comparison364768 +Ref: POSIX String Comparison-Footnote-1365840 +Node: Boolean Ops365978 +Ref: Boolean Ops-Footnote-1370457 +Node: Conditional Exp370548 +Node: Function Calls372275 +Node: Precedence376155 +Node: Locales379816 +Node: Expressions Summary381448 +Node: Patterns and Actions384008 +Node: Pattern Overview385128 +Node: Regexp Patterns386807 +Node: Expression Patterns387350 +Node: Ranges391131 +Node: BEGIN/END394237 +Node: Using BEGIN/END394998 +Ref: Using BEGIN/END-Footnote-1397732 +Node: I/O And BEGIN/END397838 +Node: BEGINFILE/ENDFILE400152 +Node: Empty403053 +Node: Using Shell Variables403370 +Node: Action Overview405643 +Node: Statements407969 +Node: If Statement409817 +Node: While Statement411312 +Node: Do Statement413341 +Node: For Statement414485 +Node: Switch Statement417642 +Node: Break Statement420024 +Node: Continue Statement422065 +Node: Next Statement423892 +Node: Nextfile Statement426273 +Node: Exit Statement428903 +Node: Built-in Variables431306 +Node: User-modified432439 +Ref: User-modified-Footnote-1440120 +Node: Auto-set440182 +Ref: Auto-set-Footnote-1453217 +Ref: Auto-set-Footnote-2453422 +Node: ARGC and ARGV453478 +Node: Pattern Action Summary457696 +Node: Arrays460123 +Node: Array Basics461452 +Node: Array Intro462296 +Ref: figure-array-elements464260 +Ref: Array Intro-Footnote-1466786 +Node: Reference to Elements466914 +Node: Assigning Elements469366 +Node: Array Example469857 +Node: Scanning an Array471615 +Node: Controlling Scanning474631 +Ref: Controlling Scanning-Footnote-1479827 +Node: Numeric Array Subscripts480143 +Node: Uninitialized Subscripts482328 +Node: Delete483945 +Ref: Delete-Footnote-1486688 +Node: Multidimensional486745 +Node: Multiscanning489842 +Node: Arrays of Arrays491431 +Node: Arrays Summary496190 +Node: Functions498282 +Node: Built-in499155 +Node: Calling Built-in500233 +Node: Numeric Functions502224 +Ref: Numeric Functions-Footnote-1506241 +Ref: Numeric Functions-Footnote-2506598 +Ref: Numeric Functions-Footnote-3506646 +Node: String Functions506918 +Ref: String Functions-Footnote-1530393 +Ref: String Functions-Footnote-2530522 +Ref: String Functions-Footnote-3530770 +Node: Gory Details530857 +Ref: table-sub-escapes532638 +Ref: table-sub-proposed534158 +Ref: table-posix-sub535522 +Ref: table-gensub-escapes537058 +Ref: Gory Details-Footnote-1537890 +Node: I/O Functions538041 +Ref: I/O Functions-Footnote-1545259 +Node: Time Functions545406 +Ref: Time Functions-Footnote-1555894 +Ref: Time Functions-Footnote-2555962 +Ref: Time Functions-Footnote-3556120 +Ref: Time Functions-Footnote-4556231 +Ref: Time Functions-Footnote-5556343 +Ref: Time Functions-Footnote-6556570 +Node: Bitwise Functions556836 +Ref: table-bitwise-ops557398 +Ref: Bitwise Functions-Footnote-1561707 +Node: Type Functions561876 +Node: I18N Functions563027 +Node: User-defined564672 +Node: Definition Syntax565477 +Ref: Definition Syntax-Footnote-1570884 +Node: Function Example570955 +Ref: Function Example-Footnote-1573874 +Node: Function Caveats573896 +Node: Calling A Function574414 +Node: Variable Scope575372 +Node: Pass By Value/Reference578360 +Node: Return Statement581855 +Node: Dynamic Typing584836 +Node: Indirect Calls585765 +Ref: Indirect Calls-Footnote-1597067 +Node: Functions Summary597195 +Node: Library Functions599897 +Ref: Library Functions-Footnote-1603506 +Ref: Library Functions-Footnote-2603649 +Node: Library Names603820 +Ref: Library Names-Footnote-1607274 +Ref: Library Names-Footnote-2607497 +Node: General Functions607583 +Node: Strtonum Function608686 +Node: Assert Function611708 +Node: Round Function615032 +Node: Cliff Random Function616573 +Node: Ordinal Functions617589 +Ref: Ordinal Functions-Footnote-1620652 +Ref: Ordinal Functions-Footnote-2620904 +Node: Join Function621115 +Ref: Join Function-Footnote-1622884 +Node: Getlocaltime Function623084 +Node: Readfile Function626828 +Node: Shell Quoting628798 +Node: Data File Management630199 +Node: Filetrans Function630831 +Node: Rewind Function634887 +Node: File Checking636274 +Ref: File Checking-Footnote-1637606 +Node: Empty Files637807 +Node: Ignoring Assigns639786 +Node: Getopt Function641337 +Ref: Getopt Function-Footnote-1652799 +Node: Passwd Functions652999 +Ref: Passwd Functions-Footnote-1661836 +Node: Group Functions661924 +Ref: Group Functions-Footnote-1669818 +Node: Walking Arrays670031 +Node: Library Functions Summary671634 +Node: Library Exercises673035 +Node: Sample Programs674315 +Node: Running Examples675085 +Node: Clones675813 +Node: Cut Program677037 +Node: Egrep Program686756 +Ref: Egrep Program-Footnote-1694254 +Node: Id Program694364 +Node: Split Program698009 +Ref: Split Program-Footnote-1701457 +Node: Tee Program701585 +Node: Uniq Program704374 +Node: Wc Program711793 +Ref: Wc Program-Footnote-1716043 +Node: Miscellaneous Programs716137 +Node: Dupword Program717350 +Node: Alarm Program719381 +Node: Translate Program724185 +Ref: Translate Program-Footnote-1728750 +Node: Labels Program729020 +Ref: Labels Program-Footnote-1732371 +Node: Word Sorting732455 +Node: History Sorting736526 +Node: Extract Program738362 +Node: Simple Sed745887 +Node: Igawk Program748955 +Ref: Igawk Program-Footnote-1763279 +Ref: Igawk Program-Footnote-2763480 +Ref: Igawk Program-Footnote-3763602 +Node: Anagram Program763717 +Node: Signature Program766774 +Node: Programs Summary768021 +Node: Programs Exercises769214 +Ref: Programs Exercises-Footnote-1773345 +Node: Advanced Features773436 +Node: Nondecimal Data775384 +Node: Array Sorting776974 +Node: Controlling Array Traversal777671 +Ref: Controlling Array Traversal-Footnote-1786004 +Node: Array Sorting Functions786122 +Ref: Array Sorting Functions-Footnote-1790011 +Node: Two-way I/O790207 +Ref: Two-way I/O-Footnote-1795148 +Ref: Two-way I/O-Footnote-2795334 +Node: TCP/IP Networking795416 +Node: Profiling798289 +Node: Advanced Features Summary805836 +Node: Internationalization807769 +Node: I18N and L10N809249 +Node: Explaining gettext809935 +Ref: Explaining gettext-Footnote-1814960 +Ref: Explaining gettext-Footnote-2815144 +Node: Programmer i18n815309 +Ref: Programmer i18n-Footnote-1820175 +Node: Translator i18n820224 +Node: String Extraction821018 +Ref: String Extraction-Footnote-1822149 +Node: Printf Ordering822235 +Ref: Printf Ordering-Footnote-1825021 +Node: I18N Portability825085 +Ref: I18N Portability-Footnote-1827540 +Node: I18N Example827603 +Ref: I18N Example-Footnote-1830406 +Node: Gawk I18N830478 +Node: I18N Summary831116 +Node: Debugger832455 +Node: Debugging833477 +Node: Debugging Concepts833918 +Node: Debugging Terms835771 +Node: Awk Debugging838343 +Node: Sample Debugging Session839237 +Node: Debugger Invocation839757 +Node: Finding The Bug841141 +Node: List of Debugger Commands847616 +Node: Breakpoint Control848949 +Node: Debugger Execution Control852645 +Node: Viewing And Changing Data856009 +Node: Execution Stack859387 +Node: Debugger Info861024 +Node: Miscellaneous Debugger Commands865041 +Node: Readline Support870070 +Node: Limitations870962 +Node: Debugging Summary873076 +Node: Arbitrary Precision Arithmetic874244 +Node: Computer Arithmetic875660 +Ref: table-numeric-ranges879258 +Ref: Computer Arithmetic-Footnote-1880117 +Node: Math Definitions880174 +Ref: table-ieee-formats883462 +Ref: Math Definitions-Footnote-1884066 +Node: MPFR features884171 +Node: FP Math Caution885842 +Ref: FP Math Caution-Footnote-1886892 +Node: Inexactness of computations887261 +Node: Inexact representation888220 +Node: Comparing FP Values889577 +Node: Errors accumulate890659 +Node: Getting Accuracy892092 +Node: Try To Round894754 +Node: Setting precision895653 +Ref: table-predefined-precision-strings896337 +Node: Setting the rounding mode898126 +Ref: table-gawk-rounding-modes898490 +Ref: Setting the rounding mode-Footnote-1901945 +Node: Arbitrary Precision Integers902124 +Ref: Arbitrary Precision Integers-Footnote-1905110 +Node: POSIX Floating Point Problems905259 +Ref: POSIX Floating Point Problems-Footnote-1909132 +Node: Floating point summary909170 +Node: Dynamic Extensions911364 +Node: Extension Intro912916 +Node: Plugin License914182 +Node: Extension Mechanism Outline914979 +Ref: figure-load-extension915407 +Ref: figure-register-new-function916887 +Ref: figure-call-new-function917891 +Node: Extension API Description919877 +Node: Extension API Functions Introduction921327 +Node: General Data Types926151 +Ref: General Data Types-Footnote-1931890 +Node: Memory Allocation Functions932189 +Ref: Memory Allocation Functions-Footnote-1935028 +Node: Constructor Functions935124 +Node: Registration Functions936858 +Node: Extension Functions937543 +Node: Exit Callback Functions939840 +Node: Extension Version String941088 +Node: Input Parsers941753 +Node: Output Wrappers951630 +Node: Two-way processors956145 +Node: Printing Messages958349 +Ref: Printing Messages-Footnote-1959425 +Node: Updating `ERRNO'959577 +Node: Requesting Values960317 +Ref: table-value-types-returned961045 +Node: Accessing Parameters962002 +Node: Symbol Table Access963233 +Node: Symbol table by name963747 +Node: Symbol table by cookie965728 +Ref: Symbol table by cookie-Footnote-1969872 +Node: Cached values969935 +Ref: Cached values-Footnote-1973434 +Node: Array Manipulation973525 +Ref: Array Manipulation-Footnote-1974623 +Node: Array Data Types974660 +Ref: Array Data Types-Footnote-1977315 +Node: Array Functions977407 +Node: Flattening Arrays981261 +Node: Creating Arrays988153 +Node: Extension API Variables992922 +Node: Extension Versioning993558 +Node: Extension API Informational Variables995459 +Node: Extension API Boilerplate996547 +Node: Finding Extensions1000356 +Node: Extension Example1000916 +Node: Internal File Description1001688 +Node: Internal File Ops1005755 +Ref: Internal File Ops-Footnote-11017425 +Node: Using Internal File Ops1017565 +Ref: Using Internal File Ops-Footnote-11019948 +Node: Extension Samples1020221 +Node: Extension Sample File Functions1021747 +Node: Extension Sample Fnmatch1029385 +Node: Extension Sample Fork1030876 +Node: Extension Sample Inplace1032091 +Node: Extension Sample Ord1033766 +Node: Extension Sample Readdir1034602 +Ref: table-readdir-file-types1035478 +Node: Extension Sample Revout1036289 +Node: Extension Sample Rev2way1036879 +Node: Extension Sample Read write array1037619 +Node: Extension Sample Readfile1039559 +Node: Extension Sample Time1040654 +Node: Extension Sample API Tests1042003 +Node: gawkextlib1042494 +Node: Extension summary1045152 +Node: Extension Exercises1048829 +Node: Language History1049551 +Node: V7/SVR3.11051207 +Node: SVR41053388 +Node: POSIX1054833 +Node: BTL1056222 +Node: POSIX/GNU1056956 +Node: Feature History1062520 +Node: Common Extensions1075618 +Node: Ranges and Locales1076942 +Ref: Ranges and Locales-Footnote-11081560 +Ref: Ranges and Locales-Footnote-21081587 +Ref: Ranges and Locales-Footnote-31081821 +Node: Contributors1082042 +Node: History summary1087583 +Node: Installation1088953 +Node: Gawk Distribution1089899 +Node: Getting1090383 +Node: Extracting1091206 +Node: Distribution contents1092841 +Node: Unix Installation1098558 +Node: Quick Installation1099175 +Node: Additional Configuration Options1101599 +Node: Configuration Philosophy1103337 +Node: Non-Unix Installation1105706 +Node: PC Installation1106164 +Node: PC Binary Installation1107483 +Node: PC Compiling1109331 +Ref: PC Compiling-Footnote-11112352 +Node: PC Testing1112461 +Node: PC Using1113637 +Node: Cygwin1117752 +Node: MSYS1118575 +Node: VMS Installation1119075 +Node: VMS Compilation1119867 +Ref: VMS Compilation-Footnote-11121089 +Node: VMS Dynamic Extensions1121147 +Node: VMS Installation Details1122831 +Node: VMS Running1125083 +Node: VMS GNV1127919 +Node: VMS Old Gawk1128653 +Node: Bugs1129123 +Node: Other Versions1133006 +Node: Installation summary1139428 +Node: Notes1140484 +Node: Compatibility Mode1141349 +Node: Additions1142131 +Node: Accessing The Source1143056 +Node: Adding Code1144492 +Node: New Ports1150657 +Node: Derived Files1155139 +Ref: Derived Files-Footnote-11160614 +Ref: Derived Files-Footnote-21160648 +Ref: Derived Files-Footnote-31161244 +Node: Future Extensions1161358 +Node: Implementation Limitations1161964 +Node: Extension Design1163212 +Node: Old Extension Problems1164366 +Ref: Old Extension Problems-Footnote-11165883 +Node: Extension New Mechanism Goals1165940 +Ref: Extension New Mechanism Goals-Footnote-11169300 +Node: Extension Other Design Decisions1169489 +Node: Extension Future Growth1171597 +Node: Old Extension Mechanism1172433 +Node: Notes summary1174195 +Node: Basic Concepts1175381 +Node: Basic High Level1176062 +Ref: figure-general-flow1176334 +Ref: figure-process-flow1176933 +Ref: Basic High Level-Footnote-11180162 +Node: Basic Data Typing1180347 +Node: Glossary1183675 +Node: Copying1208833 +Node: GNU Free Documentation License1246389 +Node: Index1271525  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 66174009..42196498 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -3932,7 +3932,13 @@ Command-line variable assignments of the form This option is particularly necessary for World Wide Web CGI applications that pass arguments through the URL; using this option prevents a malicious (or other) user from passing in options, assignments, or @command{awk} source -code (via @option{-e}) to the CGI application. This option should be used +code (via @option{-e}) to the CGI application.@footnote{For more detail, +please see Section 4.4 of @uref{http://www.ietf.org/rfc/rfc3875, +RFC 3875}. Also see the +@uref{http://lists.gnu.org/archive/html/bug-gawk/2014-11/msg00022.html, +explanatory note sent to the @command{gawk} bug +mailing list}.} +This option should be used with @samp{#!} scripts (@pxref{Executable Scripts}), like so: @example diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 0f07e210..61e41804 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -3843,7 +3843,13 @@ Command-line variable assignments of the form This option is particularly necessary for World Wide Web CGI applications that pass arguments through the URL; using this option prevents a malicious (or other) user from passing in options, assignments, or @command{awk} source -code (via @option{-e}) to the CGI application. This option should be used +code (via @option{-e}) to the CGI application.@footnote{For more detail, +please see Section 4.4 of @uref{http://www.ietf.org/rfc/rfc3875, +RFC 3875}. Also see the +@uref{http://lists.gnu.org/archive/html/bug-gawk/2014-11/msg00022.html, +explanatory note sent to the @command{gawk} bug +mailing list}.} +This option should be used with @samp{#!} scripts (@pxref{Executable Scripts}), like so: @example -- cgit v1.2.3 From bf80c70c5aa0a98c02e3ce157153f7a40c516839 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 6 Dec 2014 20:56:01 +0200 Subject: A minor doc fix. --- doc/ChangeLog | 4 + doc/gawk.info | 870 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 4 files changed, 441 insertions(+), 437 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 96c48a39..e471559b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-06 Arnold D. Robbins + + * gawktexi.in: A minor fix. + 2014-12-05 Arnold D. Robbins * gawktexi.in: Various minor fixes and updates. diff --git a/doc/gawk.info b/doc/gawk.info index 3e2ae355..37a0d505 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -6378,7 +6378,7 @@ statements. For example: > }' -| Don't Panic! -Here, neither the `+' nor the `OUCH' appear in the output message. +Here, neither the `+' nor the `OUCH!' appear in the output message.  File: gawk.info, Node: Control Letters, Next: Format Modifiers, Prev: Basic Printf, Up: Printf @@ -34417,439 +34417,439 @@ Node: Output Separators275834 Node: OFMT277852 Node: Printf279206 Node: Basic Printf279991 -Node: Control Letters281560 -Node: Format Modifiers285544 -Node: Printf Examples291545 -Node: Redirection294031 -Node: Special FD300872 -Ref: Special FD-Footnote-1304032 -Node: Special Files304106 -Node: Other Inherited Files304723 -Node: Special Network305723 -Node: Special Caveats306585 -Node: Close Files And Pipes307536 -Ref: Close Files And Pipes-Footnote-1314718 -Ref: Close Files And Pipes-Footnote-2314866 -Node: Output Summary315016 -Node: Output Exercises316014 -Node: Expressions316694 -Node: Values317879 -Node: Constants318557 -Node: Scalar Constants319248 -Ref: Scalar Constants-Footnote-1320107 -Node: Nondecimal-numbers320357 -Node: Regexp Constants323375 -Node: Using Constant Regexps323900 -Node: Variables327043 -Node: Using Variables327698 -Node: Assignment Options329609 -Node: Conversion331484 -Node: Strings And Numbers332008 -Ref: Strings And Numbers-Footnote-1335073 -Node: Locale influences conversions335182 -Ref: table-locale-affects337929 -Node: All Operators338517 -Node: Arithmetic Ops339147 -Node: Concatenation341652 -Ref: Concatenation-Footnote-1344471 -Node: Assignment Ops344577 -Ref: table-assign-ops349556 -Node: Increment Ops350828 -Node: Truth Values and Conditions354266 -Node: Truth Values355351 -Node: Typing and Comparison356400 -Node: Variable Typing357210 -Node: Comparison Operators360863 -Ref: table-relational-ops361273 -Node: POSIX String Comparison364768 -Ref: POSIX String Comparison-Footnote-1365840 -Node: Boolean Ops365978 -Ref: Boolean Ops-Footnote-1370457 -Node: Conditional Exp370548 -Node: Function Calls372275 -Node: Precedence376155 -Node: Locales379816 -Node: Expressions Summary381448 -Node: Patterns and Actions384008 -Node: Pattern Overview385128 -Node: Regexp Patterns386807 -Node: Expression Patterns387350 -Node: Ranges391131 -Node: BEGIN/END394237 -Node: Using BEGIN/END394998 -Ref: Using BEGIN/END-Footnote-1397732 -Node: I/O And BEGIN/END397838 -Node: BEGINFILE/ENDFILE400152 -Node: Empty403053 -Node: Using Shell Variables403370 -Node: Action Overview405643 -Node: Statements407969 -Node: If Statement409817 -Node: While Statement411312 -Node: Do Statement413341 -Node: For Statement414485 -Node: Switch Statement417642 -Node: Break Statement420024 -Node: Continue Statement422065 -Node: Next Statement423892 -Node: Nextfile Statement426273 -Node: Exit Statement428903 -Node: Built-in Variables431306 -Node: User-modified432439 -Ref: User-modified-Footnote-1440120 -Node: Auto-set440182 -Ref: Auto-set-Footnote-1453217 -Ref: Auto-set-Footnote-2453422 -Node: ARGC and ARGV453478 -Node: Pattern Action Summary457696 -Node: Arrays460123 -Node: Array Basics461452 -Node: Array Intro462296 -Ref: figure-array-elements464260 -Ref: Array Intro-Footnote-1466786 -Node: Reference to Elements466914 -Node: Assigning Elements469366 -Node: Array Example469857 -Node: Scanning an Array471615 -Node: Controlling Scanning474631 -Ref: Controlling Scanning-Footnote-1479827 -Node: Numeric Array Subscripts480143 -Node: Uninitialized Subscripts482328 -Node: Delete483945 -Ref: Delete-Footnote-1486688 -Node: Multidimensional486745 -Node: Multiscanning489842 -Node: Arrays of Arrays491431 -Node: Arrays Summary496190 -Node: Functions498282 -Node: Built-in499155 -Node: Calling Built-in500233 -Node: Numeric Functions502224 -Ref: Numeric Functions-Footnote-1506241 -Ref: Numeric Functions-Footnote-2506598 -Ref: Numeric Functions-Footnote-3506646 -Node: String Functions506918 -Ref: String Functions-Footnote-1530393 -Ref: String Functions-Footnote-2530522 -Ref: String Functions-Footnote-3530770 -Node: Gory Details530857 -Ref: table-sub-escapes532638 -Ref: table-sub-proposed534158 -Ref: table-posix-sub535522 -Ref: table-gensub-escapes537058 -Ref: Gory Details-Footnote-1537890 -Node: I/O Functions538041 -Ref: I/O Functions-Footnote-1545259 -Node: Time Functions545406 -Ref: Time Functions-Footnote-1555894 -Ref: Time Functions-Footnote-2555962 -Ref: Time Functions-Footnote-3556120 -Ref: Time Functions-Footnote-4556231 -Ref: Time Functions-Footnote-5556343 -Ref: Time Functions-Footnote-6556570 -Node: Bitwise Functions556836 -Ref: table-bitwise-ops557398 -Ref: Bitwise Functions-Footnote-1561707 -Node: Type Functions561876 -Node: I18N Functions563027 -Node: User-defined564672 -Node: Definition Syntax565477 -Ref: Definition Syntax-Footnote-1570884 -Node: Function Example570955 -Ref: Function Example-Footnote-1573874 -Node: Function Caveats573896 -Node: Calling A Function574414 -Node: Variable Scope575372 -Node: Pass By Value/Reference578360 -Node: Return Statement581855 -Node: Dynamic Typing584836 -Node: Indirect Calls585765 -Ref: Indirect Calls-Footnote-1597067 -Node: Functions Summary597195 -Node: Library Functions599897 -Ref: Library Functions-Footnote-1603506 -Ref: Library Functions-Footnote-2603649 -Node: Library Names603820 -Ref: Library Names-Footnote-1607274 -Ref: Library Names-Footnote-2607497 -Node: General Functions607583 -Node: Strtonum Function608686 -Node: Assert Function611708 -Node: Round Function615032 -Node: Cliff Random Function616573 -Node: Ordinal Functions617589 -Ref: Ordinal Functions-Footnote-1620652 -Ref: Ordinal Functions-Footnote-2620904 -Node: Join Function621115 -Ref: Join Function-Footnote-1622884 -Node: Getlocaltime Function623084 -Node: Readfile Function626828 -Node: Shell Quoting628798 -Node: Data File Management630199 -Node: Filetrans Function630831 -Node: Rewind Function634887 -Node: File Checking636274 -Ref: File Checking-Footnote-1637606 -Node: Empty Files637807 -Node: Ignoring Assigns639786 -Node: Getopt Function641337 -Ref: Getopt Function-Footnote-1652799 -Node: Passwd Functions652999 -Ref: Passwd Functions-Footnote-1661836 -Node: Group Functions661924 -Ref: Group Functions-Footnote-1669818 -Node: Walking Arrays670031 -Node: Library Functions Summary671634 -Node: Library Exercises673035 -Node: Sample Programs674315 -Node: Running Examples675085 -Node: Clones675813 -Node: Cut Program677037 -Node: Egrep Program686756 -Ref: Egrep Program-Footnote-1694254 -Node: Id Program694364 -Node: Split Program698009 -Ref: Split Program-Footnote-1701457 -Node: Tee Program701585 -Node: Uniq Program704374 -Node: Wc Program711793 -Ref: Wc Program-Footnote-1716043 -Node: Miscellaneous Programs716137 -Node: Dupword Program717350 -Node: Alarm Program719381 -Node: Translate Program724185 -Ref: Translate Program-Footnote-1728750 -Node: Labels Program729020 -Ref: Labels Program-Footnote-1732371 -Node: Word Sorting732455 -Node: History Sorting736526 -Node: Extract Program738362 -Node: Simple Sed745887 -Node: Igawk Program748955 -Ref: Igawk Program-Footnote-1763279 -Ref: Igawk Program-Footnote-2763480 -Ref: Igawk Program-Footnote-3763602 -Node: Anagram Program763717 -Node: Signature Program766774 -Node: Programs Summary768021 -Node: Programs Exercises769214 -Ref: Programs Exercises-Footnote-1773345 -Node: Advanced Features773436 -Node: Nondecimal Data775384 -Node: Array Sorting776974 -Node: Controlling Array Traversal777671 -Ref: Controlling Array Traversal-Footnote-1786004 -Node: Array Sorting Functions786122 -Ref: Array Sorting Functions-Footnote-1790011 -Node: Two-way I/O790207 -Ref: Two-way I/O-Footnote-1795148 -Ref: Two-way I/O-Footnote-2795334 -Node: TCP/IP Networking795416 -Node: Profiling798289 -Node: Advanced Features Summary805836 -Node: Internationalization807769 -Node: I18N and L10N809249 -Node: Explaining gettext809935 -Ref: Explaining gettext-Footnote-1814960 -Ref: Explaining gettext-Footnote-2815144 -Node: Programmer i18n815309 -Ref: Programmer i18n-Footnote-1820175 -Node: Translator i18n820224 -Node: String Extraction821018 -Ref: String Extraction-Footnote-1822149 -Node: Printf Ordering822235 -Ref: Printf Ordering-Footnote-1825021 -Node: I18N Portability825085 -Ref: I18N Portability-Footnote-1827540 -Node: I18N Example827603 -Ref: I18N Example-Footnote-1830406 -Node: Gawk I18N830478 -Node: I18N Summary831116 -Node: Debugger832455 -Node: Debugging833477 -Node: Debugging Concepts833918 -Node: Debugging Terms835771 -Node: Awk Debugging838343 -Node: Sample Debugging Session839237 -Node: Debugger Invocation839757 -Node: Finding The Bug841141 -Node: List of Debugger Commands847616 -Node: Breakpoint Control848949 -Node: Debugger Execution Control852645 -Node: Viewing And Changing Data856009 -Node: Execution Stack859387 -Node: Debugger Info861024 -Node: Miscellaneous Debugger Commands865041 -Node: Readline Support870070 -Node: Limitations870962 -Node: Debugging Summary873076 -Node: Arbitrary Precision Arithmetic874244 -Node: Computer Arithmetic875660 -Ref: table-numeric-ranges879258 -Ref: Computer Arithmetic-Footnote-1880117 -Node: Math Definitions880174 -Ref: table-ieee-formats883462 -Ref: Math Definitions-Footnote-1884066 -Node: MPFR features884171 -Node: FP Math Caution885842 -Ref: FP Math Caution-Footnote-1886892 -Node: Inexactness of computations887261 -Node: Inexact representation888220 -Node: Comparing FP Values889577 -Node: Errors accumulate890659 -Node: Getting Accuracy892092 -Node: Try To Round894754 -Node: Setting precision895653 -Ref: table-predefined-precision-strings896337 -Node: Setting the rounding mode898126 -Ref: table-gawk-rounding-modes898490 -Ref: Setting the rounding mode-Footnote-1901945 -Node: Arbitrary Precision Integers902124 -Ref: Arbitrary Precision Integers-Footnote-1905110 -Node: POSIX Floating Point Problems905259 -Ref: POSIX Floating Point Problems-Footnote-1909132 -Node: Floating point summary909170 -Node: Dynamic Extensions911364 -Node: Extension Intro912916 -Node: Plugin License914182 -Node: Extension Mechanism Outline914979 -Ref: figure-load-extension915407 -Ref: figure-register-new-function916887 -Ref: figure-call-new-function917891 -Node: Extension API Description919877 -Node: Extension API Functions Introduction921327 -Node: General Data Types926151 -Ref: General Data Types-Footnote-1931890 -Node: Memory Allocation Functions932189 -Ref: Memory Allocation Functions-Footnote-1935028 -Node: Constructor Functions935124 -Node: Registration Functions936858 -Node: Extension Functions937543 -Node: Exit Callback Functions939840 -Node: Extension Version String941088 -Node: Input Parsers941753 -Node: Output Wrappers951630 -Node: Two-way processors956145 -Node: Printing Messages958349 -Ref: Printing Messages-Footnote-1959425 -Node: Updating `ERRNO'959577 -Node: Requesting Values960317 -Ref: table-value-types-returned961045 -Node: Accessing Parameters962002 -Node: Symbol Table Access963233 -Node: Symbol table by name963747 -Node: Symbol table by cookie965728 -Ref: Symbol table by cookie-Footnote-1969872 -Node: Cached values969935 -Ref: Cached values-Footnote-1973434 -Node: Array Manipulation973525 -Ref: Array Manipulation-Footnote-1974623 -Node: Array Data Types974660 -Ref: Array Data Types-Footnote-1977315 -Node: Array Functions977407 -Node: Flattening Arrays981261 -Node: Creating Arrays988153 -Node: Extension API Variables992922 -Node: Extension Versioning993558 -Node: Extension API Informational Variables995459 -Node: Extension API Boilerplate996547 -Node: Finding Extensions1000356 -Node: Extension Example1000916 -Node: Internal File Description1001688 -Node: Internal File Ops1005755 -Ref: Internal File Ops-Footnote-11017425 -Node: Using Internal File Ops1017565 -Ref: Using Internal File Ops-Footnote-11019948 -Node: Extension Samples1020221 -Node: Extension Sample File Functions1021747 -Node: Extension Sample Fnmatch1029385 -Node: Extension Sample Fork1030876 -Node: Extension Sample Inplace1032091 -Node: Extension Sample Ord1033766 -Node: Extension Sample Readdir1034602 -Ref: table-readdir-file-types1035478 -Node: Extension Sample Revout1036289 -Node: Extension Sample Rev2way1036879 -Node: Extension Sample Read write array1037619 -Node: Extension Sample Readfile1039559 -Node: Extension Sample Time1040654 -Node: Extension Sample API Tests1042003 -Node: gawkextlib1042494 -Node: Extension summary1045152 -Node: Extension Exercises1048829 -Node: Language History1049551 -Node: V7/SVR3.11051207 -Node: SVR41053388 -Node: POSIX1054833 -Node: BTL1056222 -Node: POSIX/GNU1056956 -Node: Feature History1062520 -Node: Common Extensions1075618 -Node: Ranges and Locales1076942 -Ref: Ranges and Locales-Footnote-11081560 -Ref: Ranges and Locales-Footnote-21081587 -Ref: Ranges and Locales-Footnote-31081821 -Node: Contributors1082042 -Node: History summary1087583 -Node: Installation1088953 -Node: Gawk Distribution1089899 -Node: Getting1090383 -Node: Extracting1091206 -Node: Distribution contents1092841 -Node: Unix Installation1098558 -Node: Quick Installation1099175 -Node: Additional Configuration Options1101599 -Node: Configuration Philosophy1103337 -Node: Non-Unix Installation1105706 -Node: PC Installation1106164 -Node: PC Binary Installation1107483 -Node: PC Compiling1109331 -Ref: PC Compiling-Footnote-11112352 -Node: PC Testing1112461 -Node: PC Using1113637 -Node: Cygwin1117752 -Node: MSYS1118575 -Node: VMS Installation1119075 -Node: VMS Compilation1119867 -Ref: VMS Compilation-Footnote-11121089 -Node: VMS Dynamic Extensions1121147 -Node: VMS Installation Details1122831 -Node: VMS Running1125083 -Node: VMS GNV1127919 -Node: VMS Old Gawk1128653 -Node: Bugs1129123 -Node: Other Versions1133006 -Node: Installation summary1139428 -Node: Notes1140484 -Node: Compatibility Mode1141349 -Node: Additions1142131 -Node: Accessing The Source1143056 -Node: Adding Code1144492 -Node: New Ports1150657 -Node: Derived Files1155139 -Ref: Derived Files-Footnote-11160614 -Ref: Derived Files-Footnote-21160648 -Ref: Derived Files-Footnote-31161244 -Node: Future Extensions1161358 -Node: Implementation Limitations1161964 -Node: Extension Design1163212 -Node: Old Extension Problems1164366 -Ref: Old Extension Problems-Footnote-11165883 -Node: Extension New Mechanism Goals1165940 -Ref: Extension New Mechanism Goals-Footnote-11169300 -Node: Extension Other Design Decisions1169489 -Node: Extension Future Growth1171597 -Node: Old Extension Mechanism1172433 -Node: Notes summary1174195 -Node: Basic Concepts1175381 -Node: Basic High Level1176062 -Ref: figure-general-flow1176334 -Ref: figure-process-flow1176933 -Ref: Basic High Level-Footnote-11180162 -Node: Basic Data Typing1180347 -Node: Glossary1183675 -Node: Copying1208833 -Node: GNU Free Documentation License1246389 -Node: Index1271525 +Node: Control Letters281561 +Node: Format Modifiers285545 +Node: Printf Examples291546 +Node: Redirection294032 +Node: Special FD300873 +Ref: Special FD-Footnote-1304033 +Node: Special Files304107 +Node: Other Inherited Files304724 +Node: Special Network305724 +Node: Special Caveats306586 +Node: Close Files And Pipes307537 +Ref: Close Files And Pipes-Footnote-1314719 +Ref: Close Files And Pipes-Footnote-2314867 +Node: Output Summary315017 +Node: Output Exercises316015 +Node: Expressions316695 +Node: Values317880 +Node: Constants318558 +Node: Scalar Constants319249 +Ref: Scalar Constants-Footnote-1320108 +Node: Nondecimal-numbers320358 +Node: Regexp Constants323376 +Node: Using Constant Regexps323901 +Node: Variables327044 +Node: Using Variables327699 +Node: Assignment Options329610 +Node: Conversion331485 +Node: Strings And Numbers332009 +Ref: Strings And Numbers-Footnote-1335074 +Node: Locale influences conversions335183 +Ref: table-locale-affects337930 +Node: All Operators338518 +Node: Arithmetic Ops339148 +Node: Concatenation341653 +Ref: Concatenation-Footnote-1344472 +Node: Assignment Ops344578 +Ref: table-assign-ops349557 +Node: Increment Ops350829 +Node: Truth Values and Conditions354267 +Node: Truth Values355352 +Node: Typing and Comparison356401 +Node: Variable Typing357211 +Node: Comparison Operators360864 +Ref: table-relational-ops361274 +Node: POSIX String Comparison364769 +Ref: POSIX String Comparison-Footnote-1365841 +Node: Boolean Ops365979 +Ref: Boolean Ops-Footnote-1370458 +Node: Conditional Exp370549 +Node: Function Calls372276 +Node: Precedence376156 +Node: Locales379817 +Node: Expressions Summary381449 +Node: Patterns and Actions384009 +Node: Pattern Overview385129 +Node: Regexp Patterns386808 +Node: Expression Patterns387351 +Node: Ranges391132 +Node: BEGIN/END394238 +Node: Using BEGIN/END394999 +Ref: Using BEGIN/END-Footnote-1397733 +Node: I/O And BEGIN/END397839 +Node: BEGINFILE/ENDFILE400153 +Node: Empty403054 +Node: Using Shell Variables403371 +Node: Action Overview405644 +Node: Statements407970 +Node: If Statement409818 +Node: While Statement411313 +Node: Do Statement413342 +Node: For Statement414486 +Node: Switch Statement417643 +Node: Break Statement420025 +Node: Continue Statement422066 +Node: Next Statement423893 +Node: Nextfile Statement426274 +Node: Exit Statement428904 +Node: Built-in Variables431307 +Node: User-modified432440 +Ref: User-modified-Footnote-1440121 +Node: Auto-set440183 +Ref: Auto-set-Footnote-1453218 +Ref: Auto-set-Footnote-2453423 +Node: ARGC and ARGV453479 +Node: Pattern Action Summary457697 +Node: Arrays460124 +Node: Array Basics461453 +Node: Array Intro462297 +Ref: figure-array-elements464261 +Ref: Array Intro-Footnote-1466787 +Node: Reference to Elements466915 +Node: Assigning Elements469367 +Node: Array Example469858 +Node: Scanning an Array471616 +Node: Controlling Scanning474632 +Ref: Controlling Scanning-Footnote-1479828 +Node: Numeric Array Subscripts480144 +Node: Uninitialized Subscripts482329 +Node: Delete483946 +Ref: Delete-Footnote-1486689 +Node: Multidimensional486746 +Node: Multiscanning489843 +Node: Arrays of Arrays491432 +Node: Arrays Summary496191 +Node: Functions498283 +Node: Built-in499156 +Node: Calling Built-in500234 +Node: Numeric Functions502225 +Ref: Numeric Functions-Footnote-1506242 +Ref: Numeric Functions-Footnote-2506599 +Ref: Numeric Functions-Footnote-3506647 +Node: String Functions506919 +Ref: String Functions-Footnote-1530394 +Ref: String Functions-Footnote-2530523 +Ref: String Functions-Footnote-3530771 +Node: Gory Details530858 +Ref: table-sub-escapes532639 +Ref: table-sub-proposed534159 +Ref: table-posix-sub535523 +Ref: table-gensub-escapes537059 +Ref: Gory Details-Footnote-1537891 +Node: I/O Functions538042 +Ref: I/O Functions-Footnote-1545260 +Node: Time Functions545407 +Ref: Time Functions-Footnote-1555895 +Ref: Time Functions-Footnote-2555963 +Ref: Time Functions-Footnote-3556121 +Ref: Time Functions-Footnote-4556232 +Ref: Time Functions-Footnote-5556344 +Ref: Time Functions-Footnote-6556571 +Node: Bitwise Functions556837 +Ref: table-bitwise-ops557399 +Ref: Bitwise Functions-Footnote-1561708 +Node: Type Functions561877 +Node: I18N Functions563028 +Node: User-defined564673 +Node: Definition Syntax565478 +Ref: Definition Syntax-Footnote-1570885 +Node: Function Example570956 +Ref: Function Example-Footnote-1573875 +Node: Function Caveats573897 +Node: Calling A Function574415 +Node: Variable Scope575373 +Node: Pass By Value/Reference578361 +Node: Return Statement581856 +Node: Dynamic Typing584837 +Node: Indirect Calls585766 +Ref: Indirect Calls-Footnote-1597068 +Node: Functions Summary597196 +Node: Library Functions599898 +Ref: Library Functions-Footnote-1603507 +Ref: Library Functions-Footnote-2603650 +Node: Library Names603821 +Ref: Library Names-Footnote-1607275 +Ref: Library Names-Footnote-2607498 +Node: General Functions607584 +Node: Strtonum Function608687 +Node: Assert Function611709 +Node: Round Function615033 +Node: Cliff Random Function616574 +Node: Ordinal Functions617590 +Ref: Ordinal Functions-Footnote-1620653 +Ref: Ordinal Functions-Footnote-2620905 +Node: Join Function621116 +Ref: Join Function-Footnote-1622885 +Node: Getlocaltime Function623085 +Node: Readfile Function626829 +Node: Shell Quoting628799 +Node: Data File Management630200 +Node: Filetrans Function630832 +Node: Rewind Function634888 +Node: File Checking636275 +Ref: File Checking-Footnote-1637607 +Node: Empty Files637808 +Node: Ignoring Assigns639787 +Node: Getopt Function641338 +Ref: Getopt Function-Footnote-1652800 +Node: Passwd Functions653000 +Ref: Passwd Functions-Footnote-1661837 +Node: Group Functions661925 +Ref: Group Functions-Footnote-1669819 +Node: Walking Arrays670032 +Node: Library Functions Summary671635 +Node: Library Exercises673036 +Node: Sample Programs674316 +Node: Running Examples675086 +Node: Clones675814 +Node: Cut Program677038 +Node: Egrep Program686757 +Ref: Egrep Program-Footnote-1694255 +Node: Id Program694365 +Node: Split Program698010 +Ref: Split Program-Footnote-1701458 +Node: Tee Program701586 +Node: Uniq Program704375 +Node: Wc Program711794 +Ref: Wc Program-Footnote-1716044 +Node: Miscellaneous Programs716138 +Node: Dupword Program717351 +Node: Alarm Program719382 +Node: Translate Program724186 +Ref: Translate Program-Footnote-1728751 +Node: Labels Program729021 +Ref: Labels Program-Footnote-1732372 +Node: Word Sorting732456 +Node: History Sorting736527 +Node: Extract Program738363 +Node: Simple Sed745888 +Node: Igawk Program748956 +Ref: Igawk Program-Footnote-1763280 +Ref: Igawk Program-Footnote-2763481 +Ref: Igawk Program-Footnote-3763603 +Node: Anagram Program763718 +Node: Signature Program766775 +Node: Programs Summary768022 +Node: Programs Exercises769215 +Ref: Programs Exercises-Footnote-1773346 +Node: Advanced Features773437 +Node: Nondecimal Data775385 +Node: Array Sorting776975 +Node: Controlling Array Traversal777672 +Ref: Controlling Array Traversal-Footnote-1786005 +Node: Array Sorting Functions786123 +Ref: Array Sorting Functions-Footnote-1790012 +Node: Two-way I/O790208 +Ref: Two-way I/O-Footnote-1795149 +Ref: Two-way I/O-Footnote-2795335 +Node: TCP/IP Networking795417 +Node: Profiling798290 +Node: Advanced Features Summary805837 +Node: Internationalization807770 +Node: I18N and L10N809250 +Node: Explaining gettext809936 +Ref: Explaining gettext-Footnote-1814961 +Ref: Explaining gettext-Footnote-2815145 +Node: Programmer i18n815310 +Ref: Programmer i18n-Footnote-1820176 +Node: Translator i18n820225 +Node: String Extraction821019 +Ref: String Extraction-Footnote-1822150 +Node: Printf Ordering822236 +Ref: Printf Ordering-Footnote-1825022 +Node: I18N Portability825086 +Ref: I18N Portability-Footnote-1827541 +Node: I18N Example827604 +Ref: I18N Example-Footnote-1830407 +Node: Gawk I18N830479 +Node: I18N Summary831117 +Node: Debugger832456 +Node: Debugging833478 +Node: Debugging Concepts833919 +Node: Debugging Terms835772 +Node: Awk Debugging838344 +Node: Sample Debugging Session839238 +Node: Debugger Invocation839758 +Node: Finding The Bug841142 +Node: List of Debugger Commands847617 +Node: Breakpoint Control848950 +Node: Debugger Execution Control852646 +Node: Viewing And Changing Data856010 +Node: Execution Stack859388 +Node: Debugger Info861025 +Node: Miscellaneous Debugger Commands865042 +Node: Readline Support870071 +Node: Limitations870963 +Node: Debugging Summary873077 +Node: Arbitrary Precision Arithmetic874245 +Node: Computer Arithmetic875661 +Ref: table-numeric-ranges879259 +Ref: Computer Arithmetic-Footnote-1880118 +Node: Math Definitions880175 +Ref: table-ieee-formats883463 +Ref: Math Definitions-Footnote-1884067 +Node: MPFR features884172 +Node: FP Math Caution885843 +Ref: FP Math Caution-Footnote-1886893 +Node: Inexactness of computations887262 +Node: Inexact representation888221 +Node: Comparing FP Values889578 +Node: Errors accumulate890660 +Node: Getting Accuracy892093 +Node: Try To Round894755 +Node: Setting precision895654 +Ref: table-predefined-precision-strings896338 +Node: Setting the rounding mode898127 +Ref: table-gawk-rounding-modes898491 +Ref: Setting the rounding mode-Footnote-1901946 +Node: Arbitrary Precision Integers902125 +Ref: Arbitrary Precision Integers-Footnote-1905111 +Node: POSIX Floating Point Problems905260 +Ref: POSIX Floating Point Problems-Footnote-1909133 +Node: Floating point summary909171 +Node: Dynamic Extensions911365 +Node: Extension Intro912917 +Node: Plugin License914183 +Node: Extension Mechanism Outline914980 +Ref: figure-load-extension915408 +Ref: figure-register-new-function916888 +Ref: figure-call-new-function917892 +Node: Extension API Description919878 +Node: Extension API Functions Introduction921328 +Node: General Data Types926152 +Ref: General Data Types-Footnote-1931891 +Node: Memory Allocation Functions932190 +Ref: Memory Allocation Functions-Footnote-1935029 +Node: Constructor Functions935125 +Node: Registration Functions936859 +Node: Extension Functions937544 +Node: Exit Callback Functions939841 +Node: Extension Version String941089 +Node: Input Parsers941754 +Node: Output Wrappers951631 +Node: Two-way processors956146 +Node: Printing Messages958350 +Ref: Printing Messages-Footnote-1959426 +Node: Updating `ERRNO'959578 +Node: Requesting Values960318 +Ref: table-value-types-returned961046 +Node: Accessing Parameters962003 +Node: Symbol Table Access963234 +Node: Symbol table by name963748 +Node: Symbol table by cookie965729 +Ref: Symbol table by cookie-Footnote-1969873 +Node: Cached values969936 +Ref: Cached values-Footnote-1973435 +Node: Array Manipulation973526 +Ref: Array Manipulation-Footnote-1974624 +Node: Array Data Types974661 +Ref: Array Data Types-Footnote-1977316 +Node: Array Functions977408 +Node: Flattening Arrays981262 +Node: Creating Arrays988154 +Node: Extension API Variables992923 +Node: Extension Versioning993559 +Node: Extension API Informational Variables995460 +Node: Extension API Boilerplate996548 +Node: Finding Extensions1000357 +Node: Extension Example1000917 +Node: Internal File Description1001689 +Node: Internal File Ops1005756 +Ref: Internal File Ops-Footnote-11017426 +Node: Using Internal File Ops1017566 +Ref: Using Internal File Ops-Footnote-11019949 +Node: Extension Samples1020222 +Node: Extension Sample File Functions1021748 +Node: Extension Sample Fnmatch1029386 +Node: Extension Sample Fork1030877 +Node: Extension Sample Inplace1032092 +Node: Extension Sample Ord1033767 +Node: Extension Sample Readdir1034603 +Ref: table-readdir-file-types1035479 +Node: Extension Sample Revout1036290 +Node: Extension Sample Rev2way1036880 +Node: Extension Sample Read write array1037620 +Node: Extension Sample Readfile1039560 +Node: Extension Sample Time1040655 +Node: Extension Sample API Tests1042004 +Node: gawkextlib1042495 +Node: Extension summary1045153 +Node: Extension Exercises1048830 +Node: Language History1049552 +Node: V7/SVR3.11051208 +Node: SVR41053389 +Node: POSIX1054834 +Node: BTL1056223 +Node: POSIX/GNU1056957 +Node: Feature History1062521 +Node: Common Extensions1075619 +Node: Ranges and Locales1076943 +Ref: Ranges and Locales-Footnote-11081561 +Ref: Ranges and Locales-Footnote-21081588 +Ref: Ranges and Locales-Footnote-31081822 +Node: Contributors1082043 +Node: History summary1087584 +Node: Installation1088954 +Node: Gawk Distribution1089900 +Node: Getting1090384 +Node: Extracting1091207 +Node: Distribution contents1092842 +Node: Unix Installation1098559 +Node: Quick Installation1099176 +Node: Additional Configuration Options1101600 +Node: Configuration Philosophy1103338 +Node: Non-Unix Installation1105707 +Node: PC Installation1106165 +Node: PC Binary Installation1107484 +Node: PC Compiling1109332 +Ref: PC Compiling-Footnote-11112353 +Node: PC Testing1112462 +Node: PC Using1113638 +Node: Cygwin1117753 +Node: MSYS1118576 +Node: VMS Installation1119076 +Node: VMS Compilation1119868 +Ref: VMS Compilation-Footnote-11121090 +Node: VMS Dynamic Extensions1121148 +Node: VMS Installation Details1122832 +Node: VMS Running1125084 +Node: VMS GNV1127920 +Node: VMS Old Gawk1128654 +Node: Bugs1129124 +Node: Other Versions1133007 +Node: Installation summary1139429 +Node: Notes1140485 +Node: Compatibility Mode1141350 +Node: Additions1142132 +Node: Accessing The Source1143057 +Node: Adding Code1144493 +Node: New Ports1150658 +Node: Derived Files1155140 +Ref: Derived Files-Footnote-11160615 +Ref: Derived Files-Footnote-21160649 +Ref: Derived Files-Footnote-31161245 +Node: Future Extensions1161359 +Node: Implementation Limitations1161965 +Node: Extension Design1163213 +Node: Old Extension Problems1164367 +Ref: Old Extension Problems-Footnote-11165884 +Node: Extension New Mechanism Goals1165941 +Ref: Extension New Mechanism Goals-Footnote-11169301 +Node: Extension Other Design Decisions1169490 +Node: Extension Future Growth1171598 +Node: Old Extension Mechanism1172434 +Node: Notes summary1174196 +Node: Basic Concepts1175382 +Node: Basic High Level1176063 +Ref: figure-general-flow1176335 +Ref: figure-process-flow1176934 +Ref: Basic High Level-Footnote-11180163 +Node: Basic Data Typing1180348 +Node: Glossary1183676 +Node: Copying1208834 +Node: GNU Free Documentation License1246390 +Node: Index1271526  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 42196498..0368c05e 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -9297,7 +9297,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!} appear in the output message. @node Control Letters diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 61e41804..7d6abb67 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -8898,7 +8898,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!} appear in the output message. @node Control Letters -- cgit v1.2.3 From 50ccd9803efa7e9b1e411d4f43fcd520d41debad Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 7 Dec 2014 21:20:24 +0200 Subject: Minor edits. --- doc/ChangeLog | 4 + doc/gawk.info | 963 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 6 +- doc/gawktexi.in | 6 +- 4 files changed, 492 insertions(+), 487 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index e471559b..80db8301 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-07 Arnold D. Robbins + + * gawktexi.in: Minor fixes. + 2014-12-06 Arnold D. Robbins * gawktexi.in: A minor fix. diff --git a/doc/gawk.info b/doc/gawk.info index 37a0d505..163ec3a8 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -4372,7 +4372,7 @@ that this will never happen. `RS = "^[[:upper:]]"' can only match at the beginning of a file. This is because `gawk' views the input file as one long string that happens to contain newline characters. It is thus best to - avoid anchor characters in the value of `RS'. + avoid anchor metacharacters in the value of `RS'. The use of `RS' as a regular expression and the `RT' variable are `gawk' extensions; they are not available in compatibility mode (*note @@ -5998,6 +5998,7 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li possibilities are as follows: Value of `RS' Records are split on `awk' / `gawk' + ... ---------------------------------------------------------------------- Any single That character `awk' character @@ -6437,7 +6438,7 @@ width. Here is a list of the format-control letters: On systems supporting IEEE 754 floating-point format, values representing negative infinity are formatted as `-inf' or - `-infinity', and positive infinity as `inf' and `infinity'. The + `-infinity', and positive infinity as `inf' or `infinity'. The special "not a number" value formats as `-nan' or `nan' (*note Math Definitions::). @@ -34372,484 +34373,484 @@ Node: Reading Files188591 Node: Records190685 Node: awk split records191418 Node: gawk split records196333 -Ref: gawk split records-Footnote-1200873 -Node: Fields200910 -Ref: Fields-Footnote-1203686 -Node: Nonconstant Fields203772 -Ref: Nonconstant Fields-Footnote-1206015 -Node: Changing Fields206219 -Node: Field Separators212148 -Node: Default Field Splitting214853 -Node: Regexp Field Splitting215970 -Node: Single Character Fields219320 -Node: Command Line Field Separator220379 -Node: Full Line Fields223591 -Ref: Full Line Fields-Footnote-1225108 -Ref: Full Line Fields-Footnote-2225154 -Node: Field Splitting Summary225255 -Node: Constant Size227329 -Node: Splitting By Content231918 -Ref: Splitting By Content-Footnote-1235912 -Node: Multiple Line236075 -Ref: Multiple Line-Footnote-1241961 -Node: Getline242140 -Node: Plain Getline244352 -Node: Getline/Variable246992 -Node: Getline/File248140 -Node: Getline/Variable/File249524 -Ref: Getline/Variable/File-Footnote-1251127 -Node: Getline/Pipe251214 -Node: Getline/Variable/Pipe253897 -Node: Getline/Coprocess255028 -Node: Getline/Variable/Coprocess256280 -Node: Getline Notes257019 -Node: Getline Summary259811 -Ref: table-getline-variants260223 -Node: Read Timeout261052 -Ref: Read Timeout-Footnote-1264877 -Node: Command-line directories264935 -Node: Input Summary265840 -Node: Input Exercises269093 -Node: Printing269821 -Node: Print271598 -Node: Print Examples273055 -Node: Output Separators275834 -Node: OFMT277852 -Node: Printf279206 -Node: Basic Printf279991 -Node: Control Letters281561 -Node: Format Modifiers285545 -Node: Printf Examples291546 -Node: Redirection294032 -Node: Special FD300873 -Ref: Special FD-Footnote-1304033 -Node: Special Files304107 -Node: Other Inherited Files304724 -Node: Special Network305724 -Node: Special Caveats306586 -Node: Close Files And Pipes307537 -Ref: Close Files And Pipes-Footnote-1314719 -Ref: Close Files And Pipes-Footnote-2314867 -Node: Output Summary315017 -Node: Output Exercises316015 -Node: Expressions316695 -Node: Values317880 -Node: Constants318558 -Node: Scalar Constants319249 -Ref: Scalar Constants-Footnote-1320108 -Node: Nondecimal-numbers320358 -Node: Regexp Constants323376 -Node: Using Constant Regexps323901 -Node: Variables327044 -Node: Using Variables327699 -Node: Assignment Options329610 -Node: Conversion331485 -Node: Strings And Numbers332009 -Ref: Strings And Numbers-Footnote-1335074 -Node: Locale influences conversions335183 -Ref: table-locale-affects337930 -Node: All Operators338518 -Node: Arithmetic Ops339148 -Node: Concatenation341653 -Ref: Concatenation-Footnote-1344472 -Node: Assignment Ops344578 -Ref: table-assign-ops349557 -Node: Increment Ops350829 -Node: Truth Values and Conditions354267 -Node: Truth Values355352 -Node: Typing and Comparison356401 -Node: Variable Typing357211 -Node: Comparison Operators360864 -Ref: table-relational-ops361274 -Node: POSIX String Comparison364769 -Ref: POSIX String Comparison-Footnote-1365841 -Node: Boolean Ops365979 -Ref: Boolean Ops-Footnote-1370458 -Node: Conditional Exp370549 -Node: Function Calls372276 -Node: Precedence376156 -Node: Locales379817 -Node: Expressions Summary381449 -Node: Patterns and Actions384009 -Node: Pattern Overview385129 -Node: Regexp Patterns386808 -Node: Expression Patterns387351 -Node: Ranges391132 -Node: BEGIN/END394238 -Node: Using BEGIN/END394999 -Ref: Using BEGIN/END-Footnote-1397733 -Node: I/O And BEGIN/END397839 -Node: BEGINFILE/ENDFILE400153 -Node: Empty403054 -Node: Using Shell Variables403371 -Node: Action Overview405644 -Node: Statements407970 -Node: If Statement409818 -Node: While Statement411313 -Node: Do Statement413342 -Node: For Statement414486 -Node: Switch Statement417643 -Node: Break Statement420025 -Node: Continue Statement422066 -Node: Next Statement423893 -Node: Nextfile Statement426274 -Node: Exit Statement428904 -Node: Built-in Variables431307 -Node: User-modified432440 -Ref: User-modified-Footnote-1440121 -Node: Auto-set440183 -Ref: Auto-set-Footnote-1453218 -Ref: Auto-set-Footnote-2453423 -Node: ARGC and ARGV453479 -Node: Pattern Action Summary457697 -Node: Arrays460124 -Node: Array Basics461453 -Node: Array Intro462297 -Ref: figure-array-elements464261 -Ref: Array Intro-Footnote-1466787 -Node: Reference to Elements466915 -Node: Assigning Elements469367 -Node: Array Example469858 -Node: Scanning an Array471616 -Node: Controlling Scanning474632 -Ref: Controlling Scanning-Footnote-1479828 -Node: Numeric Array Subscripts480144 -Node: Uninitialized Subscripts482329 -Node: Delete483946 -Ref: Delete-Footnote-1486689 -Node: Multidimensional486746 -Node: Multiscanning489843 -Node: Arrays of Arrays491432 -Node: Arrays Summary496191 -Node: Functions498283 -Node: Built-in499156 -Node: Calling Built-in500234 -Node: Numeric Functions502225 -Ref: Numeric Functions-Footnote-1506242 -Ref: Numeric Functions-Footnote-2506599 -Ref: Numeric Functions-Footnote-3506647 -Node: String Functions506919 -Ref: String Functions-Footnote-1530394 -Ref: String Functions-Footnote-2530523 -Ref: String Functions-Footnote-3530771 -Node: Gory Details530858 -Ref: table-sub-escapes532639 -Ref: table-sub-proposed534159 -Ref: table-posix-sub535523 -Ref: table-gensub-escapes537059 -Ref: Gory Details-Footnote-1537891 -Node: I/O Functions538042 -Ref: I/O Functions-Footnote-1545260 -Node: Time Functions545407 -Ref: Time Functions-Footnote-1555895 -Ref: Time Functions-Footnote-2555963 -Ref: Time Functions-Footnote-3556121 -Ref: Time Functions-Footnote-4556232 -Ref: Time Functions-Footnote-5556344 -Ref: Time Functions-Footnote-6556571 -Node: Bitwise Functions556837 -Ref: table-bitwise-ops557399 -Ref: Bitwise Functions-Footnote-1561708 -Node: Type Functions561877 -Node: I18N Functions563028 -Node: User-defined564673 -Node: Definition Syntax565478 -Ref: Definition Syntax-Footnote-1570885 -Node: Function Example570956 -Ref: Function Example-Footnote-1573875 -Node: Function Caveats573897 -Node: Calling A Function574415 -Node: Variable Scope575373 -Node: Pass By Value/Reference578361 -Node: Return Statement581856 -Node: Dynamic Typing584837 -Node: Indirect Calls585766 -Ref: Indirect Calls-Footnote-1597068 -Node: Functions Summary597196 -Node: Library Functions599898 -Ref: Library Functions-Footnote-1603507 -Ref: Library Functions-Footnote-2603650 -Node: Library Names603821 -Ref: Library Names-Footnote-1607275 -Ref: Library Names-Footnote-2607498 -Node: General Functions607584 -Node: Strtonum Function608687 -Node: Assert Function611709 -Node: Round Function615033 -Node: Cliff Random Function616574 -Node: Ordinal Functions617590 -Ref: Ordinal Functions-Footnote-1620653 -Ref: Ordinal Functions-Footnote-2620905 -Node: Join Function621116 -Ref: Join Function-Footnote-1622885 -Node: Getlocaltime Function623085 -Node: Readfile Function626829 -Node: Shell Quoting628799 -Node: Data File Management630200 -Node: Filetrans Function630832 -Node: Rewind Function634888 -Node: File Checking636275 -Ref: File Checking-Footnote-1637607 -Node: Empty Files637808 -Node: Ignoring Assigns639787 -Node: Getopt Function641338 -Ref: Getopt Function-Footnote-1652800 -Node: Passwd Functions653000 -Ref: Passwd Functions-Footnote-1661837 -Node: Group Functions661925 -Ref: Group Functions-Footnote-1669819 -Node: Walking Arrays670032 -Node: Library Functions Summary671635 -Node: Library Exercises673036 -Node: Sample Programs674316 -Node: Running Examples675086 -Node: Clones675814 -Node: Cut Program677038 -Node: Egrep Program686757 -Ref: Egrep Program-Footnote-1694255 -Node: Id Program694365 -Node: Split Program698010 -Ref: Split Program-Footnote-1701458 -Node: Tee Program701586 -Node: Uniq Program704375 -Node: Wc Program711794 -Ref: Wc Program-Footnote-1716044 -Node: Miscellaneous Programs716138 -Node: Dupword Program717351 -Node: Alarm Program719382 -Node: Translate Program724186 -Ref: Translate Program-Footnote-1728751 -Node: Labels Program729021 -Ref: Labels Program-Footnote-1732372 -Node: Word Sorting732456 -Node: History Sorting736527 -Node: Extract Program738363 -Node: Simple Sed745888 -Node: Igawk Program748956 -Ref: Igawk Program-Footnote-1763280 -Ref: Igawk Program-Footnote-2763481 -Ref: Igawk Program-Footnote-3763603 -Node: Anagram Program763718 -Node: Signature Program766775 -Node: Programs Summary768022 -Node: Programs Exercises769215 -Ref: Programs Exercises-Footnote-1773346 -Node: Advanced Features773437 -Node: Nondecimal Data775385 -Node: Array Sorting776975 -Node: Controlling Array Traversal777672 -Ref: Controlling Array Traversal-Footnote-1786005 -Node: Array Sorting Functions786123 -Ref: Array Sorting Functions-Footnote-1790012 -Node: Two-way I/O790208 -Ref: Two-way I/O-Footnote-1795149 -Ref: Two-way I/O-Footnote-2795335 -Node: TCP/IP Networking795417 -Node: Profiling798290 -Node: Advanced Features Summary805837 -Node: Internationalization807770 -Node: I18N and L10N809250 -Node: Explaining gettext809936 -Ref: Explaining gettext-Footnote-1814961 -Ref: Explaining gettext-Footnote-2815145 -Node: Programmer i18n815310 -Ref: Programmer i18n-Footnote-1820176 -Node: Translator i18n820225 -Node: String Extraction821019 -Ref: String Extraction-Footnote-1822150 -Node: Printf Ordering822236 -Ref: Printf Ordering-Footnote-1825022 -Node: I18N Portability825086 -Ref: I18N Portability-Footnote-1827541 -Node: I18N Example827604 -Ref: I18N Example-Footnote-1830407 -Node: Gawk I18N830479 -Node: I18N Summary831117 -Node: Debugger832456 -Node: Debugging833478 -Node: Debugging Concepts833919 -Node: Debugging Terms835772 -Node: Awk Debugging838344 -Node: Sample Debugging Session839238 -Node: Debugger Invocation839758 -Node: Finding The Bug841142 -Node: List of Debugger Commands847617 -Node: Breakpoint Control848950 -Node: Debugger Execution Control852646 -Node: Viewing And Changing Data856010 -Node: Execution Stack859388 -Node: Debugger Info861025 -Node: Miscellaneous Debugger Commands865042 -Node: Readline Support870071 -Node: Limitations870963 -Node: Debugging Summary873077 -Node: Arbitrary Precision Arithmetic874245 -Node: Computer Arithmetic875661 -Ref: table-numeric-ranges879259 -Ref: Computer Arithmetic-Footnote-1880118 -Node: Math Definitions880175 -Ref: table-ieee-formats883463 -Ref: Math Definitions-Footnote-1884067 -Node: MPFR features884172 -Node: FP Math Caution885843 -Ref: FP Math Caution-Footnote-1886893 -Node: Inexactness of computations887262 -Node: Inexact representation888221 -Node: Comparing FP Values889578 -Node: Errors accumulate890660 -Node: Getting Accuracy892093 -Node: Try To Round894755 -Node: Setting precision895654 -Ref: table-predefined-precision-strings896338 -Node: Setting the rounding mode898127 -Ref: table-gawk-rounding-modes898491 -Ref: Setting the rounding mode-Footnote-1901946 -Node: Arbitrary Precision Integers902125 -Ref: Arbitrary Precision Integers-Footnote-1905111 -Node: POSIX Floating Point Problems905260 -Ref: POSIX Floating Point Problems-Footnote-1909133 -Node: Floating point summary909171 -Node: Dynamic Extensions911365 -Node: Extension Intro912917 -Node: Plugin License914183 -Node: Extension Mechanism Outline914980 -Ref: figure-load-extension915408 -Ref: figure-register-new-function916888 -Ref: figure-call-new-function917892 -Node: Extension API Description919878 -Node: Extension API Functions Introduction921328 -Node: General Data Types926152 -Ref: General Data Types-Footnote-1931891 -Node: Memory Allocation Functions932190 -Ref: Memory Allocation Functions-Footnote-1935029 -Node: Constructor Functions935125 -Node: Registration Functions936859 -Node: Extension Functions937544 -Node: Exit Callback Functions939841 -Node: Extension Version String941089 -Node: Input Parsers941754 -Node: Output Wrappers951631 -Node: Two-way processors956146 -Node: Printing Messages958350 -Ref: Printing Messages-Footnote-1959426 -Node: Updating `ERRNO'959578 -Node: Requesting Values960318 -Ref: table-value-types-returned961046 -Node: Accessing Parameters962003 -Node: Symbol Table Access963234 -Node: Symbol table by name963748 -Node: Symbol table by cookie965729 -Ref: Symbol table by cookie-Footnote-1969873 -Node: Cached values969936 -Ref: Cached values-Footnote-1973435 -Node: Array Manipulation973526 -Ref: Array Manipulation-Footnote-1974624 -Node: Array Data Types974661 -Ref: Array Data Types-Footnote-1977316 -Node: Array Functions977408 -Node: Flattening Arrays981262 -Node: Creating Arrays988154 -Node: Extension API Variables992923 -Node: Extension Versioning993559 -Node: Extension API Informational Variables995460 -Node: Extension API Boilerplate996548 -Node: Finding Extensions1000357 -Node: Extension Example1000917 -Node: Internal File Description1001689 -Node: Internal File Ops1005756 -Ref: Internal File Ops-Footnote-11017426 -Node: Using Internal File Ops1017566 -Ref: Using Internal File Ops-Footnote-11019949 -Node: Extension Samples1020222 -Node: Extension Sample File Functions1021748 -Node: Extension Sample Fnmatch1029386 -Node: Extension Sample Fork1030877 -Node: Extension Sample Inplace1032092 -Node: Extension Sample Ord1033767 -Node: Extension Sample Readdir1034603 -Ref: table-readdir-file-types1035479 -Node: Extension Sample Revout1036290 -Node: Extension Sample Rev2way1036880 -Node: Extension Sample Read write array1037620 -Node: Extension Sample Readfile1039560 -Node: Extension Sample Time1040655 -Node: Extension Sample API Tests1042004 -Node: gawkextlib1042495 -Node: Extension summary1045153 -Node: Extension Exercises1048830 -Node: Language History1049552 -Node: V7/SVR3.11051208 -Node: SVR41053389 -Node: POSIX1054834 -Node: BTL1056223 -Node: POSIX/GNU1056957 -Node: Feature History1062521 -Node: Common Extensions1075619 -Node: Ranges and Locales1076943 -Ref: Ranges and Locales-Footnote-11081561 -Ref: Ranges and Locales-Footnote-21081588 -Ref: Ranges and Locales-Footnote-31081822 -Node: Contributors1082043 -Node: History summary1087584 -Node: Installation1088954 -Node: Gawk Distribution1089900 -Node: Getting1090384 -Node: Extracting1091207 -Node: Distribution contents1092842 -Node: Unix Installation1098559 -Node: Quick Installation1099176 -Node: Additional Configuration Options1101600 -Node: Configuration Philosophy1103338 -Node: Non-Unix Installation1105707 -Node: PC Installation1106165 -Node: PC Binary Installation1107484 -Node: PC Compiling1109332 -Ref: PC Compiling-Footnote-11112353 -Node: PC Testing1112462 -Node: PC Using1113638 -Node: Cygwin1117753 -Node: MSYS1118576 -Node: VMS Installation1119076 -Node: VMS Compilation1119868 -Ref: VMS Compilation-Footnote-11121090 -Node: VMS Dynamic Extensions1121148 -Node: VMS Installation Details1122832 -Node: VMS Running1125084 -Node: VMS GNV1127920 -Node: VMS Old Gawk1128654 -Node: Bugs1129124 -Node: Other Versions1133007 -Node: Installation summary1139429 -Node: Notes1140485 -Node: Compatibility Mode1141350 -Node: Additions1142132 -Node: Accessing The Source1143057 -Node: Adding Code1144493 -Node: New Ports1150658 -Node: Derived Files1155140 -Ref: Derived Files-Footnote-11160615 -Ref: Derived Files-Footnote-21160649 -Ref: Derived Files-Footnote-31161245 -Node: Future Extensions1161359 -Node: Implementation Limitations1161965 -Node: Extension Design1163213 -Node: Old Extension Problems1164367 -Ref: Old Extension Problems-Footnote-11165884 -Node: Extension New Mechanism Goals1165941 -Ref: Extension New Mechanism Goals-Footnote-11169301 -Node: Extension Other Design Decisions1169490 -Node: Extension Future Growth1171598 -Node: Old Extension Mechanism1172434 -Node: Notes summary1174196 -Node: Basic Concepts1175382 -Node: Basic High Level1176063 -Ref: figure-general-flow1176335 -Ref: figure-process-flow1176934 -Ref: Basic High Level-Footnote-11180163 -Node: Basic Data Typing1180348 -Node: Glossary1183676 -Node: Copying1208834 -Node: GNU Free Documentation License1246390 -Node: Index1271526 +Ref: gawk split records-Footnote-1200877 +Node: Fields200914 +Ref: Fields-Footnote-1203690 +Node: Nonconstant Fields203776 +Ref: Nonconstant Fields-Footnote-1206019 +Node: Changing Fields206223 +Node: Field Separators212152 +Node: Default Field Splitting214857 +Node: Regexp Field Splitting215974 +Node: Single Character Fields219324 +Node: Command Line Field Separator220383 +Node: Full Line Fields223595 +Ref: Full Line Fields-Footnote-1225112 +Ref: Full Line Fields-Footnote-2225158 +Node: Field Splitting Summary225259 +Node: Constant Size227333 +Node: Splitting By Content231922 +Ref: Splitting By Content-Footnote-1235916 +Node: Multiple Line236079 +Ref: Multiple Line-Footnote-1241965 +Node: Getline242144 +Node: Plain Getline244356 +Node: Getline/Variable246996 +Node: Getline/File248144 +Node: Getline/Variable/File249528 +Ref: Getline/Variable/File-Footnote-1251131 +Node: Getline/Pipe251218 +Node: Getline/Variable/Pipe253901 +Node: Getline/Coprocess255032 +Node: Getline/Variable/Coprocess256284 +Node: Getline Notes257023 +Node: Getline Summary259815 +Ref: table-getline-variants260227 +Node: Read Timeout261056 +Ref: Read Timeout-Footnote-1264881 +Node: Command-line directories264939 +Node: Input Summary265844 +Node: Input Exercises269145 +Node: Printing269873 +Node: Print271650 +Node: Print Examples273107 +Node: Output Separators275886 +Node: OFMT277904 +Node: Printf279258 +Node: Basic Printf280043 +Node: Control Letters281613 +Node: Format Modifiers285596 +Node: Printf Examples291597 +Node: Redirection294083 +Node: Special FD300924 +Ref: Special FD-Footnote-1304084 +Node: Special Files304158 +Node: Other Inherited Files304775 +Node: Special Network305775 +Node: Special Caveats306637 +Node: Close Files And Pipes307588 +Ref: Close Files And Pipes-Footnote-1314770 +Ref: Close Files And Pipes-Footnote-2314918 +Node: Output Summary315068 +Node: Output Exercises316066 +Node: Expressions316746 +Node: Values317931 +Node: Constants318609 +Node: Scalar Constants319300 +Ref: Scalar Constants-Footnote-1320159 +Node: Nondecimal-numbers320409 +Node: Regexp Constants323427 +Node: Using Constant Regexps323952 +Node: Variables327095 +Node: Using Variables327750 +Node: Assignment Options329661 +Node: Conversion331536 +Node: Strings And Numbers332060 +Ref: Strings And Numbers-Footnote-1335125 +Node: Locale influences conversions335234 +Ref: table-locale-affects337981 +Node: All Operators338569 +Node: Arithmetic Ops339199 +Node: Concatenation341704 +Ref: Concatenation-Footnote-1344523 +Node: Assignment Ops344629 +Ref: table-assign-ops349608 +Node: Increment Ops350880 +Node: Truth Values and Conditions354318 +Node: Truth Values355403 +Node: Typing and Comparison356452 +Node: Variable Typing357262 +Node: Comparison Operators360915 +Ref: table-relational-ops361325 +Node: POSIX String Comparison364820 +Ref: POSIX String Comparison-Footnote-1365892 +Node: Boolean Ops366030 +Ref: Boolean Ops-Footnote-1370509 +Node: Conditional Exp370600 +Node: Function Calls372327 +Node: Precedence376207 +Node: Locales379868 +Node: Expressions Summary381500 +Node: Patterns and Actions384060 +Node: Pattern Overview385180 +Node: Regexp Patterns386859 +Node: Expression Patterns387402 +Node: Ranges391183 +Node: BEGIN/END394289 +Node: Using BEGIN/END395050 +Ref: Using BEGIN/END-Footnote-1397784 +Node: I/O And BEGIN/END397890 +Node: BEGINFILE/ENDFILE400204 +Node: Empty403105 +Node: Using Shell Variables403422 +Node: Action Overview405695 +Node: Statements408021 +Node: If Statement409869 +Node: While Statement411364 +Node: Do Statement413393 +Node: For Statement414537 +Node: Switch Statement417694 +Node: Break Statement420076 +Node: Continue Statement422117 +Node: Next Statement423944 +Node: Nextfile Statement426325 +Node: Exit Statement428955 +Node: Built-in Variables431358 +Node: User-modified432491 +Ref: User-modified-Footnote-1440172 +Node: Auto-set440234 +Ref: Auto-set-Footnote-1453269 +Ref: Auto-set-Footnote-2453474 +Node: ARGC and ARGV453530 +Node: Pattern Action Summary457748 +Node: Arrays460175 +Node: Array Basics461504 +Node: Array Intro462348 +Ref: figure-array-elements464312 +Ref: Array Intro-Footnote-1466838 +Node: Reference to Elements466966 +Node: Assigning Elements469418 +Node: Array Example469909 +Node: Scanning an Array471667 +Node: Controlling Scanning474683 +Ref: Controlling Scanning-Footnote-1479879 +Node: Numeric Array Subscripts480195 +Node: Uninitialized Subscripts482380 +Node: Delete483997 +Ref: Delete-Footnote-1486740 +Node: Multidimensional486797 +Node: Multiscanning489894 +Node: Arrays of Arrays491483 +Node: Arrays Summary496242 +Node: Functions498334 +Node: Built-in499207 +Node: Calling Built-in500285 +Node: Numeric Functions502276 +Ref: Numeric Functions-Footnote-1506293 +Ref: Numeric Functions-Footnote-2506650 +Ref: Numeric Functions-Footnote-3506698 +Node: String Functions506970 +Ref: String Functions-Footnote-1530445 +Ref: String Functions-Footnote-2530574 +Ref: String Functions-Footnote-3530822 +Node: Gory Details530909 +Ref: table-sub-escapes532690 +Ref: table-sub-proposed534210 +Ref: table-posix-sub535574 +Ref: table-gensub-escapes537110 +Ref: Gory Details-Footnote-1537942 +Node: I/O Functions538093 +Ref: I/O Functions-Footnote-1545311 +Node: Time Functions545458 +Ref: Time Functions-Footnote-1555946 +Ref: Time Functions-Footnote-2556014 +Ref: Time Functions-Footnote-3556172 +Ref: Time Functions-Footnote-4556283 +Ref: Time Functions-Footnote-5556395 +Ref: Time Functions-Footnote-6556622 +Node: Bitwise Functions556888 +Ref: table-bitwise-ops557450 +Ref: Bitwise Functions-Footnote-1561759 +Node: Type Functions561928 +Node: I18N Functions563079 +Node: User-defined564724 +Node: Definition Syntax565529 +Ref: Definition Syntax-Footnote-1570936 +Node: Function Example571007 +Ref: Function Example-Footnote-1573926 +Node: Function Caveats573948 +Node: Calling A Function574466 +Node: Variable Scope575424 +Node: Pass By Value/Reference578412 +Node: Return Statement581907 +Node: Dynamic Typing584888 +Node: Indirect Calls585817 +Ref: Indirect Calls-Footnote-1597119 +Node: Functions Summary597247 +Node: Library Functions599949 +Ref: Library Functions-Footnote-1603558 +Ref: Library Functions-Footnote-2603701 +Node: Library Names603872 +Ref: Library Names-Footnote-1607326 +Ref: Library Names-Footnote-2607549 +Node: General Functions607635 +Node: Strtonum Function608738 +Node: Assert Function611760 +Node: Round Function615084 +Node: Cliff Random Function616625 +Node: Ordinal Functions617641 +Ref: Ordinal Functions-Footnote-1620704 +Ref: Ordinal Functions-Footnote-2620956 +Node: Join Function621167 +Ref: Join Function-Footnote-1622936 +Node: Getlocaltime Function623136 +Node: Readfile Function626880 +Node: Shell Quoting628850 +Node: Data File Management630251 +Node: Filetrans Function630883 +Node: Rewind Function634939 +Node: File Checking636326 +Ref: File Checking-Footnote-1637658 +Node: Empty Files637859 +Node: Ignoring Assigns639838 +Node: Getopt Function641389 +Ref: Getopt Function-Footnote-1652851 +Node: Passwd Functions653051 +Ref: Passwd Functions-Footnote-1661888 +Node: Group Functions661976 +Ref: Group Functions-Footnote-1669870 +Node: Walking Arrays670083 +Node: Library Functions Summary671686 +Node: Library Exercises673087 +Node: Sample Programs674367 +Node: Running Examples675137 +Node: Clones675865 +Node: Cut Program677089 +Node: Egrep Program686808 +Ref: Egrep Program-Footnote-1694306 +Node: Id Program694416 +Node: Split Program698061 +Ref: Split Program-Footnote-1701509 +Node: Tee Program701637 +Node: Uniq Program704426 +Node: Wc Program711845 +Ref: Wc Program-Footnote-1716095 +Node: Miscellaneous Programs716189 +Node: Dupword Program717402 +Node: Alarm Program719433 +Node: Translate Program724237 +Ref: Translate Program-Footnote-1728802 +Node: Labels Program729072 +Ref: Labels Program-Footnote-1732423 +Node: Word Sorting732507 +Node: History Sorting736578 +Node: Extract Program738414 +Node: Simple Sed745939 +Node: Igawk Program749007 +Ref: Igawk Program-Footnote-1763331 +Ref: Igawk Program-Footnote-2763532 +Ref: Igawk Program-Footnote-3763654 +Node: Anagram Program763769 +Node: Signature Program766826 +Node: Programs Summary768073 +Node: Programs Exercises769266 +Ref: Programs Exercises-Footnote-1773397 +Node: Advanced Features773488 +Node: Nondecimal Data775436 +Node: Array Sorting777026 +Node: Controlling Array Traversal777723 +Ref: Controlling Array Traversal-Footnote-1786056 +Node: Array Sorting Functions786174 +Ref: Array Sorting Functions-Footnote-1790063 +Node: Two-way I/O790259 +Ref: Two-way I/O-Footnote-1795200 +Ref: Two-way I/O-Footnote-2795386 +Node: TCP/IP Networking795468 +Node: Profiling798341 +Node: Advanced Features Summary805888 +Node: Internationalization807821 +Node: I18N and L10N809301 +Node: Explaining gettext809987 +Ref: Explaining gettext-Footnote-1815012 +Ref: Explaining gettext-Footnote-2815196 +Node: Programmer i18n815361 +Ref: Programmer i18n-Footnote-1820227 +Node: Translator i18n820276 +Node: String Extraction821070 +Ref: String Extraction-Footnote-1822201 +Node: Printf Ordering822287 +Ref: Printf Ordering-Footnote-1825073 +Node: I18N Portability825137 +Ref: I18N Portability-Footnote-1827592 +Node: I18N Example827655 +Ref: I18N Example-Footnote-1830458 +Node: Gawk I18N830530 +Node: I18N Summary831168 +Node: Debugger832507 +Node: Debugging833529 +Node: Debugging Concepts833970 +Node: Debugging Terms835823 +Node: Awk Debugging838395 +Node: Sample Debugging Session839289 +Node: Debugger Invocation839809 +Node: Finding The Bug841193 +Node: List of Debugger Commands847668 +Node: Breakpoint Control849001 +Node: Debugger Execution Control852697 +Node: Viewing And Changing Data856061 +Node: Execution Stack859439 +Node: Debugger Info861076 +Node: Miscellaneous Debugger Commands865093 +Node: Readline Support870122 +Node: Limitations871014 +Node: Debugging Summary873128 +Node: Arbitrary Precision Arithmetic874296 +Node: Computer Arithmetic875712 +Ref: table-numeric-ranges879310 +Ref: Computer Arithmetic-Footnote-1880169 +Node: Math Definitions880226 +Ref: table-ieee-formats883514 +Ref: Math Definitions-Footnote-1884118 +Node: MPFR features884223 +Node: FP Math Caution885894 +Ref: FP Math Caution-Footnote-1886944 +Node: Inexactness of computations887313 +Node: Inexact representation888272 +Node: Comparing FP Values889629 +Node: Errors accumulate890711 +Node: Getting Accuracy892144 +Node: Try To Round894806 +Node: Setting precision895705 +Ref: table-predefined-precision-strings896389 +Node: Setting the rounding mode898178 +Ref: table-gawk-rounding-modes898542 +Ref: Setting the rounding mode-Footnote-1901997 +Node: Arbitrary Precision Integers902176 +Ref: Arbitrary Precision Integers-Footnote-1905162 +Node: POSIX Floating Point Problems905311 +Ref: POSIX Floating Point Problems-Footnote-1909184 +Node: Floating point summary909222 +Node: Dynamic Extensions911416 +Node: Extension Intro912968 +Node: Plugin License914234 +Node: Extension Mechanism Outline915031 +Ref: figure-load-extension915459 +Ref: figure-register-new-function916939 +Ref: figure-call-new-function917943 +Node: Extension API Description919929 +Node: Extension API Functions Introduction921379 +Node: General Data Types926203 +Ref: General Data Types-Footnote-1931942 +Node: Memory Allocation Functions932241 +Ref: Memory Allocation Functions-Footnote-1935080 +Node: Constructor Functions935176 +Node: Registration Functions936910 +Node: Extension Functions937595 +Node: Exit Callback Functions939892 +Node: Extension Version String941140 +Node: Input Parsers941805 +Node: Output Wrappers951682 +Node: Two-way processors956197 +Node: Printing Messages958401 +Ref: Printing Messages-Footnote-1959477 +Node: Updating `ERRNO'959629 +Node: Requesting Values960369 +Ref: table-value-types-returned961097 +Node: Accessing Parameters962054 +Node: Symbol Table Access963285 +Node: Symbol table by name963799 +Node: Symbol table by cookie965780 +Ref: Symbol table by cookie-Footnote-1969924 +Node: Cached values969987 +Ref: Cached values-Footnote-1973486 +Node: Array Manipulation973577 +Ref: Array Manipulation-Footnote-1974675 +Node: Array Data Types974712 +Ref: Array Data Types-Footnote-1977367 +Node: Array Functions977459 +Node: Flattening Arrays981313 +Node: Creating Arrays988205 +Node: Extension API Variables992974 +Node: Extension Versioning993610 +Node: Extension API Informational Variables995511 +Node: Extension API Boilerplate996599 +Node: Finding Extensions1000408 +Node: Extension Example1000968 +Node: Internal File Description1001740 +Node: Internal File Ops1005807 +Ref: Internal File Ops-Footnote-11017477 +Node: Using Internal File Ops1017617 +Ref: Using Internal File Ops-Footnote-11020000 +Node: Extension Samples1020273 +Node: Extension Sample File Functions1021799 +Node: Extension Sample Fnmatch1029437 +Node: Extension Sample Fork1030928 +Node: Extension Sample Inplace1032143 +Node: Extension Sample Ord1033818 +Node: Extension Sample Readdir1034654 +Ref: table-readdir-file-types1035530 +Node: Extension Sample Revout1036341 +Node: Extension Sample Rev2way1036931 +Node: Extension Sample Read write array1037671 +Node: Extension Sample Readfile1039611 +Node: Extension Sample Time1040706 +Node: Extension Sample API Tests1042055 +Node: gawkextlib1042546 +Node: Extension summary1045204 +Node: Extension Exercises1048881 +Node: Language History1049603 +Node: V7/SVR3.11051259 +Node: SVR41053440 +Node: POSIX1054885 +Node: BTL1056274 +Node: POSIX/GNU1057008 +Node: Feature History1062572 +Node: Common Extensions1075670 +Node: Ranges and Locales1076994 +Ref: Ranges and Locales-Footnote-11081612 +Ref: Ranges and Locales-Footnote-21081639 +Ref: Ranges and Locales-Footnote-31081873 +Node: Contributors1082094 +Node: History summary1087635 +Node: Installation1089005 +Node: Gawk Distribution1089951 +Node: Getting1090435 +Node: Extracting1091258 +Node: Distribution contents1092893 +Node: Unix Installation1098610 +Node: Quick Installation1099227 +Node: Additional Configuration Options1101651 +Node: Configuration Philosophy1103389 +Node: Non-Unix Installation1105758 +Node: PC Installation1106216 +Node: PC Binary Installation1107535 +Node: PC Compiling1109383 +Ref: PC Compiling-Footnote-11112404 +Node: PC Testing1112513 +Node: PC Using1113689 +Node: Cygwin1117804 +Node: MSYS1118627 +Node: VMS Installation1119127 +Node: VMS Compilation1119919 +Ref: VMS Compilation-Footnote-11121141 +Node: VMS Dynamic Extensions1121199 +Node: VMS Installation Details1122883 +Node: VMS Running1125135 +Node: VMS GNV1127971 +Node: VMS Old Gawk1128705 +Node: Bugs1129175 +Node: Other Versions1133058 +Node: Installation summary1139480 +Node: Notes1140536 +Node: Compatibility Mode1141401 +Node: Additions1142183 +Node: Accessing The Source1143108 +Node: Adding Code1144544 +Node: New Ports1150709 +Node: Derived Files1155191 +Ref: Derived Files-Footnote-11160666 +Ref: Derived Files-Footnote-21160700 +Ref: Derived Files-Footnote-31161296 +Node: Future Extensions1161410 +Node: Implementation Limitations1162016 +Node: Extension Design1163264 +Node: Old Extension Problems1164418 +Ref: Old Extension Problems-Footnote-11165935 +Node: Extension New Mechanism Goals1165992 +Ref: Extension New Mechanism Goals-Footnote-11169352 +Node: Extension Other Design Decisions1169541 +Node: Extension Future Growth1171649 +Node: Old Extension Mechanism1172485 +Node: Notes summary1174247 +Node: Basic Concepts1175433 +Node: Basic High Level1176114 +Ref: figure-general-flow1176386 +Ref: figure-process-flow1176985 +Ref: Basic High Level-Footnote-11180214 +Node: Basic Data Typing1180399 +Node: Glossary1183727 +Node: Copying1208885 +Node: GNU Free Documentation License1246441 +Node: Index1271577  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 0368c05e..bc93c38e 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -6588,7 +6588,7 @@ the beginning and end of a @emph{line}. As a result, something like @samp{RS = "^[[:upper:]]"} can only match at the beginning of a file. This is because @command{gawk} views the input file as one long string that happens to contain newline characters. -It is thus best to avoid anchor characters in the value of @code{RS}. +It is thus best to avoid anchor metacharacters in the value of @code{RS}. @end quotation @cindex differences in @command{awk} and @command{gawk}, @code{RS}/@code{RT} variables @@ -8834,7 +8834,7 @@ Input is split into records based on the value of @code{RS}. The possibilities are as follows: @multitable @columnfractions .25 .35 .40 -@headitem Value of @code{RS} @tab Records are split on @tab @command{awk} / @command{gawk} +@headitem Value of @code{RS} @tab Records are split on @dots{} @tab @command{awk} / @command{gawk} @item Any single character @tab That character @tab @command{awk} @item The empty string (@code{""}) @tab Runs of two or more newlines @tab @command{awk} @item A regexp @tab Text that matches the regexp @tab @command{gawk} @@ -9377,7 +9377,7 @@ representing negative infinity are formatted as @samp{-inf} or @samp{-infinity}, and positive infinity as -@samp{inf} and @samp{infinity}. +@samp{inf} or @samp{infinity}. The special ``not a number'' value formats as @samp{-nan} or @samp{nan} (@pxref{Math Definitions}). diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 7d6abb67..7a765db4 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -6372,7 +6372,7 @@ the beginning and end of a @emph{line}. As a result, something like @samp{RS = "^[[:upper:]]"} can only match at the beginning of a file. This is because @command{gawk} views the input file as one long string that happens to contain newline characters. -It is thus best to avoid anchor characters in the value of @code{RS}. +It is thus best to avoid anchor metacharacters in the value of @code{RS}. @end quotation @cindex differences in @command{awk} and @command{gawk}, @code{RS}/@code{RT} variables @@ -8435,7 +8435,7 @@ Input is split into records based on the value of @code{RS}. The possibilities are as follows: @multitable @columnfractions .25 .35 .40 -@headitem Value of @code{RS} @tab Records are split on @tab @command{awk} / @command{gawk} +@headitem Value of @code{RS} @tab Records are split on @dots{} @tab @command{awk} / @command{gawk} @item Any single character @tab That character @tab @command{awk} @item The empty string (@code{""}) @tab Runs of two or more newlines @tab @command{awk} @item A regexp @tab Text that matches the regexp @tab @command{gawk} @@ -8978,7 +8978,7 @@ representing negative infinity are formatted as @samp{-inf} or @samp{-infinity}, and positive infinity as -@samp{inf} and @samp{infinity}. +@samp{inf} or @samp{infinity}. The special ``not a number'' value formats as @samp{-nan} or @samp{nan} (@pxref{Math Definitions}). -- cgit v1.2.3 From 882d4057221d8a9976003214776edd43d2fbf9c4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 9 Dec 2014 23:08:01 +0200 Subject: More minor doc edits. --- doc/ChangeLog | 4 + doc/gawk.info | 776 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 54 ++-- doc/gawktexi.in | 54 ++-- 4 files changed, 446 insertions(+), 442 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 80db8301..d6c70902 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-09 Arnold D. Robbins + + * gawktexi.in: More minor fixes. + 2014-12-07 Arnold D. Robbins * gawktexi.in: Minor fixes. diff --git a/doc/gawk.info b/doc/gawk.info index 163ec3a8..3e7606f0 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -9063,10 +9063,9 @@ accepts any record with a first field that contains `li': -| 555-5553 -| 555-6699 - A regexp constant as a pattern is also a special case of an -expression pattern. The expression `/li/' has the value one if `li' -appears in the current input record. Thus, as a pattern, `/li/' matches -any record containing `li'. + pattern. The expression `/li/' has the value one if `li' appears in +the current input record. Thus, as a pattern, `/li/' matches any record +containing `li'. Boolean expressions are also commonly used as patterns. Whether the pattern matches an input record depends on whether its subexpressions @@ -11775,7 +11774,8 @@ File: gawk.info, Node: Functions, Next: Library Functions, Prev: Arrays, Up: This major node describes `awk''s built-in functions, which fall into three categories: numeric, string, and I/O. `gawk' provides additional groups of functions to work with values that represent time, do bit -manipulation, sort arrays, and internationalize and localize programs. +manipulation, sort arrays, provide type information, and +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 @@ -19603,7 +19603,7 @@ per-command basis, by setting a special element in the `PROCINFO' array command = "sort -nr" # command, save in convenience variable PROCINFO[command, "pty"] = 1 # update PROCINFO - print ... |& command # start two-way pipe + print ... |& command # start two-way pipe ... Using ptys usually avoids the buffer deadlock issues described earlier, @@ -31777,7 +31777,7 @@ Index * BEGIN pattern, and profiling: Profiling. (line 62) * BEGIN pattern, assert() user-defined function and: Assert Function. (line 83) -* BEGIN pattern, Boolean patterns and: Expression Patterns. (line 70) +* BEGIN pattern, Boolean patterns and: Expression Patterns. (line 69) * BEGIN pattern, exit statement and: Exit Statement. (line 12) * BEGIN pattern, getline and: Getline Notes. (line 19) * BEGIN pattern, headings, adding: Print Examples. (line 43) @@ -31794,7 +31794,7 @@ Index * BEGIN pattern, TEXTDOMAIN variable and: Programmer i18n. (line 60) * BEGINFILE pattern: BEGINFILE/ENDFILE. (line 6) * BEGINFILE pattern, Boolean patterns and: Expression Patterns. - (line 70) + (line 69) * beginfile() user-defined function: Filetrans Function. (line 61) * Bentley, Jon: Glossary. (line 143) * Benzinger, Michael: Contributors. (line 97) @@ -31820,7 +31820,7 @@ Index * body, in actions: Statements. (line 10) * body, in loops: While Statement. (line 14) * Boolean expressions: Boolean Ops. (line 6) -* Boolean expressions, as patterns: Expression Patterns. (line 39) +* Boolean expressions, as patterns: Expression Patterns. (line 38) * Boolean operators, See Boolean expressions: Boolean Ops. (line 6) * Bourne shell, quoting rules for: Quoting. (line 18) * braces ({}): Profiling. (line 142) @@ -32404,7 +32404,7 @@ Index * END pattern, and profiling: Profiling. (line 62) * END pattern, assert() user-defined function and: Assert Function. (line 75) -* END pattern, Boolean patterns and: Expression Patterns. (line 70) +* END pattern, Boolean patterns and: Expression Patterns. (line 69) * END pattern, exit statement and: Exit Statement. (line 12) * END pattern, next/nextfile statements and <1>: Next Statement. (line 44) @@ -32413,7 +32413,7 @@ Index * END pattern, operators and: Using BEGIN/END. (line 17) * END pattern, print statement and: I/O And BEGIN/END. (line 16) * ENDFILE pattern: BEGINFILE/ENDFILE. (line 6) -* ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 70) +* ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 69) * endfile() user-defined function: Filetrans Function. (line 61) * endgrent() function (C library): Group Functions. (line 211) * endgrent() user-defined function: Group Functions. (line 214) @@ -34475,382 +34475,382 @@ Node: Patterns and Actions384060 Node: Pattern Overview385180 Node: Regexp Patterns386859 Node: Expression Patterns387402 -Node: Ranges391183 -Node: BEGIN/END394289 -Node: Using BEGIN/END395050 -Ref: Using BEGIN/END-Footnote-1397784 -Node: I/O And BEGIN/END397890 -Node: BEGINFILE/ENDFILE400204 -Node: Empty403105 -Node: Using Shell Variables403422 -Node: Action Overview405695 -Node: Statements408021 -Node: If Statement409869 -Node: While Statement411364 -Node: Do Statement413393 -Node: For Statement414537 -Node: Switch Statement417694 -Node: Break Statement420076 -Node: Continue Statement422117 -Node: Next Statement423944 -Node: Nextfile Statement426325 -Node: Exit Statement428955 -Node: Built-in Variables431358 -Node: User-modified432491 -Ref: User-modified-Footnote-1440172 -Node: Auto-set440234 -Ref: Auto-set-Footnote-1453269 -Ref: Auto-set-Footnote-2453474 -Node: ARGC and ARGV453530 -Node: Pattern Action Summary457748 -Node: Arrays460175 -Node: Array Basics461504 -Node: Array Intro462348 -Ref: figure-array-elements464312 -Ref: Array Intro-Footnote-1466838 -Node: Reference to Elements466966 -Node: Assigning Elements469418 -Node: Array Example469909 -Node: Scanning an Array471667 -Node: Controlling Scanning474683 -Ref: Controlling Scanning-Footnote-1479879 -Node: Numeric Array Subscripts480195 -Node: Uninitialized Subscripts482380 -Node: Delete483997 -Ref: Delete-Footnote-1486740 -Node: Multidimensional486797 -Node: Multiscanning489894 -Node: Arrays of Arrays491483 -Node: Arrays Summary496242 -Node: Functions498334 -Node: Built-in499207 -Node: Calling Built-in500285 -Node: Numeric Functions502276 -Ref: Numeric Functions-Footnote-1506293 -Ref: Numeric Functions-Footnote-2506650 -Ref: Numeric Functions-Footnote-3506698 -Node: String Functions506970 -Ref: String Functions-Footnote-1530445 -Ref: String Functions-Footnote-2530574 -Ref: String Functions-Footnote-3530822 -Node: Gory Details530909 -Ref: table-sub-escapes532690 -Ref: table-sub-proposed534210 -Ref: table-posix-sub535574 -Ref: table-gensub-escapes537110 -Ref: Gory Details-Footnote-1537942 -Node: I/O Functions538093 -Ref: I/O Functions-Footnote-1545311 -Node: Time Functions545458 -Ref: Time Functions-Footnote-1555946 -Ref: Time Functions-Footnote-2556014 -Ref: Time Functions-Footnote-3556172 -Ref: Time Functions-Footnote-4556283 -Ref: Time Functions-Footnote-5556395 -Ref: Time Functions-Footnote-6556622 -Node: Bitwise Functions556888 -Ref: table-bitwise-ops557450 -Ref: Bitwise Functions-Footnote-1561759 -Node: Type Functions561928 -Node: I18N Functions563079 -Node: User-defined564724 -Node: Definition Syntax565529 -Ref: Definition Syntax-Footnote-1570936 -Node: Function Example571007 -Ref: Function Example-Footnote-1573926 -Node: Function Caveats573948 -Node: Calling A Function574466 -Node: Variable Scope575424 -Node: Pass By Value/Reference578412 -Node: Return Statement581907 -Node: Dynamic Typing584888 -Node: Indirect Calls585817 -Ref: Indirect Calls-Footnote-1597119 -Node: Functions Summary597247 -Node: Library Functions599949 -Ref: Library Functions-Footnote-1603558 -Ref: Library Functions-Footnote-2603701 -Node: Library Names603872 -Ref: Library Names-Footnote-1607326 -Ref: Library Names-Footnote-2607549 -Node: General Functions607635 -Node: Strtonum Function608738 -Node: Assert Function611760 -Node: Round Function615084 -Node: Cliff Random Function616625 -Node: Ordinal Functions617641 -Ref: Ordinal Functions-Footnote-1620704 -Ref: Ordinal Functions-Footnote-2620956 -Node: Join Function621167 -Ref: Join Function-Footnote-1622936 -Node: Getlocaltime Function623136 -Node: Readfile Function626880 -Node: Shell Quoting628850 -Node: Data File Management630251 -Node: Filetrans Function630883 -Node: Rewind Function634939 -Node: File Checking636326 -Ref: File Checking-Footnote-1637658 -Node: Empty Files637859 -Node: Ignoring Assigns639838 -Node: Getopt Function641389 -Ref: Getopt Function-Footnote-1652851 -Node: Passwd Functions653051 -Ref: Passwd Functions-Footnote-1661888 -Node: Group Functions661976 -Ref: Group Functions-Footnote-1669870 -Node: Walking Arrays670083 -Node: Library Functions Summary671686 -Node: Library Exercises673087 -Node: Sample Programs674367 -Node: Running Examples675137 -Node: Clones675865 -Node: Cut Program677089 -Node: Egrep Program686808 -Ref: Egrep Program-Footnote-1694306 -Node: Id Program694416 -Node: Split Program698061 -Ref: Split Program-Footnote-1701509 -Node: Tee Program701637 -Node: Uniq Program704426 -Node: Wc Program711845 -Ref: Wc Program-Footnote-1716095 -Node: Miscellaneous Programs716189 -Node: Dupword Program717402 -Node: Alarm Program719433 -Node: Translate Program724237 -Ref: Translate Program-Footnote-1728802 -Node: Labels Program729072 -Ref: Labels Program-Footnote-1732423 -Node: Word Sorting732507 -Node: History Sorting736578 -Node: Extract Program738414 -Node: Simple Sed745939 -Node: Igawk Program749007 -Ref: Igawk Program-Footnote-1763331 -Ref: Igawk Program-Footnote-2763532 -Ref: Igawk Program-Footnote-3763654 -Node: Anagram Program763769 -Node: Signature Program766826 -Node: Programs Summary768073 -Node: Programs Exercises769266 -Ref: Programs Exercises-Footnote-1773397 -Node: Advanced Features773488 -Node: Nondecimal Data775436 -Node: Array Sorting777026 -Node: Controlling Array Traversal777723 -Ref: Controlling Array Traversal-Footnote-1786056 -Node: Array Sorting Functions786174 -Ref: Array Sorting Functions-Footnote-1790063 -Node: Two-way I/O790259 -Ref: Two-way I/O-Footnote-1795200 -Ref: Two-way I/O-Footnote-2795386 -Node: TCP/IP Networking795468 -Node: Profiling798341 -Node: Advanced Features Summary805888 -Node: Internationalization807821 -Node: I18N and L10N809301 -Node: Explaining gettext809987 -Ref: Explaining gettext-Footnote-1815012 -Ref: Explaining gettext-Footnote-2815196 -Node: Programmer i18n815361 -Ref: Programmer i18n-Footnote-1820227 -Node: Translator i18n820276 -Node: String Extraction821070 -Ref: String Extraction-Footnote-1822201 -Node: Printf Ordering822287 -Ref: Printf Ordering-Footnote-1825073 -Node: I18N Portability825137 -Ref: I18N Portability-Footnote-1827592 -Node: I18N Example827655 -Ref: I18N Example-Footnote-1830458 -Node: Gawk I18N830530 -Node: I18N Summary831168 -Node: Debugger832507 -Node: Debugging833529 -Node: Debugging Concepts833970 -Node: Debugging Terms835823 -Node: Awk Debugging838395 -Node: Sample Debugging Session839289 -Node: Debugger Invocation839809 -Node: Finding The Bug841193 -Node: List of Debugger Commands847668 -Node: Breakpoint Control849001 -Node: Debugger Execution Control852697 -Node: Viewing And Changing Data856061 -Node: Execution Stack859439 -Node: Debugger Info861076 -Node: Miscellaneous Debugger Commands865093 -Node: Readline Support870122 -Node: Limitations871014 -Node: Debugging Summary873128 -Node: Arbitrary Precision Arithmetic874296 -Node: Computer Arithmetic875712 -Ref: table-numeric-ranges879310 -Ref: Computer Arithmetic-Footnote-1880169 -Node: Math Definitions880226 -Ref: table-ieee-formats883514 -Ref: Math Definitions-Footnote-1884118 -Node: MPFR features884223 -Node: FP Math Caution885894 -Ref: FP Math Caution-Footnote-1886944 -Node: Inexactness of computations887313 -Node: Inexact representation888272 -Node: Comparing FP Values889629 -Node: Errors accumulate890711 -Node: Getting Accuracy892144 -Node: Try To Round894806 -Node: Setting precision895705 -Ref: table-predefined-precision-strings896389 -Node: Setting the rounding mode898178 -Ref: table-gawk-rounding-modes898542 -Ref: Setting the rounding mode-Footnote-1901997 -Node: Arbitrary Precision Integers902176 -Ref: Arbitrary Precision Integers-Footnote-1905162 -Node: POSIX Floating Point Problems905311 -Ref: POSIX Floating Point Problems-Footnote-1909184 -Node: Floating point summary909222 -Node: Dynamic Extensions911416 -Node: Extension Intro912968 -Node: Plugin License914234 -Node: Extension Mechanism Outline915031 -Ref: figure-load-extension915459 -Ref: figure-register-new-function916939 -Ref: figure-call-new-function917943 -Node: Extension API Description919929 -Node: Extension API Functions Introduction921379 -Node: General Data Types926203 -Ref: General Data Types-Footnote-1931942 -Node: Memory Allocation Functions932241 -Ref: Memory Allocation Functions-Footnote-1935080 -Node: Constructor Functions935176 -Node: Registration Functions936910 -Node: Extension Functions937595 -Node: Exit Callback Functions939892 -Node: Extension Version String941140 -Node: Input Parsers941805 -Node: Output Wrappers951682 -Node: Two-way processors956197 -Node: Printing Messages958401 -Ref: Printing Messages-Footnote-1959477 -Node: Updating `ERRNO'959629 -Node: Requesting Values960369 -Ref: table-value-types-returned961097 -Node: Accessing Parameters962054 -Node: Symbol Table Access963285 -Node: Symbol table by name963799 -Node: Symbol table by cookie965780 -Ref: Symbol table by cookie-Footnote-1969924 -Node: Cached values969987 -Ref: Cached values-Footnote-1973486 -Node: Array Manipulation973577 -Ref: Array Manipulation-Footnote-1974675 -Node: Array Data Types974712 -Ref: Array Data Types-Footnote-1977367 -Node: Array Functions977459 -Node: Flattening Arrays981313 -Node: Creating Arrays988205 -Node: Extension API Variables992974 -Node: Extension Versioning993610 -Node: Extension API Informational Variables995511 -Node: Extension API Boilerplate996599 -Node: Finding Extensions1000408 -Node: Extension Example1000968 -Node: Internal File Description1001740 -Node: Internal File Ops1005807 -Ref: Internal File Ops-Footnote-11017477 -Node: Using Internal File Ops1017617 -Ref: Using Internal File Ops-Footnote-11020000 -Node: Extension Samples1020273 -Node: Extension Sample File Functions1021799 -Node: Extension Sample Fnmatch1029437 -Node: Extension Sample Fork1030928 -Node: Extension Sample Inplace1032143 -Node: Extension Sample Ord1033818 -Node: Extension Sample Readdir1034654 -Ref: table-readdir-file-types1035530 -Node: Extension Sample Revout1036341 -Node: Extension Sample Rev2way1036931 -Node: Extension Sample Read write array1037671 -Node: Extension Sample Readfile1039611 -Node: Extension Sample Time1040706 -Node: Extension Sample API Tests1042055 -Node: gawkextlib1042546 -Node: Extension summary1045204 -Node: Extension Exercises1048881 -Node: Language History1049603 -Node: V7/SVR3.11051259 -Node: SVR41053440 -Node: POSIX1054885 -Node: BTL1056274 -Node: POSIX/GNU1057008 -Node: Feature History1062572 -Node: Common Extensions1075670 -Node: Ranges and Locales1076994 -Ref: Ranges and Locales-Footnote-11081612 -Ref: Ranges and Locales-Footnote-21081639 -Ref: Ranges and Locales-Footnote-31081873 -Node: Contributors1082094 -Node: History summary1087635 -Node: Installation1089005 -Node: Gawk Distribution1089951 -Node: Getting1090435 -Node: Extracting1091258 -Node: Distribution contents1092893 -Node: Unix Installation1098610 -Node: Quick Installation1099227 -Node: Additional Configuration Options1101651 -Node: Configuration Philosophy1103389 -Node: Non-Unix Installation1105758 -Node: PC Installation1106216 -Node: PC Binary Installation1107535 -Node: PC Compiling1109383 -Ref: PC Compiling-Footnote-11112404 -Node: PC Testing1112513 -Node: PC Using1113689 -Node: Cygwin1117804 -Node: MSYS1118627 -Node: VMS Installation1119127 -Node: VMS Compilation1119919 -Ref: VMS Compilation-Footnote-11121141 -Node: VMS Dynamic Extensions1121199 -Node: VMS Installation Details1122883 -Node: VMS Running1125135 -Node: VMS GNV1127971 -Node: VMS Old Gawk1128705 -Node: Bugs1129175 -Node: Other Versions1133058 -Node: Installation summary1139480 -Node: Notes1140536 -Node: Compatibility Mode1141401 -Node: Additions1142183 -Node: Accessing The Source1143108 -Node: Adding Code1144544 -Node: New Ports1150709 -Node: Derived Files1155191 -Ref: Derived Files-Footnote-11160666 -Ref: Derived Files-Footnote-21160700 -Ref: Derived Files-Footnote-31161296 -Node: Future Extensions1161410 -Node: Implementation Limitations1162016 -Node: Extension Design1163264 -Node: Old Extension Problems1164418 -Ref: Old Extension Problems-Footnote-11165935 -Node: Extension New Mechanism Goals1165992 -Ref: Extension New Mechanism Goals-Footnote-11169352 -Node: Extension Other Design Decisions1169541 -Node: Extension Future Growth1171649 -Node: Old Extension Mechanism1172485 -Node: Notes summary1174247 -Node: Basic Concepts1175433 -Node: Basic High Level1176114 -Ref: figure-general-flow1176386 -Ref: figure-process-flow1176985 -Ref: Basic High Level-Footnote-11180214 -Node: Basic Data Typing1180399 -Node: Glossary1183727 -Node: Copying1208885 -Node: GNU Free Documentation License1246441 -Node: Index1271577 +Node: Ranges391112 +Node: BEGIN/END394218 +Node: Using BEGIN/END394979 +Ref: Using BEGIN/END-Footnote-1397713 +Node: I/O And BEGIN/END397819 +Node: BEGINFILE/ENDFILE400133 +Node: Empty403034 +Node: Using Shell Variables403351 +Node: Action Overview405624 +Node: Statements407950 +Node: If Statement409798 +Node: While Statement411293 +Node: Do Statement413322 +Node: For Statement414466 +Node: Switch Statement417623 +Node: Break Statement420005 +Node: Continue Statement422046 +Node: Next Statement423873 +Node: Nextfile Statement426254 +Node: Exit Statement428884 +Node: Built-in Variables431287 +Node: User-modified432420 +Ref: User-modified-Footnote-1440101 +Node: Auto-set440163 +Ref: Auto-set-Footnote-1453198 +Ref: Auto-set-Footnote-2453403 +Node: ARGC and ARGV453459 +Node: Pattern Action Summary457677 +Node: Arrays460104 +Node: Array Basics461433 +Node: Array Intro462277 +Ref: figure-array-elements464241 +Ref: Array Intro-Footnote-1466767 +Node: Reference to Elements466895 +Node: Assigning Elements469347 +Node: Array Example469838 +Node: Scanning an Array471596 +Node: Controlling Scanning474612 +Ref: Controlling Scanning-Footnote-1479808 +Node: Numeric Array Subscripts480124 +Node: Uninitialized Subscripts482309 +Node: Delete483926 +Ref: Delete-Footnote-1486669 +Node: Multidimensional486726 +Node: Multiscanning489823 +Node: Arrays of Arrays491412 +Node: Arrays Summary496171 +Node: Functions498263 +Node: Built-in499162 +Node: Calling Built-in500240 +Node: Numeric Functions502231 +Ref: Numeric Functions-Footnote-1506248 +Ref: Numeric Functions-Footnote-2506605 +Ref: Numeric Functions-Footnote-3506653 +Node: String Functions506925 +Ref: String Functions-Footnote-1530400 +Ref: String Functions-Footnote-2530529 +Ref: String Functions-Footnote-3530777 +Node: Gory Details530864 +Ref: table-sub-escapes532645 +Ref: table-sub-proposed534165 +Ref: table-posix-sub535529 +Ref: table-gensub-escapes537065 +Ref: Gory Details-Footnote-1537897 +Node: I/O Functions538048 +Ref: I/O Functions-Footnote-1545266 +Node: Time Functions545413 +Ref: Time Functions-Footnote-1555901 +Ref: Time Functions-Footnote-2555969 +Ref: Time Functions-Footnote-3556127 +Ref: Time Functions-Footnote-4556238 +Ref: Time Functions-Footnote-5556350 +Ref: Time Functions-Footnote-6556577 +Node: Bitwise Functions556843 +Ref: table-bitwise-ops557405 +Ref: Bitwise Functions-Footnote-1561714 +Node: Type Functions561883 +Node: I18N Functions563034 +Node: User-defined564679 +Node: Definition Syntax565484 +Ref: Definition Syntax-Footnote-1570891 +Node: Function Example570962 +Ref: Function Example-Footnote-1573881 +Node: Function Caveats573903 +Node: Calling A Function574421 +Node: Variable Scope575379 +Node: Pass By Value/Reference578367 +Node: Return Statement581862 +Node: Dynamic Typing584843 +Node: Indirect Calls585772 +Ref: Indirect Calls-Footnote-1597074 +Node: Functions Summary597202 +Node: Library Functions599904 +Ref: Library Functions-Footnote-1603513 +Ref: Library Functions-Footnote-2603656 +Node: Library Names603827 +Ref: Library Names-Footnote-1607281 +Ref: Library Names-Footnote-2607504 +Node: General Functions607590 +Node: Strtonum Function608693 +Node: Assert Function611715 +Node: Round Function615039 +Node: Cliff Random Function616580 +Node: Ordinal Functions617596 +Ref: Ordinal Functions-Footnote-1620659 +Ref: Ordinal Functions-Footnote-2620911 +Node: Join Function621122 +Ref: Join Function-Footnote-1622891 +Node: Getlocaltime Function623091 +Node: Readfile Function626835 +Node: Shell Quoting628805 +Node: Data File Management630206 +Node: Filetrans Function630838 +Node: Rewind Function634894 +Node: File Checking636281 +Ref: File Checking-Footnote-1637613 +Node: Empty Files637814 +Node: Ignoring Assigns639793 +Node: Getopt Function641344 +Ref: Getopt Function-Footnote-1652806 +Node: Passwd Functions653006 +Ref: Passwd Functions-Footnote-1661843 +Node: Group Functions661931 +Ref: Group Functions-Footnote-1669825 +Node: Walking Arrays670038 +Node: Library Functions Summary671641 +Node: Library Exercises673042 +Node: Sample Programs674322 +Node: Running Examples675092 +Node: Clones675820 +Node: Cut Program677044 +Node: Egrep Program686763 +Ref: Egrep Program-Footnote-1694261 +Node: Id Program694371 +Node: Split Program698016 +Ref: Split Program-Footnote-1701464 +Node: Tee Program701592 +Node: Uniq Program704381 +Node: Wc Program711800 +Ref: Wc Program-Footnote-1716050 +Node: Miscellaneous Programs716144 +Node: Dupword Program717357 +Node: Alarm Program719388 +Node: Translate Program724192 +Ref: Translate Program-Footnote-1728757 +Node: Labels Program729027 +Ref: Labels Program-Footnote-1732378 +Node: Word Sorting732462 +Node: History Sorting736533 +Node: Extract Program738369 +Node: Simple Sed745894 +Node: Igawk Program748962 +Ref: Igawk Program-Footnote-1763286 +Ref: Igawk Program-Footnote-2763487 +Ref: Igawk Program-Footnote-3763609 +Node: Anagram Program763724 +Node: Signature Program766781 +Node: Programs Summary768028 +Node: Programs Exercises769221 +Ref: Programs Exercises-Footnote-1773352 +Node: Advanced Features773443 +Node: Nondecimal Data775391 +Node: Array Sorting776981 +Node: Controlling Array Traversal777678 +Ref: Controlling Array Traversal-Footnote-1786011 +Node: Array Sorting Functions786129 +Ref: Array Sorting Functions-Footnote-1790018 +Node: Two-way I/O790214 +Ref: Two-way I/O-Footnote-1795159 +Ref: Two-way I/O-Footnote-2795345 +Node: TCP/IP Networking795427 +Node: Profiling798300 +Node: Advanced Features Summary805847 +Node: Internationalization807780 +Node: I18N and L10N809260 +Node: Explaining gettext809946 +Ref: Explaining gettext-Footnote-1814971 +Ref: Explaining gettext-Footnote-2815155 +Node: Programmer i18n815320 +Ref: Programmer i18n-Footnote-1820186 +Node: Translator i18n820235 +Node: String Extraction821029 +Ref: String Extraction-Footnote-1822160 +Node: Printf Ordering822246 +Ref: Printf Ordering-Footnote-1825032 +Node: I18N Portability825096 +Ref: I18N Portability-Footnote-1827551 +Node: I18N Example827614 +Ref: I18N Example-Footnote-1830417 +Node: Gawk I18N830489 +Node: I18N Summary831127 +Node: Debugger832466 +Node: Debugging833488 +Node: Debugging Concepts833929 +Node: Debugging Terms835782 +Node: Awk Debugging838354 +Node: Sample Debugging Session839248 +Node: Debugger Invocation839768 +Node: Finding The Bug841152 +Node: List of Debugger Commands847627 +Node: Breakpoint Control848960 +Node: Debugger Execution Control852656 +Node: Viewing And Changing Data856020 +Node: Execution Stack859398 +Node: Debugger Info861035 +Node: Miscellaneous Debugger Commands865052 +Node: Readline Support870081 +Node: Limitations870973 +Node: Debugging Summary873087 +Node: Arbitrary Precision Arithmetic874255 +Node: Computer Arithmetic875671 +Ref: table-numeric-ranges879269 +Ref: Computer Arithmetic-Footnote-1880128 +Node: Math Definitions880185 +Ref: table-ieee-formats883473 +Ref: Math Definitions-Footnote-1884077 +Node: MPFR features884182 +Node: FP Math Caution885853 +Ref: FP Math Caution-Footnote-1886903 +Node: Inexactness of computations887272 +Node: Inexact representation888231 +Node: Comparing FP Values889588 +Node: Errors accumulate890670 +Node: Getting Accuracy892103 +Node: Try To Round894765 +Node: Setting precision895664 +Ref: table-predefined-precision-strings896348 +Node: Setting the rounding mode898137 +Ref: table-gawk-rounding-modes898501 +Ref: Setting the rounding mode-Footnote-1901956 +Node: Arbitrary Precision Integers902135 +Ref: Arbitrary Precision Integers-Footnote-1905121 +Node: POSIX Floating Point Problems905270 +Ref: POSIX Floating Point Problems-Footnote-1909143 +Node: Floating point summary909181 +Node: Dynamic Extensions911375 +Node: Extension Intro912927 +Node: Plugin License914193 +Node: Extension Mechanism Outline914990 +Ref: figure-load-extension915418 +Ref: figure-register-new-function916898 +Ref: figure-call-new-function917902 +Node: Extension API Description919888 +Node: Extension API Functions Introduction921338 +Node: General Data Types926162 +Ref: General Data Types-Footnote-1931901 +Node: Memory Allocation Functions932200 +Ref: Memory Allocation Functions-Footnote-1935039 +Node: Constructor Functions935135 +Node: Registration Functions936869 +Node: Extension Functions937554 +Node: Exit Callback Functions939851 +Node: Extension Version String941099 +Node: Input Parsers941764 +Node: Output Wrappers951641 +Node: Two-way processors956156 +Node: Printing Messages958360 +Ref: Printing Messages-Footnote-1959436 +Node: Updating `ERRNO'959588 +Node: Requesting Values960328 +Ref: table-value-types-returned961056 +Node: Accessing Parameters962013 +Node: Symbol Table Access963244 +Node: Symbol table by name963758 +Node: Symbol table by cookie965739 +Ref: Symbol table by cookie-Footnote-1969883 +Node: Cached values969946 +Ref: Cached values-Footnote-1973445 +Node: Array Manipulation973536 +Ref: Array Manipulation-Footnote-1974634 +Node: Array Data Types974671 +Ref: Array Data Types-Footnote-1977326 +Node: Array Functions977418 +Node: Flattening Arrays981272 +Node: Creating Arrays988164 +Node: Extension API Variables992933 +Node: Extension Versioning993569 +Node: Extension API Informational Variables995470 +Node: Extension API Boilerplate996558 +Node: Finding Extensions1000367 +Node: Extension Example1000927 +Node: Internal File Description1001699 +Node: Internal File Ops1005766 +Ref: Internal File Ops-Footnote-11017436 +Node: Using Internal File Ops1017576 +Ref: Using Internal File Ops-Footnote-11019959 +Node: Extension Samples1020232 +Node: Extension Sample File Functions1021758 +Node: Extension Sample Fnmatch1029396 +Node: Extension Sample Fork1030887 +Node: Extension Sample Inplace1032102 +Node: Extension Sample Ord1033777 +Node: Extension Sample Readdir1034613 +Ref: table-readdir-file-types1035489 +Node: Extension Sample Revout1036300 +Node: Extension Sample Rev2way1036890 +Node: Extension Sample Read write array1037630 +Node: Extension Sample Readfile1039570 +Node: Extension Sample Time1040665 +Node: Extension Sample API Tests1042014 +Node: gawkextlib1042505 +Node: Extension summary1045163 +Node: Extension Exercises1048840 +Node: Language History1049562 +Node: V7/SVR3.11051218 +Node: SVR41053399 +Node: POSIX1054844 +Node: BTL1056233 +Node: POSIX/GNU1056967 +Node: Feature History1062531 +Node: Common Extensions1075629 +Node: Ranges and Locales1076953 +Ref: Ranges and Locales-Footnote-11081571 +Ref: Ranges and Locales-Footnote-21081598 +Ref: Ranges and Locales-Footnote-31081832 +Node: Contributors1082053 +Node: History summary1087594 +Node: Installation1088964 +Node: Gawk Distribution1089910 +Node: Getting1090394 +Node: Extracting1091217 +Node: Distribution contents1092852 +Node: Unix Installation1098569 +Node: Quick Installation1099186 +Node: Additional Configuration Options1101610 +Node: Configuration Philosophy1103348 +Node: Non-Unix Installation1105717 +Node: PC Installation1106175 +Node: PC Binary Installation1107494 +Node: PC Compiling1109342 +Ref: PC Compiling-Footnote-11112363 +Node: PC Testing1112472 +Node: PC Using1113648 +Node: Cygwin1117763 +Node: MSYS1118586 +Node: VMS Installation1119086 +Node: VMS Compilation1119878 +Ref: VMS Compilation-Footnote-11121100 +Node: VMS Dynamic Extensions1121158 +Node: VMS Installation Details1122842 +Node: VMS Running1125094 +Node: VMS GNV1127930 +Node: VMS Old Gawk1128664 +Node: Bugs1129134 +Node: Other Versions1133017 +Node: Installation summary1139439 +Node: Notes1140495 +Node: Compatibility Mode1141360 +Node: Additions1142142 +Node: Accessing The Source1143067 +Node: Adding Code1144503 +Node: New Ports1150668 +Node: Derived Files1155150 +Ref: Derived Files-Footnote-11160625 +Ref: Derived Files-Footnote-21160659 +Ref: Derived Files-Footnote-31161255 +Node: Future Extensions1161369 +Node: Implementation Limitations1161975 +Node: Extension Design1163223 +Node: Old Extension Problems1164377 +Ref: Old Extension Problems-Footnote-11165894 +Node: Extension New Mechanism Goals1165951 +Ref: Extension New Mechanism Goals-Footnote-11169311 +Node: Extension Other Design Decisions1169500 +Node: Extension Future Growth1171608 +Node: Old Extension Mechanism1172444 +Node: Notes summary1174206 +Node: Basic Concepts1175392 +Node: Basic High Level1176073 +Ref: figure-general-flow1176345 +Ref: figure-process-flow1176944 +Ref: Basic High Level-Footnote-11180173 +Node: Basic Data Typing1180358 +Node: Glossary1183686 +Node: Copying1208844 +Node: GNU Free Documentation License1246400 +Node: Index1271536  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index bc93c38e..b4c6b687 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -9341,7 +9341,7 @@ a single byte (0--255). @item @code{%d}, @code{%i} Print a decimal integer. The two control letters are equivalent. -(The @code{%i} specification is for compatibility with ISO C.) +(The @samp{%i} specification is for compatibility with ISO C.) @item @code{%e}, @code{%E} Print a number in scientific (exponential) notation; @@ -9356,7 +9356,7 @@ prints @samp{1.950e+03}, with a total of four significant figures, three of which follow the decimal point. (The @samp{4.3} represents two modifiers, discussed in the next @value{SUBSECTION}.) -@code{%E} uses @samp{E} instead of @samp{e} in the output. +@samp{%E} uses @samp{E} instead of @samp{e} in the output. @item @code{%f} Print a number in floating-point notation. @@ -9382,16 +9382,16 @@ The special ``not a number'' value formats as @samp{-nan} or @samp{nan} (@pxref{Math Definitions}). @item @code{%F} -Like @code{%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 @code{%F} format is a POSIX extension to ISO C; not all systems -support it. On those that don't, @command{gawk} uses @code{%f} instead. +The @samp{%F} format is a POSIX extension to ISO C; not all systems +support it. On those that don't, @command{gawk} uses @samp{%f} instead. @item @code{%g}, @code{%G} Print a number in either scientific notation or in floating-point notation, whichever uses fewer characters; if the result is printed in -scientific notation, @code{%G} uses @samp{E} instead of @samp{e}. +scientific notation, @samp{%G} uses @samp{E} instead of @samp{e}. @item @code{%o} Print an unsigned octal integer @@ -9407,7 +9407,7 @@ are floating point; it is provided primarily for compatibility with C.) @item @code{%x}, @code{%X} Print an unsigned hexadecimal integer; -@code{%X} uses the letters @samp{A} through @samp{F} +@samp{%X} uses the letters @samp{A} through @samp{F} instead of @samp{a} through @samp{f} (@pxref{Nondecimal-numbers}). @@ -9422,7 +9422,7 @@ argument and it ignores any modifiers. @quotation NOTE When using the integer format-control letters for values that are outside the range of the widest C integer type, @command{gawk} switches to -the @code{%g} format specifier. If @option{--lint} is provided on the +the @samp{%g} format specifier. If @option{--lint} is provided on the command line (@pxref{Options}), @command{gawk} warns about this. Other versions of @command{awk} may print invalid values or do something else entirely. @@ -9497,12 +9497,12 @@ to format is positive. The @samp{+} overrides the space modifier. @item # Use an ``alternative form'' for certain control letters. -For @code{%o}, supply a leading zero. -For @code{%x} and @code{%X}, supply a leading @code{0x} or @samp{0X} for +For @samp{%o}, supply a leading zero. +For @samp{%x} and @samp{%X}, supply a leading @samp{0x} or @samp{0X} for a nonzero result. -For @code{%e}, @code{%E}, @code{%f}, and @code{%F}, the result always +For @samp{%e}, @samp{%E}, @samp{%f}, and @samp{%F}, the result always contains a decimal point. -For @code{%g} and @code{%G}, trailing zeros are not removed from the result. +For @samp{%g} and @samp{%G}, trailing zeros are not removed from the result. @item 0 A leading @samp{0} (zero) acts as a flag indicating that output should be @@ -13020,7 +13020,7 @@ character}, to find the record terminator. Locales can affect how dates and times are formatted (@pxref{Time Functions}). For example, a common way to abbreviate the date September 4, 2015, in the United States is ``9/4/15.'' In many countries in -Europe, however, it is abbreviated ``4.9.15.'' Thus, the @code{%x} +Europe, however, it is abbreviated ``4.9.15.'' Thus, the @samp{%x} specification in a @code{"US"} locale might produce @samp{9/4/15}, while in a @code{"EUROPE"} locale, it might produce @samp{4.9.15}. @@ -13247,9 +13247,8 @@ $ @kbd{awk '$1 ~ /li/ @{ print $2 @}' mail-list} @cindex regexp constants, as patterns @cindex patterns, regexp constants as -A regexp constant as a pattern is also a special case of an expression -pattern. The expression @samp{/li/} has the value one if @samp{li} -appears in the current input record. Thus, as a pattern, @samp{/li/} +pattern. The expression @code{/li/} has the value one if @samp{li} +appears in the current input record. Thus, as a pattern, @code{/li/} matches any record containing @samp{li}. @cindex Boolean expressions, as patterns @@ -16904,7 +16903,8 @@ This @value{CHAPTER} describes @command{awk}'s built-in functions, which fall into three categories: numeric, string, and I/O. @command{gawk} provides additional groups of functions to work with values that represent time, do -bit manipulation, sort arrays, and internationalize and localize programs. +bit manipulation, sort arrays, +provide type information, and internationalize and localize programs. Besides the built-in functions, @command{awk} has provisions for writing new functions that the rest of a program can use. @@ -18793,7 +18793,7 @@ of its ISO week number is 2013, even though its year is 2012. The full year of the ISO week number, as a decimal number. @item %h -Equivalent to @code{%b}. +Equivalent to @samp{%b}. @item %H The hour (24-hour clock) as a decimal number (00--23). @@ -18862,7 +18862,7 @@ The locale's ``appropriate'' date representation. @item %X The locale's ``appropriate'' time representation. -(This is @code{%T} in the @code{"C"} locale.) +(This is @samp{%T} in the @code{"C"} locale.) @item %y The year modulo 100 as a decimal number (00--99). @@ -18883,7 +18883,7 @@ no time zone is determinable. @item %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH @itemx %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy ``Alternative representations'' for the specifications -that use only the second letter (@code{%c}, @code{%C}, +that use only the second letter (@samp{%c}, @samp{%C}, and so on).@footnote{If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to ``internationalize'' programs. @@ -18922,11 +18922,11 @@ Single-digit numbers are padded with a space. @ignore @item %N The ``Emperor/Era'' name. -Equivalent to @code{%C}. +Equivalent to @samp{%C}. @item %o The ``Emperor/Era'' year. -Equivalent to @code{%y}. +Equivalent to @samp{%y}. @end ignore @item %s @@ -20232,7 +20232,7 @@ saving it in @code{start}. The last part of the code loops through each function name (from @code{$2} up to the marker, @samp{data:}), calling the function named by the field. The indirect function call itself occurs as a parameter in the call to @code{printf}. -(The @code{printf} format string uses @code{%s} as the format specifier so that we +(The @code{printf} format string uses @samp{%s} as the format specifier so that we can use functions that return strings, as well as numbers. Note that the result from the indirect call is concatenated with the empty string, in order to force it to be a string value.) @@ -25525,8 +25525,8 @@ END @{ @} @end example -The regexp @samp{/[^[:alnum:]_[:blank:]]/} might have been written -@samp{/[[:punct:]]/}, but then underscores would also be removed, +The regexp @code{/[^[:alnum:]_[:blank:]]/} might have been written +@code{/[[:punct:]]/}, but then underscores would also be removed, and we want to keep them. Assuming we have saved this program in a file named @file{wordfreq.awk}, @@ -27635,7 +27635,7 @@ like so: @example command = "sort -nr" # command, save in convenience variable PROCINFO[command, "pty"] = 1 # update PROCINFO -print @dots{} |& command # start two-way pipe +print @dots{} |& command # start two-way pipe @dots{} @end example @@ -35557,7 +35557,7 @@ for case translation (@pxref{String Functions}). @item -A cleaner specification for the @code{%c} format-control letter in the +A cleaner specification for the @samp{%c} format-control letter in the @code{printf} function (@pxref{Control Letters}). diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 7a765db4..dfb9d00a 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -8942,7 +8942,7 @@ a single byte (0--255). @item @code{%d}, @code{%i} Print a decimal integer. The two control letters are equivalent. -(The @code{%i} specification is for compatibility with ISO C.) +(The @samp{%i} specification is for compatibility with ISO C.) @item @code{%e}, @code{%E} Print a number in scientific (exponential) notation; @@ -8957,7 +8957,7 @@ prints @samp{1.950e+03}, with a total of four significant figures, three of which follow the decimal point. (The @samp{4.3} represents two modifiers, discussed in the next @value{SUBSECTION}.) -@code{%E} uses @samp{E} instead of @samp{e} in the output. +@samp{%E} uses @samp{E} instead of @samp{e} in the output. @item @code{%f} Print a number in floating-point notation. @@ -8983,16 +8983,16 @@ The special ``not a number'' value formats as @samp{-nan} or @samp{nan} (@pxref{Math Definitions}). @item @code{%F} -Like @code{%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 @code{%F} format is a POSIX extension to ISO C; not all systems -support it. On those that don't, @command{gawk} uses @code{%f} instead. +The @samp{%F} format is a POSIX extension to ISO C; not all systems +support it. On those that don't, @command{gawk} uses @samp{%f} instead. @item @code{%g}, @code{%G} Print a number in either scientific notation or in floating-point notation, whichever uses fewer characters; if the result is printed in -scientific notation, @code{%G} uses @samp{E} instead of @samp{e}. +scientific notation, @samp{%G} uses @samp{E} instead of @samp{e}. @item @code{%o} Print an unsigned octal integer @@ -9008,7 +9008,7 @@ are floating point; it is provided primarily for compatibility with C.) @item @code{%x}, @code{%X} Print an unsigned hexadecimal integer; -@code{%X} uses the letters @samp{A} through @samp{F} +@samp{%X} uses the letters @samp{A} through @samp{F} instead of @samp{a} through @samp{f} (@pxref{Nondecimal-numbers}). @@ -9023,7 +9023,7 @@ argument and it ignores any modifiers. @quotation NOTE When using the integer format-control letters for values that are outside the range of the widest C integer type, @command{gawk} switches to -the @code{%g} format specifier. If @option{--lint} is provided on the +the @samp{%g} format specifier. If @option{--lint} is provided on the command line (@pxref{Options}), @command{gawk} warns about this. Other versions of @command{awk} may print invalid values or do something else entirely. @@ -9098,12 +9098,12 @@ to format is positive. The @samp{+} overrides the space modifier. @item # Use an ``alternative form'' for certain control letters. -For @code{%o}, supply a leading zero. -For @code{%x} and @code{%X}, supply a leading @code{0x} or @samp{0X} for +For @samp{%o}, supply a leading zero. +For @samp{%x} and @samp{%X}, supply a leading @samp{0x} or @samp{0X} for a nonzero result. -For @code{%e}, @code{%E}, @code{%f}, and @code{%F}, the result always +For @samp{%e}, @samp{%E}, @samp{%f}, and @samp{%F}, the result always contains a decimal point. -For @code{%g} and @code{%G}, trailing zeros are not removed from the result. +For @samp{%g} and @samp{%G}, trailing zeros are not removed from the result. @item 0 A leading @samp{0} (zero) acts as a flag indicating that output should be @@ -12349,7 +12349,7 @@ character}, to find the record terminator. Locales can affect how dates and times are formatted (@pxref{Time Functions}). For example, a common way to abbreviate the date September 4, 2015, in the United States is ``9/4/15.'' In many countries in -Europe, however, it is abbreviated ``4.9.15.'' Thus, the @code{%x} +Europe, however, it is abbreviated ``4.9.15.'' Thus, the @samp{%x} specification in a @code{"US"} locale might produce @samp{9/4/15}, while in a @code{"EUROPE"} locale, it might produce @samp{4.9.15}. @@ -12576,9 +12576,8 @@ $ @kbd{awk '$1 ~ /li/ @{ print $2 @}' mail-list} @cindex regexp constants, as patterns @cindex patterns, regexp constants as -A regexp constant as a pattern is also a special case of an expression -pattern. The expression @samp{/li/} has the value one if @samp{li} -appears in the current input record. Thus, as a pattern, @samp{/li/} +pattern. The expression @code{/li/} has the value one if @samp{li} +appears in the current input record. Thus, as a pattern, @code{/li/} matches any record containing @samp{li}. @cindex Boolean expressions, as patterns @@ -16187,7 +16186,8 @@ This @value{CHAPTER} describes @command{awk}'s built-in functions, which fall into three categories: numeric, string, and I/O. @command{gawk} provides additional groups of functions to work with values that represent time, do -bit manipulation, sort arrays, and internationalize and localize programs. +bit manipulation, sort arrays, +provide type information, and internationalize and localize programs. Besides the built-in functions, @command{awk} has provisions for writing new functions that the rest of a program can use. @@ -17915,7 +17915,7 @@ of its ISO week number is 2013, even though its year is 2012. The full year of the ISO week number, as a decimal number. @item %h -Equivalent to @code{%b}. +Equivalent to @samp{%b}. @item %H The hour (24-hour clock) as a decimal number (00--23). @@ -17984,7 +17984,7 @@ The locale's ``appropriate'' date representation. @item %X The locale's ``appropriate'' time representation. -(This is @code{%T} in the @code{"C"} locale.) +(This is @samp{%T} in the @code{"C"} locale.) @item %y The year modulo 100 as a decimal number (00--99). @@ -18005,7 +18005,7 @@ no time zone is determinable. @item %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH @itemx %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy ``Alternative representations'' for the specifications -that use only the second letter (@code{%c}, @code{%C}, +that use only the second letter (@samp{%c}, @samp{%C}, and so on).@footnote{If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to ``internationalize'' programs. @@ -18044,11 +18044,11 @@ Single-digit numbers are padded with a space. @ignore @item %N The ``Emperor/Era'' name. -Equivalent to @code{%C}. +Equivalent to @samp{%C}. @item %o The ``Emperor/Era'' year. -Equivalent to @code{%y}. +Equivalent to @samp{%y}. @end ignore @item %s @@ -19354,7 +19354,7 @@ saving it in @code{start}. The last part of the code loops through each function name (from @code{$2} up to the marker, @samp{data:}), calling the function named by the field. The indirect function call itself occurs as a parameter in the call to @code{printf}. -(The @code{printf} format string uses @code{%s} as the format specifier so that we +(The @code{printf} format string uses @samp{%s} as the format specifier so that we can use functions that return strings, as well as numbers. Note that the result from the indirect call is concatenated with the empty string, in order to force it to be a string value.) @@ -24618,8 +24618,8 @@ END @{ @} @end example -The regexp @samp{/[^[:alnum:]_[:blank:]]/} might have been written -@samp{/[[:punct:]]/}, but then underscores would also be removed, +The regexp @code{/[^[:alnum:]_[:blank:]]/} might have been written +@code{/[[:punct:]]/}, but then underscores would also be removed, and we want to keep them. Assuming we have saved this program in a file named @file{wordfreq.awk}, @@ -26728,7 +26728,7 @@ like so: @example command = "sort -nr" # command, save in convenience variable PROCINFO[command, "pty"] = 1 # update PROCINFO -print @dots{} |& command # start two-way pipe +print @dots{} |& command # start two-way pipe @dots{} @end example @@ -34650,7 +34650,7 @@ for case translation (@pxref{String Functions}). @item -A cleaner specification for the @code{%c} format-control letter in the +A cleaner specification for the @samp{%c} format-control letter in the @code{printf} function (@pxref{Control Letters}). -- cgit v1.2.3 From 4ec42f2201d6d15be74de5d6d34b1baa614a2e9f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 10 Dec 2014 22:01:12 +0200 Subject: More doc fixes. --- doc/ChangeLog | 4 + doc/gawk.info | 881 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 17 +- doc/gawktexi.in | 17 +- 4 files changed, 460 insertions(+), 459 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d6c70902..0a52dfbe 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-10 Arnold D. Robbins + + * gawktexi.in: More minor fixes. + 2014-12-09 Arnold D. Robbins * gawktexi.in: More minor fixes. diff --git a/doc/gawk.info b/doc/gawk.info index 3e7606f0..fe080ce1 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -6512,7 +6512,7 @@ which they may appear: messages at runtime. *Note Printf Ordering::, which describes how and why to use positional specifiers. For now, we ignore them. -`-' +`- (Minus)' The minus sign, used before the width modifier (see later on in this list), says to left-justify the argument within its specified width. Normally, the argument is printed right-justified in the @@ -23296,14 +23296,14 @@ used for `RT', if any. To provide an input parser, you must first provide two functions (where XXX is a prefix name for your extension): -`awk_bool_t XXX_can_take_file(const awk_input_buf_t *iobuf)' +`awk_bool_t XXX_can_take_file(const awk_input_buf_t *iobuf);' This function examines the information available in `iobuf' (which we discuss shortly). Based on the information there, it decides if the input parser should be used for this file. If so, it should return true. Otherwise, it should return false. It should not change any state (variable values, etc.) within `gawk'. -`awk_bool_t XXX_take_control_of(awk_input_buf_t *iobuf)' +`awk_bool_t XXX_take_control_of(awk_input_buf_t *iobuf);' When `gawk' decides to hand control of the file over to the input parser, it calls this function. This function in turn must fill in certain fields in the `awk_input_buf_t' structure, and ensure @@ -24409,7 +24409,7 @@ code: previously existing array using `set_array_element()'. We show example code shortly. - * Due to gawk internals, after using `sym_update()' to install an + * Due to `gawk' internals, after using `sym_update()' to install an array into `gawk', you have to retrieve the array cookie from the value passed in to `sym_update()' before doing anything else with it, like so: @@ -24601,8 +24601,7 @@ invoked. The variables are: This variable is true if `gawk' was invoked with `--debug' option. `do_lint' - This variable is true if `gawk' was invoked with `--lint' option - (*note Options::). + This variable is true if `gawk' was invoked with `--lint' option. `do_mpfr' This variable is true if `gawk' was invoked with `--bignum' option. @@ -26050,8 +26049,8 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga that loaded it. * It is easiest to start a new extension by copying the boilerplate - code described in this major node. Macros in the `gawkapi.h' make - this easier to do. + code described in this major node. Macros in the `gawkapi.h' + header file make this easier to do. * The `gawk' distribution includes a number of small but useful sample extensions. The `gawkextlib' project includes several more, @@ -28282,7 +28281,7 @@ Unix `awk' As a side note, Dan Bornstein has created a Git repository tracking all the versions of BWK `awk' that he could find. It's available - at `git://github.com/onetrueawk/awk'. + at `git://github.com/danfuzz/one-true-awk'. `mawk' Michael Brennan wrote an independent implementation of `awk', @@ -34420,437 +34419,437 @@ Node: Printf279258 Node: Basic Printf280043 Node: Control Letters281613 Node: Format Modifiers285596 -Node: Printf Examples291597 -Node: Redirection294083 -Node: Special FD300924 -Ref: Special FD-Footnote-1304084 -Node: Special Files304158 -Node: Other Inherited Files304775 -Node: Special Network305775 -Node: Special Caveats306637 -Node: Close Files And Pipes307588 -Ref: Close Files And Pipes-Footnote-1314770 -Ref: Close Files And Pipes-Footnote-2314918 -Node: Output Summary315068 -Node: Output Exercises316066 -Node: Expressions316746 -Node: Values317931 -Node: Constants318609 -Node: Scalar Constants319300 -Ref: Scalar Constants-Footnote-1320159 -Node: Nondecimal-numbers320409 -Node: Regexp Constants323427 -Node: Using Constant Regexps323952 -Node: Variables327095 -Node: Using Variables327750 -Node: Assignment Options329661 -Node: Conversion331536 -Node: Strings And Numbers332060 -Ref: Strings And Numbers-Footnote-1335125 -Node: Locale influences conversions335234 -Ref: table-locale-affects337981 -Node: All Operators338569 -Node: Arithmetic Ops339199 -Node: Concatenation341704 -Ref: Concatenation-Footnote-1344523 -Node: Assignment Ops344629 -Ref: table-assign-ops349608 -Node: Increment Ops350880 -Node: Truth Values and Conditions354318 -Node: Truth Values355403 -Node: Typing and Comparison356452 -Node: Variable Typing357262 -Node: Comparison Operators360915 -Ref: table-relational-ops361325 -Node: POSIX String Comparison364820 -Ref: POSIX String Comparison-Footnote-1365892 -Node: Boolean Ops366030 -Ref: Boolean Ops-Footnote-1370509 -Node: Conditional Exp370600 -Node: Function Calls372327 -Node: Precedence376207 -Node: Locales379868 -Node: Expressions Summary381500 -Node: Patterns and Actions384060 -Node: Pattern Overview385180 -Node: Regexp Patterns386859 -Node: Expression Patterns387402 -Node: Ranges391112 -Node: BEGIN/END394218 -Node: Using BEGIN/END394979 -Ref: Using BEGIN/END-Footnote-1397713 -Node: I/O And BEGIN/END397819 -Node: BEGINFILE/ENDFILE400133 -Node: Empty403034 -Node: Using Shell Variables403351 -Node: Action Overview405624 -Node: Statements407950 -Node: If Statement409798 -Node: While Statement411293 -Node: Do Statement413322 -Node: For Statement414466 -Node: Switch Statement417623 -Node: Break Statement420005 -Node: Continue Statement422046 -Node: Next Statement423873 -Node: Nextfile Statement426254 -Node: Exit Statement428884 -Node: Built-in Variables431287 -Node: User-modified432420 -Ref: User-modified-Footnote-1440101 -Node: Auto-set440163 -Ref: Auto-set-Footnote-1453198 -Ref: Auto-set-Footnote-2453403 -Node: ARGC and ARGV453459 -Node: Pattern Action Summary457677 -Node: Arrays460104 -Node: Array Basics461433 -Node: Array Intro462277 -Ref: figure-array-elements464241 -Ref: Array Intro-Footnote-1466767 -Node: Reference to Elements466895 -Node: Assigning Elements469347 -Node: Array Example469838 -Node: Scanning an Array471596 -Node: Controlling Scanning474612 -Ref: Controlling Scanning-Footnote-1479808 -Node: Numeric Array Subscripts480124 -Node: Uninitialized Subscripts482309 -Node: Delete483926 -Ref: Delete-Footnote-1486669 -Node: Multidimensional486726 -Node: Multiscanning489823 -Node: Arrays of Arrays491412 -Node: Arrays Summary496171 -Node: Functions498263 -Node: Built-in499162 -Node: Calling Built-in500240 -Node: Numeric Functions502231 -Ref: Numeric Functions-Footnote-1506248 -Ref: Numeric Functions-Footnote-2506605 -Ref: Numeric Functions-Footnote-3506653 -Node: String Functions506925 -Ref: String Functions-Footnote-1530400 -Ref: String Functions-Footnote-2530529 -Ref: String Functions-Footnote-3530777 -Node: Gory Details530864 -Ref: table-sub-escapes532645 -Ref: table-sub-proposed534165 -Ref: table-posix-sub535529 -Ref: table-gensub-escapes537065 -Ref: Gory Details-Footnote-1537897 -Node: I/O Functions538048 -Ref: I/O Functions-Footnote-1545266 -Node: Time Functions545413 -Ref: Time Functions-Footnote-1555901 -Ref: Time Functions-Footnote-2555969 -Ref: Time Functions-Footnote-3556127 -Ref: Time Functions-Footnote-4556238 -Ref: Time Functions-Footnote-5556350 -Ref: Time Functions-Footnote-6556577 -Node: Bitwise Functions556843 -Ref: table-bitwise-ops557405 -Ref: Bitwise Functions-Footnote-1561714 -Node: Type Functions561883 -Node: I18N Functions563034 -Node: User-defined564679 -Node: Definition Syntax565484 -Ref: Definition Syntax-Footnote-1570891 -Node: Function Example570962 -Ref: Function Example-Footnote-1573881 -Node: Function Caveats573903 -Node: Calling A Function574421 -Node: Variable Scope575379 -Node: Pass By Value/Reference578367 -Node: Return Statement581862 -Node: Dynamic Typing584843 -Node: Indirect Calls585772 -Ref: Indirect Calls-Footnote-1597074 -Node: Functions Summary597202 -Node: Library Functions599904 -Ref: Library Functions-Footnote-1603513 -Ref: Library Functions-Footnote-2603656 -Node: Library Names603827 -Ref: Library Names-Footnote-1607281 -Ref: Library Names-Footnote-2607504 -Node: General Functions607590 -Node: Strtonum Function608693 -Node: Assert Function611715 -Node: Round Function615039 -Node: Cliff Random Function616580 -Node: Ordinal Functions617596 -Ref: Ordinal Functions-Footnote-1620659 -Ref: Ordinal Functions-Footnote-2620911 -Node: Join Function621122 -Ref: Join Function-Footnote-1622891 -Node: Getlocaltime Function623091 -Node: Readfile Function626835 -Node: Shell Quoting628805 -Node: Data File Management630206 -Node: Filetrans Function630838 -Node: Rewind Function634894 -Node: File Checking636281 -Ref: File Checking-Footnote-1637613 -Node: Empty Files637814 -Node: Ignoring Assigns639793 -Node: Getopt Function641344 -Ref: Getopt Function-Footnote-1652806 -Node: Passwd Functions653006 -Ref: Passwd Functions-Footnote-1661843 -Node: Group Functions661931 -Ref: Group Functions-Footnote-1669825 -Node: Walking Arrays670038 -Node: Library Functions Summary671641 -Node: Library Exercises673042 -Node: Sample Programs674322 -Node: Running Examples675092 -Node: Clones675820 -Node: Cut Program677044 -Node: Egrep Program686763 -Ref: Egrep Program-Footnote-1694261 -Node: Id Program694371 -Node: Split Program698016 -Ref: Split Program-Footnote-1701464 -Node: Tee Program701592 -Node: Uniq Program704381 -Node: Wc Program711800 -Ref: Wc Program-Footnote-1716050 -Node: Miscellaneous Programs716144 -Node: Dupword Program717357 -Node: Alarm Program719388 -Node: Translate Program724192 -Ref: Translate Program-Footnote-1728757 -Node: Labels Program729027 -Ref: Labels Program-Footnote-1732378 -Node: Word Sorting732462 -Node: History Sorting736533 -Node: Extract Program738369 -Node: Simple Sed745894 -Node: Igawk Program748962 -Ref: Igawk Program-Footnote-1763286 -Ref: Igawk Program-Footnote-2763487 -Ref: Igawk Program-Footnote-3763609 -Node: Anagram Program763724 -Node: Signature Program766781 -Node: Programs Summary768028 -Node: Programs Exercises769221 -Ref: Programs Exercises-Footnote-1773352 -Node: Advanced Features773443 -Node: Nondecimal Data775391 -Node: Array Sorting776981 -Node: Controlling Array Traversal777678 -Ref: Controlling Array Traversal-Footnote-1786011 -Node: Array Sorting Functions786129 -Ref: Array Sorting Functions-Footnote-1790018 -Node: Two-way I/O790214 -Ref: Two-way I/O-Footnote-1795159 -Ref: Two-way I/O-Footnote-2795345 -Node: TCP/IP Networking795427 -Node: Profiling798300 -Node: Advanced Features Summary805847 -Node: Internationalization807780 -Node: I18N and L10N809260 -Node: Explaining gettext809946 -Ref: Explaining gettext-Footnote-1814971 -Ref: Explaining gettext-Footnote-2815155 -Node: Programmer i18n815320 -Ref: Programmer i18n-Footnote-1820186 -Node: Translator i18n820235 -Node: String Extraction821029 -Ref: String Extraction-Footnote-1822160 -Node: Printf Ordering822246 -Ref: Printf Ordering-Footnote-1825032 -Node: I18N Portability825096 -Ref: I18N Portability-Footnote-1827551 -Node: I18N Example827614 -Ref: I18N Example-Footnote-1830417 -Node: Gawk I18N830489 -Node: I18N Summary831127 -Node: Debugger832466 -Node: Debugging833488 -Node: Debugging Concepts833929 -Node: Debugging Terms835782 -Node: Awk Debugging838354 -Node: Sample Debugging Session839248 -Node: Debugger Invocation839768 -Node: Finding The Bug841152 -Node: List of Debugger Commands847627 -Node: Breakpoint Control848960 -Node: Debugger Execution Control852656 -Node: Viewing And Changing Data856020 -Node: Execution Stack859398 -Node: Debugger Info861035 -Node: Miscellaneous Debugger Commands865052 -Node: Readline Support870081 -Node: Limitations870973 -Node: Debugging Summary873087 -Node: Arbitrary Precision Arithmetic874255 -Node: Computer Arithmetic875671 -Ref: table-numeric-ranges879269 -Ref: Computer Arithmetic-Footnote-1880128 -Node: Math Definitions880185 -Ref: table-ieee-formats883473 -Ref: Math Definitions-Footnote-1884077 -Node: MPFR features884182 -Node: FP Math Caution885853 -Ref: FP Math Caution-Footnote-1886903 -Node: Inexactness of computations887272 -Node: Inexact representation888231 -Node: Comparing FP Values889588 -Node: Errors accumulate890670 -Node: Getting Accuracy892103 -Node: Try To Round894765 -Node: Setting precision895664 -Ref: table-predefined-precision-strings896348 -Node: Setting the rounding mode898137 -Ref: table-gawk-rounding-modes898501 -Ref: Setting the rounding mode-Footnote-1901956 -Node: Arbitrary Precision Integers902135 -Ref: Arbitrary Precision Integers-Footnote-1905121 -Node: POSIX Floating Point Problems905270 -Ref: POSIX Floating Point Problems-Footnote-1909143 -Node: Floating point summary909181 -Node: Dynamic Extensions911375 -Node: Extension Intro912927 -Node: Plugin License914193 -Node: Extension Mechanism Outline914990 -Ref: figure-load-extension915418 -Ref: figure-register-new-function916898 -Ref: figure-call-new-function917902 -Node: Extension API Description919888 -Node: Extension API Functions Introduction921338 -Node: General Data Types926162 -Ref: General Data Types-Footnote-1931901 -Node: Memory Allocation Functions932200 -Ref: Memory Allocation Functions-Footnote-1935039 -Node: Constructor Functions935135 -Node: Registration Functions936869 -Node: Extension Functions937554 -Node: Exit Callback Functions939851 -Node: Extension Version String941099 -Node: Input Parsers941764 -Node: Output Wrappers951641 -Node: Two-way processors956156 -Node: Printing Messages958360 -Ref: Printing Messages-Footnote-1959436 -Node: Updating `ERRNO'959588 -Node: Requesting Values960328 -Ref: table-value-types-returned961056 -Node: Accessing Parameters962013 -Node: Symbol Table Access963244 -Node: Symbol table by name963758 -Node: Symbol table by cookie965739 -Ref: Symbol table by cookie-Footnote-1969883 -Node: Cached values969946 -Ref: Cached values-Footnote-1973445 -Node: Array Manipulation973536 -Ref: Array Manipulation-Footnote-1974634 -Node: Array Data Types974671 -Ref: Array Data Types-Footnote-1977326 -Node: Array Functions977418 -Node: Flattening Arrays981272 -Node: Creating Arrays988164 -Node: Extension API Variables992933 -Node: Extension Versioning993569 -Node: Extension API Informational Variables995470 -Node: Extension API Boilerplate996558 -Node: Finding Extensions1000367 -Node: Extension Example1000927 -Node: Internal File Description1001699 -Node: Internal File Ops1005766 -Ref: Internal File Ops-Footnote-11017436 -Node: Using Internal File Ops1017576 -Ref: Using Internal File Ops-Footnote-11019959 -Node: Extension Samples1020232 -Node: Extension Sample File Functions1021758 -Node: Extension Sample Fnmatch1029396 -Node: Extension Sample Fork1030887 -Node: Extension Sample Inplace1032102 -Node: Extension Sample Ord1033777 -Node: Extension Sample Readdir1034613 -Ref: table-readdir-file-types1035489 -Node: Extension Sample Revout1036300 -Node: Extension Sample Rev2way1036890 -Node: Extension Sample Read write array1037630 -Node: Extension Sample Readfile1039570 -Node: Extension Sample Time1040665 -Node: Extension Sample API Tests1042014 -Node: gawkextlib1042505 -Node: Extension summary1045163 -Node: Extension Exercises1048840 -Node: Language History1049562 -Node: V7/SVR3.11051218 -Node: SVR41053399 -Node: POSIX1054844 -Node: BTL1056233 -Node: POSIX/GNU1056967 -Node: Feature History1062531 -Node: Common Extensions1075629 -Node: Ranges and Locales1076953 -Ref: Ranges and Locales-Footnote-11081571 -Ref: Ranges and Locales-Footnote-21081598 -Ref: Ranges and Locales-Footnote-31081832 -Node: Contributors1082053 -Node: History summary1087594 -Node: Installation1088964 -Node: Gawk Distribution1089910 -Node: Getting1090394 -Node: Extracting1091217 -Node: Distribution contents1092852 -Node: Unix Installation1098569 -Node: Quick Installation1099186 -Node: Additional Configuration Options1101610 -Node: Configuration Philosophy1103348 -Node: Non-Unix Installation1105717 -Node: PC Installation1106175 -Node: PC Binary Installation1107494 -Node: PC Compiling1109342 -Ref: PC Compiling-Footnote-11112363 -Node: PC Testing1112472 -Node: PC Using1113648 -Node: Cygwin1117763 -Node: MSYS1118586 -Node: VMS Installation1119086 -Node: VMS Compilation1119878 -Ref: VMS Compilation-Footnote-11121100 -Node: VMS Dynamic Extensions1121158 -Node: VMS Installation Details1122842 -Node: VMS Running1125094 -Node: VMS GNV1127930 -Node: VMS Old Gawk1128664 -Node: Bugs1129134 -Node: Other Versions1133017 -Node: Installation summary1139439 -Node: Notes1140495 -Node: Compatibility Mode1141360 -Node: Additions1142142 -Node: Accessing The Source1143067 -Node: Adding Code1144503 -Node: New Ports1150668 -Node: Derived Files1155150 -Ref: Derived Files-Footnote-11160625 -Ref: Derived Files-Footnote-21160659 -Ref: Derived Files-Footnote-31161255 -Node: Future Extensions1161369 -Node: Implementation Limitations1161975 -Node: Extension Design1163223 -Node: Old Extension Problems1164377 -Ref: Old Extension Problems-Footnote-11165894 -Node: Extension New Mechanism Goals1165951 -Ref: Extension New Mechanism Goals-Footnote-11169311 -Node: Extension Other Design Decisions1169500 -Node: Extension Future Growth1171608 -Node: Old Extension Mechanism1172444 -Node: Notes summary1174206 -Node: Basic Concepts1175392 -Node: Basic High Level1176073 -Ref: figure-general-flow1176345 -Ref: figure-process-flow1176944 -Ref: Basic High Level-Footnote-11180173 -Node: Basic Data Typing1180358 -Node: Glossary1183686 -Node: Copying1208844 -Node: GNU Free Documentation License1246400 -Node: Index1271536 +Node: Printf Examples291605 +Node: Redirection294091 +Node: Special FD300932 +Ref: Special FD-Footnote-1304092 +Node: Special Files304166 +Node: Other Inherited Files304783 +Node: Special Network305783 +Node: Special Caveats306645 +Node: Close Files And Pipes307596 +Ref: Close Files And Pipes-Footnote-1314778 +Ref: Close Files And Pipes-Footnote-2314926 +Node: Output Summary315076 +Node: Output Exercises316074 +Node: Expressions316754 +Node: Values317939 +Node: Constants318617 +Node: Scalar Constants319308 +Ref: Scalar Constants-Footnote-1320167 +Node: Nondecimal-numbers320417 +Node: Regexp Constants323435 +Node: Using Constant Regexps323960 +Node: Variables327103 +Node: Using Variables327758 +Node: Assignment Options329669 +Node: Conversion331544 +Node: Strings And Numbers332068 +Ref: Strings And Numbers-Footnote-1335133 +Node: Locale influences conversions335242 +Ref: table-locale-affects337989 +Node: All Operators338577 +Node: Arithmetic Ops339207 +Node: Concatenation341712 +Ref: Concatenation-Footnote-1344531 +Node: Assignment Ops344637 +Ref: table-assign-ops349616 +Node: Increment Ops350888 +Node: Truth Values and Conditions354326 +Node: Truth Values355411 +Node: Typing and Comparison356460 +Node: Variable Typing357270 +Node: Comparison Operators360923 +Ref: table-relational-ops361333 +Node: POSIX String Comparison364828 +Ref: POSIX String Comparison-Footnote-1365900 +Node: Boolean Ops366038 +Ref: Boolean Ops-Footnote-1370517 +Node: Conditional Exp370608 +Node: Function Calls372335 +Node: Precedence376215 +Node: Locales379876 +Node: Expressions Summary381508 +Node: Patterns and Actions384068 +Node: Pattern Overview385188 +Node: Regexp Patterns386867 +Node: Expression Patterns387410 +Node: Ranges391120 +Node: BEGIN/END394226 +Node: Using BEGIN/END394987 +Ref: Using BEGIN/END-Footnote-1397721 +Node: I/O And BEGIN/END397827 +Node: BEGINFILE/ENDFILE400141 +Node: Empty403042 +Node: Using Shell Variables403359 +Node: Action Overview405632 +Node: Statements407958 +Node: If Statement409806 +Node: While Statement411301 +Node: Do Statement413330 +Node: For Statement414474 +Node: Switch Statement417631 +Node: Break Statement420013 +Node: Continue Statement422054 +Node: Next Statement423881 +Node: Nextfile Statement426262 +Node: Exit Statement428892 +Node: Built-in Variables431295 +Node: User-modified432428 +Ref: User-modified-Footnote-1440109 +Node: Auto-set440171 +Ref: Auto-set-Footnote-1453206 +Ref: Auto-set-Footnote-2453411 +Node: ARGC and ARGV453467 +Node: Pattern Action Summary457685 +Node: Arrays460112 +Node: Array Basics461441 +Node: Array Intro462285 +Ref: figure-array-elements464249 +Ref: Array Intro-Footnote-1466775 +Node: Reference to Elements466903 +Node: Assigning Elements469355 +Node: Array Example469846 +Node: Scanning an Array471604 +Node: Controlling Scanning474620 +Ref: Controlling Scanning-Footnote-1479816 +Node: Numeric Array Subscripts480132 +Node: Uninitialized Subscripts482317 +Node: Delete483934 +Ref: Delete-Footnote-1486677 +Node: Multidimensional486734 +Node: Multiscanning489831 +Node: Arrays of Arrays491420 +Node: Arrays Summary496179 +Node: Functions498271 +Node: Built-in499170 +Node: Calling Built-in500248 +Node: Numeric Functions502239 +Ref: Numeric Functions-Footnote-1506256 +Ref: Numeric Functions-Footnote-2506613 +Ref: Numeric Functions-Footnote-3506661 +Node: String Functions506933 +Ref: String Functions-Footnote-1530408 +Ref: String Functions-Footnote-2530537 +Ref: String Functions-Footnote-3530785 +Node: Gory Details530872 +Ref: table-sub-escapes532653 +Ref: table-sub-proposed534173 +Ref: table-posix-sub535537 +Ref: table-gensub-escapes537073 +Ref: Gory Details-Footnote-1537905 +Node: I/O Functions538056 +Ref: I/O Functions-Footnote-1545274 +Node: Time Functions545421 +Ref: Time Functions-Footnote-1555909 +Ref: Time Functions-Footnote-2555977 +Ref: Time Functions-Footnote-3556135 +Ref: Time Functions-Footnote-4556246 +Ref: Time Functions-Footnote-5556358 +Ref: Time Functions-Footnote-6556585 +Node: Bitwise Functions556851 +Ref: table-bitwise-ops557413 +Ref: Bitwise Functions-Footnote-1561722 +Node: Type Functions561891 +Node: I18N Functions563042 +Node: User-defined564687 +Node: Definition Syntax565492 +Ref: Definition Syntax-Footnote-1570899 +Node: Function Example570970 +Ref: Function Example-Footnote-1573889 +Node: Function Caveats573911 +Node: Calling A Function574429 +Node: Variable Scope575387 +Node: Pass By Value/Reference578375 +Node: Return Statement581870 +Node: Dynamic Typing584851 +Node: Indirect Calls585780 +Ref: Indirect Calls-Footnote-1597082 +Node: Functions Summary597210 +Node: Library Functions599912 +Ref: Library Functions-Footnote-1603521 +Ref: Library Functions-Footnote-2603664 +Node: Library Names603835 +Ref: Library Names-Footnote-1607289 +Ref: Library Names-Footnote-2607512 +Node: General Functions607598 +Node: Strtonum Function608701 +Node: Assert Function611723 +Node: Round Function615047 +Node: Cliff Random Function616588 +Node: Ordinal Functions617604 +Ref: Ordinal Functions-Footnote-1620667 +Ref: Ordinal Functions-Footnote-2620919 +Node: Join Function621130 +Ref: Join Function-Footnote-1622899 +Node: Getlocaltime Function623099 +Node: Readfile Function626843 +Node: Shell Quoting628813 +Node: Data File Management630214 +Node: Filetrans Function630846 +Node: Rewind Function634902 +Node: File Checking636289 +Ref: File Checking-Footnote-1637621 +Node: Empty Files637822 +Node: Ignoring Assigns639801 +Node: Getopt Function641352 +Ref: Getopt Function-Footnote-1652814 +Node: Passwd Functions653014 +Ref: Passwd Functions-Footnote-1661851 +Node: Group Functions661939 +Ref: Group Functions-Footnote-1669833 +Node: Walking Arrays670046 +Node: Library Functions Summary671649 +Node: Library Exercises673050 +Node: Sample Programs674330 +Node: Running Examples675100 +Node: Clones675828 +Node: Cut Program677052 +Node: Egrep Program686771 +Ref: Egrep Program-Footnote-1694269 +Node: Id Program694379 +Node: Split Program698024 +Ref: Split Program-Footnote-1701472 +Node: Tee Program701600 +Node: Uniq Program704389 +Node: Wc Program711808 +Ref: Wc Program-Footnote-1716058 +Node: Miscellaneous Programs716152 +Node: Dupword Program717365 +Node: Alarm Program719396 +Node: Translate Program724200 +Ref: Translate Program-Footnote-1728765 +Node: Labels Program729035 +Ref: Labels Program-Footnote-1732386 +Node: Word Sorting732470 +Node: History Sorting736541 +Node: Extract Program738377 +Node: Simple Sed745902 +Node: Igawk Program748970 +Ref: Igawk Program-Footnote-1763294 +Ref: Igawk Program-Footnote-2763495 +Ref: Igawk Program-Footnote-3763617 +Node: Anagram Program763732 +Node: Signature Program766789 +Node: Programs Summary768036 +Node: Programs Exercises769229 +Ref: Programs Exercises-Footnote-1773360 +Node: Advanced Features773451 +Node: Nondecimal Data775399 +Node: Array Sorting776989 +Node: Controlling Array Traversal777686 +Ref: Controlling Array Traversal-Footnote-1786019 +Node: Array Sorting Functions786137 +Ref: Array Sorting Functions-Footnote-1790026 +Node: Two-way I/O790222 +Ref: Two-way I/O-Footnote-1795167 +Ref: Two-way I/O-Footnote-2795353 +Node: TCP/IP Networking795435 +Node: Profiling798308 +Node: Advanced Features Summary805855 +Node: Internationalization807788 +Node: I18N and L10N809268 +Node: Explaining gettext809954 +Ref: Explaining gettext-Footnote-1814979 +Ref: Explaining gettext-Footnote-2815163 +Node: Programmer i18n815328 +Ref: Programmer i18n-Footnote-1820194 +Node: Translator i18n820243 +Node: String Extraction821037 +Ref: String Extraction-Footnote-1822168 +Node: Printf Ordering822254 +Ref: Printf Ordering-Footnote-1825040 +Node: I18N Portability825104 +Ref: I18N Portability-Footnote-1827559 +Node: I18N Example827622 +Ref: I18N Example-Footnote-1830425 +Node: Gawk I18N830497 +Node: I18N Summary831135 +Node: Debugger832474 +Node: Debugging833496 +Node: Debugging Concepts833937 +Node: Debugging Terms835790 +Node: Awk Debugging838362 +Node: Sample Debugging Session839256 +Node: Debugger Invocation839776 +Node: Finding The Bug841160 +Node: List of Debugger Commands847635 +Node: Breakpoint Control848968 +Node: Debugger Execution Control852664 +Node: Viewing And Changing Data856028 +Node: Execution Stack859406 +Node: Debugger Info861043 +Node: Miscellaneous Debugger Commands865060 +Node: Readline Support870089 +Node: Limitations870981 +Node: Debugging Summary873095 +Node: Arbitrary Precision Arithmetic874263 +Node: Computer Arithmetic875679 +Ref: table-numeric-ranges879277 +Ref: Computer Arithmetic-Footnote-1880136 +Node: Math Definitions880193 +Ref: table-ieee-formats883481 +Ref: Math Definitions-Footnote-1884085 +Node: MPFR features884190 +Node: FP Math Caution885861 +Ref: FP Math Caution-Footnote-1886911 +Node: Inexactness of computations887280 +Node: Inexact representation888239 +Node: Comparing FP Values889596 +Node: Errors accumulate890678 +Node: Getting Accuracy892111 +Node: Try To Round894773 +Node: Setting precision895672 +Ref: table-predefined-precision-strings896356 +Node: Setting the rounding mode898145 +Ref: table-gawk-rounding-modes898509 +Ref: Setting the rounding mode-Footnote-1901964 +Node: Arbitrary Precision Integers902143 +Ref: Arbitrary Precision Integers-Footnote-1905129 +Node: POSIX Floating Point Problems905278 +Ref: POSIX Floating Point Problems-Footnote-1909151 +Node: Floating point summary909189 +Node: Dynamic Extensions911383 +Node: Extension Intro912935 +Node: Plugin License914201 +Node: Extension Mechanism Outline914998 +Ref: figure-load-extension915426 +Ref: figure-register-new-function916906 +Ref: figure-call-new-function917910 +Node: Extension API Description919896 +Node: Extension API Functions Introduction921346 +Node: General Data Types926170 +Ref: General Data Types-Footnote-1931909 +Node: Memory Allocation Functions932208 +Ref: Memory Allocation Functions-Footnote-1935047 +Node: Constructor Functions935143 +Node: Registration Functions936877 +Node: Extension Functions937562 +Node: Exit Callback Functions939859 +Node: Extension Version String941107 +Node: Input Parsers941772 +Node: Output Wrappers951651 +Node: Two-way processors956166 +Node: Printing Messages958370 +Ref: Printing Messages-Footnote-1959446 +Node: Updating `ERRNO'959598 +Node: Requesting Values960338 +Ref: table-value-types-returned961066 +Node: Accessing Parameters962023 +Node: Symbol Table Access963254 +Node: Symbol table by name963768 +Node: Symbol table by cookie965749 +Ref: Symbol table by cookie-Footnote-1969893 +Node: Cached values969956 +Ref: Cached values-Footnote-1973455 +Node: Array Manipulation973546 +Ref: Array Manipulation-Footnote-1974644 +Node: Array Data Types974681 +Ref: Array Data Types-Footnote-1977336 +Node: Array Functions977428 +Node: Flattening Arrays981282 +Node: Creating Arrays988174 +Node: Extension API Variables992945 +Node: Extension Versioning993581 +Node: Extension API Informational Variables995482 +Node: Extension API Boilerplate996547 +Node: Finding Extensions1000356 +Node: Extension Example1000916 +Node: Internal File Description1001688 +Node: Internal File Ops1005755 +Ref: Internal File Ops-Footnote-11017425 +Node: Using Internal File Ops1017565 +Ref: Using Internal File Ops-Footnote-11019948 +Node: Extension Samples1020221 +Node: Extension Sample File Functions1021747 +Node: Extension Sample Fnmatch1029385 +Node: Extension Sample Fork1030876 +Node: Extension Sample Inplace1032091 +Node: Extension Sample Ord1033766 +Node: Extension Sample Readdir1034602 +Ref: table-readdir-file-types1035478 +Node: Extension Sample Revout1036289 +Node: Extension Sample Rev2way1036879 +Node: Extension Sample Read write array1037619 +Node: Extension Sample Readfile1039559 +Node: Extension Sample Time1040654 +Node: Extension Sample API Tests1042003 +Node: gawkextlib1042494 +Node: Extension summary1045152 +Node: Extension Exercises1048841 +Node: Language History1049563 +Node: V7/SVR3.11051219 +Node: SVR41053400 +Node: POSIX1054845 +Node: BTL1056234 +Node: POSIX/GNU1056968 +Node: Feature History1062532 +Node: Common Extensions1075630 +Node: Ranges and Locales1076954 +Ref: Ranges and Locales-Footnote-11081572 +Ref: Ranges and Locales-Footnote-21081599 +Ref: Ranges and Locales-Footnote-31081833 +Node: Contributors1082054 +Node: History summary1087595 +Node: Installation1088965 +Node: Gawk Distribution1089911 +Node: Getting1090395 +Node: Extracting1091218 +Node: Distribution contents1092853 +Node: Unix Installation1098570 +Node: Quick Installation1099187 +Node: Additional Configuration Options1101611 +Node: Configuration Philosophy1103349 +Node: Non-Unix Installation1105718 +Node: PC Installation1106176 +Node: PC Binary Installation1107495 +Node: PC Compiling1109343 +Ref: PC Compiling-Footnote-11112364 +Node: PC Testing1112473 +Node: PC Using1113649 +Node: Cygwin1117764 +Node: MSYS1118587 +Node: VMS Installation1119087 +Node: VMS Compilation1119879 +Ref: VMS Compilation-Footnote-11121101 +Node: VMS Dynamic Extensions1121159 +Node: VMS Installation Details1122843 +Node: VMS Running1125095 +Node: VMS GNV1127931 +Node: VMS Old Gawk1128665 +Node: Bugs1129135 +Node: Other Versions1133018 +Node: Installation summary1139446 +Node: Notes1140502 +Node: Compatibility Mode1141367 +Node: Additions1142149 +Node: Accessing The Source1143074 +Node: Adding Code1144510 +Node: New Ports1150675 +Node: Derived Files1155157 +Ref: Derived Files-Footnote-11160632 +Ref: Derived Files-Footnote-21160666 +Ref: Derived Files-Footnote-31161262 +Node: Future Extensions1161376 +Node: Implementation Limitations1161982 +Node: Extension Design1163230 +Node: Old Extension Problems1164384 +Ref: Old Extension Problems-Footnote-11165901 +Node: Extension New Mechanism Goals1165958 +Ref: Extension New Mechanism Goals-Footnote-11169318 +Node: Extension Other Design Decisions1169507 +Node: Extension Future Growth1171615 +Node: Old Extension Mechanism1172451 +Node: Notes summary1174213 +Node: Basic Concepts1175399 +Node: Basic High Level1176080 +Ref: figure-general-flow1176352 +Ref: figure-process-flow1176951 +Ref: Basic High Level-Footnote-11180180 +Node: Basic Data Typing1180365 +Node: Glossary1183693 +Node: Copying1208851 +Node: GNU Free Documentation License1246407 +Node: Index1271543  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index b4c6b687..03f8bd48 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -9471,7 +9471,7 @@ messages at runtime. which describes how and why to use positional specifiers. For now, we ignore them. -@item - +@item - (Minus) The minus sign, used before the width modifier (see later on in this list), says to left-justify @@ -32139,14 +32139,14 @@ To provide an input parser, you must first provide two functions (where @var{XXX} is a prefix name for your extension): @table @code -@item awk_bool_t @var{XXX}_can_take_file(const awk_input_buf_t *iobuf) +@item awk_bool_t @var{XXX}_can_take_file(const awk_input_buf_t *iobuf); This function examines the information available in @code{iobuf} (which we discuss shortly). Based on the information there, it decides if the input parser should be used for this file. If so, it should return true. Otherwise, it should return false. It should not change any state (variable values, etc.) within @command{gawk}. -@item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf) +@item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf); When @command{gawk} decides to hand control of the file over to the input parser, it calls this function. This function in turn must fill in certain fields in the @code{awk_input_buf_t} structure, and ensure @@ -33430,7 +33430,7 @@ using @code{sym_update()}, or install it as an element in a previously existing array using @code{set_array_element()}. We show example code shortly. @item -Due to gawk internals, after using @code{sym_update()} to install an array +Due to @command{gawk} internals, after using @code{sym_update()} to install an array into @command{gawk}, you have to retrieve the array cookie from the value passed in to @command{sym_update()} before doing anything else with it, like so: @@ -33685,8 +33685,7 @@ whether the corresponding command-line options were enabled when This variable is true if @command{gawk} was invoked with @option{--debug} option. @item do_lint -This variable is true if @command{gawk} was invoked with @option{--lint} option -(@pxref{Options}). +This variable is true if @command{gawk} was invoked with @option{--lint} option. @item do_mpfr This variable is true if @command{gawk} was invoked with @option{--bignum} option. @@ -35303,8 +35302,8 @@ that loaded it. @item It is easiest to start a new extension by copying the boilerplate code -described in this @value{CHAPTER}. Macros in the @file{gawkapi.h} make -this easier to do. +described in this @value{CHAPTER}. Macros in the @file{gawkapi.h} header +file make this easier to do. @item The @command{gawk} distribution includes a number of small but useful @@ -38471,7 +38470,7 @@ for a list of extensions in this @command{awk} that are not in POSIX @command{aw As a side note, Dan Bornstein has created a Git repository tracking all the versions of BWK @command{awk} that he could find. It's -available at @uref{git://github.com/onetrueawk/awk}. +available at @uref{git://github.com/danfuzz/one-true-awk}. @cindex Brennan, Michael @cindex @command{mawk} utility diff --git a/doc/gawktexi.in b/doc/gawktexi.in index dfb9d00a..53b24f37 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -9072,7 +9072,7 @@ messages at runtime. which describes how and why to use positional specifiers. For now, we ignore them. -@item - +@item - (Minus) The minus sign, used before the width modifier (see later on in this list), says to left-justify @@ -31232,14 +31232,14 @@ To provide an input parser, you must first provide two functions (where @var{XXX} is a prefix name for your extension): @table @code -@item awk_bool_t @var{XXX}_can_take_file(const awk_input_buf_t *iobuf) +@item awk_bool_t @var{XXX}_can_take_file(const awk_input_buf_t *iobuf); This function examines the information available in @code{iobuf} (which we discuss shortly). Based on the information there, it decides if the input parser should be used for this file. If so, it should return true. Otherwise, it should return false. It should not change any state (variable values, etc.) within @command{gawk}. -@item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf) +@item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf); When @command{gawk} decides to hand control of the file over to the input parser, it calls this function. This function in turn must fill in certain fields in the @code{awk_input_buf_t} structure, and ensure @@ -32523,7 +32523,7 @@ using @code{sym_update()}, or install it as an element in a previously existing array using @code{set_array_element()}. We show example code shortly. @item -Due to gawk internals, after using @code{sym_update()} to install an array +Due to @command{gawk} internals, after using @code{sym_update()} to install an array into @command{gawk}, you have to retrieve the array cookie from the value passed in to @command{sym_update()} before doing anything else with it, like so: @@ -32778,8 +32778,7 @@ whether the corresponding command-line options were enabled when This variable is true if @command{gawk} was invoked with @option{--debug} option. @item do_lint -This variable is true if @command{gawk} was invoked with @option{--lint} option -(@pxref{Options}). +This variable is true if @command{gawk} was invoked with @option{--lint} option. @item do_mpfr This variable is true if @command{gawk} was invoked with @option{--bignum} option. @@ -34396,8 +34395,8 @@ that loaded it. @item It is easiest to start a new extension by copying the boilerplate code -described in this @value{CHAPTER}. Macros in the @file{gawkapi.h} make -this easier to do. +described in this @value{CHAPTER}. Macros in the @file{gawkapi.h} header +file make this easier to do. @item The @command{gawk} distribution includes a number of small but useful @@ -37564,7 +37563,7 @@ for a list of extensions in this @command{awk} that are not in POSIX @command{aw As a side note, Dan Bornstein has created a Git repository tracking all the versions of BWK @command{awk} that he could find. It's -available at @uref{git://github.com/onetrueawk/awk}. +available at @uref{git://github.com/danfuzz/one-true-awk}. @cindex Brennan, Michael @cindex @command{mawk} utility -- cgit v1.2.3 From 4518d0d3c80d8c616a8a7f65548fde4866495289 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 10 Dec 2014 22:12:26 +0200 Subject: Sync dfa.c with grep. --- ChangeLog | 4 ++++ dfa.c | 39 +++++++++++++++------------------------ 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5dc79045..fdb550a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-12-10 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. + 2014-11-26 Arnold D. Robbins * builtin.c (do_sub): Improve wording of gensub warnings. diff --git a/dfa.c b/dfa.c index 66136ce2..2ea37b52 100644 --- a/dfa.c +++ b/dfa.c @@ -3496,13 +3496,23 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, } } - if ((char *) p > end) + if (s < 0) { - p = NULL; - goto done; + if ((char *) p > end || p[-1] != eol || d->newlines[s1] < 0) + { + p = NULL; + goto done; + } + + /* The previous character was a newline, count it, and skip + checking of multibyte character boundary until here. */ + nlcount++; + mbp = p; + + s = allow_nl ? d->newlines[s1] : 0; } - if (s >= 0 && d->fails[s]) + if (d->fails[s]) { if (d->success[s] & sbit[*p]) { @@ -3516,32 +3526,13 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, State_transition(); else s = d->fails[s][*p++]; - continue; - } - - /* If the previous character was a newline, count it, and skip - checking of multibyte character boundary until here. */ - if (p[-1] == eol) - { - nlcount++; - mbp = p; } - - if (s >= 0) + else { if (!d->trans[s]) build_state (s, d); trans = d->trans; - continue; } - - if (p[-1] == eol && allow_nl) - { - s = d->newlines[s1]; - continue; - } - - s = 0; } done: -- cgit v1.2.3 From fa9d1a09cfe9e7386746a2c6523b5503d1b4aff9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 12 Dec 2014 06:16:43 +0200 Subject: Improve comment handling in pretty printing. --- ChangeLog | 17 ++ awk.h | 5 + awkgram.c | 788 +++++++++++++++++++++++++++++-------------------------- awkgram.y | 70 ++++- profile.c | 181 +++++++------ test/ChangeLog | 5 + test/profile5.ok | 707 +++++++++++++++++++++++++------------------------ 7 files changed, 976 insertions(+), 797 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac30d2b4..a9c7e555 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2014-12-12 Stephen Davies + + Improve comment handling in pretty printing. + + * awk.h (comment_type): New field in the node. + (EOL_COMMENT, FULL_COMMENT): New defines. + * awkgram.y (block_comment): New variable. + (check_comment): New function. + (grammar): Add code to handle comments as needed. + (get_comment): Now takes a flag indicating kind of comment. + (yylex): Collect comments appropriately. + (append_rule): Ditto. + * profile.c (pprint): Smarten up comment handling. + Have printing \n take comments into account. + (end_line): New function. + (pp_func): Better handling of function comments. + 2014-12-10 Arnold D. Robbins * dfa.c: Sync with GNU grep. diff --git a/awk.h b/awk.h index a932b54d..41181529 100644 --- a/awk.h +++ b/awk.h @@ -530,6 +530,11 @@ typedef struct exp_node { #define adepth sub.nodep.l.ll #define alevel sub.nodep.x.xl +/* Op_comment */ +#define comment_type sub.val.idx +#define EOL_COMMENT 1 +#define FULL_COMMENT 2 + /* --------------------------------lint warning types----------------------------*/ typedef enum lintvals { LINT_illegal, diff --git a/awkgram.c b/awkgram.c index ddd41d5b..225cdb4e 100644 --- a/awkgram.c +++ b/awkgram.c @@ -128,6 +128,7 @@ static void check_funcs(void); static ssize_t read_one_line(int fd, void *buffer, size_t count); static int one_line_close(int fd); static void split_comment(void); +static void check_comment(void); static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ @@ -190,8 +191,10 @@ static INSTRUCTION *ip_beginfile; static INSTRUCTION *comment = NULL; static INSTRUCTION *program_comment = NULL; static INSTRUCTION *function_comment = NULL; +static INSTRUCTION *block_comment = NULL; static bool func_first = true; +static bool first_rule = true; static inline INSTRUCTION *list_create(INSTRUCTION *x); static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x); @@ -202,7 +205,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -#line 206 "awkgram.c" /* yacc.c:339 */ +#line 209 "awkgram.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -356,7 +359,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 360 "awkgram.c" /* yacc.c:358 */ +#line 363 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -658,25 +661,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, 219, 231, 235, 246, - 252, 257, 265, 273, 275, 280, 288, 290, 296, 304, - 314, 340, 353, 366, 373, 383, 395, 397, 399, 405, - 410, 411, 415, 450, 449, 483, 485, 490, 496, 524, - 529, 530, 534, 536, 538, 545, 635, 677, 719, 832, - 839, 846, 856, 865, 874, 883, 894, 910, 909, 933, - 945, 945, 1043, 1043, 1076, 1106, 1112, 1113, 1119, 1120, - 1127, 1132, 1144, 1158, 1160, 1168, 1173, 1175, 1183, 1185, - 1194, 1195, 1203, 1208, 1208, 1219, 1223, 1231, 1232, 1235, - 1237, 1242, 1243, 1252, 1253, 1258, 1263, 1269, 1271, 1273, - 1280, 1281, 1287, 1288, 1293, 1295, 1300, 1302, 1310, 1315, - 1324, 1331, 1333, 1335, 1351, 1361, 1368, 1370, 1375, 1377, - 1379, 1387, 1389, 1394, 1396, 1401, 1403, 1405, 1455, 1457, - 1459, 1461, 1463, 1465, 1467, 1469, 1483, 1488, 1493, 1518, - 1524, 1526, 1528, 1530, 1532, 1534, 1539, 1543, 1575, 1577, - 1583, 1589, 1602, 1603, 1604, 1609, 1614, 1618, 1622, 1637, - 1650, 1655, 1691, 1709, 1710, 1716, 1717, 1722, 1724, 1731, - 1748, 1765, 1767, 1774, 1779, 1787, 1797, 1809, 1818, 1822, - 1826, 1830, 1834, 1838, 1841, 1843, 1847, 1851, 1855 + 0, 208, 208, 210, 215, 216, 222, 234, 238, 249, + 255, 260, 268, 276, 278, 283, 291, 293, 299, 307, + 317, 347, 361, 375, 383, 394, 406, 408, 410, 416, + 421, 422, 426, 461, 460, 494, 496, 501, 507, 535, + 540, 541, 545, 547, 549, 556, 646, 688, 730, 843, + 850, 857, 867, 876, 885, 894, 905, 921, 920, 944, + 956, 956, 1054, 1054, 1087, 1117, 1123, 1124, 1130, 1131, + 1138, 1143, 1155, 1169, 1171, 1179, 1184, 1186, 1194, 1196, + 1205, 1206, 1214, 1219, 1219, 1230, 1234, 1242, 1243, 1246, + 1248, 1253, 1254, 1263, 1264, 1269, 1274, 1280, 1282, 1284, + 1291, 1292, 1298, 1299, 1304, 1306, 1311, 1313, 1321, 1326, + 1335, 1342, 1344, 1346, 1362, 1372, 1379, 1381, 1386, 1388, + 1390, 1398, 1400, 1405, 1407, 1412, 1414, 1416, 1466, 1468, + 1470, 1472, 1474, 1476, 1478, 1480, 1494, 1499, 1504, 1529, + 1535, 1537, 1539, 1541, 1543, 1545, 1550, 1554, 1586, 1588, + 1594, 1600, 1613, 1614, 1615, 1620, 1625, 1629, 1633, 1648, + 1661, 1666, 1702, 1720, 1721, 1727, 1728, 1733, 1735, 1742, + 1759, 1776, 1778, 1785, 1790, 1798, 1808, 1820, 1829, 1833, + 1837, 1841, 1845, 1849, 1852, 1854, 1858, 1862, 1866 }; #endif @@ -1849,26 +1852,26 @@ yyreduce: switch (yyn) { case 3: -#line 208 "awkgram.y" /* yacc.c:1646 */ +#line 211 "awkgram.y" /* yacc.c:1646 */ { rule = 0; yyerrok; } -#line 1858 "awkgram.c" /* yacc.c:1646 */ +#line 1861 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 214 "awkgram.y" /* yacc.c:1646 */ +#line 217 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); if (sourcefile == srcfiles) process_deferred(); } -#line 1868 "awkgram.c" /* yacc.c:1646 */ +#line 1871 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 220 "awkgram.y" /* yacc.c:1646 */ +#line 223 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -1877,19 +1880,19 @@ yyreduce: */ /* yyerrok; */ } -#line 1881 "awkgram.c" /* yacc.c:1646 */ +#line 1884 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 232 "awkgram.y" /* yacc.c:1646 */ +#line 235 "awkgram.y" /* yacc.c:1646 */ { (void) append_rule((yyvsp[-1]), (yyvsp[0])); } -#line 1889 "awkgram.c" /* yacc.c:1646 */ +#line 1892 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 236 "awkgram.y" /* yacc.c:1646 */ +#line 239 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1900,39 +1903,39 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1904 "awkgram.c" /* yacc.c:1646 */ +#line 1907 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 247 "awkgram.y" /* yacc.c:1646 */ +#line 250 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1914 "awkgram.c" /* yacc.c:1646 */ +#line 1917 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 253 "awkgram.y" /* yacc.c:1646 */ +#line 256 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1923 "awkgram.c" /* yacc.c:1646 */ +#line 1926 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 258 "awkgram.y" /* yacc.c:1646 */ +#line 261 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1932 "awkgram.c" /* yacc.c:1646 */ +#line 1935 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 266 "awkgram.y" /* yacc.c:1646 */ +#line 269 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1940,23 +1943,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1944 "awkgram.c" /* yacc.c:1646 */ +#line 1947 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 274 "awkgram.y" /* yacc.c:1646 */ +#line 277 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1950 "awkgram.c" /* yacc.c:1646 */ +#line 1953 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 276 "awkgram.y" /* yacc.c:1646 */ +#line 279 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1956 "awkgram.c" /* yacc.c:1646 */ +#line 1959 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 281 "awkgram.y" /* yacc.c:1646 */ +#line 284 "awkgram.y" /* yacc.c:1646 */ { if (load_library((yyvsp[0])) < 0) YYABORT; @@ -1964,23 +1967,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1968 "awkgram.c" /* yacc.c:1646 */ +#line 1971 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 289 "awkgram.y" /* yacc.c:1646 */ +#line 292 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1974 "awkgram.c" /* yacc.c:1646 */ +#line 1977 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 291 "awkgram.y" /* yacc.c:1646 */ +#line 294 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1980 "awkgram.c" /* yacc.c:1646 */ +#line 1983 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 296 "awkgram.y" /* yacc.c:1646 */ +#line 299 "awkgram.y" /* yacc.c:1646 */ { rule = Rule; if (comment != NULL) { @@ -1989,11 +1992,11 @@ yyreduce: } else (yyval) = NULL; } -#line 1993 "awkgram.c" /* yacc.c:1646 */ +#line 1996 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 305 "awkgram.y" /* yacc.c:1646 */ +#line 308 "awkgram.y" /* yacc.c:1646 */ { rule = Rule; if (comment != NULL) { @@ -2002,11 +2005,11 @@ yyreduce: } else (yyval) = (yyvsp[0]); } -#line 2006 "awkgram.c" /* yacc.c:1646 */ +#line 2009 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 315 "awkgram.y" /* yacc.c:1646 */ +#line 318 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2029,14 +2032,18 @@ yyreduce: ((yyvsp[-3])->nexti + 1)->condpair_left = (yyvsp[-3])->lasti; ((yyvsp[-3])->nexti + 1)->condpair_right = (yyvsp[0])->lasti; } - (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); + if (comment != NULL) { + (yyval) = list_append(list_merge(list_prepend((yyvsp[-3]), comment), (yyvsp[0])), tp); + comment = NULL; + } else + (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2036 "awkgram.c" /* yacc.c:1646 */ +#line 2043 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 341 "awkgram.y" /* yacc.c:1646 */ +#line 348 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; @@ -2047,13 +2054,14 @@ yyreduce: (yyvsp[0])->in_rule = rule = BEGIN; (yyvsp[0])->source_file = source; + check_comment(); (yyval) = (yyvsp[0]); } -#line 2053 "awkgram.c" /* yacc.c:1646 */ +#line 2061 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 354 "awkgram.y" /* yacc.c:1646 */ +#line 362 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; @@ -2064,35 +2072,38 @@ yyreduce: (yyvsp[0])->in_rule = rule = END; (yyvsp[0])->source_file = source; + check_comment(); (yyval) = (yyvsp[0]); } -#line 2070 "awkgram.c" /* yacc.c:1646 */ +#line 2079 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 367 "awkgram.y" /* yacc.c:1646 */ +#line 376 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; + check_comment(); (yyval) = (yyvsp[0]); } -#line 2081 "awkgram.c" /* yacc.c:1646 */ +#line 2091 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 374 "awkgram.y" /* yacc.c:1646 */ +#line 384 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; + check_comment(); (yyval) = (yyvsp[0]); } -#line 2092 "awkgram.c" /* yacc.c:1646 */ +#line 2103 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 384 "awkgram.y" /* yacc.c:1646 */ +#line 395 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; if ((yyvsp[-3]) == NULL) @@ -2101,39 +2112,39 @@ yyreduce: ip = (yyvsp[-3]); (yyval) = ip; } -#line 2105 "awkgram.c" /* yacc.c:1646 */ +#line 2116 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 396 "awkgram.y" /* yacc.c:1646 */ +#line 407 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2111 "awkgram.c" /* yacc.c:1646 */ +#line 2122 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 398 "awkgram.y" /* yacc.c:1646 */ +#line 409 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2117 "awkgram.c" /* yacc.c:1646 */ +#line 2128 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 400 "awkgram.y" /* yacc.c:1646 */ +#line 411 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2127 "awkgram.c" /* yacc.c:1646 */ +#line 2138 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 406 "awkgram.y" /* yacc.c:1646 */ +#line 417 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2133 "awkgram.c" /* yacc.c:1646 */ +#line 2144 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 416 "awkgram.y" /* yacc.c:1646 */ +#line 427 "awkgram.y" /* yacc.c:1646 */ { /* * treat any comments between BOF and the first function @@ -2160,17 +2171,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2164 "awkgram.c" /* yacc.c:1646 */ +#line 2175 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 450 "awkgram.y" /* yacc.c:1646 */ +#line 461 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2170 "awkgram.c" /* yacc.c:1646 */ +#line 2181 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 452 "awkgram.y" /* yacc.c:1646 */ +#line 463 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2199,28 +2210,28 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2203 "awkgram.c" /* yacc.c:1646 */ +#line 2214 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 484 "awkgram.y" /* yacc.c:1646 */ +#line 495 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2209 "awkgram.c" /* yacc.c:1646 */ +#line 2220 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 490 "awkgram.y" /* yacc.c:1646 */ +#line 501 "awkgram.y" /* yacc.c:1646 */ { if (comment != NULL) { (yyval) = list_create(comment); comment = NULL; } else (yyval) = NULL; } -#line 2220 "awkgram.c" /* yacc.c:1646 */ +#line 2231 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 497 "awkgram.y" /* yacc.c:1646 */ +#line 508 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) { if (comment == NULL) @@ -2248,40 +2259,40 @@ yyreduce: } yyerrok; } -#line 2252 "awkgram.c" /* yacc.c:1646 */ +#line 2263 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 525 "awkgram.y" /* yacc.c:1646 */ +#line 536 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2258 "awkgram.c" /* yacc.c:1646 */ +#line 2269 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 535 "awkgram.y" /* yacc.c:1646 */ +#line 546 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2264 "awkgram.c" /* yacc.c:1646 */ +#line 2275 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 537 "awkgram.y" /* yacc.c:1646 */ +#line 548 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2270 "awkgram.c" /* yacc.c:1646 */ +#line 2281 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 539 "awkgram.y" /* yacc.c:1646 */ +#line 550 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2281 "awkgram.c" /* yacc.c:1646 */ +#line 2292 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 546 "awkgram.y" /* yacc.c:1646 */ +#line 557 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2371,11 +2382,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2375 "awkgram.c" /* yacc.c:1646 */ +#line 2386 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 636 "awkgram.y" /* yacc.c:1646 */ +#line 647 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2417,11 +2428,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2421 "awkgram.c" /* yacc.c:1646 */ +#line 2432 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 678 "awkgram.y" /* yacc.c:1646 */ +#line 689 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2463,11 +2474,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2467 "awkgram.c" /* yacc.c:1646 */ +#line 2478 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 720 "awkgram.y" /* yacc.c:1646 */ +#line 731 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2580,44 +2591,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2584 "awkgram.c" /* yacc.c:1646 */ +#line 2595 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 833 "awkgram.y" /* yacc.c:1646 */ +#line 844 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2595 "awkgram.c" /* yacc.c:1646 */ +#line 2606 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 840 "awkgram.y" /* yacc.c:1646 */ +#line 851 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2606 "awkgram.c" /* yacc.c:1646 */ +#line 2617 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 847 "awkgram.y" /* yacc.c:1646 */ +#line 858 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2617 "awkgram.c" /* yacc.c:1646 */ +#line 2628 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 857 "awkgram.y" /* yacc.c:1646 */ +#line 868 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2626,11 +2637,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2630 "awkgram.c" /* yacc.c:1646 */ +#line 2641 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 866 "awkgram.y" /* yacc.c:1646 */ +#line 877 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2639,11 +2650,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2643 "awkgram.c" /* yacc.c:1646 */ +#line 2654 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 875 "awkgram.y" /* yacc.c:1646 */ +#line 886 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2652,11 +2663,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2656 "awkgram.c" /* yacc.c:1646 */ +#line 2667 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 884 "awkgram.y" /* yacc.c:1646 */ +#line 895 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2667,11 +2678,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2671 "awkgram.c" /* yacc.c:1646 */ +#line 2682 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 895 "awkgram.y" /* yacc.c:1646 */ +#line 906 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2686,20 +2697,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2690 "awkgram.c" /* yacc.c:1646 */ +#line 2701 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 910 "awkgram.y" /* yacc.c:1646 */ +#line 921 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2699 "awkgram.c" /* yacc.c:1646 */ +#line 2710 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 913 "awkgram.y" /* yacc.c:1646 */ +#line 924 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2720,17 +2731,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2724 "awkgram.c" /* yacc.c:1646 */ +#line 2735 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 945 "awkgram.y" /* yacc.c:1646 */ +#line 956 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2730 "awkgram.c" /* yacc.c:1646 */ +#line 2741 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 946 "awkgram.y" /* yacc.c:1646 */ +#line 957 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2827,17 +2838,17 @@ regular_print: } } } -#line 2831 "awkgram.c" /* yacc.c:1646 */ +#line 2842 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 1043 "awkgram.y" /* yacc.c:1646 */ +#line 1054 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2837 "awkgram.c" /* yacc.c:1646 */ +#line 2848 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 1044 "awkgram.y" /* yacc.c:1646 */ +#line 1055 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2870,11 +2881,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2874 "awkgram.c" /* yacc.c:1646 */ +#line 2885 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1081 "awkgram.y" /* yacc.c:1646 */ +#line 1092 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2900,52 +2911,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2904 "awkgram.c" /* yacc.c:1646 */ +#line 2915 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1107 "awkgram.y" /* yacc.c:1646 */ +#line 1118 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2910 "awkgram.c" /* yacc.c:1646 */ +#line 2921 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1112 "awkgram.y" /* yacc.c:1646 */ +#line 1123 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2916 "awkgram.c" /* yacc.c:1646 */ +#line 2927 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1114 "awkgram.y" /* yacc.c:1646 */ +#line 1125 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2922 "awkgram.c" /* yacc.c:1646 */ +#line 2933 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1119 "awkgram.y" /* yacc.c:1646 */ +#line 1130 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2928 "awkgram.c" /* yacc.c:1646 */ +#line 2939 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1121 "awkgram.y" /* yacc.c:1646 */ +#line 1132 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2939 "awkgram.c" /* yacc.c:1646 */ +#line 2950 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1128 "awkgram.y" /* yacc.c:1646 */ +#line 1139 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2945 "awkgram.c" /* yacc.c:1646 */ +#line 2956 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1133 "awkgram.y" /* yacc.c:1646 */ +#line 1144 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2957,11 +2968,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2961 "awkgram.c" /* yacc.c:1646 */ +#line 2972 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1145 "awkgram.y" /* yacc.c:1646 */ +#line 1156 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2972,17 +2983,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2976 "awkgram.c" /* yacc.c:1646 */ +#line 2987 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1159 "awkgram.y" /* yacc.c:1646 */ +#line 1170 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2982 "awkgram.c" /* yacc.c:1646 */ +#line 2993 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1161 "awkgram.y" /* yacc.c:1646 */ +#line 1172 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2990,71 +3001,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2994 "awkgram.c" /* yacc.c:1646 */ +#line 3005 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1169 "awkgram.y" /* yacc.c:1646 */ +#line 1180 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3003 "awkgram.c" /* yacc.c:1646 */ +#line 3014 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1174 "awkgram.y" /* yacc.c:1646 */ +#line 1185 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3009 "awkgram.c" /* yacc.c:1646 */ +#line 3020 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1176 "awkgram.y" /* yacc.c:1646 */ +#line 1187 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 3018 "awkgram.c" /* yacc.c:1646 */ +#line 3029 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1184 "awkgram.y" /* yacc.c:1646 */ +#line 1195 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3024 "awkgram.c" /* yacc.c:1646 */ +#line 3035 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1186 "awkgram.y" /* yacc.c:1646 */ +#line 1197 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3030 "awkgram.c" /* yacc.c:1646 */ +#line 3041 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1196 "awkgram.y" /* yacc.c:1646 */ +#line 1207 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3038 "awkgram.c" /* yacc.c:1646 */ +#line 3049 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1203 "awkgram.y" /* yacc.c:1646 */ +#line 1214 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 3048 "awkgram.c" /* yacc.c:1646 */ +#line 3059 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1208 "awkgram.y" /* yacc.c:1646 */ +#line 1219 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3054 "awkgram.c" /* yacc.c:1646 */ +#line 3065 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1209 "awkgram.y" /* yacc.c:1646 */ +#line 1220 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -3062,136 +3073,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3066 "awkgram.c" /* yacc.c:1646 */ +#line 3077 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1220 "awkgram.y" /* yacc.c:1646 */ +#line 1231 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3074 "awkgram.c" /* yacc.c:1646 */ +#line 3085 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1225 "awkgram.y" /* yacc.c:1646 */ +#line 1236 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3082 "awkgram.c" /* yacc.c:1646 */ +#line 3093 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1242 "awkgram.y" /* yacc.c:1646 */ +#line 1253 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3088 "awkgram.c" /* yacc.c:1646 */ +#line 3099 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1244 "awkgram.y" /* yacc.c:1646 */ +#line 1255 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3097 "awkgram.c" /* yacc.c:1646 */ +#line 3108 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1252 "awkgram.y" /* yacc.c:1646 */ +#line 1263 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3103 "awkgram.c" /* yacc.c:1646 */ +#line 3114 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1254 "awkgram.y" /* yacc.c:1646 */ +#line 1265 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3109 "awkgram.c" /* yacc.c:1646 */ +#line 3120 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1259 "awkgram.y" /* yacc.c:1646 */ +#line 1270 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3118 "awkgram.c" /* yacc.c:1646 */ +#line 3129 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1264 "awkgram.y" /* yacc.c:1646 */ +#line 1275 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3128 "awkgram.c" /* yacc.c:1646 */ +#line 3139 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1270 "awkgram.y" /* yacc.c:1646 */ +#line 1281 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3134 "awkgram.c" /* yacc.c:1646 */ +#line 3145 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1272 "awkgram.y" /* yacc.c:1646 */ +#line 1283 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3140 "awkgram.c" /* yacc.c:1646 */ +#line 3151 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1274 "awkgram.y" /* yacc.c:1646 */ +#line 1285 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3146 "awkgram.c" /* yacc.c:1646 */ +#line 3157 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1280 "awkgram.y" /* yacc.c:1646 */ +#line 1291 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3152 "awkgram.c" /* yacc.c:1646 */ +#line 3163 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1282 "awkgram.y" /* yacc.c:1646 */ +#line 1293 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3158 "awkgram.c" /* yacc.c:1646 */ +#line 3169 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1287 "awkgram.y" /* yacc.c:1646 */ +#line 1298 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3164 "awkgram.c" /* yacc.c:1646 */ +#line 3175 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1289 "awkgram.y" /* yacc.c:1646 */ +#line 1300 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3170 "awkgram.c" /* yacc.c:1646 */ +#line 3181 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1294 "awkgram.y" /* yacc.c:1646 */ +#line 1305 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3176 "awkgram.c" /* yacc.c:1646 */ +#line 3187 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1296 "awkgram.y" /* yacc.c:1646 */ +#line 1307 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3185 "awkgram.c" /* yacc.c:1646 */ +#line 3196 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1301 "awkgram.y" /* yacc.c:1646 */ +#line 1312 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3191 "awkgram.c" /* yacc.c:1646 */ +#line 3202 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1303 "awkgram.y" /* yacc.c:1646 */ +#line 1314 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3199,52 +3210,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3203 "awkgram.c" /* yacc.c:1646 */ +#line 3214 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1311 "awkgram.y" /* yacc.c:1646 */ +#line 1322 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3212 "awkgram.c" /* yacc.c:1646 */ +#line 3223 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1316 "awkgram.y" /* yacc.c:1646 */ +#line 1327 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3221 "awkgram.c" /* yacc.c:1646 */ +#line 3232 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1325 "awkgram.y" /* yacc.c:1646 */ +#line 1336 "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 3232 "awkgram.c" /* yacc.c:1646 */ +#line 3243 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1332 "awkgram.y" /* yacc.c:1646 */ +#line 1343 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3238 "awkgram.c" /* yacc.c:1646 */ +#line 3249 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1334 "awkgram.y" /* yacc.c:1646 */ +#line 1345 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3244 "awkgram.c" /* yacc.c:1646 */ +#line 3255 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1336 "awkgram.y" /* yacc.c:1646 */ +#line 1347 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3260,11 +3271,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3264 "awkgram.c" /* yacc.c:1646 */ +#line 3275 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1352 "awkgram.y" /* yacc.c:1646 */ +#line 1363 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3274,91 +3285,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3278 "awkgram.c" /* yacc.c:1646 */ +#line 3289 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1362 "awkgram.y" /* yacc.c:1646 */ +#line 1373 "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 3289 "awkgram.c" /* yacc.c:1646 */ +#line 3300 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1369 "awkgram.y" /* yacc.c:1646 */ +#line 1380 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3295 "awkgram.c" /* yacc.c:1646 */ +#line 3306 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1371 "awkgram.y" /* yacc.c:1646 */ +#line 1382 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3301 "awkgram.c" /* yacc.c:1646 */ +#line 3312 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1376 "awkgram.y" /* yacc.c:1646 */ +#line 1387 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3307 "awkgram.c" /* yacc.c:1646 */ +#line 3318 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1378 "awkgram.y" /* yacc.c:1646 */ +#line 1389 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3313 "awkgram.c" /* yacc.c:1646 */ +#line 3324 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1380 "awkgram.y" /* yacc.c:1646 */ +#line 1391 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3322 "awkgram.c" /* yacc.c:1646 */ +#line 3333 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1388 "awkgram.y" /* yacc.c:1646 */ +#line 1399 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3328 "awkgram.c" /* yacc.c:1646 */ +#line 3339 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1390 "awkgram.y" /* yacc.c:1646 */ +#line 1401 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3334 "awkgram.c" /* yacc.c:1646 */ +#line 3345 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1395 "awkgram.y" /* yacc.c:1646 */ +#line 1406 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3340 "awkgram.c" /* yacc.c:1646 */ +#line 3351 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1397 "awkgram.y" /* yacc.c:1646 */ +#line 1408 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3346 "awkgram.c" /* yacc.c:1646 */ +#line 3357 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1402 "awkgram.y" /* yacc.c:1646 */ +#line 1413 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3352 "awkgram.c" /* yacc.c:1646 */ +#line 3363 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1404 "awkgram.y" /* yacc.c:1646 */ +#line 1415 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3358 "awkgram.c" /* yacc.c:1646 */ +#line 3369 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1406 "awkgram.y" /* yacc.c:1646 */ +#line 1417 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3405,47 +3416,47 @@ regular_print: max_args = count; } } -#line 3409 "awkgram.c" /* yacc.c:1646 */ +#line 3420 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1458 "awkgram.y" /* yacc.c:1646 */ +#line 1469 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3415 "awkgram.c" /* yacc.c:1646 */ +#line 3426 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1460 "awkgram.y" /* yacc.c:1646 */ +#line 1471 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3421 "awkgram.c" /* yacc.c:1646 */ +#line 3432 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1462 "awkgram.y" /* yacc.c:1646 */ +#line 1473 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3427 "awkgram.c" /* yacc.c:1646 */ +#line 3438 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1464 "awkgram.y" /* yacc.c:1646 */ +#line 1475 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3433 "awkgram.c" /* yacc.c:1646 */ +#line 3444 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1466 "awkgram.y" /* yacc.c:1646 */ +#line 1477 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3439 "awkgram.c" /* yacc.c:1646 */ +#line 3450 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1468 "awkgram.y" /* yacc.c:1646 */ +#line 1479 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3445 "awkgram.c" /* yacc.c:1646 */ +#line 3456 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1470 "awkgram.y" /* yacc.c:1646 */ +#line 1481 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3459,29 +3470,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3463 "awkgram.c" /* yacc.c:1646 */ +#line 3474 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1484 "awkgram.y" /* yacc.c:1646 */ +#line 1495 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3472 "awkgram.c" /* yacc.c:1646 */ +#line 3483 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1489 "awkgram.y" /* yacc.c:1646 */ +#line 1500 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3481 "awkgram.c" /* yacc.c:1646 */ +#line 3492 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1494 "awkgram.y" /* yacc.c:1646 */ +#line 1505 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3501,64 +3512,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3505 "awkgram.c" /* yacc.c:1646 */ +#line 3516 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1519 "awkgram.y" /* yacc.c:1646 */ +#line 1530 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3514 "awkgram.c" /* yacc.c:1646 */ +#line 3525 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1525 "awkgram.y" /* yacc.c:1646 */ +#line 1536 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3520 "awkgram.c" /* yacc.c:1646 */ +#line 3531 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1527 "awkgram.y" /* yacc.c:1646 */ +#line 1538 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3526 "awkgram.c" /* yacc.c:1646 */ +#line 3537 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1529 "awkgram.y" /* yacc.c:1646 */ +#line 1540 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3532 "awkgram.c" /* yacc.c:1646 */ +#line 3543 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1531 "awkgram.y" /* yacc.c:1646 */ +#line 1542 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3538 "awkgram.c" /* yacc.c:1646 */ +#line 3549 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1533 "awkgram.y" /* yacc.c:1646 */ +#line 1544 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3544 "awkgram.c" /* yacc.c:1646 */ +#line 3555 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1535 "awkgram.y" /* yacc.c:1646 */ +#line 1546 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3550 "awkgram.c" /* yacc.c:1646 */ +#line 3561 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1540 "awkgram.y" /* yacc.c:1646 */ +#line 1551 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3558 "awkgram.c" /* yacc.c:1646 */ +#line 3569 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1544 "awkgram.y" /* yacc.c:1646 */ +#line 1555 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3590,37 +3601,37 @@ regular_print: } } } -#line 3594 "awkgram.c" /* yacc.c:1646 */ +#line 3605 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1576 "awkgram.y" /* yacc.c:1646 */ +#line 1587 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3600 "awkgram.c" /* yacc.c:1646 */ +#line 3611 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1578 "awkgram.y" /* yacc.c:1646 */ +#line 1589 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3610 "awkgram.c" /* yacc.c:1646 */ +#line 3621 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1584 "awkgram.y" /* yacc.c:1646 */ +#line 1595 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3620 "awkgram.c" /* yacc.c:1646 */ +#line 3631 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1590 "awkgram.y" /* yacc.c:1646 */ +#line 1601 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3633,45 +3644,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3637 "awkgram.c" /* yacc.c:1646 */ +#line 3648 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1605 "awkgram.y" /* yacc.c:1646 */ +#line 1616 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3646 "awkgram.c" /* yacc.c:1646 */ +#line 3657 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1610 "awkgram.y" /* yacc.c:1646 */ +#line 1621 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3655 "awkgram.c" /* yacc.c:1646 */ +#line 3666 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1615 "awkgram.y" /* yacc.c:1646 */ +#line 1626 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3663 "awkgram.c" /* yacc.c:1646 */ +#line 3674 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1619 "awkgram.y" /* yacc.c:1646 */ +#line 1630 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3671 "awkgram.c" /* yacc.c:1646 */ +#line 3682 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1623 "awkgram.y" /* yacc.c:1646 */ +#line 1634 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3686,11 +3697,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3690 "awkgram.c" /* yacc.c:1646 */ +#line 3701 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1638 "awkgram.y" /* yacc.c:1646 */ +#line 1649 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3700,20 +3711,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3704 "awkgram.c" /* yacc.c:1646 */ +#line 3715 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1651 "awkgram.y" /* yacc.c:1646 */ +#line 1662 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3713 "awkgram.c" /* yacc.c:1646 */ +#line 3724 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1656 "awkgram.y" /* yacc.c:1646 */ +#line 1667 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3746,11 +3757,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3750 "awkgram.c" /* yacc.c:1646 */ +#line 3761 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1692 "awkgram.y" /* yacc.c:1646 */ +#line 1703 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3764,49 +3775,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3768 "awkgram.c" /* yacc.c:1646 */ +#line 3779 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1709 "awkgram.y" /* yacc.c:1646 */ +#line 1720 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3774 "awkgram.c" /* yacc.c:1646 */ +#line 3785 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1711 "awkgram.y" /* yacc.c:1646 */ +#line 1722 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3780 "awkgram.c" /* yacc.c:1646 */ +#line 3791 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1716 "awkgram.y" /* yacc.c:1646 */ +#line 1727 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3786 "awkgram.c" /* yacc.c:1646 */ +#line 3797 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1718 "awkgram.y" /* yacc.c:1646 */ +#line 1729 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3792 "awkgram.c" /* yacc.c:1646 */ +#line 3803 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1723 "awkgram.y" /* yacc.c:1646 */ +#line 1734 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3798 "awkgram.c" /* yacc.c:1646 */ +#line 3809 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1725 "awkgram.y" /* yacc.c:1646 */ +#line 1736 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3806 "awkgram.c" /* yacc.c:1646 */ +#line 3817 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1732 "awkgram.y" /* yacc.c:1646 */ +#line 1743 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3820,11 +3831,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3824 "awkgram.c" /* yacc.c:1646 */ +#line 3835 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1749 "awkgram.y" /* yacc.c:1646 */ +#line 1760 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3838,31 +3849,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3842 "awkgram.c" /* yacc.c:1646 */ +#line 3853 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1766 "awkgram.y" /* yacc.c:1646 */ +#line 1777 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3848 "awkgram.c" /* yacc.c:1646 */ +#line 3859 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1768 "awkgram.y" /* yacc.c:1646 */ +#line 1779 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3856 "awkgram.c" /* yacc.c:1646 */ +#line 3867 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1775 "awkgram.y" /* yacc.c:1646 */ +#line 1786 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3862 "awkgram.c" /* yacc.c:1646 */ +#line 3873 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1780 "awkgram.y" /* yacc.c:1646 */ +#line 1791 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3870,22 +3881,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3874 "awkgram.c" /* yacc.c:1646 */ +#line 3885 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1788 "awkgram.y" /* yacc.c:1646 */ +#line 1799 "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 3885 "awkgram.c" /* yacc.c:1646 */ +#line 3896 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1798 "awkgram.y" /* yacc.c:1646 */ +#line 1809 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3897,73 +3908,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3901 "awkgram.c" /* yacc.c:1646 */ +#line 3912 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1810 "awkgram.y" /* yacc.c:1646 */ +#line 1821 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3911 "awkgram.c" /* yacc.c:1646 */ +#line 3922 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1819 "awkgram.y" /* yacc.c:1646 */ +#line 1830 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3919 "awkgram.c" /* yacc.c:1646 */ +#line 3930 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1823 "awkgram.y" /* yacc.c:1646 */ +#line 1834 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3927 "awkgram.c" /* yacc.c:1646 */ +#line 3938 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1826 "awkgram.y" /* yacc.c:1646 */ +#line 1837 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3933 "awkgram.c" /* yacc.c:1646 */ +#line 3944 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1834 "awkgram.y" /* yacc.c:1646 */ +#line 1845 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3939 "awkgram.c" /* yacc.c:1646 */ +#line 3950 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1838 "awkgram.y" /* yacc.c:1646 */ +#line 1849 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3945 "awkgram.c" /* yacc.c:1646 */ +#line 3956 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1847 "awkgram.y" /* yacc.c:1646 */ +#line 1858 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3951 "awkgram.c" /* yacc.c:1646 */ +#line 3962 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1851 "awkgram.y" /* yacc.c:1646 */ +#line 1862 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3957 "awkgram.c" /* yacc.c:1646 */ +#line 3968 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1855 "awkgram.y" /* yacc.c:1646 */ +#line 1866 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3963 "awkgram.c" /* yacc.c:1646 */ +#line 3974 "awkgram.c" /* yacc.c:1646 */ break; -#line 3967 "awkgram.c" /* yacc.c:1646 */ +#line 3978 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4191,7 +4202,7 @@ yyreturn: #endif return yyresult; } -#line 1857 "awkgram.y" /* yacc.c:1906 */ +#line 1868 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -4620,11 +4631,9 @@ mk_program() cp = end_block; else cp = list_merge(begin_block, end_block); - /* - * We don't need to clear the comment variables - * since they're not used anymore after this - * function is called. - */ + if (program_comment != NULL) { + (void) list_prepend(cp, program_comment); + } if (comment != NULL) (void) list_append(cp, comment); (void) list_append(cp, ip_atexit); @@ -4672,6 +4681,10 @@ out: /* delete the Op_list, not needed */ tmp = cp->nexti; bcfree(cp); + /* these variables are not used again but zap them anyway. */ + comment = NULL; + function_comment = NULL; + program_comment = NULL; return tmp; #undef begin_block @@ -5314,11 +5327,29 @@ pushback(void) (! lexeof && lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr); } +/* check_comment --- check for block comment */ + +void +check_comment(void) +{ + if (comment != NULL) { + if (first_rule) { + program_comment = comment; + } else + block_comment = comment; + comment = NULL; + } + first_rule = false; +} -/* get_comment --- collect comment text */ +/* + * get_comment --- collect comment text. + * Flag = EOL_COMMENT for end-of-line comments. + * Flag = FULL_COMMENT for self-contained comments. + */ int -get_comment(void) +get_comment(int flag) { int c; int sl; @@ -5330,6 +5361,12 @@ get_comment(void) while ((c = nextc(false)) != '\n' && c != END_FILE) { tokadd(c); } + if (flag == EOL_COMMENT) { + /* comment at end of line. */ + if (c == '\n') + tokadd(c); + break; + } if (c == '\n') { tokadd(c); sourceline++; @@ -5344,6 +5381,7 @@ get_comment(void) break; else if (c != '#') { pushback(); + sourceline--; break; } else tokadd(c); @@ -5353,6 +5391,7 @@ get_comment(void) comment = bcalloc(Op_comment, 1, sl); comment->source_file = source; comment->memory = make_str_node(tokstart, tok - tokstart, 0); + comment->memory->comment_type = flag; return c; } @@ -5404,7 +5443,7 @@ allow_newline(void) if (c == '#') { if (do_pretty_print && ! do_profile) { /* collect comment byte code iff doing pretty print but not profiling. */ - c = get_comment(); + c = get_comment(EOL_COMMENT); } else { while ((c = nextc(false)) != '\n' && c != END_FILE) continue; @@ -5616,7 +5655,10 @@ retry: * Collect comment byte code iff doing pretty print * but not profiling. */ - c = get_comment(); + if (lasttok == NEWLINE || lasttok == 0) + c = get_comment(FULL_COMMENT); + else + c = get_comment(EOL_COMMENT); if (c == END_FILE) return lasttok = NEWLINE_EOF; @@ -5653,7 +5695,7 @@ retry: _("use of `\\ #...' line continuation is not portable")); } if (do_pretty_print && ! do_profile) - c = get_comment(); + c = get_comment(EOL_COMMENT); else { while ((c = nextc(false)) != '\n') if (c == END_FILE) @@ -7508,7 +7550,11 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action) (rp + 1)->lasti = action->lasti; (rp + 2)->first_line = pattern->source_line; (rp + 2)->last_line = lastline; - ip = list_prepend(action, rp); + if (block_comment != NULL) { + ip = list_prepend(list_prepend(action, block_comment), rp); + block_comment = NULL; + } else + ip = list_prepend(action, rp); } else { rp = bcalloc(Op_rule, 3, 0); diff --git a/awkgram.y b/awkgram.y index 85825cb9..6721bcdc 100644 --- a/awkgram.y +++ b/awkgram.y @@ -88,6 +88,7 @@ static void check_funcs(void); static ssize_t read_one_line(int fd, void *buffer, size_t count); static int one_line_close(int fd); static void split_comment(void); +static void check_comment(void); static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ @@ -150,8 +151,10 @@ static INSTRUCTION *ip_beginfile; static INSTRUCTION *comment = NULL; static INSTRUCTION *program_comment = NULL; static INSTRUCTION *function_comment = NULL; +static INSTRUCTION *block_comment = NULL; static bool func_first = true; +static bool first_rule = true; static inline INSTRUCTION *list_create(INSTRUCTION *x); static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x); @@ -334,7 +337,11 @@ pattern ($1->nexti + 1)->condpair_left = $1->lasti; ($1->nexti + 1)->condpair_right = $4->lasti; } - $$ = list_append(list_merge($1, $4), tp); + if (comment != NULL) { + $$ = list_append(list_merge(list_prepend($1, comment), $4), tp); + comment = NULL; + } else + $$ = list_append(list_merge($1, $4), tp); rule = Rule; } | LEX_BEGIN @@ -348,6 +355,7 @@ pattern $1->in_rule = rule = BEGIN; $1->source_file = source; + check_comment(); $$ = $1; } | LEX_END @@ -361,6 +369,7 @@ pattern $1->in_rule = rule = END; $1->source_file = source; + check_comment(); $$ = $1; } | LEX_BEGINFILE @@ -368,6 +377,7 @@ pattern func_first = false; $1->in_rule = rule = BEGINFILE; $1->source_file = source; + check_comment(); $$ = $1; } | LEX_ENDFILE @@ -375,6 +385,7 @@ pattern func_first = false; $1->in_rule = rule = ENDFILE; $1->source_file = source; + check_comment(); $$ = $1; } ; @@ -2282,11 +2293,9 @@ mk_program() cp = end_block; else cp = list_merge(begin_block, end_block); - /* - * We don't need to clear the comment variables - * since they're not used anymore after this - * function is called. - */ + if (program_comment != NULL) { + (void) list_prepend(cp, program_comment); + } if (comment != NULL) (void) list_append(cp, comment); (void) list_append(cp, ip_atexit); @@ -2334,6 +2343,10 @@ out: /* delete the Op_list, not needed */ tmp = cp->nexti; bcfree(cp); + /* these variables are not used again but zap them anyway. */ + comment = NULL; + function_comment = NULL; + program_comment = NULL; return tmp; #undef begin_block @@ -2976,11 +2989,29 @@ pushback(void) (! lexeof && lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr); } +/* check_comment --- check for block comment */ + +void +check_comment(void) +{ + if (comment != NULL) { + if (first_rule) { + program_comment = comment; + } else + block_comment = comment; + comment = NULL; + } + first_rule = false; +} -/* get_comment --- collect comment text */ +/* + * get_comment --- collect comment text. + * Flag = EOL_COMMENT for end-of-line comments. + * Flag = FULL_COMMENT for self-contained comments. + */ int -get_comment(void) +get_comment(int flag) { int c; int sl; @@ -2992,6 +3023,12 @@ get_comment(void) while ((c = nextc(false)) != '\n' && c != END_FILE) { tokadd(c); } + if (flag == EOL_COMMENT) { + /* comment at end of line. */ + if (c == '\n') + tokadd(c); + break; + } if (c == '\n') { tokadd(c); sourceline++; @@ -3006,6 +3043,7 @@ get_comment(void) break; else if (c != '#') { pushback(); + sourceline--; break; } else tokadd(c); @@ -3015,6 +3053,7 @@ get_comment(void) comment = bcalloc(Op_comment, 1, sl); comment->source_file = source; comment->memory = make_str_node(tokstart, tok - tokstart, 0); + comment->memory->comment_type = flag; return c; } @@ -3066,7 +3105,7 @@ allow_newline(void) if (c == '#') { if (do_pretty_print && ! do_profile) { /* collect comment byte code iff doing pretty print but not profiling. */ - c = get_comment(); + c = get_comment(EOL_COMMENT); } else { while ((c = nextc(false)) != '\n' && c != END_FILE) continue; @@ -3278,7 +3317,10 @@ retry: * Collect comment byte code iff doing pretty print * but not profiling. */ - c = get_comment(); + if (lasttok == NEWLINE || lasttok == 0) + c = get_comment(FULL_COMMENT); + else + c = get_comment(EOL_COMMENT); if (c == END_FILE) return lasttok = NEWLINE_EOF; @@ -3315,7 +3357,7 @@ retry: _("use of `\\ #...' line continuation is not portable")); } if (do_pretty_print && ! do_profile) - c = get_comment(); + c = get_comment(EOL_COMMENT); else { while ((c = nextc(false)) != '\n') if (c == END_FILE) @@ -5170,7 +5212,11 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action) (rp + 1)->lasti = action->lasti; (rp + 2)->first_line = pattern->source_line; (rp + 2)->last_line = lastline; - ip = list_prepend(action, rp); + if (block_comment != NULL) { + ip = list_prepend(list_prepend(action, block_comment), rp); + block_comment = NULL; + } else + ip = list_prepend(action, rp); } else { rp = bcalloc(Op_rule, 3, 0); diff --git a/profile.c b/profile.c index 59542ab9..ad879a3c 100644 --- a/profile.c +++ b/profile.c @@ -26,6 +26,7 @@ #include "awk.h" static void pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header); +static void end_line(INSTRUCTION *ip); static void pp_parenthesize(NODE *n); static void parenthesize(int type, NODE *left, NODE *right); static char *pp_list(int nargs, const char *paren, const char *delim); @@ -176,70 +177,80 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header) NODE *t1; char *str; NODE *t2; - INSTRUCTION *ip; + INSTRUCTION *ip1; + INSTRUCTION *ip2; NODE *m; char *tmp; int rule; - long lind; static int rule_count[MAXRULE]; for (pc = startp; pc != endp; pc = pc->nexti) { if (pc->source_line > 0) sourceline = pc->source_line; + /* skip leading EOL comment as it has already been printed */ + if (pc->opcode == Op_comment + && pc->memory->comment_type == EOL_COMMENT) + continue; switch (pc->opcode) { case Op_rule: + /* + * Rules are three instructions long. + * See append_rule in awkgram.y. + * The first has the Rule Op Code, nexti etc. + * The second, (pc + 1) has firsti and lasti: + * the first/last ACTION instructions for this rule. + * The third has first_line and last_line: + * the first and last source line numbers. + */ source = pc->source_file; rule = pc->in_rule; if (rule != Rule) { - ip = (pc + 1)->firsti; - - /* print pre-begin/end comments */ - if (ip->opcode == Op_comment) { - print_comment(ip, 0); - ip = ip->nexti; - } + /* Allow for pre-non-rule-block comment */ + if (pc->nexti != (pc +1)->firsti + && pc->nexti->opcode == Op_comment + && pc->nexti->memory->comment_type == FULL_COMMENT) + print_comment(pc->nexti, -1); + ip1 = (pc + 1)->firsti; + ip2 = (pc + 1)->lasti; if (do_profile) { if (! rule_count[rule]++) fprintf(prof_fp, _("\t# %s rule(s)\n\n"), ruletab[rule]); indent(0); } - fprintf(prof_fp, "%s {\n", ruletab[rule]); + fprintf(prof_fp, "%s {", ruletab[rule]); + end_line(pc); } else { if (do_profile && ! rule_count[rule]++) fprintf(prof_fp, _("\t# Rule(s)\n\n")); - ip = pc->nexti; - lind = ip->exec_count; - /* print pre-block comments */ - if (ip->opcode == Op_exec_count && ip->nexti->opcode == Op_comment) - ip = ip->nexti; - if (ip->opcode == Op_comment) { - print_comment(ip, lind); - if (ip->nexti->nexti == (pc + 1)->firsti) - ip = ip->nexti->nexti; - } - if (ip != (pc + 1)->firsti) { /* non-empty pattern */ - indent(lind); - pprint(ip->nexti, (pc + 1)->firsti, false); - t1 = pp_pop(); - fprintf(prof_fp, "%s {", t1->pp_str); - pp_free(t1); - ip = (pc + 1)->firsti; - - if (do_profile && ip->exec_count > 0) - fprintf(prof_fp, " # %ld", ip->exec_count); - - fprintf(prof_fp, "\n"); + ip1 = pc->nexti; + if (ip1 != (pc + 1)->firsti) { /* non-empty pattern */ + pprint(ip1->nexti, (pc + 1)->firsti, false); + /* Allow for case where the "pattern" is just a comment */ + if (ip1->nexti->nexti->nexti != (pc +1)->firsti + || ip1->nexti->opcode != Op_comment) { + t1 = pp_pop(); + fprintf(prof_fp, "%s {", t1->pp_str); + pp_free(t1); + } else + fprintf(prof_fp, "{"); + ip1 = (pc + 1)->firsti; + ip2 = (pc + 1)->lasti; + + if (do_profile && ip1->exec_count > 0) + fprintf(prof_fp, " # %ld", ip1->exec_count); + + end_line(ip1); } else { fprintf(prof_fp, "{\n"); - ip = (pc + 1)->firsti; + ip1 = (pc + 1)->firsti; } - ip = ip->nexti; + ip1 = ip1->nexti; } indent_in(); - pprint(ip, (pc + 1)->lasti, false); + pprint(ip1, ip2, false); indent_out(); if (do_profile) indent(0); @@ -328,7 +339,7 @@ cleanup: pp_free(t2); pp_free(t1); if (! in_for_header) - fprintf(prof_fp, "\n"); + end_line(pc); break; default: @@ -454,7 +465,7 @@ cleanup: pp_free(t2); pp_free(t1); if (! in_for_header) - fprintf(prof_fp, "\n"); + end_line(pc); break; case Op_concat: @@ -475,7 +486,7 @@ cleanup: } else fprintf(prof_fp, "%s %s", op2str(Op_K_delete), array); if (! in_for_header) - fprintf(prof_fp, "\n"); + end_line(pc); pp_free(t1); } break; @@ -587,7 +598,7 @@ cleanup: fprintf(prof_fp, "%s%s", op2str(pc->opcode), tmp); efree(tmp); if (! in_for_header) - fprintf(prof_fp, "\n"); + end_line(pc); break; case Op_push_re: @@ -705,33 +716,33 @@ cleanup: t1 = pp_pop(); fprintf(prof_fp, "%s", t1->pp_str); if (! in_for_header) - fprintf(prof_fp, "\n"); + end_line(pc); pp_free(t1); break; case Op_line_range: - ip = pc + 1; - pprint(pc->nexti, ip->condpair_left, false); - pprint(ip->condpair_left->nexti, ip->condpair_right, false); + ip1 = pc + 1; + pprint(pc->nexti, ip1->condpair_left, false); + pprint(ip1->condpair_left->nexti, ip1->condpair_right, false); t2 = pp_pop(); t1 = pp_pop(); str = pp_group3(t1->pp_str, ", ", t2->pp_str); pp_free(t1); pp_free(t2); pp_push(Op_line_range, str, CAN_FREE); - pc = ip->condpair_right; + pc = ip1->condpair_right; break; case Op_K_while: - ip = pc + 1; - indent(ip->while_body->exec_count); + ip1 = pc + 1; + indent(ip1->while_body->exec_count); fprintf(prof_fp, "%s (", op2str(pc->opcode)); - pprint(pc->nexti, ip->while_body, false); + pprint(pc->nexti, ip1->while_body, false); t1 = pp_pop(); fprintf(prof_fp, "%s) {\n", t1->pp_str); pp_free(t1); indent_in(); - pprint(ip->while_body->nexti, pc->target_break, false); + pprint(ip1->while_body->nexti, pc->target_break, false); indent_out(); indent(SPACEOVER); fprintf(prof_fp, "}\n"); @@ -739,13 +750,13 @@ cleanup: break; case Op_K_do: - ip = pc + 1; + ip1 = pc + 1; indent(pc->nexti->exec_count); fprintf(prof_fp, "%s {\n", op2str(pc->opcode)); indent_in(); - pprint(pc->nexti->nexti, ip->doloop_cond, false); + pprint(pc->nexti->nexti, ip1->doloop_cond, false); indent_out(); - pprint(ip->doloop_cond, pc->target_break, false); + pprint(ip1->doloop_cond, pc->target_break, false); indent(SPACEOVER); t1 = pp_pop(); fprintf(prof_fp, "} %s (%s)\n", op2str(Op_K_while), t1->pp_str); @@ -754,24 +765,24 @@ cleanup: break; case Op_K_for: - ip = pc + 1; - indent(ip->forloop_body->exec_count); + ip1 = pc + 1; + indent(ip1->forloop_body->exec_count); fprintf(prof_fp, "%s (", op2str(pc->opcode)); /* If empty for looop header, print it a little more nicely. */ if ( pc->nexti->opcode == Op_no_op - && ip->forloop_cond == pc->nexti + && ip1->forloop_cond == pc->nexti && pc->target_continue->opcode == Op_jmp) { fprintf(prof_fp, ";;"); } else { - pprint(pc->nexti, ip->forloop_cond, true); + pprint(pc->nexti, ip1->forloop_cond, true); fprintf(prof_fp, "; "); - if (ip->forloop_cond->opcode == Op_no_op && - ip->forloop_cond->nexti == ip->forloop_body) + if (ip1->forloop_cond->opcode == Op_no_op && + ip1->forloop_cond->nexti == ip1->forloop_body) fprintf(prof_fp, "; "); else { - pprint(ip->forloop_cond, ip->forloop_body, true); + pprint(ip1->forloop_cond, ip1->forloop_body, true); t1 = pp_pop(); fprintf(prof_fp, "%s; ", t1->pp_str); pp_free(t1); @@ -781,7 +792,7 @@ cleanup: } fprintf(prof_fp, ") {\n"); indent_in(); - pprint(ip->forloop_body->nexti, pc->target_continue, false); + pprint(ip1->forloop_body->nexti, pc->target_continue, false); indent_out(); indent(SPACEOVER); fprintf(prof_fp, "}\n"); @@ -793,20 +804,20 @@ cleanup: char *array; const char *item; - ip = pc + 1; + ip1 = pc + 1; t1 = pp_pop(); array = t1->pp_str; - m = ip->forloop_cond->array_var; + m = ip1->forloop_cond->array_var; if (m->type == Node_param_list) item = func_params[m->param_cnt].param; else item = m->vname; - indent(ip->forloop_body->exec_count); + indent(ip1->forloop_body->exec_count); fprintf(prof_fp, "%s (%s%s%s) {\n", op2str(Op_K_arrayfor), item, op2str(Op_in_array), array); indent_in(); pp_free(t1); - pprint(ip->forloop_body->nexti, pc->target_break, false); + pprint(ip1->forloop_body->nexti, pc->target_break, false); indent_out(); indent(SPACEOVER); fprintf(prof_fp, "}\n"); @@ -815,13 +826,13 @@ cleanup: break; case Op_K_switch: - ip = pc + 1; + ip1 = pc + 1; fprintf(prof_fp, "%s (", op2str(pc->opcode)); - pprint(pc->nexti, ip->switch_start, false); + pprint(pc->nexti, ip1->switch_start, false); t1 = pp_pop(); fprintf(prof_fp, "%s) {\n", t1->pp_str); pp_free(t1); - pprint(ip->switch_start, ip->switch_end, false); + pprint(ip1->switch_start, ip1->switch_end, false); indent(SPACEOVER); fprintf(prof_fp, "}\n"); pc = pc->target_break; @@ -848,12 +859,12 @@ cleanup: fprintf(prof_fp, "%s) {", t1->pp_str); pp_free(t1); - ip = pc->branch_if; - if (ip->exec_count > 0) - fprintf(prof_fp, " # %ld", ip->exec_count); - fprintf(prof_fp, "\n"); + ip1 = pc->branch_if; + if (ip1->exec_count > 0) + fprintf(prof_fp, " # %ld", ip1->exec_count); + end_line(pc); indent_in(); - pprint(ip->nexti, pc->branch_else, false); + pprint(ip1->nexti, pc->branch_else, false); indent_out(); pc = pc->branch_else; if (pc->nexti->opcode == Op_no_op) { @@ -878,11 +889,11 @@ cleanup: size_t len; pprint(pc->nexti, pc->branch_if, false); - ip = pc->branch_if; - pprint(ip->nexti, pc->branch_else, false); - ip = pc->branch_else->nexti; + ip1 = pc->branch_if; + pprint(ip1->nexti, pc->branch_else, false); + ip1 = pc->branch_else->nexti; - pc = ip->nexti; + pc = ip1->nexti; assert(pc->opcode == Op_cond_exp); pprint(pc->nexti, pc->branch_end, false); @@ -923,6 +934,21 @@ cleanup: } } +/* end_line --- end pretty print line with new line or on-line comment */ + +void +end_line(INSTRUCTION *ip) +{ + if (ip->nexti->opcode == Op_comment + && ip->nexti->memory->comment_type == EOL_COMMENT) { + fprintf(prof_fp, "\t"); + print_comment(ip->nexti, -1); + ip = ip->nexti->nexti; + } + else + fprintf(prof_fp, "\n"); +} + /* pp_string_fp --- printy print a string to the fp */ /* @@ -1008,7 +1034,8 @@ print_comment(INSTRUCTION* pc, long in) count = pc->memory->stlen; text = pc->memory->stptr; - indent(in); /* is this correct? Where should comments go? */ + if (in >= 0) + indent(in); /* is this correct? Where should comments go? */ for (; count > 0; count--, text++) { if (after_newline) { indent(in); @@ -1586,7 +1613,7 @@ pp_func(INSTRUCTION *pc, void *data ATTRIBUTE_UNUSED) /* print any function comment */ if (fp->opcode == Op_comment && fp->source_line == 0) { - print_comment(fp, 0); + print_comment(fp, -1); /* -1 ==> don't indent */ fp = fp->nexti; } diff --git a/test/ChangeLog b/test/ChangeLog index de7e66d3..9b00b382 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-12-12 Arnold D. Robbins + + * profile5.ok: Updated after code changes. + 2014-11-26 Arnold D. Robbins * Gentests: Fix gensub call after adding warning. @@ -10,6 +14,7 @@ * Makefile.am (sortglos): New test. * sortglos.awk, sortglos.in, sortglos.ok: New files. + Thanks to Antonio Columbo. 2014-11-09 Arnold D. Robbins diff --git a/test/profile5.ok b/test/profile5.ok index 4c944627..5bf04dcf 100644 --- a/test/profile5.ok +++ b/test/profile5.ok @@ -2,8 +2,7 @@ BEGIN { _addlib("_BASE") } -############################################################################ - +#___________________________________________________________________________________ BEGIN { BINMODE = "rw" SUBSEP = "\000" @@ -24,8 +23,7 @@ BEGIN { _addlib("_INSTRUC") } -############################################################################# - +#___________________________________________________________________________________ BEGIN { _delay_perfmsdelay = 11500 } @@ -38,19 +36,11 @@ BEGIN { BEGIN { } -########################################################################### - - - - - - -BEGIN { +BEGIN { ########################################################################### _addlib("_EXTFN") } -############################################################################# - +#___________________________________________________________________________________ BEGIN { delete _XCHR delete _ASC @@ -78,7 +68,6 @@ BEGIN { _QSTR[_CHR[i]] = _QSTRQ[_CHR[i]] } _QSTR["\\"] = "\\\\" - #; _QSTR["\""]="\\\"" #_____________________________________________________________________________ _CHR["CR"] = "\r" @@ -117,8 +106,7 @@ BEGIN { _addlib("_SYSIO") } -############################################################################# - +#___________________________________________________________________________________ BEGIN { _SYS_STDCON = "CON" _CON_WIDTH = (match(_cmd("MODE " _SYS_STDCON " 2>NUL"), /Columns:[ \t]*([0-9]+)/, A) ? strtonum(A[1]) : 80) @@ -128,8 +116,7 @@ BEGIN { _addlib("_FILEIO") } -############################################################################# - +#___________________________________________________________________________________ BEGIN { if (_SYS_STDOUT == "") { _SYS_STDOUT = "/dev/stdout" @@ -151,7 +138,7 @@ BEGIN { _addlib("_tOBJ") } -############################################################################# +#___________________________________________________________________________________ BEGIN { _tInBy = "\212._tInBy" _tgenuid_init() @@ -183,8 +170,7 @@ BEGIN { _addlib("_ERRLOG") } -############################################################################# - +#___________________________________________________________________________________ BEGIN { if (_gawk_scriptlevel < 1) { _ERRLOG_TF = 1 @@ -206,11 +192,7 @@ BEGIN { _shortcut_init() } -######################################################### - - - -BEGIN { +BEGIN { ######################################################### _addlib("_eXTFN") } @@ -219,10 +201,7 @@ BEGIN { _extfn_init() } -############################################################ - - -BEGIN { +BEGIN { ############################################################ _addlib("_sHARE") } @@ -231,9 +210,7 @@ BEGIN { } BEGIN { - _addlib("_DS") - ############################################################################### - + _addlib("_DS") ############################################################################### _PRODUCT_NAME = "Deployment Solution Control" _PRODUCT_VERSION = "1.0" _PRODUCT_COPYRIGHT = "Copyright (C) 2013 by CosumoGEN" @@ -300,7 +277,29 @@ BEGIN { _initsys() } -############################################################################ +#_________________________________________________________________________________________ +########################################################################################## + + + + + + + +#BootDevice BuildNumber BuildType Caption CodeSet CountryCode CreationClassName CSCreationClassName CSDVersion CSName CurrentTimeZone DataExecutionPrevention_32BitApplications DataExecutionPrevention_Available DataExecutionPrevention_Drivers DataExecutionPrevention_SupportPolicy Debug Description Distributed EncryptionLevel ForegroundApplicationBoost FreePhysicalMemory FreeSpaceInPagingFiles FreeVirtualMemory InstallDate LargeSystemCache LastBootUpTime LocalDateTime Locale Manufacturer MaxNumberOfProcesses MaxProcessMemorySize MUILanguages Name NumberOfLicensedUsers NumberOfProcesses NumberOfUsers OperatingSystemSKU Organization OSArchitecture OSLanguage OSProductSuite OSType OtherTypeDescription PAEEnabled PlusProductID PlusVersionNumber Primary ProductType RegisteredUser SerialNumber ServicePackMajorVersion ServicePackMinorVersion SizeStoredInPagingFiles Status SuiteMask SystemDevice SystemDirectory SystemDrive TotalSwapSpaceSize TotalVirtualMemorySize TotalVisibleMemorySize Version WindowsDirectory +#\Device\HarddiskVolume1 7601 Multiprocessor Free Microsoft Windows Server 2008 R2 Enterprise 1252 1 Win32_OperatingSystem Win32_ComputerSystem Service Pack 1 CPU 180 TRUE TRUE TRUE 3 FALSE FALSE 256 0 6925316 33518716 41134632 20110502192745.000000+180 20130426120425.497469+180 20130510134606.932000+180 0409 Microsoft Corporation -1 8589934464 {"en-US"} Microsoft Windows Server 2008 R2 Enterprise |C:\Windows|\Device\Harddisk0\Partition2 0 116 2 10 64-bit 1033 274 18 TRUE 3 Windows User 55041-507-2389175-84833 1 0 33554432 OK 274 \Device\HarddiskVolume2 C:\Windows\system32 C: 50311020 16758448 6.1.7601 C:\Windows + + + + + + + + + + + + BEGIN { a = ENVIRON["EGAWK_CMDLINE"] @@ -321,13 +320,43 @@ BEGIN { _END() } -######################################################################## - +#_____________________________________________________________________________ END { _EXIT() } -############################################################################### +#_______________________________________________________________________ +######################################################################## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + END { if (_gawk_scriptlevel < 1) { @@ -339,8 +368,17 @@ END { } } -############################################################################### - +########################################################################################## +# PUBLIC: +#_____________________________________________________________________________ +# _rFBRO(ptr) - Return ptr of first-bro. [TESTED] +# If !ptr then returns "". +#_____________________________________________________________________________ +# _rLBRO(ptr) - Return ptr of last-bro. [TESTED] +# If !ptr then returns "". +#_____________________________________________________________________________ +# _rQBRO(ptr) - Returns brothers total quantity. [TESTED] +# If !ptr then returns "". END { if (_gawk_scriptlevel < 1) { if (! _fileio_notdeltmpflag) { @@ -350,7 +388,297 @@ END { } } -############################################################################### +#___________________________________________________________________________________ +#################################################################################### + + + + + + + + + + + + + + + + +#___________________________________________________________________________________ +# fn _dirtree(array,pathmask) +# +# Return in `array' file tree from pathmask: +# array["file.filerdne"]="size date time" +# array["subdir.filerd"]["file.filerdne"]="size date time" +# array["subdir.filerd"]["file.filerd"][...] +# +# The array will be cleared before any action. Function return pathmask w/o ltabspc and rtabspc. +#___________________________________________________________________________________ + + + + + +# OK: change internal function's names to: w\o "_" +# OK: FLENGTH: should cover r-spcs +# OK: optimize REXP +# OK: add new symbols to dir/file names ( ! and + ) +# OK: create _getfilepath() +# OK: del - conflict with WROOTDIR (do not update it) +# OK: dir/del - support for filemask ( * and ? ) +# OK: how to define code injections: header\ender; and HANDLERS +# OK: units in header\ender? conline division... +# OK: _FILEPATH problem: it will not been defined at the moment when subscript0 starts - at the start TMPRD="_tmp" +# OK: del: if del("dir\\") - then all ok except it NOT deleted "dir\\" - _del function removed(renamed to __del) +# OK: tmpdirs: it delete only autotmp dir and only from script0 +# OK: MICROTEST: global testing of filepath (UNC! CORRECT RESULTS! ) +# question about cache: did new just now generated absolute filepath cached in FILECACHE? its seems like NO +# check _untmp: CONFLICT: if file or dir from autotmp dir will be untmp then it anyway will be deleted; but file or dir from other point never be deleted anyway - so what is the point of untmp????? +#ERRLOG: _setmpath: warning!!!!! + +#___________________________________________________________________________________ +#################################################################################### +# PUBLIC: +#___________________________________________________________________________________ +# +# fn _rdfile(_filepath) +# +# Read and return data from file specified in _filepath. +# If _filepath=="" then no action occured and return "". +# Function read and return data from file. No any changes in data occured. +# Function use _filerdne function internally. If some syntax error +# found in _filepath then function return "". +# If some error occured while reading data from file then fuction return "" +# and error-text is in ERRNO(and no close-file action will be occured!). +# If reading data completed successfully then function try to close +# file and if while closing file some error occured then function +# returns "" and error-text is in ERRNO. +# Otherwise function returns readed data. +#_____________________________________________________________________________ +# +# fn _wrfile(_filepath,_data) +# +# Write data into file specified in _filepath. +# If _filepath=="" then no action occured and return "". +# Function write _data to file. No any changes in data occured. +# Function use _filerdne function internally. If some syntax error +# found in _filepath then function return "". +# If some error occured while writing data to file then fuction return "" +# and error-text is in ERRNO(and no close-file action will be occured!). +# If writing data completed successfully then function try to close +# file and if while closing file some error occured then function +# returns "" and error-text is in ERRNO. +# Otherwise function returns _filepath(re-processed). +#___________________________________________________________________________________ +# +# fn _filepath(_filepath) +# +# Return re-processed root-dir-name-ext of _filepath. +# If _filepath=="" then no action occured and return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#_____________________________________________________________________________ +# +# fn _filerdne(_filepath) +# +# Return re-processed root-dir-filename of _filepath. +# If _filepath=="" then no action occured and return "". +# Function return result only if in _filepath present file-name(name +# and/or extension) - otherwise its return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#_____________________________________________________________________________ +# +# fn _filerdn(_filepath) +# +# Return re-processed root-dir-name of _filepath. +# If _filepath=="" then no action occured and return "". +# Function return result only if in _filepath present name field - +# - otherwise its return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#_____________________________________________________________________________ +# +# fn _filerd(_filepath) +# +# Return re-processed root-dir of _filepath. +# If _filepath=="" then no action occured and return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#_____________________________________________________________________________ +# +# fn _filer(_filepath) +# +# Return re-processed root of _filepath. +# If _filepath=="" then no action occured and return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#_____________________________________________________________________________ +# +# fn _filed(_filepath) +# +# Return re-processed dir of _filepath. +# If _filepath=="" then no action occured and return "". +# There is only one case when dir string can be =="" - when in +# _filepath specified unmounted drive(MS-format) and from- +# current-location address used(like Z:file.ext). In this +# case no rootdir-cache-record will be created. +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#_____________________________________________________________________________ +# fn _filene(_filepath) +# +# Return re-processed name-ext of _filepath. +# If _filepath=="" then no action occured and return "". +# Function return result only if in _filepath present file-name(name +# and/or extension) - otherwise its return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#_____________________________________________________________________________ +# +# fn _filen(_filepath) +# +# Return re-processed name of _filepath. +# If _filepath=="" then no action occured and return "". +# Function return result only if in _filepath present name field - +# - otherwise its return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#_____________________________________________________________________________ +# +# fn _file(_filepath) +# +# Return re-processed ext of _filepath. +# If _filepath=="" then no action occured and return "". +# Function return result only if in _filepath present ext field - +# - otherwise its return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +#___________________________________________________________________________________ +# +# fn _dir(_ARR,_filepathmask) +# +# Get file-/folder-list of root-folder of _filepathmask. +# If _filepathmask=="" then no action occured and return "". +# _filepathmask can contain symbols like `*' and `?' as like +# its used in `dir'-shell command. +# Function gets file-/folder-list of specified root-dir-_filepathmask +# and return this list in array _ARR - where each element: +# +# index - is the _filepath of file-or-folder name-ext +# value - contains 3 fields separated by " ": +# 1. =="D" if this is folder +# ==/[0-9]+/ if this is file - size of file in bytes +# 2. ==date-of-creation of file or folder +# 3. ==time-of-creation of file or folder +# +# Function returns quantity of items in ARR. +#___________________________________________________________________________________ +# +# fn _filexist(_filepath) +# +# Test if file or path or drive specified in _filepath is exist. +# If _filepath=="" then no action occured and return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +# Function returns _filepath if _filepath is exist. Otherwise +# function return 0. +#_____________________________________________________________________________ +# +# fn _filenotexist(_filepath) +# +# Test if file or path or drive specified in _filepath is not exist. +# If _filepath=="" then no action occured and return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +# Function returns 1 if _filepath is not exist. Otherwise function +# return 0. +#_____________________________________________________________________________ +# +# fn _newdir(_filepath) +# +# Create path specified in root-dir-_filepath. +# If _filepath=="" then no action occured and return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +# Function returns root-dir of _filepath. +#_______________________________________________________________________ +# +# fn _newdir(_filepath) +# +# Create path specified in root-dir-_filepath. If this folder +# already exist then it will be completely cleared. +# If _filepath=="" then no action occured and return "". +# If some syntax error found in _filepath then function return "" +# (and NO _filepath-cache-record will be created!). +# Function returns root-dir of _filepath. +#___________________________________________________________________________________ +# +# fn _getmpfile(_filepath,_currfilepath) +# +# Return .... +# +#_____________________________________________________________________________ +# +# fn _getmpdir(_filepath,_currfilepath) +# +# Return ... +# +#_____________________________________________________________________________ +# +# Temporary files folder. +# +# Temporary files folder location is defined by _FILEIO_TMPRD. +# If it wasn't been initialized before program run or not been initialized +# by ENVIRON["TMPDIR"] then it will defined as the: +# `current rootdir(stored in _FILEIO_RD)\programname.TMP' +# In this case if its already exist then it will completely cleared when _FILEIO +# library initialization processed. +# And at the program uninitialization processed it will completely +# cleared if _FILEIO_TMPCLRFLAG is true. +#___________________________________________________________________________________ +# +# var _FILEIO_RD (ENVIRON["CD"]) +# +# This var can be set before running program. It can contain path which +# will be used as default current dir while program run. +# If this var is set before program runs - then it will be refreshed by the +# _filerd it will be used as default current dir while program run. +# If this var is not set before program runs - then ENVIRON["CD"] can also +# set up default current dir while program run. If it set before program +# begin then it will be refreshed by the _filerd - and also writed into +# _FILEIO_RD. +# If both _FILEIO_RD and ENVIRON["CD"] are not set before program begins +# then real current root\dir will be writed into both _FILEIO_RD and +# ENVIRON["CD"] and it will be used as default current dir while program run. +# +#___________________________________________________________________________________ +# +# var _FILEIO_TMPRD (ENVIRON["TMPRD"]) +# +# This var can be set before running program. It can contain path which +# will be used as default temporary files root-folder while program run. +# If this var is set before program runs - then it will be refreshed by the +# _filerd - and also writed into ENVIRON["TMPRD"]. +# If this var is not set before program runs - then ENVIRON["TMPRD"] can also +# set up default temporary files root-folder while program run. If it set +# before program begin then it will be refreshed by the _filerd - and +# also writed into _FILEIO_TMPRD. +# If both _FILEIO_TMPRD and ENVIRON["TMPRD"] are not set before program begins +# then new folder into path specified by the _FILEIO_RD(after its handling) +# will be writed into both _FILEIO_TMPRD and ENVIRON["TMPRD"] and it +# will be used as default temporary files root-folder while program run. +#___________________________________________________________________________________ +# +# var _FILEPATH +# +# This var contain filepath of working script. It should be setting up externally. +# +# var _gawk_scriptlevel +#___________________________________________________________________________________ +#################################################################################### END { if (_constatstrln > 0) { _constat() @@ -376,7 +704,6 @@ END { #_______________________________________________________________________ function W(p, p0, p1) { - ##################################################### if (isarray(p0)) { delete p0[p] if (isarray(p1)) { @@ -410,7 +737,6 @@ function W(p, p0, p1) } ########################################################## - function _ARR(c, t, P) { switch (c) { @@ -440,7 +766,6 @@ function _ARR(c, t, P) } ########################################################## - function _BASE(c, t, P, A) { switch (c) { @@ -494,7 +819,6 @@ function _BASE(c, t, P, A) #____________________________________________________________________________ function _DS(c, t, P, a, A) { - ###################################################### switch (c) { case "_lib_CMDLN": #___________________________________________________________ @@ -520,12 +844,9 @@ function _DS(c, t, P, a, A) #______________________________________________________________________________________________ function _END() { - ################################################################################# - } ######################################################## - function _ERRLOG(c, t, P, a, b, A) { switch (c) { @@ -597,12 +918,9 @@ function _ERRLOG(c, t, P, a, b, A) #______________________________________________________________________________________________ function _EXIT() { - ################################################################################ - } ######################################################## - function _EXTFN(c, t, P) { switch (c) { @@ -632,7 +950,6 @@ function _EXTFN(c, t, P) } ####################################################### - function _FILEIO(c, t, P, A) { switch (c) { @@ -679,11 +996,9 @@ function _FILEIO(c, t, P, A) } } -############################################################ #_____________________________________________________________________________ function _FILEVER(c, t, P, a, A) { - ################################################# switch (c) { case "_lib_CMDLN": #___________________________________________________________ @@ -720,13 +1035,10 @@ function _INIT(f) #___________________________________________________________________________________ function _INITBASE() { - ################################################################ - _egawk_utilpath = ENVIRON["EGAWK_PATH"] "BIN\\UTIL\\" } ###################################################### - function _INSTRUC(c, t, P) { switch (c) { @@ -764,7 +1076,6 @@ function _INSTRUC(c, t, P) #_____________________________________________________________________________ function _N(F, v, p) { - ########################################################### for (p in _UIDS) { delete _UIDS[p] return _nN_i0(p, F, v) @@ -773,7 +1084,6 @@ function _N(F, v, p) } ##################################################### - function _SHORTCUT(c, t, P) { switch (c) { @@ -805,7 +1115,6 @@ function _SHORTCUT(c, t, P) #______________________________________________________________________________________________ function _START(t, i, A) { - ######################################################################### _torexp_init() test_uid() return @@ -915,7 +1224,6 @@ function _START(t, i, A) } ######################################################### - function _SYSIO(c, t, P) { switch (c) { @@ -969,7 +1277,6 @@ function _W(p, A, v) #_______________________________________________________________________ function _Zexparr(S, s, t, i) { - ############################################## t = "" if (isarray(S)) { for (i in S) { @@ -1021,7 +1328,6 @@ function _Zexparr_i3(t) #_______________________________________________________________________ function _Zimparr(D, t, A, B) { - ############################################## if (isarray(D)) { split(t, A, /\x10/, B) t = _Zimparr_i0(A, B, _Zimparr_i1(D, A, B, 1)) @@ -1072,7 +1378,6 @@ function _Zimparr_i2(t) #_____________________________________________________________________________ function _Zimport(t, p, A, c, i, n, B) { - ############################################## if (p) { c = split(t, B, /\x0A/) for (i = 1; i <= c; i++) { @@ -1147,7 +1452,6 @@ function _accmpu(A, a, n) #_______________________________________________________________________ function _add(S, sf, D, df) { - ################################################ if (sf in S) { if (isarray(S[sf])) { if (df in D) { @@ -1171,7 +1475,6 @@ function _add(S, sf, D, df) #_________________________________________________________________ function _addarr(D, S) { - ############################################# if (isarray(S)) { _addarr_i0(D, S) } @@ -1196,7 +1499,6 @@ function _addarr_i0(D, S, i) #_______________________________________________________________________ function _addarrmask(D, S, M) { - ############################################# for (_addarrmaski0 in M) { if (_addarrmaski0 in S) { if (isarray(S[_addarrmaski0])) { @@ -1229,14 +1531,12 @@ function _addarrmask(D, S, M) #_______________________________________________________________________ function _addf(A, f) { - ##################################################### A["B"][""] = A["F"][A["B"][f] = A["B"][""]] = f } #___________________________________________________________ function _addfile(f, d, a, b) { - ################################## if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") { ERRNO = "Filename error" return @@ -1262,7 +1562,6 @@ function _addfile(f, d, a, b) #_____________________________________________________________________________ function _addlib(f) { - ########################################################### _addf(_LIBAPI, f) } @@ -1273,15 +1572,12 @@ function _addlib(f) #_______________________________________________________________________ function _addlist(A, v) { - ################################################## A[++A[0]] = v } -############################################ #_______________________________________________________________________ function _bearray(A) { - #################################################### if (isarray(A) || A == 0 && A == "") { return 1 } @@ -1290,7 +1586,6 @@ function _bearray(A) #_________________________________________________________________ function _bframe(A, t, p) { - ########################################### return _bframe_i0(A, t, p, A[""]) } @@ -1322,7 +1617,6 @@ function _bframe_i0(A, t, p, f) #_______________________________________________________________________ function _cfguid(p, optr, pfx, sfx, hstrcnt, lstrchr) { - #################### 0 # delete _UIDOBL[p] if (_isptr(optr)) { if (optr == p) { @@ -1391,7 +1685,6 @@ function _cfguidl(p, H, L, hi, h, hl, li) #____________________________________________________________________________________________________ function _check(p) { - #################################################################################### _dll_check(p) _file_check(p) _serv_check(p) @@ -1401,14 +1694,12 @@ function _check(p) #_______________________________________________________________________ function _chrline(t, ts, w, s) { - ############################################# return ((t = " " _tabtospc(t, ts) ((t ? (t ~ /[ \t]$/ ? "" : " ") : ""))) _getchrln((s ? s : "_"), ((w ? w : _CON_WIDTH - 1)) - length(t)) _CHR["EOL"]) } #_____________________________________________________________________________ function _cmd(c, i, A) { - ####################################################### _fio_cmda = RS RS = ".{1,}" _fio_cmdb = BINMODE @@ -1426,7 +1717,6 @@ function _cmd(c, i, A) #_______________________________________________________________________ function _cmparr(A0, A1, R, a, i) { - ########################################## a = 0 delete R for (i in A0) { @@ -1452,7 +1742,6 @@ function _cmparr(A0, A1, R, a, i) #_____________________________________________________________________________ function _con(t, ts, a, b, c, d, i, r, A, B) { - ########################################## d = RLENGTH if ((c = split(r = t, A, /\x0D?\x0A/, B)) > 0) { a = BINMODE @@ -1494,7 +1783,6 @@ function _con(t, ts, a, b, c, d, i, r, A, B) #_______________________________________________________________________ function _conin(t, a, b) { - ################################################# _constatpush() _constat() a = BINMODE @@ -1516,14 +1804,12 @@ function _conin(t, a, b) #_______________________________________________________________________ function _conl(t, ts) { - #################################################### return _con(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])), ts) } #_______________________________________________________________________ function _conline(t, ts) { - ################################################# return _con(_chrline(t, ts)) } @@ -1540,7 +1826,6 @@ function _conlq(t, ts) #_______________________________________________________________________ function _constat(t, ts, ln, a) { - ########################################### if (_constatstrln > (ln = length(t = _constatgtstr(_constatstr = _tabtospc(t, ts), _CON_WIDTH - 1 - _conlastrln)))) { t = t _getchrln(" ", _constatstrln - ln) } @@ -1577,7 +1862,6 @@ function _constatgtstr(t, ln, a, b) #_______________________________________________________________________ function _constatpop() { - ################################################## if (_CONSTATPUSH[0] > 0) { return _constat(_CONSTATPUSH[_CONSTATPUSH[0]--]) } @@ -1587,7 +1871,6 @@ function _constatpop() #_______________________________________________________________________ function _constatpush(t, ts) { - ############################################# _CONSTATPUSH[++_CONSTATPUSH[0]] = _constatstr if (t) { _constat(t, ts) @@ -1604,7 +1887,6 @@ function _creport(p, t, f, z) #_________________________________________________________________________________________ function _defdir(pp, n, f, v, p) { - ############################################################# _[p = _wLCHLD(pp, _n("TYPE", "defdir"))]["NAME"] = n _[p]["DIR"] = f return p @@ -1613,7 +1895,6 @@ function _defdir(pp, n, f, v, p) #_________________________________________________________________________________________ function _defdll(pp, n, rn, p) { - ############################################################## _[p = _wLCHLD(pp, _n("TYPE", "defdll"))]["NAME"] = n _[p]["REGPATH"] = _[pp]["REGPATH"] rn _[p]["ERRHOST"] = pp @@ -1654,7 +1935,6 @@ function _defescarr(D, r, S, i, c, t) #_________________________________________________________________________________________ function _defile(pp, n, f, v, p) { - ############################################################# _[p = _wLCHLD(pp, _n("TYPE", "defile"))]["NAME"] = n _[p]["FILE"] = f if (! (v == 0 && v == "")) { @@ -1666,14 +1946,12 @@ function _defile(pp, n, f, v, p) #_______________________________________________________________________ function _defn(f, c, v) { - ################################################### FUNCTAB[c f] = v } #_________________________________________________________________________________________ function _defreg(pp, n, f, v, p) { - ############################################################# _[p = _wLCHLD(pp, _n("TYPE", "defreg"))]["NAME"] = n _[p]["REGPATH"] = f if (! (v == 0 && v == "")) { @@ -1684,7 +1962,6 @@ function _defreg(pp, n, f, v, p) #_______________________________________________________________________________________________ function _defsolution(pp, n, rn, p) { - ############################################################### _[p = _wLCHLD(pp, _n("TYPE", "solution"))]["NAME"] = n _[p]["REGPATH"] = rn _[p]["ERRHOST"] = pp @@ -1694,7 +1971,6 @@ function _defsolution(pp, n, rn, p) #_________________________________________________________________________________________ function _defsrv(pp, n, f, v, p) { - ############################################################# _[p = _wLCHLD(pp, _n("TYPE", "defsrv"))]["NAME"] = n _[p]["SERVNAME"] = f return p @@ -1703,7 +1979,6 @@ function _defsrv(pp, n, f, v, p) #_______________________________________________________________________ function _del(f, c, a, A) { - ################################################# if (match(f, /\\[ \t]*$/)) { if ((c = toupper(_filerd(f))) && length(f) == FLENGTH) { _cmd("rd " c " /S /Q 2>NUL") @@ -1732,7 +2007,6 @@ function _del(f, c, a, A) #_______________________________________________________________________ function _delay(t, a) { - ################################################### for (a = 1; a <= t; a++) { _delayms() } @@ -1741,7 +2015,6 @@ function _delay(t, a) #_________________________________________________________________ function _delayms(a) { - ############################################# for (a = 1; a <= _delay_perfmsdelay; a++) { } } @@ -1749,7 +2022,6 @@ function _delayms(a) #_______________________________________________________________________ function _deletepfx(A, f, B, le, i) { - ######################################## le = length(f) for (i in A) { if (substr(toupper(i), 1, le) == f) { @@ -1762,7 +2034,6 @@ function _deletepfx(A, f, B, le, i) #_________________________________________________________________ function _delf(A, f) { - ############################################### A["B"][A["F"][A["B"][f]] = A["F"][f]] = A["B"][f] delete A["F"][f] delete A["B"][f] @@ -1771,7 +2042,6 @@ function _delf(A, f) #_______________________________________________________________________ function _deluid(p) { - ################################################# 1 # if (p in _CLASSPTR) { _deluida0 = _CLASSPTR[p] if (_deluida0 in _UIDOBL) { @@ -1785,7 +2055,6 @@ function _deluid(p) #_______________________________________________________________________ function _dir(A, rd, i, r, f, ds, pf, B, C) { - #################################### delete A gsub(/(^[ \t]*)|([ \t]*$)/, "", rd) if (rd == "") { @@ -1815,7 +2084,6 @@ function _dir(A, rd, i, r, f, ds, pf, B, C) #_________________________________________________________________ function _dirtree(A, f, B) { - ######################################### gsub(/(^[ \t]*)|([ \t]*$)/, "", f) delete A A[""] @@ -1852,8 +2120,7 @@ function _dll_check(pp) { _dllchktv = "" _missfl = 1 - _tframe("_dll_check_i0", pp, _REG, pp) - #also check that all dll have same version; also check that all dlls have success and then report that DS plug-in version n - installed + _tframe("_dll_check_i0", pp, _REG, pp) #also check that all dll have same version; also check that all dlls have success and then report that DS plug-in version n - installed if (1 || "AGENT" in _[pp]) { if (_dllchktv != _[pp][".Product Version"]) { _dllerr(_[pp]["AGENT"], "agent version (" _[pp][".Product Version"] ") do not match all lib versions: " _dllchktv "'") @@ -1888,7 +2155,6 @@ function _dll_check_i0(p, R, pp, p2, i, i2, r, f, v, rs, d, tv, tf) } } } - #{ rs=_missfl=1; _[p]["." gensub(/^([^\\]+\\)+(.*)\..../,"\\2","G",i)]=R[i] } } if (rs) { if ((i = ".Install Path") in _[p] && (i = ".Product Version") in _[p]) { _[p]["STATUS"] = "PRESENT" @@ -1982,7 +2248,6 @@ function _drawuid(p, cn, ch, o) #_______________________________________________________________________ function _dumparr(A, t, lv, a) { - ############################################ b = PROCINFO["sorted_in"] PROCINFO["sorted_in"] = "_lengthsort" if (isarray(A)) { @@ -2047,7 +2312,6 @@ function _dumparr_i1(A, lv, ls, ln, t, t2, i, a, f) #_____________________________________________________________________________ function _dumpobj(p, f, t, s) { - ################################################### s = _dumpobj_i0(p, f, t = t "." p "{") if (p = _rFCHLD(p)) { return (s = s _dumpobjm(p, f, (s ? _getchrln(" ", length(t) - 1) : t " "))) @@ -2115,14 +2379,12 @@ function _dumpobj_i4(t) #_________________________________________________________________ function _dumpobj_nc(p, f, t) { - ####################################### return _dumpobj_i0(p, f, t "." p "{ ") } #_________________________________________________________________ function _dumpobjm(p, f, t, s, t2) { - ################################### t2 = _getchrln(" ", length(t)) do { s = s _dumpobj(p, f, t) @@ -2134,7 +2396,6 @@ function _dumpobjm(p, f, t, s, t2) #_________________________________________________________________ function _dumpobjm_nc(p, f, t, s, t2) { - ################################ t2 = _getchrln(" ", length(t)) do { s = s _dumpobj_nc(p, f, t) @@ -2174,7 +2435,6 @@ function _dumpval(v, n) } ######################################################## - function _eXTFN(c, t, P) { switch (c) { @@ -2212,7 +2472,6 @@ function _endpass(t) #_______________________________________________________________________ function _err(t, a, b) { - ################################################### a = BINMODE b = ORS BINMODE = "rw" @@ -2227,14 +2486,12 @@ function _err(t, a, b) #_________________________________________________________________ function _errnl(t) { - ################################################ return _err(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"]))) } #_______________________________________________________________________ function _error(t, d, A) { - ################################################# if (_ERRLOG_EF) { A["TYPE"] = "ERROR" A["TEXT"] = t @@ -2245,14 +2502,12 @@ function _error(t, d, A) #_______________________________________________________________________ function _exit(c) { - ####################################################### exit c } #_____________________________________________________________________________ function _export_data(t, i, A) { - ################################################# A["DATA"] = t A["ID"] = i _expout("_DATA: " _Zexparr(A) "\n") @@ -2264,7 +2519,6 @@ function _export_data(t, i, A) #_____________________________________________________________________________ function _expout(t, d, a, b) { - #################################################### a = BINMODE b = ORS BINMODE = "rw" @@ -2287,8 +2541,6 @@ function _expout(t, d, a, b) function _extfn_init() { - ############################################################## - _formatstrs_init() _formatstrd_init() _formatrexp_init() @@ -2321,7 +2573,6 @@ function _faccr_i0(A, t, p, P, f, r) #_______________________________________________________________________ function _fatal(t, d, A) { - ################################################# if (_ERRLOG_FF) { A["TYPE"] = "FATAL" A["TEXT"] = t @@ -2352,11 +2603,9 @@ function _ffaccr(A, t, p, P) return _faccr_i0(A["F"], t, p, P) } -################## #_______________________________________________________________________ function _fframe(A, t, p) { - ################################################# return _fframe_i0(A, t, p, A[""]) } @@ -2369,7 +2618,6 @@ function _fframe_i0(A, t, p, f) #_________________________________________________________________ function _file(f) { - ################################################# if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2418,7 +2666,6 @@ function _file_check_i0(p, pp, p1, p2, f, v) #_________________________________________________________________ function _filed(f, dd, d) { - ########################################## if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2443,7 +2690,6 @@ function _filed(f, dd, d) #_________________________________________________________________ function _filen(f) { - ################################################ if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2453,7 +2699,6 @@ function _filen(f) #_________________________________________________________________ function _filene(f) { - ############################################### if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2463,7 +2708,6 @@ function _filene(f) #_________________________________________________________________ function _filenotexist(f, a) { - ###################################### if (f == "") { return "" } @@ -2481,7 +2725,6 @@ function _filenotexist(f, a) #_______________________________________________________________________ function _filepath(f, dd) { - ################################################ if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2491,7 +2734,6 @@ function _filepath(f, dd) #_________________________________________________________________ function _filer(f, dd) { - ############################################# if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2507,7 +2749,6 @@ function _filer(f, dd) #_________________________________________________________________ function _filerd(f, dd) { - ############################################ if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2517,7 +2758,6 @@ function _filerd(f, dd) #_________________________________________________________________ function _filerdn(f, dd) { - ########################################### if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2527,7 +2767,6 @@ function _filerdn(f, dd) #_________________________________________________________________ function _filerdne(f, dd) { - ########################################## if ((f = _filerdnehnd(f)) == "") { return "" } @@ -2598,7 +2837,6 @@ function _filerdnehnd(st, c, r, d, n, A) #_______________________________________________________________________ function _filexist(f, a) { - ################################################ if (f == "") { return "" } @@ -2617,7 +2855,6 @@ function _filexist(f, a) #_______________________________________________________________________ function _fn(f, p0, p1, p2) { - ################################################ if (f in FUNCTAB) { return @f(p0, p1, p2) } @@ -2626,7 +2863,6 @@ function _fn(f, p0, p1, p2) #_______________________________________________________________________ function _foreach(A, f, r, p0, p1, p2, i, p) { - #################################### if (isarray(A)) { _TMP0[p = _n()]["."] = 1 _foreach_i0(A, f, _TMP0[p], p0, p1, p2) @@ -2695,7 +2931,6 @@ function _formatstrd_init() _FORMATSTRDESC["\t"] = "\\t" } -#__________________________________________________________________________________ #################################################################################### @@ -2765,7 +3000,6 @@ function _gen(D, t) #_____________________________________________________________________________ function _gensubfn(t, r, f, p0, A) { - ############################################### if (match(t, r, A)) { return (substr(t, 1, RSTART - 1) (@f(_th0(substr(t, RSTART, RLENGTH), t = substr(t, RSTART + RLENGTH)), A, p0)) _gensubfn(t, r, f, p0)) } @@ -2775,7 +3009,6 @@ function _gensubfn(t, r, f, p0, A) #_____________________________________________________________________________ function _get_errout(p) { - ####################################################### return _tframe("_get_errout_i0", p) } @@ -2830,7 +3063,6 @@ function _get_errout_i3(p, t, ts, cl, cp, cr, a, b) #_____________________________________________________________________________ function _get_logout(p) { - ####################################################### return _tframe("_get_logout_i0", p) } @@ -2854,7 +3086,6 @@ function _get_logout_i0(p, t, n, a) #_______________________________________________________________________ function _getchrln(s, w) { - ################################################# if (s == "") { return } @@ -2880,14 +3111,12 @@ function _getchrln(s, w) #_______________________________________________________________________ function _getdate() { - ##################################################### return strftime("%F") } #_____________________________________________________________________________ function _getfilepath(t, f, al, b, A) { - ############################################ ERRNO = "" if (match(t, /^[ \t]*(("([^"]*)"[ \t]*)|([`']([^']*)'[ \t]*)|(([^ \t]+)[ \t]*))/, A)) { al = RLENGTH @@ -2906,7 +3135,6 @@ function _getfilepath(t, f, al, b, A) function _getfilever(f) { - ############################################################# split(_cmd(_fileverpath " \"" f "\""), _GETFILEVERA0, /[ \t]+/) if (_GETFILEVERA0[5]) { return _GETFILEVERA0[5] @@ -2916,14 +3144,12 @@ function _getfilever(f) #_________________________________________________________________ function _getime() { - ################################################ return strftime("%H:%M:%S") } #_________________________________________________________________ function _getmpdir(f, dd) { - ########################################## if (! dd || ! (dd = _filerd(dd))) { dd = _FILEIO_TMPRD } @@ -2936,7 +3162,6 @@ function _getmpdir(f, dd) #_________________________________________________________________ function _getmpfile(f, dd) { - ######################################### if (! dd || ! (dd = _filerd(dd))) { dd = _FILEIO_TMPRD } @@ -2949,7 +3174,6 @@ function _getmpfile(f, dd) #_______________________________________________________________________ function _getperf(o, t, a) { - ############################################### (o == "" ? ++_getperf_opcurr : _getperf_opcurr = o) if ((a = _getsecond()) != _getperf_last) { _getperf_opsec = (_getperf_opcurr - _getperf_opstart) / ((_getperf_last = a) - _getperf_start) @@ -3045,14 +3269,12 @@ function _getreg_i1(D, r, R, a, i, il, ir, rc, B) #_________________________________________________________________ function _getsecond() { - ############################################# return systime() } #___________________________________________________________ function _getsecondsync(a, c, b, c2) { - ########################## a = systime() while (a == systime()) { ++c @@ -3063,7 +3285,6 @@ function _getsecondsync(a, c, b, c2) #_______________________________________________________________________ function _getuid(p) { - ################################################# 1 # if (p in _UIDOBL) { for (_tptr in _UIDOBLV[_getuida0 = _UIDOBL[p]]) { delete _UIDOBLV[_getuida0][_tptr] @@ -3096,7 +3317,6 @@ function _handle8494(t) #_____________________________________________________________________________ function _hexnum(n, l) { - ######################################################### if (l + 0 < 1) { l = 2 } @@ -3106,7 +3326,6 @@ function _hexnum(n, l) #_________________________________________________________________ function _igetperf(t, s, o) { - ######################################### # t-test period in seconds(==0 ? no period; s(=true/false)-output/not output status; o-qnt of ops before test start if (t == 0 && t == "" && s == 0 && s == "" && o == 0 && o == "") { if (_getperf_fn !~ /not$/ && _constatstr == _getperf_stat) { _constat(_getperf_statstr) @@ -3137,7 +3356,6 @@ function _import_data(t, p, p2, a) #_______________________________________________________________________ function _info(t, d, A) { - ################################################## if (_ERRLOG_IF) { A["TYPE"] = "INFO" A["TEXT"] = t @@ -3209,7 +3427,6 @@ function _initsys() #_______________________________________________________________________ function _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A) { - ################### 1 # if (cs == 0 && cs == "") { cs = p p = _getuid() @@ -3271,7 +3488,6 @@ function _inituidefault(h, l, H, L) #_______________________________________________________________________ function _ins(S, sf, D, df) { - ################################################ if (sf in S) { if (isarray(S[sf])) { if (df in D) { @@ -3295,19 +3511,16 @@ function _ins(S, sf, D, df) #_________________________________________________________________ function _insf(A, f) { - ############################################### A["F"][""] = A["B"][A["F"][f] = A["F"][""]] = f } #_________________________________________________________________ function _insframe(A, f) { - ########################################### A[f] = A[""] A[""] = f } -######################## #_________________________________________________________________ function _inspass(A, f) { @@ -3320,7 +3533,6 @@ function _inspass(A, f) #_______________________________________________________________________ function _isptr(p) { - ################################################## 1 # if (isarray(p)) { is = _NOP it = "A" @@ -3341,7 +3553,6 @@ function _isptr(p) #_______________________________________________________________________ function _istr(p) { - ################################################### 1 # if (isarray(p)) { is = _NOP it = "A" @@ -3358,7 +3569,6 @@ function _istr(p) #_________________________________________________________________ function _lengthsort(i1, v1, i2, v2) { - ############################## return ((length(i1) < length(i2) ? -1 : (length(i1) > length(i2) ? 1 : (i1 < i2 ? -1 : 1)))) } @@ -3401,14 +3611,12 @@ function _lib_NAMEVER() #_____________________________________________________________________________ function _ln(t) { - ############################################################### return ((t ~ /\x0A$/ ? t : t _CHR["EOL"])) } #_________________________________________________________________ function _log(A, p, a, B) { - ########################################### if (isarray(A)) { A["TIME"] = _getime() A["DATE"] = _getdate() @@ -3429,7 +3637,6 @@ function _log(A, p, a, B) #_________________________________________________________________ function _lspctab(t, ts, l, l1, l2, A) { - ################################ while (match(t, /^(\t*)( *)((\t*)(.*))$/, A)) { if (A[1, "length"] >= l) { return substr(t, l + 1) @@ -3471,7 +3678,6 @@ function _macsfx94(F, D, C, p1, p2, p3) #_______________________________________________________________________ function _movarr(D, S) { - ################################################### delete D D[""] delete D[""] @@ -3589,7 +3795,6 @@ function _mpusub(F, D, C, d, p1, p2, p3, q) #_______________________________________________________________________ function _n(F, v, p) { - ##################################################### for (p in _UIDSDEL) { delete _UIDSDEL[p] delete _ptr[p] @@ -3652,7 +3857,6 @@ function _nN_i0(p, F, v) #_________________________________________________________________ function _newclrdir(f) { - ############################################ if ((f = _filerd(f)) == "") { return } @@ -3665,7 +3869,6 @@ function _newclrdir(f) #_______________________________________________________________________ function _newdir(f) { - ##################################################### if ((f = _filerd(f)) == "") { return } @@ -3676,7 +3879,6 @@ function _newdir(f) return f } -############################## #_______________________________________________________________________ function _nop(p0, p1, p2, p3) { @@ -3700,7 +3902,6 @@ function _nop(p0, p1, p2, p3) #_________________________________________________________________ function _nretarr(A, i, v, r, q) { - ##################################### if ((i = (i == "" ? 1 : i + 0)) <= (q = A[_ARRLEN])) { if (i <= (r = q - 16)) { _ARRSTR = A[i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] @@ -3720,7 +3921,6 @@ function _nretarr(A, i, v, r, q) #___________________________________________________________ function _nretarrd(A, i, v, r, q) { - ############################## if ((i = (i == "" ? 1 : i + 0)) <= (q = A[_ARRLEN])) { if (i <= (r = q - 16)) { _ARRSTR = A[i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] @@ -3745,7 +3945,6 @@ function _nretarrd(A, i, v, r, q) #___________________________________________________________________________________ function _out(t, a, b) { - ############################################################### a = BINMODE b = ORS BINMODE = "rw" @@ -3760,7 +3959,6 @@ function _out(t, a, b) #_________________________________________________________________ function _outnl(t) { - ################################################ return _out(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"]))) } @@ -3815,7 +4013,6 @@ function _p8(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8) #_______________________________________________________________________ function _pass(A, f, t, p2, i, a) { - ########################################### a = _endpass_v0 _endpass_v0 = "" i = 1 @@ -3838,7 +4035,6 @@ function _pass(A, f, t, p2, i, a) #_____________________________________________________________________________ function _patharr0(D, q, i, h, A, B) { - ############################################## delete D if (0 < (q = split(gensub(/\\/, "/", "G", gensub(/ *([:$\\\/]) */, "\\1", "G", gensub(/(^[ \t]+)|([ \t]+$)/, "", "G", q))), A, /\/+/, B))) { if (2 > (h = length(B[1]))) { @@ -3927,9 +4123,6 @@ function _patharr0_i1(D, A, i, q, t, c) } ############################################################################# - - - function _pmap(m, s1, s2, s3, s4, s5, s6, s7, s8) { if (match(m, /^([^\(]+)\(([^\)]*)\)$/, _QMAP)) { @@ -3988,7 +4181,6 @@ function _pr8(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8) #_________________________________________________________________ function _printarr(A, t, lv, r, a) { - #################################### a = PROCINFO["sorted_in"] PROCINFO["sorted_in"] = "_lengthsort" _printarrexp = (r ? r : "") @@ -4094,7 +4286,6 @@ function _qparam_i0(p0, p1, p2, p3, p4, p5, p6, p7) #_______________________________________________________________________ function _qstr(t, c, A, B) { - ################################################ c = "" for (t = split(t, A, /[\x00-\x1F\\"]/, B); t >= 0; t--) { c = _QSTR[B[t]] A[t + 1] c @@ -4105,17 +4296,14 @@ function _qstr(t, c, A, B) #_________________________________________________________________ function _qstrq(t) { - ################################################ gsub(/\\/, "\\\\", t) gsub(/"/, "\\\"", t) return t } -################################################################ #_____________________________________________________________________________ function _rEG(c, t, P, a, A) { - ##################################################### switch (c) { case "_lib_CMDLN": #___________________________________________________________ @@ -4141,7 +4329,6 @@ function _rEG(c, t, P, a, A) #_______________________________________________________________________ function _rFBRO(p) { - ###################################################### if (p) { if (p in _tPARENT) { return _tFCHLD[_tPARENT[p]] @@ -4157,18 +4344,15 @@ function _rFBRO(p) #_______________________________________________________________________ function _rFCHLD(p) { - ##################################################### if (p && p in _tFCHLD) { return _tFCHLD[p] } return "" } -######################## p="", !v #_______________________________________________________________________ function _rLBRO(p) { - ###################################################### if (p) { if (p in _tPARENT) { return _tLCHLD[_tPARENT[p]] @@ -4181,11 +4365,9 @@ function _rLBRO(p) return p } -######################## p="" #_______________________________________________________________________ function _rLCHLD(p) { - ##################################################### if (p && p in _tLCHLD) { return _tLCHLD[p] } @@ -4195,48 +4377,39 @@ function _rLCHLD(p) #_______________________________________________________________________ function _rLINK(p) { - ###################################################### return ((p in _tLINK ? _tLINK[p] : "")) } -######################## p="" #_______________________________________________________________________ function _rNEXT(p) { - ###################################################### if (p && p in _tNEXT) { return _tNEXT[p] } return "" } -######################## p="" #_______________________________________________________________________ function _rPARENT(p) { - #################################################### if (p && p in _tPARENT) { return _tPARENT[p] } return "" } -######################## p="" #_______________________________________________________________________ function _rPREV(p) { - ###################################################### if (p && p in _tPREV) { return _tPREV[p] } return "" } -######################## p="" #_______________________________________________________________________ function _rQBRO(p, c, p1) { - ################################################ if (p) { if (p in _tPARENT) { return _tQCHLD[_tPARENT[p]] @@ -4256,11 +4429,9 @@ function _rQBRO(p, c, p1) return p } -######################## p="" #_______________________________________________________________________ function _rQCHLD(p) { - ##################################################### if (p && p in _tQCHLD) { return _tQCHLD[p] } @@ -4273,7 +4444,6 @@ function _rQCHLD(p) #_____________________________________________________________________________ function _rSQFIRST(g, p, A) { - ##################################################### if (isarray(A)) { return _rSQFIRSTA(g, p, A) } @@ -4285,7 +4455,6 @@ function _rSQFIRST(g, p, A) #_________________________________________________________________ function _rSQFIRSTA(g, p, A) { - ######################################## _SQTOPTR[g] = p _SQSTACK[g][0] = 0 if ((p = _rsqgetptr(g, p)) in A) { @@ -4297,7 +4466,6 @@ function _rSQFIRSTA(g, p, A) #_______________________________________________________________________ function _rSQNEXT(g, p, A) { - ################################################ if (isarray(A)) { return _rSQNEXTA(g, p, A) } @@ -4307,7 +4475,6 @@ function _rSQNEXT(g, p, A) #_________________________________________________________________ function _rSQNEXTA(g, p, A) { - ######################################### if (p == _SQTOPTR[g]) { if (_SQSTACK[g][0] > 0) { _SQTOPTR[g] = _SQSTACK[g][_SQSTACK[g][0]--] @@ -4353,7 +4520,6 @@ function _rd_shortcut(D, f) #_______________________________________________________________________ function _rdfile(f, i, A) { - ################################################ if ((f = _filerdne(f)) == "" || _filene(f) == "") { ERRNO = "Filename error" return @@ -4406,7 +4572,6 @@ function _rdfile(f, i, A) # fn _getsecondsync() function _rdreg(D, p) { - ################################################################ _rdregp0 = "reg query \"" p "\" /S /reg:64 2>NUL" _rdregfld = _rdregkey = 0 _rdregq0 = split(gensub(/[\x0D?\x0A]{2,}/, _CHR["EOL"], "G", _cmd(_rdregp0)), _RDREGA0, /\x0D?\x0A/) @@ -4545,7 +4710,6 @@ function _registryinit() #_____________________________________________________________________________ function _regpath0(D, i, s, q, S) { - ############################################ 0 # if (i = _patharr0(S, i)) { if ("name" in S) { D["name"] = S["name"] @@ -4569,7 +4733,6 @@ function _regpath0(D, i, s, q, S) #_________________________________________________________________________________________ function _report(p) { - ####################################################################### _report_t0 = _reportparnt = "" _report_i0(p) _tframe("_report_i0", p) @@ -4667,7 +4830,6 @@ function _reporterr(p, t3, pp, t, t2) #_____________________________________________________________________________ function _retarr(A, i, p, a, q) { - ################################################## if (isarray(A)) { i = (i == "" ? 0 : i + 0) q = A[_ARRLEN] + 0 @@ -4691,7 +4853,6 @@ function _retarr_i0(A, q, i, a) #_________________________________________________________________ function _retarrd(A, v, i) { - ######################################### if (1 in A) { return (A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9] A[10] A[11] A[12] A[13] A[14] A[15] A[16] (((i = 17) in A ? _retarrd_i0(A, i) v : v))) } @@ -4729,7 +4890,6 @@ function _rexpfnend(t) #_____________________________________________________________________________ function _rexpstr(r, i, c, A) { - ################################################### c = split(r, A, "") r = "" for (i = 1; i <= c; i++) { @@ -4771,7 +4931,6 @@ function _rpp(q, D, S) #_________________________________________________________________________________________ function _rrdreg(DD, p, k, t, v, c, i, q, tT, A, B, C, D) { - ############################################# old; regedit if (! _registrytmpfile) { _registryinit() } @@ -4889,11 +5048,9 @@ function _rxpfn(R, t, p, i, f, A) return _rexpfnend(t) } -############################################################## #_____________________________________________________________________________ function _sHARE(c, t, P, a, A) { - ################################################### switch (c) { case "_lib_CMDLN": #___________________________________________________________ @@ -4916,11 +5073,9 @@ function _sHARE(c, t, P, a, A) } } -################################################################ #_____________________________________________________________________________ function _sYS(c, t, P, a, A) { - ##################################################### switch (c) { case "_lib_CMDLN": #___________________________________________________________ @@ -4967,7 +5122,6 @@ function _serv_check_i0(p, p0, p1, p2, p3, i, q, c) #_______________________________________________________________________ function _setarrsort(f, a) { - ############################################## a = PROCINFO["sorted_in"] if (! f) { delete PROCINFO["sorted_in"] @@ -4980,7 +5134,6 @@ function _setarrsort(f, a) #_______________________________________________________________________ function _setmpath(p, a) { - ################################################ ERRNO = "" if (p && (a = _filerd(p))) { if (_FILEIO_TMPRD) { @@ -5018,7 +5171,6 @@ function _setmpath(p, a) function _sharelist(D, h, q, c, l, A, B) { - ################################################# delete D c = _sharextool " \\\\" ((h == "" ? h = ENVIRON["COMPUTERNAME"] : h)) " 2>&1" if (match(c = _cmd(c), /\x0AShare[^\x0A]*Remark/)) { @@ -5038,7 +5190,6 @@ function _sharelist(D, h, q, c, l, A, B) #_____________________________________________________________________________ function _sharepath(h, s, A) { - ################################################### s = _sharextool " \\\\" ((h == "" ? h = ENVIRON["COMPUTERNAME"] : h)) "\\\"" s "\" 2>&1" if (match(s = _cmd(s), /\x0APath[ \t]+([^\x0D\x0A]+)/, _SHAREPATHA0)) { return gensub(/[ \t\\\/]*$/, "\\\\", 1, _SHAREPATHA0[1]) @@ -5048,17 +5199,14 @@ function _sharepath(h, s, A) function _shortcut(D, S) { - ############################################################# if (isarray(D)) { if (isarray(S)) { _addarrmask(D, S, _SHORTCUTWSTRUC) } else { if (S == 0 && S == "") { - # array,array2* - copy from array2 to array shorcut-specific elements _addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC) } else { if (_isnotfileptr(S)) { - # array* - define shortcut-specific elements in array by default values _addarrmask(D, _[S], _SHORTCUTWSTRUC) } else { if (_rd_shortcut(D, S)) { @@ -5067,22 +5215,18 @@ function _shortcut(D, S) } } } - # array,ptr* - copy from array _[ptr] to array shorcut-specific elements } else { if (D == 0 && D == "") { return _NOP } else { if (_isnotfileptr(D)) { - # -* - no action(return -) if (isarray(S)) { _addarrmask(_[D], S, _SHORTCUTWSTRUC) } else { if (S == 0 && S == "") { - # ptr,array* - copy from array to array _[ptr] shorcut-specific elements _addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC) } else { if (_isnotfileptr(S)) { - # ptr* - define shortcut-specifc elements in array _[ptr] by default values _addarrmask(_[D], _[S], _SHORTCUTWSTRUC) } else { if (_rd_shortcut(_[D], S)) { @@ -5091,9 +5235,7 @@ function _shortcut(D, S) } } } - # ptr,ptr2* - copy from array _[ptr2] to array _[ptr] shorcut-specific elements } else { - # ptr,filepath* - define in array _[ptr] shortcut-specific elements by reading its from shortcut file filepath(load shortcut) if (isarray(S) && _wr_shortcut(D, S)) { return } else { @@ -5109,11 +5251,9 @@ function _shortcut(D, S) } } } - # filepath,ptr* - [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array _[ptr](save shortcut) } } } - # filepath,filepath2* - [over]write shorcut file filepath; shortcut parameters will be defined from shortcut file filepath2(copy shortcut) return 1 } @@ -5299,7 +5439,6 @@ function _splitpath_test() #_______________________________________________________________________ function _splitstr(A, t, r) { - ########################################### 1 # if (_istr(t)) { if (_splitstr_i0(A, t) > 0) { return _splitstrp0 @@ -5475,7 +5614,6 @@ function _subseqon(B, r, F, f, s, e, q, i, A) function _sysinfo(D, h) { - ############################################################## h = "wmic /NODE: \"" h "\" OS 2>NUL" if (split(_cmd(h), _SYSINFOA0, /[\x0D\x0A]+/) == 3) { _sysinfol0 = length(h = _SYSINFOA0[2]) + 1 @@ -5488,7 +5626,6 @@ function _sysinfo(D, h) } ######################################################### - function _tOBJ(c, t, P) { switch (c) { @@ -5519,7 +5656,6 @@ function _tOBJ(c, t, P) #_______________________________________________________________________ function _tOBJ_CLEANUP(p) { - ############################################## for (p in UIDSDEL) { delete _ptr[p] delete _tPREV[p] @@ -5538,7 +5674,6 @@ function _tOBJ_CLEANUP(p) #_______________________________________________________________________ function _tabtospc(t, ts, xc, a, c, n, A, B) { - ################################## if (! ts) { ts = _TAB_STEP_DEFAULT } @@ -5575,7 +5710,6 @@ function _tapi(p, f, p0, p1, p2, p3, c) #_____________________________________________________________________________ function _tbframe(f, p, p0, p1) { - ################################################## delete _t_ENDF[++_t_ENDF[0]] f = (p ? _tbframe_i0(f, p, p0, p1) : "") --_t_ENDF[0] @@ -5594,7 +5728,6 @@ function _tbframe_i0(f, p, p0, p1, a) #_______________________________________________________________________ function _tbframex(f, p, p0, p1) { - ########################################### delete _t_ENDF[++_t_ENDF[0]] f = (p ? _tbframex_i0(f, p, p0, p1) : "") --_t_ENDF[0] @@ -5613,7 +5746,6 @@ function _tbframex_i0(f, p, p0, p1) #_____________________________________________________________________________ function _tbpass(f, p, p0, p1) { - ################################################### delete _t_ENDF[++_t_ENDF[0]] f = (p ? _tbpass_i0(f, p, p0, p1) : "") --_t_ENDF[0] @@ -5632,7 +5764,6 @@ function _tbpass_i0(f, p, p0, p1, a) #_____________________________________________________________________________ function _tbpassx(f, p, p0, p1) { - ################################################## delete _t_ENDF[++_t_ENDF[0]] f = (p ? _tbpassx_i0(f, p, p0, p1) : "") --_t_ENDF[0] @@ -5651,7 +5782,6 @@ function _tbpassx_i0(f, p, p0, p1) #_____________________________________________________________________________ function _tbrochld(p, f, pp) { - ################################################### # TEST!!! if (p) { if (p in _tFCHLD) { f = _tFCHLD[p] @@ -5743,35 +5873,30 @@ function _tbrochld(p, f, pp) #_________________________________________________________________ function _tbrunframe(f, p, p0, p1) { - ################################### return _tbframe((f ? f : "_trunframe_i0"), p, p0, p1) } #_________________________________________________________________ function _tbrunframex(f, p, p0, p1) { - ################################## return _tbframex((f ? f : "_trunframe_i0"), p, p0, p1) } #_________________________________________________________________ function _tbrunpass(f, p, p0, p1) { - #################################### return _tbpass((f ? f : "_trunframe_i0"), p, p0, p1) } #_________________________________________________________________ function _tbrunpassx(f, p, p0, p1) { - ################################### return _tbpassx((f ? f : "_trunframe_i0"), p, p0, p1) } #_____________________________________________________________________________ function _tdel(p, i) { - ########################################################## if (p in _) { _texclude(p) for (i in _ptr[p]) { @@ -5833,7 +5958,6 @@ function _tdel_i1(A, i) #_____________________________________________________________________________ function _tdelete(p, v) { - ####################################################### # REMAKE EXCLUDE if (p) { _wLCHLD(_tDELPTR, p) } @@ -5843,7 +5967,6 @@ function _tdelete(p, v) #_________________________________________________________________ function _tdelitem(p) { - ############################################# if (p) { if ("HOST" in _PTR[p] && "ITEMNAME" in _[p]) { return _wLCHLD(_PTR[_PTR[p]["HOST"]]["ITEM"][_[p]["ITEMNAME"]], p) @@ -5856,7 +5979,6 @@ function _tdelitem(p) #_______________________________________________________________________ function _tend(a, b) { - ##################################################### if (b == "") { return (_t_ENDF[_t_ENDF[0]] = a) } else { @@ -5867,7 +5989,6 @@ function _tend(a, b) #_____________________________________________________________________________ function _texclude(p, v, pp) { - ################################################### # TEST!!! if (p in _) { if (p in _tPARENT) { pp = _tPARENT[p] @@ -5916,7 +6037,6 @@ function _texclude(p, v, pp) #_____________________________________________________________________________ function _tframe(fF, p, p0, p1, p2) { - ############################################### delete _t_ENDF[++_t_ENDF[0]] p = (_isptr(p) ? (isarray(fF) ? _tframe_i1(fF, p, p0, p1, p2) : _tframe_i0(fF, p, p0, p1, p2)) : "") --_t_ENDF[0] @@ -5926,7 +6046,6 @@ function _tframe(fF, p, p0, p1, p2) #_____________________________________________________________________________ function _tframe0(f, p, p0, p1, p2, p3, A) { - ######################################### if (_isptr(p)) { if (isarray(f)) { return _tframe0_i0(f, p) @@ -5993,7 +6112,6 @@ function _tframe0_i2(A, m, p) #_________________________________________________________________ function _tframe1(f, p, p0, p1, p2, p3, A) { - ############################# if (_isptr(p)) { if (isarray(f)) { return _tframe1_i0(f, p, p0) @@ -6049,7 +6167,6 @@ function _tframe1_i2(A, m, p, p0) #_________________________________________________________________ function _tframe2(f, p, p0, p1, p2, p3, A) { - ############################# if (_isptr(p)) { if (isarray(f)) { return _tframe2_i0(f, p, p0, p1) @@ -6105,7 +6222,6 @@ function _tframe2_i2(A, m, p, p0, p1) #_________________________________________________________________ function _tframe3(f, p, p0, p1, p2, p3, A) { - ############################# if (_isptr(p)) { if (isarray(f)) { return _tframe3_i0(f, p, p0, p1, p2) @@ -6161,7 +6277,6 @@ function _tframe3_i2(A, m, p, p0, p1, p2) #_________________________________________________________________ function _tframe4(f, p, p0, p1, p2, p3, A) { - ############################# if (_isptr(p)) { if (isarray(f)) { return _tframe4_i0(f, p, p0, p1, p2, p3) @@ -6235,7 +6350,6 @@ function _tframe_i1(F, p, p0, p1, p2, a) #_______________________________________________________________________ function _tframex(f, p, p0, p1) { - ############################################ delete _t_ENDF[++_t_ENDF[0]] f = (p ? _tframex_i0(f, p, p0, p1) : "") --_t_ENDF[0] @@ -6347,7 +6461,6 @@ function _tgenuid_init(a, b, A) #_______________________________________________________________________ function _tgetitem(p, n, a, b) { - ############################################ if (p) { if (isarray(_PTR[p]["ITEM"]) && n in _PTR[p]["ITEM"]) { a = _PTR[p]["ITEM"][n] @@ -6366,7 +6479,6 @@ function _tgetitem(p, n, a, b) #_________________________________________________________________ function _tgetsp(p) { - ############################################### return _tSTACK[p][0] } @@ -6378,28 +6490,24 @@ function _th0(p, p1, p2, p3) return p } -########################################## #_________________________________________________________________ function _th1(p0, p, p2, p3) { return p } -############################## #_________________________________________________________________ function _th10(p0, p1) { return (p1 p0) } -############################## #_________________________________________________________________ function _th2(p0, p1, r, p3) { return p } -############################## #_________________________________________________________________ function _th3(p0, p1, p2, r) { @@ -6409,7 +6517,6 @@ function _th3(p0, p1, p2, r) #_________________________________________________________________ function _tifend(l) { - ############################################### return ((_t_ENDF[0] + l in _t_ENDF ? (_t_ENDF[_t_ENDF[0] + l] ? _t_ENDF[_t_ENDF[0] + l] : 1) : "")) } @@ -6579,7 +6686,6 @@ function _tlist_i1(L, p) #_________________________________________________________________ function _tmbframe(f, p, p0, p1, t) { - ################################## while (p && ! (_t_ENDF[0] in _t_ENDF)) { t = t _tbframe_i0(f, p, p0, p1, p = (p in _tPREV ? _tPREV[p] : "")) } @@ -6589,7 +6695,6 @@ function _tmbframe(f, p, p0, p1, t) #_________________________________________________________________ function _tmbframex(f, p, p0, p1, t) { - ################################# while (p && ! (_t_ENDF[0] in _t_ENDF)) { t = t _tbframex_i0(f, p, p0, p1) p = (p in _tPREV ? _tPREV[p] : "") @@ -6600,7 +6705,6 @@ function _tmbframex(f, p, p0, p1, t) #_________________________________________________________________ function _tmbpass(f, p, p0, p1) { - ###################################### while (p && ! (_t_ENDF[0] in _t_ENDF)) { p0 = _tbpass_i0(f, p, p0, p1, p = (p in _tPREV ? _tPREV[p] : "")) } @@ -6610,7 +6714,6 @@ function _tmbpass(f, p, p0, p1) #_________________________________________________________________ function _tmbpassx(f, p, p0, p1) { - ##################################### while (p && ! (_t_ENDF[0] in _t_ENDF)) { p0 = _tbpassx_i0(f, p, p0, p1) p = (p in _tPREV ? _tPREV[p] : "") @@ -6621,7 +6724,6 @@ function _tmbpassx(f, p, p0, p1) #_________________________________________________________________ function _tmframe(f, p, p0, p1, p2) { - ################################### delete _t_ENDF[++_t_ENDF[0]] f = (p ? _tmframe_i0(f, p, p0, p1, p2) : "") --_t_ENDF[0] @@ -6649,7 +6751,6 @@ function _tmframe_i1(F, p, p0, p1, p2, t) #_________________________________________________________________ function _tmframex(f, p, p0, p1, t) { - ################################## while (p && ! (_t_ENDF[0] in _t_ENDF)) { t = t _tframex_i0(f, p, p0, p1) p = (p in _tNEXT ? _tNEXT[p] : "") @@ -6660,7 +6761,6 @@ function _tmframex(f, p, p0, p1, t) #_________________________________________________________________ function _tmpass(f, p, p0, p1) { - ####################################### while (p && ! (_t_ENDF[0] in _t_ENDF)) { p0 = _tbpass_i0(f, p, p0, p1, p = (p in _tNEXT ? _tNEXT[p] : "")) } @@ -6670,7 +6770,6 @@ function _tmpass(f, p, p0, p1) #_________________________________________________________________ function _tmpassx(f, p, p0, p1) { - ###################################### while (p && ! (_t_ENDF[0] in _t_ENDF)) { p0 = _tbpassx_i0(f, p, p0, p1) p = (p in _tNEXT ? _tNEXT[p] : "") @@ -6714,7 +6813,6 @@ function _torexp_rexp(t) #_____________________________________________________________________________ function _tpass(f, p, p0, p1) { - #################################################### delete _t_ENDF[++_t_ENDF[0]] f = (p ? _tpass_i0(f, p, p0, p1) : "") --_t_ENDF[0] @@ -6733,7 +6831,6 @@ function _tpass_i0(f, p, p0, p1, a) #_____________________________________________________________________________ function _tpassx(f, p, p0, p1) { - ################################################### delete _t_ENDF[++_t_ENDF[0]] f = (p ? _tpassx_i0(f, p, p0, p1) : "") --_t_ENDF[0] @@ -6752,7 +6849,6 @@ function _tpassx_i0(f, p, p0, p1) #_________________________________________________________________ function _tpop(p, aA, a) { - ########################################### if ((a = _tSTACK[p][0]) > 0) { _tSTACK[p][0]-- if (isarray(_tSTACK[p][a])) { @@ -6768,7 +6864,6 @@ function _tpop(p, aA, a) #_____________________________________________________________________________ function _tpush(p, aA, a) { - ###################################################### if (isarray(aA)) { delete _tSTACK[p][a = ++_tSTACK[p][0]] _tSTACK[p][a][""] @@ -6807,7 +6902,6 @@ function _tr(n, cs, H) #_______________________________________________________________________ function _trace(t, d, A) { - ################################################# if (_ERRLOG_TF) { A["TYPE"] = "TRACE" A["TEXT"] = t @@ -6818,7 +6912,6 @@ function _trace(t, d, A) #_________________________________________________________________ function _trunframe(f, p, p0, p1, p2) { - ################################# return _tframe((f ? f : "_trunframe_i0"), p, p0, p1, p2) } @@ -6834,28 +6927,24 @@ function _trunframe_i0(p, p0, p1, p2, f) #_________________________________________________________________ function _trunframex(f, p, p0, p1) { - ################################### return _tframex((f ? f : "_trunframe_i0"), p, p0, p1) } #_________________________________________________________________ function _trunpass(f, p, p0, p1) { - ##################################### return _tpass((f ? f : "_trunframe_i0"), p, p0, p1) } #_________________________________________________________________ function _trunpassx(f, p, p0, p1) { - #################################### return _tpassx((f ? f : "_trunframe_i0"), p, p0, p1) } #_________________________________________________________________ function _tsetsp(p, v) { - ############################################# return (_tSTACK[p][0] = v) } @@ -7036,7 +7125,6 @@ function _typa(p, A) #_______________________________________________________________________ function _tzend(a, b) { - ##################################################### if (b == 0 && b == "") { return (_TEND[_TEND[_ARRLEN]] = a) } else { @@ -7176,7 +7264,6 @@ function _unstr(t) #_________________________________________________________________ function _untmp(f, a) { - ############################################# if (f = filepath(f)) { if (match(f, /\\$/)) { _deletepfx(_FILEIO_RDTMP, a = toupper(f)) @@ -7228,7 +7315,6 @@ function _var(v, t) #_______________________________________________________________________ function _verb(t, d, A) { - ################################################## if (_ERRLOG_VF) { A["TYPE"] = "VERB" A["TEXT"] = t @@ -7239,7 +7325,6 @@ function _verb(t, d, A) #_________________________________________________________________ function _wFBRO(p, v, a) { - ########################################### if (p) { if (v) { for (a = p; a in _tPARENT; ) { @@ -7247,7 +7332,6 @@ function _wFBRO(p, v, a) return v } } - ######################## v is parentesis of p if (p in _tPARENT) { p = _tPARENT[p] if (v in _tNEXT) { @@ -7346,19 +7430,15 @@ function _wFBRO(p, v, a) if (v == 0) { return v } - ######################## p=ptr, v=0 return v } } else { - ######################## p=ptr, v="" if (p == 0) { return v } - ######################## p=0 if (v) { return _texclude(v) } - ######################## p="", v=ptr - exclude v return v } } @@ -7366,19 +7446,16 @@ function _wFBRO(p, v, a) #_________________________________________________________________ function _wFCHLD(p, v, a) { - ########################################## if (p) { if (v) { if (p == v) { return v } - ######################## p=v=ptr for (a = p; a in _tPARENT; ) { if ((a = _tPARENT[a]) == v) { return v } } - ######################## v is parentesis of p if (v in _tNEXT) { if (v in _tPREV) { _tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v] @@ -7438,7 +7515,6 @@ function _wFCHLD(p, v, a) } else { if (v == 0) { if (p in _tFCHLD) { - ######################## p=ptr, v=0 > delete all chld v = _tFCHLD[p] delete _tFCHLD[p] delete _tLCHLD[p] @@ -7451,11 +7527,9 @@ function _wFCHLD(p, v, a) return v } } else { - ######################## p=ptr, v="" > ignore action if (p == 0) { return v } - ######################## p=0 return v } } @@ -7463,7 +7537,6 @@ function _wFCHLD(p, v, a) #_________________________________________________________________ function _wLBRO(p, v, a) { - ########################################### if (p) { if (v) { for (a = p; a in _tPARENT; ) { @@ -7471,7 +7544,6 @@ function _wLBRO(p, v, a) return v } } - ######################## v is parentesis of p if (p in _tPARENT) { p = _tPARENT[p] if (v in _tPREV) { @@ -7570,19 +7642,15 @@ function _wLBRO(p, v, a) if (v == 0) { return v } - ######################## p=ptr, v=0 return v } } else { - ######################## p=ptr, v="" if (p == 0) { return v } - ######################## p=0 if (v) { return _texclude(v) } - ######################## p="", v=ptr - exclude v return v } } @@ -7590,19 +7658,16 @@ function _wLBRO(p, v, a) #_________________________________________________________________ function _wLCHLD(p, v, a) { - ########################################## if (p) { if (v) { if (p == v) { return v } - ######################## p=v=ptr for (a = p; a in _tPARENT; ) { if ((a = _tPARENT[a]) == v) { return v } } - ######################## v is parentesis of p if (v in _tPREV) { if (v in _tNEXT) { _tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v] @@ -7662,7 +7727,6 @@ function _wLCHLD(p, v, a) } else { if (v == 0) { if (p in _tFCHLD) { - ######################## p=ptr, v=0 > delete all chld v = _tFCHLD[p] delete _tFCHLD[p] delete _tLCHLD[p] @@ -7675,11 +7739,9 @@ function _wLCHLD(p, v, a) return v } } else { - ######################## p=ptr, v="" > ignore action if (p == 0) { return v } - ######################## p=0 return v } } @@ -7687,26 +7749,22 @@ function _wLCHLD(p, v, a) #_________________________________________________________________ function _wLINK(p, v) { - ############################################## return (_tLINK[p] = v) } #_________________________________________________________________ function _wNEXT(p, v, a, b) { - ######################################### if (p) { if (v) { if (p == v) { return v } - ######################## p=v=ptr for (a = p; a in _tPARENT; ) { if ((a = _tPARENT[a]) == v) { return v } } - ######################## v is parentesis of p if (v in _tPREV) { if (p == (a = _tPREV[v])) { return v @@ -7759,19 +7817,15 @@ function _wNEXT(p, v, a, b) if (v == 0) { return v } - ######################## p=ptr, v=0 return v } } else { - ######################## p=ptr, v="" if (p == 0) { return v } - ######################## p=0 if (v) { return _texclude(v) } - ######################## p="", v=ptr - exclude v return v } } @@ -7779,26 +7833,22 @@ function _wNEXT(p, v, a, b) #_________________________________________________________________ function _wPARENT(p, v) { - ############################################ return v } #_________________________________________________________________ function _wPREV(p, v, a, b) { - ######################################### if (p) { if (v) { if (p == v) { return v } - ######################## p=v=ptr for (a = p; a in _tPARENT; ) { if ((a = _tPARENT[a]) == v) { return v } } - ######################## v is parentesis of p if (v in _tNEXT) { if (p == (a = _tNEXT[v])) { return v @@ -7851,19 +7901,15 @@ function _wPREV(p, v, a, b) if (v == 0) { return v } - ######################## p=ptr, v=0 return v } } else { - ######################## p=ptr, v="" if (p == 0) { return v } - ######################## p=0 if (v) { return _texclude(v) } - ######################## p="", v=ptr - exclude v return v } } @@ -7871,21 +7917,17 @@ function _wPREV(p, v, a, b) #_________________________________________________________________ function _wQBRO(p, v) { - ############################################## return v } #_________________________________________________________________ function _wQCHLD(p, v) { - ############################################# if (p) { if (v) { } else { - ######################## p=ptr, v=ptr if (v == 0) { if (p in _tFCHLD) { - ######################## p=ptr, v=0 > delete all chld v = _tFCHLD[p] delete _tFCHLD[p] delete _tLCHLD[p] @@ -7898,11 +7940,9 @@ function _wQCHLD(p, v) return v } } else { - ######################## p=ptr, v="" > ignore action if (p == 0) { return v } - ######################## p=0 return v } } @@ -7910,7 +7950,6 @@ function _wQCHLD(p, v) #_______________________________________________________________________ function _warning(t, d, A) { - ############################################### if (_ERRLOG_WF) { A["TYPE"] = "WARNING" A["TEXT"] = t @@ -7962,7 +8001,6 @@ function _wr_shortcut(f, S) #_________________________________________________________________ function _wrfile(f, d, a, b) { - ######################################### if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") { ERRNO = "Filename error" return @@ -7988,7 +8026,6 @@ function _wrfile(f, d, a, b) #___________________________________________________________ function _wrfile1(f, d, a, b) { - ################################## if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") { ERRNO = "Filename error" return @@ -8014,7 +8051,6 @@ function _wrfile1(f, d, a, b) #_______________________________________________________________________ function _yexport(p) { - ##################################################### return _tframe("_yexport_i0", p) } @@ -8035,7 +8071,6 @@ function _yexport_i0(p, p0, p1, p2) #_________________________________________________________________ function cmp_str_idx(i1, v1, i2, v2) { - ############################## return ((i1 < i2 ? -1 : 1)) } @@ -8190,7 +8225,6 @@ function hujf(a, b, c) #___________________________________________________________ function ncmp_str_idx(i1, v1, i2, v2) { - ####################### return ((i1 < i2 ? 1 : -1)) } @@ -8317,5 +8351,4 @@ function zorr(A, i, r) #_____________________________________________________________________________ function zzer() { - ################################################################ } -- cgit v1.2.3 From 769d7886cceec048dcd4aa67236b5971891418c3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 12 Dec 2014 07:42:32 +0200 Subject: Small doc fix. --- doc/ChangeLog | 5 +++++ doc/gawk.info | 2 +- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0a52dfbe..ede811ef 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2014-12-12 Arnold D. Robbins + + * gawktexi.in: Minor fix. + Thanks to Teri Price . + 2014-12-10 Arnold D. Robbins * gawktexi.in: More minor fixes. diff --git a/doc/gawk.info b/doc/gawk.info index fe080ce1..d6fccecd 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -11850,7 +11850,7 @@ undefined. Thus, avoid writing programs that assume that parameters are evaluated from left to right or from right to left. For example: i = 5 - j = atan2(i++, i *= 2) + 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 diff --git a/doc/gawk.texi b/doc/gawk.texi index 03f8bd48..3e6fb5d6 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -16989,7 +16989,7 @@ right to left. For example: @example i = 5 -j = atan2(i++, i *= 2) +j = atan2(++i, i *= 2) @end example If the order of evaluation is left to right, then @code{i} first becomes diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 53b24f37..61575e42 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -16272,7 +16272,7 @@ right to left. For example: @example i = 5 -j = atan2(i++, i *= 2) +j = atan2(++i, i *= 2) @end example If the order of evaluation is left to right, then @code{i} first becomes -- cgit v1.2.3 From 2e5a819d44fdc20235c66d95e96c4618d9008f6d Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 14 Dec 2014 12:27:05 -0500 Subject: Updating autotools caused some changes in derived files. --- Makefile.in | 22 +++++--- aclocal.m4 | 122 ++++++++++++++++++++++++++++++++++++++-- awklib/Makefile.in | 6 +- configure | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++- doc/Makefile.in | 10 +--- extras/Makefile.in | 2 +- test/Makefile.in | 2 +- 7 files changed, 299 insertions(+), 26 deletions(-) diff --git a/Makefile.in b/Makefile.in index 16d19b02..e5d872b3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -108,7 +108,8 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/configh.in mkinstalldirs ABOUT-NLS awkgram.c \ command.c depcomp ylwrap $(include_HEADERS) COPYING TODO \ - config.guess config.rpath config.sub install-sh missing + 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 \ @@ -589,8 +590,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/configh.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -690,14 +691,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) @@ -911,10 +912,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives 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: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -956,9 +963,10 @@ distcheck: dist && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ diff --git a/aclocal.m4 b/aclocal.m4 index 4099cd7e..8907206b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -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.13' +[am__api_version='1.14' 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.13.4], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,7 +51,7 @@ 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.13.4])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -418,6 +418,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -526,7 +532,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) 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 @@ -534,7 +581,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -716,6 +762,70 @@ 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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. diff --git a/awklib/Makefile.in b/awklib/Makefile.in index 611d2193..5a4087e5 100644 --- a/awklib/Makefile.in +++ b/awklib/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -414,14 +414,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique diff --git a/configure b/configure index b5f485ca..26e555f7 100755 --- a/configure +++ b/configure @@ -2591,7 +2591,7 @@ then fi -am__api_version='1.13' +am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -3157,6 +3157,47 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi @@ -4118,6 +4159,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -5366,6 +5466,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 diff --git a/doc/Makefile.in b/doc/Makefile.in index d89beffd..09701a06 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -451,13 +451,9 @@ $(am__aclocal_m4_deps): $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ - rm -rf $@; \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ - exit 1; \ + rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/gawk.info: gawk.texi gawk.dvi: gawk.texi diff --git a/extras/Makefile.in b/extras/Makefile.in index 86a10745..8418e2dc 100644 --- a/extras/Makefile.in +++ b/extras/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. diff --git a/test/Makefile.in b/test/Makefile.in index ab8aebe3..7214b707 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. -- cgit v1.2.3 From f9c7ec30542ef2550761f49cd25503e0775ef271 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 14 Dec 2014 12:32:36 -0500 Subject: Add `compile' needed by new autotools. --- compile | 347 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 347 insertions(+) create mode 100755 compile diff --git a/compile b/compile new file mode 100755 index 00000000..531136b0 --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: -- cgit v1.2.3 From a7478f42519382507939db409563753b76cfe140 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 14 Dec 2014 13:26:32 -0500 Subject: More autotools updates to derived files in the extension subdirectory. --- extension/Makefile.in | 21 ++++++--- extension/aclocal.m4 | 127 ++++++++++++++++++++++++++++++++++++++++++++++---- extension/configure | 121 +++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 249 insertions(+), 20 deletions(-) diff --git a/extension/Makefile.in b/extension/Makefile.in index 02ac379f..5feca509 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -110,7 +110,7 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ 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/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 \ @@ -651,8 +651,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/configh.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -770,14 +770,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -1025,10 +1025,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives 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: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -1070,9 +1076,10 @@ distcheck: dist && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ diff --git a/extension/aclocal.m4 b/extension/aclocal.m4 index 7e987650..cd7f9c16 100644 --- a/extension/aclocal.m4 +++ b/extension/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -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.13' +[am__api_version='1.14' 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.13.4], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,7 +51,7 @@ 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.13.4])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -76,7 +76,8 @@ AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [am_cv_ar_interface=ar + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) @@ -93,7 +94,7 @@ AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], fi rm -f conftest.lib libconftest.a ]) - ]) + AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) @@ -477,6 +478,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -585,7 +592,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) 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 @@ -593,7 +641,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -775,6 +822,70 @@ 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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. diff --git a/extension/configure b/extension/configure index 6e92b054..4bd1d940 100755 --- a/extension/configure +++ b/extension/configure @@ -2371,6 +2371,9 @@ 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` + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3160,6 +3163,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3623,7 +3685,7 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } INSTALL="$ac_aux_dir/install-sh -c" export INSTALL -am__api_version='1.13' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3795,9 +3857,6 @@ 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` - if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) @@ -4351,6 +4410,47 @@ fi +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 @@ -6562,7 +6662,13 @@ $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_ar_interface=ar + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; @@ -6593,6 +6699,11 @@ if ac_fn_c_try_compile "$LINENO"; then : fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 -- cgit v1.2.3 From 99c220c921ef24bfea7a1fe425753caf20db7c30 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 14 Dec 2014 20:54:58 -0500 Subject: Remove the errno extension, since it is now part of gawkextlib. --- extension/ChangeLog | 8 + extension/Makefile.am | 6 - extension/Makefile.in | 45 ++--- extension/errlist.h | 455 -------------------------------------------------- extension/errno.c | 143 ---------------- 5 files changed, 23 insertions(+), 634 deletions(-) delete mode 100644 extension/errlist.h delete mode 100644 extension/errno.c diff --git a/extension/ChangeLog b/extension/ChangeLog index 1561adfb..053ba50b 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,11 @@ +2014-12-14 Andrew J. Schorr + + Remove the errno extension, since it is now part of gawkextlib. + * errno.c, errlist.h: Deleted. + * Makefile.am (pkgextension_LTLIBRARIES): Remove errno.la. + (errno_la_SOURCES, errno_la_LDFLAGS, errno_la_LIBADD): Remove. + (EXTRA_DIST): Remove errlist.h. + 2014-11-23 Arnold D. Robbins * inplace.c (do_inplace_begin): Jump through hoops to silence diff --git a/extension/Makefile.am b/extension/Makefile.am index 32603734..5c0df894 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -35,7 +35,6 @@ RM = rm -f # Note: rwarray does not currently compile. pkgextension_LTLIBRARIES = \ - errno.la \ filefuncs.la \ fnmatch.la \ fork.la \ @@ -54,10 +53,6 @@ MY_MODULE_FLAGS = -module -avoid-version -no-undefined # on Cygwin, gettext requires that we link with -lintl MY_LIBS = $(LTLIBINTL) -errno_la_SOURCES = errno.c -errno_la_LDFLAGS = $(MY_MODULE_FLAGS) -errno_la_LIBADD = $(MY_LIBS) - filefuncs_la_SOURCES = filefuncs.c stack.h stack.c gawkfts.h \ gawkfts.c gawkdirfd.h filefuncs_la_LDFLAGS = $(MY_MODULE_FLAGS) @@ -128,7 +123,6 @@ uninstall-recursive: uninstall-so EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ - errlist.h \ fts.3 \ README.fts \ siglist.h diff --git a/extension/Makefile.in b/extension/Makefile.in index 5feca509..015bc118 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -167,19 +167,13 @@ am__installdirs = "$(DESTDIR)$(pkgextensiondir)" \ LTLIBRARIES = $(pkgextension_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -errno_la_DEPENDENCIES = $(am__DEPENDENCIES_2) -am_errno_la_OBJECTS = errno.lo -errno_la_OBJECTS = $(am_errno_la_OBJECTS) +filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +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@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -errno_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(errno_la_LDFLAGS) $(LDFLAGS) -o $@ -filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2) -am_filefuncs_la_OBJECTS = filefuncs.lo stack.lo gawkfts.lo -filefuncs_la_OBJECTS = $(am_filefuncs_la_OBJECTS) filefuncs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(filefuncs_la_LDFLAGS) $(LDFLAGS) -o $@ @@ -289,18 +283,18 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(errno_la_SOURCES) $(filefuncs_la_SOURCES) \ - $(fnmatch_la_SOURCES) $(fork_la_SOURCES) $(inplace_la_SOURCES) \ - $(ordchr_la_SOURCES) $(readdir_la_SOURCES) \ - $(readfile_la_SOURCES) $(revoutput_la_SOURCES) \ - $(revtwoway_la_SOURCES) $(rwarray_la_SOURCES) \ - $(select_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) -DIST_SOURCES = $(errno_la_SOURCES) $(filefuncs_la_SOURCES) \ - $(fnmatch_la_SOURCES) $(fork_la_SOURCES) $(inplace_la_SOURCES) \ - $(ordchr_la_SOURCES) $(readdir_la_SOURCES) \ - $(readfile_la_SOURCES) $(revoutput_la_SOURCES) \ - $(revtwoway_la_SOURCES) $(rwarray_la_SOURCES) \ - $(select_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) +SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ + $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ + $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ + $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ + $(rwarray_la_SOURCES) $(select_la_SOURCES) \ + $(testext_la_SOURCES) $(time_la_SOURCES) +DIST_SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ + $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ + $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ + $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ + $(rwarray_la_SOURCES) $(select_la_SOURCES) \ + $(testext_la_SOURCES) $(time_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -532,7 +526,6 @@ RM = rm -f # Note: rwarray does not currently compile. pkgextension_LTLIBRARIES = \ - errno.la \ filefuncs.la \ fnmatch.la \ fork.la \ @@ -550,9 +543,6 @@ pkgextension_LTLIBRARIES = \ MY_MODULE_FLAGS = -module -avoid-version -no-undefined # on Cygwin, gettext requires that we link with -lintl MY_LIBS = $(LTLIBINTL) -errno_la_SOURCES = errno.c -errno_la_LDFLAGS = $(MY_MODULE_FLAGS) -errno_la_LIBADD = $(MY_LIBS) filefuncs_la_SOURCES = filefuncs.c stack.h stack.c gawkfts.h \ gawkfts.c gawkdirfd.h @@ -597,7 +587,6 @@ testext_la_LIBADD = $(MY_LIBS) EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ - errlist.h \ fts.3 \ README.fts \ siglist.h @@ -700,9 +689,6 @@ clean-pkgextensionLTLIBRARIES: rm -f $${locs}; \ } -errno.la: $(errno_la_OBJECTS) $(errno_la_DEPENDENCIES) $(EXTRA_errno_la_DEPENDENCIES) - $(AM_V_CCLD)$(errno_la_LINK) -rpath $(pkgextensiondir) $(errno_la_OBJECTS) $(errno_la_LIBADD) $(LIBS) - filefuncs.la: $(filefuncs_la_OBJECTS) $(filefuncs_la_DEPENDENCIES) $(EXTRA_filefuncs_la_DEPENDENCIES) $(AM_V_CCLD)$(filefuncs_la_LINK) -rpath $(pkgextensiondir) $(filefuncs_la_OBJECTS) $(filefuncs_la_LIBADD) $(LIBS) @@ -748,7 +734,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errno.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filefuncs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork.Plo@am__quote@ diff --git a/extension/errlist.h b/extension/errlist.h deleted file mode 100644 index caa6d63b..00000000 --- a/extension/errlist.h +++ /dev/null @@ -1,455 +0,0 @@ -/* - * errlist.h - List of errno values. - */ - -/* - * Copyright (C) 2013 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifdef E2BIG -init_errno (E2BIG, "E2BIG") -#endif -#ifdef EACCES -init_errno (EACCES, "EACCES") -#endif -#ifdef EADDRINUSE -init_errno (EADDRINUSE, "EADDRINUSE") -#endif -#ifdef EADDRNOTAVAIL -init_errno (EADDRNOTAVAIL, "EADDRNOTAVAIL") -#endif -#ifdef EADV -init_errno (EADV, "EADV") -#endif -#ifdef EAFNOSUPPORT -init_errno (EAFNOSUPPORT, "EAFNOSUPPORT") -#endif -#ifdef EAGAIN -init_errno (EAGAIN, "EAGAIN") -#endif -#ifdef EALREADY -init_errno (EALREADY, "EALREADY") -#endif -#ifdef EAUTH -init_errno (EAUTH, "EAUTH") -#endif -#ifdef EBADE -init_errno (EBADE, "EBADE") -#endif -#ifdef EBADF -init_errno (EBADF, "EBADF") -#endif -#ifdef EBADFD -init_errno (EBADFD, "EBADFD") -#endif -#ifdef EBADMSG -init_errno (EBADMSG, "EBADMSG") -#endif -#ifdef EBADR -init_errno (EBADR, "EBADR") -#endif -#ifdef EBADRPC -init_errno (EBADRPC, "EBADRPC") -#endif -#ifdef EBADRQC -init_errno (EBADRQC, "EBADRQC") -#endif -#ifdef EBADSLT -init_errno (EBADSLT, "EBADSLT") -#endif -#ifdef EBFONT -init_errno (EBFONT, "EBFONT") -#endif -#ifdef EBUSY -init_errno (EBUSY, "EBUSY") -#endif -#ifdef ECANCELED -init_errno (ECANCELED, "ECANCELED") -#endif -#ifdef ECHILD -init_errno (ECHILD, "ECHILD") -#endif -#ifdef ECHRNG -init_errno (ECHRNG, "ECHRNG") -#endif -#ifdef ECOMM -init_errno (ECOMM, "ECOMM") -#endif -#ifdef ECONNABORTED -init_errno (ECONNABORTED, "ECONNABORTED") -#endif -#ifdef ECONNREFUSED -init_errno (ECONNREFUSED, "ECONNREFUSED") -#endif -#ifdef ECONNRESET -init_errno (ECONNRESET, "ECONNRESET") -#endif -#ifdef EDEADLK -init_errno (EDEADLK, "EDEADLK") -#endif -#ifdef EDEADLOCK -#if !defined(EDEADLK) || (EDEADLK != EDEADLOCK) -init_errno (EDEADLOCK, "EDEADLOCK") -#endif -#endif -#ifdef EDESTADDRREQ -init_errno (EDESTADDRREQ, "EDESTADDRREQ") -#endif -#ifdef EDOM -init_errno (EDOM, "EDOM") -#endif -#ifdef EDOTDOT -init_errno (EDOTDOT, "EDOTDOT") -#endif -#ifdef EDQUOT -init_errno (EDQUOT, "EDQUOT") -#endif -#ifdef EEXIST -init_errno (EEXIST, "EEXIST") -#endif -#ifdef EFAULT -init_errno (EFAULT, "EFAULT") -#endif -#ifdef EFBIG -init_errno (EFBIG, "EFBIG") -#endif -#ifdef EFTYPE -init_errno (EFTYPE, "EFTYPE") -#endif -#ifdef EHOSTDOWN -init_errno (EHOSTDOWN, "EHOSTDOWN") -#endif -#ifdef EHOSTUNREACH -init_errno (EHOSTUNREACH, "EHOSTUNREACH") -#endif -#ifdef EIDRM -init_errno (EIDRM, "EIDRM") -#endif -#ifdef EILSEQ -init_errno (EILSEQ, "EILSEQ") -#endif -#ifdef EINPROGRESS -init_errno (EINPROGRESS, "EINPROGRESS") -#endif -#ifdef EINTR -init_errno (EINTR, "EINTR") -#endif -#ifdef EINVAL -init_errno (EINVAL, "EINVAL") -#endif -#ifdef EIO -init_errno (EIO, "EIO") -#endif -#ifdef EISCONN -init_errno (EISCONN, "EISCONN") -#endif -#ifdef EISDIR -init_errno (EISDIR, "EISDIR") -#endif -#ifdef EISNAM -init_errno (EISNAM, "EISNAM") -#endif -#ifdef EKEYEXPIRED -init_errno (EKEYEXPIRED, "EKEYEXPIRED") -#endif -#ifdef EKEYREJECTED -init_errno (EKEYREJECTED, "EKEYREJECTED") -#endif -#ifdef EKEYREVOKED -init_errno (EKEYREVOKED, "EKEYREVOKED") -#endif -#ifdef EL2HLT -init_errno (EL2HLT, "EL2HLT") -#endif -#ifdef EL2NSYNC -init_errno (EL2NSYNC, "EL2NSYNC") -#endif -#ifdef EL3HLT -init_errno (EL3HLT, "EL3HLT") -#endif -#ifdef EL3RST -init_errno (EL3RST, "EL3RST") -#endif -#ifdef ELAST -init_errno (ELAST, "ELAST") -#endif -#ifdef ELIBACC -init_errno (ELIBACC, "ELIBACC") -#endif -#ifdef ELIBBAD -init_errno (ELIBBAD, "ELIBBAD") -#endif -#ifdef ELIBEXEC -init_errno (ELIBEXEC, "ELIBEXEC") -#endif -#ifdef ELIBMAX -init_errno (ELIBMAX, "ELIBMAX") -#endif -#ifdef ELIBSCN -init_errno (ELIBSCN, "ELIBSCN") -#endif -#ifdef ELNRNG -init_errno (ELNRNG, "ELNRNG") -#endif -#ifdef ELOOP -init_errno (ELOOP, "ELOOP") -#endif -#ifdef EMEDIUMTYPE -init_errno (EMEDIUMTYPE, "EMEDIUMTYPE") -#endif -#ifdef EMFILE -init_errno (EMFILE, "EMFILE") -#endif -#ifdef EMLINK -init_errno (EMLINK, "EMLINK") -#endif -#ifdef EMSGSIZE -init_errno (EMSGSIZE, "EMSGSIZE") -#endif -#ifdef EMULTIHOP -init_errno (EMULTIHOP, "EMULTIHOP") -#endif -#ifdef ENAMETOOLONG -init_errno (ENAMETOOLONG, "ENAMETOOLONG") -#endif -#ifdef ENAVAIL -init_errno (ENAVAIL, "ENAVAIL") -#endif -#ifdef ENEEDAUTH -init_errno (ENEEDAUTH, "ENEEDAUTH") -#endif -#ifdef ENETDOWN -init_errno (ENETDOWN, "ENETDOWN") -#endif -#ifdef ENETRESET -init_errno (ENETRESET, "ENETRESET") -#endif -#ifdef ENETUNREACH -init_errno (ENETUNREACH, "ENETUNREACH") -#endif -#ifdef ENFILE -init_errno (ENFILE, "ENFILE") -#endif -#ifdef ENOANO -init_errno (ENOANO, "ENOANO") -#endif -#ifdef ENOBUFS -init_errno (ENOBUFS, "ENOBUFS") -#endif -#ifdef ENOCSI -init_errno (ENOCSI, "ENOCSI") -#endif -#ifdef ENODATA -init_errno (ENODATA, "ENODATA") -#endif -#ifdef ENODEV -init_errno (ENODEV, "ENODEV") -#endif -#ifdef ENOENT -init_errno (ENOENT, "ENOENT") -#endif -#ifdef ENOEXEC -init_errno (ENOEXEC, "ENOEXEC") -#endif -#ifdef ENOKEY -init_errno (ENOKEY, "ENOKEY") -#endif -#ifdef ENOLCK -init_errno (ENOLCK, "ENOLCK") -#endif -#ifdef ENOLINK -init_errno (ENOLINK, "ENOLINK") -#endif -#ifdef ENOMEDIUM -init_errno (ENOMEDIUM, "ENOMEDIUM") -#endif -#ifdef ENOMEM -init_errno (ENOMEM, "ENOMEM") -#endif -#ifdef ENOMSG -init_errno (ENOMSG, "ENOMSG") -#endif -#ifdef ENONET -init_errno (ENONET, "ENONET") -#endif -#ifdef ENOPKG -init_errno (ENOPKG, "ENOPKG") -#endif -#ifdef ENOPROTOOPT -init_errno (ENOPROTOOPT, "ENOPROTOOPT") -#endif -#ifdef ENOSPC -init_errno (ENOSPC, "ENOSPC") -#endif -#ifdef ENOSR -init_errno (ENOSR, "ENOSR") -#endif -#ifdef ENOSTR -init_errno (ENOSTR, "ENOSTR") -#endif -#ifdef ENOSYS -init_errno (ENOSYS, "ENOSYS") -#endif -#ifdef ENOTBLK -init_errno (ENOTBLK, "ENOTBLK") -#endif -#ifdef ENOTCONN -init_errno (ENOTCONN, "ENOTCONN") -#endif -#ifdef ENOTDIR -init_errno (ENOTDIR, "ENOTDIR") -#endif -#ifdef ENOTEMPTY -init_errno (ENOTEMPTY, "ENOTEMPTY") -#endif -#ifdef ENOTNAM -init_errno (ENOTNAM, "ENOTNAM") -#endif -#ifdef ENOTRECOVERABLE -init_errno (ENOTRECOVERABLE, "ENOTRECOVERABLE") -#endif -#ifdef ENOTSOCK -init_errno (ENOTSOCK, "ENOTSOCK") -#endif -#ifdef ENOTTY -init_errno (ENOTTY, "ENOTTY") -#endif -#ifdef ENOTUNIQ -init_errno (ENOTUNIQ, "ENOTUNIQ") -#endif -#ifdef ENXIO -init_errno (ENXIO, "ENXIO") -#endif -#ifdef EOPNOTSUPP -init_errno (EOPNOTSUPP, "EOPNOTSUPP") -#endif -#ifdef EOVERFLOW -init_errno (EOVERFLOW, "EOVERFLOW") -#endif -#ifdef EOWNERDEAD -init_errno (EOWNERDEAD, "EOWNERDEAD") -#endif -#ifdef EPERM -init_errno (EPERM, "EPERM") -#endif -#ifdef EPFNOSUPPORT -init_errno (EPFNOSUPPORT, "EPFNOSUPPORT") -#endif -#ifdef EPIPE -init_errno (EPIPE, "EPIPE") -#endif -#ifdef EPROCLIM -init_errno (EPROCLIM, "EPROCLIM") -#endif -#ifdef EPROCUNAVAIL -init_errno (EPROCUNAVAIL, "EPROCUNAVAIL") -#endif -#ifdef EPROGMISMATCH -init_errno (EPROGMISMATCH, "EPROGMISMATCH") -#endif -#ifdef EPROGUNAVAIL -init_errno (EPROGUNAVAIL, "EPROGUNAVAIL") -#endif -#ifdef EPROTO -init_errno (EPROTO, "EPROTO") -#endif -#ifdef EPROTONOSUPPORT -init_errno (EPROTONOSUPPORT, "EPROTONOSUPPORT") -#endif -#ifdef EPROTOTYPE -init_errno (EPROTOTYPE, "EPROTOTYPE") -#endif -#ifdef ERANGE -init_errno (ERANGE, "ERANGE") -#endif -#ifdef EREMCHG -init_errno (EREMCHG, "EREMCHG") -#endif -#ifdef EREMOTE -init_errno (EREMOTE, "EREMOTE") -#endif -#ifdef EREMOTEIO -init_errno (EREMOTEIO, "EREMOTEIO") -#endif -#ifdef ERESTART -init_errno (ERESTART, "ERESTART") -#endif -#ifdef ERFKILL -init_errno (ERFKILL, "ERFKILL") -#endif -#ifdef EROFS -init_errno (EROFS, "EROFS") -#endif -#ifdef ERPCMISMATCH -init_errno (ERPCMISMATCH, "ERPCMISMATCH") -#endif -#ifdef ESHUTDOWN -init_errno (ESHUTDOWN, "ESHUTDOWN") -#endif -#ifdef ESOCKTNOSUPPORT -init_errno (ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT") -#endif -#ifdef ESPIPE -init_errno (ESPIPE, "ESPIPE") -#endif -#ifdef ESRCH -init_errno (ESRCH, "ESRCH") -#endif -#ifdef ESRMNT -init_errno (ESRMNT, "ESRMNT") -#endif -#ifdef ESTALE -init_errno (ESTALE, "ESTALE") -#endif -#ifdef ESTRPIPE -init_errno (ESTRPIPE, "ESTRPIPE") -#endif -#ifdef ETIME -init_errno (ETIME, "ETIME") -#endif -#ifdef ETIMEDOUT -init_errno (ETIMEDOUT, "ETIMEDOUT") -#endif -#ifdef ETOOMANYREFS -init_errno (ETOOMANYREFS, "ETOOMANYREFS") -#endif -#ifdef ETXTBSY -init_errno (ETXTBSY, "ETXTBSY") -#endif -#ifdef EUCLEAN -init_errno (EUCLEAN, "EUCLEAN") -#endif -#ifdef EUNATCH -init_errno (EUNATCH, "EUNATCH") -#endif -#ifdef EUSERS -init_errno (EUSERS, "EUSERS") -#endif -#ifdef EWOULDBLOCK -#if !defined(EAGAIN) || (EWOULDBLOCK != EAGAIN) -init_errno (EWOULDBLOCK, "EWOULDBLOCK") -#endif -#endif -#ifdef EXDEV -init_errno (EXDEV, "EXDEV") -#endif -#ifdef EXFULL -init_errno (EXFULL, "EXFULL") -#endif diff --git a/extension/errno.c b/extension/errno.c deleted file mode 100644 index 5dc15d79..00000000 --- a/extension/errno.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * errno.c - Builtin functions to map errno values. - */ - -/* - * Copyright (C) 2013 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "gawkapi.h" - -#include "gettext.h" -#define _(msgid) gettext(msgid) -#define N_(msgid) msgid - -static const gawk_api_t *api; /* for convenience macros to work */ -static awk_ext_id_t *ext_id; -static const char *ext_version = "errno extension: version 1.0"; -static awk_bool_t (*init_func)(void) = NULL; - -int plugin_is_GPL_compatible; - -static const char *const errno2name[] = { -#define init_errno(A, B) [A] = B, -#include "errlist.h" -#undef init_errno -}; -#define NUMERR sizeof(errno2name)/sizeof(errno2name[0]) - -/* do_strerror --- call strerror */ - -static awk_value_t * -do_strerror(int nargs, awk_value_t *result) -{ - awk_value_t errnum; - - if (do_lint && nargs > 1) - lintwarn(ext_id, _("strerror: called with too many arguments")); - - if (get_argument(0, AWK_NUMBER, & errnum)) { - const char *str = gettext(strerror(errnum.num_value)); - return make_const_string(str, strlen(str), result); - } - if (do_lint) { - if (nargs == 0) - lintwarn(ext_id, _("strerror: called with no arguments")); - else - lintwarn(ext_id, _("strerror: called with inappropriate argument(s)")); - } - return make_null_string(result); -} - -/* do_errno2name --- convert an integer errno value to it's symbolic name */ - -static awk_value_t * -do_errno2name(int nargs, awk_value_t *result) -{ - awk_value_t errnum; - - if (do_lint && nargs > 1) - lintwarn(ext_id, _("errno2name: called with too many arguments")); - - if (get_argument(0, AWK_NUMBER, & errnum)) { - int i = errnum.num_value; - - if ((i == errnum.num_value) && (i >= 0) && ((size_t)i < NUMERR) && errno2name[i]) - return make_const_string(errno2name[i], strlen(errno2name[i]), result); - warning(ext_id, _("errno2name: called with invalid argument")); - } else if (do_lint) { - if (nargs == 0) - lintwarn(ext_id, _("errno2name: called with no arguments")); - else - lintwarn(ext_id, _("errno2name: called with inappropriate argument(s)")); - } - return make_null_string(result); -} - -/* do_name2errno --- convert a symbolic errno name to an integer */ - -static awk_value_t * -do_name2errno(int nargs, awk_value_t *result) -{ - awk_value_t err; - - if (do_lint && nargs > 1) - lintwarn(ext_id, _("name2errno: called with too many arguments")); - - if (get_argument(0, AWK_STRING, & err)) { - size_t i; - - for (i = 0; i < NUMERR; i++) { - if (errno2name[i] && ! strcasecmp(err.str_value.str, errno2name[i])) - return make_number(i, result); - } - warning(ext_id, _("name2errno: called with invalid argument")); - } else if (do_lint) { - if (nargs == 0) - lintwarn(ext_id, _("name2errno: called with no arguments")); - else - lintwarn(ext_id, _("name2errno: called with inappropriate argument(s)")); - } - return make_number(-1, result); -} - -static awk_ext_func_t func_table[] = { - { "strerror", do_strerror, 1 }, - { "errno2name", do_errno2name, 1 }, - { "name2errno", do_name2errno, 1 }, -}; - -/* define the dl_load function using the boilerplate macro */ - -dl_load_func(func_table, errno, "") -- cgit v1.2.3 From dcaab6dd8a28be8885ccc508c49b962a61ab09fe Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 20 Dec 2014 19:56:44 +0200 Subject: Start at non-fatal output via PROCINFO. --- ChangeLog | 16 ++++++++++++++++ awk.h | 1 + builtin.c | 28 ++++++++++++++++++++++------ io.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 86 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index a9c7e555..35d73180 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2014-12-20 Arnold D. Robbins + + Enable non-fatal output on per-file or global basis, + via PROCINFO. + + * awk.h (RED_NON_FATAL): New redirection flag. + * builtin.c (efwrite): If RED_NON_FATAL set, just set ERRNO and return. + (do_printf): Check errflg and if set, set ERRNO and return. + (do_print): Ditto. + (do_print_rec): Ditto. + * io.c (redflags2str): Update table. + (redirect): Check for global PROCINFO["nonfatal"] or for + PROCINFO[file, "nonfatal"] and don't fail on open if set. + Add RED_NON_FATAL to flags. + (in_PROCINFO): Make smarter and more general. + 2014-12-12 Stephen Davies Improve comment handling in pretty printing. diff --git a/awk.h b/awk.h index 41181529..ff3499cd 100644 --- a/awk.h +++ b/awk.h @@ -918,6 +918,7 @@ struct redirect { # define RED_PTY 512 # define RED_SOCKET 1024 # define RED_TCP 2048 +# define RED_NON_FATAL 4096 char *value; FILE *ifp; /* input fp, needed for PIPES_SIMULATED */ IOBUF *iop; diff --git a/builtin.c b/builtin.c index 21c6ed5c..b3f3f333 100644 --- a/builtin.c +++ b/builtin.c @@ -130,9 +130,12 @@ wrerror: gawk_exit(EXIT_FATAL); /* otherwise die verbosely */ - fatal(_("%s to \"%s\" failed (%s)"), from, - rp ? rp->value : _("standard output"), - errno ? strerror(errno) : _("reason unknown")); + if ((rp->flag & RED_NON_FATAL) != 0) { + update_ERRNO_int(errno); + } else + fatal(_("%s to \"%s\" failed (%s)"), from, + rp ? rp->value : _("standard output"), + errno ? strerror(errno) : _("reason unknown")); } /* do_exp --- exponential function */ @@ -1633,7 +1636,7 @@ do_printf(int nargs, int redirtype) FILE *fp = NULL; NODE *tmp; struct redirect *rp = NULL; - int errflg; /* not used, sigh */ + int errflg = 0; NODE *redir_exp = NULL; if (nargs == 0) { @@ -1660,6 +1663,10 @@ do_printf(int nargs, int redirtype) rp = redirect(redir_exp, redirtype, & errflg); if (rp != NULL) fp = rp->output.fp; + else if (errflg) { + update_ERRNO_int(errflg); + return; + } } else if (do_debug) /* only the debugger can change the default output */ fp = output_fp; else @@ -2072,7 +2079,7 @@ void do_print(int nargs, int redirtype) { struct redirect *rp = NULL; - int errflg; /* not used, sigh */ + int errflg = 0; FILE *fp = NULL; int i; NODE *redir_exp = NULL; @@ -2087,6 +2094,10 @@ do_print(int nargs, int redirtype) rp = redirect(redir_exp, redirtype, & errflg); if (rp != NULL) fp = rp->output.fp; + else if (errflg) { + update_ERRNO_int(errflg); + return; + } } else if (do_debug) /* only the debugger can change the default output */ fp = output_fp; else @@ -2142,7 +2153,7 @@ do_print_rec(int nargs, int redirtype) FILE *fp = NULL; NODE *f0; struct redirect *rp = NULL; - int errflg; /* not used, sigh */ + int errflg = 0; NODE *redir_exp = NULL; assert(nargs == 0); @@ -2162,6 +2173,11 @@ do_print_rec(int nargs, int redirtype) if (! field0_valid) (void) get_field(0L, NULL); /* rebuild record */ + if (errflg) { + update_ERRNO_int(errflg); + return; + } + f0 = fields_arr[0]; if (do_lint && (f0->flags & NULL_FIELD) != 0) diff --git a/io.c b/io.c index 1d15d887..b4688c89 100644 --- a/io.c +++ b/io.c @@ -718,6 +718,7 @@ redflags2str(int flags) { RED_PTY, "RED_PTY" }, { RED_SOCKET, "RED_SOCKET" }, { RED_TCP, "RED_TCP" }, + { RED_NON_FATAL, "RED_NON_FATAL" }, { 0, NULL } }; @@ -744,6 +745,8 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) static struct redirect *save_rp = NULL; /* hold onto rp that should * be freed for reuse */ + bool is_output = false; + bool is_non_fatal = false; if (do_sandbox) fatal(_("redirection not allowed in sandbox mode")); @@ -753,6 +756,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) tflag = RED_APPEND; /* FALL THROUGH */ case redirect_output: + is_output = true; outflag = (RED_FILE|RED_WRITE); tflag |= outflag; if (redirtype == redirect_output) @@ -761,6 +765,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) what = ">>"; break; case redirect_pipe: + is_output = true; tflag = (RED_PIPE|RED_WRITE); what = "|"; break; @@ -773,6 +778,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) what = "<"; break; case redirect_twoway: + is_output = true; tflag = (RED_READ|RED_WRITE|RED_TWOWAY); what = "|&"; break; @@ -794,6 +800,14 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) lintwarn(_("filename `%s' for `%s' redirection may be result of logical expression"), str, what); + /* input files/pipes are automatically nonfatal */ + if (is_output) { + is_non_fatal = (in_PROCINFO("nonfatal", NULL, NULL) != NULL + || in_PROCINFO(str, "nonfatal", NULL) != NULL); + if (is_non_fatal) + tflag |= RED_NON_FATAL; + } + #ifdef HAVE_SOCKETS /* * Use /inet4 to force IPv4, /inet6 to force IPv6, and plain @@ -892,6 +906,12 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) (void) flush_io(); os_restore_mode(fileno(stdin)); + /* + * Don't check is_non_fatal; see input pipe below. + * Note that the failure happens upon failure to fork, + * using a non-existant program will still succeed the + * popen(). + */ if ((rp->output.fp = popen(str, binmode("w"))) == NULL) fatal(_("can't open pipe `%s' for output (%s)"), str, strerror(errno)); @@ -932,6 +952,10 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) *errflg = errno; /* do not free rp, saving it for reuse (save_rp = rp) */ return NULL; + } else if (is_non_fatal) { + *errflg = errno; + /* do not free rp, saving it for reuse (save_rp = rp) */ + return NULL; } else #endif fatal(_("can't open two way pipe `%s' for input/output (%s)"), @@ -1009,11 +1033,14 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) * can return -1. For output to file, * complain. The shell will complain on * a bad command to a pipe. + * + * 12/2014: Take nonfatal settings in PROCINFO into account. */ if (errflg != NULL) *errflg = errno; - if ( redirtype == redirect_output - || redirtype == redirect_append) { + if (! is_non_fatal && + (redirtype == redirect_output + || redirtype == redirect_append)) { /* multiple messages make life easier for translators */ if (*direction == 'f') fatal(_("can't redirect from `%s' (%s)"), @@ -3799,12 +3826,21 @@ in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx) NODE *r, *sub = NULL; NODE *subsep = SUBSEP_node->var_value; + if (PROCINFO_node == NULL || (pidx1 == NULL && pidx2 == NULL)) + return NULL; + /* full_idx is in+out parameter */ if (full_idx) sub = *full_idx; - str_len = strlen(pidx1) + subsep->stlen + strlen(pidx2); + if (pidx1 != NULL && pidx2 == NULL) + str_len = strlen(pidx1); + else if (pidx1 == NULL && pidx2 != NULL) + str_len = strlen(pidx2); + else + str_len = strlen(pidx1) + subsep->stlen + strlen(pidx2); + if (sub == NULL) { emalloc(str, char *, str_len + 1, "in_PROCINFO"); sub = make_str_node(str, str_len, ALREADY_MALLOCED); @@ -3818,8 +3854,14 @@ in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx) sub->stlen = str_len; } - sprintf(sub->stptr, "%s%.*s%s", pidx1, (int)subsep->stlen, - subsep->stptr, pidx2); + if (pidx1 != NULL && pidx2 == NULL) + strcpy(sub->stptr, pidx1); + else if (pidx1 == NULL && pidx2 != NULL) + strcpy(sub->stptr, pidx2); + else + sprintf(sub->stptr, "%s%.*s%s", pidx1, (int)subsep->stlen, + subsep->stptr, pidx2); + r = in_array(PROCINFO_node, sub); if (! full_idx) unref(sub); -- cgit v1.2.3 From 06e47b84ed3eb2ec562ee9910d192853f351a0bc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 19:39:05 +0200 Subject: Update foreword from Mike Brennan. --- doc/ChangeLog | 4 + doc/gawk.info | 1109 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 3 + doc/gawktexi.in | 3 + 4 files changed, 566 insertions(+), 553 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index ede811ef..47dd656f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-24 Arnold D. Robbins + + * gawktexi.in: Add one more paragraph to new foreword. + 2014-12-12 Arnold D. Robbins * gawktexi.in: Minor fix. diff --git a/doc/gawk.info b/doc/gawk.info index d6fccecd..0224c7d5 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -797,6 +797,9 @@ module loads the C/C++ module as a dynamic plug-in. *note Dynamic Extensions::, has all the details, and as expected, many examples to help you learn the ins and outs. + I enjoy programming in AWK and had fun (re)reading this book. I +think you will too. + Michael Brennan Author of `mawk' October 2014 @@ -31853,7 +31856,7 @@ Index * Brennan, Michael <2>: Simple Sed. (line 25) * Brennan, Michael <3>: Delete. (line 56) * Brennan, Michael <4>: Acknowledgments. (line 78) -* Brennan, Michael <5>: Foreword4. (line 30) +* Brennan, Michael <5>: Foreword4. (line 33) * Brennan, Michael: Foreword3. (line 84) * Brian Kernighan's awk <1>: I/O Functions. (line 43) * Brian Kernighan's awk <2>: Gory Details. (line 19) @@ -34299,557 +34302,557 @@ Tag Table: Node: Top1204 Node: Foreword342156 Node: Foreword446598 -Node: Preface48031 -Ref: Preface-Footnote-150902 -Ref: Preface-Footnote-251009 -Ref: Preface-Footnote-351242 -Node: History51384 -Node: Names53730 -Ref: Names-Footnote-154824 -Node: This Manual54970 -Ref: This Manual-Footnote-161457 -Node: Conventions61557 -Node: Manual History63895 -Ref: Manual History-Footnote-166877 -Ref: Manual History-Footnote-266918 -Node: How To Contribute66992 -Node: Acknowledgments68121 -Node: Getting Started72926 -Node: Running gawk75359 -Node: One-shot76549 -Node: Read Terminal77797 -Node: Long79824 -Node: Executable Scripts81340 -Ref: Executable Scripts-Footnote-184129 -Node: Comments84232 -Node: Quoting86714 -Node: DOS Quoting92238 -Node: Sample Data Files92913 -Node: Very Simple95508 -Node: Two Rules100406 -Node: More Complex102292 -Node: Statements/Lines105154 -Ref: Statements/Lines-Footnote-1109609 -Node: Other Features109874 -Node: When110805 -Ref: When-Footnote-1112559 -Node: Intro Summary112624 -Node: Invoking Gawk113507 -Node: Command Line115021 -Node: Options115819 -Ref: Options-Footnote-1131752 -Ref: Options-Footnote-2131981 -Node: Other Arguments132006 -Node: Naming Standard Input134954 -Node: Environment Variables136047 -Node: AWKPATH Variable136605 -Ref: AWKPATH Variable-Footnote-1139908 -Ref: AWKPATH Variable-Footnote-2139953 -Node: AWKLIBPATH Variable140213 -Node: Other Environment Variables141356 -Node: Exit Status145084 -Node: Include Files145760 -Node: Loading Shared Libraries149357 -Node: Obsolete150784 -Node: Undocumented151481 -Node: Invoking Summary151748 -Node: Regexp153412 -Node: Regexp Usage154866 -Node: Escape Sequences156903 -Node: Regexp Operators162914 -Ref: Regexp Operators-Footnote-1170340 -Ref: Regexp Operators-Footnote-2170487 -Node: Bracket Expressions170585 -Ref: table-char-classes172600 -Node: Leftmost Longest175524 -Node: Computed Regexps176826 -Node: GNU Regexp Operators180223 -Node: Case-sensitivity183896 -Ref: Case-sensitivity-Footnote-1186781 -Ref: Case-sensitivity-Footnote-2187016 -Node: Regexp Summary187124 -Node: Reading Files188591 -Node: Records190685 -Node: awk split records191418 -Node: gawk split records196333 -Ref: gawk split records-Footnote-1200877 -Node: Fields200914 -Ref: Fields-Footnote-1203690 -Node: Nonconstant Fields203776 -Ref: Nonconstant Fields-Footnote-1206019 -Node: Changing Fields206223 -Node: Field Separators212152 -Node: Default Field Splitting214857 -Node: Regexp Field Splitting215974 -Node: Single Character Fields219324 -Node: Command Line Field Separator220383 -Node: Full Line Fields223595 -Ref: Full Line Fields-Footnote-1225112 -Ref: Full Line Fields-Footnote-2225158 -Node: Field Splitting Summary225259 -Node: Constant Size227333 -Node: Splitting By Content231922 -Ref: Splitting By Content-Footnote-1235916 -Node: Multiple Line236079 -Ref: Multiple Line-Footnote-1241965 -Node: Getline242144 -Node: Plain Getline244356 -Node: Getline/Variable246996 -Node: Getline/File248144 -Node: Getline/Variable/File249528 -Ref: Getline/Variable/File-Footnote-1251131 -Node: Getline/Pipe251218 -Node: Getline/Variable/Pipe253901 -Node: Getline/Coprocess255032 -Node: Getline/Variable/Coprocess256284 -Node: Getline Notes257023 -Node: Getline Summary259815 -Ref: table-getline-variants260227 -Node: Read Timeout261056 -Ref: Read Timeout-Footnote-1264881 -Node: Command-line directories264939 -Node: Input Summary265844 -Node: Input Exercises269145 -Node: Printing269873 -Node: Print271650 -Node: Print Examples273107 -Node: Output Separators275886 -Node: OFMT277904 -Node: Printf279258 -Node: Basic Printf280043 -Node: Control Letters281613 -Node: Format Modifiers285596 -Node: Printf Examples291605 -Node: Redirection294091 -Node: Special FD300932 -Ref: Special FD-Footnote-1304092 -Node: Special Files304166 -Node: Other Inherited Files304783 -Node: Special Network305783 -Node: Special Caveats306645 -Node: Close Files And Pipes307596 -Ref: Close Files And Pipes-Footnote-1314778 -Ref: Close Files And Pipes-Footnote-2314926 -Node: Output Summary315076 -Node: Output Exercises316074 -Node: Expressions316754 -Node: Values317939 -Node: Constants318617 -Node: Scalar Constants319308 -Ref: Scalar Constants-Footnote-1320167 -Node: Nondecimal-numbers320417 -Node: Regexp Constants323435 -Node: Using Constant Regexps323960 -Node: Variables327103 -Node: Using Variables327758 -Node: Assignment Options329669 -Node: Conversion331544 -Node: Strings And Numbers332068 -Ref: Strings And Numbers-Footnote-1335133 -Node: Locale influences conversions335242 -Ref: table-locale-affects337989 -Node: All Operators338577 -Node: Arithmetic Ops339207 -Node: Concatenation341712 -Ref: Concatenation-Footnote-1344531 -Node: Assignment Ops344637 -Ref: table-assign-ops349616 -Node: Increment Ops350888 -Node: Truth Values and Conditions354326 -Node: Truth Values355411 -Node: Typing and Comparison356460 -Node: Variable Typing357270 -Node: Comparison Operators360923 -Ref: table-relational-ops361333 -Node: POSIX String Comparison364828 -Ref: POSIX String Comparison-Footnote-1365900 -Node: Boolean Ops366038 -Ref: Boolean Ops-Footnote-1370517 -Node: Conditional Exp370608 -Node: Function Calls372335 -Node: Precedence376215 -Node: Locales379876 -Node: Expressions Summary381508 -Node: Patterns and Actions384068 -Node: Pattern Overview385188 -Node: Regexp Patterns386867 -Node: Expression Patterns387410 -Node: Ranges391120 -Node: BEGIN/END394226 -Node: Using BEGIN/END394987 -Ref: Using BEGIN/END-Footnote-1397721 -Node: I/O And BEGIN/END397827 -Node: BEGINFILE/ENDFILE400141 -Node: Empty403042 -Node: Using Shell Variables403359 -Node: Action Overview405632 -Node: Statements407958 -Node: If Statement409806 -Node: While Statement411301 -Node: Do Statement413330 -Node: For Statement414474 -Node: Switch Statement417631 -Node: Break Statement420013 -Node: Continue Statement422054 -Node: Next Statement423881 -Node: Nextfile Statement426262 -Node: Exit Statement428892 -Node: Built-in Variables431295 -Node: User-modified432428 -Ref: User-modified-Footnote-1440109 -Node: Auto-set440171 -Ref: Auto-set-Footnote-1453206 -Ref: Auto-set-Footnote-2453411 -Node: ARGC and ARGV453467 -Node: Pattern Action Summary457685 -Node: Arrays460112 -Node: Array Basics461441 -Node: Array Intro462285 -Ref: figure-array-elements464249 -Ref: Array Intro-Footnote-1466775 -Node: Reference to Elements466903 -Node: Assigning Elements469355 -Node: Array Example469846 -Node: Scanning an Array471604 -Node: Controlling Scanning474620 -Ref: Controlling Scanning-Footnote-1479816 -Node: Numeric Array Subscripts480132 -Node: Uninitialized Subscripts482317 -Node: Delete483934 -Ref: Delete-Footnote-1486677 -Node: Multidimensional486734 -Node: Multiscanning489831 -Node: Arrays of Arrays491420 -Node: Arrays Summary496179 -Node: Functions498271 -Node: Built-in499170 -Node: Calling Built-in500248 -Node: Numeric Functions502239 -Ref: Numeric Functions-Footnote-1506256 -Ref: Numeric Functions-Footnote-2506613 -Ref: Numeric Functions-Footnote-3506661 -Node: String Functions506933 -Ref: String Functions-Footnote-1530408 -Ref: String Functions-Footnote-2530537 -Ref: String Functions-Footnote-3530785 -Node: Gory Details530872 -Ref: table-sub-escapes532653 -Ref: table-sub-proposed534173 -Ref: table-posix-sub535537 -Ref: table-gensub-escapes537073 -Ref: Gory Details-Footnote-1537905 -Node: I/O Functions538056 -Ref: I/O Functions-Footnote-1545274 -Node: Time Functions545421 -Ref: Time Functions-Footnote-1555909 -Ref: Time Functions-Footnote-2555977 -Ref: Time Functions-Footnote-3556135 -Ref: Time Functions-Footnote-4556246 -Ref: Time Functions-Footnote-5556358 -Ref: Time Functions-Footnote-6556585 -Node: Bitwise Functions556851 -Ref: table-bitwise-ops557413 -Ref: Bitwise Functions-Footnote-1561722 -Node: Type Functions561891 -Node: I18N Functions563042 -Node: User-defined564687 -Node: Definition Syntax565492 -Ref: Definition Syntax-Footnote-1570899 -Node: Function Example570970 -Ref: Function Example-Footnote-1573889 -Node: Function Caveats573911 -Node: Calling A Function574429 -Node: Variable Scope575387 -Node: Pass By Value/Reference578375 -Node: Return Statement581870 -Node: Dynamic Typing584851 -Node: Indirect Calls585780 -Ref: Indirect Calls-Footnote-1597082 -Node: Functions Summary597210 -Node: Library Functions599912 -Ref: Library Functions-Footnote-1603521 -Ref: Library Functions-Footnote-2603664 -Node: Library Names603835 -Ref: Library Names-Footnote-1607289 -Ref: Library Names-Footnote-2607512 -Node: General Functions607598 -Node: Strtonum Function608701 -Node: Assert Function611723 -Node: Round Function615047 -Node: Cliff Random Function616588 -Node: Ordinal Functions617604 -Ref: Ordinal Functions-Footnote-1620667 -Ref: Ordinal Functions-Footnote-2620919 -Node: Join Function621130 -Ref: Join Function-Footnote-1622899 -Node: Getlocaltime Function623099 -Node: Readfile Function626843 -Node: Shell Quoting628813 -Node: Data File Management630214 -Node: Filetrans Function630846 -Node: Rewind Function634902 -Node: File Checking636289 -Ref: File Checking-Footnote-1637621 -Node: Empty Files637822 -Node: Ignoring Assigns639801 -Node: Getopt Function641352 -Ref: Getopt Function-Footnote-1652814 -Node: Passwd Functions653014 -Ref: Passwd Functions-Footnote-1661851 -Node: Group Functions661939 -Ref: Group Functions-Footnote-1669833 -Node: Walking Arrays670046 -Node: Library Functions Summary671649 -Node: Library Exercises673050 -Node: Sample Programs674330 -Node: Running Examples675100 -Node: Clones675828 -Node: Cut Program677052 -Node: Egrep Program686771 -Ref: Egrep Program-Footnote-1694269 -Node: Id Program694379 -Node: Split Program698024 -Ref: Split Program-Footnote-1701472 -Node: Tee Program701600 -Node: Uniq Program704389 -Node: Wc Program711808 -Ref: Wc Program-Footnote-1716058 -Node: Miscellaneous Programs716152 -Node: Dupword Program717365 -Node: Alarm Program719396 -Node: Translate Program724200 -Ref: Translate Program-Footnote-1728765 -Node: Labels Program729035 -Ref: Labels Program-Footnote-1732386 -Node: Word Sorting732470 -Node: History Sorting736541 -Node: Extract Program738377 -Node: Simple Sed745902 -Node: Igawk Program748970 -Ref: Igawk Program-Footnote-1763294 -Ref: Igawk Program-Footnote-2763495 -Ref: Igawk Program-Footnote-3763617 -Node: Anagram Program763732 -Node: Signature Program766789 -Node: Programs Summary768036 -Node: Programs Exercises769229 -Ref: Programs Exercises-Footnote-1773360 -Node: Advanced Features773451 -Node: Nondecimal Data775399 -Node: Array Sorting776989 -Node: Controlling Array Traversal777686 -Ref: Controlling Array Traversal-Footnote-1786019 -Node: Array Sorting Functions786137 -Ref: Array Sorting Functions-Footnote-1790026 -Node: Two-way I/O790222 -Ref: Two-way I/O-Footnote-1795167 -Ref: Two-way I/O-Footnote-2795353 -Node: TCP/IP Networking795435 -Node: Profiling798308 -Node: Advanced Features Summary805855 -Node: Internationalization807788 -Node: I18N and L10N809268 -Node: Explaining gettext809954 -Ref: Explaining gettext-Footnote-1814979 -Ref: Explaining gettext-Footnote-2815163 -Node: Programmer i18n815328 -Ref: Programmer i18n-Footnote-1820194 -Node: Translator i18n820243 -Node: String Extraction821037 -Ref: String Extraction-Footnote-1822168 -Node: Printf Ordering822254 -Ref: Printf Ordering-Footnote-1825040 -Node: I18N Portability825104 -Ref: I18N Portability-Footnote-1827559 -Node: I18N Example827622 -Ref: I18N Example-Footnote-1830425 -Node: Gawk I18N830497 -Node: I18N Summary831135 -Node: Debugger832474 -Node: Debugging833496 -Node: Debugging Concepts833937 -Node: Debugging Terms835790 -Node: Awk Debugging838362 -Node: Sample Debugging Session839256 -Node: Debugger Invocation839776 -Node: Finding The Bug841160 -Node: List of Debugger Commands847635 -Node: Breakpoint Control848968 -Node: Debugger Execution Control852664 -Node: Viewing And Changing Data856028 -Node: Execution Stack859406 -Node: Debugger Info861043 -Node: Miscellaneous Debugger Commands865060 -Node: Readline Support870089 -Node: Limitations870981 -Node: Debugging Summary873095 -Node: Arbitrary Precision Arithmetic874263 -Node: Computer Arithmetic875679 -Ref: table-numeric-ranges879277 -Ref: Computer Arithmetic-Footnote-1880136 -Node: Math Definitions880193 -Ref: table-ieee-formats883481 -Ref: Math Definitions-Footnote-1884085 -Node: MPFR features884190 -Node: FP Math Caution885861 -Ref: FP Math Caution-Footnote-1886911 -Node: Inexactness of computations887280 -Node: Inexact representation888239 -Node: Comparing FP Values889596 -Node: Errors accumulate890678 -Node: Getting Accuracy892111 -Node: Try To Round894773 -Node: Setting precision895672 -Ref: table-predefined-precision-strings896356 -Node: Setting the rounding mode898145 -Ref: table-gawk-rounding-modes898509 -Ref: Setting the rounding mode-Footnote-1901964 -Node: Arbitrary Precision Integers902143 -Ref: Arbitrary Precision Integers-Footnote-1905129 -Node: POSIX Floating Point Problems905278 -Ref: POSIX Floating Point Problems-Footnote-1909151 -Node: Floating point summary909189 -Node: Dynamic Extensions911383 -Node: Extension Intro912935 -Node: Plugin License914201 -Node: Extension Mechanism Outline914998 -Ref: figure-load-extension915426 -Ref: figure-register-new-function916906 -Ref: figure-call-new-function917910 -Node: Extension API Description919896 -Node: Extension API Functions Introduction921346 -Node: General Data Types926170 -Ref: General Data Types-Footnote-1931909 -Node: Memory Allocation Functions932208 -Ref: Memory Allocation Functions-Footnote-1935047 -Node: Constructor Functions935143 -Node: Registration Functions936877 -Node: Extension Functions937562 -Node: Exit Callback Functions939859 -Node: Extension Version String941107 -Node: Input Parsers941772 -Node: Output Wrappers951651 -Node: Two-way processors956166 -Node: Printing Messages958370 -Ref: Printing Messages-Footnote-1959446 -Node: Updating `ERRNO'959598 -Node: Requesting Values960338 -Ref: table-value-types-returned961066 -Node: Accessing Parameters962023 -Node: Symbol Table Access963254 -Node: Symbol table by name963768 -Node: Symbol table by cookie965749 -Ref: Symbol table by cookie-Footnote-1969893 -Node: Cached values969956 -Ref: Cached values-Footnote-1973455 -Node: Array Manipulation973546 -Ref: Array Manipulation-Footnote-1974644 -Node: Array Data Types974681 -Ref: Array Data Types-Footnote-1977336 -Node: Array Functions977428 -Node: Flattening Arrays981282 -Node: Creating Arrays988174 -Node: Extension API Variables992945 -Node: Extension Versioning993581 -Node: Extension API Informational Variables995482 -Node: Extension API Boilerplate996547 -Node: Finding Extensions1000356 -Node: Extension Example1000916 -Node: Internal File Description1001688 -Node: Internal File Ops1005755 -Ref: Internal File Ops-Footnote-11017425 -Node: Using Internal File Ops1017565 -Ref: Using Internal File Ops-Footnote-11019948 -Node: Extension Samples1020221 -Node: Extension Sample File Functions1021747 -Node: Extension Sample Fnmatch1029385 -Node: Extension Sample Fork1030876 -Node: Extension Sample Inplace1032091 -Node: Extension Sample Ord1033766 -Node: Extension Sample Readdir1034602 -Ref: table-readdir-file-types1035478 -Node: Extension Sample Revout1036289 -Node: Extension Sample Rev2way1036879 -Node: Extension Sample Read write array1037619 -Node: Extension Sample Readfile1039559 -Node: Extension Sample Time1040654 -Node: Extension Sample API Tests1042003 -Node: gawkextlib1042494 -Node: Extension summary1045152 -Node: Extension Exercises1048841 -Node: Language History1049563 -Node: V7/SVR3.11051219 -Node: SVR41053400 -Node: POSIX1054845 -Node: BTL1056234 -Node: POSIX/GNU1056968 -Node: Feature History1062532 -Node: Common Extensions1075630 -Node: Ranges and Locales1076954 -Ref: Ranges and Locales-Footnote-11081572 -Ref: Ranges and Locales-Footnote-21081599 -Ref: Ranges and Locales-Footnote-31081833 -Node: Contributors1082054 -Node: History summary1087595 -Node: Installation1088965 -Node: Gawk Distribution1089911 -Node: Getting1090395 -Node: Extracting1091218 -Node: Distribution contents1092853 -Node: Unix Installation1098570 -Node: Quick Installation1099187 -Node: Additional Configuration Options1101611 -Node: Configuration Philosophy1103349 -Node: Non-Unix Installation1105718 -Node: PC Installation1106176 -Node: PC Binary Installation1107495 -Node: PC Compiling1109343 -Ref: PC Compiling-Footnote-11112364 -Node: PC Testing1112473 -Node: PC Using1113649 -Node: Cygwin1117764 -Node: MSYS1118587 -Node: VMS Installation1119087 -Node: VMS Compilation1119879 -Ref: VMS Compilation-Footnote-11121101 -Node: VMS Dynamic Extensions1121159 -Node: VMS Installation Details1122843 -Node: VMS Running1125095 -Node: VMS GNV1127931 -Node: VMS Old Gawk1128665 -Node: Bugs1129135 -Node: Other Versions1133018 -Node: Installation summary1139446 -Node: Notes1140502 -Node: Compatibility Mode1141367 -Node: Additions1142149 -Node: Accessing The Source1143074 -Node: Adding Code1144510 -Node: New Ports1150675 -Node: Derived Files1155157 -Ref: Derived Files-Footnote-11160632 -Ref: Derived Files-Footnote-21160666 -Ref: Derived Files-Footnote-31161262 -Node: Future Extensions1161376 -Node: Implementation Limitations1161982 -Node: Extension Design1163230 -Node: Old Extension Problems1164384 -Ref: Old Extension Problems-Footnote-11165901 -Node: Extension New Mechanism Goals1165958 -Ref: Extension New Mechanism Goals-Footnote-11169318 -Node: Extension Other Design Decisions1169507 -Node: Extension Future Growth1171615 -Node: Old Extension Mechanism1172451 -Node: Notes summary1174213 -Node: Basic Concepts1175399 -Node: Basic High Level1176080 -Ref: figure-general-flow1176352 -Ref: figure-process-flow1176951 -Ref: Basic High Level-Footnote-11180180 -Node: Basic Data Typing1180365 -Node: Glossary1183693 -Node: Copying1208851 -Node: GNU Free Documentation License1246407 -Node: Index1271543 +Node: Preface48120 +Ref: Preface-Footnote-150991 +Ref: Preface-Footnote-251098 +Ref: Preface-Footnote-351331 +Node: History51473 +Node: Names53819 +Ref: Names-Footnote-154913 +Node: This Manual55059 +Ref: This Manual-Footnote-161546 +Node: Conventions61646 +Node: Manual History63984 +Ref: Manual History-Footnote-166966 +Ref: Manual History-Footnote-267007 +Node: How To Contribute67081 +Node: Acknowledgments68210 +Node: Getting Started73015 +Node: Running gawk75448 +Node: One-shot76638 +Node: Read Terminal77886 +Node: Long79913 +Node: Executable Scripts81429 +Ref: Executable Scripts-Footnote-184218 +Node: Comments84321 +Node: Quoting86803 +Node: DOS Quoting92327 +Node: Sample Data Files93002 +Node: Very Simple95597 +Node: Two Rules100495 +Node: More Complex102381 +Node: Statements/Lines105243 +Ref: Statements/Lines-Footnote-1109698 +Node: Other Features109963 +Node: When110894 +Ref: When-Footnote-1112648 +Node: Intro Summary112713 +Node: Invoking Gawk113596 +Node: Command Line115110 +Node: Options115908 +Ref: Options-Footnote-1131841 +Ref: Options-Footnote-2132070 +Node: Other Arguments132095 +Node: Naming Standard Input135043 +Node: Environment Variables136136 +Node: AWKPATH Variable136694 +Ref: AWKPATH Variable-Footnote-1139997 +Ref: AWKPATH Variable-Footnote-2140042 +Node: AWKLIBPATH Variable140302 +Node: Other Environment Variables141445 +Node: Exit Status145173 +Node: Include Files145849 +Node: Loading Shared Libraries149446 +Node: Obsolete150873 +Node: Undocumented151570 +Node: Invoking Summary151837 +Node: Regexp153501 +Node: Regexp Usage154955 +Node: Escape Sequences156992 +Node: Regexp Operators163003 +Ref: Regexp Operators-Footnote-1170429 +Ref: Regexp Operators-Footnote-2170576 +Node: Bracket Expressions170674 +Ref: table-char-classes172689 +Node: Leftmost Longest175613 +Node: Computed Regexps176915 +Node: GNU Regexp Operators180312 +Node: Case-sensitivity183985 +Ref: Case-sensitivity-Footnote-1186870 +Ref: Case-sensitivity-Footnote-2187105 +Node: Regexp Summary187213 +Node: Reading Files188680 +Node: Records190774 +Node: awk split records191507 +Node: gawk split records196422 +Ref: gawk split records-Footnote-1200966 +Node: Fields201003 +Ref: Fields-Footnote-1203779 +Node: Nonconstant Fields203865 +Ref: Nonconstant Fields-Footnote-1206108 +Node: Changing Fields206312 +Node: Field Separators212241 +Node: Default Field Splitting214946 +Node: Regexp Field Splitting216063 +Node: Single Character Fields219413 +Node: Command Line Field Separator220472 +Node: Full Line Fields223684 +Ref: Full Line Fields-Footnote-1225201 +Ref: Full Line Fields-Footnote-2225247 +Node: Field Splitting Summary225348 +Node: Constant Size227422 +Node: Splitting By Content232011 +Ref: Splitting By Content-Footnote-1236005 +Node: Multiple Line236168 +Ref: Multiple Line-Footnote-1242054 +Node: Getline242233 +Node: Plain Getline244445 +Node: Getline/Variable247085 +Node: Getline/File248233 +Node: Getline/Variable/File249617 +Ref: Getline/Variable/File-Footnote-1251220 +Node: Getline/Pipe251307 +Node: Getline/Variable/Pipe253990 +Node: Getline/Coprocess255121 +Node: Getline/Variable/Coprocess256373 +Node: Getline Notes257112 +Node: Getline Summary259904 +Ref: table-getline-variants260316 +Node: Read Timeout261145 +Ref: Read Timeout-Footnote-1264970 +Node: Command-line directories265028 +Node: Input Summary265933 +Node: Input Exercises269234 +Node: Printing269962 +Node: Print271739 +Node: Print Examples273196 +Node: Output Separators275975 +Node: OFMT277993 +Node: Printf279347 +Node: Basic Printf280132 +Node: Control Letters281702 +Node: Format Modifiers285685 +Node: Printf Examples291694 +Node: Redirection294180 +Node: Special FD301021 +Ref: Special FD-Footnote-1304181 +Node: Special Files304255 +Node: Other Inherited Files304872 +Node: Special Network305872 +Node: Special Caveats306734 +Node: Close Files And Pipes307685 +Ref: Close Files And Pipes-Footnote-1314867 +Ref: Close Files And Pipes-Footnote-2315015 +Node: Output Summary315165 +Node: Output Exercises316163 +Node: Expressions316843 +Node: Values318028 +Node: Constants318706 +Node: Scalar Constants319397 +Ref: Scalar Constants-Footnote-1320256 +Node: Nondecimal-numbers320506 +Node: Regexp Constants323524 +Node: Using Constant Regexps324049 +Node: Variables327192 +Node: Using Variables327847 +Node: Assignment Options329758 +Node: Conversion331633 +Node: Strings And Numbers332157 +Ref: Strings And Numbers-Footnote-1335222 +Node: Locale influences conversions335331 +Ref: table-locale-affects338078 +Node: All Operators338666 +Node: Arithmetic Ops339296 +Node: Concatenation341801 +Ref: Concatenation-Footnote-1344620 +Node: Assignment Ops344726 +Ref: table-assign-ops349705 +Node: Increment Ops350977 +Node: Truth Values and Conditions354415 +Node: Truth Values355500 +Node: Typing and Comparison356549 +Node: Variable Typing357359 +Node: Comparison Operators361012 +Ref: table-relational-ops361422 +Node: POSIX String Comparison364917 +Ref: POSIX String Comparison-Footnote-1365989 +Node: Boolean Ops366127 +Ref: Boolean Ops-Footnote-1370606 +Node: Conditional Exp370697 +Node: Function Calls372424 +Node: Precedence376304 +Node: Locales379965 +Node: Expressions Summary381597 +Node: Patterns and Actions384157 +Node: Pattern Overview385277 +Node: Regexp Patterns386956 +Node: Expression Patterns387499 +Node: Ranges391209 +Node: BEGIN/END394315 +Node: Using BEGIN/END395076 +Ref: Using BEGIN/END-Footnote-1397810 +Node: I/O And BEGIN/END397916 +Node: BEGINFILE/ENDFILE400230 +Node: Empty403131 +Node: Using Shell Variables403448 +Node: Action Overview405721 +Node: Statements408047 +Node: If Statement409895 +Node: While Statement411390 +Node: Do Statement413419 +Node: For Statement414563 +Node: Switch Statement417720 +Node: Break Statement420102 +Node: Continue Statement422143 +Node: Next Statement423970 +Node: Nextfile Statement426351 +Node: Exit Statement428981 +Node: Built-in Variables431384 +Node: User-modified432517 +Ref: User-modified-Footnote-1440198 +Node: Auto-set440260 +Ref: Auto-set-Footnote-1453295 +Ref: Auto-set-Footnote-2453500 +Node: ARGC and ARGV453556 +Node: Pattern Action Summary457774 +Node: Arrays460201 +Node: Array Basics461530 +Node: Array Intro462374 +Ref: figure-array-elements464338 +Ref: Array Intro-Footnote-1466864 +Node: Reference to Elements466992 +Node: Assigning Elements469444 +Node: Array Example469935 +Node: Scanning an Array471693 +Node: Controlling Scanning474709 +Ref: Controlling Scanning-Footnote-1479905 +Node: Numeric Array Subscripts480221 +Node: Uninitialized Subscripts482406 +Node: Delete484023 +Ref: Delete-Footnote-1486766 +Node: Multidimensional486823 +Node: Multiscanning489920 +Node: Arrays of Arrays491509 +Node: Arrays Summary496268 +Node: Functions498360 +Node: Built-in499259 +Node: Calling Built-in500337 +Node: Numeric Functions502328 +Ref: Numeric Functions-Footnote-1506345 +Ref: Numeric Functions-Footnote-2506702 +Ref: Numeric Functions-Footnote-3506750 +Node: String Functions507022 +Ref: String Functions-Footnote-1530497 +Ref: String Functions-Footnote-2530626 +Ref: String Functions-Footnote-3530874 +Node: Gory Details530961 +Ref: table-sub-escapes532742 +Ref: table-sub-proposed534262 +Ref: table-posix-sub535626 +Ref: table-gensub-escapes537162 +Ref: Gory Details-Footnote-1537994 +Node: I/O Functions538145 +Ref: I/O Functions-Footnote-1545363 +Node: Time Functions545510 +Ref: Time Functions-Footnote-1555998 +Ref: Time Functions-Footnote-2556066 +Ref: Time Functions-Footnote-3556224 +Ref: Time Functions-Footnote-4556335 +Ref: Time Functions-Footnote-5556447 +Ref: Time Functions-Footnote-6556674 +Node: Bitwise Functions556940 +Ref: table-bitwise-ops557502 +Ref: Bitwise Functions-Footnote-1561811 +Node: Type Functions561980 +Node: I18N Functions563131 +Node: User-defined564776 +Node: Definition Syntax565581 +Ref: Definition Syntax-Footnote-1570988 +Node: Function Example571059 +Ref: Function Example-Footnote-1573978 +Node: Function Caveats574000 +Node: Calling A Function574518 +Node: Variable Scope575476 +Node: Pass By Value/Reference578464 +Node: Return Statement581959 +Node: Dynamic Typing584940 +Node: Indirect Calls585869 +Ref: Indirect Calls-Footnote-1597171 +Node: Functions Summary597299 +Node: Library Functions600001 +Ref: Library Functions-Footnote-1603610 +Ref: Library Functions-Footnote-2603753 +Node: Library Names603924 +Ref: Library Names-Footnote-1607378 +Ref: Library Names-Footnote-2607601 +Node: General Functions607687 +Node: Strtonum Function608790 +Node: Assert Function611812 +Node: Round Function615136 +Node: Cliff Random Function616677 +Node: Ordinal Functions617693 +Ref: Ordinal Functions-Footnote-1620756 +Ref: Ordinal Functions-Footnote-2621008 +Node: Join Function621219 +Ref: Join Function-Footnote-1622988 +Node: Getlocaltime Function623188 +Node: Readfile Function626932 +Node: Shell Quoting628902 +Node: Data File Management630303 +Node: Filetrans Function630935 +Node: Rewind Function634991 +Node: File Checking636378 +Ref: File Checking-Footnote-1637710 +Node: Empty Files637911 +Node: Ignoring Assigns639890 +Node: Getopt Function641441 +Ref: Getopt Function-Footnote-1652903 +Node: Passwd Functions653103 +Ref: Passwd Functions-Footnote-1661940 +Node: Group Functions662028 +Ref: Group Functions-Footnote-1669922 +Node: Walking Arrays670135 +Node: Library Functions Summary671738 +Node: Library Exercises673139 +Node: Sample Programs674419 +Node: Running Examples675189 +Node: Clones675917 +Node: Cut Program677141 +Node: Egrep Program686860 +Ref: Egrep Program-Footnote-1694358 +Node: Id Program694468 +Node: Split Program698113 +Ref: Split Program-Footnote-1701561 +Node: Tee Program701689 +Node: Uniq Program704478 +Node: Wc Program711897 +Ref: Wc Program-Footnote-1716147 +Node: Miscellaneous Programs716241 +Node: Dupword Program717454 +Node: Alarm Program719485 +Node: Translate Program724289 +Ref: Translate Program-Footnote-1728854 +Node: Labels Program729124 +Ref: Labels Program-Footnote-1732475 +Node: Word Sorting732559 +Node: History Sorting736630 +Node: Extract Program738466 +Node: Simple Sed745991 +Node: Igawk Program749059 +Ref: Igawk Program-Footnote-1763383 +Ref: Igawk Program-Footnote-2763584 +Ref: Igawk Program-Footnote-3763706 +Node: Anagram Program763821 +Node: Signature Program766878 +Node: Programs Summary768125 +Node: Programs Exercises769318 +Ref: Programs Exercises-Footnote-1773449 +Node: Advanced Features773540 +Node: Nondecimal Data775488 +Node: Array Sorting777078 +Node: Controlling Array Traversal777775 +Ref: Controlling Array Traversal-Footnote-1786108 +Node: Array Sorting Functions786226 +Ref: Array Sorting Functions-Footnote-1790115 +Node: Two-way I/O790311 +Ref: Two-way I/O-Footnote-1795256 +Ref: Two-way I/O-Footnote-2795442 +Node: TCP/IP Networking795524 +Node: Profiling798397 +Node: Advanced Features Summary805944 +Node: Internationalization807877 +Node: I18N and L10N809357 +Node: Explaining gettext810043 +Ref: Explaining gettext-Footnote-1815068 +Ref: Explaining gettext-Footnote-2815252 +Node: Programmer i18n815417 +Ref: Programmer i18n-Footnote-1820283 +Node: Translator i18n820332 +Node: String Extraction821126 +Ref: String Extraction-Footnote-1822257 +Node: Printf Ordering822343 +Ref: Printf Ordering-Footnote-1825129 +Node: I18N Portability825193 +Ref: I18N Portability-Footnote-1827648 +Node: I18N Example827711 +Ref: I18N Example-Footnote-1830514 +Node: Gawk I18N830586 +Node: I18N Summary831224 +Node: Debugger832563 +Node: Debugging833585 +Node: Debugging Concepts834026 +Node: Debugging Terms835879 +Node: Awk Debugging838451 +Node: Sample Debugging Session839345 +Node: Debugger Invocation839865 +Node: Finding The Bug841249 +Node: List of Debugger Commands847724 +Node: Breakpoint Control849057 +Node: Debugger Execution Control852753 +Node: Viewing And Changing Data856117 +Node: Execution Stack859495 +Node: Debugger Info861132 +Node: Miscellaneous Debugger Commands865149 +Node: Readline Support870178 +Node: Limitations871070 +Node: Debugging Summary873184 +Node: Arbitrary Precision Arithmetic874352 +Node: Computer Arithmetic875768 +Ref: table-numeric-ranges879366 +Ref: Computer Arithmetic-Footnote-1880225 +Node: Math Definitions880282 +Ref: table-ieee-formats883570 +Ref: Math Definitions-Footnote-1884174 +Node: MPFR features884279 +Node: FP Math Caution885950 +Ref: FP Math Caution-Footnote-1887000 +Node: Inexactness of computations887369 +Node: Inexact representation888328 +Node: Comparing FP Values889685 +Node: Errors accumulate890767 +Node: Getting Accuracy892200 +Node: Try To Round894862 +Node: Setting precision895761 +Ref: table-predefined-precision-strings896445 +Node: Setting the rounding mode898234 +Ref: table-gawk-rounding-modes898598 +Ref: Setting the rounding mode-Footnote-1902053 +Node: Arbitrary Precision Integers902232 +Ref: Arbitrary Precision Integers-Footnote-1905218 +Node: POSIX Floating Point Problems905367 +Ref: POSIX Floating Point Problems-Footnote-1909240 +Node: Floating point summary909278 +Node: Dynamic Extensions911472 +Node: Extension Intro913024 +Node: Plugin License914290 +Node: Extension Mechanism Outline915087 +Ref: figure-load-extension915515 +Ref: figure-register-new-function916995 +Ref: figure-call-new-function917999 +Node: Extension API Description919985 +Node: Extension API Functions Introduction921435 +Node: General Data Types926259 +Ref: General Data Types-Footnote-1931998 +Node: Memory Allocation Functions932297 +Ref: Memory Allocation Functions-Footnote-1935136 +Node: Constructor Functions935232 +Node: Registration Functions936966 +Node: Extension Functions937651 +Node: Exit Callback Functions939948 +Node: Extension Version String941196 +Node: Input Parsers941861 +Node: Output Wrappers951740 +Node: Two-way processors956255 +Node: Printing Messages958459 +Ref: Printing Messages-Footnote-1959535 +Node: Updating `ERRNO'959687 +Node: Requesting Values960427 +Ref: table-value-types-returned961155 +Node: Accessing Parameters962112 +Node: Symbol Table Access963343 +Node: Symbol table by name963857 +Node: Symbol table by cookie965838 +Ref: Symbol table by cookie-Footnote-1969982 +Node: Cached values970045 +Ref: Cached values-Footnote-1973544 +Node: Array Manipulation973635 +Ref: Array Manipulation-Footnote-1974733 +Node: Array Data Types974770 +Ref: Array Data Types-Footnote-1977425 +Node: Array Functions977517 +Node: Flattening Arrays981371 +Node: Creating Arrays988263 +Node: Extension API Variables993034 +Node: Extension Versioning993670 +Node: Extension API Informational Variables995571 +Node: Extension API Boilerplate996636 +Node: Finding Extensions1000445 +Node: Extension Example1001005 +Node: Internal File Description1001777 +Node: Internal File Ops1005844 +Ref: Internal File Ops-Footnote-11017514 +Node: Using Internal File Ops1017654 +Ref: Using Internal File Ops-Footnote-11020037 +Node: Extension Samples1020310 +Node: Extension Sample File Functions1021836 +Node: Extension Sample Fnmatch1029474 +Node: Extension Sample Fork1030965 +Node: Extension Sample Inplace1032180 +Node: Extension Sample Ord1033855 +Node: Extension Sample Readdir1034691 +Ref: table-readdir-file-types1035567 +Node: Extension Sample Revout1036378 +Node: Extension Sample Rev2way1036968 +Node: Extension Sample Read write array1037708 +Node: Extension Sample Readfile1039648 +Node: Extension Sample Time1040743 +Node: Extension Sample API Tests1042092 +Node: gawkextlib1042583 +Node: Extension summary1045241 +Node: Extension Exercises1048930 +Node: Language History1049652 +Node: V7/SVR3.11051308 +Node: SVR41053489 +Node: POSIX1054934 +Node: BTL1056323 +Node: POSIX/GNU1057057 +Node: Feature History1062621 +Node: Common Extensions1075719 +Node: Ranges and Locales1077043 +Ref: Ranges and Locales-Footnote-11081661 +Ref: Ranges and Locales-Footnote-21081688 +Ref: Ranges and Locales-Footnote-31081922 +Node: Contributors1082143 +Node: History summary1087684 +Node: Installation1089054 +Node: Gawk Distribution1090000 +Node: Getting1090484 +Node: Extracting1091307 +Node: Distribution contents1092942 +Node: Unix Installation1098659 +Node: Quick Installation1099276 +Node: Additional Configuration Options1101700 +Node: Configuration Philosophy1103438 +Node: Non-Unix Installation1105807 +Node: PC Installation1106265 +Node: PC Binary Installation1107584 +Node: PC Compiling1109432 +Ref: PC Compiling-Footnote-11112453 +Node: PC Testing1112562 +Node: PC Using1113738 +Node: Cygwin1117853 +Node: MSYS1118676 +Node: VMS Installation1119176 +Node: VMS Compilation1119968 +Ref: VMS Compilation-Footnote-11121190 +Node: VMS Dynamic Extensions1121248 +Node: VMS Installation Details1122932 +Node: VMS Running1125184 +Node: VMS GNV1128020 +Node: VMS Old Gawk1128754 +Node: Bugs1129224 +Node: Other Versions1133107 +Node: Installation summary1139535 +Node: Notes1140591 +Node: Compatibility Mode1141456 +Node: Additions1142238 +Node: Accessing The Source1143163 +Node: Adding Code1144599 +Node: New Ports1150764 +Node: Derived Files1155246 +Ref: Derived Files-Footnote-11160721 +Ref: Derived Files-Footnote-21160755 +Ref: Derived Files-Footnote-31161351 +Node: Future Extensions1161465 +Node: Implementation Limitations1162071 +Node: Extension Design1163319 +Node: Old Extension Problems1164473 +Ref: Old Extension Problems-Footnote-11165990 +Node: Extension New Mechanism Goals1166047 +Ref: Extension New Mechanism Goals-Footnote-11169407 +Node: Extension Other Design Decisions1169596 +Node: Extension Future Growth1171704 +Node: Old Extension Mechanism1172540 +Node: Notes summary1174302 +Node: Basic Concepts1175488 +Node: Basic High Level1176169 +Ref: figure-general-flow1176441 +Ref: figure-process-flow1177040 +Ref: Basic High Level-Footnote-11180269 +Node: Basic Data Typing1180454 +Node: Glossary1183782 +Node: Copying1208940 +Node: GNU Free Documentation License1246496 +Node: Index1271632  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 3e6fb5d6..a7df2315 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -1269,6 +1269,9 @@ the C/C++ module as a dynamic plug-in. has all the details, and as expected, many examples to help you learn the ins and outs. +I enjoy programming in AWK and had fun (re)reading this book. +I think you will too. + @ifnotdocbook @cindex Brennan, Michael @display diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 61575e42..73471b6d 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -1264,6 +1264,9 @@ the C/C++ module as a dynamic plug-in. has all the details, and as expected, many examples to help you learn the ins and outs. +I enjoy programming in AWK and had fun (re)reading this book. +I think you will too. + @ifnotdocbook @cindex Brennan, Michael @display -- cgit v1.2.3 From ba81a835d78656b966a81e3426af82ee903f97de Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:23:32 +0200 Subject: Typo in exponentiation fix in manual. --- doc/ChangeLog | 2 ++ doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 47dd656f..eb7a04b3 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,8 @@ 2014-12-24 Arnold D. Robbins * gawktexi.in: Add one more paragraph to new foreword. + * gawktexi.in: Fix exponentiation in TeX mode. Thanks to + Marco Curreli by way of Antonio Giovanni. 2014-12-12 Arnold D. Robbins diff --git a/doc/gawk.texi b/doc/gawk.texi index a7df2315..408bc0c9 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -11844,7 +11844,7 @@ The post-increment @samp{foo++} is nearly the same as writing @samp{(foo not necessarily equal @code{foo}. But the difference is minute as long as you stick to numbers that are fairly small (less than @iftex -@math{10^12}). +@math{10^{12}}). @end iftex @ifnottex @ifnotdocbook diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 73471b6d..54b084bb 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -11231,7 +11231,7 @@ The post-increment @samp{foo++} is nearly the same as writing @samp{(foo not necessarily equal @code{foo}. But the difference is minute as long as you stick to numbers that are fairly small (less than @iftex -@math{10^12}). +@math{10^{12}}). @end iftex @ifnottex @ifnotdocbook -- cgit v1.2.3 From 608116b9826d199c2df99d79fe6c0b39c4febb8b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:24:21 +0200 Subject: Update texinfo.tex. --- doc/ChangeLog | 2 + doc/texinfo.tex | 123 +++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 79 insertions(+), 46 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index eb7a04b3..957e4827 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -4,6 +4,8 @@ * gawktexi.in: Fix exponentiation in TeX mode. Thanks to Marco Curreli by way of Antonio Giovanni. + * texinfo.tex: Updated. + 2014-12-12 Arnold D. Robbins * gawktexi.in: Minor fix. diff --git a/doc/texinfo.tex b/doc/texinfo.tex index 7506dffb..370d4505 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2014-03-18.17} +\def\texinfoversion{2014-12-03.16} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -96,7 +96,9 @@ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ +\let\ptexsp=\sp \let\ptexstar=\* +\let\ptexsup=\sup \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode @@ -1010,24 +1012,15 @@ where each line of input produces a line of output.} % paragraph. % \gdef\dosuppressfirstparagraphindent{% - \gdef\indent{% - \restorefirstparagraphindent - \indent - }% - \gdef\noindent{% - \restorefirstparagraphindent - \noindent - }% - \global\everypar = {% - \kern -\parindent - \restorefirstparagraphindent - }% + \gdef\indent {\restorefirstparagraphindent \indent}% + \gdef\noindent{\restorefirstparagraphindent \noindent}% + \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% } - +% \gdef\restorefirstparagraphindent{% - \global \let \indent = \ptexindent - \global \let \noindent = \ptexnoindent - \global \everypar = {}% + \global\let\indent = \ptexindent + \global\let\noindent = \ptexnoindent + \global\everypar = {}% } @@ -2090,12 +2083,9 @@ end \endgroup } - % In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. Since -% texinfo doesn't allow for producing subscripts and superscripts except -% in the main text, we don't bother to reset \scriptfont and -% \scriptscriptfont (which would also require loading a lot more fonts). +% we have to define the \textfont of the standard families. We don't +% bother to reset \scriptfont and \scriptscriptfont; awaiting user need. % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy @@ -2109,8 +2099,8 @@ end % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) -% and \lllsize (three sizes lower). These relative commands are used in -% the LaTeX logo and acronyms. +% and \lllsize (three sizes lower). These relative commands are used +% in, e.g., the LaTeX logo and acronyms. % % This all needs generalizing, badly. % @@ -2146,7 +2136,7 @@ end \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% - \resetmathfonts \setleading{16pt}} + \resetmathfonts \setleading{17pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc @@ -2851,6 +2841,8 @@ end \let\v=\check \let\~=\tilde \let\dotaccent=\dot + % have to provide another name for sup operator + \let\mathopsup=\sup $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. @@ -2874,6 +2866,18 @@ end } } +% for @sub and @sup, if in math mode, just do a normal sub/superscript. +% If in text, use math to place as sub/superscript, but switch +% into text mode, with smaller fonts. This is a different font than the +% one used for real math sub/superscripts (8pt vs. 7pt), but let's not +% fix it (significant additions to font machinery) until someone notices. +% +\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} +\def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}% +% +\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} +\def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}% + % ctrl is no longer a Texinfo command, but leave this definition for fun. \def\ctrl #1{{\tt \rawbackslash \hat}#1} @@ -5739,13 +5743,16 @@ end % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. +% Not used for @heading series. % % To test against our argument. \def\Ynothingkeyword{Ynothing} -\def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} +\def\Yomitfromtockeyword{Yomitfromtoc} % \def\chapmacro#1#2#3{% + \checkenv{}% chapters, etc., should not start inside an environment. + % % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs @@ -5798,6 +5805,7 @@ end % {% \chapfonts \rmisbold + \let\footnote=\errfootnoteheading % give better error message % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called @@ -5891,22 +5899,29 @@ end % Print any size, any type, section title. % -% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is -% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the -% section number. +% #1 is the text of the title, +% #2 is the section level (sec/subsec/subsubsec), +% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), +% #4 is the section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% - \checkenv{}% should not be in an environment. + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % It is ok for the @heading series commands to appear inside an + % environment (it's been historically allowed, though the logic is + % dubious), but not the others. + \ifx\temptype\Yomitfromtockeyword\else + \checkenv{}% non-@*heading should not be in an environment. + \fi + \let\footnote=\errfootnoteheading % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % - \def\sectionlevel{#2}% - \def\temptype{#3}% - % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword @@ -6333,6 +6348,7 @@ end % other math active characters (just in case), to plain's definitions. \mathactive % + % Inverse of the list at the beginning of the file. \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc @@ -6348,7 +6364,9 @@ end \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash + \let\sp=\ptexsp \let\*=\ptexstar + %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % we've made it outer \let\frenchspacing=\plainfrenchspacing @@ -7414,7 +7432,6 @@ end % % \anythingelse will almost certainly be an error of some kind. - % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. @@ -7523,8 +7540,7 @@ end % the catcode regime underwhich the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more -% arguments, you need that no macro has more than 256 arguments, otherwise an -% error is produced. +% arguments, no macro can have more than 256 arguments (else error). \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax @@ -8359,9 +8375,6 @@ end % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% - \let\indent=\ptexindent - \let\noindent=\ptexnoindent - % \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % @@ -8388,7 +8401,7 @@ end % % Nested footnotes are not supported in TeX, that would take a lot % more work. (\startsavinginserts does not suffice.) - \let\footnote=\errfootnote + \let\footnote=\errfootnotenest % % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. @@ -8427,12 +8440,17 @@ end } }%end \catcode `\@=11 -\def\errfootnote{% +\def\errfootnotenest{% \errhelp=\EMsimple \errmessage{Nested footnotes not supported in texinfo.tex, even though they work in makeinfo; sorry} } +\def\errfootnoteheading{% + \errhelp=\EMsimple + \errmessage{Footnotes in chapters, sections, etc., are not supported} +} + % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. @@ -8856,20 +8874,20 @@ end { \catcode`\_ = \active \globaldefs=1 -\parseargdef\documentlanguage{\begingroup - \let_=\normalunderscore % normal _ character for filenames +\parseargdef\documentlanguage{% \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. + \let_ = \normalunderscore % normal _ character for filename test \openin 1 txi-#1.tex \ifeof 1 - \documentlanguagetrywithoutunderscore{#1_\finish}% + \documentlanguagetrywithoutunderscore #1_\finish \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX -\endgroup} +} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. @@ -9279,6 +9297,18 @@ directory should work if nowhere else does.} \UTFviiiLoop \endgroup +\def\globallet{\global\let} % save some \expandafter's below + +% @U{xxxx} to produce U+xxxx, if we support it. +\def\U#1{% + \expandafter\ifx\csname uni:#1\endcsname \relax + \errhelp = \EMsimple + \errmessage{Unicode character U+#1 not supported, sorry}% + \else + \csname uni:#1\endcsname + \fi +} + \begingroup \catcode`\"=12 \catcode`\<=12 @@ -9287,7 +9317,6 @@ directory should work if nowhere else does.} \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 - \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% @@ -9302,6 +9331,8 @@ directory should work if nowhere else does.} \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% + % define an additional control sequence for this code point. + \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp \endgroup} \gdef\parseXMLCharref{% -- cgit v1.2.3 From 5f4811bd1b91dd3b50a30a227e455738f5dcfe36 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:24:38 +0200 Subject: Update it.po. --- po/it.po | 1174 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 602 insertions(+), 572 deletions(-) diff --git a/po/it.po b/po/it.po index 68f2d7f0..12305a74 100644 --- a/po/it.po +++ b/po/it.po @@ -1,13 +1,13 @@ # Italian messages for GNU Awk -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # Antonio Colombo . # msgid "" msgstr "" "Project-Id-Version: GNU Awk 4.0.73, API: 0.0\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2014-01-15 10:39+0100\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2014-12-14 21:30+0100\n" +"PO-Revision-Date: 2014-12-14 22:10+0100\n" "Last-Translator: Antonio Colombo \n" "Language-Team: Italian \n" "Language: it\n" @@ -34,9 +34,9 @@ msgstr "tentativo di usare il parametro scalare `%s' come un vettore" msgid "attempt to use scalar `%s' as an array" msgstr "tentativo di usare scalare '%s' come vettore" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1600 builtin.c:1646 +#: builtin.c:1659 builtin.c:2086 builtin.c:2100 eval.c:1150 eval.c:1154 +#: eval.c:1559 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "tentativo di usare vettore `%s' in un contesto scalare" @@ -95,412 +95,412 @@ msgstr "" "asorti: non consentito un primo argomento che sia un sottovettore del " "secondo argomento" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "`%s' non è un nome funzione valido" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "funzione di confronto del sort `%s' non definita" -#: awkgram.y:233 +#: awkgram.y:241 #, c-format msgid "%s blocks must have an action part" msgstr "blocchi %s richiedono una `azione'" -#: awkgram.y:236 +#: awkgram.y:244 msgid "each rule must have a pattern or an action part" msgstr "ogni regola deve avere una parte `espressione' o una parte `azione'" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:354 awkgram.y:368 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "il vecchio awk non supporta più di una regola `BEGIN' o `END'" -#: awkgram.y:373 +#: awkgram.y:412 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' è una funzione interna, non si può ridefinire" -#: awkgram.y:419 +#: awkgram.y:474 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "espressione regolare costante `//' sembra un commento C++, ma non lo è" -#: awkgram.y:423 +#: awkgram.y:478 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "espressione regolare costante `/%s/' sembra un commento C, ma non lo è" -#: awkgram.y:515 +#: awkgram.y:590 #, c-format msgid "duplicate case values in switch body: %s" msgstr "valori di `case' doppi all'interno di uno `switch': %s" -#: awkgram.y:536 +#: awkgram.y:611 msgid "duplicate `default' detected in switch body" msgstr "valori di default doppi all'interno di uno `switch'" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:871 awkgram.y:3948 msgid "`break' is not allowed outside a loop or switch" msgstr "`break' non consentito fuori da un ciclo o da uno `switch'" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:880 awkgram.y:3940 msgid "`continue' is not allowed outside a loop" msgstr "`continue' non consentito fuori da un un ciclo" -#: awkgram.y:815 +#: awkgram.y:890 #, c-format msgid "`next' used in %s action" msgstr "`next' usato in `azione' %s" -#: awkgram.y:824 +#: awkgram.y:899 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' usato in `azione' %s" -#: awkgram.y:848 +#: awkgram.y:923 msgid "`return' used outside function context" msgstr "`return' usato fuori da una funzione" -#: awkgram.y:922 +#: awkgram.y:997 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "`print' da solo in BEGIN o END dovrebbe forse essere `print \"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:1063 awkgram.y:1112 msgid "`delete' is not allowed with SYMTAB" msgstr "`delete' non consentito in SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:1065 awkgram.y:1114 msgid "`delete' is not allowed with FUNCTAB" msgstr "`delete' non consentito in FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1099 awkgram.y:1103 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' è un'estensione tawk non-portabile" -#: awkgram.y:1149 +#: awkgram.y:1224 msgid "multistage two-way pipelines don't work" msgstr "`pipeline' multistadio bidirezionali non funzionano" -#: awkgram.y:1264 +#: awkgram.y:1339 msgid "regular expression on right of assignment" msgstr "espressione regolare usata per assegnare un valore" -#: awkgram.y:1275 +#: awkgram.y:1350 msgid "regular expression on left of `~' or `!~' operator" msgstr "espressione regolare prima di operatore `~' o `!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1366 awkgram.y:1508 msgid "old awk does not support the keyword `in' except after `for'" msgstr "il vecchio awk non supporta la parola-chiave `in' se non dopo `for'" -#: awkgram.y:1301 +#: awkgram.y:1376 msgid "regular expression on right of comparison" msgstr "espressione regolare a destra in un confronto" -#: awkgram.y:1417 +#: awkgram.y:1488 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "`getline var' invalida all'interno della regola `%s'" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "`getline' non ridiretta invalida all'interno della regola `%s'" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "`getline' invalida all'interno della regola `%s'" - -#: awkgram.y:1425 +#: awkgram.y:1491 msgid "non-redirected `getline' undefined inside END action" -msgstr "`getline' non re-diretta indefinita dentro `azione' END" +msgstr "`getline' non ri-diretta indefinita dentro `azione' END" -#: awkgram.y:1444 +#: awkgram.y:1510 msgid "old awk does not support multidimensional arrays" msgstr "il vecchio awk non supporta vettori multidimensionali" -#: awkgram.y:1541 +#: awkgram.y:1607 msgid "call of `length' without parentheses is not portable" msgstr "chiamata a `length' senza parentesi non portabile" -#: awkgram.y:1607 +#: awkgram.y:1673 msgid "indirect function calls are a gawk extension" msgstr "chiamate a funzione indirette sono un'estensione gawk" -#: awkgram.y:1620 +#: awkgram.y:1686 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "non riesco a usare la variabile speciale `%s' come parametro indiretto di " "funzione" -#: awkgram.y:1698 +#: awkgram.y:1764 msgid "invalid subscript expression" msgstr "espressione indice invalida" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2111 awkgram.y:2131 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "attenzione: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2129 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatale: " -#: awkgram.y:2116 +#: awkgram.y:2179 msgid "unexpected newline or end of string" msgstr "carattere 'a capo' o fine stringa non previsti" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 -#: debug.c:2812 debug.c:5055 +#: awkgram.y:2470 awkgram.y:2546 awkgram.y:2769 debug.c:523 debug.c:539 +#: debug.c:2812 debug.c:5056 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "non riesco ad aprire file sorgente `%s' in lettura (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2471 awkgram.y:2596 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "non riesco ad aprire shared library `%s' in lettura (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2473 awkgram.y:2547 awkgram.y:2597 builtin.c:135 debug.c:5207 msgid "reason unknown" msgstr "ragione indeterminata" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2482 awkgram.y:2506 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "non riesco a includere `%s' per usarlo come file di programma" -#: awkgram.y:2408 +#: awkgram.y:2495 #, c-format msgid "already included source file `%s'" msgstr "file sorgente `%s' già incluso" -#: awkgram.y:2409 +#: awkgram.y:2496 #, c-format msgid "already loaded shared library `%s'" msgstr "shared library `%s' già inclusa" -#: awkgram.y:2444 +#: awkgram.y:2531 msgid "@include is a gawk extension" msgstr "@include è un'estensione gawk" -#: awkgram.y:2450 +#: awkgram.y:2537 msgid "empty filename after @include" msgstr "nome-file mancante dopo @include" -#: awkgram.y:2494 +#: awkgram.y:2581 msgid "@load is a gawk extension" msgstr "@load è un'estensione gawk" -#: awkgram.y:2500 +#: awkgram.y:2587 msgid "empty filename after @load" msgstr "nome-file mancante dopo @include" -#: awkgram.y:2634 +#: awkgram.y:2721 msgid "empty program text on command line" msgstr "programma nullo sulla riga comandi" -#: awkgram.y:2749 +#: awkgram.y:2836 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "non riesco a leggere file sorgente `%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2847 #, c-format msgid "source file `%s' is empty" msgstr "file sorgente `%s' vuoto" -#: awkgram.y:2937 +#: awkgram.y:2906 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "errore PEBKAC: carattere invalido '\\%03o' nel codice sorgente" + +#: awkgram.y:3142 msgid "source file does not end in newline" msgstr "file sorgente non termina con carattere 'a capo'" -#: awkgram.y:3042 +#: awkgram.y:3247 msgid "unterminated regexp ends with `\\' at end of file" msgstr "espressione regolare non completata termina con `\\' a fine file" -#: awkgram.y:3066 +#: awkgram.y:3271 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: modificatore di espressione regolare tawk `/.../%c' non valido in " "gawk" -#: awkgram.y:3070 +#: awkgram.y:3275 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "modificatore di espressione regolare tawk `/.../%c' non valido in gawk" -#: awkgram.y:3077 +#: awkgram.y:3282 msgid "unterminated regexp" msgstr "espressione regolare non completata" -#: awkgram.y:3081 +#: awkgram.y:3286 msgid "unterminated regexp at end of file" msgstr "espressione regolare non completata a fine file" -#: awkgram.y:3140 +#: awkgram.y:3357 msgid "use of `\\ #...' line continuation is not portable" msgstr "uso di `\\ #...' continuazione riga non portabile" -#: awkgram.y:3156 +#: awkgram.y:3377 msgid "backslash not last character on line" msgstr "'\\' non è l'ultimo carattere della riga" -#: awkgram.y:3217 +#: awkgram.y:3438 msgid "POSIX does not allow operator `**='" msgstr "POSIX non permette l'operatore `**='" -#: awkgram.y:3219 +#: awkgram.y:3440 msgid "old awk does not support operator `**='" msgstr "il vecchio awk non supporta l'operatore `**='" -#: awkgram.y:3228 +#: awkgram.y:3449 msgid "POSIX does not allow operator `**'" msgstr "POSIX non permette l'operatore `**'" -#: awkgram.y:3230 +#: awkgram.y:3451 msgid "old awk does not support operator `**'" msgstr "il vecchio awk non supporta l'operatore `**'" -#: awkgram.y:3265 +#: awkgram.y:3486 msgid "operator `^=' is not supported in old awk" msgstr "l'operatore `^=' non è supportato nel vecchio awk" -#: awkgram.y:3273 +#: awkgram.y:3494 msgid "operator `^' is not supported in old awk" msgstr "l'operatore `^' non è supportato nel vecchio awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3591 awkgram.y:3607 command.y:1180 msgid "unterminated string" msgstr "stringa non terminata" -#: awkgram.y:3603 +#: awkgram.y:3828 #, c-format msgid "invalid char '%c' in expression" msgstr "carattere '%c' non valido in un'espressione" -#: awkgram.y:3650 +#: awkgram.y:3875 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' è un'estensione gawk" -#: awkgram.y:3655 +#: awkgram.y:3880 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX non permette `%s'" -#: awkgram.y:3663 +#: awkgram.y:3888 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' non è supportato nel vecchio awk" -#: awkgram.y:3753 +#: awkgram.y:3978 msgid "`goto' considered harmful!\n" msgstr "`goto' considerato pericoloso!\n" -#: awkgram.y:3787 +#: awkgram.y:4012 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d non valido come numero di argomenti per %s" -#: awkgram.y:3822 +#: awkgram.y:4047 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: una stringa come ultimo argomento di `substitute' non ha effetto" -#: awkgram.y:3827 +#: awkgram.y:4052 #, c-format msgid "%s third parameter is not a changeable object" msgstr "il terzo parametro di '%s' non è un oggetto modificabile" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:4144 awkgram.y:4147 msgid "match: third argument is a gawk extension" msgstr "match: il terzo argomento è un'estensione gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4201 awkgram.y:4204 msgid "close: second argument is a gawk extension" msgstr "close: il secondo argomento è un'estensione gawk" -#: awkgram.y:3982 +#: awkgram.y:4216 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale" -#: awkgram.y:3997 +#: awkgram.y:4231 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale" -#: awkgram.y:4016 +#: awkgram.y:4250 msgid "index: regexp constant as second argument is not allowed" msgstr "index: espressione regolare come secondo argomento non consentita" -#: awkgram.y:4069 +#: awkgram.y:4303 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funzione `%s': parametro `%s' nasconde variabile globale" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4360 debug.c:4042 debug.c:4085 debug.c:5205 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "non riesco ad aprire `%s' in scrittura (%s)" -#: awkgram.y:4127 +#: awkgram.y:4361 msgid "sending variable list to standard error" msgstr "mando lista variabili a 'standard error'" -#: awkgram.y:4135 +#: awkgram.y:4369 #, c-format msgid "%s: close failed (%s)" msgstr "%s: `close' non riuscita (%s)" -#: awkgram.y:4160 +#: awkgram.y:4394 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() chiamata due volte!" -#: awkgram.y:4168 +#: awkgram.y:4402 msgid "there were shadowed variables." msgstr "c'erano variabili nascoste." -#: awkgram.y:4239 +#: awkgram.y:4481 #, c-format msgid "function name `%s' previously defined" msgstr "funzione di nome `%s' definita in precedenza" -#: awkgram.y:4285 +#: awkgram.y:4527 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" "funzione `%s': non è possibile usare nome della funzione come nome parametro" -#: awkgram.y:4288 +#: awkgram.y:4530 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funzione `%s': non è possibile usare la variabile speciale `%s' come " "parametro di funzione" -#: awkgram.y:4296 +#: awkgram.y:4538 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4625 awkgram.y:4631 #, c-format msgid "function `%s' called but never defined" msgstr "funzione `%s' chiamata ma mai definita" -#: awkgram.y:4393 +#: awkgram.y:4635 #, c-format msgid "function `%s' defined but never called directly" msgstr "funzione `%s' definita ma mai chiamata direttamente" -#: awkgram.y:4425 +#: awkgram.y:4667 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "espressione regolare di valore costante per parametro #%d genera valore " "booleano" -#: awkgram.y:4484 +#: awkgram.y:4726 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -509,23 +509,23 @@ msgstr "" "funzione `%s' chiamata con spazio tra il nome e `(',\n" "o usata come variabile o vettore" -#: awkgram.y:4720 +#: awkgram.y:4962 msgid "division by zero attempted" msgstr "tentativo di dividere per zero" -#: awkgram.y:4729 +#: awkgram.y:4971 #, c-format msgid "division by zero attempted in `%%'" msgstr "tentativo di dividere per zero in `%%'" -#: awkgram.y:5049 +#: awkgram.y:5294 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "impossibile assegnare un valore al risultato di un'espressione di post-" "incremento di un campo" -#: awkgram.y:5052 +#: awkgram.y:5297 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "destinazione di assegnazione non valida (codice operativo %s)" @@ -541,7 +541,7 @@ msgstr "standard output" #: builtin.c:148 msgid "exp: received non-numeric argument" -msgstr "exp: argomento non-numerico" +msgstr "exp: l'argomento ricevuto non è numerico" #: builtin.c:154 #, c-format @@ -566,189 +566,198 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' non è un file aperto, una `pipe' o un co-processo" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" -msgstr "index: il primo argomento non è una stringa" +msgstr "index: il primo argomento ricevuto non è una stringa" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" -msgstr "index: il secondo argomento non è una stringa" +msgstr "index: il secondo argomento ricevuto non è una stringa" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" -msgstr "int: argomento non-numerico" +msgstr "int: l'argomento ricevuto non è numerico" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" -msgstr "length: l'argomento fornito è un vettore" +msgstr "length: l'argomento ricevuto è un vettore" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(array)' è un'estensione gawk" -#: builtin.c:544 +#: builtin.c:522 msgid "length: received non-string argument" -msgstr "length: l'argomento non è una stringa" +msgstr "length: l'argomento ricevuto non è una stringa" -#: builtin.c:575 +#: builtin.c:551 msgid "log: received non-numeric argument" -msgstr "log: argomento non-numerico" +msgstr "log: l'argomento ricevuto non è numerico" -#: builtin.c:578 +#: builtin.c:554 #, c-format msgid "log: received negative argument %g" -msgstr "log: argomento negativo %g" +msgstr "log: argomento ricevuto negativo %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:752 builtin.c:757 msgid "fatal: must use `count$' on all formats or none" -msgstr "fatale: `count$' va usato per ogni `format' o per nessuno" +msgstr "fatale: `count$' va usato per tutti i formati o per nessuno" -#: builtin.c:851 +#: builtin.c:827 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "larghezza campo ignorata per la specifica `%%'" -#: builtin.c:853 +#: builtin.c:829 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "precisione ignorata per la specifica `%%'" -#: builtin.c:855 +#: builtin.c:831 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "larghezza campo e precisone ignorate per la specifica `%%'" -#: builtin.c:906 +#: builtin.c:882 msgid "fatal: `$' is not permitted in awk formats" -msgstr "fatale: operatore `$' non consentito nei `format' awk" +msgstr "fatale: operatore `$' non consentito nei formati awk" -#: builtin.c:915 +#: builtin.c:891 msgid "fatal: arg count with `$' must be > 0" msgstr "fatale: numero argomenti con `$' dev'essere > 0" -#: builtin.c:919 +#: builtin.c:895 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "fatale: numero argomenti %ld > del numero totale argomenti specificati" -#: builtin.c:923 +#: builtin.c:899 msgid "fatal: `$' not permitted after period in format" -msgstr "fatale: `$' non consentito dopo il punto in un `format'" +msgstr "fatale: `$' non consentito dopo il punto in un formato" -#: builtin.c:939 +#: builtin.c:915 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "fatale: manca `$' per i campi posizionali larghezza o precisione" -#: builtin.c:1009 +#: builtin.c:985 msgid "`l' is meaningless in awk formats; ignored" -msgstr "`l' non ha senso nei `format' awk; ignorato" +msgstr "`l' non ha senso nei formati awk; ignorato" -#: builtin.c:1013 +#: builtin.c:989 msgid "fatal: `l' is not permitted in POSIX awk formats" -msgstr "fatale: `l' non consentito nei `format' POSIX awk" +msgstr "fatale: `l' non consentito nei formati POSIX awk" -#: builtin.c:1026 +#: builtin.c:1002 msgid "`L' is meaningless in awk formats; ignored" -msgstr "`L' non ha senso nei `format' awk; ignorato" +msgstr "`L' non ha senso nei formati awk; ignorato" -#: builtin.c:1030 +#: builtin.c:1006 msgid "fatal: `L' is not permitted in POSIX awk formats" -msgstr "`L' non ha senso nei `format' awk; ignorato" +msgstr "fatale: `L' non consentito nei formati POSIX awk" -#: builtin.c:1043 +#: builtin.c:1019 msgid "`h' is meaningless in awk formats; ignored" -msgstr "`h' non ha senso nei `format' awk; ignorato" +msgstr "`h' non ha senso nei formati awk; ignorato" -#: builtin.c:1047 +#: builtin.c:1023 msgid "fatal: `h' is not permitted in POSIX awk formats" -msgstr "fatale: `h' non consentito nei `format' POSIX awk" +msgstr "fatale: `h' non consentito nei formati POSIX awk" + +#: builtin.c:1049 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: valore %g troppo elevato per il formato %%c" -#: builtin.c:1463 +#: builtin.c:1062 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: valore %g non è un carattere multibyte valido " + +#: builtin.c:1448 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" -msgstr "[s]printf: valore %g fuori intervallo per il `format' `%%%c'" +msgstr "[s]printf: valore %g fuori intervallo per il formato `%%%c'" -#: builtin.c:1561 +#: builtin.c:1546 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" -msgstr "" -"carattere di `format' sconosciuto `%c' ignorato: nessun argomento convertito" +msgstr "carattere di formato ignoto `%c' ignorato: nessun argomento convertito" -#: builtin.c:1566 +#: builtin.c:1551 msgid "fatal: not enough arguments to satisfy format string" msgstr "" "fatale: argomenti in numero minore di quelli richiesti dalla stringa di " -"`format'" +"formato" -#: builtin.c:1568 +#: builtin.c:1553 msgid "^ ran out for this one" msgstr "^ esauriti a questo punto" -#: builtin.c:1575 +#: builtin.c:1560 msgid "[s]printf: format specifier does not have control letter" -msgstr "[s]printf: specifica di `format' senza un carattere di controllo" +msgstr "[s]printf: specifica di formato senza un carattere di controllo" -#: builtin.c:1578 +#: builtin.c:1563 msgid "too many arguments supplied for format string" -msgstr "troppi argomenti specificati per questa stringa di `format'" +msgstr "troppi argomenti specificati per questa stringa di formato" -#: builtin.c:1634 +#: builtin.c:1619 msgid "sprintf: no arguments" msgstr "sprintf: nessun argomento" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1642 builtin.c:1653 msgid "printf: no arguments" msgstr "printf: nessun argomento" -#: builtin.c:1711 +#: builtin.c:1696 msgid "sqrt: received non-numeric argument" -msgstr "sqrt: argomento non-numerico" +msgstr "sqrt: l'argomento ricevuto non è numerico" -#: builtin.c:1715 +#: builtin.c:1700 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: chiamata con argomento negativo %g" -#: builtin.c:1746 +#: builtin.c:1731 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: lunghezza %g non >= 1" -#: builtin.c:1748 +#: builtin.c:1733 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: lunghezza %g non >= 0" -#: builtin.c:1755 +#: builtin.c:1747 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: lunghezza non intera %g: sarà troncata" -#: builtin.c:1760 +#: builtin.c:1752 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: lunghezza %g troppo elevata per indice stringa, tronco a %g" -#: builtin.c:1772 +#: builtin.c:1764 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: indice di partenza %g non valido, uso 1" -#: builtin.c:1777 +#: builtin.c:1769 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: indice di partenza non intero %g: sarà troncato" -#: builtin.c:1802 +#: builtin.c:1792 msgid "substr: source string is zero length" msgstr "substr: stringa di partenza lunga zero" -#: builtin.c:1818 +#: builtin.c:1806 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: indice di partenza %g oltre la fine della stringa" -#: builtin.c:1826 +#: builtin.c:1814 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -756,191 +765,213 @@ msgstr "" "substr: lunghezza %g all'indice di partenza %g supera la lunghezza del primo " "argomento (%lu)" -#: builtin.c:1900 +#: builtin.c:1884 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" -"strftime: il valore del `format' in PROCINFO[\"strftime\"] è di tipo numerico" +"strftime: il valore del formato in PROCINFO[\"strftime\"] è di tipo numerico" -#: builtin.c:1923 +#: builtin.c:1907 msgid "strftime: received non-numeric second argument" -msgstr "strftime: secondo argomento non-numerico" +msgstr "strftime: il secondo argomento ricevuto non è numerico" -#: builtin.c:1927 +#: builtin.c:1911 msgid "strftime: second argument less than 0 or too big for time_t" -msgstr "strftime: secondo argomento < 0 o troppo elevato per time_t" +msgstr "strftime: il secondo argomento è < 0 o troppo elevato per time_t" -#: builtin.c:1934 +#: builtin.c:1918 msgid "strftime: received non-string first argument" -msgstr "strftime: il primo argomento non è una stringa" +msgstr "strftime: il primo argomento ricevuto non è una stringa" -#: builtin.c:1941 +#: builtin.c:1925 msgid "strftime: received empty format string" -msgstr "strftime: `format' è una stringa nulla" +msgstr "strftime: il formato ricevuto è una stringa nulla" -#: builtin.c:2007 +#: builtin.c:1991 msgid "mktime: received non-string argument" -msgstr "mktime: l'argomento non è una stringa" +msgstr "mktime: l'argomento ricevuto non è una stringa" -#: builtin.c:2024 +#: builtin.c:2008 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: almeno un valore è fuori dall'intervallo di default" -#: builtin.c:2059 +#: builtin.c:2043 msgid "'system' function not allowed in sandbox mode" msgstr "funzione 'system' non consentita in modo `sandbox'" -#: builtin.c:2064 +#: builtin.c:2048 msgid "system: received non-string argument" -msgstr "system: l'argomento non è una stringa" +msgstr "system: l'argomento ricevuto non è una stringa" -#: builtin.c:2184 +#: builtin.c:2168 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "riferimento a variabile non inizializzata `$%d'" -#: builtin.c:2271 +#: builtin.c:2253 msgid "tolower: received non-string argument" -msgstr "tolower: l'argomento non è una stringa" +msgstr "tolower: l'argomento ricevuto non è una stringa" -#: builtin.c:2305 +#: builtin.c:2284 msgid "toupper: received non-string argument" -msgstr "toupper: l'argomento non è una stringa" +msgstr "toupper: l'argomento ricevuto non è una stringa" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2317 mpfr.c:679 msgid "atan2: received non-numeric first argument" -msgstr "atan2: primo argomento non-numerico" +msgstr "atan2: il primo argomento ricevuto non è numerico" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2319 mpfr.c:681 msgid "atan2: received non-numeric second argument" -msgstr "atan2: secondo argomento non-numerico" +msgstr "atan2: il secondo argomento ricevuto non è numerico" -#: builtin.c:2362 +#: builtin.c:2338 msgid "sin: received non-numeric argument" -msgstr "sin: argomento non-numerico" +msgstr "sin: l'argomento ricevuto non è numerico" -#: builtin.c:2378 +#: builtin.c:2354 msgid "cos: received non-numeric argument" -msgstr "cos: argomento non-numerico" +msgstr "cos: l'argomento ricevuto non è numerico" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2468 mpfr.c:1176 msgid "srand: received non-numeric argument" -msgstr "srand: argomento non-numerico" +msgstr "srand: l'argomento ricevuto non è numerico" -#: builtin.c:2462 +#: builtin.c:2499 msgid "match: third argument is not an array" msgstr "match: terzo argomento non-vettoriale" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub: il terzo argomento è 0, trattato come 1" +#: builtin.c:2760 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: il terzo argomento `%.*s' trattato come 1" + +#: builtin.c:2775 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: il terzo argomento %g trattato come 1" -#: builtin.c:3030 +#: builtin.c:3075 msgid "lshift: received non-numeric first argument" -msgstr "lshift: primo argomento non-numerico" +msgstr "lshift: il primo argomento ricevuto non è numerico" -#: builtin.c:3032 +#: builtin.c:3077 msgid "lshift: received non-numeric second argument" -msgstr "lshift: secondo argomento non-numerico" +msgstr "lshift: il secondo argomento ricevuto non è numerico" -#: builtin.c:3038 +#: builtin.c:3083 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): valori negativi daranno risultati strani" -#: builtin.c:3040 +#: builtin.c:3085 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): valori decimali saranno troncati" -#: builtin.c:3042 +#: builtin.c:3087 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): valori troppo alti daranno risultati strani" -#: builtin.c:3067 +#: builtin.c:3112 msgid "rshift: received non-numeric first argument" -msgstr "rshift: primo argomento ricevuto non-numerico" +msgstr "rshift: il primo argomento ricevuto non è numerico" -#: builtin.c:3069 +#: builtin.c:3114 msgid "rshift: received non-numeric second argument" -msgstr "rshift: secondo argomento non-numerico" +msgstr "rshift: il secondo argomento ricevuto non è numerico" -#: builtin.c:3075 +#: builtin.c:3120 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): valori negativi daranno risultati strani" -#: builtin.c:3077 +#: builtin.c:3122 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): valori decimali saranno troncati" -#: builtin.c:3079 +#: builtin.c:3124 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): valori troppo alti daranno risultati strani" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3149 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: chiamata con meno di due argomenti" -#: builtin.c:3109 +#: builtin.c:3154 #, c-format msgid "and: argument %d is non-numeric" -msgstr "and: argomento %d non-numerico" +msgstr "and: l'argomento %d non è numerico" -#: builtin.c:3113 +#: builtin.c:3158 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argomento %d, valore negativo %g darà risultati strani" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3181 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: chiamata con meno di due argomenti" -#: builtin.c:3141 +#: builtin.c:3186 #, c-format msgid "or: argument %d is non-numeric" -msgstr "or: argomento %d non-numerico" +msgstr "or: l'argomento %d non è numerico" -#: builtin.c:3145 +#: builtin.c:3190 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argomento %d, valore negativo %g darà risultati strani" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3212 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: chiamata con meno di due argomenti" -#: builtin.c:3173 +#: builtin.c:3218 #, c-format msgid "xor: argument %d is non-numeric" -msgstr "xor: argomento %d non-numerico" +msgstr "xor: l'argomento %d non è numerico" -#: builtin.c:3177 +#: builtin.c:3222 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argomento %d, valore negativo %g darà risultati strani" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3247 mpfr.c:807 msgid "compl: received non-numeric argument" -msgstr "compl: argomento non-numerico" +msgstr "compl: l'argomento ricevuto non è numerico" -#: builtin.c:3208 +#: builtin.c:3253 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): valore negativo, darà risultati strani" -#: builtin.c:3210 +#: builtin.c:3255 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): valori decimali saranno troncati" -#: builtin.c:3379 +#: builtin.c:3424 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' non è una categoria `locale' valida" +#: builtin.c:3611 mpfr.c:1209 +msgid "div: third argument is not an array" +msgstr "div: terzo argomento non-vettoriale" + +#: builtin.c:3619 mpfr.c:1217 +msgid "div: received non-numeric first argument" +msgstr "div: il primo argomento ricevuto non è numerico" + +#: builtin.c:3621 mpfr.c:1219 +msgid "div: received non-numeric second argument" +msgstr "div: il secondo argomento ricevuto non è numerico" + +#: builtin.c:3630 mpfr.c:1253 +msgid "div: division by zero attempted" +msgstr "div: tentativo di dividere per zero" + #: command.y:225 #, c-format msgid "Type (g)awk statement(s). End with the command \"end\"\n" @@ -1141,7 +1172,7 @@ msgstr "" #: command.y:855 msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)." msgstr "" -"list [-|+|[nome-file:]num_linea|funzione|intervallo] - elenca riga/he " +"list [-|+|[nome-file:]num_riga|funzione|intervallo] - elenca riga/he " "richiesta/e." #: command.y:857 @@ -1167,7 +1198,7 @@ msgstr "print var [var] - stampa valore di variabile/i o vettore/i." #: command.y:865 msgid "printf format, [arg], ... - formatted output." -msgstr "printf format, [arg], ... - output secondo formato specificato." +msgstr "printf format, [arg], ... - output secondo formato." #: command.y:867 msgid "quit - exit debugger." @@ -1228,8 +1259,8 @@ msgid "" "until [[filename:]N|function] - execute until program reaches a different " "line or line N within current frame." msgstr "" -"until [[nome-file:]N|funzione] - esegui finché il programma arriva una " -"rigadifferente, o alla riga N nell'elemento di stack corrente." +"until [[nome-file:]N|funzione] - esegui finché il programma arriva una riga " +"differente, o alla riga N nell'elemento di stack corrente." #: command.y:895 msgid "unwatch [N] - remove variable(s) from watch list." @@ -1243,40 +1274,48 @@ msgstr "up [N] - spostati di N elementi dello stack verso l'alto." msgid "watch var - set a watchpoint for a variable." msgstr "watch var - imposta un watchpoint per una variabile." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"dove [N] - (equivalente a backtrace) stampa tracia di tutti gli elementi o " +"degli N più interni (più esterni se N <0)" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "errore: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "non riesco a leggere comando (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "non riesco a leggere comando (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "carattere non valido nel comando" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "comando sconosciuto - \"%.*s\", vedere help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "carattere non valido" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "comando non definito: %s\n" @@ -1488,17 +1527,17 @@ msgstr "[\"%s\"] non presente nel vettore `%s\n" msgid "`%s[\"%s\"]' is not an array\n" msgstr "`%s[\"%s\"]' non è un vettore\n" -#: debug.c:1236 debug.c:4964 +#: debug.c:1236 debug.c:4965 #, c-format msgid "`%s' is not a scalar variable" msgstr "`%s' non è una variabile scalare" -#: debug.c:1258 debug.c:4994 +#: debug.c:1258 debug.c:4995 #, c-format msgid "attempt to use array `%s[\"%s\"]' in a scalar context" msgstr "tentativo di usare vettore `%s[\"%s\"]' in un contesto scalare" -#: debug.c:1280 debug.c:5005 +#: debug.c:1280 debug.c:5006 #, c-format msgid "attempt to use scalar `%s[\"%s\"]' as array" msgstr "tentativo di usare scalare `%s[\"%s\"]' come vettore" @@ -1776,99 +1815,99 @@ msgstr "'finish' not significativo per salti non-locali '%s'\n" msgid "'until' not meaningful with non-local jump '%s'\n" msgstr "'until' not significativo per salti non-locali '%s'\n" -#: debug.c:4185 +#: debug.c:4186 msgid "\t------[Enter] to continue or q [Enter] to quit------" msgstr "\t------[Invio] per continuare o q [Invio] per uscire------" -#: debug.c:4186 +#: debug.c:4187 msgid "q" msgstr "q" -#: debug.c:5001 +#: debug.c:5002 #, c-format msgid "[\"%s\"] not in array `%s'" msgstr "[\"%s\"] non presente nel vettore `%s'" -#: debug.c:5207 +#: debug.c:5208 #, c-format msgid "sending output to stdout\n" msgstr "output inviato a stdout\n" -#: debug.c:5247 +#: debug.c:5248 msgid "invalid number" msgstr "numero non valido" -#: debug.c:5381 +#: debug.c:5382 #, c-format msgid "`%s' not allowed in current context; statement ignored" msgstr "`%s' non consentito nel contesto corrente; istruzione ignorata" -#: debug.c:5389 +#: debug.c:5390 msgid "`return' not allowed in current context; statement ignored" msgstr "`return' non consentito nel contesto corrente; istruzione ignorata" -#: debug.c:5590 +#: debug.c:5605 #, c-format msgid "No symbol `%s' in current context" msgstr "Simbolo `%s' non esiste nel contesto corrente" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1051 dfa.c:1054 dfa.c:1073 dfa.c:1083 dfa.c:1095 dfa.c:1131 +#: dfa.c:1140 dfa.c:1143 dfa.c:1148 dfa.c:1162 dfa.c:1210 msgid "unbalanced [" msgstr "[ non chiusa" -#: dfa.c:1174 +#: dfa.c:1107 msgid "invalid character class" msgstr "character class non valida" -#: dfa.c:1316 +#: dfa.c:1253 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "sintassi character class è [[:spazio:]], non [:spazio:]" -#: dfa.c:1366 +#: dfa.c:1315 msgid "unfinished \\ escape" msgstr "sequenza escape \\ non completa" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" -msgstr "Contenuto di \\{\\} non valido" +#: dfa.c:1462 +msgid "invalid content of \\{\\}" +msgstr "contenuto di \\{\\} non valido" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" -msgstr "Espressione regolare troppo complessa" +#: dfa.c:1465 +msgid "regular expression too big" +msgstr "espressione regolare troppo complessa" -#: dfa.c:1936 +#: dfa.c:1900 msgid "unbalanced (" msgstr "( non chiusa" -#: dfa.c:2062 +#: dfa.c:2026 msgid "no syntax specified" msgstr "nessuna sintassi specificata" -#: dfa.c:2070 +#: dfa.c:2034 msgid "unbalanced )" msgstr ") non aperta" -#: eval.c:394 +#: eval.c:397 #, c-format msgid "unknown nodetype %d" msgstr "tipo nodo sconosciuto %d" -#: eval.c:405 eval.c:419 +#: eval.c:408 eval.c:422 #, c-format msgid "unknown opcode %d" msgstr "codice operativo sconosciuto %d" -#: eval.c:416 +#: eval.c:419 #, c-format msgid "opcode %s not an operator or keyword" msgstr "codice operativo %s non è un operatore o una parola chiave" -#: eval.c:472 +#: eval.c:475 msgid "buffer overflow in genflags2str" msgstr "superamento limiti buffer in 'genflags2str'" -#: eval.c:675 +#: eval.c:677 #, c-format msgid "" "\n" @@ -1879,216 +1918,216 @@ msgstr "" "\t# `Stack' (Pila) Chiamate Funzione:\n" "\n" -#: eval.c:704 +#: eval.c:706 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' è un'estensione gawk" -#: eval.c:736 +#: eval.c:738 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' è un'estensione gawk" -#: eval.c:794 +#: eval.c:796 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "valore di BINMODE `%s' non valido, considerato come 3" -#: eval.c:885 +#: eval.c:913 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "specificazione invalida `%sFMT' `%s'" -#: eval.c:969 +#: eval.c:997 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "disabilito `--lint' a causa di assegnamento a `LINT'" -#: eval.c:1147 +#: eval.c:1175 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "riferimento ad argomento non inizializzato `%s'" -#: eval.c:1148 +#: eval.c:1176 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "riferimento a variabile non inizializzata `%s'" -#: eval.c:1166 +#: eval.c:1194 msgid "attempt to field reference from non-numeric value" msgstr "tentativo di riferimento a un campo da valore non-numerico" -#: eval.c:1168 +#: eval.c:1196 msgid "attempt to field reference from null string" msgstr "tentativo di riferimento a un campo da una stringa nulla" -#: eval.c:1176 +#: eval.c:1204 #, c-format msgid "attempt to access field %ld" msgstr "tentativo di accedere al campo %ld" -#: eval.c:1185 +#: eval.c:1213 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "riferimento a campo non inizializzato `$%ld'" -#: eval.c:1272 +#: eval.c:1300 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funzione `%s' chiamata con più argomenti di quelli previsti" -#: eval.c:1473 +#: eval.c:1501 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: tipo non previsto `%s'" -#: eval.c:1569 +#: eval.c:1597 msgid "division by zero attempted in `/='" msgstr "divisione per zero tentata in `/='" -#: eval.c:1576 +#: eval.c:1604 #, c-format msgid "division by zero attempted in `%%='" msgstr "divisione per zero tentata in `%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "le estensioni non sono consentite in modo `sandbox'" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load sono estensioni gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" -msgstr "load_ext: nome libreria ricevuto è NULL" +msgstr "load_ext: il nome libreria ricevuto è NULL" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: non riesco ad aprire libreria `%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: libreria `%s': non definisce `plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: libreria `%s': non riesco a chiamare funzione `%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext: libreria `%s' routine di inizializzazione `%s' non riuscita\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' è un'estensione gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" -msgstr "extension: nome libreria ricevuto è NULL" +msgstr "extension: il nome libreria ricevuto è NULL" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: non riesco ad aprire libreria `%s' (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: libreria `%s': non definisce `plugin_is_GPL_compatible' (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: libreria `%s': non riesco a chiamare funzione `%s' (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: manca nome di funzione" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: non riesco a ridefinire funzione `%s'" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: funzione `%s' già definita" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: funzione di nome `%s' definita in precedenza" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: nome funzione interna gawk `%s' non ammesso come nome funzione" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: contatore argomenti negativo per la funzione `%s'" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: manca nome di funzione" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: carattere non ammesso `%c' nel nome di funzione `%s'" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: non riesco a ridefinire funzione `%s'" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: funzione `%s' già definita" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: funzione di nome `%s' definita in precedenza" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: nome funzione interna gawk `%s' non ammesso come nome funzione" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funzione `%s' definita per avere al massimo %d argomenti(o)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funzione `%s': manca argomento #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "funzione `%s': argomento #%d: tentativo di usare scalare come vettore" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "funzione `%s': argomento #%d: tentativo di usare vettore come scalare" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "caricamento dinamico di libreria non supportato" @@ -2232,7 +2271,7 @@ msgstr "wait: chiamata con troppi argomenti" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: modifica in-place già attiva" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: 2 argumenti richiesti, ma chiamata con %d" @@ -2263,56 +2302,56 @@ msgstr "inplace_begin: `%s' non msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(`%s') non riuscita (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: chmod non riuscita (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) non riuscita (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) non riuscita (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) non riuscita (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end: non riesco a trovare il 1° argomento come stringa nome-file" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: modifica in-place non attiva" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) non riuscita (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) non riuscita (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) non riuscita (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(`%s', `%s') non riuscita (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(`%s', `%s') non riuscito (%s)" @@ -2426,90 +2465,90 @@ msgstr "sleep: l'argomento msgid "sleep: not supported on this platform" msgstr "sleep: non supportato in questa architettura" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF impostato a un valore negativo" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: il quarto argomento è un'estensione gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: quarto argomento non-vettoriale" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: secondo argomento non-vettoriale" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: non si può usare un unico vettore come secondo e quarto argomento" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: non consentito un quarto argomento che sia un sottovettore del " "secondo argomento" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: non consentito un secondo argomento che sia un sottovettore del " "quarto argomento" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: la stringa nulla come terzo arg. è un'estensione gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: secondo argomento non-vettoriale" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: secondo argomento non-vettoriale" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: il terzo argomento non può essere nullo" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: non si può usare un unico vettore come secondo e quarto argomento" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: non consentito un quarto argomento che sia un sottovettore del " "secondo argomento" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: non consentito un secondo argomento che sia un sottovettore del " "quarto argomento" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' è un'estensione gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "valore di FIELDWIDTHS non valido, vicino a `%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "la stringa nulla usata come `FS' è un'estensione gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "il vecchio awk non supporta espressioni come valori di `FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' è un'estensione gawk" @@ -2525,20 +2564,20 @@ msgstr "node_to_awk_value: ricevuto nodo nullo" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: ricevuto valore nullo" -#: gawkapi.c:807 +#: gawkapi.c:810 msgid "remove_element: received null array" msgstr "remove_element: ricevuto vettore nullo" -#: gawkapi.c:810 +#: gawkapi.c:813 msgid "remove_element: received null subscript" msgstr "remove_element: ricevuto indice nullo" -#: gawkapi.c:947 +#: gawkapi.c:950 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: non sono riuscito a convertire l'indice %d\n" -#: gawkapi.c:952 +#: gawkapi.c:955 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: non sono riuscito a convertire il valore %d\n" @@ -2598,293 +2637,275 @@ msgstr "%s: l'opzione '-W %s' non ammette un argomento\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: l'opzione '-W %s' richiede un argomento\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" -msgstr "l'argomento in linea comando `%s' è una directory: saltato" +msgstr "l'argomento in riga comando `%s' è una directory: ignorata" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "non riesco ad aprire file `%s' in lettura (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "chiusura di fd %d (`%s') non riuscita (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" -msgstr "re-direzione non consentita in modo `sandbox'" +msgstr "ri-direzione non consentita in modo `sandbox'" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" -msgstr "espressione nella re-direzione `%s' ha solo un valore numerico" +msgstr "espressione nella ri-direzione `%s' ha solo un valore numerico" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" -msgstr "espressione nella re-direzione `%s' ha per valore la stringa nulla" +msgstr "espressione nella ri-direzione `%s' ha per valore la stringa nulla" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" -"nome-file `%s' per la re-direzione `%s' può essere il risultato di una " +"nome-file `%s' per la ri-direzione `%s' può essere il risultato di una " "espressione logica" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mistura non necessaria di `>' e `>>' per il file `%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "non riesco ad aprire `pipe' `%s' in scrittura (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "non riesco ad aprire `pipe' `%s' in lettura (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "non riesco ad aprire `pipe' bidirezionale `%s' in lettura/scrittura (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" -msgstr "non riesco a re-dirigere da `%s' (%s)" +msgstr "non riesco a ri-dirigere da `%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" -msgstr "non riesco a re-dirigere a `%s' (%s)" +msgstr "non riesco a ri-dirigere a `%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "numero massimo consentito di file aperti raggiunto: comincio a riutilizzare " "i descrittori di file" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "chiusura di `%s' non riuscita (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "troppe `pipe' o file di input aperti" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: il secondo argomento deve essere `a' o `da'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' non è un file aperto, una `pipe' o un co-processo" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" -msgstr "chiusura di una re-direzione mai aperta" +msgstr "chiusura di una ri-direzione mai aperta" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" -msgstr "close: re-direzione `%s' non aperta con `|&', ignoro secondo argomento" +msgstr "close: ri-direzione `%s' non aperta con `|&', ignoro secondo argomento" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "errore ritornato (%d) dalla chiusura della `pipe' `%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "errore ritornato (%d) dalla chiusura del file `%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "nessuna chiusura esplicita richiesta per `socket' `%s'" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "nessuna chiusura esplicita richiesta per co-processo `%s'" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "nessuna chiusura esplicita richiesta per `pipe' `%s'" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "nessuna chiusura esplicita richiesta per file `%s'" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:615 main.c:657 #, c-format msgid "error writing standard output (%s)" msgstr "errore scrivendo 'standard output' (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:617 #, c-format msgid "error writing standard error (%s)" msgstr "errore scrivendo 'standard error' (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "scaricamento di `pipe' `%s' non riuscito (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "scaricamento da co-processo di `pipe' a `%s' non riuscito (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "scaricamento di file `%s' non riuscito (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "porta locale %s invalida in `/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "host remoto e informazione di porta (%s, %s) invalidi" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "nessuno protocollo (noto) specificato nel filename speciale `%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "nome-file speciale `%s' incompleto" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "va fornito nome di `host' remoto a `/inet'" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "va fornita porta remota a `/inet'" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "comunicazioni TCP/IP non supportate" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "non riesco ad aprire `%s', modo `%s'" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "close di `pty' principale non riuscita (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "close di `stdout' nel processo-figlio non riuscita (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "trasferimento di `pty' secondaria a `stdout' nel processo-figlio non " "riuscita (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "close di `stdin' nel processo-figlio non riuscita (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "trasferimento di 'pty' secondaria a 'stdin' nel processo-figlio non riuscito " "(dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "close di 'pty' secondaria non riuscita (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "passaggio di `pipe' a `stdout' nel processo-figlio non riuscito (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "passaggio di pipe a `stdin' nel processo-figlio non riuscito (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "ripristino di `stdout' nel processo-padre non riuscito\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "ripristino di `stdin' nel processo-padre non riuscito\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "close di 'pipe' non riuscita (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "`|&' non supportato" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "non riesco ad aprire `pipe' `%s' (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "non riesco a creare processo-figlio per `%s' (fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: ricevuto puntatore NULL" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "input parser `%s' in conflitto con l'input parser `%s' installato in " "precedenza" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "l'input parser `%s' non è riuscito ad aprire `%s'" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: ricevuto puntatore NULL" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" @@ -2892,16 +2913,16 @@ msgstr "" "output wrapper `%s' in conflitto con l'output wrapper `%s' installato in " "precedenza" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "l'output wrapper `%s' non è riuscito ad aprire `%s'" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: ricevuto puntatore NULL" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2910,209 +2931,195 @@ msgstr "" "processore doppio `%s' in conflitto con il processore doppio installato in " "precedenza `%s'" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "il processore doppio `%s' non è riuscito ad aprire `%s'" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "file dati `%s' vuoto" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "non riesco ad allocare ulteriore memoria per l'input" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "valore multicarattere per `RS' è un'estensione gawk" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "comunicazioni IPv6 non supportate" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "argomento di `-e/--source' nullo, ignorato" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: l'opzione richiede un argomento -- %c\n" - -#: main.c:562 +#: main.c:309 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "variable d'ambiente `POSIXLY_CORRECT' impostata: attivo `--posix'" -#: main.c:568 +#: main.c:315 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' annulla `--traditional'" -#: main.c:579 +#: main.c:326 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' annulla `--non-decimal-data'" -#: main.c:583 +#: main.c:330 #, c-format msgid "running %s setuid root may be a security problem" msgstr "eseguire %s con `setuid' root può essere un rischio per la sicurezza" -#: main.c:588 +#: main.c:334 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' annulla `--characters-as-bytes'" -#: main.c:647 +#: main.c:392 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "non è possibile impostare modalità binaria su `stdin'(%s)" -#: main.c:650 +#: main.c:395 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "non è possibile impostare modalità binaria su `stdout'(%s)" -#: main.c:652 +#: main.c:397 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "non è possibile impostare modalità binaria su `stderr'(%s)" -#: main.c:710 +#: main.c:457 msgid "no program text at all!" msgstr "manca del tutto il testo del programma!" -#: main.c:799 +#: main.c:550 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Uso: %s [opzioni in stile POSIX o GNU] -f file-prog. [--] file ...\n" -#: main.c:801 +#: main.c:552 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Usage: %s [opzioni in stile POSIX o GNU] [--] %cprogramma%c file ...\n" -#: main.c:806 +#: main.c:557 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opzioni POSIX:\t\topzioni lunghe GNU: (standard)\n" -#: main.c:807 +#: main.c:558 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fileprog\t\t--file=file-prog.\n" -#: main.c:808 +#: main.c:559 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:560 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valore\t\t--assign=var=valore\n" -#: main.c:810 +#: main.c:561 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Opzioni brevi:\t\topzioni lunghe GNU: (estensioni)\n" -#: main.c:811 +#: main.c:562 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:563 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:564 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:565 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[file]\t\t--dump-variables[=file]\n" -#: main.c:815 +#: main.c:566 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[file]\t\t--debug[=file]\n" -#: main.c:816 +#: main.c:567 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'testo-del-programma'\t--source='testo-del-programma'\n" -#: main.c:817 +#: main.c:568 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=file\n" -#: main.c:818 +#: main.c:569 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:570 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:571 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i include_file\t\t--include=include_file\n" -#: main.c:821 +#: main.c:572 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l libreria\t\t--load=libreria\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" - -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" +#: main.c:573 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" +msgstr "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" -#: main.c:824 +#: main.c:574 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:575 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:576 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:577 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[file]\t\t--pretty-print[=file]\n" -#: main.c:827 +#: main.c:578 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:579 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:829 +#: main.c:580 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:581 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:582 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:583 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:584 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:586 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:589 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3121,7 +3128,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:598 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3134,7 +3141,7 @@ msgstr "" "Problemi di traduzione, segnalare ad: azc100@gmail.com.\n" "\n" -#: main.c:851 +#: main.c:602 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3144,7 +3151,7 @@ msgstr "" "Senza parametri, legge da 'standard input' e scrive su 'standard output'.\n" "\n" -#: main.c:855 +#: main.c:606 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3154,7 +3161,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:631 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3173,7 +3180,7 @@ msgstr "" "Licenza, o (a tua scelta) a una qualsiasi versione successiva.\n" "\n" -#: main.c:888 +#: main.c:639 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3187,7 +3194,7 @@ msgstr "" "Vedi la 'GNU General Public License' per ulteriori dettagli.\n" "\n" -#: main.c:894 +#: main.c:645 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3196,16 +3203,16 @@ msgstr "" "assieme a questo programma; se non è così, vedi http://www.gnu.org/" "licenses/.\n" -#: main.c:931 +#: main.c:682 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft non imposta FS a `tab' nell'awk POSIX" -#: main.c:1208 +#: main.c:973 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valore non noto per specifica campo: %d\n" -#: main.c:1306 +#: main.c:1071 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3214,98 +3221,116 @@ msgstr "" "%s: `%s' argomento di `-v' non in forma `var=valore'\n" "\n" -#: main.c:1332 +#: main.c:1097 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' non è un nome di variabile ammesso" -#: main.c:1335 +#: main.c:1100 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' non è un nome di variabile, cerco il file `%s=%s'" -#: main.c:1339 +#: main.c:1104 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "nome funzione interna gawk `%s' non ammesso come nome variabile" -#: main.c:1344 +#: main.c:1109 #, c-format msgid "cannot use function `%s' as variable name" msgstr "non è possibile usare nome di funzione `%s' come nome di variabile" -#: main.c:1397 +#: main.c:1162 msgid "floating point exception" msgstr "eccezione floating point" -#: main.c:1404 +#: main.c:1169 msgid "fatal error: internal error" msgstr "errore fatale: errore interno" -#: main.c:1419 +#: main.c:1184 msgid "fatal error: internal error: segfault" msgstr "errore fatale: errore interno: segfault" -#: main.c:1431 +#: main.c:1196 msgid "fatal error: internal error: stack overflow" msgstr "errore fatale: errore interno: stack overflow" -#: main.c:1490 +#: main.c:1255 #, c-format msgid "no pre-opened fd %d" msgstr "manca `fd' pre-aperta %d" -#: main.c:1497 +#: main.c:1262 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "non riesco a pre-aprire /dev/null per `fd' %d" -#: mpfr.c:550 +#: main.c:1476 +msgid "empty argument to `-e/--source' ignored" +msgstr "argomento di `-e/--source' nullo, ignorato" + +#: main.c:1547 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "-M ignorato: supporto per MPFR/GMP non generato" + +#: main.c:1568 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n" + +#: main.c:1621 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'opzione richiede un argomento -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "valore PREC `%.*s' non valido" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "valore di RNDMODE `%.*s' non valido" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" -msgstr "%s: ricevuto argomento non-numerico" +msgstr "%s: l'argomento ricevuto non è numerico" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): valore negativo, darà risultati strani" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "comp(%Rg): valore decimale sarà troncato" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): valori negativi, daranno risultati strani" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" -msgstr "%s:ricevuto argomento non-numerico #%d" +msgstr "%s: l'argomento ricevuto non è numerico #%d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argomento #%d con valore non valido %Rg, uso 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: argomento #%d con valore negativo %Rg, darà risultati strani" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: argomento #%d, valore decimale sarà troncato" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: argomento #%d con valore negativo %Zd, darà risultati strani" @@ -3313,26 +3338,26 @@ msgstr "%s: argomento #%d con valore negativo %Zd, dar #: msg.c:68 #, c-format msgid "cmd. line:" -msgstr "linea com.:" +msgstr "riga com.:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "'\\' a fine stringa" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "il vecchio awk non supporta la sequenza di escape '\\%c'" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX non permette escape `\\x'" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "niente cifre esadecimali nella sequenza di escape `\\x'" -#: node.c:579 +#: node.c:566 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3341,12 +3366,12 @@ msgstr "" "sequenza di escape esadec.\\x%.*s di %d caratteri probabilmente non " "interpretata nel modo previsto" -#: node.c:594 +#: node.c:581 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "sequenza di escape `\\%c' considerata come semplice `%c'" -#: node.c:739 +#: node.c:725 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3365,25 +3390,25 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "" "%s %s `%s': non riesco a impostare 'close-on-exec': (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:73 #, c-format msgid "could not open `%s' for writing: %s" msgstr "non riesco ad aprire `%s' in scrittura: %s" -#: profile.c:73 +#: profile.c:75 msgid "sending profile to standard error" msgstr "mando profilo a 'standard error'" -#: profile.c:193 +#: profile.c:220 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# blocco(hi) %s\n" +"\t# %s regola(e)\n" "\n" -#: profile.c:198 +#: profile.c:227 #, c-format msgid "" "\t# Rule(s)\n" @@ -3392,16 +3417,16 @@ msgstr "" "\t# Regola(e)\n" "\n" -#: profile.c:272 +#: profile.c:308 #, c-format msgid "internal error: %s with null vname" msgstr "errore interno: %s con `vname' nullo" -#: profile.c:537 +#: profile.c:574 msgid "internal error: builtin with null fname" msgstr "errore interno: funzione interna con `fname' nullo" -#: profile.c:949 +#: profile.c:1016 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3410,12 +3435,12 @@ msgstr "" "\t# Estensioni caricate (-l e/o @load)\n" "\n" -#: profile.c:972 +#: profile.c:1065 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profilo gawk, creato %s\n" -#: profile.c:1475 +#: profile.c:1607 #, c-format msgid "" "\n" @@ -3424,10 +3449,10 @@ msgstr "" "\n" "\t# Funzioni, in ordine alfabetico\n" -#: profile.c:1513 +#: profile.c:1658 #, c-format msgid "redir2str: unknown redirection type %d" -msgstr "redir2str: tipo di re-direzione non noto %d" +msgstr "redir2str: tipo di ri-direzione non noto %d" #: re.c:607 #, c-format @@ -3464,8 +3489,8 @@ msgid "Invalid back reference" msgstr "Riferimento indietro non valido" #: regcomp.c:152 -msgid "Unmatched [ or [^" -msgstr "[ o [^ non chiusa" +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[, [^, [:, [. o [= non chiusa" #: regcomp.c:155 msgid "Unmatched ( or \\(" @@ -3475,6 +3500,10 @@ msgstr "( o \\( non chiusa" msgid "Unmatched \\{" msgstr "\\{ non chiusa" +#: regcomp.c:161 +msgid "Invalid content of \\{\\}" +msgstr "Contenuto di \\{\\} non valido" + #: regcomp.c:164 msgid "Invalid range end" msgstr "Fine di intervallo non valido" @@ -3491,6 +3520,10 @@ msgstr "Espressione regolare precedente invalida" msgid "Premature end of regular expression" msgstr "Fine di espressione regolare inaspettata" +#: regcomp.c:176 +msgid "Regular expression too big" +msgstr "Espressione regolare troppo complessa" + #: regcomp.c:179 msgid "Unmatched ) or \\)" msgstr ") o \\) non aperta" @@ -3499,9 +3532,6 @@ msgstr ") o \\) non aperta" msgid "No previous regular expression" msgstr "Nessuna espressione regolare precedente" -#: symbol.c:741 +#: symbol.c:749 msgid "can not pop main context" msgstr "non posso salire più in alto nello stack" - -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "intervallo della forma `[%c-%c]' dipende da `locale'" -- cgit v1.2.3 From 0585c4e6f3d68846d56fe766675099b539e2cba9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:25:05 +0200 Subject: If a test fails, run make diffout and exit 1. --- test/ChangeLog | 6 ++++++ test/Makefile.am | 2 +- test/Makefile.in | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index a8d12fd7..10fc9490 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2014-12-24 Andrew J. Schorr + + * Makefile.am (check): If tests don't pass, run 'make diffout' + and exit 1. Should help distros that notice when they + have built gawk incorrectly. (Can you say "Fedora", boys and girls?) + 2014-11-26 Arnold D. Robbins * Gentests: Fix gensub call after adding warning. diff --git a/test/Makefile.am b/test/Makefile.am index 3c850125..b9a404ed 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1100,7 +1100,7 @@ check: msg \ charset-msg-start charset-tests charset-msg-end \ shlib-msg-start shlib-tests shlib-msg-end \ mpfr-msg-start mpfr-tests mpfr-msg-end - @$(MAKE) pass-fail + @$(MAKE) pass-fail || { $(MAKE) diffout; exit 1; } basic: $(BASIC_TESTS) diff --git a/test/Makefile.in b/test/Makefile.in index 5a7610ee..f342de9d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1528,7 +1528,7 @@ check: msg \ charset-msg-start charset-tests charset-msg-end \ shlib-msg-start shlib-tests shlib-msg-end \ mpfr-msg-start mpfr-tests mpfr-msg-end - @$(MAKE) pass-fail + @$(MAKE) pass-fail || { $(MAKE) diffout; exit 1; } basic: $(BASIC_TESTS) -- cgit v1.2.3 From 969ee3cbf2255a508eca008c0b25d8a1f09bdeb3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:28:14 +0200 Subject: New test for bad builds (with non-bison). --- test/ChangeLog | 9 +++++++-- test/Makefile.am | 5 ++++- test/Makefile.in | 10 +++++++++- test/Maketests | 5 +++++ test/badbuild.awk | 6 ++++++ test/badbuild.in | 1 + test/badbuild.ok | 3 +++ 7 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 test/badbuild.awk create mode 100644 test/badbuild.in create mode 100644 test/badbuild.ok diff --git a/test/ChangeLog b/test/ChangeLog index 10fc9490..e51148d8 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,8 +1,13 @@ 2014-12-24 Andrew J. Schorr * Makefile.am (check): If tests don't pass, run 'make diffout' - and exit 1. Should help distros that notice when they - have built gawk incorrectly. (Can you say "Fedora", boys and girls?) + and exit 1. Should help distros to notice when they have built + gawk incorrectly. (Can you say "Fedora", boys and girls?) + + Not quite unrelated: + + * Makefile.am (badbuild): New test. + * badbuild.awk, badbuild.in, badbuild.ok: New files. 2014-11-26 Arnold D. Robbins diff --git a/test/Makefile.am b/test/Makefile.am index b9a404ed..b93f851f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -123,6 +123,9 @@ EXTRA_DIST = \ badargs.ok \ badassign1.awk \ badassign1.ok \ + badbuild.awk \ + badbuild.in \ + badbuild.ok \ beginfile1.awk \ beginfile1.ok \ beginfile2.in \ @@ -974,7 +977,7 @@ BASIC_TESTS = \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub badassign1 \ + back89 backgsub badassign1 badbuild \ childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ diff --git a/test/Makefile.in b/test/Makefile.in index f342de9d..7a281eca 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -370,6 +370,9 @@ EXTRA_DIST = \ badargs.ok \ badassign1.awk \ badassign1.ok \ + badbuild.awk \ + badbuild.in \ + badbuild.ok \ beginfile1.awk \ beginfile1.ok \ beginfile2.in \ @@ -1220,7 +1223,7 @@ BASIC_TESTS = \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub badassign1 \ + back89 backgsub badassign1 badbuild \ childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ @@ -2547,6 +2550,11 @@ badassign1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +badbuild: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 85c13d5d..e1b92bf9 100644 --- a/test/Maketests +++ b/test/Maketests @@ -125,6 +125,11 @@ badassign1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +badbuild: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/badbuild.awk b/test/badbuild.awk new file mode 100644 index 00000000..12a6caeb --- /dev/null +++ b/test/badbuild.awk @@ -0,0 +1,6 @@ +$1 == $2 == $3 { + print "Gawk was built incorrectly." + print "Use bison, not byacc or something else!" + print "(Really, why aren't you using the awkgram.c in the distribution?)" + exit 42 +} diff --git a/test/badbuild.in b/test/badbuild.in new file mode 100644 index 00000000..560711d4 --- /dev/null +++ b/test/badbuild.in @@ -0,0 +1 @@ +a a 1 diff --git a/test/badbuild.ok b/test/badbuild.ok new file mode 100644 index 00000000..6d60f5a9 --- /dev/null +++ b/test/badbuild.ok @@ -0,0 +1,3 @@ +gawk: badbuild.awk:1: $1 == $2 == $3 { +gawk: badbuild.awk:1: ^ syntax error +EXIT CODE: 1 -- cgit v1.2.3 From 5db85f61829f0b56001884c59c690200eb07742e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:34:12 +0200 Subject: Fix test/ChangeLog. --- test/ChangeLog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index e51148d8..8d39af74 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,14 +1,14 @@ +2014-12-24 Arnold D. Robbins + + * Makefile.am (badbuild): New test. + * badbuild.awk, badbuild.in, badbuild.ok: New files. + 2014-12-24 Andrew J. Schorr * Makefile.am (check): If tests don't pass, run 'make diffout' and exit 1. Should help distros to notice when they have built gawk incorrectly. (Can you say "Fedora", boys and girls?) - Not quite unrelated: - - * Makefile.am (badbuild): New test. - * badbuild.awk, badbuild.in, badbuild.ok: New files. - 2014-11-26 Arnold D. Robbins * Gentests: Fix gensub call after adding warning. -- cgit v1.2.3 From 399ec4931adce151b7633f2b66b04d021d3ae78c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:38:00 +0200 Subject: Minor bug fix in pretty printing code. --- ChangeLog | 5 +++++ profile.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index a9c7e555..b78fc06e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-12-24 Arnold D. Robbins + + * profile.c (pprint): Be sure to set ip2 in all paths + through the code. Thanks to GCC 4.9 for the warning. + 2014-12-12 Stephen Davies Improve comment handling in pretty printing. diff --git a/profile.c b/profile.c index ad879a3c..233bca0f 100644 --- a/profile.c +++ b/profile.c @@ -246,6 +246,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header) } else { fprintf(prof_fp, "{\n"); ip1 = (pc + 1)->firsti; + ip2 = (pc + 1)->lasti; } ip1 = ip1->nexti; } -- cgit v1.2.3 From 15fba5cef614e836b6ed35543b8e7ae49f52a450 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:41:09 +0200 Subject: Start on doc updates. --- doc/ChangeLog | 4 + doc/gawk.info | 1191 +++++++++++++++++++++++++++++-------------------------- doc/gawk.texi | 92 +++++ doc/gawktexi.in | 92 +++++ 4 files changed, 820 insertions(+), 559 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index e6b14381..d49a77db 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-24 Arnold D. Robbins + + * gawktexi.in: Start documenting nonfatal output. + 2014-12-24 Arnold D. Robbins * gawktexi.in: Add one more paragraph to new foreword. diff --git a/doc/gawk.info b/doc/gawk.info index 37494e64..92495978 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -246,6 +246,7 @@ entitled "GNU Free Documentation License". * Special Caveats:: Things to watch out for. * Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Nonfatal:: Enabling Nonfatal Output. * Output Summary:: Output summary. * Output Exercises:: Exercises. * Values:: Constants, Variables, and Regular @@ -6119,6 +6120,7 @@ function. `gawk' allows access to inherited file descriptors. * Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Nonfatal:: Enabling Nonfatal Output. * Output Summary:: Output summary. * Output Exercises:: Exercises. @@ -7032,7 +7034,7 @@ that `gawk' provides: behavior.  -File: gawk.info, Node: Close Files And Pipes, Next: Output Summary, Prev: Special Files, Up: Printing +File: gawk.info, Node: Close Files And Pipes, Next: Nonfatal, Prev: Special Files, Up: Printing 5.9 Closing Input and Output Redirections ========================================= @@ -7201,9 +7203,56 @@ call. See the system manual pages for information on how to decode this value.  -File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Files And Pipes, Up: Printing +File: gawk.info, Node: Nonfatal, Next: Output Summary, Prev: Close Files And Pipes, Up: Printing -5.10 Summary +5.10 Enabling Nonfatal Output +============================= + +This minor node describes a `gawk'-specific feature. + + In standard `awk', output with `print' or `printf' to a nonexistent +file, or some other I/O error (such as filling up the disk) is a fatal +error. + + $ gawk 'BEGIN { print "hi" > "/no/such/file" }' + error--> gawk: cmd. line:1: fatal: can't redirect to `/no/such/file' (No such file or directory) + + `gawk' makes it possible to detect that an error has occurred, +allowing you to possibly recover from the error, or at least print an +error message of your choosing before exiting. You can do this in one +of two ways: + + * For all output files, by assigning any value to + `PROCINFO["nonfatal"]'. + + * On a per-file basis, by assigning any value to `PROCINFO[FILENAME, + "nonfatal"]'. Here, FILENAME is the name of the file to which you + wish output to be nonfatal. + + Once you have enabled nonfatal output, you must check `ERRNO' after +every relevant `print' or `printf' statement to see if something went +wrong. It is also a good idea to initialize `ERRNO' to zero before +attempting the output. For example: + + $ gawk ' + > BEGIN { + > PROCINFO["nonfatal"] = 1 + > ERRNO = 0 + > print "hi" > "/no/such/file" + > if (ERRNO) { + > print("Output failed:", ERRNO) > "/dev/stderr" + > exit 1 + > } + > }' + error--> Output failed: No such file or directory + + Here, `gawk' did not produce a fatal error; instead it let the `awk' +program code detect the problem and handle it. + + +File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Nonfatal, Up: Printing + +5.11 Summary ============ * The `print' statement prints comma-separated expressions. Each @@ -7225,11 +7274,16 @@ File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Fi For coprocesses, it is possible to close only one direction of the communications. + * Normally errors with `print' or `printf' are fatal. `gawk' lets + you make output errors be nonfatal either for all files or on a + per-file basis. You must then check for errors after every + relevant output statement. +  File: gawk.info, Node: Output Exercises, Prev: Output Summary, Up: Printing -5.11 Exercises +5.12 Exercises ============== 1. Rewrite the program: @@ -26931,6 +26985,24 @@ in POSIX `awk', in the order they were added to `gawk'. Dynamic Extensions::). + Version *FIXME* XXXX introduced the following changes: + + * Changes to `ENVIRON' are reflected into `gawk''s environment and + that of programs that it runs. *Note Auto-set::. + + * The `--pretty-print' option no longer runs the `awk' program too. + FIXME: Add xref. + + * The `igawk' program and its manual page are no longer installed + when `gawk' is built. FIXME: Add xref. + + * The `div()' function. FIXME: Add xref. + + * The maximum number of hexdecimal digits in `\x' escapes is now two. + FIXME: Add xref. + + * Nonfatal output with `print' and `printf'. *Note Nonfatal::. +  File: gawk.info, Node: Common Extensions, Next: Ranges and Locales, Prev: Feature History, Up: Language History @@ -34453,560 +34525,561 @@ Index  Tag Table: Node: Top1204 -Node: Foreword342225 -Node: Foreword446667 -Node: Preface48189 -Ref: Preface-Footnote-151060 -Ref: Preface-Footnote-251167 -Ref: Preface-Footnote-351400 -Node: History51542 -Node: Names53888 -Ref: Names-Footnote-154982 -Node: This Manual55128 -Ref: This Manual-Footnote-161615 -Node: Conventions61715 -Node: Manual History64053 -Ref: Manual History-Footnote-167035 -Ref: Manual History-Footnote-267076 -Node: How To Contribute67150 -Node: Acknowledgments68279 -Node: Getting Started73084 -Node: Running gawk75517 -Node: One-shot76707 -Node: Read Terminal77955 -Node: Long79982 -Node: Executable Scripts81498 -Ref: Executable Scripts-Footnote-184287 -Node: Comments84390 -Node: Quoting86872 -Node: DOS Quoting92396 -Node: Sample Data Files93071 -Node: Very Simple95666 -Node: Two Rules100564 -Node: More Complex102450 -Node: Statements/Lines105312 -Ref: Statements/Lines-Footnote-1109767 -Node: Other Features110032 -Node: When110963 -Ref: When-Footnote-1112717 -Node: Intro Summary112782 -Node: Invoking Gawk113665 -Node: Command Line115179 -Node: Options115977 -Ref: Options-Footnote-1131781 -Ref: Options-Footnote-2132010 -Node: Other Arguments132035 -Node: Naming Standard Input134983 -Node: Environment Variables136076 -Node: AWKPATH Variable136634 -Ref: AWKPATH Variable-Footnote-1140047 -Ref: AWKPATH Variable-Footnote-2140092 -Node: AWKLIBPATH Variable140352 -Node: Other Environment Variables141608 -Node: Exit Status145096 -Node: Include Files145772 -Node: Loading Shared Libraries149369 -Node: Obsolete150796 -Node: Undocumented151493 -Node: Invoking Summary151760 -Node: Regexp153424 -Node: Regexp Usage154878 -Node: Escape Sequences156915 -Node: Regexp Operators163156 -Ref: Regexp Operators-Footnote-1170582 -Ref: Regexp Operators-Footnote-2170729 -Node: Bracket Expressions170827 -Ref: table-char-classes172842 -Node: Leftmost Longest175766 -Node: Computed Regexps177068 -Node: GNU Regexp Operators180465 -Node: Case-sensitivity184138 -Ref: Case-sensitivity-Footnote-1187023 -Ref: Case-sensitivity-Footnote-2187258 -Node: Regexp Summary187366 -Node: Reading Files188833 -Node: Records190927 -Node: awk split records191660 -Node: gawk split records196575 -Ref: gawk split records-Footnote-1201119 -Node: Fields201156 -Ref: Fields-Footnote-1203932 -Node: Nonconstant Fields204018 -Ref: Nonconstant Fields-Footnote-1206261 -Node: Changing Fields206465 -Node: Field Separators212394 -Node: Default Field Splitting215099 -Node: Regexp Field Splitting216216 -Node: Single Character Fields219566 -Node: Command Line Field Separator220625 -Node: Full Line Fields223837 -Ref: Full Line Fields-Footnote-1225354 -Ref: Full Line Fields-Footnote-2225400 -Node: Field Splitting Summary225501 -Node: Constant Size227575 -Node: Splitting By Content232164 -Ref: Splitting By Content-Footnote-1236158 -Node: Multiple Line236321 -Ref: Multiple Line-Footnote-1242207 -Node: Getline242386 -Node: Plain Getline244598 -Node: Getline/Variable247238 -Node: Getline/File248386 -Node: Getline/Variable/File249770 -Ref: Getline/Variable/File-Footnote-1251373 -Node: Getline/Pipe251460 -Node: Getline/Variable/Pipe254143 -Node: Getline/Coprocess255274 -Node: Getline/Variable/Coprocess256526 -Node: Getline Notes257265 -Node: Getline Summary260057 -Ref: table-getline-variants260469 -Node: Read Timeout261298 -Ref: Read Timeout-Footnote-1265123 -Node: Command-line directories265181 -Node: Input Summary266086 -Node: Input Exercises269387 -Node: Printing270115 -Node: Print271892 -Node: Print Examples273349 -Node: Output Separators276128 -Node: OFMT278146 -Node: Printf279500 -Node: Basic Printf280285 -Node: Control Letters281855 -Node: Format Modifiers285838 -Node: Printf Examples291847 -Node: Redirection294333 -Node: Special FD301174 -Ref: Special FD-Footnote-1304334 -Node: Special Files304408 -Node: Other Inherited Files305025 -Node: Special Network306025 -Node: Special Caveats306887 -Node: Close Files And Pipes307838 -Ref: Close Files And Pipes-Footnote-1315020 -Ref: Close Files And Pipes-Footnote-2315168 -Node: Output Summary315318 -Node: Output Exercises316316 -Node: Expressions316996 -Node: Values318181 -Node: Constants318859 -Node: Scalar Constants319550 -Ref: Scalar Constants-Footnote-1320409 -Node: Nondecimal-numbers320659 -Node: Regexp Constants323677 -Node: Using Constant Regexps324202 -Node: Variables327345 -Node: Using Variables328000 -Node: Assignment Options329911 -Node: Conversion331786 -Node: Strings And Numbers332310 -Ref: Strings And Numbers-Footnote-1335375 -Node: Locale influences conversions335484 -Ref: table-locale-affects338231 -Node: All Operators338819 -Node: Arithmetic Ops339449 -Node: Concatenation341954 -Ref: Concatenation-Footnote-1344773 -Node: Assignment Ops344879 -Ref: table-assign-ops349858 -Node: Increment Ops351130 -Node: Truth Values and Conditions354568 -Node: Truth Values355653 -Node: Typing and Comparison356702 -Node: Variable Typing357512 -Node: Comparison Operators361165 -Ref: table-relational-ops361575 -Node: POSIX String Comparison365070 -Ref: POSIX String Comparison-Footnote-1366142 -Node: Boolean Ops366280 -Ref: Boolean Ops-Footnote-1370759 -Node: Conditional Exp370850 -Node: Function Calls372577 -Node: Precedence376457 -Node: Locales380118 -Node: Expressions Summary381750 -Node: Patterns and Actions384310 -Node: Pattern Overview385430 -Node: Regexp Patterns387109 -Node: Expression Patterns387652 -Node: Ranges391362 -Node: BEGIN/END394468 -Node: Using BEGIN/END395229 -Ref: Using BEGIN/END-Footnote-1397963 -Node: I/O And BEGIN/END398069 -Node: BEGINFILE/ENDFILE400383 -Node: Empty403284 -Node: Using Shell Variables403601 -Node: Action Overview405874 -Node: Statements408200 -Node: If Statement410048 -Node: While Statement411543 -Node: Do Statement413572 -Node: For Statement414716 -Node: Switch Statement417873 -Node: Break Statement420255 -Node: Continue Statement422296 -Node: Next Statement424123 -Node: Nextfile Statement426504 -Node: Exit Statement429134 -Node: Built-in Variables431537 -Node: User-modified432670 -Ref: User-modified-Footnote-1440351 -Node: Auto-set440413 -Ref: Auto-set-Footnote-1454105 -Ref: Auto-set-Footnote-2454310 -Node: ARGC and ARGV454366 -Node: Pattern Action Summary458584 -Node: Arrays461011 -Node: Array Basics462340 -Node: Array Intro463184 -Ref: figure-array-elements465148 -Ref: Array Intro-Footnote-1467674 -Node: Reference to Elements467802 -Node: Assigning Elements470254 -Node: Array Example470745 -Node: Scanning an Array472503 -Node: Controlling Scanning475519 -Ref: Controlling Scanning-Footnote-1480715 -Node: Numeric Array Subscripts481031 -Node: Uninitialized Subscripts483216 -Node: Delete484833 -Ref: Delete-Footnote-1487576 -Node: Multidimensional487633 -Node: Multiscanning490730 -Node: Arrays of Arrays492319 -Node: Arrays Summary497078 -Node: Functions499170 -Node: Built-in500069 -Node: Calling Built-in501147 -Node: Numeric Functions503138 -Ref: Numeric Functions-Footnote-1507957 -Ref: Numeric Functions-Footnote-2508314 -Ref: Numeric Functions-Footnote-3508362 -Node: String Functions508634 -Ref: String Functions-Footnote-1532109 -Ref: String Functions-Footnote-2532238 -Ref: String Functions-Footnote-3532486 -Node: Gory Details532573 -Ref: table-sub-escapes534354 -Ref: table-sub-proposed535874 -Ref: table-posix-sub537238 -Ref: table-gensub-escapes538774 -Ref: Gory Details-Footnote-1539606 -Node: I/O Functions539757 -Ref: I/O Functions-Footnote-1546975 -Node: Time Functions547122 -Ref: Time Functions-Footnote-1557610 -Ref: Time Functions-Footnote-2557678 -Ref: Time Functions-Footnote-3557836 -Ref: Time Functions-Footnote-4557947 -Ref: Time Functions-Footnote-5558059 -Ref: Time Functions-Footnote-6558286 -Node: Bitwise Functions558552 -Ref: table-bitwise-ops559114 -Ref: Bitwise Functions-Footnote-1563423 -Node: Type Functions563592 -Node: I18N Functions564743 -Node: User-defined566388 -Node: Definition Syntax567193 -Ref: Definition Syntax-Footnote-1572600 -Node: Function Example572671 -Ref: Function Example-Footnote-1575590 -Node: Function Caveats575612 -Node: Calling A Function576130 -Node: Variable Scope577088 -Node: Pass By Value/Reference580076 -Node: Return Statement583571 -Node: Dynamic Typing586552 -Node: Indirect Calls587481 -Ref: Indirect Calls-Footnote-1598783 -Node: Functions Summary598911 -Node: Library Functions601613 -Ref: Library Functions-Footnote-1605222 -Ref: Library Functions-Footnote-2605365 -Node: Library Names605536 -Ref: Library Names-Footnote-1608990 -Ref: Library Names-Footnote-2609213 -Node: General Functions609299 -Node: Strtonum Function610402 -Node: Assert Function613424 -Node: Round Function616748 -Node: Cliff Random Function618289 -Node: Ordinal Functions619305 -Ref: Ordinal Functions-Footnote-1622368 -Ref: Ordinal Functions-Footnote-2622620 -Node: Join Function622831 -Ref: Join Function-Footnote-1624600 -Node: Getlocaltime Function624800 -Node: Readfile Function628544 -Node: Shell Quoting630514 -Node: Data File Management631915 -Node: Filetrans Function632547 -Node: Rewind Function636603 -Node: File Checking637990 -Ref: File Checking-Footnote-1639322 -Node: Empty Files639523 -Node: Ignoring Assigns641502 -Node: Getopt Function643053 -Ref: Getopt Function-Footnote-1654515 -Node: Passwd Functions654715 -Ref: Passwd Functions-Footnote-1663552 -Node: Group Functions663640 -Ref: Group Functions-Footnote-1671534 -Node: Walking Arrays671747 -Node: Library Functions Summary673350 -Node: Library Exercises674751 -Node: Sample Programs676031 -Node: Running Examples676801 -Node: Clones677529 -Node: Cut Program678753 -Node: Egrep Program688472 -Ref: Egrep Program-Footnote-1695970 -Node: Id Program696080 -Node: Split Program699725 -Ref: Split Program-Footnote-1703173 -Node: Tee Program703301 -Node: Uniq Program706090 -Node: Wc Program713509 -Ref: Wc Program-Footnote-1717759 -Node: Miscellaneous Programs717853 -Node: Dupword Program719066 -Node: Alarm Program721097 -Node: Translate Program725901 -Ref: Translate Program-Footnote-1730466 -Node: Labels Program730736 -Ref: Labels Program-Footnote-1734087 -Node: Word Sorting734171 -Node: History Sorting738242 -Node: Extract Program740078 -Node: Simple Sed747603 -Node: Igawk Program750671 -Ref: Igawk Program-Footnote-1764995 -Ref: Igawk Program-Footnote-2765196 -Ref: Igawk Program-Footnote-3765318 -Node: Anagram Program765433 -Node: Signature Program768490 -Node: Programs Summary769737 -Node: Programs Exercises770930 -Ref: Programs Exercises-Footnote-1775061 -Node: Advanced Features775152 -Node: Nondecimal Data777100 -Node: Array Sorting778690 -Node: Controlling Array Traversal779387 -Ref: Controlling Array Traversal-Footnote-1787720 -Node: Array Sorting Functions787838 -Ref: Array Sorting Functions-Footnote-1791727 -Node: Two-way I/O791923 -Ref: Two-way I/O-Footnote-1796868 -Ref: Two-way I/O-Footnote-2797054 -Node: TCP/IP Networking797136 -Node: Profiling800009 -Node: Advanced Features Summary808286 -Node: Internationalization810219 -Node: I18N and L10N811699 -Node: Explaining gettext812385 -Ref: Explaining gettext-Footnote-1817410 -Ref: Explaining gettext-Footnote-2817594 -Node: Programmer i18n817759 -Ref: Programmer i18n-Footnote-1822625 -Node: Translator i18n822674 -Node: String Extraction823468 -Ref: String Extraction-Footnote-1824599 -Node: Printf Ordering824685 -Ref: Printf Ordering-Footnote-1827471 -Node: I18N Portability827535 -Ref: I18N Portability-Footnote-1829990 -Node: I18N Example830053 -Ref: I18N Example-Footnote-1832856 -Node: Gawk I18N832928 -Node: I18N Summary833566 -Node: Debugger834905 -Node: Debugging835927 -Node: Debugging Concepts836368 -Node: Debugging Terms838221 -Node: Awk Debugging840793 -Node: Sample Debugging Session841687 -Node: Debugger Invocation842207 -Node: Finding The Bug843591 -Node: List of Debugger Commands850066 -Node: Breakpoint Control851399 -Node: Debugger Execution Control855095 -Node: Viewing And Changing Data858459 -Node: Execution Stack861837 -Node: Debugger Info863474 -Node: Miscellaneous Debugger Commands867491 -Node: Readline Support872520 -Node: Limitations873412 -Node: Debugging Summary875526 -Node: Arbitrary Precision Arithmetic876694 -Node: Computer Arithmetic878110 -Ref: table-numeric-ranges881708 -Ref: Computer Arithmetic-Footnote-1882567 -Node: Math Definitions882624 -Ref: table-ieee-formats885912 -Ref: Math Definitions-Footnote-1886516 -Node: MPFR features886621 -Node: FP Math Caution888292 -Ref: FP Math Caution-Footnote-1889342 -Node: Inexactness of computations889711 -Node: Inexact representation890670 -Node: Comparing FP Values892027 -Node: Errors accumulate893109 -Node: Getting Accuracy894542 -Node: Try To Round897204 -Node: Setting precision898103 -Ref: table-predefined-precision-strings898787 -Node: Setting the rounding mode900576 -Ref: table-gawk-rounding-modes900940 -Ref: Setting the rounding mode-Footnote-1904395 -Node: Arbitrary Precision Integers904574 -Ref: Arbitrary Precision Integers-Footnote-1909473 -Node: POSIX Floating Point Problems909622 -Ref: POSIX Floating Point Problems-Footnote-1913495 -Node: Floating point summary913533 -Node: Dynamic Extensions915727 -Node: Extension Intro917279 -Node: Plugin License918545 -Node: Extension Mechanism Outline919342 -Ref: figure-load-extension919770 -Ref: figure-register-new-function921250 -Ref: figure-call-new-function922254 -Node: Extension API Description924240 -Node: Extension API Functions Introduction925690 -Node: General Data Types930514 -Ref: General Data Types-Footnote-1936253 -Node: Memory Allocation Functions936552 -Ref: Memory Allocation Functions-Footnote-1939391 -Node: Constructor Functions939487 -Node: Registration Functions941221 -Node: Extension Functions941906 -Node: Exit Callback Functions944203 -Node: Extension Version String945451 -Node: Input Parsers946116 -Node: Output Wrappers955995 -Node: Two-way processors960510 -Node: Printing Messages962714 -Ref: Printing Messages-Footnote-1963790 -Node: Updating `ERRNO'963942 -Node: Requesting Values964682 -Ref: table-value-types-returned965410 -Node: Accessing Parameters966367 -Node: Symbol Table Access967598 -Node: Symbol table by name968112 -Node: Symbol table by cookie970093 -Ref: Symbol table by cookie-Footnote-1974237 -Node: Cached values974300 -Ref: Cached values-Footnote-1977799 -Node: Array Manipulation977890 -Ref: Array Manipulation-Footnote-1978988 -Node: Array Data Types979025 -Ref: Array Data Types-Footnote-1981680 -Node: Array Functions981772 -Node: Flattening Arrays985626 -Node: Creating Arrays992518 -Node: Extension API Variables997289 -Node: Extension Versioning997925 -Node: Extension API Informational Variables999826 -Node: Extension API Boilerplate1000891 -Node: Finding Extensions1004700 -Node: Extension Example1005260 -Node: Internal File Description1006032 -Node: Internal File Ops1010099 -Ref: Internal File Ops-Footnote-11021769 -Node: Using Internal File Ops1021909 -Ref: Using Internal File Ops-Footnote-11024292 -Node: Extension Samples1024565 -Node: Extension Sample File Functions1026091 -Node: Extension Sample Fnmatch1033729 -Node: Extension Sample Fork1035220 -Node: Extension Sample Inplace1036435 -Node: Extension Sample Ord1038110 -Node: Extension Sample Readdir1038946 -Ref: table-readdir-file-types1039822 -Node: Extension Sample Revout1040633 -Node: Extension Sample Rev2way1041223 -Node: Extension Sample Read write array1041963 -Node: Extension Sample Readfile1043903 -Node: Extension Sample Time1044998 -Node: Extension Sample API Tests1046347 -Node: gawkextlib1046838 -Node: Extension summary1049496 -Node: Extension Exercises1053185 -Node: Language History1053907 -Node: V7/SVR3.11055563 -Node: SVR41057744 -Node: POSIX1059189 -Node: BTL1060578 -Node: POSIX/GNU1061312 -Node: Feature History1066936 -Node: Common Extensions1080034 -Node: Ranges and Locales1081358 -Ref: Ranges and Locales-Footnote-11085976 -Ref: Ranges and Locales-Footnote-21086003 -Ref: Ranges and Locales-Footnote-31086237 -Node: Contributors1086458 -Node: History summary1091999 -Node: Installation1093369 -Node: Gawk Distribution1094315 -Node: Getting1094799 -Node: Extracting1095622 -Node: Distribution contents1097257 -Node: Unix Installation1103322 -Node: Quick Installation1104005 -Node: Shell Startup Files1106416 -Node: Additional Configuration Options1107495 -Node: Configuration Philosophy1109234 -Node: Non-Unix Installation1111603 -Node: PC Installation1112061 -Node: PC Binary Installation1113380 -Node: PC Compiling1115228 -Ref: PC Compiling-Footnote-11118249 -Node: PC Testing1118358 -Node: PC Using1119534 -Node: Cygwin1123649 -Node: MSYS1124472 -Node: VMS Installation1124972 -Node: VMS Compilation1125764 -Ref: VMS Compilation-Footnote-11126986 -Node: VMS Dynamic Extensions1127044 -Node: VMS Installation Details1128728 -Node: VMS Running1130980 -Node: VMS GNV1133816 -Node: VMS Old Gawk1134550 -Node: Bugs1135020 -Node: Other Versions1138903 -Node: Installation summary1145331 -Node: Notes1146387 -Node: Compatibility Mode1147252 -Node: Additions1148034 -Node: Accessing The Source1148959 -Node: Adding Code1150395 -Node: New Ports1156560 -Node: Derived Files1161042 -Ref: Derived Files-Footnote-11166517 -Ref: Derived Files-Footnote-21166551 -Ref: Derived Files-Footnote-31167147 -Node: Future Extensions1167261 -Node: Implementation Limitations1167867 -Node: Extension Design1169115 -Node: Old Extension Problems1170269 -Ref: Old Extension Problems-Footnote-11171786 -Node: Extension New Mechanism Goals1171843 -Ref: Extension New Mechanism Goals-Footnote-11175203 -Node: Extension Other Design Decisions1175392 -Node: Extension Future Growth1177500 -Node: Old Extension Mechanism1178336 -Node: Notes summary1180098 -Node: Basic Concepts1181284 -Node: Basic High Level1181965 -Ref: figure-general-flow1182237 -Ref: figure-process-flow1182836 -Ref: Basic High Level-Footnote-11186065 -Node: Basic Data Typing1186250 -Node: Glossary1189578 -Node: Copying1214736 -Node: GNU Free Documentation License1252292 -Node: Index1277428 +Node: Foreword342291 +Node: Foreword446733 +Node: Preface48255 +Ref: Preface-Footnote-151126 +Ref: Preface-Footnote-251233 +Ref: Preface-Footnote-351466 +Node: History51608 +Node: Names53954 +Ref: Names-Footnote-155048 +Node: This Manual55194 +Ref: This Manual-Footnote-161681 +Node: Conventions61781 +Node: Manual History64119 +Ref: Manual History-Footnote-167101 +Ref: Manual History-Footnote-267142 +Node: How To Contribute67216 +Node: Acknowledgments68345 +Node: Getting Started73150 +Node: Running gawk75583 +Node: One-shot76773 +Node: Read Terminal78021 +Node: Long80048 +Node: Executable Scripts81564 +Ref: Executable Scripts-Footnote-184353 +Node: Comments84456 +Node: Quoting86938 +Node: DOS Quoting92462 +Node: Sample Data Files93137 +Node: Very Simple95732 +Node: Two Rules100630 +Node: More Complex102516 +Node: Statements/Lines105378 +Ref: Statements/Lines-Footnote-1109833 +Node: Other Features110098 +Node: When111029 +Ref: When-Footnote-1112783 +Node: Intro Summary112848 +Node: Invoking Gawk113731 +Node: Command Line115245 +Node: Options116043 +Ref: Options-Footnote-1131847 +Ref: Options-Footnote-2132076 +Node: Other Arguments132101 +Node: Naming Standard Input135049 +Node: Environment Variables136142 +Node: AWKPATH Variable136700 +Ref: AWKPATH Variable-Footnote-1140113 +Ref: AWKPATH Variable-Footnote-2140158 +Node: AWKLIBPATH Variable140418 +Node: Other Environment Variables141674 +Node: Exit Status145162 +Node: Include Files145838 +Node: Loading Shared Libraries149435 +Node: Obsolete150862 +Node: Undocumented151559 +Node: Invoking Summary151826 +Node: Regexp153490 +Node: Regexp Usage154944 +Node: Escape Sequences156981 +Node: Regexp Operators163222 +Ref: Regexp Operators-Footnote-1170648 +Ref: Regexp Operators-Footnote-2170795 +Node: Bracket Expressions170893 +Ref: table-char-classes172908 +Node: Leftmost Longest175832 +Node: Computed Regexps177134 +Node: GNU Regexp Operators180531 +Node: Case-sensitivity184204 +Ref: Case-sensitivity-Footnote-1187089 +Ref: Case-sensitivity-Footnote-2187324 +Node: Regexp Summary187432 +Node: Reading Files188899 +Node: Records190993 +Node: awk split records191726 +Node: gawk split records196641 +Ref: gawk split records-Footnote-1201185 +Node: Fields201222 +Ref: Fields-Footnote-1203998 +Node: Nonconstant Fields204084 +Ref: Nonconstant Fields-Footnote-1206327 +Node: Changing Fields206531 +Node: Field Separators212460 +Node: Default Field Splitting215165 +Node: Regexp Field Splitting216282 +Node: Single Character Fields219632 +Node: Command Line Field Separator220691 +Node: Full Line Fields223903 +Ref: Full Line Fields-Footnote-1225420 +Ref: Full Line Fields-Footnote-2225466 +Node: Field Splitting Summary225567 +Node: Constant Size227641 +Node: Splitting By Content232230 +Ref: Splitting By Content-Footnote-1236224 +Node: Multiple Line236387 +Ref: Multiple Line-Footnote-1242273 +Node: Getline242452 +Node: Plain Getline244664 +Node: Getline/Variable247304 +Node: Getline/File248452 +Node: Getline/Variable/File249836 +Ref: Getline/Variable/File-Footnote-1251439 +Node: Getline/Pipe251526 +Node: Getline/Variable/Pipe254209 +Node: Getline/Coprocess255340 +Node: Getline/Variable/Coprocess256592 +Node: Getline Notes257331 +Node: Getline Summary260123 +Ref: table-getline-variants260535 +Node: Read Timeout261364 +Ref: Read Timeout-Footnote-1265189 +Node: Command-line directories265247 +Node: Input Summary266152 +Node: Input Exercises269453 +Node: Printing270181 +Node: Print272016 +Node: Print Examples273473 +Node: Output Separators276252 +Node: OFMT278270 +Node: Printf279624 +Node: Basic Printf280409 +Node: Control Letters281979 +Node: Format Modifiers285962 +Node: Printf Examples291971 +Node: Redirection294457 +Node: Special FD301298 +Ref: Special FD-Footnote-1304458 +Node: Special Files304532 +Node: Other Inherited Files305149 +Node: Special Network306149 +Node: Special Caveats307011 +Node: Close Files And Pipes307962 +Ref: Close Files And Pipes-Footnote-1315138 +Ref: Close Files And Pipes-Footnote-2315286 +Node: Nonfatal315436 +Node: Output Summary317122 +Node: Output Exercises318343 +Node: Expressions319023 +Node: Values320208 +Node: Constants320886 +Node: Scalar Constants321577 +Ref: Scalar Constants-Footnote-1322436 +Node: Nondecimal-numbers322686 +Node: Regexp Constants325704 +Node: Using Constant Regexps326229 +Node: Variables329372 +Node: Using Variables330027 +Node: Assignment Options331938 +Node: Conversion333813 +Node: Strings And Numbers334337 +Ref: Strings And Numbers-Footnote-1337402 +Node: Locale influences conversions337511 +Ref: table-locale-affects340258 +Node: All Operators340846 +Node: Arithmetic Ops341476 +Node: Concatenation343981 +Ref: Concatenation-Footnote-1346800 +Node: Assignment Ops346906 +Ref: table-assign-ops351885 +Node: Increment Ops353157 +Node: Truth Values and Conditions356595 +Node: Truth Values357680 +Node: Typing and Comparison358729 +Node: Variable Typing359539 +Node: Comparison Operators363192 +Ref: table-relational-ops363602 +Node: POSIX String Comparison367097 +Ref: POSIX String Comparison-Footnote-1368169 +Node: Boolean Ops368307 +Ref: Boolean Ops-Footnote-1372786 +Node: Conditional Exp372877 +Node: Function Calls374604 +Node: Precedence378484 +Node: Locales382145 +Node: Expressions Summary383777 +Node: Patterns and Actions386337 +Node: Pattern Overview387457 +Node: Regexp Patterns389136 +Node: Expression Patterns389679 +Node: Ranges393389 +Node: BEGIN/END396495 +Node: Using BEGIN/END397256 +Ref: Using BEGIN/END-Footnote-1399990 +Node: I/O And BEGIN/END400096 +Node: BEGINFILE/ENDFILE402410 +Node: Empty405311 +Node: Using Shell Variables405628 +Node: Action Overview407901 +Node: Statements410227 +Node: If Statement412075 +Node: While Statement413570 +Node: Do Statement415599 +Node: For Statement416743 +Node: Switch Statement419900 +Node: Break Statement422282 +Node: Continue Statement424323 +Node: Next Statement426150 +Node: Nextfile Statement428531 +Node: Exit Statement431161 +Node: Built-in Variables433564 +Node: User-modified434697 +Ref: User-modified-Footnote-1442378 +Node: Auto-set442440 +Ref: Auto-set-Footnote-1456132 +Ref: Auto-set-Footnote-2456337 +Node: ARGC and ARGV456393 +Node: Pattern Action Summary460611 +Node: Arrays463038 +Node: Array Basics464367 +Node: Array Intro465211 +Ref: figure-array-elements467175 +Ref: Array Intro-Footnote-1469701 +Node: Reference to Elements469829 +Node: Assigning Elements472281 +Node: Array Example472772 +Node: Scanning an Array474530 +Node: Controlling Scanning477546 +Ref: Controlling Scanning-Footnote-1482742 +Node: Numeric Array Subscripts483058 +Node: Uninitialized Subscripts485243 +Node: Delete486860 +Ref: Delete-Footnote-1489603 +Node: Multidimensional489660 +Node: Multiscanning492757 +Node: Arrays of Arrays494346 +Node: Arrays Summary499105 +Node: Functions501197 +Node: Built-in502096 +Node: Calling Built-in503174 +Node: Numeric Functions505165 +Ref: Numeric Functions-Footnote-1509984 +Ref: Numeric Functions-Footnote-2510341 +Ref: Numeric Functions-Footnote-3510389 +Node: String Functions510661 +Ref: String Functions-Footnote-1534136 +Ref: String Functions-Footnote-2534265 +Ref: String Functions-Footnote-3534513 +Node: Gory Details534600 +Ref: table-sub-escapes536381 +Ref: table-sub-proposed537901 +Ref: table-posix-sub539265 +Ref: table-gensub-escapes540801 +Ref: Gory Details-Footnote-1541633 +Node: I/O Functions541784 +Ref: I/O Functions-Footnote-1549002 +Node: Time Functions549149 +Ref: Time Functions-Footnote-1559637 +Ref: Time Functions-Footnote-2559705 +Ref: Time Functions-Footnote-3559863 +Ref: Time Functions-Footnote-4559974 +Ref: Time Functions-Footnote-5560086 +Ref: Time Functions-Footnote-6560313 +Node: Bitwise Functions560579 +Ref: table-bitwise-ops561141 +Ref: Bitwise Functions-Footnote-1565450 +Node: Type Functions565619 +Node: I18N Functions566770 +Node: User-defined568415 +Node: Definition Syntax569220 +Ref: Definition Syntax-Footnote-1574627 +Node: Function Example574698 +Ref: Function Example-Footnote-1577617 +Node: Function Caveats577639 +Node: Calling A Function578157 +Node: Variable Scope579115 +Node: Pass By Value/Reference582103 +Node: Return Statement585598 +Node: Dynamic Typing588579 +Node: Indirect Calls589508 +Ref: Indirect Calls-Footnote-1600810 +Node: Functions Summary600938 +Node: Library Functions603640 +Ref: Library Functions-Footnote-1607249 +Ref: Library Functions-Footnote-2607392 +Node: Library Names607563 +Ref: Library Names-Footnote-1611017 +Ref: Library Names-Footnote-2611240 +Node: General Functions611326 +Node: Strtonum Function612429 +Node: Assert Function615451 +Node: Round Function618775 +Node: Cliff Random Function620316 +Node: Ordinal Functions621332 +Ref: Ordinal Functions-Footnote-1624395 +Ref: Ordinal Functions-Footnote-2624647 +Node: Join Function624858 +Ref: Join Function-Footnote-1626627 +Node: Getlocaltime Function626827 +Node: Readfile Function630571 +Node: Shell Quoting632541 +Node: Data File Management633942 +Node: Filetrans Function634574 +Node: Rewind Function638630 +Node: File Checking640017 +Ref: File Checking-Footnote-1641349 +Node: Empty Files641550 +Node: Ignoring Assigns643529 +Node: Getopt Function645080 +Ref: Getopt Function-Footnote-1656542 +Node: Passwd Functions656742 +Ref: Passwd Functions-Footnote-1665579 +Node: Group Functions665667 +Ref: Group Functions-Footnote-1673561 +Node: Walking Arrays673774 +Node: Library Functions Summary675377 +Node: Library Exercises676778 +Node: Sample Programs678058 +Node: Running Examples678828 +Node: Clones679556 +Node: Cut Program680780 +Node: Egrep Program690499 +Ref: Egrep Program-Footnote-1697997 +Node: Id Program698107 +Node: Split Program701752 +Ref: Split Program-Footnote-1705200 +Node: Tee Program705328 +Node: Uniq Program708117 +Node: Wc Program715536 +Ref: Wc Program-Footnote-1719786 +Node: Miscellaneous Programs719880 +Node: Dupword Program721093 +Node: Alarm Program723124 +Node: Translate Program727928 +Ref: Translate Program-Footnote-1732493 +Node: Labels Program732763 +Ref: Labels Program-Footnote-1736114 +Node: Word Sorting736198 +Node: History Sorting740269 +Node: Extract Program742105 +Node: Simple Sed749630 +Node: Igawk Program752698 +Ref: Igawk Program-Footnote-1767022 +Ref: Igawk Program-Footnote-2767223 +Ref: Igawk Program-Footnote-3767345 +Node: Anagram Program767460 +Node: Signature Program770517 +Node: Programs Summary771764 +Node: Programs Exercises772957 +Ref: Programs Exercises-Footnote-1777088 +Node: Advanced Features777179 +Node: Nondecimal Data779127 +Node: Array Sorting780717 +Node: Controlling Array Traversal781414 +Ref: Controlling Array Traversal-Footnote-1789747 +Node: Array Sorting Functions789865 +Ref: Array Sorting Functions-Footnote-1793754 +Node: Two-way I/O793950 +Ref: Two-way I/O-Footnote-1798895 +Ref: Two-way I/O-Footnote-2799081 +Node: TCP/IP Networking799163 +Node: Profiling802036 +Node: Advanced Features Summary810313 +Node: Internationalization812246 +Node: I18N and L10N813726 +Node: Explaining gettext814412 +Ref: Explaining gettext-Footnote-1819437 +Ref: Explaining gettext-Footnote-2819621 +Node: Programmer i18n819786 +Ref: Programmer i18n-Footnote-1824652 +Node: Translator i18n824701 +Node: String Extraction825495 +Ref: String Extraction-Footnote-1826626 +Node: Printf Ordering826712 +Ref: Printf Ordering-Footnote-1829498 +Node: I18N Portability829562 +Ref: I18N Portability-Footnote-1832017 +Node: I18N Example832080 +Ref: I18N Example-Footnote-1834883 +Node: Gawk I18N834955 +Node: I18N Summary835593 +Node: Debugger836932 +Node: Debugging837954 +Node: Debugging Concepts838395 +Node: Debugging Terms840248 +Node: Awk Debugging842820 +Node: Sample Debugging Session843714 +Node: Debugger Invocation844234 +Node: Finding The Bug845618 +Node: List of Debugger Commands852093 +Node: Breakpoint Control853426 +Node: Debugger Execution Control857122 +Node: Viewing And Changing Data860486 +Node: Execution Stack863864 +Node: Debugger Info865501 +Node: Miscellaneous Debugger Commands869518 +Node: Readline Support874547 +Node: Limitations875439 +Node: Debugging Summary877553 +Node: Arbitrary Precision Arithmetic878721 +Node: Computer Arithmetic880137 +Ref: table-numeric-ranges883735 +Ref: Computer Arithmetic-Footnote-1884594 +Node: Math Definitions884651 +Ref: table-ieee-formats887939 +Ref: Math Definitions-Footnote-1888543 +Node: MPFR features888648 +Node: FP Math Caution890319 +Ref: FP Math Caution-Footnote-1891369 +Node: Inexactness of computations891738 +Node: Inexact representation892697 +Node: Comparing FP Values894054 +Node: Errors accumulate895136 +Node: Getting Accuracy896569 +Node: Try To Round899231 +Node: Setting precision900130 +Ref: table-predefined-precision-strings900814 +Node: Setting the rounding mode902603 +Ref: table-gawk-rounding-modes902967 +Ref: Setting the rounding mode-Footnote-1906422 +Node: Arbitrary Precision Integers906601 +Ref: Arbitrary Precision Integers-Footnote-1911500 +Node: POSIX Floating Point Problems911649 +Ref: POSIX Floating Point Problems-Footnote-1915522 +Node: Floating point summary915560 +Node: Dynamic Extensions917754 +Node: Extension Intro919306 +Node: Plugin License920572 +Node: Extension Mechanism Outline921369 +Ref: figure-load-extension921797 +Ref: figure-register-new-function923277 +Ref: figure-call-new-function924281 +Node: Extension API Description926267 +Node: Extension API Functions Introduction927717 +Node: General Data Types932541 +Ref: General Data Types-Footnote-1938280 +Node: Memory Allocation Functions938579 +Ref: Memory Allocation Functions-Footnote-1941418 +Node: Constructor Functions941514 +Node: Registration Functions943248 +Node: Extension Functions943933 +Node: Exit Callback Functions946230 +Node: Extension Version String947478 +Node: Input Parsers948143 +Node: Output Wrappers958022 +Node: Two-way processors962537 +Node: Printing Messages964741 +Ref: Printing Messages-Footnote-1965817 +Node: Updating `ERRNO'965969 +Node: Requesting Values966709 +Ref: table-value-types-returned967437 +Node: Accessing Parameters968394 +Node: Symbol Table Access969625 +Node: Symbol table by name970139 +Node: Symbol table by cookie972120 +Ref: Symbol table by cookie-Footnote-1976264 +Node: Cached values976327 +Ref: Cached values-Footnote-1979826 +Node: Array Manipulation979917 +Ref: Array Manipulation-Footnote-1981015 +Node: Array Data Types981052 +Ref: Array Data Types-Footnote-1983707 +Node: Array Functions983799 +Node: Flattening Arrays987653 +Node: Creating Arrays994545 +Node: Extension API Variables999316 +Node: Extension Versioning999952 +Node: Extension API Informational Variables1001853 +Node: Extension API Boilerplate1002918 +Node: Finding Extensions1006727 +Node: Extension Example1007287 +Node: Internal File Description1008059 +Node: Internal File Ops1012126 +Ref: Internal File Ops-Footnote-11023796 +Node: Using Internal File Ops1023936 +Ref: Using Internal File Ops-Footnote-11026319 +Node: Extension Samples1026592 +Node: Extension Sample File Functions1028118 +Node: Extension Sample Fnmatch1035756 +Node: Extension Sample Fork1037247 +Node: Extension Sample Inplace1038462 +Node: Extension Sample Ord1040137 +Node: Extension Sample Readdir1040973 +Ref: table-readdir-file-types1041849 +Node: Extension Sample Revout1042660 +Node: Extension Sample Rev2way1043250 +Node: Extension Sample Read write array1043990 +Node: Extension Sample Readfile1045930 +Node: Extension Sample Time1047025 +Node: Extension Sample API Tests1048374 +Node: gawkextlib1048865 +Node: Extension summary1051523 +Node: Extension Exercises1055212 +Node: Language History1055934 +Node: V7/SVR3.11057590 +Node: SVR41059771 +Node: POSIX1061216 +Node: BTL1062605 +Node: POSIX/GNU1063339 +Node: Feature History1068963 +Node: Common Extensions1082665 +Node: Ranges and Locales1083989 +Ref: Ranges and Locales-Footnote-11088607 +Ref: Ranges and Locales-Footnote-21088634 +Ref: Ranges and Locales-Footnote-31088868 +Node: Contributors1089089 +Node: History summary1094630 +Node: Installation1096000 +Node: Gawk Distribution1096946 +Node: Getting1097430 +Node: Extracting1098253 +Node: Distribution contents1099888 +Node: Unix Installation1105953 +Node: Quick Installation1106636 +Node: Shell Startup Files1109047 +Node: Additional Configuration Options1110126 +Node: Configuration Philosophy1111865 +Node: Non-Unix Installation1114234 +Node: PC Installation1114692 +Node: PC Binary Installation1116011 +Node: PC Compiling1117859 +Ref: PC Compiling-Footnote-11120880 +Node: PC Testing1120989 +Node: PC Using1122165 +Node: Cygwin1126280 +Node: MSYS1127103 +Node: VMS Installation1127603 +Node: VMS Compilation1128395 +Ref: VMS Compilation-Footnote-11129617 +Node: VMS Dynamic Extensions1129675 +Node: VMS Installation Details1131359 +Node: VMS Running1133611 +Node: VMS GNV1136447 +Node: VMS Old Gawk1137181 +Node: Bugs1137651 +Node: Other Versions1141534 +Node: Installation summary1147962 +Node: Notes1149018 +Node: Compatibility Mode1149883 +Node: Additions1150665 +Node: Accessing The Source1151590 +Node: Adding Code1153026 +Node: New Ports1159191 +Node: Derived Files1163673 +Ref: Derived Files-Footnote-11169148 +Ref: Derived Files-Footnote-21169182 +Ref: Derived Files-Footnote-31169778 +Node: Future Extensions1169892 +Node: Implementation Limitations1170498 +Node: Extension Design1171746 +Node: Old Extension Problems1172900 +Ref: Old Extension Problems-Footnote-11174417 +Node: Extension New Mechanism Goals1174474 +Ref: Extension New Mechanism Goals-Footnote-11177834 +Node: Extension Other Design Decisions1178023 +Node: Extension Future Growth1180131 +Node: Old Extension Mechanism1180967 +Node: Notes summary1182729 +Node: Basic Concepts1183915 +Node: Basic High Level1184596 +Ref: figure-general-flow1184868 +Ref: figure-process-flow1185467 +Ref: Basic High Level-Footnote-11188696 +Node: Basic Data Typing1188881 +Node: Glossary1192209 +Node: Copying1217367 +Node: GNU Free Documentation License1254923 +Node: Index1280059  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 1c3c0f78..871c9ea8 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -632,6 +632,7 @@ particular records in a file and perform operations upon them. * Special Caveats:: Things to watch out for. * Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Nonfatal:: Enabling Nonfatal Output. * Output Summary:: Output summary. * Output Exercises:: Exercises. * Values:: Constants, Variables, and Regular @@ -8967,6 +8968,7 @@ and discusses the @code{close()} built-in function. @command{gawk} allows access to inherited file descriptors. * Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Nonfatal:: Enabling Nonfatal Output. * Output Summary:: Output summary. * Output Exercises:: Exercises. @end menu @@ -10484,6 +10486,58 @@ when closing a pipe. @c ENDOFRANGE pc @c ENDOFRANGE cc +@node Nonfatal +@section Enabling Nonfatal Output + +This @value{SECTION} describes a @command{gawk}-specific feature. + +In standard @command{awk}, output with @code{print} or @code{printf} +to a nonexistent file, or some other I/O error (such as filling up the +disk) is a fatal error. + +@example +$ @kbd{gawk 'BEGIN @{ print "hi" > "/no/such/file" @}'} +@error{} gawk: cmd. line:1: fatal: can't redirect to `/no/such/file' (No such file or directory) +@end example + +@command{gawk} makes it possible to detect that an error has +occurred, allowing you to possibly recover from the error, or +at least print an error message of your choosing before exiting. +You can do this in one of two ways: + +@itemize @bullet +@item +For all output files, by assigning any value to @code{PROCINFO["nonfatal"]}. + +@item +On a per-file basis, by assigning any value to +@code{PROCINFO[@var{filename}, "nonfatal"]}. +Here, @var{filename} is the name of the file to which +you wish output to be nonfatal. +@end itemize + +Once you have enabled nonfatal output, you must check @code{ERRNO} +after every relevant @code{print} or @code{printf} statement to +see if something went wrong. It is also a good idea to initialize +@code{ERRNO} to zero before attempting the output. For example: + +@example +$ @kbd{gawk '} +> @kbd{BEGIN @{} +> @kbd{ PROCINFO["nonfatal"] = 1} +> @kbd{ ERRNO = 0} +> @kbd{ print "hi" > "/no/such/file"} +> @kbd{ if (ERRNO) @{} +> @kbd{ print("Output failed:", ERRNO) > "/dev/stderr"} +> @kbd{ exit 1} +> @kbd{ @}} +> @kbd{@}'} +@error{} Output failed: No such file or directory +@end example + +Here, @command{gawk} did not produce a fatal error; instead +it let the @command{awk} program code detect the problem and handle it. + @node Output Summary @section Summary @@ -10512,6 +10566,12 @@ Use @code{close()} to close open file, pipe, and coprocess redirections. For coprocesses, it is possible to close only one direction of the communications. +@item +Normally errors with @code{print} or @code{printf} are fatal. +@command{gawk} lets you make output errors be nonfatal either for +all files or on a per-file basis. You must then check for errors +after every relevant output statement. + @end itemize @c EXCLUDE START @@ -36771,6 +36831,38 @@ The dynamic extension interface was completely redone @end itemize +Version @strong{FIXME} XXXX introduced the following changes: + +@itemize @bullet +@item +Changes to @code{ENVIRON} are reflected into @command{gawk}'s +environment and that of programs that it runs. +@xref{Auto-set}. + +@item +The @option{--pretty-print} option no longer runs the @command{awk} +program too. +FIXME: Add xref. + +@item +The @command{igawk} program and its manual page are no longer +installed when @command{gawk} is built. +FIXME: Add xref. + +@item +The @code{div()} function. +FIXME: Add xref. + +@item +The maximum number of hexdecimal digits in @samp{\x} escapes +is now two. +FIXME: Add xref. + +@item +Nonfatal output with @code{print} and @code{printf}. +@xref{Nonfatal}. +@end itemize + @c XXX ADD MORE STUFF HERE @end ifclear diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 8bdf1a70..abf139a8 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -627,6 +627,7 @@ particular records in a file and perform operations upon them. * Special Caveats:: Things to watch out for. * Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Nonfatal:: Enabling Nonfatal Output. * Output Summary:: Output summary. * Output Exercises:: Exercises. * Values:: Constants, Variables, and Regular @@ -8568,6 +8569,7 @@ and discusses the @code{close()} built-in function. @command{gawk} allows access to inherited file descriptors. * Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Nonfatal:: Enabling Nonfatal Output. * Output Summary:: Output summary. * Output Exercises:: Exercises. @end menu @@ -9981,6 +9983,58 @@ when closing a pipe. @c ENDOFRANGE pc @c ENDOFRANGE cc +@node Nonfatal +@section Enabling Nonfatal Output + +This @value{SECTION} describes a @command{gawk}-specific feature. + +In standard @command{awk}, output with @code{print} or @code{printf} +to a nonexistent file, or some other I/O error (such as filling up the +disk) is a fatal error. + +@example +$ @kbd{gawk 'BEGIN @{ print "hi" > "/no/such/file" @}'} +@error{} gawk: cmd. line:1: fatal: can't redirect to `/no/such/file' (No such file or directory) +@end example + +@command{gawk} makes it possible to detect that an error has +occurred, allowing you to possibly recover from the error, or +at least print an error message of your choosing before exiting. +You can do this in one of two ways: + +@itemize @bullet +@item +For all output files, by assigning any value to @code{PROCINFO["nonfatal"]}. + +@item +On a per-file basis, by assigning any value to +@code{PROCINFO[@var{filename}, "nonfatal"]}. +Here, @var{filename} is the name of the file to which +you wish output to be nonfatal. +@end itemize + +Once you have enabled nonfatal output, you must check @code{ERRNO} +after every relevant @code{print} or @code{printf} statement to +see if something went wrong. It is also a good idea to initialize +@code{ERRNO} to zero before attempting the output. For example: + +@example +$ @kbd{gawk '} +> @kbd{BEGIN @{} +> @kbd{ PROCINFO["nonfatal"] = 1} +> @kbd{ ERRNO = 0} +> @kbd{ print "hi" > "/no/such/file"} +> @kbd{ if (ERRNO) @{} +> @kbd{ print("Output failed:", ERRNO) > "/dev/stderr"} +> @kbd{ exit 1} +> @kbd{ @}} +> @kbd{@}'} +@error{} Output failed: No such file or directory +@end example + +Here, @command{gawk} did not produce a fatal error; instead +it let the @command{awk} program code detect the problem and handle it. + @node Output Summary @section Summary @@ -10009,6 +10063,12 @@ Use @code{close()} to close open file, pipe, and coprocess redirections. For coprocesses, it is possible to close only one direction of the communications. +@item +Normally errors with @code{print} or @code{printf} are fatal. +@command{gawk} lets you make output errors be nonfatal either for +all files or on a per-file basis. You must then check for errors +after every relevant output statement. + @end itemize @c EXCLUDE START @@ -35864,6 +35924,38 @@ The dynamic extension interface was completely redone @end itemize +Version @strong{FIXME} XXXX introduced the following changes: + +@itemize @bullet +@item +Changes to @code{ENVIRON} are reflected into @command{gawk}'s +environment and that of programs that it runs. +@xref{Auto-set}. + +@item +The @option{--pretty-print} option no longer runs the @command{awk} +program too. +FIXME: Add xref. + +@item +The @command{igawk} program and its manual page are no longer +installed when @command{gawk} is built. +FIXME: Add xref. + +@item +The @code{div()} function. +FIXME: Add xref. + +@item +The maximum number of hexdecimal digits in @samp{\x} escapes +is now two. +FIXME: Add xref. + +@item +Nonfatal output with @code{print} and @code{printf}. +@xref{Nonfatal}. +@end itemize + @c XXX ADD MORE STUFF HERE @end ifclear -- cgit v1.2.3 From d6e200568261f51fd007895516da1a06851d4481 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Dec 2014 20:41:46 +0200 Subject: Update TODO file. --- TODO | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/TODO b/TODO index 235ded0e..3e8b4589 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -Sun Sep 28 22:19:10 IDT 2014 +Wed Dec 24 20:41:38 IST 2014 ============================ There were too many files tracking different thoughts and ideas for @@ -44,9 +44,6 @@ Minor New Features Consider relaxing the strictness of --posix. - Make it possible to put print/printf + redirections into - an expression. - ? Add an optional base to strtonum, allowing 2-36. ? Optional third argument for index indicating where to start the -- cgit v1.2.3 From 4160a0e1fe1aaf4919162010a33550bc22af9454 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 26 Dec 2014 09:41:09 +0200 Subject: Sort the glossary. --- doc/ChangeLog | 6 +++- doc/gawk.info | 70 +++++++++++++++++++------------------- doc/gawk.texi | 102 ++++++++++++++++++++++++++++---------------------------- doc/gawktexi.in | 102 ++++++++++++++++++++++++++++---------------------------- 4 files changed, 142 insertions(+), 138 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 957e4827..d2b9f236 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,8 +1,12 @@ +2014-12-26 Antonio Giovanni Colombo + + * gawktexi.in (Glossary): Really sort the items. + 2014-12-24 Arnold D. Robbins * gawktexi.in: Add one more paragraph to new foreword. * gawktexi.in: Fix exponentiation in TeX mode. Thanks to - Marco Curreli by way of Antonio Giovanni. + Marco Curreli by way of Antonio Giovanni Columbo. * texinfo.tex: Updated. diff --git a/doc/gawk.info b/doc/gawk.info index 0224c7d5..4b016405 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -29549,13 +29549,11 @@ CHEM Brian Kernighan and Jon Bentley, and is available from `http://netlib.sandia.gov/netlib/typesetting/chem.gz'. -Cookie - A peculiar goodie, token, saying or remembrance produced by or - presented to a program. (With thanks to Professor Doug McIlroy.) - -Coprocess - A subordinate program with which two-way communications is - possible. +Comparison Expression + A relation that is either true or false, such as `a < b'. + Comparison expressions are used in `if', `while', `do', and `for' + statements, and in patterns to select which input records to + process. (*Note Typing and Comparison::.) Compiler A program that translates human-readable source code into @@ -29579,11 +29577,13 @@ Conditional Expression otherwise the value is EXPR3. In either case, only one of EXPR2 and EXPR3 is evaluated. (*Note Conditional Exp::.) -Comparison Expression - A relation that is either true or false, such as `a < b'. - Comparison expressions are used in `if', `while', `do', and `for' - statements, and in patterns to select which input records to - process. (*Note Typing and Comparison::.) +Cookie + A peculiar goodie, token, saying or remembrance produced by or + presented to a program. (With thanks to Professor Doug McIlroy.) + +Coprocess + A subordinate program with which two-way communications is + possible. Curly Braces See "Braces." @@ -29625,15 +29625,15 @@ Dynamic Regular Expression `"foo"', but it may also be an expression whose value can vary. (*Note Computed Regexps::.) +Empty String + See "Null String." + Environment A collection of strings, of the form `NAME=VAL', that each program has available to it. Users generally place values into the environment in order to provide information to various programs. Typical examples are the environment variables `HOME' and `PATH'. -Empty String - See "Null String." - Epoch The date used as the "beginning of time" for timestamps. Time values in most systems are represented as seconds since the epoch, @@ -29688,20 +29688,20 @@ Free Documentation License published and may be copied. (*Note GNU Free Documentation License::.) -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::.) - -FSF - See "Free Software Foundation." - Free Software Foundation A nonprofit organization dedicated to the production and distribution of freely distributable software. It was founded by Richard M. Stallman, the author of the original Emacs editor. GNU Emacs is the most widely used version of Emacs today. +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::.) + `gawk' The GNU implementation of `awk'. @@ -29801,12 +29801,12 @@ Lesser General Public License archives or shared objects, and their source code may be distributed. -Linux - See "GNU/Linux." - LGPL See "Lesser General Public License." +Linux + See "GNU/Linux." + Localization The process of providing the data necessary for an internationalized program to work in a particular language. @@ -29945,13 +29945,13 @@ Search Path source files. In the shell, a list of directories to search for executable programs. +`sed' + See "Stream Editor." + Seed The initial value, or starting point, for a sequence of random numbers. -`sed' - See "Stream Editor." - Shell The command interpreter for Unix and POSIX-compliant systems. The shell works both interactively, and as a programming language for @@ -32010,7 +32010,7 @@ Index * compatibility mode (gawk), octal numbers: Nondecimal-numbers. (line 60) * compatibility mode (gawk), specifying: Options. (line 81) -* compiled programs <1>: Glossary. (line 157) +* compiled programs <1>: Glossary. (line 155) * 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) @@ -32056,7 +32056,7 @@ Index * CONVFMT variable: Strings And Numbers. (line 29) * CONVFMT variable, and array subscripts: Numeric Array Subscripts. (line 6) -* cookie: Glossary. (line 149) +* cookie: Glossary. (line 177) * coprocesses <1>: Two-way I/O. (line 25) * coprocesses: Redirection. (line 96) * coprocesses, closing: Close Files And Pipes. @@ -32672,7 +32672,7 @@ 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 296) +* Free Software Foundation (FSF) <1>: Glossary. (line 288) * Free Software Foundation (FSF) <2>: Getting. (line 10) * Free Software Foundation (FSF): Manual History. (line 6) * FreeBSD: Glossary. (line 611) @@ -32689,7 +32689,7 @@ Index * FS, containing ^: Regexp Field Splitting. (line 59) * FS, in multiline records: Multiple Line. (line 41) -* FSF (Free Software Foundation) <1>: Glossary. (line 296) +* FSF (Free Software Foundation) <1>: Glossary. (line 288) * FSF (Free Software Foundation) <2>: Getting. (line 10) * FSF (Free Software Foundation): Manual History. (line 6) * fts() extension function: Extension Sample File Functions. @@ -33208,7 +33208,7 @@ Index * mawk utility <4>: Getline/Pipe. (line 62) * mawk utility: Escape Sequences. (line 117) * maximum precision supported by MPFR library: Auto-set. (line 221) -* McIlroy, Doug: Glossary. (line 149) +* McIlroy, Doug: Glossary. (line 177) * McPhee, Patrick: Contributors. (line 100) * message object files: Explaining gettext. (line 42) * message object files, converting from portable object files: I18N Example. @@ -33959,7 +33959,7 @@ Index * square root: Numeric Functions. (line 77) * srand: Numeric Functions. (line 81) * stack frame: Debugging Terms. (line 10) -* Stallman, Richard <1>: Glossary. (line 296) +* Stallman, Richard <1>: Glossary. (line 288) * Stallman, Richard <2>: Contributors. (line 23) * Stallman, Richard <3>: Acknowledgments. (line 18) * Stallman, Richard: Manual History. (line 6) diff --git a/doc/gawk.texi b/doc/gawk.texi index 408bc0c9..95844125 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -40097,6 +40097,39 @@ 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}. +@item Comparison Expression +A relation that is either true or false, such as @samp{a < b}. +Comparison expressions are used in @code{if}, @code{while}, @code{do}, +and @code{for} +statements, and in patterns to select which input records to process. +(@xref{Typing and Comparison}.) + +@cindex compiled programs +@item Compiler +A program that translates human-readable source code into +machine-executable object code. The object code is then executed +directly by the computer. +See also ``Interpreter.'' + +@item Compound Statement +A series of @command{awk} statements, enclosed in curly braces. Compound +statements may be nested. +(@xref{Statements}.) + +@item Concatenation +Concatenating two strings means sticking them together, one after another, +producing a new string. For example, the string @samp{foo} concatenated with +the string @samp{bar} gives the string @samp{foobar}. +(@xref{Concatenation}.) + +@item Conditional Expression +An expression using the @samp{?:} ternary operator, such as +@samp{@var{expr1} ? @var{expr2} : @var{expr3}}. The expression +@var{expr1} is evaluated; if the result is true, the value of the whole +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}.) + @cindex McIlroy, Doug @cindex cookie @item Cookie @@ -40145,39 +40178,6 @@ Doug @item Coprocess A subordinate program with which two-way communications is possible. -@cindex compiled programs -@item Compiler -A program that translates human-readable source code into -machine-executable object code. The object code is then executed -directly by the computer. -See also ``Interpreter.'' - -@item Compound Statement -A series of @command{awk} statements, enclosed in curly braces. Compound -statements may be nested. -(@xref{Statements}.) - -@item Concatenation -Concatenating two strings means sticking them together, one after another, -producing a new string. For example, the string @samp{foo} concatenated with -the string @samp{bar} gives the string @samp{foobar}. -(@xref{Concatenation}.) - -@item Conditional Expression -An expression using the @samp{?:} ternary operator, such as -@samp{@var{expr1} ? @var{expr2} : @var{expr3}}. The expression -@var{expr1} is evaluated; if the result is true, the value of the whole -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 Comparison Expression -A relation that is either true or false, such as @samp{a < b}. -Comparison expressions are used in @code{if}, @code{while}, @code{do}, -and @code{for} -statements, and in patterns to select which input records to process. -(@xref{Typing and Comparison}.) - @item Curly Braces See ``Braces.'' @@ -40223,15 +40223,15 @@ ordinary expression. It could be a string constant, such as @code{"foo"}, but it may also be an expression whose value can vary. (@xref{Computed Regexps}.) +@item Empty String +See ``Null String.'' + @item Environment A collection of strings, of the form @samp{@var{name}=@var{val}}, that each program has available to it. Users generally place values into the environment in order to provide information to various programs. Typical examples are the environment variables @env{HOME} and @env{PATH}. -@item Empty String -See ``Null String.'' - @cindex epoch, definition of @item Epoch The date used as the ``beginning of time'' for timestamps. @@ -40288,15 +40288,6 @@ are controlled by the format strings contained in the predefined variables This document describes the terms under which this @value{DOCUMENT} is published and may be copied. (@xref{GNU Free Documentation License}.) -@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}.) - -@item FSF -See ``Free Software Foundation.'' - @cindex FSF (Free Software Foundation) @cindex Free Software Foundation (FSF) @cindex Stallman, Richard @@ -40306,6 +40297,15 @@ to the production and distribution of freely distributable software. It was founded by Richard M.@: Stallman, the author of the original Emacs editor. GNU Emacs is the most widely used version of Emacs today. +@item FSF +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}.) + @item @command{gawk} The GNU implementation of @command{awk}. @@ -40436,12 +40436,12 @@ This document describes the terms under which binary library archives or shared objects, and their source code may be distributed. -@item Linux -See ``GNU/Linux.'' - @item LGPL See ``Lesser General Public License.'' +@item Linux +See ``GNU/Linux.'' + @item Localization The process of providing the data necessary for an internationalized program to work in a particular language. @@ -40579,12 +40579,12 @@ Regular variables are scalars; arrays and functions are not. In @command{gawk}, a list of directories to search for @command{awk} program source files. In the shell, a list of directories to search for executable programs. -@item Seed -The initial value, or starting point, for a sequence of random numbers. - @item @command{sed} See ``Stream Editor.'' +@item Seed +The initial value, or starting point, for a sequence of random numbers. + @item Shell The command interpreter for Unix and POSIX-compliant systems. The shell works both interactively, and as a programming language diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 54b084bb..8182790c 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -39190,6 +39190,39 @@ 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}. +@item Comparison Expression +A relation that is either true or false, such as @samp{a < b}. +Comparison expressions are used in @code{if}, @code{while}, @code{do}, +and @code{for} +statements, and in patterns to select which input records to process. +(@xref{Typing and Comparison}.) + +@cindex compiled programs +@item Compiler +A program that translates human-readable source code into +machine-executable object code. The object code is then executed +directly by the computer. +See also ``Interpreter.'' + +@item Compound Statement +A series of @command{awk} statements, enclosed in curly braces. Compound +statements may be nested. +(@xref{Statements}.) + +@item Concatenation +Concatenating two strings means sticking them together, one after another, +producing a new string. For example, the string @samp{foo} concatenated with +the string @samp{bar} gives the string @samp{foobar}. +(@xref{Concatenation}.) + +@item Conditional Expression +An expression using the @samp{?:} ternary operator, such as +@samp{@var{expr1} ? @var{expr2} : @var{expr3}}. The expression +@var{expr1} is evaluated; if the result is true, the value of the whole +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}.) + @cindex McIlroy, Doug @cindex cookie @item Cookie @@ -39238,39 +39271,6 @@ Doug @item Coprocess A subordinate program with which two-way communications is possible. -@cindex compiled programs -@item Compiler -A program that translates human-readable source code into -machine-executable object code. The object code is then executed -directly by the computer. -See also ``Interpreter.'' - -@item Compound Statement -A series of @command{awk} statements, enclosed in curly braces. Compound -statements may be nested. -(@xref{Statements}.) - -@item Concatenation -Concatenating two strings means sticking them together, one after another, -producing a new string. For example, the string @samp{foo} concatenated with -the string @samp{bar} gives the string @samp{foobar}. -(@xref{Concatenation}.) - -@item Conditional Expression -An expression using the @samp{?:} ternary operator, such as -@samp{@var{expr1} ? @var{expr2} : @var{expr3}}. The expression -@var{expr1} is evaluated; if the result is true, the value of the whole -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 Comparison Expression -A relation that is either true or false, such as @samp{a < b}. -Comparison expressions are used in @code{if}, @code{while}, @code{do}, -and @code{for} -statements, and in patterns to select which input records to process. -(@xref{Typing and Comparison}.) - @item Curly Braces See ``Braces.'' @@ -39316,15 +39316,15 @@ ordinary expression. It could be a string constant, such as @code{"foo"}, but it may also be an expression whose value can vary. (@xref{Computed Regexps}.) +@item Empty String +See ``Null String.'' + @item Environment A collection of strings, of the form @samp{@var{name}=@var{val}}, that each program has available to it. Users generally place values into the environment in order to provide information to various programs. Typical examples are the environment variables @env{HOME} and @env{PATH}. -@item Empty String -See ``Null String.'' - @cindex epoch, definition of @item Epoch The date used as the ``beginning of time'' for timestamps. @@ -39381,15 +39381,6 @@ are controlled by the format strings contained in the predefined variables This document describes the terms under which this @value{DOCUMENT} is published and may be copied. (@xref{GNU Free Documentation License}.) -@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}.) - -@item FSF -See ``Free Software Foundation.'' - @cindex FSF (Free Software Foundation) @cindex Free Software Foundation (FSF) @cindex Stallman, Richard @@ -39399,6 +39390,15 @@ to the production and distribution of freely distributable software. It was founded by Richard M.@: Stallman, the author of the original Emacs editor. GNU Emacs is the most widely used version of Emacs today. +@item FSF +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}.) + @item @command{gawk} The GNU implementation of @command{awk}. @@ -39529,12 +39529,12 @@ This document describes the terms under which binary library archives or shared objects, and their source code may be distributed. -@item Linux -See ``GNU/Linux.'' - @item LGPL See ``Lesser General Public License.'' +@item Linux +See ``GNU/Linux.'' + @item Localization The process of providing the data necessary for an internationalized program to work in a particular language. @@ -39672,12 +39672,12 @@ Regular variables are scalars; arrays and functions are not. In @command{gawk}, a list of directories to search for @command{awk} program source files. In the shell, a list of directories to search for executable programs. -@item Seed -The initial value, or starting point, for a sequence of random numbers. - @item @command{sed} See ``Stream Editor.'' +@item Seed +The initial value, or starting point, for a sequence of random numbers. + @item Shell The command interpreter for Unix and POSIX-compliant systems. The shell works both interactively, and as a programming language -- cgit v1.2.3 From 15a1d8d213380bd99b5dfe7f4cafcd6dedb8f0dc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 27 Dec 2014 21:20:47 +0200 Subject: Make nonfatal work with stdout & stderr. Update doc more. --- ChangeLog | 6 + awk.h | 1 + builtin.c | 4 +- doc/ChangeLog | 5 + doc/gawk.info | 1028 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 43 ++- doc/gawktexi.in | 43 ++- io.c | 19 + 8 files changed, 625 insertions(+), 524 deletions(-) diff --git a/ChangeLog b/ChangeLog index c75a913f..0ee6bf26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-12-27 Arnold D. Robbins + + * awk.h (is_non_fatal_std): Declare new function. + * io.c (is_non_fatal_std): New function. + * builtin.c (efwrite): Call it. + 2014-12-24 Arnold D. Robbins * profile.c (pprint): Be sure to set ip2 in all paths diff --git a/awk.h b/awk.h index ff3499cd..81a0e91f 100644 --- a/awk.h +++ b/awk.h @@ -1496,6 +1496,7 @@ extern NODE *do_getline(int intovar, IOBUF *iop); extern struct redirect *getredirect(const char *str, int len); extern bool inrec(IOBUF *iop, int *errcode); extern int nextfile(IOBUF **curfile, bool skipping); +extern bool is_non_fatal_std(FILE *fp); /* main.c */ extern int arg_assign(char *arg, bool initing); extern int is_std_var(const char *var); diff --git a/builtin.c b/builtin.c index b3f3f333..e80d46d4 100644 --- a/builtin.c +++ b/builtin.c @@ -129,8 +129,10 @@ wrerror: if (fp == stdout && errno == EPIPE) gawk_exit(EXIT_FATAL); + /* otherwise die verbosely */ - if ((rp->flag & RED_NON_FATAL) != 0) { + if ( (rp != NULL && (rp->flag & RED_NON_FATAL) != 0) + || is_non_fatal_std(fp)) { update_ERRNO_int(errno); } else fatal(_("%s to \"%s\" failed (%s)"), from, diff --git a/doc/ChangeLog b/doc/ChangeLog index 82c89c4f..ba473168 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2014-12-27 Arnold D. Robbins + + * gawktexi.in: Add info that nonfatal I/O works with stdout and + stderr. Revise version info and what was added when. + 2014-12-26 Antonio Giovanni Colombo * gawktexi.in (Glossary): Really sort the items. diff --git a/doc/gawk.info b/doc/gawk.info index ba16256f..08ec4452 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -3454,8 +3454,8 @@ sequences apply to both string constants and regexp constants: would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. However, using more than two hexadecimal - digits produced undefined results. As of version *FIXME:* - 4.3.0, only two digits are processed. + digits produced undefined results. As of version 4.2, only + two digits are processed. `\/' A literal slash (necessary for regexp constants only). This @@ -7249,6 +7249,11 @@ attempting the output. For example: Here, `gawk' did not produce a fatal error; instead it let the `awk' program code detect the problem and handle it. + This mechanism works also for standard output and standard error. +For standard output, you may use `PROCINFO["-", "nonfatal"]' or +`PROCINFO["/dev/stdout", "nonfatal"]'. For standard error, use +`PROCINFO["/dev/stderr", "nonfatal"]'. +  File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Nonfatal, Up: Printing @@ -26492,6 +26497,9 @@ the current version of `gawk'. - Directories on the command line produce a warning and are skipped (*note Command-line directories::). + - Output with `print' and `printf' need not be fatal (*note + Nonfatal::). + * New keywords: - The `BEGINFILE' and `ENDFILE' special patterns (*note @@ -26543,6 +26551,9 @@ the current version of `gawk'. - The `bindtextdomain()', `dcgettext()' and `dcngettext()' functions for internationalization (*note Programmer i18n::). + - The `div()' function for doing integer division and remainder + (*note Numeric Functions::). + * Changes and/or additions in the command-line options: - The `AWKPATH' environment variable for specifying a path @@ -26597,7 +26608,10 @@ the current version of `gawk'. - Ultrix - * Support for MirBSD was removed at `gawk' version 4.2. + * Support for the following systems was removed from the code for + `gawk' version 4.2: + + - MirBSD  @@ -26984,25 +26998,29 @@ in POSIX `awk', in the order they were added to `gawk'. * The dynamic extension interface was completely redone (*note Dynamic Extensions::). + * Support for Ultrix was removed. + - Version *FIXME* XXXX introduced the following changes: + Version 4.2 introduced the following changes: * Changes to `ENVIRON' are reflected into `gawk''s environment and that of programs that it runs. *Note Auto-set::. * The `--pretty-print' option no longer runs the `awk' program too. - FIXME: Add xref. + *Note Options::. * The `igawk' program and its manual page are no longer installed - when `gawk' is built. FIXME: Add xref. + when `gawk' is built. *Note Igawk Program::. - * The `div()' function. FIXME: Add xref. + * The `div()' function. *Note Numeric Functions::. * The maximum number of hexdecimal digits in `\x' escapes is now two. - FIXME: Add xref. + *Note Escape Sequences::. * Nonfatal output with `print' and `printf'. *Note Nonfatal::. + * Support for MirBSD was removed. +  File: gawk.info, Node: Common Extensions, Next: Ranges and Locales, Prev: Feature History, Up: Language History @@ -34584,502 +34602,502 @@ Node: Invoking Summary151826 Node: Regexp153490 Node: Regexp Usage154944 Node: Escape Sequences156981 -Node: Regexp Operators163222 -Ref: Regexp Operators-Footnote-1170648 -Ref: Regexp Operators-Footnote-2170795 -Node: Bracket Expressions170893 -Ref: table-char-classes172908 -Node: Leftmost Longest175832 -Node: Computed Regexps177134 -Node: GNU Regexp Operators180531 -Node: Case-sensitivity184204 -Ref: Case-sensitivity-Footnote-1187089 -Ref: Case-sensitivity-Footnote-2187324 -Node: Regexp Summary187432 -Node: Reading Files188899 -Node: Records190993 -Node: awk split records191726 -Node: gawk split records196641 -Ref: gawk split records-Footnote-1201185 -Node: Fields201222 -Ref: Fields-Footnote-1203998 -Node: Nonconstant Fields204084 -Ref: Nonconstant Fields-Footnote-1206327 -Node: Changing Fields206531 -Node: Field Separators212460 -Node: Default Field Splitting215165 -Node: Regexp Field Splitting216282 -Node: Single Character Fields219632 -Node: Command Line Field Separator220691 -Node: Full Line Fields223903 -Ref: Full Line Fields-Footnote-1225420 -Ref: Full Line Fields-Footnote-2225466 -Node: Field Splitting Summary225567 -Node: Constant Size227641 -Node: Splitting By Content232230 -Ref: Splitting By Content-Footnote-1236224 -Node: Multiple Line236387 -Ref: Multiple Line-Footnote-1242273 -Node: Getline242452 -Node: Plain Getline244664 -Node: Getline/Variable247304 -Node: Getline/File248452 -Node: Getline/Variable/File249836 -Ref: Getline/Variable/File-Footnote-1251439 -Node: Getline/Pipe251526 -Node: Getline/Variable/Pipe254209 -Node: Getline/Coprocess255340 -Node: Getline/Variable/Coprocess256592 -Node: Getline Notes257331 -Node: Getline Summary260123 -Ref: table-getline-variants260535 -Node: Read Timeout261364 -Ref: Read Timeout-Footnote-1265189 -Node: Command-line directories265247 -Node: Input Summary266152 -Node: Input Exercises269453 -Node: Printing270181 -Node: Print272016 -Node: Print Examples273473 -Node: Output Separators276252 -Node: OFMT278270 -Node: Printf279624 -Node: Basic Printf280409 -Node: Control Letters281979 -Node: Format Modifiers285962 -Node: Printf Examples291971 -Node: Redirection294457 -Node: Special FD301298 -Ref: Special FD-Footnote-1304458 -Node: Special Files304532 -Node: Other Inherited Files305149 -Node: Special Network306149 -Node: Special Caveats307011 -Node: Close Files And Pipes307962 -Ref: Close Files And Pipes-Footnote-1315138 -Ref: Close Files And Pipes-Footnote-2315286 -Node: Nonfatal315436 -Node: Output Summary317122 -Node: Output Exercises318343 -Node: Expressions319023 -Node: Values320208 -Node: Constants320886 -Node: Scalar Constants321577 -Ref: Scalar Constants-Footnote-1322436 -Node: Nondecimal-numbers322686 -Node: Regexp Constants325704 -Node: Using Constant Regexps326229 -Node: Variables329372 -Node: Using Variables330027 -Node: Assignment Options331938 -Node: Conversion333813 -Node: Strings And Numbers334337 -Ref: Strings And Numbers-Footnote-1337402 -Node: Locale influences conversions337511 -Ref: table-locale-affects340258 -Node: All Operators340846 -Node: Arithmetic Ops341476 -Node: Concatenation343981 -Ref: Concatenation-Footnote-1346800 -Node: Assignment Ops346906 -Ref: table-assign-ops351885 -Node: Increment Ops353157 -Node: Truth Values and Conditions356595 -Node: Truth Values357680 -Node: Typing and Comparison358729 -Node: Variable Typing359539 -Node: Comparison Operators363192 -Ref: table-relational-ops363602 -Node: POSIX String Comparison367097 -Ref: POSIX String Comparison-Footnote-1368169 -Node: Boolean Ops368307 -Ref: Boolean Ops-Footnote-1372786 -Node: Conditional Exp372877 -Node: Function Calls374604 -Node: Precedence378484 -Node: Locales382145 -Node: Expressions Summary383777 -Node: Patterns and Actions386337 -Node: Pattern Overview387457 -Node: Regexp Patterns389136 -Node: Expression Patterns389679 -Node: Ranges393389 -Node: BEGIN/END396495 -Node: Using BEGIN/END397256 -Ref: Using BEGIN/END-Footnote-1399990 -Node: I/O And BEGIN/END400096 -Node: BEGINFILE/ENDFILE402410 -Node: Empty405311 -Node: Using Shell Variables405628 -Node: Action Overview407901 -Node: Statements410227 -Node: If Statement412075 -Node: While Statement413570 -Node: Do Statement415599 -Node: For Statement416743 -Node: Switch Statement419900 -Node: Break Statement422282 -Node: Continue Statement424323 -Node: Next Statement426150 -Node: Nextfile Statement428531 -Node: Exit Statement431161 -Node: Built-in Variables433564 -Node: User-modified434697 -Ref: User-modified-Footnote-1442378 -Node: Auto-set442440 -Ref: Auto-set-Footnote-1456132 -Ref: Auto-set-Footnote-2456337 -Node: ARGC and ARGV456393 -Node: Pattern Action Summary460611 -Node: Arrays463038 -Node: Array Basics464367 -Node: Array Intro465211 -Ref: figure-array-elements467175 -Ref: Array Intro-Footnote-1469701 -Node: Reference to Elements469829 -Node: Assigning Elements472281 -Node: Array Example472772 -Node: Scanning an Array474530 -Node: Controlling Scanning477546 -Ref: Controlling Scanning-Footnote-1482742 -Node: Numeric Array Subscripts483058 -Node: Uninitialized Subscripts485243 -Node: Delete486860 -Ref: Delete-Footnote-1489603 -Node: Multidimensional489660 -Node: Multiscanning492757 -Node: Arrays of Arrays494346 -Node: Arrays Summary499105 -Node: Functions501197 -Node: Built-in502096 -Node: Calling Built-in503174 -Node: Numeric Functions505165 -Ref: Numeric Functions-Footnote-1509984 -Ref: Numeric Functions-Footnote-2510341 -Ref: Numeric Functions-Footnote-3510389 -Node: String Functions510661 -Ref: String Functions-Footnote-1534136 -Ref: String Functions-Footnote-2534265 -Ref: String Functions-Footnote-3534513 -Node: Gory Details534600 -Ref: table-sub-escapes536381 -Ref: table-sub-proposed537901 -Ref: table-posix-sub539265 -Ref: table-gensub-escapes540801 -Ref: Gory Details-Footnote-1541633 -Node: I/O Functions541784 -Ref: I/O Functions-Footnote-1549002 -Node: Time Functions549149 -Ref: Time Functions-Footnote-1559637 -Ref: Time Functions-Footnote-2559705 -Ref: Time Functions-Footnote-3559863 -Ref: Time Functions-Footnote-4559974 -Ref: Time Functions-Footnote-5560086 -Ref: Time Functions-Footnote-6560313 -Node: Bitwise Functions560579 -Ref: table-bitwise-ops561141 -Ref: Bitwise Functions-Footnote-1565450 -Node: Type Functions565619 -Node: I18N Functions566770 -Node: User-defined568415 -Node: Definition Syntax569220 -Ref: Definition Syntax-Footnote-1574627 -Node: Function Example574698 -Ref: Function Example-Footnote-1577617 -Node: Function Caveats577639 -Node: Calling A Function578157 -Node: Variable Scope579115 -Node: Pass By Value/Reference582103 -Node: Return Statement585598 -Node: Dynamic Typing588579 -Node: Indirect Calls589508 -Ref: Indirect Calls-Footnote-1600810 -Node: Functions Summary600938 -Node: Library Functions603640 -Ref: Library Functions-Footnote-1607249 -Ref: Library Functions-Footnote-2607392 -Node: Library Names607563 -Ref: Library Names-Footnote-1611017 -Ref: Library Names-Footnote-2611240 -Node: General Functions611326 -Node: Strtonum Function612429 -Node: Assert Function615451 -Node: Round Function618775 -Node: Cliff Random Function620316 -Node: Ordinal Functions621332 -Ref: Ordinal Functions-Footnote-1624395 -Ref: Ordinal Functions-Footnote-2624647 -Node: Join Function624858 -Ref: Join Function-Footnote-1626627 -Node: Getlocaltime Function626827 -Node: Readfile Function630571 -Node: Shell Quoting632541 -Node: Data File Management633942 -Node: Filetrans Function634574 -Node: Rewind Function638630 -Node: File Checking640017 -Ref: File Checking-Footnote-1641349 -Node: Empty Files641550 -Node: Ignoring Assigns643529 -Node: Getopt Function645080 -Ref: Getopt Function-Footnote-1656542 -Node: Passwd Functions656742 -Ref: Passwd Functions-Footnote-1665579 -Node: Group Functions665667 -Ref: Group Functions-Footnote-1673561 -Node: Walking Arrays673774 -Node: Library Functions Summary675377 -Node: Library Exercises676778 -Node: Sample Programs678058 -Node: Running Examples678828 -Node: Clones679556 -Node: Cut Program680780 -Node: Egrep Program690499 -Ref: Egrep Program-Footnote-1697997 -Node: Id Program698107 -Node: Split Program701752 -Ref: Split Program-Footnote-1705200 -Node: Tee Program705328 -Node: Uniq Program708117 -Node: Wc Program715536 -Ref: Wc Program-Footnote-1719786 -Node: Miscellaneous Programs719880 -Node: Dupword Program721093 -Node: Alarm Program723124 -Node: Translate Program727928 -Ref: Translate Program-Footnote-1732493 -Node: Labels Program732763 -Ref: Labels Program-Footnote-1736114 -Node: Word Sorting736198 -Node: History Sorting740269 -Node: Extract Program742105 -Node: Simple Sed749630 -Node: Igawk Program752698 -Ref: Igawk Program-Footnote-1767022 -Ref: Igawk Program-Footnote-2767223 -Ref: Igawk Program-Footnote-3767345 -Node: Anagram Program767460 -Node: Signature Program770517 -Node: Programs Summary771764 -Node: Programs Exercises772957 -Ref: Programs Exercises-Footnote-1777088 -Node: Advanced Features777179 -Node: Nondecimal Data779127 -Node: Array Sorting780717 -Node: Controlling Array Traversal781414 -Ref: Controlling Array Traversal-Footnote-1789747 -Node: Array Sorting Functions789865 -Ref: Array Sorting Functions-Footnote-1793754 -Node: Two-way I/O793950 -Ref: Two-way I/O-Footnote-1798895 -Ref: Two-way I/O-Footnote-2799081 -Node: TCP/IP Networking799163 -Node: Profiling802036 -Node: Advanced Features Summary810313 -Node: Internationalization812246 -Node: I18N and L10N813726 -Node: Explaining gettext814412 -Ref: Explaining gettext-Footnote-1819437 -Ref: Explaining gettext-Footnote-2819621 -Node: Programmer i18n819786 -Ref: Programmer i18n-Footnote-1824652 -Node: Translator i18n824701 -Node: String Extraction825495 -Ref: String Extraction-Footnote-1826626 -Node: Printf Ordering826712 -Ref: Printf Ordering-Footnote-1829498 -Node: I18N Portability829562 -Ref: I18N Portability-Footnote-1832017 -Node: I18N Example832080 -Ref: I18N Example-Footnote-1834883 -Node: Gawk I18N834955 -Node: I18N Summary835593 -Node: Debugger836932 -Node: Debugging837954 -Node: Debugging Concepts838395 -Node: Debugging Terms840248 -Node: Awk Debugging842820 -Node: Sample Debugging Session843714 -Node: Debugger Invocation844234 -Node: Finding The Bug845618 -Node: List of Debugger Commands852093 -Node: Breakpoint Control853426 -Node: Debugger Execution Control857122 -Node: Viewing And Changing Data860486 -Node: Execution Stack863864 -Node: Debugger Info865501 -Node: Miscellaneous Debugger Commands869518 -Node: Readline Support874547 -Node: Limitations875439 -Node: Debugging Summary877553 -Node: Arbitrary Precision Arithmetic878721 -Node: Computer Arithmetic880137 -Ref: table-numeric-ranges883735 -Ref: Computer Arithmetic-Footnote-1884594 -Node: Math Definitions884651 -Ref: table-ieee-formats887939 -Ref: Math Definitions-Footnote-1888543 -Node: MPFR features888648 -Node: FP Math Caution890319 -Ref: FP Math Caution-Footnote-1891369 -Node: Inexactness of computations891738 -Node: Inexact representation892697 -Node: Comparing FP Values894054 -Node: Errors accumulate895136 -Node: Getting Accuracy896569 -Node: Try To Round899231 -Node: Setting precision900130 -Ref: table-predefined-precision-strings900814 -Node: Setting the rounding mode902603 -Ref: table-gawk-rounding-modes902967 -Ref: Setting the rounding mode-Footnote-1906422 -Node: Arbitrary Precision Integers906601 -Ref: Arbitrary Precision Integers-Footnote-1911500 -Node: POSIX Floating Point Problems911649 -Ref: POSIX Floating Point Problems-Footnote-1915522 -Node: Floating point summary915560 -Node: Dynamic Extensions917754 -Node: Extension Intro919306 -Node: Plugin License920572 -Node: Extension Mechanism Outline921369 -Ref: figure-load-extension921797 -Ref: figure-register-new-function923277 -Ref: figure-call-new-function924281 -Node: Extension API Description926267 -Node: Extension API Functions Introduction927717 -Node: General Data Types932541 -Ref: General Data Types-Footnote-1938280 -Node: Memory Allocation Functions938579 -Ref: Memory Allocation Functions-Footnote-1941418 -Node: Constructor Functions941514 -Node: Registration Functions943248 -Node: Extension Functions943933 -Node: Exit Callback Functions946230 -Node: Extension Version String947478 -Node: Input Parsers948143 -Node: Output Wrappers958022 -Node: Two-way processors962537 -Node: Printing Messages964741 -Ref: Printing Messages-Footnote-1965817 -Node: Updating `ERRNO'965969 -Node: Requesting Values966709 -Ref: table-value-types-returned967437 -Node: Accessing Parameters968394 -Node: Symbol Table Access969625 -Node: Symbol table by name970139 -Node: Symbol table by cookie972120 -Ref: Symbol table by cookie-Footnote-1976264 -Node: Cached values976327 -Ref: Cached values-Footnote-1979826 -Node: Array Manipulation979917 -Ref: Array Manipulation-Footnote-1981015 -Node: Array Data Types981052 -Ref: Array Data Types-Footnote-1983707 -Node: Array Functions983799 -Node: Flattening Arrays987653 -Node: Creating Arrays994545 -Node: Extension API Variables999316 -Node: Extension Versioning999952 -Node: Extension API Informational Variables1001853 -Node: Extension API Boilerplate1002918 -Node: Finding Extensions1006727 -Node: Extension Example1007287 -Node: Internal File Description1008059 -Node: Internal File Ops1012126 -Ref: Internal File Ops-Footnote-11023796 -Node: Using Internal File Ops1023936 -Ref: Using Internal File Ops-Footnote-11026319 -Node: Extension Samples1026592 -Node: Extension Sample File Functions1028118 -Node: Extension Sample Fnmatch1035756 -Node: Extension Sample Fork1037247 -Node: Extension Sample Inplace1038462 -Node: Extension Sample Ord1040137 -Node: Extension Sample Readdir1040973 -Ref: table-readdir-file-types1041849 -Node: Extension Sample Revout1042660 -Node: Extension Sample Rev2way1043250 -Node: Extension Sample Read write array1043990 -Node: Extension Sample Readfile1045930 -Node: Extension Sample Time1047025 -Node: Extension Sample API Tests1048374 -Node: gawkextlib1048865 -Node: Extension summary1051523 -Node: Extension Exercises1055212 -Node: Language History1055934 -Node: V7/SVR3.11057590 -Node: SVR41059771 -Node: POSIX1061216 -Node: BTL1062605 -Node: POSIX/GNU1063339 -Node: Feature History1068963 -Node: Common Extensions1082665 -Node: Ranges and Locales1083989 -Ref: Ranges and Locales-Footnote-11088607 -Ref: Ranges and Locales-Footnote-21088634 -Ref: Ranges and Locales-Footnote-31088868 -Node: Contributors1089089 -Node: History summary1094630 -Node: Installation1096000 -Node: Gawk Distribution1096946 -Node: Getting1097430 -Node: Extracting1098253 -Node: Distribution contents1099888 -Node: Unix Installation1105953 -Node: Quick Installation1106636 -Node: Shell Startup Files1109047 -Node: Additional Configuration Options1110126 -Node: Configuration Philosophy1111865 -Node: Non-Unix Installation1114234 -Node: PC Installation1114692 -Node: PC Binary Installation1116011 -Node: PC Compiling1117859 -Ref: PC Compiling-Footnote-11120880 -Node: PC Testing1120989 -Node: PC Using1122165 -Node: Cygwin1126280 -Node: MSYS1127103 -Node: VMS Installation1127603 -Node: VMS Compilation1128395 -Ref: VMS Compilation-Footnote-11129617 -Node: VMS Dynamic Extensions1129675 -Node: VMS Installation Details1131359 -Node: VMS Running1133611 -Node: VMS GNV1136447 -Node: VMS Old Gawk1137181 -Node: Bugs1137651 -Node: Other Versions1141534 -Node: Installation summary1147962 -Node: Notes1149018 -Node: Compatibility Mode1149883 -Node: Additions1150665 -Node: Accessing The Source1151590 -Node: Adding Code1153026 -Node: New Ports1159191 -Node: Derived Files1163673 -Ref: Derived Files-Footnote-11169148 -Ref: Derived Files-Footnote-21169182 -Ref: Derived Files-Footnote-31169778 -Node: Future Extensions1169892 -Node: Implementation Limitations1170498 -Node: Extension Design1171746 -Node: Old Extension Problems1172900 -Ref: Old Extension Problems-Footnote-11174417 -Node: Extension New Mechanism Goals1174474 -Ref: Extension New Mechanism Goals-Footnote-11177834 -Node: Extension Other Design Decisions1178023 -Node: Extension Future Growth1180131 -Node: Old Extension Mechanism1180967 -Node: Notes summary1182729 -Node: Basic Concepts1183915 -Node: Basic High Level1184596 -Ref: figure-general-flow1184868 -Ref: figure-process-flow1185467 -Ref: Basic High Level-Footnote-11188696 -Node: Basic Data Typing1188881 -Node: Glossary1192209 -Node: Copying1217367 -Node: GNU Free Documentation License1254923 -Node: Index1280059 +Node: Regexp Operators163211 +Ref: Regexp Operators-Footnote-1170637 +Ref: Regexp Operators-Footnote-2170784 +Node: Bracket Expressions170882 +Ref: table-char-classes172897 +Node: Leftmost Longest175821 +Node: Computed Regexps177123 +Node: GNU Regexp Operators180520 +Node: Case-sensitivity184193 +Ref: Case-sensitivity-Footnote-1187078 +Ref: Case-sensitivity-Footnote-2187313 +Node: Regexp Summary187421 +Node: Reading Files188888 +Node: Records190982 +Node: awk split records191715 +Node: gawk split records196630 +Ref: gawk split records-Footnote-1201174 +Node: Fields201211 +Ref: Fields-Footnote-1203987 +Node: Nonconstant Fields204073 +Ref: Nonconstant Fields-Footnote-1206316 +Node: Changing Fields206520 +Node: Field Separators212449 +Node: Default Field Splitting215154 +Node: Regexp Field Splitting216271 +Node: Single Character Fields219621 +Node: Command Line Field Separator220680 +Node: Full Line Fields223892 +Ref: Full Line Fields-Footnote-1225409 +Ref: Full Line Fields-Footnote-2225455 +Node: Field Splitting Summary225556 +Node: Constant Size227630 +Node: Splitting By Content232219 +Ref: Splitting By Content-Footnote-1236213 +Node: Multiple Line236376 +Ref: Multiple Line-Footnote-1242262 +Node: Getline242441 +Node: Plain Getline244653 +Node: Getline/Variable247293 +Node: Getline/File248441 +Node: Getline/Variable/File249825 +Ref: Getline/Variable/File-Footnote-1251428 +Node: Getline/Pipe251515 +Node: Getline/Variable/Pipe254198 +Node: Getline/Coprocess255329 +Node: Getline/Variable/Coprocess256581 +Node: Getline Notes257320 +Node: Getline Summary260112 +Ref: table-getline-variants260524 +Node: Read Timeout261353 +Ref: Read Timeout-Footnote-1265178 +Node: Command-line directories265236 +Node: Input Summary266141 +Node: Input Exercises269442 +Node: Printing270170 +Node: Print272005 +Node: Print Examples273462 +Node: Output Separators276241 +Node: OFMT278259 +Node: Printf279613 +Node: Basic Printf280398 +Node: Control Letters281968 +Node: Format Modifiers285951 +Node: Printf Examples291960 +Node: Redirection294446 +Node: Special FD301287 +Ref: Special FD-Footnote-1304447 +Node: Special Files304521 +Node: Other Inherited Files305138 +Node: Special Network306138 +Node: Special Caveats307000 +Node: Close Files And Pipes307951 +Ref: Close Files And Pipes-Footnote-1315127 +Ref: Close Files And Pipes-Footnote-2315275 +Node: Nonfatal315425 +Node: Output Summary317348 +Node: Output Exercises318569 +Node: Expressions319249 +Node: Values320434 +Node: Constants321112 +Node: Scalar Constants321803 +Ref: Scalar Constants-Footnote-1322662 +Node: Nondecimal-numbers322912 +Node: Regexp Constants325930 +Node: Using Constant Regexps326455 +Node: Variables329598 +Node: Using Variables330253 +Node: Assignment Options332164 +Node: Conversion334039 +Node: Strings And Numbers334563 +Ref: Strings And Numbers-Footnote-1337628 +Node: Locale influences conversions337737 +Ref: table-locale-affects340484 +Node: All Operators341072 +Node: Arithmetic Ops341702 +Node: Concatenation344207 +Ref: Concatenation-Footnote-1347026 +Node: Assignment Ops347132 +Ref: table-assign-ops352111 +Node: Increment Ops353383 +Node: Truth Values and Conditions356821 +Node: Truth Values357906 +Node: Typing and Comparison358955 +Node: Variable Typing359765 +Node: Comparison Operators363418 +Ref: table-relational-ops363828 +Node: POSIX String Comparison367323 +Ref: POSIX String Comparison-Footnote-1368395 +Node: Boolean Ops368533 +Ref: Boolean Ops-Footnote-1373012 +Node: Conditional Exp373103 +Node: Function Calls374830 +Node: Precedence378710 +Node: Locales382371 +Node: Expressions Summary384003 +Node: Patterns and Actions386563 +Node: Pattern Overview387683 +Node: Regexp Patterns389362 +Node: Expression Patterns389905 +Node: Ranges393615 +Node: BEGIN/END396721 +Node: Using BEGIN/END397482 +Ref: Using BEGIN/END-Footnote-1400216 +Node: I/O And BEGIN/END400322 +Node: BEGINFILE/ENDFILE402636 +Node: Empty405537 +Node: Using Shell Variables405854 +Node: Action Overview408127 +Node: Statements410453 +Node: If Statement412301 +Node: While Statement413796 +Node: Do Statement415825 +Node: For Statement416969 +Node: Switch Statement420126 +Node: Break Statement422508 +Node: Continue Statement424549 +Node: Next Statement426376 +Node: Nextfile Statement428757 +Node: Exit Statement431387 +Node: Built-in Variables433790 +Node: User-modified434923 +Ref: User-modified-Footnote-1442604 +Node: Auto-set442666 +Ref: Auto-set-Footnote-1456358 +Ref: Auto-set-Footnote-2456563 +Node: ARGC and ARGV456619 +Node: Pattern Action Summary460837 +Node: Arrays463264 +Node: Array Basics464593 +Node: Array Intro465437 +Ref: figure-array-elements467401 +Ref: Array Intro-Footnote-1469927 +Node: Reference to Elements470055 +Node: Assigning Elements472507 +Node: Array Example472998 +Node: Scanning an Array474756 +Node: Controlling Scanning477772 +Ref: Controlling Scanning-Footnote-1482968 +Node: Numeric Array Subscripts483284 +Node: Uninitialized Subscripts485469 +Node: Delete487086 +Ref: Delete-Footnote-1489829 +Node: Multidimensional489886 +Node: Multiscanning492983 +Node: Arrays of Arrays494572 +Node: Arrays Summary499331 +Node: Functions501423 +Node: Built-in502322 +Node: Calling Built-in503400 +Node: Numeric Functions505391 +Ref: Numeric Functions-Footnote-1510210 +Ref: Numeric Functions-Footnote-2510567 +Ref: Numeric Functions-Footnote-3510615 +Node: String Functions510887 +Ref: String Functions-Footnote-1534362 +Ref: String Functions-Footnote-2534491 +Ref: String Functions-Footnote-3534739 +Node: Gory Details534826 +Ref: table-sub-escapes536607 +Ref: table-sub-proposed538127 +Ref: table-posix-sub539491 +Ref: table-gensub-escapes541027 +Ref: Gory Details-Footnote-1541859 +Node: I/O Functions542010 +Ref: I/O Functions-Footnote-1549228 +Node: Time Functions549375 +Ref: Time Functions-Footnote-1559863 +Ref: Time Functions-Footnote-2559931 +Ref: Time Functions-Footnote-3560089 +Ref: Time Functions-Footnote-4560200 +Ref: Time Functions-Footnote-5560312 +Ref: Time Functions-Footnote-6560539 +Node: Bitwise Functions560805 +Ref: table-bitwise-ops561367 +Ref: Bitwise Functions-Footnote-1565676 +Node: Type Functions565845 +Node: I18N Functions566996 +Node: User-defined568641 +Node: Definition Syntax569446 +Ref: Definition Syntax-Footnote-1574853 +Node: Function Example574924 +Ref: Function Example-Footnote-1577843 +Node: Function Caveats577865 +Node: Calling A Function578383 +Node: Variable Scope579341 +Node: Pass By Value/Reference582329 +Node: Return Statement585824 +Node: Dynamic Typing588805 +Node: Indirect Calls589734 +Ref: Indirect Calls-Footnote-1601036 +Node: Functions Summary601164 +Node: Library Functions603866 +Ref: Library Functions-Footnote-1607475 +Ref: Library Functions-Footnote-2607618 +Node: Library Names607789 +Ref: Library Names-Footnote-1611243 +Ref: Library Names-Footnote-2611466 +Node: General Functions611552 +Node: Strtonum Function612655 +Node: Assert Function615677 +Node: Round Function619001 +Node: Cliff Random Function620542 +Node: Ordinal Functions621558 +Ref: Ordinal Functions-Footnote-1624621 +Ref: Ordinal Functions-Footnote-2624873 +Node: Join Function625084 +Ref: Join Function-Footnote-1626853 +Node: Getlocaltime Function627053 +Node: Readfile Function630797 +Node: Shell Quoting632767 +Node: Data File Management634168 +Node: Filetrans Function634800 +Node: Rewind Function638856 +Node: File Checking640243 +Ref: File Checking-Footnote-1641575 +Node: Empty Files641776 +Node: Ignoring Assigns643755 +Node: Getopt Function645306 +Ref: Getopt Function-Footnote-1656768 +Node: Passwd Functions656968 +Ref: Passwd Functions-Footnote-1665805 +Node: Group Functions665893 +Ref: Group Functions-Footnote-1673787 +Node: Walking Arrays674000 +Node: Library Functions Summary675603 +Node: Library Exercises677004 +Node: Sample Programs678284 +Node: Running Examples679054 +Node: Clones679782 +Node: Cut Program681006 +Node: Egrep Program690725 +Ref: Egrep Program-Footnote-1698223 +Node: Id Program698333 +Node: Split Program701978 +Ref: Split Program-Footnote-1705426 +Node: Tee Program705554 +Node: Uniq Program708343 +Node: Wc Program715762 +Ref: Wc Program-Footnote-1720012 +Node: Miscellaneous Programs720106 +Node: Dupword Program721319 +Node: Alarm Program723350 +Node: Translate Program728154 +Ref: Translate Program-Footnote-1732719 +Node: Labels Program732989 +Ref: Labels Program-Footnote-1736340 +Node: Word Sorting736424 +Node: History Sorting740495 +Node: Extract Program742331 +Node: Simple Sed749856 +Node: Igawk Program752924 +Ref: Igawk Program-Footnote-1767248 +Ref: Igawk Program-Footnote-2767449 +Ref: Igawk Program-Footnote-3767571 +Node: Anagram Program767686 +Node: Signature Program770743 +Node: Programs Summary771990 +Node: Programs Exercises773183 +Ref: Programs Exercises-Footnote-1777314 +Node: Advanced Features777405 +Node: Nondecimal Data779353 +Node: Array Sorting780943 +Node: Controlling Array Traversal781640 +Ref: Controlling Array Traversal-Footnote-1789973 +Node: Array Sorting Functions790091 +Ref: Array Sorting Functions-Footnote-1793980 +Node: Two-way I/O794176 +Ref: Two-way I/O-Footnote-1799121 +Ref: Two-way I/O-Footnote-2799307 +Node: TCP/IP Networking799389 +Node: Profiling802262 +Node: Advanced Features Summary810539 +Node: Internationalization812472 +Node: I18N and L10N813952 +Node: Explaining gettext814638 +Ref: Explaining gettext-Footnote-1819663 +Ref: Explaining gettext-Footnote-2819847 +Node: Programmer i18n820012 +Ref: Programmer i18n-Footnote-1824878 +Node: Translator i18n824927 +Node: String Extraction825721 +Ref: String Extraction-Footnote-1826852 +Node: Printf Ordering826938 +Ref: Printf Ordering-Footnote-1829724 +Node: I18N Portability829788 +Ref: I18N Portability-Footnote-1832243 +Node: I18N Example832306 +Ref: I18N Example-Footnote-1835109 +Node: Gawk I18N835181 +Node: I18N Summary835819 +Node: Debugger837158 +Node: Debugging838180 +Node: Debugging Concepts838621 +Node: Debugging Terms840474 +Node: Awk Debugging843046 +Node: Sample Debugging Session843940 +Node: Debugger Invocation844460 +Node: Finding The Bug845844 +Node: List of Debugger Commands852319 +Node: Breakpoint Control853652 +Node: Debugger Execution Control857348 +Node: Viewing And Changing Data860712 +Node: Execution Stack864090 +Node: Debugger Info865727 +Node: Miscellaneous Debugger Commands869744 +Node: Readline Support874773 +Node: Limitations875665 +Node: Debugging Summary877779 +Node: Arbitrary Precision Arithmetic878947 +Node: Computer Arithmetic880363 +Ref: table-numeric-ranges883961 +Ref: Computer Arithmetic-Footnote-1884820 +Node: Math Definitions884877 +Ref: table-ieee-formats888165 +Ref: Math Definitions-Footnote-1888769 +Node: MPFR features888874 +Node: FP Math Caution890545 +Ref: FP Math Caution-Footnote-1891595 +Node: Inexactness of computations891964 +Node: Inexact representation892923 +Node: Comparing FP Values894280 +Node: Errors accumulate895362 +Node: Getting Accuracy896795 +Node: Try To Round899457 +Node: Setting precision900356 +Ref: table-predefined-precision-strings901040 +Node: Setting the rounding mode902829 +Ref: table-gawk-rounding-modes903193 +Ref: Setting the rounding mode-Footnote-1906648 +Node: Arbitrary Precision Integers906827 +Ref: Arbitrary Precision Integers-Footnote-1911726 +Node: POSIX Floating Point Problems911875 +Ref: POSIX Floating Point Problems-Footnote-1915748 +Node: Floating point summary915786 +Node: Dynamic Extensions917980 +Node: Extension Intro919532 +Node: Plugin License920798 +Node: Extension Mechanism Outline921595 +Ref: figure-load-extension922023 +Ref: figure-register-new-function923503 +Ref: figure-call-new-function924507 +Node: Extension API Description926493 +Node: Extension API Functions Introduction927943 +Node: General Data Types932767 +Ref: General Data Types-Footnote-1938506 +Node: Memory Allocation Functions938805 +Ref: Memory Allocation Functions-Footnote-1941644 +Node: Constructor Functions941740 +Node: Registration Functions943474 +Node: Extension Functions944159 +Node: Exit Callback Functions946456 +Node: Extension Version String947704 +Node: Input Parsers948369 +Node: Output Wrappers958248 +Node: Two-way processors962763 +Node: Printing Messages964967 +Ref: Printing Messages-Footnote-1966043 +Node: Updating `ERRNO'966195 +Node: Requesting Values966935 +Ref: table-value-types-returned967663 +Node: Accessing Parameters968620 +Node: Symbol Table Access969851 +Node: Symbol table by name970365 +Node: Symbol table by cookie972346 +Ref: Symbol table by cookie-Footnote-1976490 +Node: Cached values976553 +Ref: Cached values-Footnote-1980052 +Node: Array Manipulation980143 +Ref: Array Manipulation-Footnote-1981241 +Node: Array Data Types981278 +Ref: Array Data Types-Footnote-1983933 +Node: Array Functions984025 +Node: Flattening Arrays987879 +Node: Creating Arrays994771 +Node: Extension API Variables999542 +Node: Extension Versioning1000178 +Node: Extension API Informational Variables1002079 +Node: Extension API Boilerplate1003144 +Node: Finding Extensions1006953 +Node: Extension Example1007513 +Node: Internal File Description1008285 +Node: Internal File Ops1012352 +Ref: Internal File Ops-Footnote-11024022 +Node: Using Internal File Ops1024162 +Ref: Using Internal File Ops-Footnote-11026545 +Node: Extension Samples1026818 +Node: Extension Sample File Functions1028344 +Node: Extension Sample Fnmatch1035982 +Node: Extension Sample Fork1037473 +Node: Extension Sample Inplace1038688 +Node: Extension Sample Ord1040363 +Node: Extension Sample Readdir1041199 +Ref: table-readdir-file-types1042075 +Node: Extension Sample Revout1042886 +Node: Extension Sample Rev2way1043476 +Node: Extension Sample Read write array1044216 +Node: Extension Sample Readfile1046156 +Node: Extension Sample Time1047251 +Node: Extension Sample API Tests1048600 +Node: gawkextlib1049091 +Node: Extension summary1051749 +Node: Extension Exercises1055438 +Node: Language History1056160 +Node: V7/SVR3.11057816 +Node: SVR41059997 +Node: POSIX1061442 +Node: BTL1062831 +Node: POSIX/GNU1063565 +Node: Feature History1069446 +Node: Common Extensions1083240 +Node: Ranges and Locales1084564 +Ref: Ranges and Locales-Footnote-11089182 +Ref: Ranges and Locales-Footnote-21089209 +Ref: Ranges and Locales-Footnote-31089443 +Node: Contributors1089664 +Node: History summary1095205 +Node: Installation1096575 +Node: Gawk Distribution1097521 +Node: Getting1098005 +Node: Extracting1098828 +Node: Distribution contents1100463 +Node: Unix Installation1106528 +Node: Quick Installation1107211 +Node: Shell Startup Files1109622 +Node: Additional Configuration Options1110701 +Node: Configuration Philosophy1112440 +Node: Non-Unix Installation1114809 +Node: PC Installation1115267 +Node: PC Binary Installation1116586 +Node: PC Compiling1118434 +Ref: PC Compiling-Footnote-11121455 +Node: PC Testing1121564 +Node: PC Using1122740 +Node: Cygwin1126855 +Node: MSYS1127678 +Node: VMS Installation1128178 +Node: VMS Compilation1128970 +Ref: VMS Compilation-Footnote-11130192 +Node: VMS Dynamic Extensions1130250 +Node: VMS Installation Details1131934 +Node: VMS Running1134186 +Node: VMS GNV1137022 +Node: VMS Old Gawk1137756 +Node: Bugs1138226 +Node: Other Versions1142109 +Node: Installation summary1148537 +Node: Notes1149593 +Node: Compatibility Mode1150458 +Node: Additions1151240 +Node: Accessing The Source1152165 +Node: Adding Code1153601 +Node: New Ports1159766 +Node: Derived Files1164248 +Ref: Derived Files-Footnote-11169723 +Ref: Derived Files-Footnote-21169757 +Ref: Derived Files-Footnote-31170353 +Node: Future Extensions1170467 +Node: Implementation Limitations1171073 +Node: Extension Design1172321 +Node: Old Extension Problems1173475 +Ref: Old Extension Problems-Footnote-11174992 +Node: Extension New Mechanism Goals1175049 +Ref: Extension New Mechanism Goals-Footnote-11178409 +Node: Extension Other Design Decisions1178598 +Node: Extension Future Growth1180706 +Node: Old Extension Mechanism1181542 +Node: Notes summary1183304 +Node: Basic Concepts1184490 +Node: Basic High Level1185171 +Ref: figure-general-flow1185443 +Ref: figure-process-flow1186042 +Ref: Basic High Level-Footnote-11189271 +Node: Basic Data Typing1189456 +Node: Glossary1192784 +Node: Copying1217942 +Node: GNU Free Documentation License1255498 +Node: Index1280634  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 376ec02b..e0023245 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -5178,13 +5178,12 @@ letters or numbers. @value{COMMONEXT} @quotation CAUTION In ISO C, the escape sequence continues until the first nonhexadecimal digit is seen. -@c FIXME: Add exact version here. For many years, @command{gawk} would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. However, using more than two hexadecimal digits produced undefined results. -As of @value{PVERSION} @strong{FIXME:} 4.3.0, only two digits +As of @value{PVERSION} 4.2, only two digits are processed. @end quotation @@ -10538,6 +10537,11 @@ $ @kbd{gawk '} Here, @command{gawk} did not produce a fatal error; instead it let the @command{awk} program code detect the problem and handle it. +This mechanism works also for standard output and standard error. +For standard output, you may use @code{PROCINFO["-", "nonfatal"]} +or @code{PROCINFO["/dev/stdout", "nonfatal"]}. For standard error, use +@code{PROCINFO["/dev/stderr", "nonfatal"]}. + @node Output Summary @section Summary @@ -35991,6 +35995,10 @@ Indirect function calls @item Directories on the command line produce a warning and are skipped (@pxref{Command-line directories}). + +@item +Output with @code{print} and @code{printf} need not be fatal +(@pxref{Nonfatal}). @end itemize @item @@ -36078,6 +36086,11 @@ The @code{isarray()} function to check if a variable is an array or not The @code{bindtextdomain()}, @code{dcgettext()} and @code{dcngettext()} functions for internationalization (@pxref{Programmer i18n}). + +@item +The @code{div()} function for doing integer +division and remainder +(@pxref{Numeric Functions}). @end itemize @item @@ -36211,8 +36224,14 @@ Ultrix @end itemize @item -@c FIXME: Verify the version here. -Support for MirBSD was removed at @command{gawk} @value{PVERSION} 4.2. +Support for the following systems was removed from the code +for @command{gawk} @value{PVERSION} 4.2: + +@c nested table +@itemize @value{MINUS} +@item +MirBSD +@end itemize @end itemize @@ -36829,9 +36848,12 @@ with a minimum of two The dynamic extension interface was completely redone (@pxref{Dynamic Extensions}). +@item +Support for Ultrix was removed. + @end itemize -Version @strong{FIXME} XXXX introduced the following changes: +Version 4.2 introduced the following changes: @itemize @bullet @item @@ -36842,25 +36864,28 @@ environment and that of programs that it runs. @item The @option{--pretty-print} option no longer runs the @command{awk} program too. -FIXME: Add xref. +@xref{Options}. @item The @command{igawk} program and its manual page are no longer installed when @command{gawk} is built. -FIXME: Add xref. +@xref{Igawk Program}. @item The @code{div()} function. -FIXME: Add xref. +@xref{Numeric Functions}. @item The maximum number of hexdecimal digits in @samp{\x} escapes is now two. -FIXME: Add xref. +@xref{Escape Sequences}. @item Nonfatal output with @code{print} and @code{printf}. @xref{Nonfatal}. + +@item +Support for MirBSD was removed. @end itemize @c XXX ADD MORE STUFF HERE diff --git a/doc/gawktexi.in b/doc/gawktexi.in index bdd94bff..87fa41ca 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -5089,13 +5089,12 @@ letters or numbers. @value{COMMONEXT} @quotation CAUTION In ISO C, the escape sequence continues until the first nonhexadecimal digit is seen. -@c FIXME: Add exact version here. For many years, @command{gawk} would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. However, using more than two hexadecimal digits produced undefined results. -As of @value{PVERSION} @strong{FIXME:} 4.3.0, only two digits +As of @value{PVERSION} 4.2, only two digits are processed. @end quotation @@ -10035,6 +10034,11 @@ $ @kbd{gawk '} Here, @command{gawk} did not produce a fatal error; instead it let the @command{awk} program code detect the problem and handle it. +This mechanism works also for standard output and standard error. +For standard output, you may use @code{PROCINFO["-", "nonfatal"]} +or @code{PROCINFO["/dev/stdout", "nonfatal"]}. For standard error, use +@code{PROCINFO["/dev/stderr", "nonfatal"]}. + @node Output Summary @section Summary @@ -35084,6 +35088,10 @@ Indirect function calls @item Directories on the command line produce a warning and are skipped (@pxref{Command-line directories}). + +@item +Output with @code{print} and @code{printf} need not be fatal +(@pxref{Nonfatal}). @end itemize @item @@ -35171,6 +35179,11 @@ The @code{isarray()} function to check if a variable is an array or not The @code{bindtextdomain()}, @code{dcgettext()} and @code{dcngettext()} functions for internationalization (@pxref{Programmer i18n}). + +@item +The @code{div()} function for doing integer +division and remainder +(@pxref{Numeric Functions}). @end itemize @item @@ -35304,8 +35317,14 @@ Ultrix @end itemize @item -@c FIXME: Verify the version here. -Support for MirBSD was removed at @command{gawk} @value{PVERSION} 4.2. +Support for the following systems was removed from the code +for @command{gawk} @value{PVERSION} 4.2: + +@c nested table +@itemize @value{MINUS} +@item +MirBSD +@end itemize @end itemize @@ -35922,9 +35941,12 @@ with a minimum of two The dynamic extension interface was completely redone (@pxref{Dynamic Extensions}). +@item +Support for Ultrix was removed. + @end itemize -Version @strong{FIXME} XXXX introduced the following changes: +Version 4.2 introduced the following changes: @itemize @bullet @item @@ -35935,25 +35957,28 @@ environment and that of programs that it runs. @item The @option{--pretty-print} option no longer runs the @command{awk} program too. -FIXME: Add xref. +@xref{Options}. @item The @command{igawk} program and its manual page are no longer installed when @command{gawk} is built. -FIXME: Add xref. +@xref{Igawk Program}. @item The @code{div()} function. -FIXME: Add xref. +@xref{Numeric Functions}. @item The maximum number of hexdecimal digits in @samp{\x} escapes is now two. -FIXME: Add xref. +@xref{Escape Sequences}. @item Nonfatal output with @code{print} and @code{printf}. @xref{Nonfatal}. + +@item +Support for MirBSD was removed. @end itemize @c XXX ADD MORE STUFF HERE diff --git a/io.c b/io.c index b4688c89..b3819c01 100644 --- a/io.c +++ b/io.c @@ -1085,6 +1085,25 @@ getredirect(const char *str, int len) return NULL; } +/* is_non_fatal_std --- return true if fp is stdout/stderr and nonfatal */ + +bool +is_non_fatal_std(FILE *fp) +{ + if (in_PROCINFO("nonfatal", NULL, NULL)) + return true; + + /* yucky logic. sigh. */ + if (fp == stdout) { + return ( in_PROCINFO("-", "nonfatal", NULL) != NULL + || in_PROCINFO("/dev/stdout", "nonfatal", NULL) != NULL); + } else if (fp == stderr) { + return (in_PROCINFO("/dev/stderr", "nonfatal", NULL) != NULL); + } + + return false; +} + /* close_one --- temporarily close an open file to re-use the fd */ static void -- cgit v1.2.3 From e5f5db59aacd63af3369cb113c1c7b097c2f4be5 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 2 Jan 2015 15:19:35 -0500 Subject: Remove the select extension, since it will be part of gawkextlib. --- extension/ChangeLog | 10 + extension/Makefile.am | 8 +- extension/Makefile.in | 23 +- extension/configh.in | 15 -- extension/configure | 7 +- extension/configure.ac | 7 +- extension/select.c | 681 ------------------------------------------------- extension/siglist.h | 76 ------ 8 files changed, 20 insertions(+), 807 deletions(-) delete mode 100644 extension/select.c delete mode 100644 extension/siglist.h diff --git a/extension/ChangeLog b/extension/ChangeLog index 053ba50b..e8fa12fd 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,13 @@ +2015-01-02 Andrew J. Schorr + + Remove the select extension, since it will be part of gawkextlib. + * select.c, siglist.h: Deleted. + * Makefile.am (pkgextension_LTLIBRARIES): Remove select.la. + (select_la_SOURCES, select_la_LDFLAGS, select_la_LIBADD): Remove. + (EXTRA_DIST): Remove siglist.h. + * configure.ac (AC_CHECK_HEADERS): Remove signal.h. + (AC_CHECK_FUNCS): Remove fcntl, kill, sigaction, and sigprocmask. + 2014-12-14 Andrew J. Schorr Remove the errno extension, since it is now part of gawkextlib. diff --git a/extension/Makefile.am b/extension/Makefile.am index 5c0df894..b9dabfe2 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -45,7 +45,6 @@ pkgextension_LTLIBRARIES = \ revoutput.la \ revtwoway.la \ rwarray.la \ - select.la \ testext.la \ time.la @@ -94,10 +93,6 @@ rwarray_la_SOURCES = rwarray.c rwarray_la_LDFLAGS = $(MY_MODULE_FLAGS) rwarray_la_LIBADD = $(MY_LIBS) -select_la_SOURCES = select.c -select_la_LDFLAGS = $(MY_MODULE_FLAGS) -select_la_LIBADD = $(MY_LIBS) - time_la_SOURCES = time.c time_la_LDFLAGS = $(MY_MODULE_FLAGS) time_la_LIBADD = $(MY_LIBS) @@ -124,8 +119,7 @@ EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ fts.3 \ - README.fts \ - siglist.h + README.fts dist_man_MANS = \ filefuncs.3am fnmatch.3am fork.3am inplace.3am \ diff --git a/extension/Makefile.in b/extension/Makefile.in index 015bc118..2596d282 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -231,12 +231,6 @@ 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 $@ -select_la_DEPENDENCIES = $(am__DEPENDENCIES_2) -am_select_la_OBJECTS = select.lo -select_la_OBJECTS = $(am_select_la_OBJECTS) -select_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(select_la_LDFLAGS) $(LDFLAGS) -o $@ testext_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am_testext_la_OBJECTS = testext.lo testext_la_OBJECTS = $(am_testext_la_OBJECTS) @@ -287,14 +281,12 @@ SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ - $(rwarray_la_SOURCES) $(select_la_SOURCES) \ - $(testext_la_SOURCES) $(time_la_SOURCES) + $(rwarray_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) DIST_SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ - $(rwarray_la_SOURCES) $(select_la_SOURCES) \ - $(testext_la_SOURCES) $(time_la_SOURCES) + $(rwarray_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -536,7 +528,6 @@ pkgextension_LTLIBRARIES = \ revoutput.la \ revtwoway.la \ rwarray.la \ - select.la \ testext.la \ time.la @@ -575,9 +566,6 @@ revtwoway_la_LIBADD = $(MY_LIBS) rwarray_la_SOURCES = rwarray.c rwarray_la_LDFLAGS = $(MY_MODULE_FLAGS) rwarray_la_LIBADD = $(MY_LIBS) -select_la_SOURCES = select.c -select_la_LDFLAGS = $(MY_MODULE_FLAGS) -select_la_LIBADD = $(MY_LIBS) time_la_SOURCES = time.c time_la_LDFLAGS = $(MY_MODULE_FLAGS) time_la_LIBADD = $(MY_LIBS) @@ -588,8 +576,7 @@ EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ fts.3 \ - README.fts \ - siglist.h + README.fts dist_man_MANS = \ filefuncs.3am fnmatch.3am fork.3am inplace.3am \ @@ -719,9 +706,6 @@ revtwoway.la: $(revtwoway_la_OBJECTS) $(revtwoway_la_DEPENDENCIES) $(EXTRA_revtw rwarray.la: $(rwarray_la_OBJECTS) $(rwarray_la_DEPENDENCIES) $(EXTRA_rwarray_la_DEPENDENCIES) $(AM_V_CCLD)$(rwarray_la_LINK) -rpath $(pkgextensiondir) $(rwarray_la_OBJECTS) $(rwarray_la_LIBADD) $(LIBS) -select.la: $(select_la_OBJECTS) $(select_la_DEPENDENCIES) $(EXTRA_select_la_DEPENDENCIES) - $(AM_V_CCLD)$(select_la_LINK) -rpath $(pkgextensiondir) $(select_la_OBJECTS) $(select_la_LIBADD) $(LIBS) - testext.la: $(testext_la_OBJECTS) $(testext_la_DEPENDENCIES) $(EXTRA_testext_la_DEPENDENCIES) $(AM_V_CCLD)$(testext_la_LINK) -rpath $(pkgextensiondir) $(testext_la_OBJECTS) $(testext_la_LIBADD) $(LIBS) @@ -745,7 +729,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revoutput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revtwoway.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rwarray.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@ diff --git a/extension/configh.in b/extension/configh.in index 57c9ec3e..5842f2f4 100644 --- a/extension/configh.in +++ b/extension/configh.in @@ -40,9 +40,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -/* Define to 1 if you have the `fcntl' function. */ -#undef HAVE_FCNTL - /* Define to 1 if you have the `fdopendir' function. */ #undef HAVE_FDOPENDIR @@ -70,9 +67,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `kill' function. */ -#undef HAVE_KILL - /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H @@ -88,15 +82,6 @@ /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT -/* Define to 1 if you have the `sigaction' function. */ -#undef HAVE_SIGACTION - -/* Define to 1 if you have the header file. */ -#undef HAVE_SIGNAL_H - -/* Define to 1 if you have the `sigprocmask' function. */ -#undef HAVE_SIGPROCMASK - /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H diff --git a/extension/configure b/extension/configure index 4bd1d940..7ee9c0df 100755 --- a/extension/configure +++ b/extension/configure @@ -14233,7 +14233,7 @@ else $as_echo "no" >&6; } fi -for ac_header in fnmatch.h limits.h sys/time.h sys/select.h sys/param.h signal.h +for ac_header in fnmatch.h limits.h sys/time.h sys/select.h sys/param.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -14490,9 +14490,8 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi -for ac_func in fcntl fdopendir fnmatch gettimeofday \ - getdtablesize kill nanosleep select sigaction sigprocmask \ - GetSystemTimeAsFileTime +for ac_func in fdopendir fnmatch gettimeofday \ + getdtablesize nanosleep select GetSystemTimeAsFileTime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/extension/configure.ac b/extension/configure.ac index 37e306f3..1f876a0e 100644 --- a/extension/configure.ac +++ b/extension/configure.ac @@ -66,14 +66,13 @@ else AC_MSG_RESULT([no]) fi -AC_CHECK_HEADERS(fnmatch.h limits.h sys/time.h sys/select.h sys/param.h signal.h) +AC_CHECK_HEADERS(fnmatch.h limits.h sys/time.h sys/select.h sys/param.h) AC_HEADER_DIRENT AC_HEADER_MAJOR AC_HEADER_TIME -AC_CHECK_FUNCS(fcntl fdopendir fnmatch gettimeofday \ - getdtablesize kill nanosleep select sigaction sigprocmask \ - GetSystemTimeAsFileTime) +AC_CHECK_FUNCS(fdopendir fnmatch gettimeofday \ + getdtablesize nanosleep select GetSystemTimeAsFileTime) GAWK_FUNC_DIRFD GAWK_PREREQ_DIRFD diff --git a/extension/select.c b/extension/select.c deleted file mode 100644 index b2105b75..00000000 --- a/extension/select.c +++ /dev/null @@ -1,681 +0,0 @@ -/* - * select.c - Builtin functions to provide select I/O multiplexing. - */ - -/* - * Copyright (C) 2013 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "gawkapi.h" - -#include "gettext.h" -#define _(msgid) gettext(msgid) -#define N_(msgid) msgid - -static const gawk_api_t *api; /* for convenience macros to work */ -static awk_ext_id_t *ext_id; -static const char *ext_version = "select extension: version 1.0"; -static awk_bool_t (*init_func)(void) = NULL; - -int plugin_is_GPL_compatible; - -#if defined(HAVE_SELECT) && defined(HAVE_SYS_SELECT_H) -#include -#endif - -#ifdef HAVE_SIGNAL_H -#include -#endif - -static const char *const signum2name[] = { -#define init_sig(A, B, C) [A] = B, -#include "siglist.h" -#undef init_sig -}; -#define NUMSIG sizeof(signum2name)/sizeof(signum2name[0]) - -#define MIN_VALID_SIGNAL 1 /* 0 is not allowed! */ -/* - * We would like to use NSIG, but I think this seems to be a BSD'ism that is not - * POSIX-compliant. It is used internally by glibc, but not always - * available. We add a buffer to the maximum number in the provided mapping - * in case the list is not comprehensive: - */ -#define MAX_VALID_SIGNAL (NUMSIG+100) -#define IS_VALID_SIGNAL(X) \ - (((X) >= MIN_VALID_SIGNAL) && ((X) <= MAX_VALID_SIGNAL)) - -static int -signame2num(const char *name) -{ - size_t i; - - if (strncasecmp(name, "sig", 3) == 0) - /* skip "sig" prefix */ - name += 3; - for (i = MIN_VALID_SIGNAL; i < NUMSIG; i++) { - if (signum2name[i] && ! strcasecmp(signum2name[i], name)) - return i; - } - return -1; -} - -static volatile struct { - int flag; - sigset_t mask; -} caught; - -static void -signal_handler(int signum) -{ - /* - * All signals should be blocked, so we do not have to worry about - * whether sigaddset is thread-safe. It is documented to be - * async-signal-safe. - */ - sigaddset(& caught.mask, signum); - caught.flag = 1; -#ifndef HAVE_SIGACTION - /* - * On platforms without sigaction, we do not know how the legacy - * signal API will behave. There does not appear to be an autoconf - * test for whether the signal handler is reset to default each time - * a signal is trapped, so we do this to be safe. - */ - signal(signum, signal_handler); -#endif -} - -static int -integer_string(const char *s, long *x) -{ - char *endptr; - - *x = strtol(s, & endptr, 10); - return ((endptr != s) && (*endptr == '\0')) ? 0 : -1; -} - -static int -get_signal_number(awk_value_t signame) -{ - int x; - - switch (signame.val_type) { - case AWK_NUMBER: - x = signame.num_value; - if ((x != signame.num_value) || ! IS_VALID_SIGNAL(x)) { - update_ERRNO_string(_("invalid signal number")); - return -1; - } - return x; - case AWK_STRING: - if ((x = signame2num(signame.str_value.str)) >= 0) - return x; - { - long z; - if ((integer_string(signame.str_value.str, &z) == 0) && IS_VALID_SIGNAL(z)) - return z; - } - update_ERRNO_string(_("invalid signal name")); - return -1; - default: - update_ERRNO_string(_("signal name argument must be string or numeric")); - return -1; - } -} - -static awk_value_t * -signal_result(awk_value_t *result, void (*func)(int)) -{ - awk_value_t override; - - if (func == SIG_DFL) - return make_const_string("default", 7, result); - if (func == SIG_IGN) - return make_const_string("ignore", 6, result); - if (func == signal_handler) - return make_const_string("trap", 4, result); - if (get_argument(2, AWK_NUMBER, & override) && override.num_value) - return make_const_string("unknown", 7, result); - /* need to roll it back! */ - update_ERRNO_string(_("select_signal: override not requested for unknown signal handler")); - make_null_string(result); - return NULL; -} - -/* do_signal --- trap signals */ - -static awk_value_t * -do_signal(int nargs, awk_value_t *result) -{ - awk_value_t signame, disposition; - int signum; - void (*func)(int); - - if (do_lint && nargs > 3) - lintwarn(ext_id, _("select_signal: called with too many arguments")); - if (! get_argument(0, AWK_UNDEFINED, & signame)) { - update_ERRNO_string(_("select_signal: missing required signal name argument")); - return make_null_string(result); - } - if ((signum = get_signal_number(signame)) < 0) - return make_null_string(result); - if (! get_argument(1, AWK_STRING, & disposition)) { - update_ERRNO_string(_("select_signal: missing required signal disposition argument")); - return make_null_string(result); - } - if (strcasecmp(disposition.str_value.str, "default") == 0) - func = SIG_DFL; - else if (strcasecmp(disposition.str_value.str, "ignore") == 0) - func = SIG_IGN; - else if (strcasecmp(disposition.str_value.str, "trap") == 0) - func = signal_handler; - else { - update_ERRNO_string(_("select_signal: invalid disposition argument")); - return make_null_string(result); - } - -#ifdef HAVE_SIGPROCMASK -/* Temporarily block this signal in case we need to roll back the handler! */ -#define PROTECT \ - sigset_t set, oldset; \ - sigemptyset(& set); \ - sigaddset(& set, signum); \ - sigprocmask(SIG_BLOCK, &set, &oldset); -#define RELEASE sigprocmask(SIG_SETMASK, &oldset, NULL); -#else -/* Brain-damaged platform, so we will have to live with the race condition. */ -#define PROTECT -#define RELEASE -#endif - -#ifdef HAVE_SIGACTION - { - struct sigaction sa, prev; - sa.sa_handler = func; - sigfillset(& sa.sa_mask); /* block all signals in handler */ - sa.sa_flags = SA_RESTART; - { - PROTECT - if (sigaction(signum, &sa, &prev) < 0) { - update_ERRNO_int(errno); - RELEASE - return make_null_string(result); - } - if (signal_result(result, prev.sa_handler)) { - RELEASE - return result; - } - /* roll it back! */ - sigaction(signum, &prev, NULL); - RELEASE - return result; - } - } -#else - /* - * Fall back to signal; this is available on all platforms. We can - * only hope that it does the right thing. - */ - { - void (*prev)(int); - PROTECT - if ((prev = signal(signum, func)) == SIG_ERR) { - update_ERRNO_int(errno); - RELEASE - return make_null_string(result); - } - if (signal_result(result, prev)) { - RELEASE - return result; - } - /* roll it back! */ - signal(signum, prev); - RELEASE - return result; - } -#endif -} - -/* do_kill --- send a signal */ - -static awk_value_t * -do_kill(int nargs, awk_value_t *result) -{ -#ifdef HAVE_KILL - awk_value_t pidarg, signame; - pid_t pid; - int signum; - int rc; - - if (do_lint && nargs > 2) - lintwarn(ext_id, _("kill: called with too many arguments")); - if (! get_argument(0, AWK_NUMBER, & pidarg)) { - update_ERRNO_string(_("kill: missing required pid argument")); - return make_number(-1, result); - } - pid = pidarg.num_value; - if (pid != pidarg.num_value) { - update_ERRNO_string(_("kill: pid argument must be an integer")); - return make_number(-1, result); - } - if (! get_argument(1, AWK_UNDEFINED, & signame)) { - update_ERRNO_string(_("kill: missing required signal name argument")); - return make_number(-1, result); - } - if ((signum = get_signal_number(signame)) < 0) - return make_number(-1, result); - if ((rc = kill(pid, signum)) < 0) - update_ERRNO_int(errno); - return make_number(rc, result); -#else - update_ERRNO_string(_("kill: not supported on this platform")); - return make_number(-1, result); -#endif -} - -static int -grabfd(int i, const awk_input_buf_t *ibuf, const awk_output_buf_t *obuf, const char *fnm, const char *ftp) -{ - switch (i) { - case 0: /* read */ - return ibuf ? ibuf->fd : -1; - case 1: /* write */ - return obuf ? fileno(obuf->fp) : -1; - case 2: /* except */ - if (ibuf) { - if (obuf && ibuf->fd != fileno(obuf->fp)) - warning(ext_id, _("select: `%s', `%s' in `except' array has clashing fds, using input %d, not output %d"), fnm, ftp, ibuf->fd, fileno(obuf->fp)); - return ibuf->fd; - } - if (obuf) - return fileno(obuf->fp); - break; - } - return -1; -} - -/* do_select --- I/O multiplexing */ - -static awk_value_t * -do_select(int nargs, awk_value_t *result) -{ - static const char *argname[] = { "read", "write", "except" }; - struct { - awk_value_t array; - awk_flat_array_t *flat; - fd_set bits; - int *array2fd; - } fds[3]; - awk_value_t timeout_arg; - int i; - struct timeval maxwait; - struct timeval *timeout; - int nfds = 0; - int rc; - awk_value_t sigarr; - int dosig = 0; - - if (do_lint && nargs > 5) - lintwarn(ext_id, _("select: called with too many arguments")); - -#define EL fds[i].flat->elements[j] - if (nargs == 5) { - dosig = 1; - if (! get_argument(4, AWK_ARRAY, &sigarr)) { - warning(ext_id, _("select: the signal argument must be an array")); - update_ERRNO_string(_("select: bad signal parameter")); - return make_number(-1, result); - } - clear_array(sigarr.array_cookie); - } - - for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) { - size_t j; - - if (! get_argument(i, AWK_ARRAY, & fds[i].array)) { - warning(ext_id, _("select: bad array parameter `%s'"), argname[i]); - update_ERRNO_string(_("select: bad array parameter")); - return make_number(-1, result); - } - /* N.B. flatten_array fails for empty arrays, so that's OK */ - FD_ZERO(&fds[i].bits); - if (flatten_array(fds[i].array.array_cookie, &fds[i].flat)) { - emalloc(fds[i].array2fd, int *, fds[i].flat->count*sizeof(int), "select"); - for (j = 0; j < fds[i].flat->count; j++) { - long x; - fds[i].array2fd[j] = -1; - /* note: the index is always delivered as a string */ - - if (((EL.value.val_type == AWK_UNDEFINED) || ((EL.value.val_type == AWK_STRING) && ! EL.value.str_value.len)) && (integer_string(EL.index.str_value.str, &x) == 0) && (x >= 0)) - fds[i].array2fd[j] = x; - else if (EL.value.val_type == AWK_STRING) { - const awk_input_buf_t *ibuf; - const awk_output_buf_t *obuf; - int fd; - if (get_file(EL.index.str_value.str, EL.index.str_value.len, EL.value.str_value.str, EL.value.str_value.len, -1, &ibuf, &obuf) && ((fd = grabfd(i, ibuf, obuf, EL.index.str_value.str, EL.value.str_value.str)) >= 0)) - fds[i].array2fd[j] = fd; - else - warning(ext_id, _("select: get_file(`%s', `%s') failed in `%s' array"), EL.index.str_value.str, EL.value.str_value.str, argname[i]); - } - else - warning(ext_id, _("select: command type should be a string for `%s' in `%s' array"), EL.index.str_value.str, argname[i]); - if (fds[i].array2fd[j] < 0) { - update_ERRNO_string(_("select: get_file failed")); - if (! release_flattened_array(fds[i].array.array_cookie, fds[i].flat)) - warning(ext_id, _("select: release_flattened_array failed")); - free(fds[i].array2fd); - return make_number(-1, result); - } - FD_SET(fds[i].array2fd[j], &fds[i].bits); - if (nfds <= fds[i].array2fd[j]) - nfds = fds[i].array2fd[j]+1; - } - } - else - fds[i].flat = NULL; - } - if (dosig && caught.flag) { - /* take a quick poll, but do not block, since signals have been trapped */ - maxwait.tv_sec = maxwait.tv_usec = 0; - timeout = &maxwait; - } - else if (get_argument(3, AWK_NUMBER, &timeout_arg)) { - double secs = timeout_arg.num_value; - if (secs < 0) { - warning(ext_id, _("select: treating negative timeout as zero")); - secs = 0; - } - maxwait.tv_sec = secs; - maxwait.tv_usec = (secs-(double)maxwait.tv_sec)*1000000.0; - timeout = &maxwait; - } else - timeout = NULL; - - if ((rc = select(nfds, &fds[0].bits, &fds[1].bits, &fds[2].bits, timeout)) < 0) - update_ERRNO_int(errno); - - if (dosig && caught.flag) { - int i; - sigset_t trapped; -#ifdef HAVE_SIGPROCMASK - /* - * Block signals while we copy and reset the mask to eliminate - * a race condition whereby a signal could be missed. - */ - sigset_t set, oldset; - sigfillset(& set); - sigprocmask(SIG_SETMASK, &set, &oldset); -#endif - /* - * Reset flag to 0 first. If we don't have sigprocmask, - * that may reduce the chance of missing a signal. - */ - caught.flag = 0; - trapped = caught.mask; - sigemptyset(& caught.mask); -#ifdef HAVE_SIGPROCMASK - sigprocmask(SIG_SETMASK, &oldset, NULL); -#endif - /* populate sigarr with trapped signals */ - /* - * XXX this is very inefficient! Note that get_signal_number - * ensures that we trap only signals between MIN_VALID_SIGNAL - * and MAX_VALID_SIGNAL. - */ - for (i = MIN_VALID_SIGNAL; i <= MAX_VALID_SIGNAL; i++) { - if (sigismember(& trapped, i) > 0) { - awk_value_t idx, val; - if ((i < NUMSIG) && signum2name[i]) - set_array_element(sigarr.array_cookie, make_number(i, &idx), make_const_string(signum2name[i], strlen(signum2name[i]), &val)); - else - set_array_element(sigarr.array_cookie, make_number(i, &idx), make_null_string(&val)); - } - } - } - - if (rc < 0) { - /* bit masks are undefined, so delete all array entries */ - for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) { - if (fds[i].flat) { - size_t j; - for (j = 0; j < fds[i].flat->count; j++) - EL.flags |= AWK_ELEMENT_DELETE; - if (! release_flattened_array(fds[i].array.array_cookie, fds[i].flat)) - warning(ext_id, _("select: release_flattened_array failed")); - free(fds[i].array2fd); - } - } - return make_number(rc, result); - } - - for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) { - if (fds[i].flat) { - size_t j; - /* remove array elements not set in the bit mask */ - for (j = 0; j < fds[i].flat->count; j++) { - if (! FD_ISSET(fds[i].array2fd[j], &fds[i].bits)) - EL.flags |= AWK_ELEMENT_DELETE; - } - if (! release_flattened_array(fds[i].array.array_cookie, fds[i].flat)) - warning(ext_id, _("select: release_flattened_array failed")); - free(fds[i].array2fd); - } - } -#undef EL - - /* Set the return value */ - return make_number(rc, result); -} - -static int -set_non_blocking(int fd) -{ -#if defined(HAVE_FCNTL) && defined(O_NONBLOCK) - int flags; - - if (((flags = fcntl(fd, F_GETFL)) == -1) || - (fcntl(fd, F_SETFL, (flags|O_NONBLOCK)) == -1)) { - update_ERRNO_int(errno); - return -1; - } - return 0; -#else - update_ERRNO_string(_("set_non_blocking: not supported on this platform")); - return -1; -#endif -} - -static void -set_retry(const char *name) -{ - static const char suffix[] = "RETRY"; - static awk_array_t procinfo; - static char *subsep; - static size_t subsep_len; - awk_value_t idx, val; - char *s; - size_t len; - - if (!subsep) { - /* initialize cached values for PROCINFO and SUBSEP */ - awk_value_t res; - - if (! sym_lookup("PROCINFO", AWK_ARRAY, & res)) { - procinfo = create_array(); - res.val_type = AWK_ARRAY; - res.array_cookie = procinfo; - if (! sym_update("PROCINFO", & res)) { - warning(ext_id, _("set_non_blocking: could not install PROCINFO array; unable to configure PROCINFO RETRY for `%s'"), name); - return; - } - /* must retrieve it after installing it! */ - if (! sym_lookup("PROCINFO", AWK_ARRAY, & res)) { - warning(ext_id, _("set_non_blocking: sym_lookup(`%s') failed; unable to configure PROCINFO RETRY for `%s'"), "PROCINFO", name); - return; - } - } - procinfo = res.array_cookie; - - if (! sym_lookup("SUBSEP", AWK_STRING, & res)) { - warning(ext_id, _("set_non_blocking: sym_lookup(`%s') failed; unable to configure PROCINFO RETRY for `%s'"), "SUBSEP", name); - return; - } - subsep = strdup(res.str_value.str); - subsep_len = res.str_value.len; - } - - len = strlen(name)+subsep_len+sizeof(suffix)-1; - emalloc(s, char *, len+2, "set_non_blocking"); - sprintf(s, "%s%s%s", name, subsep, suffix); - - if (! set_array_element(procinfo, make_malloced_string(s, len, &idx), make_null_string(&val))) - warning(ext_id, _("set_non_blocking: unable to configure PROCINFO RETRY for `%s'"), name); -} - -/* do_set_non_blocking --- Set a file to be non-blocking */ - -static awk_value_t * -do_set_non_blocking(int nargs, awk_value_t *result) -{ - awk_value_t cmd, cmdtype; - int fd; - - if (do_lint && nargs > 2) - lintwarn(ext_id, _("set_non_blocking: called with too many arguments")); - /* - * N.B. If called with a single "" arg, we want it to work! In that - * case, the 1st arg is an empty string, and get_argument fails on the - * 2nd arg. Note that API get_file promises not to access the type - * argument if the name argument is an empty string. - */ - if (get_argument(0, AWK_NUMBER, & cmd) && - (cmd.num_value == (fd = cmd.num_value)) && - ! get_argument(1, AWK_STRING, & cmdtype)) - return make_number(set_non_blocking(fd), result); - else if (get_argument(0, AWK_STRING, & cmd) && - (get_argument(1, AWK_STRING, & cmdtype) || - (! cmd.str_value.len && (nargs == 1)))) { - const awk_input_buf_t *ibuf; - const awk_output_buf_t *obuf; - if (get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len, -1, &ibuf, &obuf)) { - int rc = set_non_blocking(ibuf ? ibuf->fd : fileno(obuf->fp)); - if (rc == 0 && ibuf) - set_retry(ibuf->name); - return make_number(rc, result); - } - warning(ext_id, _("set_non_blocking: get_file(`%s', `%s') failed"), cmd.str_value.str, cmdtype.str_value.str); - } else if (do_lint) { - if (nargs < 2) - lintwarn(ext_id, _("set_non_blocking: called with too few arguments")); - else - lintwarn(ext_id, _("set_non_blocking: called with inappropriate argument(s)")); - } - return make_number(-1, result); -} - -/* do_input_fd --- Return command's input file descriptor */ - -static awk_value_t * -do_input_fd(int nargs, awk_value_t *result) -{ - awk_value_t cmd, cmdtype; - - if (do_lint && nargs > 2) - lintwarn(ext_id, _("input_fd: called with too many arguments")); - /* - * N.B. If called with a single "" arg, we want it to work! In that - * case, the 1st arg is an empty string, and get_argument fails on the - * 2nd arg. Note that API get_file promises not to access the type - * argument if the name argument is an empty string. - */ - if (get_argument(0, AWK_STRING, & cmd) && - (get_argument(1, AWK_STRING, & cmdtype) || - (! cmd.str_value.len && (nargs == 1)))) { - const awk_input_buf_t *ibuf; - const awk_output_buf_t *obuf; - if (get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len, -1, &ibuf, &obuf) && ibuf) - return make_number(ibuf->fd, result); - warning(ext_id, _("input_fd: get_file(`%s', `%s') failed to return an input descriptor"), cmd.str_value.str, cmdtype.str_value.str); - } else if (do_lint) { - if (nargs < 2) - lintwarn(ext_id, _("input_fd: called with too few arguments")); - else - lintwarn(ext_id, _("input_fd: called with inappropriate argument(s)")); - } - return make_number(-1, result); -} - -/* do_output_fd --- Return command's output file descriptor */ - -static awk_value_t * -do_output_fd(int nargs, awk_value_t *result) -{ - awk_value_t cmd, cmdtype; - - if (do_lint && nargs > 2) - lintwarn(ext_id, _("output_fd: called with too many arguments")); - /* - * N.B. If called with a single "" arg, it will not work, since there - * is no output fd associated the current input file. - */ - if (get_argument(0, AWK_STRING, & cmd) && - get_argument(1, AWK_STRING, & cmdtype)) { - const awk_input_buf_t *ibuf; - const awk_output_buf_t *obuf; - if (get_file(cmd.str_value.str, cmd.str_value.len, cmdtype.str_value.str, cmdtype.str_value.len, -1, &ibuf, &obuf) && obuf) - return make_number(fileno(obuf->fp), result); - warning(ext_id, _("output_fd: get_file(`%s', `%s') failed to return an output descriptor"), cmd.str_value.str, cmdtype.str_value.str); - } else if (do_lint) { - if (nargs < 2) - lintwarn(ext_id, _("output_fd: called with too few arguments")); - else - lintwarn(ext_id, _("output_fd: called with inappropriate argument(s)")); - } - return make_number(-1, result); -} - -static awk_ext_func_t func_table[] = { - { "select", do_select, 5 }, - { "select_signal", do_signal, 3 }, - { "set_non_blocking", do_set_non_blocking, 2 }, - { "kill", do_kill, 2 }, - { "input_fd", do_input_fd, 2 }, - { "output_fd", do_output_fd, 2 }, -}; - -/* define the dl_load function using the boilerplate macro */ - -dl_load_func(func_table, select, "") diff --git a/extension/siglist.h b/extension/siglist.h deleted file mode 100644 index 7ecb8ab1..00000000 --- a/extension/siglist.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Canonical list of all signal names. - Copyright (C) 1996-2012 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* This file should be usable for any platform, since it just associates - the SIG* macros with text names and descriptions. The actual values - come from (via ). For any signal macros do not - exist on every platform, we can use #ifdef tests here and still use - this single common file for all platforms. */ - -/* This file is included multiple times. */ - -/* Standard signals */ - init_sig (SIGHUP, "HUP", N_("Hangup")) - init_sig (SIGINT, "INT", N_("Interrupt")) - init_sig (SIGQUIT, "QUIT", N_("Quit")) - init_sig (SIGILL, "ILL", N_("Illegal instruction")) - init_sig (SIGTRAP, "TRAP", N_("Trace/breakpoint trap")) - init_sig (SIGABRT, "ABRT", N_("Aborted")) - init_sig (SIGFPE, "FPE", N_("Floating point exception")) - init_sig (SIGKILL, "KILL", N_("Killed")) - init_sig (SIGBUS, "BUS", N_("Bus error")) - init_sig (SIGSEGV, "SEGV", N_("Segmentation fault")) - init_sig (SIGPIPE, "PIPE", N_("Broken pipe")) - init_sig (SIGALRM, "ALRM", N_("Alarm clock")) - init_sig (SIGTERM, "TERM", N_("Terminated")) - init_sig (SIGURG, "URG", N_("Urgent I/O condition")) - init_sig (SIGSTOP, "STOP", N_("Stopped (signal)")) - init_sig (SIGTSTP, "TSTP", N_("Stopped")) - init_sig (SIGCONT, "CONT", N_("Continued")) - init_sig (SIGCHLD, "CHLD", N_("Child exited")) - init_sig (SIGTTIN, "TTIN", N_("Stopped (tty input)")) - init_sig (SIGTTOU, "TTOU", N_("Stopped (tty output)")) - init_sig (SIGIO, "IO", N_("I/O possible")) - init_sig (SIGXCPU, "XCPU", N_("CPU time limit exceeded")) - init_sig (SIGXFSZ, "XFSZ", N_("File size limit exceeded")) - init_sig (SIGVTALRM, "VTALRM", N_("Virtual timer expired")) - init_sig (SIGPROF, "PROF", N_("Profiling timer expired")) - init_sig (SIGUSR1, "USR1", N_("User defined signal 1")) - init_sig (SIGUSR2, "USR2", N_("User defined signal 2")) - -/* Variations */ -#ifdef SIGEMT - init_sig (SIGEMT, "EMT", N_("EMT trap")) -#endif -#ifdef SIGSYS - init_sig (SIGSYS, "SYS", N_("Bad system call")) -#endif -#ifdef SIGSTKFLT - init_sig (SIGSTKFLT, "STKFLT", N_("Stack fault")) -#endif -#ifdef SIGINFO - init_sig (SIGINFO, "INFO", N_("Information request")) -#elif defined(SIGPWR) && (!defined(SIGLOST) || (SIGPWR != SIGLOST)) - init_sig (SIGPWR, "PWR", N_("Power failure")) -#endif -#ifdef SIGLOST - init_sig (SIGLOST, "LOST", N_("Resource lost")) -#endif -#ifdef SIGWINCH - init_sig (SIGWINCH, "WINCH", N_("Window changed")) -#endif -- cgit v1.2.3 From e36300be4deb7bbdeff17c8e896ac2f727e1477e Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 2 Jan 2015 16:44:33 -0500 Subject: Remove api_get_file typelen argument. --- ChangeLog | 7 +++++++ extension/ChangeLog | 5 +++++ extension/testext.c | 2 +- gawkapi.c | 28 ++++++++++++++-------------- gawkapi.h | 10 +++++----- 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5f29f44..baa7c003 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-01-02 Andrew J. Schorr + + * gawkapi.h (gawk_api): Modify api_get_file to remove the typelen + argument. + (get_file): Remove typelen argument from the macro. + * gawkapi.c (api_get_file): Remove typelen argument. + 2014-12-24 Arnold D. Robbins * profile.c (pprint): Be sure to set ip2 in all paths diff --git a/extension/ChangeLog b/extension/ChangeLog index e8fa12fd..55438800 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2015-01-02 Andrew J. Schorr + + * testext.c (test_get_file): The get_file hook no longer takes a + typelen argument. + 2015-01-02 Andrew J. Schorr Remove the select extension, since it will be part of gawkextlib. diff --git a/extension/testext.c b/extension/testext.c index f00ced7d..a10c9255 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -790,7 +790,7 @@ test_get_file(int nargs, awk_value_t *result) printf("%s: open(%s) failed\n", "test_get_file", filename.str_value.str); return make_number(-1.0, result); } - if (! get_file(alias.str_value.str, strlen(alias.str_value.str), "<", 1, fd, &ibuf, &obuf)) { + if (! get_file(alias.str_value.str, strlen(alias.str_value.str), "<", fd, &ibuf, &obuf)) { printf("%s: get_file(%s) failed\n", "test_get_file", alias.str_value.str); return make_number(-1.0, result); } diff --git a/gawkapi.c b/gawkapi.c index e2c0b1a0..a693621e 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -1043,7 +1043,7 @@ api_release_value(awk_ext_id_t id, awk_value_cookie_t value) /* api_get_file --- return a handle to an existing or newly opened file */ static awk_bool_t -api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, size_t typelen, int fd, const awk_input_buf_t **ibufp, const awk_output_buf_t **obufp) +api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, int fd, const awk_input_buf_t **ibufp, const awk_output_buf_t **obufp) { const struct redirect *f; int flag; /* not used, sigh */ @@ -1080,24 +1080,24 @@ api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *file return awk_true; } redirtype = redirect_none; - switch (typelen) { - case 1: - switch (*filetype) { - case '<': + switch (filetype[0]) { + case '<': + if (filetype[1] == '\0') redirtype = redirect_input; - break; - case '>': + break; + case '>': + switch (filetype[1]) { + case '\0': redirtype = redirect_output; break; - } - break; - case 2: - switch (*filetype) { case '>': - if (filetype[1] == '>') + if (filetype[2] == '\0') redirtype = redirect_append; break; - case '|': + } + break; + case '|': + if (filetype[2] == '\0') { switch (filetype[1]) { case '>': redirtype = redirect_pipe; @@ -1109,8 +1109,8 @@ api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *file redirtype = redirect_twoway; break; } - break; } + break; } if (redirtype == redirect_none) { warning(_("cannot open unrecognized file type `%s' for `%s'"), diff --git a/gawkapi.h b/gawkapi.h index 65f1dfc3..22b3be3d 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -678,8 +678,8 @@ typedef struct gawk_api { /* * Look up a file. If the name is NULL or name_len is 0, it returns * data for the currently open input file corresponding to FILENAME - * (and it will not access the filetype or typelen arguments, so those - * may be undefined). + * (and it will not access the filetype argument, so that may be + * undefined). * If the file is not already open, it tries to open it. * The "filetype" argument should be one of: * ">", ">>", "<", "|>", "|<", and "|&" @@ -700,7 +700,7 @@ typedef struct gawk_api { const char *name, size_t name_len, const char *filetype, - size_t typelen, int fd, + int fd, /* * Return values (on success, one or both should * be non-NULL): @@ -789,8 +789,8 @@ typedef struct gawk_api { #define release_value(value) \ (api->api_release_value(ext_id, value)) -#define get_file(name, namelen, filetype, typelen, fd, ibuf, obuf) \ - (api->api_get_file(ext_id, name, namelen, filetype, typelen, fd, ibuf, obuf)) +#define get_file(name, namelen, filetype, fd, ibuf, obuf) \ + (api->api_get_file(ext_id, name, namelen, filetype, fd, ibuf, obuf)) #define register_ext_version(version) \ (api->api_register_ext_version(ext_id, version)) -- cgit v1.2.3 From 903e540568e70f71e0a2911cb5998ac2d82ebbb4 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 4 Jan 2015 18:24:25 -0500 Subject: Document new user-visible features in gawk.1 and gawktexi.in. --- ChangeLog | 4 + doc/ChangeLog | 6 + doc/gawk.1 | 45 ++ doc/gawk.info | 1256 +++++++++++++++++++++++++++++-------------------------- doc/gawk.texi | 53 ++- doc/gawktexi.in | 53 ++- gawkapi.h | 2 +- 7 files changed, 813 insertions(+), 606 deletions(-) diff --git a/ChangeLog b/ChangeLog index baa7c003..c93bd631 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-01-04 Andrew J. Schorr + + * gawkapi.h: Fix typo in comment. + 2015-01-02 Andrew J. Schorr * gawkapi.h (gawk_api): Modify api_get_file to remove the typelen diff --git a/doc/ChangeLog b/doc/ChangeLog index 19278667..31bcecce 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-01-04 Andrew J. Schorr + + * gawk.1: Document new features PROCINFO["errno"] and + PROCINFO["input", "RETRY"], and new getline return value of -2. + * gawktexi.in: Ditto. + 2014-12-26 Antonio Giovanni Colombo * gawktexi.in (Glossary): Really sort the items. diff --git a/doc/gawk.1 b/doc/gawk.1 index 3d5d1812..b425c24c 100644 --- a/doc/gawk.1 +++ b/doc/gawk.1 @@ -942,6 +942,15 @@ then will contain a string describing the error. The value is subject to translation in non-English locales. +If the string in +.B ERRNO +corresponds to a system error in the +.IR errno (3) +variable, then the numeric value can be found in +.B PROCINFO["errno"]. +For non-system errors, +.B PROCINFO["errno"] +will be zero. .TP .B FIELDWIDTHS A whitespace separated list of field widths. When set, @@ -1103,6 +1112,13 @@ system call. The default time format string for .BR strftime() . .TP +\fBPROCINFO["errno"]\fP +The value of +.IR errno (3) +when +.BR ERRNO +is set to the associated error message. +.TP \fBPROCINFO["euid"]\fP The value of the .IR geteuid (2) @@ -1221,6 +1237,28 @@ where is a redirection string or a filename. A value of zero or less than zero means no timeout. .TP +\fBPROCINFO["input", "RETRY"]\fP +If an I/O error that may be retried occurs when reading data from +.IR input , +and this array entry exists, then +.BR getline +will return -2 instead of following the default behavior of returning -1 +and configuring +.IR input +to return no further data. +An I/O error that may be retried is one where +.IR errno (3) +has the value +.IR EAGAIN , +.IR EWOULDBLOCK , +.IR EINTR , +or +.IR ETIMEDOUT . +This may be useful in conjunction with +\fBPROCINFO["input", "READ_TIMEOUT"]\fP +or situations where a file descriptor has been configured to behave in a +non-blocking fashion. +.TP \fBPROCINFO["mpfr_version"]\fP The version of the GNU MPFR library used for arbitrary precision number support in @@ -2289,6 +2327,13 @@ below.) The .B getline command returns 1 on success, 0 on end of file, and \-1 on an error. +If the +.IR errno (3) +value indicates that the I/O operation may be retried, +and \fBPROCINFO["input", "RETRY"]\fP +is set, then \-2 will be returned instead of \-1, and further calls to +.B getline +may be attempted. Upon an error, .B ERRNO is set to a string describing the problem. diff --git a/doc/gawk.info b/doc/gawk.info index e501b297..02b59b92 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -217,6 +217,7 @@ entitled "GNU Free Documentation License". `getline'. * Getline Summary:: Summary of `getline' Variants. * Read Timeout:: Reading input with a timeout. +* Retrying I/O:: Retrying I/O after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -4168,6 +4169,7 @@ have to be named on the `awk' command line (*note Getline::). * Getline:: Reading files under explicit program control using the `getline' function. * Read Timeout:: Reading input with a timeout. +* Retrying I/O:: Retrying I/O after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -5439,7 +5441,11 @@ how `awk' works. encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then `getline' returns -1. In this case, `gawk' sets the variable `ERRNO' to a string -describing the error that occurred. +describing the error that occurred. If the `errno' variable indicates +that the I/O operation may be retried, and `PROCINFO["input", "RETRY"]' +is set, then -2 will be returned instead of -1, and further calls to +`getline' may be attemped. *Note Retrying I/O::, for further +information about this feature. In the following examples, COMMAND stands for a string value that represents a shell command. @@ -5876,7 +5882,7 @@ VAR Table 4.1: `getline' variants and what they set  -File: gawk.info, Node: Read Timeout, Next: Command-line directories, Prev: Getline, Up: Reading Files +File: gawk.info, Node: Read Timeout, Next: Retrying I/O, Prev: Getline, Up: Reading Files 4.10 Reading Input with a Timeout ================================= @@ -5955,7 +5961,8 @@ a per command or 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 attempt. This is a limitation, and it also means that you cannot use -this to multiplex input from two or more sources. +this to multiplex input from two or more sources. *Note Retrying +I/O::, for a way to enable later I/O attempts to succeed. Assigning a timeout value prevents read operations from blocking indefinitely. But bear in mind that there are other ways `gawk' can @@ -5970,9 +5977,36 @@ writing. (1) This assumes that standard input is the keyboard.  -File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Read Timeout, Up: Reading Files +File: gawk.info, Node: Retrying I/O, Next: Command-line directories, Prev: Read Timeout, Up: Reading Files -4.11 Directories on the Command Line +4.11 Retrying I/O on Certain Input Errors +========================================= + +This minor node describes a feature that is specific to `gawk'. + + When `gawk' encounters an error while reading input, it will by +default return -1 from getline, and subsequent attempts to read from +that file will result in an end-of-file indication. However, you may +optionally instruct `gawk' to allow I/O to be retried when certain +errors are encountered by setting setting a special element in the +`PROCINFO' array (*note Auto-set::): + + PROCINFO["input_name", "RETRY"] + + When set, this causes `gawk' to check the value of the system +`errno' variable when an I/O error occurs. If `errno' indicates a +subsequent I/O attempt may succeed, `getline' will instead return -2 and +further calls to `getline' may succeed. This applies to `errno' values +EAGAIN, EWOULDBLOCK, EINTR, or ETIMEDOUT. + + This feature is useful in conjunction with `PROCINFO["input_name", +"READ_TIMEOUT"]' or situations where a file descriptor has been +configured to behave in a non-blocking fashion. + + +File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Retrying I/O, Up: Reading Files + +4.12 Directories on the Command Line ==================================== According to the POSIX standard, files named on the `awk' command line @@ -5995,7 +6029,7 @@ usable data from an `awk' program.  File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-line directories, Up: Reading Files -4.12 Summary +4.13 Summary ============ * Input is split into records based on the value of `RS'. The @@ -6068,7 +6102,7 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li  File: gawk.info, Node: Input Exercises, Prev: Input Summary, Up: Reading Files -4.13 Exercises +4.14 Exercises ============== 1. Using the `FIELDWIDTHS' variable (*note Constant Size::), write a @@ -10363,6 +10397,11 @@ Options::), they are not special: `getline' returning -1. You are, of course, free to clear it yourself before doing an I/O operation. + If the value of `ERRNO' corresponds to a system error in the C + `errno' variable, then `PROCINFO["errno"]' will be set to the value + of `errno'. For non-system errors, `PROCINFO["errno"]' will be + zero. + `FILENAME' The name of the current input file. When no data files are listed on the command line, `awk' reads from the standard input and @@ -10411,6 +10450,10 @@ Options::), they are not special: `PROCINFO["egid"]' The value of the `getegid()' system call. + `PROCINFO["errno"]' + The value of the C `errno' variable when `ERRNO' is set to + the associated error message. + `PROCINFO["euid"]' The value of the `geteuid()' system call. @@ -10521,6 +10564,10 @@ Options::), they are not special: open input file, pipe, or coprocess. *Note Read Timeout::, for more information. + * It may be used to indicate that I/O may be retried when it + fails due to certain errors. *Note Retrying I/O::, for more + information. + * It may be used to cause coprocesses to communicate over pseudo-ttys instead of through two-way pipes; this is discussed further in *note Two-way I/O::. @@ -32246,9 +32293,9 @@ Index (line 143) * dark corner, exit statement: Exit Statement. (line 30) * dark corner, field separators: Full Line Fields. (line 22) -* dark corner, FILENAME variable <1>: Auto-set. (line 104) +* dark corner, FILENAME variable <1>: Auto-set. (line 109) * dark corner, FILENAME variable: Getline Notes. (line 19) -* dark corner, FNR/NR variables: Auto-set. (line 328) +* dark corner, FNR/NR variables: Auto-set. (line 341) * dark corner, format-control characters: Control Letters. (line 18) * dark corner, FS as null string: Single Character Fields. (line 20) @@ -32442,7 +32489,7 @@ Index * differences in awk and gawk, FIELDWIDTHS variable: User-modified. (line 37) * differences in awk and gawk, FPAT variable: User-modified. (line 43) -* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 130) +* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 135) * differences in awk and gawk, function arguments (gawk): Calling Built-in. (line 16) * differences in awk and gawk, getline command: Getline. (line 19) @@ -32465,7 +32512,7 @@ Index (line 263) * differences in awk and gawk, print/printf statements: Format Modifiers. (line 13) -* differences in awk and gawk, PROCINFO array: Auto-set. (line 144) +* differences in awk and gawk, PROCINFO array: Auto-set. (line 149) * differences in awk and gawk, read timeouts: Read Timeout. (line 6) * differences in awk and gawk, record separators: awk split records. (line 125) @@ -32473,9 +32520,10 @@ Index (line 43) * differences in awk and gawk, regular expressions: Case-sensitivity. (line 26) +* differences in awk and gawk, retrying I/O: Retrying I/O. (line 6) * differences in awk and gawk, RS/RT variables: gawk split records. (line 58) -* differences in awk and gawk, RT variable: Auto-set. (line 279) +* differences in awk and gawk, RT variable: Auto-set. (line 292) * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. @@ -32483,7 +32531,7 @@ Index * differences in awk and gawk, strings: Scalar Constants. (line 20) * differences in awk and gawk, strings, storing: gawk split records. (line 77) -* differences in awk and gawk, SYMTAB variable: Auto-set. (line 283) +* differences in awk and gawk, SYMTAB variable: Auto-set. (line 296) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. (line 151) * differences in awk and gawk, trunc-mod operation: Arithmetic Ops. @@ -32524,8 +32572,8 @@ Index * dynamically loaded extensions: Dynamic Extensions. (line 6) * e debugger command (alias for enable): Breakpoint Control. (line 73) * EBCDIC: Ordinal Functions. (line 45) -* effective group ID of gawk user: Auto-set. (line 149) -* effective user ID of gawk user: Auto-set. (line 153) +* effective group ID of gawk user: Auto-set. (line 154) +* effective user ID of gawk user: Auto-set. (line 162) * egrep utility <1>: Egrep Program. (line 6) * egrep utility: Bracket Expressions. (line 26) * egrep.awk program: Egrep Program. (line 54) @@ -32640,7 +32688,7 @@ Index (line 6) * extension API version: Extension Versioning. (line 6) -* extension API, version number: Auto-set. (line 246) +* extension API, version number: Auto-set. (line 255) * extension example: Extension Example. (line 6) * extension registration: Registration Functions. (line 6) @@ -32721,7 +32769,7 @@ Index * file names, distinguishing: Auto-set. (line 56) * file names, in compatibility mode: Special Caveats. (line 9) * file names, standard streams in gawk: Special FD. (line 48) -* FILENAME variable <1>: Auto-set. (line 104) +* FILENAME variable <1>: Auto-set. (line 109) * FILENAME variable: Reading Files. (line 6) * FILENAME variable, getline, setting with: Getline Notes. (line 19) * filenames, assignments as: Ignoring Assigns. (line 6) @@ -32789,9 +32837,9 @@ Index * flush buffered output: I/O Functions. (line 28) * fnmatch() extension function: Extension Sample Fnmatch. (line 12) -* FNR variable <1>: Auto-set. (line 114) +* FNR variable <1>: Auto-set. (line 119) * FNR variable: Records. (line 6) -* FNR variable, changing: Auto-set. (line 328) +* FNR variable, changing: Auto-set. (line 341) * for statement: For Statement. (line 6) * for statement, looping over arrays: Scanning an Array. (line 20) * fork() extension function: Extension Sample Fork. @@ -32841,7 +32889,7 @@ Index * FSF (Free Software Foundation): Manual History. (line 6) * fts() extension function: Extension Sample File Functions. (line 61) -* FUNCTAB array: Auto-set. (line 130) +* FUNCTAB array: Auto-set. (line 135) * function calls: Function Calls. (line 6) * function calls, indirect: Indirect Calls. (line 6) * function calls, indirect, @-notation for: Indirect Calls. (line 47) @@ -32891,7 +32939,7 @@ Index * G-d: Acknowledgments. (line 94) * Garfinkle, Scott: Contributors. (line 34) * gawk program, dynamic profiling: Profiling. (line 178) -* gawk version: Auto-set. (line 221) +* gawk version: Auto-set. (line 230) * gawk, ARGIND variable in: Other Arguments. (line 15) * gawk, awk and <1>: This Manual. (line 14) * gawk, awk and: Preface. (line 21) @@ -32926,7 +32974,7 @@ Index * gawk, FPAT variable in <1>: User-modified. (line 43) * gawk, FPAT variable in: Splitting By Content. (line 25) -* gawk, FUNCTAB array in: Auto-set. (line 130) +* gawk, FUNCTAB array in: Auto-set. (line 135) * gawk, function arguments and: Calling Built-in. (line 16) * gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42) * gawk, IGNORECASE variable in <1>: Array Sorting Functions. @@ -32958,7 +33006,7 @@ Index * gawk, predefined variables and: Built-in Variables. (line 14) * gawk, PROCINFO array in <1>: Two-way I/O. (line 99) * gawk, PROCINFO array in <2>: Time Functions. (line 47) -* gawk, PROCINFO array in: Auto-set. (line 144) +* gawk, PROCINFO array in: Auto-set. (line 149) * gawk, regexp constants and: Using Constant Regexps. (line 28) * gawk, regular expressions, case sensitivity: Case-sensitivity. @@ -32966,14 +33014,14 @@ Index * gawk, regular expressions, operators: GNU Regexp Operators. (line 6) * gawk, regular expressions, precedence: Regexp Operators. (line 161) -* gawk, RT variable in <1>: Auto-set. (line 279) +* gawk, RT variable in <1>: Auto-set. (line 292) * gawk, RT variable in <2>: Multiple Line. (line 129) * gawk, RT variable in: awk split records. (line 125) * gawk, See Also awk: Preface. (line 34) * gawk, source code, obtaining: Getting. (line 6) * gawk, splitting fields and: Constant Size. (line 87) * gawk, string-translation functions: I18N Functions. (line 6) -* gawk, SYMTAB array in: Auto-set. (line 283) +* gawk, SYMTAB array in: Auto-set. (line 296) * gawk, TEXTDOMAIN variable in: User-modified. (line 151) * gawk, timestamps: Time Functions. (line 6) * gawk, uses for: Preface. (line 34) @@ -33065,7 +33113,7 @@ Index * Grigera, Juan: Contributors. (line 57) * group database, reading: Group Functions. (line 6) * group file: Group Functions. (line 6) -* group ID of gawk user: Auto-set. (line 194) +* group ID of gawk user: Auto-set. (line 203) * groups, information about: Group Functions. (line 6) * gsub <1>: String Functions. (line 140) * gsub: Using Constant Regexps. @@ -33360,7 +33408,7 @@ Index * 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 235) +* maximum precision supported by MPFR library: Auto-set. (line 244) * McIlroy, Doug: Glossary. (line 177) * McPhee, Patrick: Contributors. (line 100) * message object files: Explaining gettext. (line 42) @@ -33373,7 +33421,7 @@ Index * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) * metacharacters, escape sequences for: Escape Sequences. (line 139) -* minimum precision supported by MPFR library: Auto-set. (line 238) +* minimum precision supported by MPFR library: Auto-set. (line 247) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 104) @@ -33422,7 +33470,7 @@ Index (line 47) * nexti debugger command: Debugger Execution Control. (line 49) -* NF variable <1>: Auto-set. (line 119) +* NF variable <1>: Auto-set. (line 124) * NF variable: Fields. (line 33) * NF variable, decrementing: Changing Fields. (line 107) * ni debugger command (alias for nexti): Debugger Execution Control. @@ -33431,9 +33479,9 @@ Index * non-existent array elements: Reference to Elements. (line 23) * not Boolean-logic operator: Boolean Ops. (line 6) -* NR variable <1>: Auto-set. (line 139) +* NR variable <1>: Auto-set. (line 144) * NR variable: Records. (line 6) -* NR variable, changing: Auto-set. (line 328) +* NR variable, changing: Auto-set. (line 341) * null strings <1>: Basic Data Typing. (line 26) * null strings <2>: Truth Values. (line 6) * null strings <3>: Regexp Field Splitting. @@ -33547,7 +33595,7 @@ Index * p debugger command (alias for print): Viewing And Changing Data. (line 36) * Papadopoulos, Panos: Contributors. (line 128) -* parent process ID of gawk process: Auto-set. (line 203) +* parent process ID of gawk process: Auto-set. (line 212) * parentheses (), in a profile: Profiling. (line 146) * parentheses (), regexp operator: Regexp Operators. (line 81) * password file: Passwd Functions. (line 16) @@ -33713,24 +33761,24 @@ Index * printing, unduplicated lines of text: Uniq Program. (line 6) * printing, user information: Id Program. (line 6) * private variables: Library Names. (line 11) -* process group idIDof gawk process: Auto-set. (line 197) -* process ID of gawk process: Auto-set. (line 200) +* process group idIDof gawk process: Auto-set. (line 206) +* process ID of gawk process: Auto-set. (line 209) * processes, two-way communications with: Two-way I/O. (line 6) * processing data: Basic High Level. (line 6) * PROCINFO array <1>: Passwd Functions. (line 6) * PROCINFO array <2>: Time Functions. (line 47) -* PROCINFO array: Auto-set. (line 144) +* PROCINFO array: Auto-set. (line 149) * PROCINFO array, and communications via ptys: Two-way I/O. (line 99) * PROCINFO array, and group membership: Group Functions. (line 6) * PROCINFO array, and user and group ID numbers: Id Program. (line 15) * PROCINFO array, testing the field splitting: Passwd Functions. (line 154) -* PROCINFO array, uses: Auto-set. (line 256) +* PROCINFO array, uses: Auto-set. (line 265) * PROCINFO, values of sorted_in: Controlling Scanning. (line 26) * profiling awk programs: Profiling. (line 6) * profiling awk programs, dynamically: Profiling. (line 178) -* program identifiers: Auto-set. (line 162) +* program identifiers: Auto-set. (line 171) * program, definition of: Getting Started. (line 21) * programming conventions, --non-decimal-data option: Nondecimal Data. (line 35) @@ -33865,6 +33913,7 @@ Index * relational operators, See comparison operators: Typing and Comparison. (line 9) * replace in string: String Functions. (line 408) +* retrying I/O: Retrying I/O. (line 6) * return debugger command: Debugger Execution Control. (line 54) * return statement, user-defined functions: Return Statement. (line 6) @@ -33888,7 +33937,7 @@ Index * right shift: Bitwise Functions. (line 53) * right shift, bitwise: Bitwise Functions. (line 32) * Ritchie, Dennis: Basic Data Typing. (line 54) -* RLENGTH variable: Auto-set. (line 266) +* RLENGTH variable: Auto-set. (line 279) * RLENGTH variable, match() function and: String Functions. (line 228) * Robbins, Arnold <1>: Future Extensions. (line 6) * Robbins, Arnold <2>: Bugs. (line 70) @@ -33914,9 +33963,9 @@ Index * RS variable: awk split records. (line 12) * RS variable, multiline records and: Multiple Line. (line 17) * rshift: Bitwise Functions. (line 53) -* RSTART variable: Auto-set. (line 272) +* RSTART variable: Auto-set. (line 285) * RSTART variable, match() function and: String Functions. (line 228) -* RT variable <1>: Auto-set. (line 279) +* RT variable <1>: Auto-set. (line 292) * RT variable <2>: Multiple Line. (line 129) * RT variable: awk split records. (line 125) * Rubin, Paul <1>: Contributors. (line 15) @@ -33936,7 +33985,7 @@ Index * scanning arrays: Scanning an Array. (line 6) * scanning multidimensional arrays: Multiscanning. (line 11) * Schorr, Andrew <1>: Contributors. (line 133) -* Schorr, Andrew <2>: Auto-set. (line 311) +* Schorr, Andrew <2>: Auto-set. (line 324) * Schorr, Andrew: Acknowledgments. (line 60) * Schreiber, Bert: Acknowledgments. (line 38) * Schreiber, Rita: Acknowledgments. (line 38) @@ -34019,7 +34068,7 @@ Index (line 106) * sidebar, Changing FS Does Not Affect the Fields: Full Line Fields. (line 14) -* sidebar, Changing NR and FNR: Auto-set. (line 326) +* sidebar, Changing NR and FNR: Auto-set. (line 339) * sidebar, Controlling Output Buffering with system(): I/O Functions. (line 138) * sidebar, Escape Sequences for Metacharacters: Escape Sequences. @@ -34181,9 +34230,9 @@ Index * substr: String Functions. (line 481) * substring: String Functions. (line 481) * Sumner, Andrew: Other Versions. (line 68) -* supplementary groups of gawk process: Auto-set. (line 251) +* supplementary groups of gawk process: Auto-set. (line 260) * switch statement: Switch Statement. (line 6) -* SYMTAB array: Auto-set. (line 283) +* SYMTAB array: Auto-set. (line 296) * syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops. (line 148) * system: I/O Functions. (line 106) @@ -34360,10 +34409,10 @@ Index * variables, uninitialized, as array subscripts: Uninitialized Subscripts. (line 6) * variables, user-defined: Variables. (line 6) -* version of gawk: Auto-set. (line 221) -* version of gawk extension API: Auto-set. (line 246) -* version of GNU MP library: Auto-set. (line 232) -* version of GNU MPFR library: Auto-set. (line 228) +* version of gawk: Auto-set. (line 230) +* version of gawk extension API: Auto-set. (line 255) +* version of GNU MP library: Auto-set. (line 241) +* version of GNU MPFR library: Auto-set. (line 237) * vertical bar (|): Regexp Operators. (line 70) * vertical bar (|), | operator (I/O) <1>: Precedence. (line 65) * vertical bar (|), | operator (I/O): Getline/Pipe. (line 9) @@ -34453,560 +34502,561 @@ Index  Tag Table: Node: Top1204 -Node: Foreword342225 -Node: Foreword446667 -Node: Preface48189 -Ref: Preface-Footnote-151060 -Ref: Preface-Footnote-251167 -Ref: Preface-Footnote-351400 -Node: History51542 -Node: Names53888 -Ref: Names-Footnote-154982 -Node: This Manual55128 -Ref: This Manual-Footnote-161615 -Node: Conventions61715 -Node: Manual History64053 -Ref: Manual History-Footnote-167035 -Ref: Manual History-Footnote-267076 -Node: How To Contribute67150 -Node: Acknowledgments68279 -Node: Getting Started73084 -Node: Running gawk75517 -Node: One-shot76707 -Node: Read Terminal77955 -Node: Long79982 -Node: Executable Scripts81498 -Ref: Executable Scripts-Footnote-184287 -Node: Comments84390 -Node: Quoting86872 -Node: DOS Quoting92396 -Node: Sample Data Files93071 -Node: Very Simple95666 -Node: Two Rules100564 -Node: More Complex102450 -Node: Statements/Lines105312 -Ref: Statements/Lines-Footnote-1109767 -Node: Other Features110032 -Node: When110963 -Ref: When-Footnote-1112717 -Node: Intro Summary112782 -Node: Invoking Gawk113665 -Node: Command Line115179 -Node: Options115977 -Ref: Options-Footnote-1131781 -Ref: Options-Footnote-2132010 -Node: Other Arguments132035 -Node: Naming Standard Input134983 -Node: Environment Variables136076 -Node: AWKPATH Variable136634 -Ref: AWKPATH Variable-Footnote-1140047 -Ref: AWKPATH Variable-Footnote-2140092 -Node: AWKLIBPATH Variable140352 -Node: Other Environment Variables141608 -Node: Exit Status145096 -Node: Include Files145772 -Node: Loading Shared Libraries149369 -Node: Obsolete150796 -Node: Undocumented151493 -Node: Invoking Summary151760 -Node: Regexp153424 -Node: Regexp Usage154878 -Node: Escape Sequences156915 -Node: Regexp Operators163156 -Ref: Regexp Operators-Footnote-1170582 -Ref: Regexp Operators-Footnote-2170729 -Node: Bracket Expressions170827 -Ref: table-char-classes172842 -Node: Leftmost Longest175766 -Node: Computed Regexps177068 -Node: GNU Regexp Operators180465 -Node: Case-sensitivity184138 -Ref: Case-sensitivity-Footnote-1187023 -Ref: Case-sensitivity-Footnote-2187258 -Node: Regexp Summary187366 -Node: Reading Files188833 -Node: Records190927 -Node: awk split records191660 -Node: gawk split records196575 -Ref: gawk split records-Footnote-1201119 -Node: Fields201156 -Ref: Fields-Footnote-1203932 -Node: Nonconstant Fields204018 -Ref: Nonconstant Fields-Footnote-1206261 -Node: Changing Fields206465 -Node: Field Separators212394 -Node: Default Field Splitting215099 -Node: Regexp Field Splitting216216 -Node: Single Character Fields219566 -Node: Command Line Field Separator220625 -Node: Full Line Fields223837 -Ref: Full Line Fields-Footnote-1225354 -Ref: Full Line Fields-Footnote-2225400 -Node: Field Splitting Summary225501 -Node: Constant Size227575 -Node: Splitting By Content232164 -Ref: Splitting By Content-Footnote-1236158 -Node: Multiple Line236321 -Ref: Multiple Line-Footnote-1242207 -Node: Getline242386 -Node: Plain Getline244598 -Node: Getline/Variable247238 -Node: Getline/File248386 -Node: Getline/Variable/File249770 -Ref: Getline/Variable/File-Footnote-1251373 -Node: Getline/Pipe251460 -Node: Getline/Variable/Pipe254143 -Node: Getline/Coprocess255274 -Node: Getline/Variable/Coprocess256526 -Node: Getline Notes257265 -Node: Getline Summary260057 -Ref: table-getline-variants260469 -Node: Read Timeout261298 -Ref: Read Timeout-Footnote-1265123 -Node: Command-line directories265181 -Node: Input Summary266086 -Node: Input Exercises269387 -Node: Printing270115 -Node: Print271892 -Node: Print Examples273349 -Node: Output Separators276128 -Node: OFMT278146 -Node: Printf279500 -Node: Basic Printf280285 -Node: Control Letters281855 -Node: Format Modifiers285838 -Node: Printf Examples291847 -Node: Redirection294333 -Node: Special FD301174 -Ref: Special FD-Footnote-1304334 -Node: Special Files304408 -Node: Other Inherited Files305025 -Node: Special Network306025 -Node: Special Caveats306887 -Node: Close Files And Pipes307838 -Ref: Close Files And Pipes-Footnote-1315020 -Ref: Close Files And Pipes-Footnote-2315168 -Node: Output Summary315318 -Node: Output Exercises316316 -Node: Expressions316996 -Node: Values318181 -Node: Constants318859 -Node: Scalar Constants319550 -Ref: Scalar Constants-Footnote-1320409 -Node: Nondecimal-numbers320659 -Node: Regexp Constants323677 -Node: Using Constant Regexps324202 -Node: Variables327345 -Node: Using Variables328000 -Node: Assignment Options329911 -Node: Conversion331786 -Node: Strings And Numbers332310 -Ref: Strings And Numbers-Footnote-1335375 -Node: Locale influences conversions335484 -Ref: table-locale-affects338231 -Node: All Operators338819 -Node: Arithmetic Ops339449 -Node: Concatenation341954 -Ref: Concatenation-Footnote-1344773 -Node: Assignment Ops344879 -Ref: table-assign-ops349858 -Node: Increment Ops351130 -Node: Truth Values and Conditions354568 -Node: Truth Values355653 -Node: Typing and Comparison356702 -Node: Variable Typing357512 -Node: Comparison Operators361165 -Ref: table-relational-ops361575 -Node: POSIX String Comparison365070 -Ref: POSIX String Comparison-Footnote-1366142 -Node: Boolean Ops366280 -Ref: Boolean Ops-Footnote-1370759 -Node: Conditional Exp370850 -Node: Function Calls372577 -Node: Precedence376457 -Node: Locales380118 -Node: Expressions Summary381750 -Node: Patterns and Actions384310 -Node: Pattern Overview385430 -Node: Regexp Patterns387109 -Node: Expression Patterns387652 -Node: Ranges391362 -Node: BEGIN/END394468 -Node: Using BEGIN/END395229 -Ref: Using BEGIN/END-Footnote-1397963 -Node: I/O And BEGIN/END398069 -Node: BEGINFILE/ENDFILE400383 -Node: Empty403284 -Node: Using Shell Variables403601 -Node: Action Overview405874 -Node: Statements408200 -Node: If Statement410048 -Node: While Statement411543 -Node: Do Statement413572 -Node: For Statement414716 -Node: Switch Statement417873 -Node: Break Statement420255 -Node: Continue Statement422296 -Node: Next Statement424123 -Node: Nextfile Statement426504 -Node: Exit Statement429134 -Node: Built-in Variables431537 -Node: User-modified432670 -Ref: User-modified-Footnote-1440351 -Node: Auto-set440413 -Ref: Auto-set-Footnote-1454105 -Ref: Auto-set-Footnote-2454310 -Node: ARGC and ARGV454366 -Node: Pattern Action Summary458584 -Node: Arrays461011 -Node: Array Basics462340 -Node: Array Intro463184 -Ref: figure-array-elements465148 -Ref: Array Intro-Footnote-1467674 -Node: Reference to Elements467802 -Node: Assigning Elements470254 -Node: Array Example470745 -Node: Scanning an Array472503 -Node: Controlling Scanning475519 -Ref: Controlling Scanning-Footnote-1480715 -Node: Numeric Array Subscripts481031 -Node: Uninitialized Subscripts483216 -Node: Delete484833 -Ref: Delete-Footnote-1487576 -Node: Multidimensional487633 -Node: Multiscanning490730 -Node: Arrays of Arrays492319 -Node: Arrays Summary497078 -Node: Functions499170 -Node: Built-in500069 -Node: Calling Built-in501147 -Node: Numeric Functions503138 -Ref: Numeric Functions-Footnote-1507957 -Ref: Numeric Functions-Footnote-2508314 -Ref: Numeric Functions-Footnote-3508362 -Node: String Functions508634 -Ref: String Functions-Footnote-1532109 -Ref: String Functions-Footnote-2532238 -Ref: String Functions-Footnote-3532486 -Node: Gory Details532573 -Ref: table-sub-escapes534354 -Ref: table-sub-proposed535874 -Ref: table-posix-sub537238 -Ref: table-gensub-escapes538774 -Ref: Gory Details-Footnote-1539606 -Node: I/O Functions539757 -Ref: I/O Functions-Footnote-1546975 -Node: Time Functions547122 -Ref: Time Functions-Footnote-1557610 -Ref: Time Functions-Footnote-2557678 -Ref: Time Functions-Footnote-3557836 -Ref: Time Functions-Footnote-4557947 -Ref: Time Functions-Footnote-5558059 -Ref: Time Functions-Footnote-6558286 -Node: Bitwise Functions558552 -Ref: table-bitwise-ops559114 -Ref: Bitwise Functions-Footnote-1563423 -Node: Type Functions563592 -Node: I18N Functions564743 -Node: User-defined566388 -Node: Definition Syntax567193 -Ref: Definition Syntax-Footnote-1572600 -Node: Function Example572671 -Ref: Function Example-Footnote-1575590 -Node: Function Caveats575612 -Node: Calling A Function576130 -Node: Variable Scope577088 -Node: Pass By Value/Reference580076 -Node: Return Statement583571 -Node: Dynamic Typing586552 -Node: Indirect Calls587481 -Ref: Indirect Calls-Footnote-1598783 -Node: Functions Summary598911 -Node: Library Functions601613 -Ref: Library Functions-Footnote-1605222 -Ref: Library Functions-Footnote-2605365 -Node: Library Names605536 -Ref: Library Names-Footnote-1608990 -Ref: Library Names-Footnote-2609213 -Node: General Functions609299 -Node: Strtonum Function610402 -Node: Assert Function613424 -Node: Round Function616748 -Node: Cliff Random Function618289 -Node: Ordinal Functions619305 -Ref: Ordinal Functions-Footnote-1622368 -Ref: Ordinal Functions-Footnote-2622620 -Node: Join Function622831 -Ref: Join Function-Footnote-1624600 -Node: Getlocaltime Function624800 -Node: Readfile Function628544 -Node: Shell Quoting630514 -Node: Data File Management631915 -Node: Filetrans Function632547 -Node: Rewind Function636603 -Node: File Checking637990 -Ref: File Checking-Footnote-1639322 -Node: Empty Files639523 -Node: Ignoring Assigns641502 -Node: Getopt Function643053 -Ref: Getopt Function-Footnote-1654515 -Node: Passwd Functions654715 -Ref: Passwd Functions-Footnote-1663552 -Node: Group Functions663640 -Ref: Group Functions-Footnote-1671534 -Node: Walking Arrays671747 -Node: Library Functions Summary673350 -Node: Library Exercises674751 -Node: Sample Programs676031 -Node: Running Examples676801 -Node: Clones677529 -Node: Cut Program678753 -Node: Egrep Program688472 -Ref: Egrep Program-Footnote-1695970 -Node: Id Program696080 -Node: Split Program699725 -Ref: Split Program-Footnote-1703173 -Node: Tee Program703301 -Node: Uniq Program706090 -Node: Wc Program713509 -Ref: Wc Program-Footnote-1717759 -Node: Miscellaneous Programs717853 -Node: Dupword Program719066 -Node: Alarm Program721097 -Node: Translate Program725901 -Ref: Translate Program-Footnote-1730466 -Node: Labels Program730736 -Ref: Labels Program-Footnote-1734087 -Node: Word Sorting734171 -Node: History Sorting738242 -Node: Extract Program740078 -Node: Simple Sed747603 -Node: Igawk Program750671 -Ref: Igawk Program-Footnote-1764995 -Ref: Igawk Program-Footnote-2765196 -Ref: Igawk Program-Footnote-3765318 -Node: Anagram Program765433 -Node: Signature Program768490 -Node: Programs Summary769737 -Node: Programs Exercises770930 -Ref: Programs Exercises-Footnote-1775061 -Node: Advanced Features775152 -Node: Nondecimal Data777100 -Node: Array Sorting778690 -Node: Controlling Array Traversal779387 -Ref: Controlling Array Traversal-Footnote-1787720 -Node: Array Sorting Functions787838 -Ref: Array Sorting Functions-Footnote-1791727 -Node: Two-way I/O791923 -Ref: Two-way I/O-Footnote-1796868 -Ref: Two-way I/O-Footnote-2797054 -Node: TCP/IP Networking797136 -Node: Profiling800009 -Node: Advanced Features Summary808286 -Node: Internationalization810219 -Node: I18N and L10N811699 -Node: Explaining gettext812385 -Ref: Explaining gettext-Footnote-1817410 -Ref: Explaining gettext-Footnote-2817594 -Node: Programmer i18n817759 -Ref: Programmer i18n-Footnote-1822625 -Node: Translator i18n822674 -Node: String Extraction823468 -Ref: String Extraction-Footnote-1824599 -Node: Printf Ordering824685 -Ref: Printf Ordering-Footnote-1827471 -Node: I18N Portability827535 -Ref: I18N Portability-Footnote-1829990 -Node: I18N Example830053 -Ref: I18N Example-Footnote-1832856 -Node: Gawk I18N832928 -Node: I18N Summary833566 -Node: Debugger834905 -Node: Debugging835927 -Node: Debugging Concepts836368 -Node: Debugging Terms838221 -Node: Awk Debugging840793 -Node: Sample Debugging Session841687 -Node: Debugger Invocation842207 -Node: Finding The Bug843591 -Node: List of Debugger Commands850066 -Node: Breakpoint Control851399 -Node: Debugger Execution Control855095 -Node: Viewing And Changing Data858459 -Node: Execution Stack861837 -Node: Debugger Info863474 -Node: Miscellaneous Debugger Commands867491 -Node: Readline Support872520 -Node: Limitations873412 -Node: Debugging Summary875526 -Node: Arbitrary Precision Arithmetic876694 -Node: Computer Arithmetic878110 -Ref: table-numeric-ranges881708 -Ref: Computer Arithmetic-Footnote-1882567 -Node: Math Definitions882624 -Ref: table-ieee-formats885912 -Ref: Math Definitions-Footnote-1886516 -Node: MPFR features886621 -Node: FP Math Caution888292 -Ref: FP Math Caution-Footnote-1889342 -Node: Inexactness of computations889711 -Node: Inexact representation890670 -Node: Comparing FP Values892027 -Node: Errors accumulate893109 -Node: Getting Accuracy894542 -Node: Try To Round897204 -Node: Setting precision898103 -Ref: table-predefined-precision-strings898787 -Node: Setting the rounding mode900576 -Ref: table-gawk-rounding-modes900940 -Ref: Setting the rounding mode-Footnote-1904395 -Node: Arbitrary Precision Integers904574 -Ref: Arbitrary Precision Integers-Footnote-1909473 -Node: POSIX Floating Point Problems909622 -Ref: POSIX Floating Point Problems-Footnote-1913495 -Node: Floating point summary913533 -Node: Dynamic Extensions915727 -Node: Extension Intro917279 -Node: Plugin License918545 -Node: Extension Mechanism Outline919342 -Ref: figure-load-extension919770 -Ref: figure-register-new-function921250 -Ref: figure-call-new-function922254 -Node: Extension API Description924240 -Node: Extension API Functions Introduction925690 -Node: General Data Types930514 -Ref: General Data Types-Footnote-1936253 -Node: Memory Allocation Functions936552 -Ref: Memory Allocation Functions-Footnote-1939391 -Node: Constructor Functions939487 -Node: Registration Functions941221 -Node: Extension Functions941906 -Node: Exit Callback Functions944203 -Node: Extension Version String945451 -Node: Input Parsers946116 -Node: Output Wrappers955995 -Node: Two-way processors960510 -Node: Printing Messages962714 -Ref: Printing Messages-Footnote-1963790 -Node: Updating `ERRNO'963942 -Node: Requesting Values964682 -Ref: table-value-types-returned965410 -Node: Accessing Parameters966367 -Node: Symbol Table Access967598 -Node: Symbol table by name968112 -Node: Symbol table by cookie970093 -Ref: Symbol table by cookie-Footnote-1974237 -Node: Cached values974300 -Ref: Cached values-Footnote-1977799 -Node: Array Manipulation977890 -Ref: Array Manipulation-Footnote-1978988 -Node: Array Data Types979025 -Ref: Array Data Types-Footnote-1981680 -Node: Array Functions981772 -Node: Flattening Arrays985626 -Node: Creating Arrays992518 -Node: Extension API Variables997289 -Node: Extension Versioning997925 -Node: Extension API Informational Variables999826 -Node: Extension API Boilerplate1000891 -Node: Finding Extensions1004700 -Node: Extension Example1005260 -Node: Internal File Description1006032 -Node: Internal File Ops1010099 -Ref: Internal File Ops-Footnote-11021769 -Node: Using Internal File Ops1021909 -Ref: Using Internal File Ops-Footnote-11024292 -Node: Extension Samples1024565 -Node: Extension Sample File Functions1026091 -Node: Extension Sample Fnmatch1033729 -Node: Extension Sample Fork1035220 -Node: Extension Sample Inplace1036435 -Node: Extension Sample Ord1038110 -Node: Extension Sample Readdir1038946 -Ref: table-readdir-file-types1039822 -Node: Extension Sample Revout1040633 -Node: Extension Sample Rev2way1041223 -Node: Extension Sample Read write array1041963 -Node: Extension Sample Readfile1043903 -Node: Extension Sample Time1044998 -Node: Extension Sample API Tests1046347 -Node: gawkextlib1046838 -Node: Extension summary1049496 -Node: Extension Exercises1053185 -Node: Language History1053907 -Node: V7/SVR3.11055563 -Node: SVR41057744 -Node: POSIX1059189 -Node: BTL1060578 -Node: POSIX/GNU1061312 -Node: Feature History1066936 -Node: Common Extensions1080034 -Node: Ranges and Locales1081358 -Ref: Ranges and Locales-Footnote-11085976 -Ref: Ranges and Locales-Footnote-21086003 -Ref: Ranges and Locales-Footnote-31086237 -Node: Contributors1086458 -Node: History summary1091999 -Node: Installation1093369 -Node: Gawk Distribution1094315 -Node: Getting1094799 -Node: Extracting1095622 -Node: Distribution contents1097257 -Node: Unix Installation1103322 -Node: Quick Installation1104005 -Node: Shell Startup Files1106416 -Node: Additional Configuration Options1107495 -Node: Configuration Philosophy1109234 -Node: Non-Unix Installation1111603 -Node: PC Installation1112061 -Node: PC Binary Installation1113380 -Node: PC Compiling1115228 -Ref: PC Compiling-Footnote-11118249 -Node: PC Testing1118358 -Node: PC Using1119534 -Node: Cygwin1123649 -Node: MSYS1124472 -Node: VMS Installation1124972 -Node: VMS Compilation1125764 -Ref: VMS Compilation-Footnote-11126986 -Node: VMS Dynamic Extensions1127044 -Node: VMS Installation Details1128728 -Node: VMS Running1130980 -Node: VMS GNV1133816 -Node: VMS Old Gawk1134550 -Node: Bugs1135020 -Node: Other Versions1138903 -Node: Installation summary1145331 -Node: Notes1146387 -Node: Compatibility Mode1147252 -Node: Additions1148034 -Node: Accessing The Source1148959 -Node: Adding Code1150395 -Node: New Ports1156560 -Node: Derived Files1161042 -Ref: Derived Files-Footnote-11166517 -Ref: Derived Files-Footnote-21166551 -Ref: Derived Files-Footnote-31167147 -Node: Future Extensions1167261 -Node: Implementation Limitations1167867 -Node: Extension Design1169115 -Node: Old Extension Problems1170269 -Ref: Old Extension Problems-Footnote-11171786 -Node: Extension New Mechanism Goals1171843 -Ref: Extension New Mechanism Goals-Footnote-11175203 -Node: Extension Other Design Decisions1175392 -Node: Extension Future Growth1177500 -Node: Old Extension Mechanism1178336 -Node: Notes summary1180098 -Node: Basic Concepts1181284 -Node: Basic High Level1181965 -Ref: figure-general-flow1182237 -Ref: figure-process-flow1182836 -Ref: Basic High Level-Footnote-11186065 -Node: Basic Data Typing1186250 -Node: Glossary1189578 -Node: Copying1214736 -Node: GNU Free Documentation License1252292 -Node: Index1277428 +Node: Foreword342300 +Node: Foreword446742 +Node: Preface48264 +Ref: Preface-Footnote-151135 +Ref: Preface-Footnote-251242 +Ref: Preface-Footnote-351475 +Node: History51617 +Node: Names53963 +Ref: Names-Footnote-155057 +Node: This Manual55203 +Ref: This Manual-Footnote-161690 +Node: Conventions61790 +Node: Manual History64128 +Ref: Manual History-Footnote-167110 +Ref: Manual History-Footnote-267151 +Node: How To Contribute67225 +Node: Acknowledgments68354 +Node: Getting Started73159 +Node: Running gawk75592 +Node: One-shot76782 +Node: Read Terminal78030 +Node: Long80057 +Node: Executable Scripts81573 +Ref: Executable Scripts-Footnote-184362 +Node: Comments84465 +Node: Quoting86947 +Node: DOS Quoting92471 +Node: Sample Data Files93146 +Node: Very Simple95741 +Node: Two Rules100639 +Node: More Complex102525 +Node: Statements/Lines105387 +Ref: Statements/Lines-Footnote-1109842 +Node: Other Features110107 +Node: When111038 +Ref: When-Footnote-1112792 +Node: Intro Summary112857 +Node: Invoking Gawk113740 +Node: Command Line115254 +Node: Options116052 +Ref: Options-Footnote-1131856 +Ref: Options-Footnote-2132085 +Node: Other Arguments132110 +Node: Naming Standard Input135058 +Node: Environment Variables136151 +Node: AWKPATH Variable136709 +Ref: AWKPATH Variable-Footnote-1140122 +Ref: AWKPATH Variable-Footnote-2140167 +Node: AWKLIBPATH Variable140427 +Node: Other Environment Variables141683 +Node: Exit Status145171 +Node: Include Files145847 +Node: Loading Shared Libraries149444 +Node: Obsolete150871 +Node: Undocumented151568 +Node: Invoking Summary151835 +Node: Regexp153499 +Node: Regexp Usage154953 +Node: Escape Sequences156990 +Node: Regexp Operators163231 +Ref: Regexp Operators-Footnote-1170657 +Ref: Regexp Operators-Footnote-2170804 +Node: Bracket Expressions170902 +Ref: table-char-classes172917 +Node: Leftmost Longest175841 +Node: Computed Regexps177143 +Node: GNU Regexp Operators180540 +Node: Case-sensitivity184213 +Ref: Case-sensitivity-Footnote-1187098 +Ref: Case-sensitivity-Footnote-2187333 +Node: Regexp Summary187441 +Node: Reading Files188908 +Node: Records191069 +Node: awk split records191802 +Node: gawk split records196717 +Ref: gawk split records-Footnote-1201261 +Node: Fields201298 +Ref: Fields-Footnote-1204074 +Node: Nonconstant Fields204160 +Ref: Nonconstant Fields-Footnote-1206403 +Node: Changing Fields206607 +Node: Field Separators212536 +Node: Default Field Splitting215241 +Node: Regexp Field Splitting216358 +Node: Single Character Fields219708 +Node: Command Line Field Separator220767 +Node: Full Line Fields223979 +Ref: Full Line Fields-Footnote-1225496 +Ref: Full Line Fields-Footnote-2225542 +Node: Field Splitting Summary225643 +Node: Constant Size227717 +Node: Splitting By Content232306 +Ref: Splitting By Content-Footnote-1236300 +Node: Multiple Line236463 +Ref: Multiple Line-Footnote-1242349 +Node: Getline242528 +Node: Plain Getline245010 +Node: Getline/Variable247650 +Node: Getline/File248798 +Node: Getline/Variable/File250182 +Ref: Getline/Variable/File-Footnote-1251785 +Node: Getline/Pipe251872 +Node: Getline/Variable/Pipe254555 +Node: Getline/Coprocess255686 +Node: Getline/Variable/Coprocess256938 +Node: Getline Notes257677 +Node: Getline Summary260469 +Ref: table-getline-variants260881 +Node: Read Timeout261710 +Ref: Read Timeout-Footnote-1265597 +Node: Retrying I/O265655 +Node: Command-line directories266838 +Node: Input Summary267743 +Node: Input Exercises271044 +Node: Printing271772 +Node: Print273549 +Node: Print Examples275006 +Node: Output Separators277785 +Node: OFMT279803 +Node: Printf281157 +Node: Basic Printf281942 +Node: Control Letters283512 +Node: Format Modifiers287495 +Node: Printf Examples293504 +Node: Redirection295990 +Node: Special FD302831 +Ref: Special FD-Footnote-1305991 +Node: Special Files306065 +Node: Other Inherited Files306682 +Node: Special Network307682 +Node: Special Caveats308544 +Node: Close Files And Pipes309495 +Ref: Close Files And Pipes-Footnote-1316677 +Ref: Close Files And Pipes-Footnote-2316825 +Node: Output Summary316975 +Node: Output Exercises317973 +Node: Expressions318653 +Node: Values319838 +Node: Constants320516 +Node: Scalar Constants321207 +Ref: Scalar Constants-Footnote-1322066 +Node: Nondecimal-numbers322316 +Node: Regexp Constants325334 +Node: Using Constant Regexps325859 +Node: Variables329002 +Node: Using Variables329657 +Node: Assignment Options331568 +Node: Conversion333443 +Node: Strings And Numbers333967 +Ref: Strings And Numbers-Footnote-1337032 +Node: Locale influences conversions337141 +Ref: table-locale-affects339888 +Node: All Operators340476 +Node: Arithmetic Ops341106 +Node: Concatenation343611 +Ref: Concatenation-Footnote-1346430 +Node: Assignment Ops346536 +Ref: table-assign-ops351515 +Node: Increment Ops352787 +Node: Truth Values and Conditions356225 +Node: Truth Values357310 +Node: Typing and Comparison358359 +Node: Variable Typing359169 +Node: Comparison Operators362822 +Ref: table-relational-ops363232 +Node: POSIX String Comparison366727 +Ref: POSIX String Comparison-Footnote-1367799 +Node: Boolean Ops367937 +Ref: Boolean Ops-Footnote-1372416 +Node: Conditional Exp372507 +Node: Function Calls374234 +Node: Precedence378114 +Node: Locales381775 +Node: Expressions Summary383407 +Node: Patterns and Actions385967 +Node: Pattern Overview387087 +Node: Regexp Patterns388766 +Node: Expression Patterns389309 +Node: Ranges393019 +Node: BEGIN/END396125 +Node: Using BEGIN/END396886 +Ref: Using BEGIN/END-Footnote-1399620 +Node: I/O And BEGIN/END399726 +Node: BEGINFILE/ENDFILE402040 +Node: Empty404941 +Node: Using Shell Variables405258 +Node: Action Overview407531 +Node: Statements409857 +Node: If Statement411705 +Node: While Statement413200 +Node: Do Statement415229 +Node: For Statement416373 +Node: Switch Statement419530 +Node: Break Statement421912 +Node: Continue Statement423953 +Node: Next Statement425780 +Node: Nextfile Statement428161 +Node: Exit Statement430791 +Node: Built-in Variables433194 +Node: User-modified434327 +Ref: User-modified-Footnote-1442008 +Node: Auto-set442070 +Ref: Auto-set-Footnote-1456282 +Ref: Auto-set-Footnote-2456487 +Node: ARGC and ARGV456543 +Node: Pattern Action Summary460761 +Node: Arrays463188 +Node: Array Basics464517 +Node: Array Intro465361 +Ref: figure-array-elements467325 +Ref: Array Intro-Footnote-1469851 +Node: Reference to Elements469979 +Node: Assigning Elements472431 +Node: Array Example472922 +Node: Scanning an Array474680 +Node: Controlling Scanning477696 +Ref: Controlling Scanning-Footnote-1482892 +Node: Numeric Array Subscripts483208 +Node: Uninitialized Subscripts485393 +Node: Delete487010 +Ref: Delete-Footnote-1489753 +Node: Multidimensional489810 +Node: Multiscanning492907 +Node: Arrays of Arrays494496 +Node: Arrays Summary499255 +Node: Functions501347 +Node: Built-in502246 +Node: Calling Built-in503324 +Node: Numeric Functions505315 +Ref: Numeric Functions-Footnote-1510134 +Ref: Numeric Functions-Footnote-2510491 +Ref: Numeric Functions-Footnote-3510539 +Node: String Functions510811 +Ref: String Functions-Footnote-1534286 +Ref: String Functions-Footnote-2534415 +Ref: String Functions-Footnote-3534663 +Node: Gory Details534750 +Ref: table-sub-escapes536531 +Ref: table-sub-proposed538051 +Ref: table-posix-sub539415 +Ref: table-gensub-escapes540951 +Ref: Gory Details-Footnote-1541783 +Node: I/O Functions541934 +Ref: I/O Functions-Footnote-1549152 +Node: Time Functions549299 +Ref: Time Functions-Footnote-1559787 +Ref: Time Functions-Footnote-2559855 +Ref: Time Functions-Footnote-3560013 +Ref: Time Functions-Footnote-4560124 +Ref: Time Functions-Footnote-5560236 +Ref: Time Functions-Footnote-6560463 +Node: Bitwise Functions560729 +Ref: table-bitwise-ops561291 +Ref: Bitwise Functions-Footnote-1565600 +Node: Type Functions565769 +Node: I18N Functions566920 +Node: User-defined568565 +Node: Definition Syntax569370 +Ref: Definition Syntax-Footnote-1574777 +Node: Function Example574848 +Ref: Function Example-Footnote-1577767 +Node: Function Caveats577789 +Node: Calling A Function578307 +Node: Variable Scope579265 +Node: Pass By Value/Reference582253 +Node: Return Statement585748 +Node: Dynamic Typing588729 +Node: Indirect Calls589658 +Ref: Indirect Calls-Footnote-1600960 +Node: Functions Summary601088 +Node: Library Functions603790 +Ref: Library Functions-Footnote-1607399 +Ref: Library Functions-Footnote-2607542 +Node: Library Names607713 +Ref: Library Names-Footnote-1611167 +Ref: Library Names-Footnote-2611390 +Node: General Functions611476 +Node: Strtonum Function612579 +Node: Assert Function615601 +Node: Round Function618925 +Node: Cliff Random Function620466 +Node: Ordinal Functions621482 +Ref: Ordinal Functions-Footnote-1624545 +Ref: Ordinal Functions-Footnote-2624797 +Node: Join Function625008 +Ref: Join Function-Footnote-1626777 +Node: Getlocaltime Function626977 +Node: Readfile Function630721 +Node: Shell Quoting632691 +Node: Data File Management634092 +Node: Filetrans Function634724 +Node: Rewind Function638780 +Node: File Checking640167 +Ref: File Checking-Footnote-1641499 +Node: Empty Files641700 +Node: Ignoring Assigns643679 +Node: Getopt Function645230 +Ref: Getopt Function-Footnote-1656692 +Node: Passwd Functions656892 +Ref: Passwd Functions-Footnote-1665729 +Node: Group Functions665817 +Ref: Group Functions-Footnote-1673711 +Node: Walking Arrays673924 +Node: Library Functions Summary675527 +Node: Library Exercises676928 +Node: Sample Programs678208 +Node: Running Examples678978 +Node: Clones679706 +Node: Cut Program680930 +Node: Egrep Program690649 +Ref: Egrep Program-Footnote-1698147 +Node: Id Program698257 +Node: Split Program701902 +Ref: Split Program-Footnote-1705350 +Node: Tee Program705478 +Node: Uniq Program708267 +Node: Wc Program715686 +Ref: Wc Program-Footnote-1719936 +Node: Miscellaneous Programs720030 +Node: Dupword Program721243 +Node: Alarm Program723274 +Node: Translate Program728078 +Ref: Translate Program-Footnote-1732643 +Node: Labels Program732913 +Ref: Labels Program-Footnote-1736264 +Node: Word Sorting736348 +Node: History Sorting740419 +Node: Extract Program742255 +Node: Simple Sed749780 +Node: Igawk Program752848 +Ref: Igawk Program-Footnote-1767172 +Ref: Igawk Program-Footnote-2767373 +Ref: Igawk Program-Footnote-3767495 +Node: Anagram Program767610 +Node: Signature Program770667 +Node: Programs Summary771914 +Node: Programs Exercises773107 +Ref: Programs Exercises-Footnote-1777238 +Node: Advanced Features777329 +Node: Nondecimal Data779277 +Node: Array Sorting780867 +Node: Controlling Array Traversal781564 +Ref: Controlling Array Traversal-Footnote-1789897 +Node: Array Sorting Functions790015 +Ref: Array Sorting Functions-Footnote-1793904 +Node: Two-way I/O794100 +Ref: Two-way I/O-Footnote-1799045 +Ref: Two-way I/O-Footnote-2799231 +Node: TCP/IP Networking799313 +Node: Profiling802186 +Node: Advanced Features Summary810463 +Node: Internationalization812396 +Node: I18N and L10N813876 +Node: Explaining gettext814562 +Ref: Explaining gettext-Footnote-1819587 +Ref: Explaining gettext-Footnote-2819771 +Node: Programmer i18n819936 +Ref: Programmer i18n-Footnote-1824802 +Node: Translator i18n824851 +Node: String Extraction825645 +Ref: String Extraction-Footnote-1826776 +Node: Printf Ordering826862 +Ref: Printf Ordering-Footnote-1829648 +Node: I18N Portability829712 +Ref: I18N Portability-Footnote-1832167 +Node: I18N Example832230 +Ref: I18N Example-Footnote-1835033 +Node: Gawk I18N835105 +Node: I18N Summary835743 +Node: Debugger837082 +Node: Debugging838104 +Node: Debugging Concepts838545 +Node: Debugging Terms840398 +Node: Awk Debugging842970 +Node: Sample Debugging Session843864 +Node: Debugger Invocation844384 +Node: Finding The Bug845768 +Node: List of Debugger Commands852243 +Node: Breakpoint Control853576 +Node: Debugger Execution Control857272 +Node: Viewing And Changing Data860636 +Node: Execution Stack864014 +Node: Debugger Info865651 +Node: Miscellaneous Debugger Commands869668 +Node: Readline Support874697 +Node: Limitations875589 +Node: Debugging Summary877703 +Node: Arbitrary Precision Arithmetic878871 +Node: Computer Arithmetic880287 +Ref: table-numeric-ranges883885 +Ref: Computer Arithmetic-Footnote-1884744 +Node: Math Definitions884801 +Ref: table-ieee-formats888089 +Ref: Math Definitions-Footnote-1888693 +Node: MPFR features888798 +Node: FP Math Caution890469 +Ref: FP Math Caution-Footnote-1891519 +Node: Inexactness of computations891888 +Node: Inexact representation892847 +Node: Comparing FP Values894204 +Node: Errors accumulate895286 +Node: Getting Accuracy896719 +Node: Try To Round899381 +Node: Setting precision900280 +Ref: table-predefined-precision-strings900964 +Node: Setting the rounding mode902753 +Ref: table-gawk-rounding-modes903117 +Ref: Setting the rounding mode-Footnote-1906572 +Node: Arbitrary Precision Integers906751 +Ref: Arbitrary Precision Integers-Footnote-1911650 +Node: POSIX Floating Point Problems911799 +Ref: POSIX Floating Point Problems-Footnote-1915672 +Node: Floating point summary915710 +Node: Dynamic Extensions917904 +Node: Extension Intro919456 +Node: Plugin License920722 +Node: Extension Mechanism Outline921519 +Ref: figure-load-extension921947 +Ref: figure-register-new-function923427 +Ref: figure-call-new-function924431 +Node: Extension API Description926417 +Node: Extension API Functions Introduction927867 +Node: General Data Types932691 +Ref: General Data Types-Footnote-1938430 +Node: Memory Allocation Functions938729 +Ref: Memory Allocation Functions-Footnote-1941568 +Node: Constructor Functions941664 +Node: Registration Functions943398 +Node: Extension Functions944083 +Node: Exit Callback Functions946380 +Node: Extension Version String947628 +Node: Input Parsers948293 +Node: Output Wrappers958172 +Node: Two-way processors962687 +Node: Printing Messages964891 +Ref: Printing Messages-Footnote-1965967 +Node: Updating `ERRNO'966119 +Node: Requesting Values966859 +Ref: table-value-types-returned967587 +Node: Accessing Parameters968544 +Node: Symbol Table Access969775 +Node: Symbol table by name970289 +Node: Symbol table by cookie972270 +Ref: Symbol table by cookie-Footnote-1976414 +Node: Cached values976477 +Ref: Cached values-Footnote-1979976 +Node: Array Manipulation980067 +Ref: Array Manipulation-Footnote-1981165 +Node: Array Data Types981202 +Ref: Array Data Types-Footnote-1983857 +Node: Array Functions983949 +Node: Flattening Arrays987803 +Node: Creating Arrays994695 +Node: Extension API Variables999466 +Node: Extension Versioning1000102 +Node: Extension API Informational Variables1002003 +Node: Extension API Boilerplate1003068 +Node: Finding Extensions1006877 +Node: Extension Example1007437 +Node: Internal File Description1008209 +Node: Internal File Ops1012276 +Ref: Internal File Ops-Footnote-11023946 +Node: Using Internal File Ops1024086 +Ref: Using Internal File Ops-Footnote-11026469 +Node: Extension Samples1026742 +Node: Extension Sample File Functions1028268 +Node: Extension Sample Fnmatch1035906 +Node: Extension Sample Fork1037397 +Node: Extension Sample Inplace1038612 +Node: Extension Sample Ord1040287 +Node: Extension Sample Readdir1041123 +Ref: table-readdir-file-types1041999 +Node: Extension Sample Revout1042810 +Node: Extension Sample Rev2way1043400 +Node: Extension Sample Read write array1044140 +Node: Extension Sample Readfile1046080 +Node: Extension Sample Time1047175 +Node: Extension Sample API Tests1048524 +Node: gawkextlib1049015 +Node: Extension summary1051673 +Node: Extension Exercises1055362 +Node: Language History1056084 +Node: V7/SVR3.11057740 +Node: SVR41059921 +Node: POSIX1061366 +Node: BTL1062755 +Node: POSIX/GNU1063489 +Node: Feature History1069113 +Node: Common Extensions1082211 +Node: Ranges and Locales1083535 +Ref: Ranges and Locales-Footnote-11088153 +Ref: Ranges and Locales-Footnote-21088180 +Ref: Ranges and Locales-Footnote-31088414 +Node: Contributors1088635 +Node: History summary1094176 +Node: Installation1095546 +Node: Gawk Distribution1096492 +Node: Getting1096976 +Node: Extracting1097799 +Node: Distribution contents1099434 +Node: Unix Installation1105499 +Node: Quick Installation1106182 +Node: Shell Startup Files1108593 +Node: Additional Configuration Options1109672 +Node: Configuration Philosophy1111411 +Node: Non-Unix Installation1113780 +Node: PC Installation1114238 +Node: PC Binary Installation1115557 +Node: PC Compiling1117405 +Ref: PC Compiling-Footnote-11120426 +Node: PC Testing1120535 +Node: PC Using1121711 +Node: Cygwin1125826 +Node: MSYS1126649 +Node: VMS Installation1127149 +Node: VMS Compilation1127941 +Ref: VMS Compilation-Footnote-11129163 +Node: VMS Dynamic Extensions1129221 +Node: VMS Installation Details1130905 +Node: VMS Running1133157 +Node: VMS GNV1135993 +Node: VMS Old Gawk1136727 +Node: Bugs1137197 +Node: Other Versions1141080 +Node: Installation summary1147508 +Node: Notes1148564 +Node: Compatibility Mode1149429 +Node: Additions1150211 +Node: Accessing The Source1151136 +Node: Adding Code1152572 +Node: New Ports1158737 +Node: Derived Files1163219 +Ref: Derived Files-Footnote-11168694 +Ref: Derived Files-Footnote-21168728 +Ref: Derived Files-Footnote-31169324 +Node: Future Extensions1169438 +Node: Implementation Limitations1170044 +Node: Extension Design1171292 +Node: Old Extension Problems1172446 +Ref: Old Extension Problems-Footnote-11173963 +Node: Extension New Mechanism Goals1174020 +Ref: Extension New Mechanism Goals-Footnote-11177380 +Node: Extension Other Design Decisions1177569 +Node: Extension Future Growth1179677 +Node: Old Extension Mechanism1180513 +Node: Notes summary1182275 +Node: Basic Concepts1183461 +Node: Basic High Level1184142 +Ref: figure-general-flow1184414 +Ref: figure-process-flow1185013 +Ref: Basic High Level-Footnote-11188242 +Node: Basic Data Typing1188427 +Node: Glossary1191755 +Node: Copying1216913 +Node: GNU Free Documentation License1254469 +Node: Index1279605  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 57c37746..f0e17602 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -603,6 +603,7 @@ particular records in a file and perform operations upon them. @code{getline}. * Getline Summary:: Summary of @code{getline} Variants. * Read Timeout:: Reading input with a timeout. +* Retrying I/O:: Retrying I/O after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -6335,6 +6336,7 @@ used with it do not have to be named on the @command{awk} command line * Getline:: Reading files under explicit program control using the @code{getline} function. * Read Timeout:: Reading input with a timeout. +* Retrying I/O:: Retrying I/O after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -8142,6 +8144,11 @@ it encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @code{ERRNO} to a string describing the error that occurred. +If the @code{errno} variable indicates that the I/O operation may be +retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2 +will be returned instead of @minus{}1, and further calls to @code{getline} +may be attemped. @DBXREF{Retrying I/O} for further information about +this feature. In the following examples, @var{command} stands for a string value that represents a shell command. @@ -8794,7 +8801,8 @@ on a per command or connection basis. the attempt to read from the underlying device may succeed in a later attempt. This is a limitation, and it also means that you cannot use this to multiplex input from -two or more sources. +two or more sources. @DBXREF{Retrying I/O} for a way to enable +later I/O attempts to succeed. Assigning a timeout value prevents read operations from blocking indefinitely. But bear in mind that there are other ways @@ -8804,6 +8812,35 @@ a connection before it can start reading any data, or the attempt to open a FIFO special file for reading can block indefinitely until some other process opens it for writing. +@node Retrying I/O +@section Retrying I/O on Certain Input Errors +@cindex retrying I/O + +@cindex differences in @command{awk} and @command{gawk}, retrying I/O +This @value{SECTION} describes a feature that is specific to @command{gawk}. + +When @command{gawk} encounters an error while reading input, it will by default +return @minus{}1 from getline, and subsequent attempts to read from that file +will result in an end-of-file indication. However, you may optionally instruct +@command{gawk} to allow I/O to be retried when certain errors are encountered +by setting setting a special element +in the @code{PROCINFO} array (@pxref{Auto-set}): + +@example +PROCINFO["input_name", "RETRY"] +@end example + +When set, this causes @command{gawk} to check the value of the system +@code{errno} variable when an I/O error occurs. If @code{errno} indicates +a subsequent I/O attempt may succeed, @code{getline} will instead return +@minus{}2 and +further calls to @code{getline} may succeed. This applies to @code{errno} +values EAGAIN, EWOULDBLOCK, EINTR, or ETIMEDOUT. + +This feature is useful in conjunction with +@code{PROCINFO["input_name", "READ_TIMEOUT"]} or situations where a file +descriptor has been configured to behave in a non-blocking fashion. + @node Command-line directories @section Directories on the Command Line @cindex differences in @command{awk} and @command{gawk}, command-line directories @@ -14942,6 +14979,11 @@ value to be meaningful when an I/O operation returns a failure value, such as @code{getline} returning @minus{}1. You are, of course, free to clear it yourself before doing an I/O operation. +If the value of @code{ERRNO} corresponds to a system error in the C +@code{errno} variable, then @code{PROCINFO["errno"]} will be set to the value +of @code{errno}. For non-system errors, @code{PROCINFO["errno"]} will +be zero. + @cindex @code{FILENAME} variable @cindex dark corner, @code{FILENAME} variable @item @code{FILENAME} @@ -15010,6 +15052,10 @@ are guaranteed to be available: @item PROCINFO["egid"] The value of the @code{getegid()} system call. +@item PROCINFO["errno"] +The value of the C @code{errno} variable when @code{ERRNO} is set to +the associated error message. + @item PROCINFO["euid"] @cindex effective user ID of @command{gawk} user The value of the @code{geteuid()} system call. @@ -15148,6 +15194,11 @@ It may be used to provide a timeout when reading from any open input file, pipe, or coprocess. @DBXREF{Read Timeout} for more information. +@item +It may be used to indicate that I/O may be retried when it fails due to +certain errors. +@DBXREF{Retrying I/O} for more information. + @item It may be used to cause coprocesses to communicate over pseudo-ttys instead of through two-way pipes; this is discussed further in diff --git a/doc/gawktexi.in b/doc/gawktexi.in index b850dd15..638bb909 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -598,6 +598,7 @@ particular records in a file and perform operations upon them. @code{getline}. * Getline Summary:: Summary of @code{getline} Variants. * Read Timeout:: Reading input with a timeout. +* Retrying I/O:: Retrying I/O after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -6119,6 +6120,7 @@ used with it do not have to be named on the @command{awk} command line * Getline:: Reading files under explicit program control using the @code{getline} function. * Read Timeout:: Reading input with a timeout. +* Retrying I/O:: Retrying I/O after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -7743,6 +7745,11 @@ it encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @code{ERRNO} to a string describing the error that occurred. +If the @code{errno} variable indicates that the I/O operation may be +retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2 +will be returned instead of @minus{}1, and further calls to @code{getline} +may be attemped. @DBXREF{Retrying I/O} for further information about +this feature. In the following examples, @var{command} stands for a string value that represents a shell command. @@ -8395,7 +8402,8 @@ on a per command or connection basis. the attempt to read from the underlying device may succeed in a later attempt. This is a limitation, and it also means that you cannot use this to multiplex input from -two or more sources. +two or more sources. @DBXREF{Retrying I/O} for a way to enable +later I/O attempts to succeed. Assigning a timeout value prevents read operations from blocking indefinitely. But bear in mind that there are other ways @@ -8405,6 +8413,35 @@ a connection before it can start reading any data, or the attempt to open a FIFO special file for reading can block indefinitely until some other process opens it for writing. +@node Retrying I/O +@section Retrying I/O on Certain Input Errors +@cindex retrying I/O + +@cindex differences in @command{awk} and @command{gawk}, retrying I/O +This @value{SECTION} describes a feature that is specific to @command{gawk}. + +When @command{gawk} encounters an error while reading input, it will by default +return @minus{}1 from getline, and subsequent attempts to read from that file +will result in an end-of-file indication. However, you may optionally instruct +@command{gawk} to allow I/O to be retried when certain errors are encountered +by setting setting a special element +in the @code{PROCINFO} array (@pxref{Auto-set}): + +@example +PROCINFO["input_name", "RETRY"] +@end example + +When set, this causes @command{gawk} to check the value of the system +@code{errno} variable when an I/O error occurs. If @code{errno} indicates +a subsequent I/O attempt may succeed, @code{getline} will instead return +@minus{}2 and +further calls to @code{getline} may succeed. This applies to @code{errno} +values EAGAIN, EWOULDBLOCK, EINTR, or ETIMEDOUT. + +This feature is useful in conjunction with +@code{PROCINFO["input_name", "READ_TIMEOUT"]} or situations where a file +descriptor has been configured to behave in a non-blocking fashion. + @node Command-line directories @section Directories on the Command Line @cindex differences in @command{awk} and @command{gawk}, command-line directories @@ -14271,6 +14308,11 @@ value to be meaningful when an I/O operation returns a failure value, such as @code{getline} returning @minus{}1. You are, of course, free to clear it yourself before doing an I/O operation. +If the value of @code{ERRNO} corresponds to a system error in the C +@code{errno} variable, then @code{PROCINFO["errno"]} will be set to the value +of @code{errno}. For non-system errors, @code{PROCINFO["errno"]} will +be zero. + @cindex @code{FILENAME} variable @cindex dark corner, @code{FILENAME} variable @item @code{FILENAME} @@ -14339,6 +14381,10 @@ are guaranteed to be available: @item PROCINFO["egid"] The value of the @code{getegid()} system call. +@item PROCINFO["errno"] +The value of the C @code{errno} variable when @code{ERRNO} is set to +the associated error message. + @item PROCINFO["euid"] @cindex effective user ID of @command{gawk} user The value of the @code{geteuid()} system call. @@ -14477,6 +14523,11 @@ It may be used to provide a timeout when reading from any open input file, pipe, or coprocess. @DBXREF{Read Timeout} for more information. +@item +It may be used to indicate that I/O may be retried when it fails due to +certain errors. +@DBXREF{Retrying I/O} for more information. + @item It may be used to cause coprocesses to communicate over pseudo-ttys instead of through two-way pipes; this is discussed further in diff --git a/gawkapi.h b/gawkapi.h index 22b3be3d..6893fda0 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -504,7 +504,7 @@ typedef struct gawk_api { awk_value_t *result); /* - * Convert a paramter that was undefined into an array + * Convert a parameter that was undefined into an array * (provide call-by-reference for arrays). Returns false * if count is too big, or if the argument's type is * not undefined. -- cgit v1.2.3 From a29f6a213fb18c199a4b1358327dc6d21f59eb64 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 4 Jan 2015 20:18:10 -0500 Subject: Document the new get_file API function in gawktexi.in. --- ChangeLog | 4 + doc/ChangeLog | 4 + doc/gawk.info | 1187 +++++++++++++++++++++++++++++-------------------------- doc/gawk.texi | 54 +++ doc/gawktexi.in | 54 +++ gawkapi.h | 2 +- 6 files changed, 741 insertions(+), 564 deletions(-) diff --git a/ChangeLog b/ChangeLog index c93bd631..eb7555f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-01-04 Andrew J. Schorr + + * gawkapi.h: Fix another comment typo. + 2015-01-04 Andrew J. Schorr * gawkapi.h: Fix typo in comment. diff --git a/doc/ChangeLog b/doc/ChangeLog index 31bcecce..de948bda 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-01-04 Andrew J. Schorr + + * gawktexi.in: Document the get_file API function. + 2015-01-04 Andrew J. Schorr * gawk.1: Document new features PROCINFO["errno"] and diff --git a/doc/gawk.info b/doc/gawk.info index 02b59b92..9513e5d6 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -558,6 +558,7 @@ entitled "GNU Free Documentation License". * Array Functions:: Functions for working with arrays. * Flattening Arrays:: How to flatten arrays. * Creating Arrays:: How to create and populate arrays. +* Redirection API:: How to access and manipulate redirections. * Extension API Variables:: Variables provided by the API. * Extension Versioning:: API Version information. * Extension API Informational Variables:: Variables providing information about @@ -22922,6 +22923,7 @@ describes the API in detail. * Symbol Table Access:: Functions for accessing global variables. * Array Manipulation:: Functions for working with arrays. +* Redirection API:: How to access and manipulate redirections. * Extension API Variables:: Variables provided by the API. * Extension API Boilerplate:: Boilerplate code for using the API. @@ -22982,6 +22984,9 @@ operations: - Flattening an array for easy C style looping over all its indices and elements + * Accessing and manipulating redirections. + + Some points about using the API: * The following types, macros, and/or functions are referenced in @@ -24188,7 +24193,7 @@ using `release_value()'. `double' to store.  -File: gawk.info, Node: Array Manipulation, Next: Extension API Variables, Prev: Symbol Table Access, Up: Extension API Description +File: gawk.info, Node: Array Manipulation, Next: Redirection API, Prev: Symbol Table Access, Up: Extension API Description 16.4.11 Array Manipulation -------------------------- @@ -24673,9 +24678,64 @@ array: environment variable.)  -File: gawk.info, Node: Extension API Variables, Next: Extension API Boilerplate, Prev: Array Manipulation, Up: Extension API Description - -16.4.12 API Variables +File: gawk.info, Node: Redirection API, Next: Extension API Variables, Prev: Array Manipulation, Up: Extension API Description + +16.4.12 Accessing and Manipulating Redirections +----------------------------------------------- + +The following function allows extensions to access and manipulate +redirections. + +`awk_bool_t get_file(const char *name,' +` size_t name_len,' +` const char *filetype,' +` int fd,' +` const awk_input_buf_t **ibufp,' +` const awk_output_buf_t **obufp);' + Look up a file in `gawk''s internal redirection table. If `name' + is NULL or `name_len' is 0, it returns data for the currently open + input file corresponding to `FILENAME' (and it will not access the + `filetype' argument, so that may be undefined). If the file is + not already open, it tries to open it. The `filetype' argument + must be NUL-terminated and should be one of: + `>' + A file opened for output. + + `>>' + A file opened for append. + + `<' + A file opened for input. + + `|>' + A pipe opened for output. + + `|<' + A pipe opened for input. + + `|&' + A two-way coprocess. + If the file is not already open, and the fd argument is + non-negative, `gawk' will use that file descriptor instead of + opening the file in the usual way. If the fd is non-negative, but + the file exists already, `gawk' ignores the fd and returns the + existing file. It is the caller's responsibility to notice that + neither the fd in the returned `awk_input_buf_t' nor the fd in the + returned `awk_output_buf_t' matches the requested value. Note that + supplying a file descriptor is currently NOT supported for pipes. + It should work for input, output, append, and two-way (coprocess) + sockets. If `filetype' is two-way, we assume that it is a socket! + Note that in the two-way case, the input and output file + descriptors may differ. To check for success, one must check + whether either matches. + + For example, this API function can be used to implement I/O +multiplexing or a socket library. + + +File: gawk.info, Node: Extension API Variables, Next: Extension API Boilerplate, Prev: Redirection API, Up: Extension API Description + +16.4.13 API Variables --------------------- The API provides two sets of variables. The first provides information @@ -24692,7 +24752,7 @@ information about how `gawk' was invoked.  File: gawk.info, Node: Extension Versioning, Next: Extension API Informational Variables, Up: Extension API Variables -16.4.12.1 API Version Constants and Variables +16.4.13.1 API Version Constants and Variables ............................................. The API provides both a "major" and a "minor" version number. The API @@ -24741,7 +24801,7 @@ Boilerplate::).  File: gawk.info, Node: Extension API Informational Variables, Prev: Extension Versioning, Up: Extension API Variables -16.4.12.2 Informational Variables +16.4.13.2 Informational Variables ................................. The API provides access to several variables that describe whether the @@ -24776,7 +24836,7 @@ not change during execution.  File: gawk.info, Node: Extension API Boilerplate, Prev: Extension API Variables, Up: Extension API Description -16.4.13 Boilerplate Code +16.4.14 Boilerplate Code ------------------------ As mentioned earlier (*note Extension Mechanism Outline::), the function @@ -34502,561 +34562,562 @@ Index  Tag Table: Node: Top1204 -Node: Foreword342300 -Node: Foreword446742 -Node: Preface48264 -Ref: Preface-Footnote-151135 -Ref: Preface-Footnote-251242 -Ref: Preface-Footnote-351475 -Node: History51617 -Node: Names53963 -Ref: Names-Footnote-155057 -Node: This Manual55203 -Ref: This Manual-Footnote-161690 -Node: Conventions61790 -Node: Manual History64128 -Ref: Manual History-Footnote-167110 -Ref: Manual History-Footnote-267151 -Node: How To Contribute67225 -Node: Acknowledgments68354 -Node: Getting Started73159 -Node: Running gawk75592 -Node: One-shot76782 -Node: Read Terminal78030 -Node: Long80057 -Node: Executable Scripts81573 -Ref: Executable Scripts-Footnote-184362 -Node: Comments84465 -Node: Quoting86947 -Node: DOS Quoting92471 -Node: Sample Data Files93146 -Node: Very Simple95741 -Node: Two Rules100639 -Node: More Complex102525 -Node: Statements/Lines105387 -Ref: Statements/Lines-Footnote-1109842 -Node: Other Features110107 -Node: When111038 -Ref: When-Footnote-1112792 -Node: Intro Summary112857 -Node: Invoking Gawk113740 -Node: Command Line115254 -Node: Options116052 -Ref: Options-Footnote-1131856 -Ref: Options-Footnote-2132085 -Node: Other Arguments132110 -Node: Naming Standard Input135058 -Node: Environment Variables136151 -Node: AWKPATH Variable136709 -Ref: AWKPATH Variable-Footnote-1140122 -Ref: AWKPATH Variable-Footnote-2140167 -Node: AWKLIBPATH Variable140427 -Node: Other Environment Variables141683 -Node: Exit Status145171 -Node: Include Files145847 -Node: Loading Shared Libraries149444 -Node: Obsolete150871 -Node: Undocumented151568 -Node: Invoking Summary151835 -Node: Regexp153499 -Node: Regexp Usage154953 -Node: Escape Sequences156990 -Node: Regexp Operators163231 -Ref: Regexp Operators-Footnote-1170657 -Ref: Regexp Operators-Footnote-2170804 -Node: Bracket Expressions170902 -Ref: table-char-classes172917 -Node: Leftmost Longest175841 -Node: Computed Regexps177143 -Node: GNU Regexp Operators180540 -Node: Case-sensitivity184213 -Ref: Case-sensitivity-Footnote-1187098 -Ref: Case-sensitivity-Footnote-2187333 -Node: Regexp Summary187441 -Node: Reading Files188908 -Node: Records191069 -Node: awk split records191802 -Node: gawk split records196717 -Ref: gawk split records-Footnote-1201261 -Node: Fields201298 -Ref: Fields-Footnote-1204074 -Node: Nonconstant Fields204160 -Ref: Nonconstant Fields-Footnote-1206403 -Node: Changing Fields206607 -Node: Field Separators212536 -Node: Default Field Splitting215241 -Node: Regexp Field Splitting216358 -Node: Single Character Fields219708 -Node: Command Line Field Separator220767 -Node: Full Line Fields223979 -Ref: Full Line Fields-Footnote-1225496 -Ref: Full Line Fields-Footnote-2225542 -Node: Field Splitting Summary225643 -Node: Constant Size227717 -Node: Splitting By Content232306 -Ref: Splitting By Content-Footnote-1236300 -Node: Multiple Line236463 -Ref: Multiple Line-Footnote-1242349 -Node: Getline242528 -Node: Plain Getline245010 -Node: Getline/Variable247650 -Node: Getline/File248798 -Node: Getline/Variable/File250182 -Ref: Getline/Variable/File-Footnote-1251785 -Node: Getline/Pipe251872 -Node: Getline/Variable/Pipe254555 -Node: Getline/Coprocess255686 -Node: Getline/Variable/Coprocess256938 -Node: Getline Notes257677 -Node: Getline Summary260469 -Ref: table-getline-variants260881 -Node: Read Timeout261710 -Ref: Read Timeout-Footnote-1265597 -Node: Retrying I/O265655 -Node: Command-line directories266838 -Node: Input Summary267743 -Node: Input Exercises271044 -Node: Printing271772 -Node: Print273549 -Node: Print Examples275006 -Node: Output Separators277785 -Node: OFMT279803 -Node: Printf281157 -Node: Basic Printf281942 -Node: Control Letters283512 -Node: Format Modifiers287495 -Node: Printf Examples293504 -Node: Redirection295990 -Node: Special FD302831 -Ref: Special FD-Footnote-1305991 -Node: Special Files306065 -Node: Other Inherited Files306682 -Node: Special Network307682 -Node: Special Caveats308544 -Node: Close Files And Pipes309495 -Ref: Close Files And Pipes-Footnote-1316677 -Ref: Close Files And Pipes-Footnote-2316825 -Node: Output Summary316975 -Node: Output Exercises317973 -Node: Expressions318653 -Node: Values319838 -Node: Constants320516 -Node: Scalar Constants321207 -Ref: Scalar Constants-Footnote-1322066 -Node: Nondecimal-numbers322316 -Node: Regexp Constants325334 -Node: Using Constant Regexps325859 -Node: Variables329002 -Node: Using Variables329657 -Node: Assignment Options331568 -Node: Conversion333443 -Node: Strings And Numbers333967 -Ref: Strings And Numbers-Footnote-1337032 -Node: Locale influences conversions337141 -Ref: table-locale-affects339888 -Node: All Operators340476 -Node: Arithmetic Ops341106 -Node: Concatenation343611 -Ref: Concatenation-Footnote-1346430 -Node: Assignment Ops346536 -Ref: table-assign-ops351515 -Node: Increment Ops352787 -Node: Truth Values and Conditions356225 -Node: Truth Values357310 -Node: Typing and Comparison358359 -Node: Variable Typing359169 -Node: Comparison Operators362822 -Ref: table-relational-ops363232 -Node: POSIX String Comparison366727 -Ref: POSIX String Comparison-Footnote-1367799 -Node: Boolean Ops367937 -Ref: Boolean Ops-Footnote-1372416 -Node: Conditional Exp372507 -Node: Function Calls374234 -Node: Precedence378114 -Node: Locales381775 -Node: Expressions Summary383407 -Node: Patterns and Actions385967 -Node: Pattern Overview387087 -Node: Regexp Patterns388766 -Node: Expression Patterns389309 -Node: Ranges393019 -Node: BEGIN/END396125 -Node: Using BEGIN/END396886 -Ref: Using BEGIN/END-Footnote-1399620 -Node: I/O And BEGIN/END399726 -Node: BEGINFILE/ENDFILE402040 -Node: Empty404941 -Node: Using Shell Variables405258 -Node: Action Overview407531 -Node: Statements409857 -Node: If Statement411705 -Node: While Statement413200 -Node: Do Statement415229 -Node: For Statement416373 -Node: Switch Statement419530 -Node: Break Statement421912 -Node: Continue Statement423953 -Node: Next Statement425780 -Node: Nextfile Statement428161 -Node: Exit Statement430791 -Node: Built-in Variables433194 -Node: User-modified434327 -Ref: User-modified-Footnote-1442008 -Node: Auto-set442070 -Ref: Auto-set-Footnote-1456282 -Ref: Auto-set-Footnote-2456487 -Node: ARGC and ARGV456543 -Node: Pattern Action Summary460761 -Node: Arrays463188 -Node: Array Basics464517 -Node: Array Intro465361 -Ref: figure-array-elements467325 -Ref: Array Intro-Footnote-1469851 -Node: Reference to Elements469979 -Node: Assigning Elements472431 -Node: Array Example472922 -Node: Scanning an Array474680 -Node: Controlling Scanning477696 -Ref: Controlling Scanning-Footnote-1482892 -Node: Numeric Array Subscripts483208 -Node: Uninitialized Subscripts485393 -Node: Delete487010 -Ref: Delete-Footnote-1489753 -Node: Multidimensional489810 -Node: Multiscanning492907 -Node: Arrays of Arrays494496 -Node: Arrays Summary499255 -Node: Functions501347 -Node: Built-in502246 -Node: Calling Built-in503324 -Node: Numeric Functions505315 -Ref: Numeric Functions-Footnote-1510134 -Ref: Numeric Functions-Footnote-2510491 -Ref: Numeric Functions-Footnote-3510539 -Node: String Functions510811 -Ref: String Functions-Footnote-1534286 -Ref: String Functions-Footnote-2534415 -Ref: String Functions-Footnote-3534663 -Node: Gory Details534750 -Ref: table-sub-escapes536531 -Ref: table-sub-proposed538051 -Ref: table-posix-sub539415 -Ref: table-gensub-escapes540951 -Ref: Gory Details-Footnote-1541783 -Node: I/O Functions541934 -Ref: I/O Functions-Footnote-1549152 -Node: Time Functions549299 -Ref: Time Functions-Footnote-1559787 -Ref: Time Functions-Footnote-2559855 -Ref: Time Functions-Footnote-3560013 -Ref: Time Functions-Footnote-4560124 -Ref: Time Functions-Footnote-5560236 -Ref: Time Functions-Footnote-6560463 -Node: Bitwise Functions560729 -Ref: table-bitwise-ops561291 -Ref: Bitwise Functions-Footnote-1565600 -Node: Type Functions565769 -Node: I18N Functions566920 -Node: User-defined568565 -Node: Definition Syntax569370 -Ref: Definition Syntax-Footnote-1574777 -Node: Function Example574848 -Ref: Function Example-Footnote-1577767 -Node: Function Caveats577789 -Node: Calling A Function578307 -Node: Variable Scope579265 -Node: Pass By Value/Reference582253 -Node: Return Statement585748 -Node: Dynamic Typing588729 -Node: Indirect Calls589658 -Ref: Indirect Calls-Footnote-1600960 -Node: Functions Summary601088 -Node: Library Functions603790 -Ref: Library Functions-Footnote-1607399 -Ref: Library Functions-Footnote-2607542 -Node: Library Names607713 -Ref: Library Names-Footnote-1611167 -Ref: Library Names-Footnote-2611390 -Node: General Functions611476 -Node: Strtonum Function612579 -Node: Assert Function615601 -Node: Round Function618925 -Node: Cliff Random Function620466 -Node: Ordinal Functions621482 -Ref: Ordinal Functions-Footnote-1624545 -Ref: Ordinal Functions-Footnote-2624797 -Node: Join Function625008 -Ref: Join Function-Footnote-1626777 -Node: Getlocaltime Function626977 -Node: Readfile Function630721 -Node: Shell Quoting632691 -Node: Data File Management634092 -Node: Filetrans Function634724 -Node: Rewind Function638780 -Node: File Checking640167 -Ref: File Checking-Footnote-1641499 -Node: Empty Files641700 -Node: Ignoring Assigns643679 -Node: Getopt Function645230 -Ref: Getopt Function-Footnote-1656692 -Node: Passwd Functions656892 -Ref: Passwd Functions-Footnote-1665729 -Node: Group Functions665817 -Ref: Group Functions-Footnote-1673711 -Node: Walking Arrays673924 -Node: Library Functions Summary675527 -Node: Library Exercises676928 -Node: Sample Programs678208 -Node: Running Examples678978 -Node: Clones679706 -Node: Cut Program680930 -Node: Egrep Program690649 -Ref: Egrep Program-Footnote-1698147 -Node: Id Program698257 -Node: Split Program701902 -Ref: Split Program-Footnote-1705350 -Node: Tee Program705478 -Node: Uniq Program708267 -Node: Wc Program715686 -Ref: Wc Program-Footnote-1719936 -Node: Miscellaneous Programs720030 -Node: Dupword Program721243 -Node: Alarm Program723274 -Node: Translate Program728078 -Ref: Translate Program-Footnote-1732643 -Node: Labels Program732913 -Ref: Labels Program-Footnote-1736264 -Node: Word Sorting736348 -Node: History Sorting740419 -Node: Extract Program742255 -Node: Simple Sed749780 -Node: Igawk Program752848 -Ref: Igawk Program-Footnote-1767172 -Ref: Igawk Program-Footnote-2767373 -Ref: Igawk Program-Footnote-3767495 -Node: Anagram Program767610 -Node: Signature Program770667 -Node: Programs Summary771914 -Node: Programs Exercises773107 -Ref: Programs Exercises-Footnote-1777238 -Node: Advanced Features777329 -Node: Nondecimal Data779277 -Node: Array Sorting780867 -Node: Controlling Array Traversal781564 -Ref: Controlling Array Traversal-Footnote-1789897 -Node: Array Sorting Functions790015 -Ref: Array Sorting Functions-Footnote-1793904 -Node: Two-way I/O794100 -Ref: Two-way I/O-Footnote-1799045 -Ref: Two-way I/O-Footnote-2799231 -Node: TCP/IP Networking799313 -Node: Profiling802186 -Node: Advanced Features Summary810463 -Node: Internationalization812396 -Node: I18N and L10N813876 -Node: Explaining gettext814562 -Ref: Explaining gettext-Footnote-1819587 -Ref: Explaining gettext-Footnote-2819771 -Node: Programmer i18n819936 -Ref: Programmer i18n-Footnote-1824802 -Node: Translator i18n824851 -Node: String Extraction825645 -Ref: String Extraction-Footnote-1826776 -Node: Printf Ordering826862 -Ref: Printf Ordering-Footnote-1829648 -Node: I18N Portability829712 -Ref: I18N Portability-Footnote-1832167 -Node: I18N Example832230 -Ref: I18N Example-Footnote-1835033 -Node: Gawk I18N835105 -Node: I18N Summary835743 -Node: Debugger837082 -Node: Debugging838104 -Node: Debugging Concepts838545 -Node: Debugging Terms840398 -Node: Awk Debugging842970 -Node: Sample Debugging Session843864 -Node: Debugger Invocation844384 -Node: Finding The Bug845768 -Node: List of Debugger Commands852243 -Node: Breakpoint Control853576 -Node: Debugger Execution Control857272 -Node: Viewing And Changing Data860636 -Node: Execution Stack864014 -Node: Debugger Info865651 -Node: Miscellaneous Debugger Commands869668 -Node: Readline Support874697 -Node: Limitations875589 -Node: Debugging Summary877703 -Node: Arbitrary Precision Arithmetic878871 -Node: Computer Arithmetic880287 -Ref: table-numeric-ranges883885 -Ref: Computer Arithmetic-Footnote-1884744 -Node: Math Definitions884801 -Ref: table-ieee-formats888089 -Ref: Math Definitions-Footnote-1888693 -Node: MPFR features888798 -Node: FP Math Caution890469 -Ref: FP Math Caution-Footnote-1891519 -Node: Inexactness of computations891888 -Node: Inexact representation892847 -Node: Comparing FP Values894204 -Node: Errors accumulate895286 -Node: Getting Accuracy896719 -Node: Try To Round899381 -Node: Setting precision900280 -Ref: table-predefined-precision-strings900964 -Node: Setting the rounding mode902753 -Ref: table-gawk-rounding-modes903117 -Ref: Setting the rounding mode-Footnote-1906572 -Node: Arbitrary Precision Integers906751 -Ref: Arbitrary Precision Integers-Footnote-1911650 -Node: POSIX Floating Point Problems911799 -Ref: POSIX Floating Point Problems-Footnote-1915672 -Node: Floating point summary915710 -Node: Dynamic Extensions917904 -Node: Extension Intro919456 -Node: Plugin License920722 -Node: Extension Mechanism Outline921519 -Ref: figure-load-extension921947 -Ref: figure-register-new-function923427 -Ref: figure-call-new-function924431 -Node: Extension API Description926417 -Node: Extension API Functions Introduction927867 -Node: General Data Types932691 -Ref: General Data Types-Footnote-1938430 -Node: Memory Allocation Functions938729 -Ref: Memory Allocation Functions-Footnote-1941568 -Node: Constructor Functions941664 -Node: Registration Functions943398 -Node: Extension Functions944083 -Node: Exit Callback Functions946380 -Node: Extension Version String947628 -Node: Input Parsers948293 -Node: Output Wrappers958172 -Node: Two-way processors962687 -Node: Printing Messages964891 -Ref: Printing Messages-Footnote-1965967 -Node: Updating `ERRNO'966119 -Node: Requesting Values966859 -Ref: table-value-types-returned967587 -Node: Accessing Parameters968544 -Node: Symbol Table Access969775 -Node: Symbol table by name970289 -Node: Symbol table by cookie972270 -Ref: Symbol table by cookie-Footnote-1976414 -Node: Cached values976477 -Ref: Cached values-Footnote-1979976 -Node: Array Manipulation980067 -Ref: Array Manipulation-Footnote-1981165 -Node: Array Data Types981202 -Ref: Array Data Types-Footnote-1983857 -Node: Array Functions983949 -Node: Flattening Arrays987803 -Node: Creating Arrays994695 -Node: Extension API Variables999466 -Node: Extension Versioning1000102 -Node: Extension API Informational Variables1002003 -Node: Extension API Boilerplate1003068 -Node: Finding Extensions1006877 -Node: Extension Example1007437 -Node: Internal File Description1008209 -Node: Internal File Ops1012276 -Ref: Internal File Ops-Footnote-11023946 -Node: Using Internal File Ops1024086 -Ref: Using Internal File Ops-Footnote-11026469 -Node: Extension Samples1026742 -Node: Extension Sample File Functions1028268 -Node: Extension Sample Fnmatch1035906 -Node: Extension Sample Fork1037397 -Node: Extension Sample Inplace1038612 -Node: Extension Sample Ord1040287 -Node: Extension Sample Readdir1041123 -Ref: table-readdir-file-types1041999 -Node: Extension Sample Revout1042810 -Node: Extension Sample Rev2way1043400 -Node: Extension Sample Read write array1044140 -Node: Extension Sample Readfile1046080 -Node: Extension Sample Time1047175 -Node: Extension Sample API Tests1048524 -Node: gawkextlib1049015 -Node: Extension summary1051673 -Node: Extension Exercises1055362 -Node: Language History1056084 -Node: V7/SVR3.11057740 -Node: SVR41059921 -Node: POSIX1061366 -Node: BTL1062755 -Node: POSIX/GNU1063489 -Node: Feature History1069113 -Node: Common Extensions1082211 -Node: Ranges and Locales1083535 -Ref: Ranges and Locales-Footnote-11088153 -Ref: Ranges and Locales-Footnote-21088180 -Ref: Ranges and Locales-Footnote-31088414 -Node: Contributors1088635 -Node: History summary1094176 -Node: Installation1095546 -Node: Gawk Distribution1096492 -Node: Getting1096976 -Node: Extracting1097799 -Node: Distribution contents1099434 -Node: Unix Installation1105499 -Node: Quick Installation1106182 -Node: Shell Startup Files1108593 -Node: Additional Configuration Options1109672 -Node: Configuration Philosophy1111411 -Node: Non-Unix Installation1113780 -Node: PC Installation1114238 -Node: PC Binary Installation1115557 -Node: PC Compiling1117405 -Ref: PC Compiling-Footnote-11120426 -Node: PC Testing1120535 -Node: PC Using1121711 -Node: Cygwin1125826 -Node: MSYS1126649 -Node: VMS Installation1127149 -Node: VMS Compilation1127941 -Ref: VMS Compilation-Footnote-11129163 -Node: VMS Dynamic Extensions1129221 -Node: VMS Installation Details1130905 -Node: VMS Running1133157 -Node: VMS GNV1135993 -Node: VMS Old Gawk1136727 -Node: Bugs1137197 -Node: Other Versions1141080 -Node: Installation summary1147508 -Node: Notes1148564 -Node: Compatibility Mode1149429 -Node: Additions1150211 -Node: Accessing The Source1151136 -Node: Adding Code1152572 -Node: New Ports1158737 -Node: Derived Files1163219 -Ref: Derived Files-Footnote-11168694 -Ref: Derived Files-Footnote-21168728 -Ref: Derived Files-Footnote-31169324 -Node: Future Extensions1169438 -Node: Implementation Limitations1170044 -Node: Extension Design1171292 -Node: Old Extension Problems1172446 -Ref: Old Extension Problems-Footnote-11173963 -Node: Extension New Mechanism Goals1174020 -Ref: Extension New Mechanism Goals-Footnote-11177380 -Node: Extension Other Design Decisions1177569 -Node: Extension Future Growth1179677 -Node: Old Extension Mechanism1180513 -Node: Notes summary1182275 -Node: Basic Concepts1183461 -Node: Basic High Level1184142 -Ref: figure-general-flow1184414 -Ref: figure-process-flow1185013 -Ref: Basic High Level-Footnote-11188242 -Node: Basic Data Typing1188427 -Node: Glossary1191755 -Node: Copying1216913 -Node: GNU Free Documentation License1254469 -Node: Index1279605 +Node: Foreword342383 +Node: Foreword446825 +Node: Preface48347 +Ref: Preface-Footnote-151218 +Ref: Preface-Footnote-251325 +Ref: Preface-Footnote-351558 +Node: History51700 +Node: Names54046 +Ref: Names-Footnote-155140 +Node: This Manual55286 +Ref: This Manual-Footnote-161773 +Node: Conventions61873 +Node: Manual History64211 +Ref: Manual History-Footnote-167193 +Ref: Manual History-Footnote-267234 +Node: How To Contribute67308 +Node: Acknowledgments68437 +Node: Getting Started73242 +Node: Running gawk75675 +Node: One-shot76865 +Node: Read Terminal78113 +Node: Long80140 +Node: Executable Scripts81656 +Ref: Executable Scripts-Footnote-184445 +Node: Comments84548 +Node: Quoting87030 +Node: DOS Quoting92554 +Node: Sample Data Files93229 +Node: Very Simple95824 +Node: Two Rules100722 +Node: More Complex102608 +Node: Statements/Lines105470 +Ref: Statements/Lines-Footnote-1109925 +Node: Other Features110190 +Node: When111121 +Ref: When-Footnote-1112875 +Node: Intro Summary112940 +Node: Invoking Gawk113823 +Node: Command Line115337 +Node: Options116135 +Ref: Options-Footnote-1131939 +Ref: Options-Footnote-2132168 +Node: Other Arguments132193 +Node: Naming Standard Input135141 +Node: Environment Variables136234 +Node: AWKPATH Variable136792 +Ref: AWKPATH Variable-Footnote-1140205 +Ref: AWKPATH Variable-Footnote-2140250 +Node: AWKLIBPATH Variable140510 +Node: Other Environment Variables141766 +Node: Exit Status145254 +Node: Include Files145930 +Node: Loading Shared Libraries149527 +Node: Obsolete150954 +Node: Undocumented151651 +Node: Invoking Summary151918 +Node: Regexp153582 +Node: Regexp Usage155036 +Node: Escape Sequences157073 +Node: Regexp Operators163314 +Ref: Regexp Operators-Footnote-1170740 +Ref: Regexp Operators-Footnote-2170887 +Node: Bracket Expressions170985 +Ref: table-char-classes173000 +Node: Leftmost Longest175924 +Node: Computed Regexps177226 +Node: GNU Regexp Operators180623 +Node: Case-sensitivity184296 +Ref: Case-sensitivity-Footnote-1187181 +Ref: Case-sensitivity-Footnote-2187416 +Node: Regexp Summary187524 +Node: Reading Files188991 +Node: Records191152 +Node: awk split records191885 +Node: gawk split records196800 +Ref: gawk split records-Footnote-1201344 +Node: Fields201381 +Ref: Fields-Footnote-1204157 +Node: Nonconstant Fields204243 +Ref: Nonconstant Fields-Footnote-1206486 +Node: Changing Fields206690 +Node: Field Separators212619 +Node: Default Field Splitting215324 +Node: Regexp Field Splitting216441 +Node: Single Character Fields219791 +Node: Command Line Field Separator220850 +Node: Full Line Fields224062 +Ref: Full Line Fields-Footnote-1225579 +Ref: Full Line Fields-Footnote-2225625 +Node: Field Splitting Summary225726 +Node: Constant Size227800 +Node: Splitting By Content232389 +Ref: Splitting By Content-Footnote-1236383 +Node: Multiple Line236546 +Ref: Multiple Line-Footnote-1242432 +Node: Getline242611 +Node: Plain Getline245093 +Node: Getline/Variable247733 +Node: Getline/File248881 +Node: Getline/Variable/File250265 +Ref: Getline/Variable/File-Footnote-1251868 +Node: Getline/Pipe251955 +Node: Getline/Variable/Pipe254638 +Node: Getline/Coprocess255769 +Node: Getline/Variable/Coprocess257021 +Node: Getline Notes257760 +Node: Getline Summary260552 +Ref: table-getline-variants260964 +Node: Read Timeout261793 +Ref: Read Timeout-Footnote-1265680 +Node: Retrying I/O265738 +Node: Command-line directories266921 +Node: Input Summary267826 +Node: Input Exercises271127 +Node: Printing271855 +Node: Print273632 +Node: Print Examples275089 +Node: Output Separators277868 +Node: OFMT279886 +Node: Printf281240 +Node: Basic Printf282025 +Node: Control Letters283595 +Node: Format Modifiers287578 +Node: Printf Examples293587 +Node: Redirection296073 +Node: Special FD302914 +Ref: Special FD-Footnote-1306074 +Node: Special Files306148 +Node: Other Inherited Files306765 +Node: Special Network307765 +Node: Special Caveats308627 +Node: Close Files And Pipes309578 +Ref: Close Files And Pipes-Footnote-1316760 +Ref: Close Files And Pipes-Footnote-2316908 +Node: Output Summary317058 +Node: Output Exercises318056 +Node: Expressions318736 +Node: Values319921 +Node: Constants320599 +Node: Scalar Constants321290 +Ref: Scalar Constants-Footnote-1322149 +Node: Nondecimal-numbers322399 +Node: Regexp Constants325417 +Node: Using Constant Regexps325942 +Node: Variables329085 +Node: Using Variables329740 +Node: Assignment Options331651 +Node: Conversion333526 +Node: Strings And Numbers334050 +Ref: Strings And Numbers-Footnote-1337115 +Node: Locale influences conversions337224 +Ref: table-locale-affects339971 +Node: All Operators340559 +Node: Arithmetic Ops341189 +Node: Concatenation343694 +Ref: Concatenation-Footnote-1346513 +Node: Assignment Ops346619 +Ref: table-assign-ops351598 +Node: Increment Ops352870 +Node: Truth Values and Conditions356308 +Node: Truth Values357393 +Node: Typing and Comparison358442 +Node: Variable Typing359252 +Node: Comparison Operators362905 +Ref: table-relational-ops363315 +Node: POSIX String Comparison366810 +Ref: POSIX String Comparison-Footnote-1367882 +Node: Boolean Ops368020 +Ref: Boolean Ops-Footnote-1372499 +Node: Conditional Exp372590 +Node: Function Calls374317 +Node: Precedence378197 +Node: Locales381858 +Node: Expressions Summary383490 +Node: Patterns and Actions386050 +Node: Pattern Overview387170 +Node: Regexp Patterns388849 +Node: Expression Patterns389392 +Node: Ranges393102 +Node: BEGIN/END396208 +Node: Using BEGIN/END396969 +Ref: Using BEGIN/END-Footnote-1399703 +Node: I/O And BEGIN/END399809 +Node: BEGINFILE/ENDFILE402123 +Node: Empty405024 +Node: Using Shell Variables405341 +Node: Action Overview407614 +Node: Statements409940 +Node: If Statement411788 +Node: While Statement413283 +Node: Do Statement415312 +Node: For Statement416456 +Node: Switch Statement419613 +Node: Break Statement421995 +Node: Continue Statement424036 +Node: Next Statement425863 +Node: Nextfile Statement428244 +Node: Exit Statement430874 +Node: Built-in Variables433277 +Node: User-modified434410 +Ref: User-modified-Footnote-1442091 +Node: Auto-set442153 +Ref: Auto-set-Footnote-1456365 +Ref: Auto-set-Footnote-2456570 +Node: ARGC and ARGV456626 +Node: Pattern Action Summary460844 +Node: Arrays463271 +Node: Array Basics464600 +Node: Array Intro465444 +Ref: figure-array-elements467408 +Ref: Array Intro-Footnote-1469934 +Node: Reference to Elements470062 +Node: Assigning Elements472514 +Node: Array Example473005 +Node: Scanning an Array474763 +Node: Controlling Scanning477779 +Ref: Controlling Scanning-Footnote-1482975 +Node: Numeric Array Subscripts483291 +Node: Uninitialized Subscripts485476 +Node: Delete487093 +Ref: Delete-Footnote-1489836 +Node: Multidimensional489893 +Node: Multiscanning492990 +Node: Arrays of Arrays494579 +Node: Arrays Summary499338 +Node: Functions501430 +Node: Built-in502329 +Node: Calling Built-in503407 +Node: Numeric Functions505398 +Ref: Numeric Functions-Footnote-1510217 +Ref: Numeric Functions-Footnote-2510574 +Ref: Numeric Functions-Footnote-3510622 +Node: String Functions510894 +Ref: String Functions-Footnote-1534369 +Ref: String Functions-Footnote-2534498 +Ref: String Functions-Footnote-3534746 +Node: Gory Details534833 +Ref: table-sub-escapes536614 +Ref: table-sub-proposed538134 +Ref: table-posix-sub539498 +Ref: table-gensub-escapes541034 +Ref: Gory Details-Footnote-1541866 +Node: I/O Functions542017 +Ref: I/O Functions-Footnote-1549235 +Node: Time Functions549382 +Ref: Time Functions-Footnote-1559870 +Ref: Time Functions-Footnote-2559938 +Ref: Time Functions-Footnote-3560096 +Ref: Time Functions-Footnote-4560207 +Ref: Time Functions-Footnote-5560319 +Ref: Time Functions-Footnote-6560546 +Node: Bitwise Functions560812 +Ref: table-bitwise-ops561374 +Ref: Bitwise Functions-Footnote-1565683 +Node: Type Functions565852 +Node: I18N Functions567003 +Node: User-defined568648 +Node: Definition Syntax569453 +Ref: Definition Syntax-Footnote-1574860 +Node: Function Example574931 +Ref: Function Example-Footnote-1577850 +Node: Function Caveats577872 +Node: Calling A Function578390 +Node: Variable Scope579348 +Node: Pass By Value/Reference582336 +Node: Return Statement585831 +Node: Dynamic Typing588812 +Node: Indirect Calls589741 +Ref: Indirect Calls-Footnote-1601043 +Node: Functions Summary601171 +Node: Library Functions603873 +Ref: Library Functions-Footnote-1607482 +Ref: Library Functions-Footnote-2607625 +Node: Library Names607796 +Ref: Library Names-Footnote-1611250 +Ref: Library Names-Footnote-2611473 +Node: General Functions611559 +Node: Strtonum Function612662 +Node: Assert Function615684 +Node: Round Function619008 +Node: Cliff Random Function620549 +Node: Ordinal Functions621565 +Ref: Ordinal Functions-Footnote-1624628 +Ref: Ordinal Functions-Footnote-2624880 +Node: Join Function625091 +Ref: Join Function-Footnote-1626860 +Node: Getlocaltime Function627060 +Node: Readfile Function630804 +Node: Shell Quoting632774 +Node: Data File Management634175 +Node: Filetrans Function634807 +Node: Rewind Function638863 +Node: File Checking640250 +Ref: File Checking-Footnote-1641582 +Node: Empty Files641783 +Node: Ignoring Assigns643762 +Node: Getopt Function645313 +Ref: Getopt Function-Footnote-1656775 +Node: Passwd Functions656975 +Ref: Passwd Functions-Footnote-1665812 +Node: Group Functions665900 +Ref: Group Functions-Footnote-1673794 +Node: Walking Arrays674007 +Node: Library Functions Summary675610 +Node: Library Exercises677011 +Node: Sample Programs678291 +Node: Running Examples679061 +Node: Clones679789 +Node: Cut Program681013 +Node: Egrep Program690732 +Ref: Egrep Program-Footnote-1698230 +Node: Id Program698340 +Node: Split Program701985 +Ref: Split Program-Footnote-1705433 +Node: Tee Program705561 +Node: Uniq Program708350 +Node: Wc Program715769 +Ref: Wc Program-Footnote-1720019 +Node: Miscellaneous Programs720113 +Node: Dupword Program721326 +Node: Alarm Program723357 +Node: Translate Program728161 +Ref: Translate Program-Footnote-1732726 +Node: Labels Program732996 +Ref: Labels Program-Footnote-1736347 +Node: Word Sorting736431 +Node: History Sorting740502 +Node: Extract Program742338 +Node: Simple Sed749863 +Node: Igawk Program752931 +Ref: Igawk Program-Footnote-1767255 +Ref: Igawk Program-Footnote-2767456 +Ref: Igawk Program-Footnote-3767578 +Node: Anagram Program767693 +Node: Signature Program770750 +Node: Programs Summary771997 +Node: Programs Exercises773190 +Ref: Programs Exercises-Footnote-1777321 +Node: Advanced Features777412 +Node: Nondecimal Data779360 +Node: Array Sorting780950 +Node: Controlling Array Traversal781647 +Ref: Controlling Array Traversal-Footnote-1789980 +Node: Array Sorting Functions790098 +Ref: Array Sorting Functions-Footnote-1793987 +Node: Two-way I/O794183 +Ref: Two-way I/O-Footnote-1799128 +Ref: Two-way I/O-Footnote-2799314 +Node: TCP/IP Networking799396 +Node: Profiling802269 +Node: Advanced Features Summary810546 +Node: Internationalization812479 +Node: I18N and L10N813959 +Node: Explaining gettext814645 +Ref: Explaining gettext-Footnote-1819670 +Ref: Explaining gettext-Footnote-2819854 +Node: Programmer i18n820019 +Ref: Programmer i18n-Footnote-1824885 +Node: Translator i18n824934 +Node: String Extraction825728 +Ref: String Extraction-Footnote-1826859 +Node: Printf Ordering826945 +Ref: Printf Ordering-Footnote-1829731 +Node: I18N Portability829795 +Ref: I18N Portability-Footnote-1832250 +Node: I18N Example832313 +Ref: I18N Example-Footnote-1835116 +Node: Gawk I18N835188 +Node: I18N Summary835826 +Node: Debugger837165 +Node: Debugging838187 +Node: Debugging Concepts838628 +Node: Debugging Terms840481 +Node: Awk Debugging843053 +Node: Sample Debugging Session843947 +Node: Debugger Invocation844467 +Node: Finding The Bug845851 +Node: List of Debugger Commands852326 +Node: Breakpoint Control853659 +Node: Debugger Execution Control857355 +Node: Viewing And Changing Data860719 +Node: Execution Stack864097 +Node: Debugger Info865734 +Node: Miscellaneous Debugger Commands869751 +Node: Readline Support874780 +Node: Limitations875672 +Node: Debugging Summary877786 +Node: Arbitrary Precision Arithmetic878954 +Node: Computer Arithmetic880370 +Ref: table-numeric-ranges883968 +Ref: Computer Arithmetic-Footnote-1884827 +Node: Math Definitions884884 +Ref: table-ieee-formats888172 +Ref: Math Definitions-Footnote-1888776 +Node: MPFR features888881 +Node: FP Math Caution890552 +Ref: FP Math Caution-Footnote-1891602 +Node: Inexactness of computations891971 +Node: Inexact representation892930 +Node: Comparing FP Values894287 +Node: Errors accumulate895369 +Node: Getting Accuracy896802 +Node: Try To Round899464 +Node: Setting precision900363 +Ref: table-predefined-precision-strings901047 +Node: Setting the rounding mode902836 +Ref: table-gawk-rounding-modes903200 +Ref: Setting the rounding mode-Footnote-1906655 +Node: Arbitrary Precision Integers906834 +Ref: Arbitrary Precision Integers-Footnote-1911733 +Node: POSIX Floating Point Problems911882 +Ref: POSIX Floating Point Problems-Footnote-1915755 +Node: Floating point summary915793 +Node: Dynamic Extensions917987 +Node: Extension Intro919539 +Node: Plugin License920805 +Node: Extension Mechanism Outline921602 +Ref: figure-load-extension922030 +Ref: figure-register-new-function923510 +Ref: figure-call-new-function924514 +Node: Extension API Description926500 +Node: Extension API Functions Introduction928034 +Node: General Data Types932906 +Ref: General Data Types-Footnote-1938645 +Node: Memory Allocation Functions938944 +Ref: Memory Allocation Functions-Footnote-1941783 +Node: Constructor Functions941879 +Node: Registration Functions943613 +Node: Extension Functions944298 +Node: Exit Callback Functions946595 +Node: Extension Version String947843 +Node: Input Parsers948508 +Node: Output Wrappers958387 +Node: Two-way processors962902 +Node: Printing Messages965106 +Ref: Printing Messages-Footnote-1966182 +Node: Updating `ERRNO'966334 +Node: Requesting Values967074 +Ref: table-value-types-returned967802 +Node: Accessing Parameters968759 +Node: Symbol Table Access969990 +Node: Symbol table by name970504 +Node: Symbol table by cookie972485 +Ref: Symbol table by cookie-Footnote-1976629 +Node: Cached values976692 +Ref: Cached values-Footnote-1980191 +Node: Array Manipulation980282 +Ref: Array Manipulation-Footnote-1981372 +Node: Array Data Types981409 +Ref: Array Data Types-Footnote-1984064 +Node: Array Functions984156 +Node: Flattening Arrays988010 +Node: Creating Arrays994902 +Node: Redirection API999673 +Node: Extension API Variables1001869 +Node: Extension Versioning1002502 +Node: Extension API Informational Variables1004403 +Node: Extension API Boilerplate1005468 +Node: Finding Extensions1009277 +Node: Extension Example1009837 +Node: Internal File Description1010609 +Node: Internal File Ops1014676 +Ref: Internal File Ops-Footnote-11026346 +Node: Using Internal File Ops1026486 +Ref: Using Internal File Ops-Footnote-11028869 +Node: Extension Samples1029142 +Node: Extension Sample File Functions1030668 +Node: Extension Sample Fnmatch1038306 +Node: Extension Sample Fork1039797 +Node: Extension Sample Inplace1041012 +Node: Extension Sample Ord1042687 +Node: Extension Sample Readdir1043523 +Ref: table-readdir-file-types1044399 +Node: Extension Sample Revout1045210 +Node: Extension Sample Rev2way1045800 +Node: Extension Sample Read write array1046540 +Node: Extension Sample Readfile1048480 +Node: Extension Sample Time1049575 +Node: Extension Sample API Tests1050924 +Node: gawkextlib1051415 +Node: Extension summary1054073 +Node: Extension Exercises1057762 +Node: Language History1058484 +Node: V7/SVR3.11060140 +Node: SVR41062321 +Node: POSIX1063766 +Node: BTL1065155 +Node: POSIX/GNU1065889 +Node: Feature History1071513 +Node: Common Extensions1084611 +Node: Ranges and Locales1085935 +Ref: Ranges and Locales-Footnote-11090553 +Ref: Ranges and Locales-Footnote-21090580 +Ref: Ranges and Locales-Footnote-31090814 +Node: Contributors1091035 +Node: History summary1096576 +Node: Installation1097946 +Node: Gawk Distribution1098892 +Node: Getting1099376 +Node: Extracting1100199 +Node: Distribution contents1101834 +Node: Unix Installation1107899 +Node: Quick Installation1108582 +Node: Shell Startup Files1110993 +Node: Additional Configuration Options1112072 +Node: Configuration Philosophy1113811 +Node: Non-Unix Installation1116180 +Node: PC Installation1116638 +Node: PC Binary Installation1117957 +Node: PC Compiling1119805 +Ref: PC Compiling-Footnote-11122826 +Node: PC Testing1122935 +Node: PC Using1124111 +Node: Cygwin1128226 +Node: MSYS1129049 +Node: VMS Installation1129549 +Node: VMS Compilation1130341 +Ref: VMS Compilation-Footnote-11131563 +Node: VMS Dynamic Extensions1131621 +Node: VMS Installation Details1133305 +Node: VMS Running1135557 +Node: VMS GNV1138393 +Node: VMS Old Gawk1139127 +Node: Bugs1139597 +Node: Other Versions1143480 +Node: Installation summary1149908 +Node: Notes1150964 +Node: Compatibility Mode1151829 +Node: Additions1152611 +Node: Accessing The Source1153536 +Node: Adding Code1154972 +Node: New Ports1161137 +Node: Derived Files1165619 +Ref: Derived Files-Footnote-11171094 +Ref: Derived Files-Footnote-21171128 +Ref: Derived Files-Footnote-31171724 +Node: Future Extensions1171838 +Node: Implementation Limitations1172444 +Node: Extension Design1173692 +Node: Old Extension Problems1174846 +Ref: Old Extension Problems-Footnote-11176363 +Node: Extension New Mechanism Goals1176420 +Ref: Extension New Mechanism Goals-Footnote-11179780 +Node: Extension Other Design Decisions1179969 +Node: Extension Future Growth1182077 +Node: Old Extension Mechanism1182913 +Node: Notes summary1184675 +Node: Basic Concepts1185861 +Node: Basic High Level1186542 +Ref: figure-general-flow1186814 +Ref: figure-process-flow1187413 +Ref: Basic High Level-Footnote-11190642 +Node: Basic Data Typing1190827 +Node: Glossary1194155 +Node: Copying1219313 +Node: GNU Free Documentation License1256869 +Node: Index1282005  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index f0e17602..a222c23e 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -944,6 +944,7 @@ particular records in a file and perform operations upon them. * Array Functions:: Functions for working with arrays. * Flattening Arrays:: How to flatten arrays. * Creating Arrays:: How to create and populate arrays. +* Redirection API:: How to access and manipulate redirections. * Extension API Variables:: Variables provided by the API. * Extension Versioning:: API Version information. * Extension API Informational Variables:: Variables providing information about @@ -31779,6 +31780,7 @@ This (rather large) @value{SECTION} describes the API in detail. * Symbol Table Access:: Functions for accessing global variables. * Array Manipulation:: Functions for working with arrays. +* Redirection API:: How to access and manipulate redirections. * Extension API Variables:: Variables provided by the API. * Extension API Boilerplate:: Boilerplate code for using the API. @end menu @@ -31854,6 +31856,10 @@ Clearing an array @item Flattening an array for easy C style looping over all its indices and elements @end itemize + +@item +Accessing and manipulating redirections. + @end itemize Some points about using the API: @@ -33818,6 +33824,54 @@ $ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk} (@DBXREF{Finding Extensions} for more information on the @env{AWKLIBPATH} environment variable.) +@node Redirection API +@subsection Accessing and Manipulating Redirections + +The following function allows extensions to access and manipulate redirections. + +@table @code +@item awk_bool_t get_file(const char *name, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ size_t name_len, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const char *filetype, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ int fd, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_input_buf_t **ibufp, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_output_buf_t **obufp); +Look up a file in @command{gawk}'s internal redirection table. If @code{name} is NULL or @code{name_len} is 0, it returns +data for the currently open input file corresponding to @code{FILENAME} +(and it will not access the @code{filetype} argument, so that may be +undefined). +If the file is not already open, it tries to open it. +The @code{filetype} argument must be NUL-terminated and should be one of: +@table @code +@item > +A file opened for output. +@item >> +A file opened for append. +@item < +A file opened for input. +@item |> +A pipe opened for output. +@item |< +A pipe opened for input. +@item |& +A two-way coprocess. +@end table +If the file is not already open, and the fd argument is non-negative, +@command{gawk} will use that file descriptor instead of opening the file +in the usual way. If the fd is non-negative, but the file exists +already, @command{gawk} ignores the fd and returns the existing file. It is +the caller's responsibility to notice that neither the fd in the returned +@code{awk_input_buf_t} nor the fd in the returned @code{awk_output_buf_t} matches the requested value. Note that +supplying a file descriptor is currently NOT supported for pipes. +It should work for input, output, append, and two-way (coprocess) +sockets. If @code{filetype} is two-way, we assume that it is a socket! +Note that in the two-way case, the input and output file descriptors +may differ. To check for success, one must check whether either matches. +@end table + +For example, this API function can be used to implement I/O multiplexing or a +socket library. + @node Extension API Variables @subsection API Variables diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 638bb909..706512f9 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -939,6 +939,7 @@ particular records in a file and perform operations upon them. * Array Functions:: Functions for working with arrays. * Flattening Arrays:: How to flatten arrays. * Creating Arrays:: How to create and populate arrays. +* Redirection API:: How to access and manipulate redirections. * Extension API Variables:: Variables provided by the API. * Extension Versioning:: API Version information. * Extension API Informational Variables:: Variables providing information about @@ -30872,6 +30873,7 @@ This (rather large) @value{SECTION} describes the API in detail. * Symbol Table Access:: Functions for accessing global variables. * Array Manipulation:: Functions for working with arrays. +* Redirection API:: How to access and manipulate redirections. * Extension API Variables:: Variables provided by the API. * Extension API Boilerplate:: Boilerplate code for using the API. @end menu @@ -30947,6 +30949,10 @@ Clearing an array @item Flattening an array for easy C style looping over all its indices and elements @end itemize + +@item +Accessing and manipulating redirections. + @end itemize Some points about using the API: @@ -32911,6 +32917,54 @@ $ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk} (@DBXREF{Finding Extensions} for more information on the @env{AWKLIBPATH} environment variable.) +@node Redirection API +@subsection Accessing and Manipulating Redirections + +The following function allows extensions to access and manipulate redirections. + +@table @code +@item awk_bool_t get_file(const char *name, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ size_t name_len, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const char *filetype, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ int fd, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_input_buf_t **ibufp, +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_output_buf_t **obufp); +Look up a file in @command{gawk}'s internal redirection table. If @code{name} is NULL or @code{name_len} is 0, it returns +data for the currently open input file corresponding to @code{FILENAME} +(and it will not access the @code{filetype} argument, so that may be +undefined). +If the file is not already open, it tries to open it. +The @code{filetype} argument must be NUL-terminated and should be one of: +@table @code +@item > +A file opened for output. +@item >> +A file opened for append. +@item < +A file opened for input. +@item |> +A pipe opened for output. +@item |< +A pipe opened for input. +@item |& +A two-way coprocess. +@end table +If the file is not already open, and the fd argument is non-negative, +@command{gawk} will use that file descriptor instead of opening the file +in the usual way. If the fd is non-negative, but the file exists +already, @command{gawk} ignores the fd and returns the existing file. It is +the caller's responsibility to notice that neither the fd in the returned +@code{awk_input_buf_t} nor the fd in the returned @code{awk_output_buf_t} matches the requested value. Note that +supplying a file descriptor is currently NOT supported for pipes. +It should work for input, output, append, and two-way (coprocess) +sockets. If @code{filetype} is two-way, we assume that it is a socket! +Note that in the two-way case, the input and output file descriptors +may differ. To check for success, one must check whether either matches. +@end table + +For example, this API function can be used to implement I/O multiplexing or a +socket library. + @node Extension API Variables @subsection API Variables diff --git a/gawkapi.h b/gawkapi.h index 6893fda0..cdf81cc8 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -692,7 +692,7 @@ typedef struct gawk_api { * supplying a file descriptor is currently NOT supported for pipes. * It should work for input, output, append, and two-way (coprocess) * sockets. If the filetype is two-way, we assume that it is a socket! - * Note that in the two-way case, the intput and output file descriptors + * Note that in the two-way case, the input and output file descriptors * may differ. To check for success, one must check that either of * them matches. */ -- cgit v1.2.3 From 0d867aa42ea8c3487678dcceea484c10c88914cb Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 5 Jan 2015 12:37:43 -0500 Subject: Fix bug in io.c:wait_any where we may not have waited for the requested child process exit status. --- ChangeLog | 7 +++++++ io.c | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index eb7555f2..f0c3dc4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-01-05 Andrew J. Schorr + + * io.c (wait_any): If the `interesting' argument is non-zero, then we + must not return until that child process has exited, since the caller + gawk_pclose depends on our returning its exit status. So in that case, + do not pass WNOHANG to waitpid. + 2015-01-04 Andrew J. Schorr * gawkapi.h: Fix another comment typo. diff --git a/io.c b/io.c index 6e6d1a1a..f849f839 100644 --- a/io.c +++ b/io.c @@ -2250,7 +2250,12 @@ wait_any(int interesting) /* pid of interest, if any */ #endif for (;;) { # if defined(HAVE_WAITPID) && defined(WNOHANG) - if ((pid = waitpid(-1, & status, WNOHANG)) == 0) + /* + * N.B. If the caller wants status for a specific child process + * (i.e. interesting is non-zero), then we must hang until we + * get exit status for that child. + */ + if ((pid = waitpid(-1, & status, (interesting ? 0 : WNOHANG))) == 0) /* No children have exited */ break; # elif defined(HAVE_SYS_WAIT_H) /* POSIX compatible sys/wait.h */ -- cgit v1.2.3 From 4323eba6170c7aee1661d834a9b7c177a10b7764 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 5 Jan 2015 13:07:47 -0500 Subject: Add new errno test to make sure PROCINFO["errno"] is working. --- test/ChangeLog | 7 +++++++ test/Makefile.am | 10 +++++++++- test/errno.awk | 10 ++++++++++ test/errno.in | 3 +++ test/errno.ok | 3 +++ 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test/errno.awk create mode 100644 test/errno.in create mode 100644 test/errno.ok diff --git a/test/ChangeLog b/test/ChangeLog index 7ff3e422..49b26843 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2015-01-05 Andrew J. Schorr + + * Makefile.am (EXTRA_DIST): Add errno.awk, errno.in, and errno.ok. + (BASIC_TESTS): Add errno. + (errno): New test. + * errno.awk, errno.in, errno.ok: New files. + 2014-12-24 Arnold D. Robbins * Makefile.am (badbuild): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 7335da32..0feaebc5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -208,6 +208,9 @@ EXTRA_DIST = \ dynlj.ok \ eofsplit.awk \ eofsplit.ok \ + errno.awk \ + errno.in \ + errno.ok \ exit.ok \ exit.sh \ exit2.awk \ @@ -983,7 +986,7 @@ BASIC_TESTS = \ childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ - eofsplit exit2 exitval1 exitval2 \ + eofsplit errno exit2 exitval1 exitval2 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ @@ -1310,6 +1313,11 @@ devfd:: @$(AWK) 1 /dev/fd/4 /dev/fd/5 4<"$(srcdir)"/devfd.in4 5<"$(srcdir)"/devfd.in5 >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +errno: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fflush:: @echo $@ @"$(srcdir)"/fflush.sh >_$@ diff --git a/test/errno.awk b/test/errno.awk new file mode 100644 index 00000000..bcb77614 --- /dev/null +++ b/test/errno.awk @@ -0,0 +1,10 @@ +BEGIN { + # check that PROCINFO["errno"] is working properly + getline + if (close(FILENAME)) { + print "Error `" ERRNO "' closing input file" + print "errno =", PROCINFO["errno"] + } + getline < (FILENAME "/bogus") + print (PROCINFO["errno"] > 0), ERRNO +} diff --git a/test/errno.in b/test/errno.in new file mode 100644 index 00000000..a92d664b --- /dev/null +++ b/test/errno.in @@ -0,0 +1,3 @@ +line 1 +line 2 +line 3 diff --git a/test/errno.ok b/test/errno.ok new file mode 100644 index 00000000..181afdaf --- /dev/null +++ b/test/errno.ok @@ -0,0 +1,3 @@ +Error `close of redirection that was never opened' closing input file +errno = 0 +1 Not a directory -- cgit v1.2.3 From e81b32fd38fb79595e7773670818f78e9a3e2df2 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 5 Jan 2015 13:45:40 -0500 Subject: In texinfo docs, replace "Retrying I/O" with more accurate "Retrying Input". --- doc/ChangeLog | 5 + doc/gawk.info | 1143 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 20 +- doc/gawktexi.in | 20 +- 4 files changed, 597 insertions(+), 591 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index de948bda..a995b66d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-05 Andrew J. Schorr + + * gawktexi.in: Replace "Retrying I/O" with "Retrying Input", since this + feature pertains to input, not output. + 2015-01-04 Andrew J. Schorr * gawktexi.in: Document the get_file API function. diff --git a/doc/gawk.info b/doc/gawk.info index 9513e5d6..60e0f6f9 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -217,7 +217,7 @@ entitled "GNU Free Documentation License". `getline'. * Getline Summary:: Summary of `getline' Variants. * Read Timeout:: Reading input with a timeout. -* Retrying I/O:: Retrying I/O after certain errors. +* Retrying Input:: Retrying input after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -4170,7 +4170,7 @@ have to be named on the `awk' command line (*note Getline::). * Getline:: Reading files under explicit program control using the `getline' function. * Read Timeout:: Reading input with a timeout. -* Retrying I/O:: Retrying I/O after certain errors. +* Retrying Input:: Retrying input after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -5445,7 +5445,7 @@ record, such as a file that cannot be opened, then `getline' returns describing the error that occurred. If the `errno' variable indicates that the I/O operation may be retried, and `PROCINFO["input", "RETRY"]' is set, then -2 will be returned instead of -1, and further calls to -`getline' may be attemped. *Note Retrying I/O::, for further +`getline' may be attemped. *Note Retrying Input::, for further information about this feature. In the following examples, COMMAND stands for a string value that @@ -5883,7 +5883,7 @@ VAR Table 4.1: `getline' variants and what they set  -File: gawk.info, Node: Read Timeout, Next: Retrying I/O, Prev: Getline, Up: Reading Files +File: gawk.info, Node: Read Timeout, Next: Retrying Input, Prev: Getline, Up: Reading Files 4.10 Reading Input with a Timeout ================================= @@ -5963,7 +5963,7 @@ a per command or connection basis. attempt to read from the underlying device may succeed in a later attempt. This is a limitation, and it also means that you cannot use this to multiplex input from two or more sources. *Note Retrying -I/O::, for a way to enable later I/O attempts to succeed. +Input::, for a way to enable later I/O attempts to succeed. Assigning a timeout value prevents read operations from blocking indefinitely. But bear in mind that there are other ways `gawk' can @@ -5978,10 +5978,10 @@ writing. (1) This assumes that standard input is the keyboard.  -File: gawk.info, Node: Retrying I/O, Next: Command-line directories, Prev: Read Timeout, Up: Reading Files +File: gawk.info, Node: Retrying Input, Next: Command-line directories, Prev: Read Timeout, Up: Reading Files -4.11 Retrying I/O on Certain Input Errors -========================================= +4.11 Retrying Reads After Certain Input Errors +============================================== This minor node describes a feature that is specific to `gawk'. @@ -6005,7 +6005,7 @@ EAGAIN, EWOULDBLOCK, EINTR, or ETIMEDOUT. configured to behave in a non-blocking fashion.  -File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Retrying I/O, Up: Reading Files +File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Retrying Input, Up: Reading Files 4.12 Directories on the Command Line ==================================== @@ -10565,9 +10565,9 @@ Options::), they are not special: open input file, pipe, or coprocess. *Note Read Timeout::, for more information. - * It may be used to indicate that I/O may be retried when it - fails due to certain errors. *Note Retrying I/O::, for more - information. + * It may be used to indicate that input may be retried when it + fails due to certain errors. *Note Retrying Input::, for + more information. * It may be used to cause coprocesses to communicate over pseudo-ttys instead of through two-way pipes; this is @@ -32580,7 +32580,8 @@ Index (line 43) * differences in awk and gawk, regular expressions: Case-sensitivity. (line 26) -* differences in awk and gawk, retrying I/O: Retrying I/O. (line 6) +* differences in awk and gawk, retrying input: Retrying Input. + (line 6) * differences in awk and gawk, RS/RT variables: gawk split records. (line 58) * differences in awk and gawk, RT variable: Auto-set. (line 292) @@ -33973,7 +33974,7 @@ Index * relational operators, See comparison operators: Typing and Comparison. (line 9) * replace in string: String Functions. (line 408) -* retrying I/O: Retrying I/O. (line 6) +* retrying input: Retrying Input. (line 6) * return debugger command: Debugger Execution Control. (line 54) * return statement, user-defined functions: Return Statement. (line 6) @@ -34562,562 +34563,562 @@ Index  Tag Table: Node: Top1204 -Node: Foreword342383 -Node: Foreword446825 -Node: Preface48347 -Ref: Preface-Footnote-151218 -Ref: Preface-Footnote-251325 -Ref: Preface-Footnote-351558 -Node: History51700 -Node: Names54046 -Ref: Names-Footnote-155140 -Node: This Manual55286 -Ref: This Manual-Footnote-161773 -Node: Conventions61873 -Node: Manual History64211 -Ref: Manual History-Footnote-167193 -Ref: Manual History-Footnote-267234 -Node: How To Contribute67308 -Node: Acknowledgments68437 -Node: Getting Started73242 -Node: Running gawk75675 -Node: One-shot76865 -Node: Read Terminal78113 -Node: Long80140 -Node: Executable Scripts81656 -Ref: Executable Scripts-Footnote-184445 -Node: Comments84548 -Node: Quoting87030 -Node: DOS Quoting92554 -Node: Sample Data Files93229 -Node: Very Simple95824 -Node: Two Rules100722 -Node: More Complex102608 -Node: Statements/Lines105470 -Ref: Statements/Lines-Footnote-1109925 -Node: Other Features110190 -Node: When111121 -Ref: When-Footnote-1112875 -Node: Intro Summary112940 -Node: Invoking Gawk113823 -Node: Command Line115337 -Node: Options116135 -Ref: Options-Footnote-1131939 -Ref: Options-Footnote-2132168 -Node: Other Arguments132193 -Node: Naming Standard Input135141 -Node: Environment Variables136234 -Node: AWKPATH Variable136792 -Ref: AWKPATH Variable-Footnote-1140205 -Ref: AWKPATH Variable-Footnote-2140250 -Node: AWKLIBPATH Variable140510 -Node: Other Environment Variables141766 -Node: Exit Status145254 -Node: Include Files145930 -Node: Loading Shared Libraries149527 -Node: Obsolete150954 -Node: Undocumented151651 -Node: Invoking Summary151918 -Node: Regexp153582 -Node: Regexp Usage155036 -Node: Escape Sequences157073 -Node: Regexp Operators163314 -Ref: Regexp Operators-Footnote-1170740 -Ref: Regexp Operators-Footnote-2170887 -Node: Bracket Expressions170985 -Ref: table-char-classes173000 -Node: Leftmost Longest175924 -Node: Computed Regexps177226 -Node: GNU Regexp Operators180623 -Node: Case-sensitivity184296 -Ref: Case-sensitivity-Footnote-1187181 -Ref: Case-sensitivity-Footnote-2187416 -Node: Regexp Summary187524 -Node: Reading Files188991 -Node: Records191152 -Node: awk split records191885 -Node: gawk split records196800 -Ref: gawk split records-Footnote-1201344 -Node: Fields201381 -Ref: Fields-Footnote-1204157 -Node: Nonconstant Fields204243 -Ref: Nonconstant Fields-Footnote-1206486 -Node: Changing Fields206690 -Node: Field Separators212619 -Node: Default Field Splitting215324 -Node: Regexp Field Splitting216441 -Node: Single Character Fields219791 -Node: Command Line Field Separator220850 -Node: Full Line Fields224062 -Ref: Full Line Fields-Footnote-1225579 -Ref: Full Line Fields-Footnote-2225625 -Node: Field Splitting Summary225726 -Node: Constant Size227800 -Node: Splitting By Content232389 -Ref: Splitting By Content-Footnote-1236383 -Node: Multiple Line236546 -Ref: Multiple Line-Footnote-1242432 -Node: Getline242611 -Node: Plain Getline245093 -Node: Getline/Variable247733 -Node: Getline/File248881 -Node: Getline/Variable/File250265 -Ref: Getline/Variable/File-Footnote-1251868 -Node: Getline/Pipe251955 -Node: Getline/Variable/Pipe254638 -Node: Getline/Coprocess255769 -Node: Getline/Variable/Coprocess257021 -Node: Getline Notes257760 -Node: Getline Summary260552 -Ref: table-getline-variants260964 -Node: Read Timeout261793 -Ref: Read Timeout-Footnote-1265680 -Node: Retrying I/O265738 -Node: Command-line directories266921 -Node: Input Summary267826 -Node: Input Exercises271127 -Node: Printing271855 -Node: Print273632 -Node: Print Examples275089 -Node: Output Separators277868 -Node: OFMT279886 -Node: Printf281240 -Node: Basic Printf282025 -Node: Control Letters283595 -Node: Format Modifiers287578 -Node: Printf Examples293587 -Node: Redirection296073 -Node: Special FD302914 -Ref: Special FD-Footnote-1306074 -Node: Special Files306148 -Node: Other Inherited Files306765 -Node: Special Network307765 -Node: Special Caveats308627 -Node: Close Files And Pipes309578 -Ref: Close Files And Pipes-Footnote-1316760 -Ref: Close Files And Pipes-Footnote-2316908 -Node: Output Summary317058 -Node: Output Exercises318056 -Node: Expressions318736 -Node: Values319921 -Node: Constants320599 -Node: Scalar Constants321290 -Ref: Scalar Constants-Footnote-1322149 -Node: Nondecimal-numbers322399 -Node: Regexp Constants325417 -Node: Using Constant Regexps325942 -Node: Variables329085 -Node: Using Variables329740 -Node: Assignment Options331651 -Node: Conversion333526 -Node: Strings And Numbers334050 -Ref: Strings And Numbers-Footnote-1337115 -Node: Locale influences conversions337224 -Ref: table-locale-affects339971 -Node: All Operators340559 -Node: Arithmetic Ops341189 -Node: Concatenation343694 -Ref: Concatenation-Footnote-1346513 -Node: Assignment Ops346619 -Ref: table-assign-ops351598 -Node: Increment Ops352870 -Node: Truth Values and Conditions356308 -Node: Truth Values357393 -Node: Typing and Comparison358442 -Node: Variable Typing359252 -Node: Comparison Operators362905 -Ref: table-relational-ops363315 -Node: POSIX String Comparison366810 -Ref: POSIX String Comparison-Footnote-1367882 -Node: Boolean Ops368020 -Ref: Boolean Ops-Footnote-1372499 -Node: Conditional Exp372590 -Node: Function Calls374317 -Node: Precedence378197 -Node: Locales381858 -Node: Expressions Summary383490 -Node: Patterns and Actions386050 -Node: Pattern Overview387170 -Node: Regexp Patterns388849 -Node: Expression Patterns389392 -Node: Ranges393102 -Node: BEGIN/END396208 -Node: Using BEGIN/END396969 -Ref: Using BEGIN/END-Footnote-1399703 -Node: I/O And BEGIN/END399809 -Node: BEGINFILE/ENDFILE402123 -Node: Empty405024 -Node: Using Shell Variables405341 -Node: Action Overview407614 -Node: Statements409940 -Node: If Statement411788 -Node: While Statement413283 -Node: Do Statement415312 -Node: For Statement416456 -Node: Switch Statement419613 -Node: Break Statement421995 -Node: Continue Statement424036 -Node: Next Statement425863 -Node: Nextfile Statement428244 -Node: Exit Statement430874 -Node: Built-in Variables433277 -Node: User-modified434410 -Ref: User-modified-Footnote-1442091 -Node: Auto-set442153 -Ref: Auto-set-Footnote-1456365 -Ref: Auto-set-Footnote-2456570 -Node: ARGC and ARGV456626 -Node: Pattern Action Summary460844 -Node: Arrays463271 -Node: Array Basics464600 -Node: Array Intro465444 -Ref: figure-array-elements467408 -Ref: Array Intro-Footnote-1469934 -Node: Reference to Elements470062 -Node: Assigning Elements472514 -Node: Array Example473005 -Node: Scanning an Array474763 -Node: Controlling Scanning477779 -Ref: Controlling Scanning-Footnote-1482975 -Node: Numeric Array Subscripts483291 -Node: Uninitialized Subscripts485476 -Node: Delete487093 -Ref: Delete-Footnote-1489836 -Node: Multidimensional489893 -Node: Multiscanning492990 -Node: Arrays of Arrays494579 -Node: Arrays Summary499338 -Node: Functions501430 -Node: Built-in502329 -Node: Calling Built-in503407 -Node: Numeric Functions505398 -Ref: Numeric Functions-Footnote-1510217 -Ref: Numeric Functions-Footnote-2510574 -Ref: Numeric Functions-Footnote-3510622 -Node: String Functions510894 -Ref: String Functions-Footnote-1534369 -Ref: String Functions-Footnote-2534498 -Ref: String Functions-Footnote-3534746 -Node: Gory Details534833 -Ref: table-sub-escapes536614 -Ref: table-sub-proposed538134 -Ref: table-posix-sub539498 -Ref: table-gensub-escapes541034 -Ref: Gory Details-Footnote-1541866 -Node: I/O Functions542017 -Ref: I/O Functions-Footnote-1549235 -Node: Time Functions549382 -Ref: Time Functions-Footnote-1559870 -Ref: Time Functions-Footnote-2559938 -Ref: Time Functions-Footnote-3560096 -Ref: Time Functions-Footnote-4560207 -Ref: Time Functions-Footnote-5560319 -Ref: Time Functions-Footnote-6560546 -Node: Bitwise Functions560812 -Ref: table-bitwise-ops561374 -Ref: Bitwise Functions-Footnote-1565683 -Node: Type Functions565852 -Node: I18N Functions567003 -Node: User-defined568648 -Node: Definition Syntax569453 -Ref: Definition Syntax-Footnote-1574860 -Node: Function Example574931 -Ref: Function Example-Footnote-1577850 -Node: Function Caveats577872 -Node: Calling A Function578390 -Node: Variable Scope579348 -Node: Pass By Value/Reference582336 -Node: Return Statement585831 -Node: Dynamic Typing588812 -Node: Indirect Calls589741 -Ref: Indirect Calls-Footnote-1601043 -Node: Functions Summary601171 -Node: Library Functions603873 -Ref: Library Functions-Footnote-1607482 -Ref: Library Functions-Footnote-2607625 -Node: Library Names607796 -Ref: Library Names-Footnote-1611250 -Ref: Library Names-Footnote-2611473 -Node: General Functions611559 -Node: Strtonum Function612662 -Node: Assert Function615684 -Node: Round Function619008 -Node: Cliff Random Function620549 -Node: Ordinal Functions621565 -Ref: Ordinal Functions-Footnote-1624628 -Ref: Ordinal Functions-Footnote-2624880 -Node: Join Function625091 -Ref: Join Function-Footnote-1626860 -Node: Getlocaltime Function627060 -Node: Readfile Function630804 -Node: Shell Quoting632774 -Node: Data File Management634175 -Node: Filetrans Function634807 -Node: Rewind Function638863 -Node: File Checking640250 -Ref: File Checking-Footnote-1641582 -Node: Empty Files641783 -Node: Ignoring Assigns643762 -Node: Getopt Function645313 -Ref: Getopt Function-Footnote-1656775 -Node: Passwd Functions656975 -Ref: Passwd Functions-Footnote-1665812 -Node: Group Functions665900 -Ref: Group Functions-Footnote-1673794 -Node: Walking Arrays674007 -Node: Library Functions Summary675610 -Node: Library Exercises677011 -Node: Sample Programs678291 -Node: Running Examples679061 -Node: Clones679789 -Node: Cut Program681013 -Node: Egrep Program690732 -Ref: Egrep Program-Footnote-1698230 -Node: Id Program698340 -Node: Split Program701985 -Ref: Split Program-Footnote-1705433 -Node: Tee Program705561 -Node: Uniq Program708350 -Node: Wc Program715769 -Ref: Wc Program-Footnote-1720019 -Node: Miscellaneous Programs720113 -Node: Dupword Program721326 -Node: Alarm Program723357 -Node: Translate Program728161 -Ref: Translate Program-Footnote-1732726 -Node: Labels Program732996 -Ref: Labels Program-Footnote-1736347 -Node: Word Sorting736431 -Node: History Sorting740502 -Node: Extract Program742338 -Node: Simple Sed749863 -Node: Igawk Program752931 -Ref: Igawk Program-Footnote-1767255 -Ref: Igawk Program-Footnote-2767456 -Ref: Igawk Program-Footnote-3767578 -Node: Anagram Program767693 -Node: Signature Program770750 -Node: Programs Summary771997 -Node: Programs Exercises773190 -Ref: Programs Exercises-Footnote-1777321 -Node: Advanced Features777412 -Node: Nondecimal Data779360 -Node: Array Sorting780950 -Node: Controlling Array Traversal781647 -Ref: Controlling Array Traversal-Footnote-1789980 -Node: Array Sorting Functions790098 -Ref: Array Sorting Functions-Footnote-1793987 -Node: Two-way I/O794183 -Ref: Two-way I/O-Footnote-1799128 -Ref: Two-way I/O-Footnote-2799314 -Node: TCP/IP Networking799396 -Node: Profiling802269 -Node: Advanced Features Summary810546 -Node: Internationalization812479 -Node: I18N and L10N813959 -Node: Explaining gettext814645 -Ref: Explaining gettext-Footnote-1819670 -Ref: Explaining gettext-Footnote-2819854 -Node: Programmer i18n820019 -Ref: Programmer i18n-Footnote-1824885 -Node: Translator i18n824934 -Node: String Extraction825728 -Ref: String Extraction-Footnote-1826859 -Node: Printf Ordering826945 -Ref: Printf Ordering-Footnote-1829731 -Node: I18N Portability829795 -Ref: I18N Portability-Footnote-1832250 -Node: I18N Example832313 -Ref: I18N Example-Footnote-1835116 -Node: Gawk I18N835188 -Node: I18N Summary835826 -Node: Debugger837165 -Node: Debugging838187 -Node: Debugging Concepts838628 -Node: Debugging Terms840481 -Node: Awk Debugging843053 -Node: Sample Debugging Session843947 -Node: Debugger Invocation844467 -Node: Finding The Bug845851 -Node: List of Debugger Commands852326 -Node: Breakpoint Control853659 -Node: Debugger Execution Control857355 -Node: Viewing And Changing Data860719 -Node: Execution Stack864097 -Node: Debugger Info865734 -Node: Miscellaneous Debugger Commands869751 -Node: Readline Support874780 -Node: Limitations875672 -Node: Debugging Summary877786 -Node: Arbitrary Precision Arithmetic878954 -Node: Computer Arithmetic880370 -Ref: table-numeric-ranges883968 -Ref: Computer Arithmetic-Footnote-1884827 -Node: Math Definitions884884 -Ref: table-ieee-formats888172 -Ref: Math Definitions-Footnote-1888776 -Node: MPFR features888881 -Node: FP Math Caution890552 -Ref: FP Math Caution-Footnote-1891602 -Node: Inexactness of computations891971 -Node: Inexact representation892930 -Node: Comparing FP Values894287 -Node: Errors accumulate895369 -Node: Getting Accuracy896802 -Node: Try To Round899464 -Node: Setting precision900363 -Ref: table-predefined-precision-strings901047 -Node: Setting the rounding mode902836 -Ref: table-gawk-rounding-modes903200 -Ref: Setting the rounding mode-Footnote-1906655 -Node: Arbitrary Precision Integers906834 -Ref: Arbitrary Precision Integers-Footnote-1911733 -Node: POSIX Floating Point Problems911882 -Ref: POSIX Floating Point Problems-Footnote-1915755 -Node: Floating point summary915793 -Node: Dynamic Extensions917987 -Node: Extension Intro919539 -Node: Plugin License920805 -Node: Extension Mechanism Outline921602 -Ref: figure-load-extension922030 -Ref: figure-register-new-function923510 -Ref: figure-call-new-function924514 -Node: Extension API Description926500 -Node: Extension API Functions Introduction928034 -Node: General Data Types932906 -Ref: General Data Types-Footnote-1938645 -Node: Memory Allocation Functions938944 -Ref: Memory Allocation Functions-Footnote-1941783 -Node: Constructor Functions941879 -Node: Registration Functions943613 -Node: Extension Functions944298 -Node: Exit Callback Functions946595 -Node: Extension Version String947843 -Node: Input Parsers948508 -Node: Output Wrappers958387 -Node: Two-way processors962902 -Node: Printing Messages965106 -Ref: Printing Messages-Footnote-1966182 -Node: Updating `ERRNO'966334 -Node: Requesting Values967074 -Ref: table-value-types-returned967802 -Node: Accessing Parameters968759 -Node: Symbol Table Access969990 -Node: Symbol table by name970504 -Node: Symbol table by cookie972485 -Ref: Symbol table by cookie-Footnote-1976629 -Node: Cached values976692 -Ref: Cached values-Footnote-1980191 -Node: Array Manipulation980282 -Ref: Array Manipulation-Footnote-1981372 -Node: Array Data Types981409 -Ref: Array Data Types-Footnote-1984064 -Node: Array Functions984156 -Node: Flattening Arrays988010 -Node: Creating Arrays994902 -Node: Redirection API999673 -Node: Extension API Variables1001869 -Node: Extension Versioning1002502 -Node: Extension API Informational Variables1004403 -Node: Extension API Boilerplate1005468 -Node: Finding Extensions1009277 -Node: Extension Example1009837 -Node: Internal File Description1010609 -Node: Internal File Ops1014676 -Ref: Internal File Ops-Footnote-11026346 -Node: Using Internal File Ops1026486 -Ref: Using Internal File Ops-Footnote-11028869 -Node: Extension Samples1029142 -Node: Extension Sample File Functions1030668 -Node: Extension Sample Fnmatch1038306 -Node: Extension Sample Fork1039797 -Node: Extension Sample Inplace1041012 -Node: Extension Sample Ord1042687 -Node: Extension Sample Readdir1043523 -Ref: table-readdir-file-types1044399 -Node: Extension Sample Revout1045210 -Node: Extension Sample Rev2way1045800 -Node: Extension Sample Read write array1046540 -Node: Extension Sample Readfile1048480 -Node: Extension Sample Time1049575 -Node: Extension Sample API Tests1050924 -Node: gawkextlib1051415 -Node: Extension summary1054073 -Node: Extension Exercises1057762 -Node: Language History1058484 -Node: V7/SVR3.11060140 -Node: SVR41062321 -Node: POSIX1063766 -Node: BTL1065155 -Node: POSIX/GNU1065889 -Node: Feature History1071513 -Node: Common Extensions1084611 -Node: Ranges and Locales1085935 -Ref: Ranges and Locales-Footnote-11090553 -Ref: Ranges and Locales-Footnote-21090580 -Ref: Ranges and Locales-Footnote-31090814 -Node: Contributors1091035 -Node: History summary1096576 -Node: Installation1097946 -Node: Gawk Distribution1098892 -Node: Getting1099376 -Node: Extracting1100199 -Node: Distribution contents1101834 -Node: Unix Installation1107899 -Node: Quick Installation1108582 -Node: Shell Startup Files1110993 -Node: Additional Configuration Options1112072 -Node: Configuration Philosophy1113811 -Node: Non-Unix Installation1116180 -Node: PC Installation1116638 -Node: PC Binary Installation1117957 -Node: PC Compiling1119805 -Ref: PC Compiling-Footnote-11122826 -Node: PC Testing1122935 -Node: PC Using1124111 -Node: Cygwin1128226 -Node: MSYS1129049 -Node: VMS Installation1129549 -Node: VMS Compilation1130341 -Ref: VMS Compilation-Footnote-11131563 -Node: VMS Dynamic Extensions1131621 -Node: VMS Installation Details1133305 -Node: VMS Running1135557 -Node: VMS GNV1138393 -Node: VMS Old Gawk1139127 -Node: Bugs1139597 -Node: Other Versions1143480 -Node: Installation summary1149908 -Node: Notes1150964 -Node: Compatibility Mode1151829 -Node: Additions1152611 -Node: Accessing The Source1153536 -Node: Adding Code1154972 -Node: New Ports1161137 -Node: Derived Files1165619 -Ref: Derived Files-Footnote-11171094 -Ref: Derived Files-Footnote-21171128 -Ref: Derived Files-Footnote-31171724 -Node: Future Extensions1171838 -Node: Implementation Limitations1172444 -Node: Extension Design1173692 -Node: Old Extension Problems1174846 -Ref: Old Extension Problems-Footnote-11176363 -Node: Extension New Mechanism Goals1176420 -Ref: Extension New Mechanism Goals-Footnote-11179780 -Node: Extension Other Design Decisions1179969 -Node: Extension Future Growth1182077 -Node: Old Extension Mechanism1182913 -Node: Notes summary1184675 -Node: Basic Concepts1185861 -Node: Basic High Level1186542 -Ref: figure-general-flow1186814 -Ref: figure-process-flow1187413 -Ref: Basic High Level-Footnote-11190642 -Node: Basic Data Typing1190827 -Node: Glossary1194155 -Node: Copying1219313 -Node: GNU Free Documentation License1256869 -Node: Index1282005 +Node: Foreword342385 +Node: Foreword446827 +Node: Preface48349 +Ref: Preface-Footnote-151220 +Ref: Preface-Footnote-251327 +Ref: Preface-Footnote-351560 +Node: History51702 +Node: Names54048 +Ref: Names-Footnote-155142 +Node: This Manual55288 +Ref: This Manual-Footnote-161775 +Node: Conventions61875 +Node: Manual History64213 +Ref: Manual History-Footnote-167195 +Ref: Manual History-Footnote-267236 +Node: How To Contribute67310 +Node: Acknowledgments68439 +Node: Getting Started73244 +Node: Running gawk75677 +Node: One-shot76867 +Node: Read Terminal78115 +Node: Long80142 +Node: Executable Scripts81658 +Ref: Executable Scripts-Footnote-184447 +Node: Comments84550 +Node: Quoting87032 +Node: DOS Quoting92556 +Node: Sample Data Files93231 +Node: Very Simple95826 +Node: Two Rules100724 +Node: More Complex102610 +Node: Statements/Lines105472 +Ref: Statements/Lines-Footnote-1109927 +Node: Other Features110192 +Node: When111123 +Ref: When-Footnote-1112877 +Node: Intro Summary112942 +Node: Invoking Gawk113825 +Node: Command Line115339 +Node: Options116137 +Ref: Options-Footnote-1131941 +Ref: Options-Footnote-2132170 +Node: Other Arguments132195 +Node: Naming Standard Input135143 +Node: Environment Variables136236 +Node: AWKPATH Variable136794 +Ref: AWKPATH Variable-Footnote-1140207 +Ref: AWKPATH Variable-Footnote-2140252 +Node: AWKLIBPATH Variable140512 +Node: Other Environment Variables141768 +Node: Exit Status145256 +Node: Include Files145932 +Node: Loading Shared Libraries149529 +Node: Obsolete150956 +Node: Undocumented151653 +Node: Invoking Summary151920 +Node: Regexp153584 +Node: Regexp Usage155038 +Node: Escape Sequences157075 +Node: Regexp Operators163316 +Ref: Regexp Operators-Footnote-1170742 +Ref: Regexp Operators-Footnote-2170889 +Node: Bracket Expressions170987 +Ref: table-char-classes173002 +Node: Leftmost Longest175926 +Node: Computed Regexps177228 +Node: GNU Regexp Operators180625 +Node: Case-sensitivity184298 +Ref: Case-sensitivity-Footnote-1187183 +Ref: Case-sensitivity-Footnote-2187418 +Node: Regexp Summary187526 +Node: Reading Files188993 +Node: Records191156 +Node: awk split records191889 +Node: gawk split records196804 +Ref: gawk split records-Footnote-1201348 +Node: Fields201385 +Ref: Fields-Footnote-1204161 +Node: Nonconstant Fields204247 +Ref: Nonconstant Fields-Footnote-1206490 +Node: Changing Fields206694 +Node: Field Separators212623 +Node: Default Field Splitting215328 +Node: Regexp Field Splitting216445 +Node: Single Character Fields219795 +Node: Command Line Field Separator220854 +Node: Full Line Fields224066 +Ref: Full Line Fields-Footnote-1225583 +Ref: Full Line Fields-Footnote-2225629 +Node: Field Splitting Summary225730 +Node: Constant Size227804 +Node: Splitting By Content232393 +Ref: Splitting By Content-Footnote-1236387 +Node: Multiple Line236550 +Ref: Multiple Line-Footnote-1242436 +Node: Getline242615 +Node: Plain Getline245099 +Node: Getline/Variable247739 +Node: Getline/File248887 +Node: Getline/Variable/File250271 +Ref: Getline/Variable/File-Footnote-1251874 +Node: Getline/Pipe251961 +Node: Getline/Variable/Pipe254644 +Node: Getline/Coprocess255775 +Node: Getline/Variable/Coprocess257027 +Node: Getline Notes257766 +Node: Getline Summary260558 +Ref: table-getline-variants260970 +Node: Read Timeout261799 +Ref: Read Timeout-Footnote-1265690 +Node: Retrying Input265748 +Node: Command-line directories266943 +Node: Input Summary267850 +Node: Input Exercises271151 +Node: Printing271879 +Node: Print273656 +Node: Print Examples275113 +Node: Output Separators277892 +Node: OFMT279910 +Node: Printf281264 +Node: Basic Printf282049 +Node: Control Letters283619 +Node: Format Modifiers287602 +Node: Printf Examples293611 +Node: Redirection296097 +Node: Special FD302938 +Ref: Special FD-Footnote-1306098 +Node: Special Files306172 +Node: Other Inherited Files306789 +Node: Special Network307789 +Node: Special Caveats308651 +Node: Close Files And Pipes309602 +Ref: Close Files And Pipes-Footnote-1316784 +Ref: Close Files And Pipes-Footnote-2316932 +Node: Output Summary317082 +Node: Output Exercises318080 +Node: Expressions318760 +Node: Values319945 +Node: Constants320623 +Node: Scalar Constants321314 +Ref: Scalar Constants-Footnote-1322173 +Node: Nondecimal-numbers322423 +Node: Regexp Constants325441 +Node: Using Constant Regexps325966 +Node: Variables329109 +Node: Using Variables329764 +Node: Assignment Options331675 +Node: Conversion333550 +Node: Strings And Numbers334074 +Ref: Strings And Numbers-Footnote-1337139 +Node: Locale influences conversions337248 +Ref: table-locale-affects339995 +Node: All Operators340583 +Node: Arithmetic Ops341213 +Node: Concatenation343718 +Ref: Concatenation-Footnote-1346537 +Node: Assignment Ops346643 +Ref: table-assign-ops351622 +Node: Increment Ops352894 +Node: Truth Values and Conditions356332 +Node: Truth Values357417 +Node: Typing and Comparison358466 +Node: Variable Typing359276 +Node: Comparison Operators362929 +Ref: table-relational-ops363339 +Node: POSIX String Comparison366834 +Ref: POSIX String Comparison-Footnote-1367906 +Node: Boolean Ops368044 +Ref: Boolean Ops-Footnote-1372523 +Node: Conditional Exp372614 +Node: Function Calls374341 +Node: Precedence378221 +Node: Locales381882 +Node: Expressions Summary383514 +Node: Patterns and Actions386074 +Node: Pattern Overview387194 +Node: Regexp Patterns388873 +Node: Expression Patterns389416 +Node: Ranges393126 +Node: BEGIN/END396232 +Node: Using BEGIN/END396993 +Ref: Using BEGIN/END-Footnote-1399727 +Node: I/O And BEGIN/END399833 +Node: BEGINFILE/ENDFILE402147 +Node: Empty405048 +Node: Using Shell Variables405365 +Node: Action Overview407638 +Node: Statements409964 +Node: If Statement411812 +Node: While Statement413307 +Node: Do Statement415336 +Node: For Statement416480 +Node: Switch Statement419637 +Node: Break Statement422019 +Node: Continue Statement424060 +Node: Next Statement425887 +Node: Nextfile Statement428268 +Node: Exit Statement430898 +Node: Built-in Variables433301 +Node: User-modified434434 +Ref: User-modified-Footnote-1442115 +Node: Auto-set442177 +Ref: Auto-set-Footnote-1456393 +Ref: Auto-set-Footnote-2456598 +Node: ARGC and ARGV456654 +Node: Pattern Action Summary460872 +Node: Arrays463299 +Node: Array Basics464628 +Node: Array Intro465472 +Ref: figure-array-elements467436 +Ref: Array Intro-Footnote-1469962 +Node: Reference to Elements470090 +Node: Assigning Elements472542 +Node: Array Example473033 +Node: Scanning an Array474791 +Node: Controlling Scanning477807 +Ref: Controlling Scanning-Footnote-1483003 +Node: Numeric Array Subscripts483319 +Node: Uninitialized Subscripts485504 +Node: Delete487121 +Ref: Delete-Footnote-1489864 +Node: Multidimensional489921 +Node: Multiscanning493018 +Node: Arrays of Arrays494607 +Node: Arrays Summary499366 +Node: Functions501458 +Node: Built-in502357 +Node: Calling Built-in503435 +Node: Numeric Functions505426 +Ref: Numeric Functions-Footnote-1510245 +Ref: Numeric Functions-Footnote-2510602 +Ref: Numeric Functions-Footnote-3510650 +Node: String Functions510922 +Ref: String Functions-Footnote-1534397 +Ref: String Functions-Footnote-2534526 +Ref: String Functions-Footnote-3534774 +Node: Gory Details534861 +Ref: table-sub-escapes536642 +Ref: table-sub-proposed538162 +Ref: table-posix-sub539526 +Ref: table-gensub-escapes541062 +Ref: Gory Details-Footnote-1541894 +Node: I/O Functions542045 +Ref: I/O Functions-Footnote-1549263 +Node: Time Functions549410 +Ref: Time Functions-Footnote-1559898 +Ref: Time Functions-Footnote-2559966 +Ref: Time Functions-Footnote-3560124 +Ref: Time Functions-Footnote-4560235 +Ref: Time Functions-Footnote-5560347 +Ref: Time Functions-Footnote-6560574 +Node: Bitwise Functions560840 +Ref: table-bitwise-ops561402 +Ref: Bitwise Functions-Footnote-1565711 +Node: Type Functions565880 +Node: I18N Functions567031 +Node: User-defined568676 +Node: Definition Syntax569481 +Ref: Definition Syntax-Footnote-1574888 +Node: Function Example574959 +Ref: Function Example-Footnote-1577878 +Node: Function Caveats577900 +Node: Calling A Function578418 +Node: Variable Scope579376 +Node: Pass By Value/Reference582364 +Node: Return Statement585859 +Node: Dynamic Typing588840 +Node: Indirect Calls589769 +Ref: Indirect Calls-Footnote-1601071 +Node: Functions Summary601199 +Node: Library Functions603901 +Ref: Library Functions-Footnote-1607510 +Ref: Library Functions-Footnote-2607653 +Node: Library Names607824 +Ref: Library Names-Footnote-1611278 +Ref: Library Names-Footnote-2611501 +Node: General Functions611587 +Node: Strtonum Function612690 +Node: Assert Function615712 +Node: Round Function619036 +Node: Cliff Random Function620577 +Node: Ordinal Functions621593 +Ref: Ordinal Functions-Footnote-1624656 +Ref: Ordinal Functions-Footnote-2624908 +Node: Join Function625119 +Ref: Join Function-Footnote-1626888 +Node: Getlocaltime Function627088 +Node: Readfile Function630832 +Node: Shell Quoting632802 +Node: Data File Management634203 +Node: Filetrans Function634835 +Node: Rewind Function638891 +Node: File Checking640278 +Ref: File Checking-Footnote-1641610 +Node: Empty Files641811 +Node: Ignoring Assigns643790 +Node: Getopt Function645341 +Ref: Getopt Function-Footnote-1656803 +Node: Passwd Functions657003 +Ref: Passwd Functions-Footnote-1665840 +Node: Group Functions665928 +Ref: Group Functions-Footnote-1673822 +Node: Walking Arrays674035 +Node: Library Functions Summary675638 +Node: Library Exercises677039 +Node: Sample Programs678319 +Node: Running Examples679089 +Node: Clones679817 +Node: Cut Program681041 +Node: Egrep Program690760 +Ref: Egrep Program-Footnote-1698258 +Node: Id Program698368 +Node: Split Program702013 +Ref: Split Program-Footnote-1705461 +Node: Tee Program705589 +Node: Uniq Program708378 +Node: Wc Program715797 +Ref: Wc Program-Footnote-1720047 +Node: Miscellaneous Programs720141 +Node: Dupword Program721354 +Node: Alarm Program723385 +Node: Translate Program728189 +Ref: Translate Program-Footnote-1732754 +Node: Labels Program733024 +Ref: Labels Program-Footnote-1736375 +Node: Word Sorting736459 +Node: History Sorting740530 +Node: Extract Program742366 +Node: Simple Sed749891 +Node: Igawk Program752959 +Ref: Igawk Program-Footnote-1767283 +Ref: Igawk Program-Footnote-2767484 +Ref: Igawk Program-Footnote-3767606 +Node: Anagram Program767721 +Node: Signature Program770778 +Node: Programs Summary772025 +Node: Programs Exercises773218 +Ref: Programs Exercises-Footnote-1777349 +Node: Advanced Features777440 +Node: Nondecimal Data779388 +Node: Array Sorting780978 +Node: Controlling Array Traversal781675 +Ref: Controlling Array Traversal-Footnote-1790008 +Node: Array Sorting Functions790126 +Ref: Array Sorting Functions-Footnote-1794015 +Node: Two-way I/O794211 +Ref: Two-way I/O-Footnote-1799156 +Ref: Two-way I/O-Footnote-2799342 +Node: TCP/IP Networking799424 +Node: Profiling802297 +Node: Advanced Features Summary810574 +Node: Internationalization812507 +Node: I18N and L10N813987 +Node: Explaining gettext814673 +Ref: Explaining gettext-Footnote-1819698 +Ref: Explaining gettext-Footnote-2819882 +Node: Programmer i18n820047 +Ref: Programmer i18n-Footnote-1824913 +Node: Translator i18n824962 +Node: String Extraction825756 +Ref: String Extraction-Footnote-1826887 +Node: Printf Ordering826973 +Ref: Printf Ordering-Footnote-1829759 +Node: I18N Portability829823 +Ref: I18N Portability-Footnote-1832278 +Node: I18N Example832341 +Ref: I18N Example-Footnote-1835144 +Node: Gawk I18N835216 +Node: I18N Summary835854 +Node: Debugger837193 +Node: Debugging838215 +Node: Debugging Concepts838656 +Node: Debugging Terms840509 +Node: Awk Debugging843081 +Node: Sample Debugging Session843975 +Node: Debugger Invocation844495 +Node: Finding The Bug845879 +Node: List of Debugger Commands852354 +Node: Breakpoint Control853687 +Node: Debugger Execution Control857383 +Node: Viewing And Changing Data860747 +Node: Execution Stack864125 +Node: Debugger Info865762 +Node: Miscellaneous Debugger Commands869779 +Node: Readline Support874808 +Node: Limitations875700 +Node: Debugging Summary877814 +Node: Arbitrary Precision Arithmetic878982 +Node: Computer Arithmetic880398 +Ref: table-numeric-ranges883996 +Ref: Computer Arithmetic-Footnote-1884855 +Node: Math Definitions884912 +Ref: table-ieee-formats888200 +Ref: Math Definitions-Footnote-1888804 +Node: MPFR features888909 +Node: FP Math Caution890580 +Ref: FP Math Caution-Footnote-1891630 +Node: Inexactness of computations891999 +Node: Inexact representation892958 +Node: Comparing FP Values894315 +Node: Errors accumulate895397 +Node: Getting Accuracy896830 +Node: Try To Round899492 +Node: Setting precision900391 +Ref: table-predefined-precision-strings901075 +Node: Setting the rounding mode902864 +Ref: table-gawk-rounding-modes903228 +Ref: Setting the rounding mode-Footnote-1906683 +Node: Arbitrary Precision Integers906862 +Ref: Arbitrary Precision Integers-Footnote-1911761 +Node: POSIX Floating Point Problems911910 +Ref: POSIX Floating Point Problems-Footnote-1915783 +Node: Floating point summary915821 +Node: Dynamic Extensions918015 +Node: Extension Intro919567 +Node: Plugin License920833 +Node: Extension Mechanism Outline921630 +Ref: figure-load-extension922058 +Ref: figure-register-new-function923538 +Ref: figure-call-new-function924542 +Node: Extension API Description926528 +Node: Extension API Functions Introduction928062 +Node: General Data Types932934 +Ref: General Data Types-Footnote-1938673 +Node: Memory Allocation Functions938972 +Ref: Memory Allocation Functions-Footnote-1941811 +Node: Constructor Functions941907 +Node: Registration Functions943641 +Node: Extension Functions944326 +Node: Exit Callback Functions946623 +Node: Extension Version String947871 +Node: Input Parsers948536 +Node: Output Wrappers958415 +Node: Two-way processors962930 +Node: Printing Messages965134 +Ref: Printing Messages-Footnote-1966210 +Node: Updating `ERRNO'966362 +Node: Requesting Values967102 +Ref: table-value-types-returned967830 +Node: Accessing Parameters968787 +Node: Symbol Table Access970018 +Node: Symbol table by name970532 +Node: Symbol table by cookie972513 +Ref: Symbol table by cookie-Footnote-1976657 +Node: Cached values976720 +Ref: Cached values-Footnote-1980219 +Node: Array Manipulation980310 +Ref: Array Manipulation-Footnote-1981400 +Node: Array Data Types981437 +Ref: Array Data Types-Footnote-1984092 +Node: Array Functions984184 +Node: Flattening Arrays988038 +Node: Creating Arrays994930 +Node: Redirection API999701 +Node: Extension API Variables1001897 +Node: Extension Versioning1002530 +Node: Extension API Informational Variables1004431 +Node: Extension API Boilerplate1005496 +Node: Finding Extensions1009305 +Node: Extension Example1009865 +Node: Internal File Description1010637 +Node: Internal File Ops1014704 +Ref: Internal File Ops-Footnote-11026374 +Node: Using Internal File Ops1026514 +Ref: Using Internal File Ops-Footnote-11028897 +Node: Extension Samples1029170 +Node: Extension Sample File Functions1030696 +Node: Extension Sample Fnmatch1038334 +Node: Extension Sample Fork1039825 +Node: Extension Sample Inplace1041040 +Node: Extension Sample Ord1042715 +Node: Extension Sample Readdir1043551 +Ref: table-readdir-file-types1044427 +Node: Extension Sample Revout1045238 +Node: Extension Sample Rev2way1045828 +Node: Extension Sample Read write array1046568 +Node: Extension Sample Readfile1048508 +Node: Extension Sample Time1049603 +Node: Extension Sample API Tests1050952 +Node: gawkextlib1051443 +Node: Extension summary1054101 +Node: Extension Exercises1057790 +Node: Language History1058512 +Node: V7/SVR3.11060168 +Node: SVR41062349 +Node: POSIX1063794 +Node: BTL1065183 +Node: POSIX/GNU1065917 +Node: Feature History1071541 +Node: Common Extensions1084639 +Node: Ranges and Locales1085963 +Ref: Ranges and Locales-Footnote-11090581 +Ref: Ranges and Locales-Footnote-21090608 +Ref: Ranges and Locales-Footnote-31090842 +Node: Contributors1091063 +Node: History summary1096604 +Node: Installation1097974 +Node: Gawk Distribution1098920 +Node: Getting1099404 +Node: Extracting1100227 +Node: Distribution contents1101862 +Node: Unix Installation1107927 +Node: Quick Installation1108610 +Node: Shell Startup Files1111021 +Node: Additional Configuration Options1112100 +Node: Configuration Philosophy1113839 +Node: Non-Unix Installation1116208 +Node: PC Installation1116666 +Node: PC Binary Installation1117985 +Node: PC Compiling1119833 +Ref: PC Compiling-Footnote-11122854 +Node: PC Testing1122963 +Node: PC Using1124139 +Node: Cygwin1128254 +Node: MSYS1129077 +Node: VMS Installation1129577 +Node: VMS Compilation1130369 +Ref: VMS Compilation-Footnote-11131591 +Node: VMS Dynamic Extensions1131649 +Node: VMS Installation Details1133333 +Node: VMS Running1135585 +Node: VMS GNV1138421 +Node: VMS Old Gawk1139155 +Node: Bugs1139625 +Node: Other Versions1143508 +Node: Installation summary1149936 +Node: Notes1150992 +Node: Compatibility Mode1151857 +Node: Additions1152639 +Node: Accessing The Source1153564 +Node: Adding Code1155000 +Node: New Ports1161165 +Node: Derived Files1165647 +Ref: Derived Files-Footnote-11171122 +Ref: Derived Files-Footnote-21171156 +Ref: Derived Files-Footnote-31171752 +Node: Future Extensions1171866 +Node: Implementation Limitations1172472 +Node: Extension Design1173720 +Node: Old Extension Problems1174874 +Ref: Old Extension Problems-Footnote-11176391 +Node: Extension New Mechanism Goals1176448 +Ref: Extension New Mechanism Goals-Footnote-11179808 +Node: Extension Other Design Decisions1179997 +Node: Extension Future Growth1182105 +Node: Old Extension Mechanism1182941 +Node: Notes summary1184703 +Node: Basic Concepts1185889 +Node: Basic High Level1186570 +Ref: figure-general-flow1186842 +Ref: figure-process-flow1187441 +Ref: Basic High Level-Footnote-11190670 +Node: Basic Data Typing1190855 +Node: Glossary1194183 +Node: Copying1219341 +Node: GNU Free Documentation License1256897 +Node: Index1282033  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index a222c23e..dc9087ba 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -603,7 +603,7 @@ particular records in a file and perform operations upon them. @code{getline}. * Getline Summary:: Summary of @code{getline} Variants. * Read Timeout:: Reading input with a timeout. -* Retrying I/O:: Retrying I/O after certain errors. +* Retrying Input:: Retrying input after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -6337,7 +6337,7 @@ used with it do not have to be named on the @command{awk} command line * Getline:: Reading files under explicit program control using the @code{getline} function. * Read Timeout:: Reading input with a timeout. -* Retrying I/O:: Retrying I/O after certain errors. +* Retrying Input:: Retrying input after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -8148,7 +8148,7 @@ returns @minus{}1. In this case, @command{gawk} sets the variable If the @code{errno} variable indicates that the I/O operation may be retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2 will be returned instead of @minus{}1, and further calls to @code{getline} -may be attemped. @DBXREF{Retrying I/O} for further information about +may be attemped. @DBXREF{Retrying Input} for further information about this feature. In the following examples, @var{command} stands for a string value that @@ -8802,7 +8802,7 @@ on a per command or connection basis. the attempt to read from the underlying device may succeed in a later attempt. This is a limitation, and it also means that you cannot use this to multiplex input from -two or more sources. @DBXREF{Retrying I/O} for a way to enable +two or more sources. @DBXREF{Retrying Input} for a way to enable later I/O attempts to succeed. Assigning a timeout value prevents read operations from @@ -8813,11 +8813,11 @@ a connection before it can start reading any data, or the attempt to open a FIFO special file for reading can block indefinitely until some other process opens it for writing. -@node Retrying I/O -@section Retrying I/O on Certain Input Errors -@cindex retrying I/O +@node Retrying Input +@section Retrying Reads After Certain Input Errors +@cindex retrying input -@cindex differences in @command{awk} and @command{gawk}, retrying I/O +@cindex differences in @command{awk} and @command{gawk}, retrying input This @value{SECTION} describes a feature that is specific to @command{gawk}. When @command{gawk} encounters an error while reading input, it will by default @@ -15196,9 +15196,9 @@ open input file, pipe, or coprocess. @DBXREF{Read Timeout} for more information. @item -It may be used to indicate that I/O may be retried when it fails due to +It may be used to indicate that input may be retried when it fails due to certain errors. -@DBXREF{Retrying I/O} for more information. +@DBXREF{Retrying Input} for more information. @item It may be used to cause coprocesses to communicate over pseudo-ttys diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 706512f9..85a1d83c 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -598,7 +598,7 @@ particular records in a file and perform operations upon them. @code{getline}. * Getline Summary:: Summary of @code{getline} Variants. * Read Timeout:: Reading input with a timeout. -* Retrying I/O:: Retrying I/O after certain errors. +* Retrying Input:: Retrying input after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -6121,7 +6121,7 @@ used with it do not have to be named on the @command{awk} command line * Getline:: Reading files under explicit program control using the @code{getline} function. * Read Timeout:: Reading input with a timeout. -* Retrying I/O:: Retrying I/O after certain errors. +* Retrying Input:: Retrying input after certain errors. * Command-line directories:: What happens if you put a directory on the command line. * Input Summary:: Input summary. @@ -7749,7 +7749,7 @@ returns @minus{}1. In this case, @command{gawk} sets the variable If the @code{errno} variable indicates that the I/O operation may be retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2 will be returned instead of @minus{}1, and further calls to @code{getline} -may be attemped. @DBXREF{Retrying I/O} for further information about +may be attemped. @DBXREF{Retrying Input} for further information about this feature. In the following examples, @var{command} stands for a string value that @@ -8403,7 +8403,7 @@ on a per command or connection basis. the attempt to read from the underlying device may succeed in a later attempt. This is a limitation, and it also means that you cannot use this to multiplex input from -two or more sources. @DBXREF{Retrying I/O} for a way to enable +two or more sources. @DBXREF{Retrying Input} for a way to enable later I/O attempts to succeed. Assigning a timeout value prevents read operations from @@ -8414,11 +8414,11 @@ a connection before it can start reading any data, or the attempt to open a FIFO special file for reading can block indefinitely until some other process opens it for writing. -@node Retrying I/O -@section Retrying I/O on Certain Input Errors -@cindex retrying I/O +@node Retrying Input +@section Retrying Reads After Certain Input Errors +@cindex retrying input -@cindex differences in @command{awk} and @command{gawk}, retrying I/O +@cindex differences in @command{awk} and @command{gawk}, retrying input This @value{SECTION} describes a feature that is specific to @command{gawk}. When @command{gawk} encounters an error while reading input, it will by default @@ -14525,9 +14525,9 @@ open input file, pipe, or coprocess. @DBXREF{Read Timeout} for more information. @item -It may be used to indicate that I/O may be retried when it fails due to +It may be used to indicate that input may be retried when it fails due to certain errors. -@DBXREF{Retrying I/O} for more information. +@DBXREF{Retrying Input} for more information. @item It may be used to cause coprocesses to communicate over pseudo-ttys -- cgit v1.2.3 From 66c827a4607fa11c5c3d26eb8e3a4d63c2b05bef Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 5 Jan 2015 14:12:25 -0500 Subject: Add read timeout/retry test. --- test/ChangeLog | 7 +++++++ test/Makefile.am | 9 ++++++--- test/Makefile.in | 20 ++++++++++++++++++-- test/Maketests | 5 +++++ test/timeout.awk | 26 ++++++++++++++++++++++++++ test/timeout.ok | 12 ++++++++++++ 6 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 test/timeout.awk create mode 100644 test/timeout.ok diff --git a/test/ChangeLog b/test/ChangeLog index 49b26843..36dbfaa5 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2015-01-05 Andrew J. Schorr + + * Makefile.am (EXTRA_DIST): Add timeout.awk and timeout.ok. + (BASIC_TESTS): Remove errno. + (GAWK_EXT_TESTS): Add errno and timeout. + * timeout.awk, timeout.ok: New files. + 2015-01-05 Andrew J. Schorr * Makefile.am (EXTRA_DIST): Add errno.awk, errno.in, and errno.ok. diff --git a/test/Makefile.am b/test/Makefile.am index 0feaebc5..3ac9a691 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -923,6 +923,8 @@ EXTRA_DIST = \ testext.ok \ time.awk \ time.ok \ + timeout.awk \ + timeout.ok \ tradanch.awk \ tradanch.in \ tradanch.ok \ @@ -986,7 +988,7 @@ BASIC_TESTS = \ childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ - eofsplit errno exit2 exitval1 exitval2 \ + eofsplit exit2 exitval1 exitval2 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ @@ -1021,7 +1023,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars errno exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ @@ -1037,7 +1039,8 @@ GAWK_EXT_TESTS = \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ - symtab7 symtab8 symtab9 + symtab7 symtab8 symtab9 \ + timeout EXTRA_TESTS = inftest regtest diff --git a/test/Makefile.in b/test/Makefile.in index fa86fc7f..874a92de 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -455,6 +455,9 @@ EXTRA_DIST = \ dynlj.ok \ eofsplit.awk \ eofsplit.ok \ + errno.awk \ + errno.in \ + errno.ok \ exit.ok \ exit.sh \ exit2.awk \ @@ -1167,6 +1170,8 @@ EXTRA_DIST = \ testext.ok \ time.awk \ time.ok \ + timeout.awk \ + timeout.ok \ tradanch.awk \ tradanch.in \ tradanch.ok \ @@ -1264,7 +1269,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars errno exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ @@ -1280,7 +1285,8 @@ GAWK_EXT_TESTS = \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ - symtab7 symtab8 symtab9 + symtab7 symtab8 symtab9 \ + timeout EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht @@ -1736,6 +1742,11 @@ devfd:: @$(AWK) 1 /dev/fd/4 /dev/fd/5 4<"$(srcdir)"/devfd.in4 5<"$(srcdir)"/devfd.in5 >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +errno: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fflush:: @echo $@ @"$(srcdir)"/fflush.sh >_$@ @@ -3688,6 +3699,11 @@ symtab7: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +timeout: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + double1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index e1b92bf9..97f2ed52 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1257,6 +1257,11 @@ symtab7: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +timeout: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + double1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/timeout.awk b/test/timeout.awk new file mode 100644 index 00000000..ccf4537d --- /dev/null +++ b/test/timeout.awk @@ -0,0 +1,26 @@ +BEGIN { + cmd = "echo hello; sleep 1; echo goodbye" + + print "With timeouts" + PROCINFO[cmd, "READ_TIMEOUT"] = 300 + while ((rc = (cmd | getline x)) > 0) + print x + if (rc < 0) + print rc, (PROCINFO["errno"] != 0), (ERRNO != "") + print (close(cmd) != 0) + + PROCINFO[cmd, "RETRY"] + print "" + print "With timeouts and retries" + while (((rc = (cmd | getline x)) > 0) || (rc == -2)) { + if (rc > 0) { + print x + n = 0 + } + else + print ++n, "timed out; trying again" + } + if (rc < 0) + print rc, (PROCINFO["errno"] != 0), (ERRNO != "") + print (close(cmd) != 0) +} diff --git a/test/timeout.ok b/test/timeout.ok new file mode 100644 index 00000000..a388747b --- /dev/null +++ b/test/timeout.ok @@ -0,0 +1,12 @@ +With timeouts +hello +-1 1 1 +1 + +With timeouts and retries +hello +1 timed out; trying again +2 timed out; trying again +3 timed out; trying again +goodbye +0 -- cgit v1.2.3 From 4e952aea89bbfaecd12614f1249c830aff36c551 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 5 Jan 2015 14:37:56 -0500 Subject: Improve texinfo documentation of the get_file API function. --- doc/ChangeLog | 4 + doc/gawk.info | 246 +++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 12 ++- doc/gawktexi.in | 12 ++- 4 files changed, 151 insertions(+), 123 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index a995b66d..4a6fa085 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-01-05 Andrew J. Schorr + + * gawktexi.in: Improve get_file documentation. + 2015-01-05 Andrew J. Schorr * gawktexi.in: Replace "Retrying I/O" with "Retrying Input", since this diff --git a/doc/gawk.info b/doc/gawk.info index 60e0f6f9..f0a9d84d 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -24715,22 +24715,30 @@ redirections. `|&' A two-way coprocess. - If the file is not already open, and the fd argument is - non-negative, `gawk' will use that file descriptor instead of - opening the file in the usual way. If the fd is non-negative, but - the file exists already, `gawk' ignores the fd and returns the - existing file. It is the caller's responsibility to notice that - neither the fd in the returned `awk_input_buf_t' nor the fd in the - returned `awk_output_buf_t' matches the requested value. Note that - supplying a file descriptor is currently NOT supported for pipes. - It should work for input, output, append, and two-way (coprocess) - sockets. If `filetype' is two-way, we assume that it is a socket! - Note that in the two-way case, the input and output file - descriptors may differ. To check for success, one must check - whether either matches. - - For example, this API function can be used to implement I/O -multiplexing or a socket library. + On error, a `false' value is returned. Otherwise, the return + status is `true', and additional information about the redirection + is returned in the `ibufp' and `obufp' pointers. For input + redirections, the `*ibufp' value should be non-NULL, and `*obufp' + should be NULL. For output redirections, the `*obufp' value + should be non-NULL, and `*ibufp' should be NULL. For two-way + coprocesses, both values should be non-NULL. In the usual case, + the extension is interested in `(*ibufp)->fd' and/or + `fileno((*obufp)->fp)'. If the file is not already open, and the + fd argument is non-negative, `gawk' will use that file descriptor + instead of opening the file in the usual way. If the fd is + non-negative, but the file exists already, `gawk' ignores the fd + and returns the existing file. It is the caller's responsibility + to notice that neither the fd in the returned `awk_input_buf_t' + nor the fd in the returned `awk_output_buf_t' matches the + requested value. Note that supplying a file descriptor is + currently NOT supported for pipes. It should work for input, + output, append, and two-way (coprocess) sockets. If `filetype' is + two-way, we assume that it is a socket! Note that in the two-way + case, the input and output file descriptors may differ. To check + for success, one must check whether either matches. + + It is anticipated that this API function will be used to implement +I/O multiplexing and a socket library.  File: gawk.info, Node: Extension API Variables, Next: Extension API Boilerplate, Prev: Redirection API, Up: Extension API Description @@ -35017,108 +35025,108 @@ Node: Array Functions984184 Node: Flattening Arrays988038 Node: Creating Arrays994930 Node: Redirection API999701 -Node: Extension API Variables1001897 -Node: Extension Versioning1002530 -Node: Extension API Informational Variables1004431 -Node: Extension API Boilerplate1005496 -Node: Finding Extensions1009305 -Node: Extension Example1009865 -Node: Internal File Description1010637 -Node: Internal File Ops1014704 -Ref: Internal File Ops-Footnote-11026374 -Node: Using Internal File Ops1026514 -Ref: Using Internal File Ops-Footnote-11028897 -Node: Extension Samples1029170 -Node: Extension Sample File Functions1030696 -Node: Extension Sample Fnmatch1038334 -Node: Extension Sample Fork1039825 -Node: Extension Sample Inplace1041040 -Node: Extension Sample Ord1042715 -Node: Extension Sample Readdir1043551 -Ref: table-readdir-file-types1044427 -Node: Extension Sample Revout1045238 -Node: Extension Sample Rev2way1045828 -Node: Extension Sample Read write array1046568 -Node: Extension Sample Readfile1048508 -Node: Extension Sample Time1049603 -Node: Extension Sample API Tests1050952 -Node: gawkextlib1051443 -Node: Extension summary1054101 -Node: Extension Exercises1057790 -Node: Language History1058512 -Node: V7/SVR3.11060168 -Node: SVR41062349 -Node: POSIX1063794 -Node: BTL1065183 -Node: POSIX/GNU1065917 -Node: Feature History1071541 -Node: Common Extensions1084639 -Node: Ranges and Locales1085963 -Ref: Ranges and Locales-Footnote-11090581 -Ref: Ranges and Locales-Footnote-21090608 -Ref: Ranges and Locales-Footnote-31090842 -Node: Contributors1091063 -Node: History summary1096604 -Node: Installation1097974 -Node: Gawk Distribution1098920 -Node: Getting1099404 -Node: Extracting1100227 -Node: Distribution contents1101862 -Node: Unix Installation1107927 -Node: Quick Installation1108610 -Node: Shell Startup Files1111021 -Node: Additional Configuration Options1112100 -Node: Configuration Philosophy1113839 -Node: Non-Unix Installation1116208 -Node: PC Installation1116666 -Node: PC Binary Installation1117985 -Node: PC Compiling1119833 -Ref: PC Compiling-Footnote-11122854 -Node: PC Testing1122963 -Node: PC Using1124139 -Node: Cygwin1128254 -Node: MSYS1129077 -Node: VMS Installation1129577 -Node: VMS Compilation1130369 -Ref: VMS Compilation-Footnote-11131591 -Node: VMS Dynamic Extensions1131649 -Node: VMS Installation Details1133333 -Node: VMS Running1135585 -Node: VMS GNV1138421 -Node: VMS Old Gawk1139155 -Node: Bugs1139625 -Node: Other Versions1143508 -Node: Installation summary1149936 -Node: Notes1150992 -Node: Compatibility Mode1151857 -Node: Additions1152639 -Node: Accessing The Source1153564 -Node: Adding Code1155000 -Node: New Ports1161165 -Node: Derived Files1165647 -Ref: Derived Files-Footnote-11171122 -Ref: Derived Files-Footnote-21171156 -Ref: Derived Files-Footnote-31171752 -Node: Future Extensions1171866 -Node: Implementation Limitations1172472 -Node: Extension Design1173720 -Node: Old Extension Problems1174874 -Ref: Old Extension Problems-Footnote-11176391 -Node: Extension New Mechanism Goals1176448 -Ref: Extension New Mechanism Goals-Footnote-11179808 -Node: Extension Other Design Decisions1179997 -Node: Extension Future Growth1182105 -Node: Old Extension Mechanism1182941 -Node: Notes summary1184703 -Node: Basic Concepts1185889 -Node: Basic High Level1186570 -Ref: figure-general-flow1186842 -Ref: figure-process-flow1187441 -Ref: Basic High Level-Footnote-11190670 -Node: Basic Data Typing1190855 -Node: Glossary1194183 -Node: Copying1219341 -Node: GNU Free Documentation License1256897 -Node: Index1282033 +Node: Extension API Variables1002472 +Node: Extension Versioning1003105 +Node: Extension API Informational Variables1005006 +Node: Extension API Boilerplate1006071 +Node: Finding Extensions1009880 +Node: Extension Example1010440 +Node: Internal File Description1011212 +Node: Internal File Ops1015279 +Ref: Internal File Ops-Footnote-11026949 +Node: Using Internal File Ops1027089 +Ref: Using Internal File Ops-Footnote-11029472 +Node: Extension Samples1029745 +Node: Extension Sample File Functions1031271 +Node: Extension Sample Fnmatch1038909 +Node: Extension Sample Fork1040400 +Node: Extension Sample Inplace1041615 +Node: Extension Sample Ord1043290 +Node: Extension Sample Readdir1044126 +Ref: table-readdir-file-types1045002 +Node: Extension Sample Revout1045813 +Node: Extension Sample Rev2way1046403 +Node: Extension Sample Read write array1047143 +Node: Extension Sample Readfile1049083 +Node: Extension Sample Time1050178 +Node: Extension Sample API Tests1051527 +Node: gawkextlib1052018 +Node: Extension summary1054676 +Node: Extension Exercises1058365 +Node: Language History1059087 +Node: V7/SVR3.11060743 +Node: SVR41062924 +Node: POSIX1064369 +Node: BTL1065758 +Node: POSIX/GNU1066492 +Node: Feature History1072116 +Node: Common Extensions1085214 +Node: Ranges and Locales1086538 +Ref: Ranges and Locales-Footnote-11091156 +Ref: Ranges and Locales-Footnote-21091183 +Ref: Ranges and Locales-Footnote-31091417 +Node: Contributors1091638 +Node: History summary1097179 +Node: Installation1098549 +Node: Gawk Distribution1099495 +Node: Getting1099979 +Node: Extracting1100802 +Node: Distribution contents1102437 +Node: Unix Installation1108502 +Node: Quick Installation1109185 +Node: Shell Startup Files1111596 +Node: Additional Configuration Options1112675 +Node: Configuration Philosophy1114414 +Node: Non-Unix Installation1116783 +Node: PC Installation1117241 +Node: PC Binary Installation1118560 +Node: PC Compiling1120408 +Ref: PC Compiling-Footnote-11123429 +Node: PC Testing1123538 +Node: PC Using1124714 +Node: Cygwin1128829 +Node: MSYS1129652 +Node: VMS Installation1130152 +Node: VMS Compilation1130944 +Ref: VMS Compilation-Footnote-11132166 +Node: VMS Dynamic Extensions1132224 +Node: VMS Installation Details1133908 +Node: VMS Running1136160 +Node: VMS GNV1138996 +Node: VMS Old Gawk1139730 +Node: Bugs1140200 +Node: Other Versions1144083 +Node: Installation summary1150511 +Node: Notes1151567 +Node: Compatibility Mode1152432 +Node: Additions1153214 +Node: Accessing The Source1154139 +Node: Adding Code1155575 +Node: New Ports1161740 +Node: Derived Files1166222 +Ref: Derived Files-Footnote-11171697 +Ref: Derived Files-Footnote-21171731 +Ref: Derived Files-Footnote-31172327 +Node: Future Extensions1172441 +Node: Implementation Limitations1173047 +Node: Extension Design1174295 +Node: Old Extension Problems1175449 +Ref: Old Extension Problems-Footnote-11176966 +Node: Extension New Mechanism Goals1177023 +Ref: Extension New Mechanism Goals-Footnote-11180383 +Node: Extension Other Design Decisions1180572 +Node: Extension Future Growth1182680 +Node: Old Extension Mechanism1183516 +Node: Notes summary1185278 +Node: Basic Concepts1186464 +Node: Basic High Level1187145 +Ref: figure-general-flow1187417 +Ref: figure-process-flow1188016 +Ref: Basic High Level-Footnote-11191245 +Node: Basic Data Typing1191430 +Node: Glossary1194758 +Node: Copying1219916 +Node: GNU Free Documentation License1257472 +Node: Index1282608  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index dc9087ba..7c346a3a 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -33856,6 +33856,14 @@ A pipe opened for input. @item |& A two-way coprocess. @end table +On error, a @code{false} value is returned. Otherwise, the return status +is @code{true}, and additional information about the redirection is +returned in the @code{ibufp} and @code{obufp} pointers. For input redirections, +the @code{*ibufp} value should be non-NULL, and @code{*obufp} should be NULL. +For output redirections, +the @code{*obufp} value should be non-NULL, and @code{*ibufp} should be NULL. +For two-way coprocesses, both values should be non-NULL. In the usual case, +the extension is interested in @code{(*ibufp)->fd} and/or @code{fileno((*obufp)->fp)}. If the file is not already open, and the fd argument is non-negative, @command{gawk} will use that file descriptor instead of opening the file in the usual way. If the fd is non-negative, but the file exists @@ -33869,8 +33877,8 @@ Note that in the two-way case, the input and output file descriptors may differ. To check for success, one must check whether either matches. @end table -For example, this API function can be used to implement I/O multiplexing or a -socket library. +It is anticipated that this API function will be used to implement I/O +multiplexing and a socket library. @node Extension API Variables @subsection API Variables diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 85a1d83c..385874a7 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -32949,6 +32949,14 @@ A pipe opened for input. @item |& A two-way coprocess. @end table +On error, a @code{false} value is returned. Otherwise, the return status +is @code{true}, and additional information about the redirection is +returned in the @code{ibufp} and @code{obufp} pointers. For input redirections, +the @code{*ibufp} value should be non-NULL, and @code{*obufp} should be NULL. +For output redirections, +the @code{*obufp} value should be non-NULL, and @code{*ibufp} should be NULL. +For two-way coprocesses, both values should be non-NULL. In the usual case, +the extension is interested in @code{(*ibufp)->fd} and/or @code{fileno((*obufp)->fp)}. If the file is not already open, and the fd argument is non-negative, @command{gawk} will use that file descriptor instead of opening the file in the usual way. If the fd is non-negative, but the file exists @@ -32962,8 +32970,8 @@ Note that in the two-way case, the input and output file descriptors may differ. To check for success, one must check whether either matches. @end table -For example, this API function can be used to implement I/O multiplexing or a -socket library. +It is anticipated that this API function will be used to implement I/O +multiplexing and a socket library. @node Extension API Variables @subsection API Variables -- cgit v1.2.3 From a97507159ee06523c9dd6ec809199a0774976498 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 5 Jan 2015 15:44:28 -0500 Subject: Add low-level access to the get_file API through the testext sample extension to facilitate further testing. --- extension/ChangeLog | 9 +++++++ extension/testext.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 55438800..617cc033 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,12 @@ +2015-01-05 Andrew J. Schorr + + * testext.c (test_get_file): Fix error message. + (do_get_file): Implement new function providing low-level access + to the get_file API. + (func_table): Add "get_file" -> do_get_file. + (init_testext): If TESTEXT_QUIET has been set to a numeric value, + return quietly. + 2015-01-02 Andrew J. Schorr * testext.c (test_get_file): The get_file hook no longer takes a diff --git a/extension/testext.c b/extension/testext.c index a10c9255..c931ed39 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -783,7 +783,7 @@ test_get_file(int nargs, awk_value_t *result) return make_number(-1.0, result); } if (! get_argument(1, AWK_STRING, & alias)) { - printf("%s: cannot get first arg\n", "test_get_file"); + printf("%s: cannot get second arg\n", "test_get_file"); return make_number(-1.0, result); } if ((fd = open(filename.str_value.str, O_RDONLY)) < 0) { @@ -801,6 +801,68 @@ test_get_file(int nargs, awk_value_t *result) return make_number(0.0, result); } +/* do_get_file --- provide access to get_file API */ + +static awk_value_t * +do_get_file(int nargs, awk_value_t *result) +{ + awk_value_t filename, filetype, fd, res; + const awk_input_buf_t *ibuf; + const awk_output_buf_t *obuf; + awk_array_t array; + + if (nargs != 4) { + printf("%s: nargs not right (%d should be 4)\n", "get_file", nargs); + return make_number(-1.0, result); + } + + if (! get_argument(0, AWK_STRING, & filename)) { + printf("%s: cannot get first arg\n", "get_file"); + return make_number(-1.0, result); + } + if (! get_argument(1, AWK_STRING, & filetype)) { + printf("%s: cannot get second arg\n", "get_file"); + return make_number(-1.0, result); + } + if (! get_argument(2, AWK_NUMBER, & fd)) { + printf("%s: cannot get third arg\n", "get_file"); + return make_number(-1.0, result); + } + if (! get_argument(3, AWK_ARRAY, & res)) { + printf("%s: cannot get fourth arg\n", "get_file"); + return make_number(-1.0, result); + } + clear_array(res.array_cookie); + + if (! get_file(filename.str_value.str, strlen(filename.str_value.str), filetype.str_value.str, fd.num_value, &ibuf, &obuf)) { + printf("%s: get_file(%s, %s, %d) failed\n", "get_file", filename.str_value.str, filetype.str_value.str, (int)(fd.num_value)); + return make_number(0.0, result); + } + + if (ibuf) { + awk_value_t idx, val; + set_array_element(res.array_cookie, + make_const_string("input", 5, & idx), + make_number(ibuf->fd, & val)); + if (ibuf->name) + set_array_element(res.array_cookie, + make_const_string("input_name", 10, & idx), + make_const_string(ibuf->name, strlen(ibuf->name), & val)); + } + if (obuf) { + awk_value_t idx, val; + set_array_element(res.array_cookie, + make_const_string("output", 6, & idx), + make_number(obuf->fp ? fileno(obuf->fp) : -1, + & val)); + if (obuf->name) + set_array_element(res.array_cookie, + make_const_string("output_name", 11, & idx), + make_const_string(obuf->name, strlen(obuf->name), & val)); + } + return make_number(1.0, result); +} + /* fill_in_array --- fill in a new array */ static void @@ -897,6 +959,7 @@ static awk_ext_func_t func_table[] = { { "test_scalar_reserved", test_scalar_reserved, 0 }, { "test_indirect_vars", test_indirect_vars, 0 }, { "test_get_file", test_get_file, 2 }, + { "get_file", do_get_file, 4 }, }; /* init_testext --- additional initialization function */ @@ -907,6 +970,9 @@ static awk_bool_t init_testext(void) static const char message[] = "hello, world"; /* of course */ static const char message2[] = "i am a scalar"; + if (sym_lookup("TESTEXT_QUIET", AWK_NUMBER, & value)) + return awk_true; + /* add at_exit functions */ awk_atexit(at_exit0, NULL); awk_atexit(at_exit1, & data_for_1); -- cgit v1.2.3 From cb5838c3c261f9a775fae45adfa70e1514e8bfe0 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 5 Jan 2015 16:36:17 -0500 Subject: Add test of get_file API. --- test/ChangeLog | 7 +++++++ test/Makefile.am | 9 ++++++++- test/Makefile.in | 9 ++++++++- test/getfile.awk | 35 +++++++++++++++++++++++++++++++++++ test/getfile.ok | 17 +++++++++++++++++ 5 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 test/getfile.awk create mode 100644 test/getfile.ok diff --git a/test/ChangeLog b/test/ChangeLog index 36dbfaa5..0fa59a65 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2015-01-05 Andrew J. Schorr + + * Makefile.am (EXTRA_DIST): Add getfile.awk and getfile.ok. + (SHLIB_TESTS): Add gefile. + (getfile): New test. + * getfile.awk, getfile.ok: New files. + 2015-01-05 Andrew J. Schorr * Makefile.am (EXTRA_DIST): Add timeout.awk and timeout.ok. diff --git a/test/Makefile.am b/test/Makefile.am index 3ac9a691..c31e8823 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -337,6 +337,8 @@ EXTRA_DIST = \ gensub.ok \ gensub2.awk \ gensub2.ok \ + getfile.awk \ + getfile.ok \ getline.awk \ getline.in \ getline.ok \ @@ -1057,7 +1059,7 @@ LOCALE_CHARSET_TESTS = \ mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc SHLIB_TESTS = \ - fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \ + fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time # List of the tests which should be run with --lint option: @@ -1898,6 +1900,11 @@ testext:: @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk +getfile: + @echo $@ + @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + readdir: @if [ "`uname`" = Linux ] && [ "`stat -f . 2>/dev/null | awk 'NR == 2 { print $$NF }'`" = nfs ]; then \ echo This test may fail on GNU/Linux systems when run on an NFS filesystem.; \ diff --git a/test/Makefile.in b/test/Makefile.in index 874a92de..1ab2c8a8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -584,6 +584,8 @@ EXTRA_DIST = \ gensub.ok \ gensub2.awk \ gensub2.ok \ + getfile.awk \ + getfile.ok \ getline.awk \ getline.in \ getline.ok \ @@ -1300,7 +1302,7 @@ LOCALE_CHARSET_TESTS = \ mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc SHLIB_TESTS = \ - fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \ + fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time @@ -2323,6 +2325,11 @@ testext:: @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk +getfile: + @echo $@ + @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + readdir: @if [ "`uname`" = Linux ] && [ "`stat -f . 2>/dev/null | awk 'NR == 2 { print $$NF }'`" = nfs ]; then \ echo This test may fail on GNU/Linux systems when run on an NFS filesystem.; \ diff --git a/test/getfile.awk b/test/getfile.awk new file mode 100644 index 00000000..6ee783f6 --- /dev/null +++ b/test/getfile.awk @@ -0,0 +1,35 @@ +function basename(x) { + return gensub(/^.*\//, "", 1, x) +} + +BEGIN { + print "BEGIN" + + cmd = "echo hello; echo goodbye" + rc = get_file(cmd, "<<", -1, res) + print "expected error result", rc, ERRNO + print "get_file returned", get_file(cmd, "|<", -1, res) + print "input_name", basename(res["input_name"]) + print (cmd | getline x) + print x + + # check that calling get_file on "" triggers the BEGINFILE rule + print "get_file returned", get_file("", "", -1, res) + print "input_name", basename(res["input_name"]) + print "end BEGIN" +} + +BEGINFILE { + printf "BEGINFILE (%s) ERRNO (%s)\n", basename(FILENAME), ERRNO +} + +ENDFILE { + printf "ENDFILE (%s) ERRNO (%s)\n", basename(FILENAME), ERRNO +} + +END { + print "END" + print (cmd | getline x) + print x + print close(cmd) +} diff --git a/test/getfile.ok b/test/getfile.ok new file mode 100644 index 00000000..92c915f2 --- /dev/null +++ b/test/getfile.ok @@ -0,0 +1,17 @@ +BEGIN +gawk: ./getfile.awk:9: warning: cannot open unrecognized file type `<<' for `echo hello; echo goodbye' +get_file: get_file(echo hello; echo goodbye, <<, -1) failed +expected error result 0 +get_file returned 1 +input_name echo hello; echo goodbye +1 +hello +BEGINFILE (getfile.awk) ERRNO () +get_file returned 1 +input_name getfile.awk +end BEGIN +ENDFILE (getfile.awk) ERRNO () +END +1 +goodbye +0 -- cgit v1.2.3 From 9121c3059288f36e004108e02ed4d826b84604e7 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 6 Jan 2015 14:20:19 -0500 Subject: Fix bug so that extensions can create deferred arrays PROCINFO and ENVIRON properly. --- ChangeLog | 13 +++++++++++++ awk.h | 1 + awkgram.c | 36 ++++++++++++++++++------------------ awkgram.y | 36 ++++++++++++++++++------------------ gawkapi.c | 28 ++++++++++++++++++++++++++-- 5 files changed, 76 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0c3dc4e..098031ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2015-01-06 Andrew J. Schorr + + * awk.h (variable_create): Declare new function. + * awkgram.y (variable_create): New function to create a variable + taking the deferred variable list into consideration. + (variable): Call new function variable_create if the variable is + not found. + * gawkapi.c (api_sym_update): If an array is being created, then + call new function variable_create instead of install_symbol. If this + is the first reference to a deferred variable, than the new array + may contain elements that must be merged into the array provided by + the extension. + 2015-01-05 Andrew J. Schorr * io.c (wait_any): If the `interesting' argument is non-zero, then we diff --git a/awk.h b/awk.h index bb63f65a..5ecc13fa 100644 --- a/awk.h +++ b/awk.h @@ -1318,6 +1318,7 @@ extern NODE *do_asorti(int nargs); extern unsigned long (*hash)(const char *s, size_t len, unsigned long hsize, size_t *code); extern void init_env_array(NODE *env_node); /* awkgram.c */ +extern NODE *variable_create(char *name, NODETYPE type); extern NODE *variable(int location, char *name, NODETYPE type); extern int parse_program(INSTRUCTION **pcode); extern void track_ext_func(const char *name); diff --git a/awkgram.c b/awkgram.c index adb31d9c..2257ee35 100644 --- a/awkgram.c +++ b/awkgram.c @@ -7052,6 +7052,20 @@ is_deferred_variable(const char *name) return false; } +/* variable_create --- create a new variable */ +NODE * +variable_create(char *name, NODETYPE type) +{ + struct deferred_variable *dv; + + for (dv = deferred_variables; dv != NULL; dv = dv->next) { + if (strcmp(name, dv->name) == 0) { + efree(name); + return (*dv->load_func)(); + } + } + return install_symbol(name, type); +} /* variable --- make sure NAME is in the symbol table */ @@ -7066,25 +7080,11 @@ variable(int location, char *name, NODETYPE type) r->vname); if (r == symbol_table) symtab_used = true; - } else { - /* not found */ - struct deferred_variable *dv; - - for (dv = deferred_variables; true; dv = dv->next) { - if (dv == NULL) { - /* - * This is the only case in which we may not free the string. - */ - return install_symbol(name, type); - } - if (strcmp(name, dv->name) == 0) { - r = (*dv->load_func)(); - break; - } - } + efree(name); + return r; } - efree(name); - return r; + /* not found */ + return variable_create(name, type); } /* process_deferred --- if the program uses SYMTAB, load deferred variables */ diff --git a/awkgram.y b/awkgram.y index 52284af4..6575e0f0 100644 --- a/awkgram.y +++ b/awkgram.y @@ -4714,6 +4714,20 @@ is_deferred_variable(const char *name) return false; } +/* variable_create --- create a new variable */ +NODE * +variable_create(char *name, NODETYPE type) +{ + struct deferred_variable *dv; + + for (dv = deferred_variables; dv != NULL; dv = dv->next) { + if (strcmp(name, dv->name) == 0) { + efree(name); + return (*dv->load_func)(); + } + } + return install_symbol(name, type); +} /* variable --- make sure NAME is in the symbol table */ @@ -4728,25 +4742,11 @@ variable(int location, char *name, NODETYPE type) r->vname); if (r == symbol_table) symtab_used = true; - } else { - /* not found */ - struct deferred_variable *dv; - - for (dv = deferred_variables; true; dv = dv->next) { - if (dv == NULL) { - /* - * This is the only case in which we may not free the string. - */ - return install_symbol(name, type); - } - if (strcmp(name, dv->name) == 0) { - r = (*dv->load_func)(); - break; - } - } + efree(name); + return r; } - efree(name); - return r; + /* not found */ + return variable_create(name, type); } /* process_deferred --- if the program uses SYMTAB, load deferred variables */ diff --git a/gawkapi.c b/gawkapi.c index a693621e..5630185c 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -579,10 +579,34 @@ api_sym_update(awk_ext_id_t id, if (node == NULL) { /* new value to be installed */ if (value->val_type == AWK_ARRAY) { + unsigned long nel; + array_node = awk_value_to_node(value); - node = install_symbol(estrdup((char *) name, strlen(name)), - Node_var_array); + /* + * use variable_create instead of install_symbol in + * case this is a deferred variable such as PROCINFO + * or ENVIRON + */ + node = variable_create(estrdup((char *) name, strlen(name)), Node_var_array); array_node->vname = node->vname; + if ((nel = assoc_length(node)) > 0) { + /* merge the 2 arrays */ + NODE **list; + NODE akind; + unsigned long i; + + akind.flags = (AINDEX|AVALUE); + list = node->alist(node, & akind); + for (i = 0; i < nel; i++) { + NODE **aptr; + aptr = assoc_lookup(array_node, list[2*i]); + unref(*aptr); + unref(list[2*i]); /* alist duped it */ + *aptr = dupnode(list[2*i+1]); + } + efree(list); + assoc_clear(node); + } *node = *array_node; freenode(array_node); value->array_cookie = node; /* pass new cookie back to extension */ -- cgit v1.2.3 From f38a8f801496ea91cef7a8507e2919f6586d0694 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 6 Jan 2015 20:17:35 -0500 Subject: Fix bug in API deferred variable creation and add a test case. --- ChangeLog | 12 +++++++++ awk.h | 2 +- awkgram.c | 7 ++++-- awkgram.y | 7 ++++-- extension/ChangeLog | 7 ++++++ extension/testext.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++- gawkapi.c | 26 +++++++++++++------- test/ChangeLog | 9 ++++++- test/Makefile.am | 9 ++++++- test/Makefile.in | 9 ++++++- test/defvar.awk | 3 +++ test/defvar.ok | 5 ++++ 12 files changed, 149 insertions(+), 18 deletions(-) create mode 100644 test/defvar.awk create mode 100644 test/defvar.ok diff --git a/ChangeLog b/ChangeLog index 098031ab..71268d3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2015-01-06 Andrew J. Schorr + + * awk.h (variable_create): Now takes a 3rd argument to tell caller + whether this is a deferred variable. + * awkgram.y (variable_create): Return indicator of whether this is + a deferred variable in a newly added 3rd arg. + (variable): Pass 3rd arg to variable_create. + * gawkapi.c (api_sym_update): If we triggered the creation of a deferred + variable, we must merge the extension's array elements into the deffered + array, not the other way around. The ENVIRON array has special funcs + to call setenv and unsetenv. + 2015-01-06 Andrew J. Schorr * awk.h (variable_create): Declare new function. diff --git a/awk.h b/awk.h index 5ecc13fa..f624a876 100644 --- a/awk.h +++ b/awk.h @@ -1318,7 +1318,7 @@ extern NODE *do_asorti(int nargs); extern unsigned long (*hash)(const char *s, size_t len, unsigned long hsize, size_t *code); extern void init_env_array(NODE *env_node); /* awkgram.c */ -extern NODE *variable_create(char *name, NODETYPE type); +extern NODE *variable_create(char *name, NODETYPE type, bool *is_deferred); extern NODE *variable(int location, char *name, NODETYPE type); extern int parse_program(INSTRUCTION **pcode); extern void track_ext_func(const char *name); diff --git a/awkgram.c b/awkgram.c index 2257ee35..249fdcdf 100644 --- a/awkgram.c +++ b/awkgram.c @@ -7054,16 +7054,18 @@ is_deferred_variable(const char *name) /* variable_create --- create a new variable */ NODE * -variable_create(char *name, NODETYPE type) +variable_create(char *name, NODETYPE type, bool *is_deferred) { struct deferred_variable *dv; for (dv = deferred_variables; dv != NULL; dv = dv->next) { if (strcmp(name, dv->name) == 0) { efree(name); + *is_deferred = true; return (*dv->load_func)(); } } + *is_deferred = false; return install_symbol(name, type); } @@ -7073,6 +7075,7 @@ NODE * variable(int location, char *name, NODETYPE type) { NODE *r; + bool is_deferred; if ((r = lookup(name)) != NULL) { if (r->type == Node_func || r->type == Node_ext_func ) @@ -7084,7 +7087,7 @@ variable(int location, char *name, NODETYPE type) return r; } /* not found */ - return variable_create(name, type); + return variable_create(name, type, & is_deferred); } /* process_deferred --- if the program uses SYMTAB, load deferred variables */ diff --git a/awkgram.y b/awkgram.y index 6575e0f0..461bd6b0 100644 --- a/awkgram.y +++ b/awkgram.y @@ -4716,16 +4716,18 @@ is_deferred_variable(const char *name) /* variable_create --- create a new variable */ NODE * -variable_create(char *name, NODETYPE type) +variable_create(char *name, NODETYPE type, bool *is_deferred) { struct deferred_variable *dv; for (dv = deferred_variables; dv != NULL; dv = dv->next) { if (strcmp(name, dv->name) == 0) { efree(name); + *is_deferred = true; return (*dv->load_func)(); } } + *is_deferred = false; return install_symbol(name, type); } @@ -4735,6 +4737,7 @@ NODE * variable(int location, char *name, NODETYPE type) { NODE *r; + bool is_deferred; if ((r = lookup(name)) != NULL) { if (r->type == Node_func || r->type == Node_ext_func ) @@ -4746,7 +4749,7 @@ variable(int location, char *name, NODETYPE type) return r; } /* not found */ - return variable_create(name, type); + return variable_create(name, type, & is_deferred); } /* process_deferred --- if the program uses SYMTAB, load deferred variables */ diff --git a/extension/ChangeLog b/extension/ChangeLog index 617cc033..c8f77042 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,10 @@ +2015-01-06 Andrew J. Schorr + + * testext.c (test_deferred): New function to help with testing + of deferred variable instantiation. + (do_get_file): Remove unused variable array. + (func_table): Add test_deferred. + 2015-01-05 Andrew J. Schorr * testext.c (test_get_file): Fix error message. diff --git a/extension/testext.c b/extension/testext.c index c931ed39..7c61bb0d 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -374,6 +374,75 @@ out: return result; } +static awk_value_t * +test_deferred(int nargs, awk_value_t *result) +{ + awk_value_t arr; + awk_value_t index, value; + const struct nval { + const char *name; + double val; + } seed[] = { + { "fubar", 9.0, }, + { "rumpus", -5.0, }, + }; + struct nval sysval[] = { + { "uid", getuid(), }, + { "api_major", GAWK_API_MAJOR_VERSION, }, + }; + size_t i; + + assert(result != NULL); + make_number(0.0, result); + + if (nargs != 0) { + printf("test_deferred: nargs not right (%d should be 0)\n", nargs); + goto out; + } + arr.val_type = AWK_ARRAY; + arr.array_cookie = create_array(); + + for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { + make_const_string(seed[i].name, strlen(seed[i].name), & index); + make_number(seed[i].val, & value); + if (! set_array_element(arr.array_cookie, & index, & value)) { + printf("test_deferred: %d: set_array_element(%s) failed\n", __LINE__, seed[i].name); + goto out; + } + } + + if (! sym_update("PROCINFO", & arr)) { + printf("test_deferred: %d: sym_update failed\n", __LINE__); + goto out; + } + + /* test that it still contains the values we loaded */ + for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { + make_const_string(seed[i].name, strlen(seed[i].name), & index); + make_null_string(& value); + if (! get_array_element(arr.array_cookie, &index, AWK_NUMBER, & value)) { + printf("test_deferred: %d: get_array_element(%s) failed\n", __LINE__, seed[i].name); + goto out; + } + printf("%s = %g\n", seed[i].name, value.num_value); + } + + /* check a few automatically-supplied values */ + for (i = 0; i < sizeof(sysval)/sizeof(sysval[0]); i++) { + make_const_string(sysval[i].name, strlen(sysval[i].name), & index); + make_null_string(& value); + if (! get_array_element(arr.array_cookie, &index, AWK_NUMBER, & value)) { + printf("test_deferred: %d: get_array_element(%s) failed\n", __LINE__, sysval[i].name); + goto out; + } + printf("%s matches %d\n", sysval[i].name, (value.num_value == sysval[i].val)); + } + + make_number(1.0, result); +out: + return result; +} + /* BEGIN { for (i = 1; i <= 10; i++) @@ -809,7 +878,6 @@ do_get_file(int nargs, awk_value_t *result) awk_value_t filename, filetype, fd, res; const awk_input_buf_t *ibuf; const awk_output_buf_t *obuf; - awk_array_t array; if (nargs != 4) { printf("%s: nargs not right (%d should be 4)\n", "get_file", nargs); @@ -950,6 +1018,7 @@ static awk_ext_func_t func_table[] = { { "dump_array_and_delete", dump_array_and_delete, 2 }, { "try_modify_environ", try_modify_environ, 0 }, { "var_test", var_test, 1 }, + { "test_deferred", test_deferred, 0 }, { "test_errno", test_errno, 0 }, { "test_array_size", test_array_size, 1 }, { "test_array_elem", test_array_elem, 2 }, diff --git a/gawkapi.c b/gawkapi.c index 5630185c..e8879022 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -579,7 +579,7 @@ api_sym_update(awk_ext_id_t id, if (node == NULL) { /* new value to be installed */ if (value->val_type == AWK_ARRAY) { - unsigned long nel; + bool is_deferred; array_node = awk_value_to_node(value); /* @@ -587,27 +587,35 @@ api_sym_update(awk_ext_id_t id, * case this is a deferred variable such as PROCINFO * or ENVIRON */ - node = variable_create(estrdup((char *) name, strlen(name)), Node_var_array); - array_node->vname = node->vname; - if ((nel = assoc_length(node)) > 0) { - /* merge the 2 arrays */ + node = variable_create(estrdup((char *) name, strlen(name)), Node_var_array, & is_deferred); + if (is_deferred) { + /* + * merge the user-supplied elements into the + * already-existing array. Since ENVIRON + * has special array_funcs, we need to retain + * the auto-created array! + */ + unsigned long nel; NODE **list; NODE akind; unsigned long i; + nel = assoc_length(array_node); akind.flags = (AINDEX|AVALUE); - list = node->alist(node, & akind); + list = array_node->alist(array_node, & akind); for (i = 0; i < nel; i++) { NODE **aptr; - aptr = assoc_lookup(array_node, list[2*i]); + aptr = assoc_lookup(node, list[2*i]); unref(*aptr); unref(list[2*i]); /* alist duped it */ *aptr = dupnode(list[2*i+1]); } efree(list); - assoc_clear(node); + assoc_clear(array_node); + } else { + array_node->vname = node->vname; + *node = *array_node; } - *node = *array_node; freenode(array_node); value->array_cookie = node; /* pass new cookie back to extension */ } else { diff --git a/test/ChangeLog b/test/ChangeLog index 0fa59a65..7522f7aa 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,7 +1,14 @@ +2015-01-06 Andrew J. Schorr + + * Makefile.am (EXTRA_DIST): Add defvar.awk and defvar.ok. + (SHLIB_TESTS): Add defvar. + (defvar): New test. + * defvar.awk, defvar.ok: New files. + 2015-01-05 Andrew J. Schorr * Makefile.am (EXTRA_DIST): Add getfile.awk and getfile.ok. - (SHLIB_TESTS): Add gefile. + (SHLIB_TESTS): Add getfile. (getfile): New test. * getfile.awk, getfile.ok: New files. diff --git a/test/Makefile.am b/test/Makefile.am index c31e8823..3d95f4cc 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -174,6 +174,8 @@ EXTRA_DIST = \ dbugeval.ok \ defref.awk \ defref.ok \ + defvar.awk \ + defvar.ok \ delargv.awk \ delargv.ok \ delarpm2.awk \ @@ -1059,7 +1061,7 @@ LOCALE_CHARSET_TESTS = \ mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc SHLIB_TESTS = \ - fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ + defvar fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time # List of the tests which should be run with --lint option: @@ -1900,6 +1902,11 @@ testext:: @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk +defvar: + @echo $@ + @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + getfile: @echo $@ @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Makefile.in b/test/Makefile.in index 1ab2c8a8..d2492d32 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -421,6 +421,8 @@ EXTRA_DIST = \ dbugeval.ok \ defref.awk \ defref.ok \ + defvar.awk \ + defvar.ok \ delargv.awk \ delargv.ok \ delarpm2.awk \ @@ -1302,7 +1304,7 @@ LOCALE_CHARSET_TESTS = \ mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc SHLIB_TESTS = \ - fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ + defvar fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time @@ -2325,6 +2327,11 @@ testext:: @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk +defvar: + @echo $@ + @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + getfile: @echo $@ @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/defvar.awk b/test/defvar.awk new file mode 100644 index 00000000..444b81c9 --- /dev/null +++ b/test/defvar.awk @@ -0,0 +1,3 @@ +BEGIN { + print "test_deferred returns", test_deferred() +} diff --git a/test/defvar.ok b/test/defvar.ok new file mode 100644 index 00000000..4c85427e --- /dev/null +++ b/test/defvar.ok @@ -0,0 +1,5 @@ +fubar = 9 +rumpus = -5 +uid matches 1 +api_major matches 1 +test_deferred returns 1 -- cgit v1.2.3 From 444afe9e4a9c70f0833f6a0a912651dd0d0e57aa Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 6 Jan 2015 21:28:12 -0500 Subject: The API should call the astore hook after array assignment. --- ChangeLog | 6 ++++++ gawkapi.c | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71268d3e..e3a194d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-01-06 Andrew J. Schorr + + * gawkapi.c (api_sym_update): If copying a subarray, must update + the parent_array pointer. Also, call the astore hook if non-NULL. + (api_set_array_element): Call the astore hook if non-NULL. + 2015-01-06 Andrew J. Schorr * awk.h (variable_create): Now takes a 3rd argument to tell caller diff --git a/gawkapi.c b/gawkapi.c index e8879022..371a375c 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -605,10 +605,15 @@ api_sym_update(awk_ext_id_t id, list = array_node->alist(array_node, & akind); for (i = 0; i < nel; i++) { NODE **aptr; + NODE *elem; aptr = assoc_lookup(node, list[2*i]); unref(*aptr); + elem = *aptr = dupnode(list[2*i+1]); + if (elem->type == Node_var_array) + elem->parent_array = node; + if (node->astore != NULL) + (*node->astore)(node, list[2*i]); unref(list[2*i]); /* alist duped it */ - *aptr = dupnode(list[2*i+1]); } efree(list); assoc_clear(array_node); @@ -820,7 +825,6 @@ api_set_array_element(awk_ext_id_t id, awk_array_t a_cookie, tmp = awk_value_to_node(index); aptr = assoc_lookup(array, tmp); - unref(tmp); unref(*aptr); elem = *aptr = awk_value_to_node(value); if (elem->type == Node_var_array) { @@ -829,6 +833,9 @@ api_set_array_element(awk_ext_id_t id, awk_array_t a_cookie, index->str_value.len); make_aname(elem); } + if (array->astore != NULL) + (*array->astore)(array, tmp); + unref(tmp); return awk_true; } -- cgit v1.2.3 From 55aefdc29dde7eb585b7a553876313ecceec1d68 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Wed, 7 Jan 2015 13:08:23 -0500 Subject: Remove stray call to make_aname in api_set_array_element. --- ChangeLog | 6 ++++++ gawkapi.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e3a194d5..6e549065 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-01-07 Andrew J. Schorr + + * gawkapi.c (api_set_array_element): Remove stray call to + make_aname. I cannot see what purpose this served. Maybe I am + missing something. + 2015-01-06 Andrew J. Schorr * gawkapi.c (api_sym_update): If copying a subarray, must update diff --git a/gawkapi.c b/gawkapi.c index 371a375c..749be178 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -831,7 +831,6 @@ api_set_array_element(awk_ext_id_t id, awk_array_t a_cookie, elem->parent_array = array; elem->vname = estrdup(index->str_value.str, index->str_value.len); - make_aname(elem); } if (array->astore != NULL) (*array->astore)(array, tmp); -- cgit v1.2.3 From 9fc264e33c0fcc77ed18860a47bea824d75daebd Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 7 Jan 2015 22:01:34 +0200 Subject: Update debug flags for compiling when developing. --- ChangeLog | 4 ++++ configure | 2 +- configure.ac | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fdb550a7..a4afb19e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-01-07 Arnold D. Robbins + + * configure.ac: Update debug flags if developing. + 2014-12-10 Arnold D. Robbins * dfa.c: Sync with GNU grep. diff --git a/configure b/configure index 77a80dff..8e2cc7ca 100755 --- a/configure +++ b/configure @@ -5845,7 +5845,7 @@ then # enable debugging using macros also if test "$GCC" = yes then - CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -gdwarf-2" + CFLAGS="$CFLAGS -Wall -fno-builtin -g3" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } diff --git a/configure.ac b/configure.ac index 5667b7c6..8d03ca1a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl dnl configure.ac --- autoconf input file for gawk dnl -dnl Copyright (C) 1995-2014 the Free Software Foundation, Inc. +dnl Copyright (C) 1995-2015 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Programming Language. @@ -97,7 +97,7 @@ then # enable debugging using macros also if test "$GCC" = yes then - CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -gdwarf-2" + CFLAGS="$CFLAGS -Wall -fno-builtin -g3" fi AC_MSG_RESULT([yes]) else -- cgit v1.2.3 From 385f22a32c3794615d713e519ae290eb09b2c4d2 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 7 Jan 2015 22:07:24 +0200 Subject: Bug fix in regexp parsing. --- ChangeLog | 2 ++ awkgram.c | 6 ++---- awkgram.y | 8 +++----- test/ChangeLog | 5 +++++ test/Makefile.am | 7 +++++-- test/Makefile.in | 12 ++++++++++-- test/Maketests | 5 +++++ test/regexpbrack.awk | 2 ++ test/regexpbrack.in | 0 test/regexpbrack.ok | 0 10 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 test/regexpbrack.awk create mode 100644 test/regexpbrack.in create mode 100644 test/regexpbrack.ok diff --git a/ChangeLog b/ChangeLog index a4afb19e..231288ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2015-01-07 Arnold D. Robbins * configure.ac: Update debug flags if developing. + * awkgram.y (yylex): Regex parsing bug fix for bracket expressions. + Thanks to Mike Brennan for the report. 2014-12-10 Arnold D. Robbins diff --git a/awkgram.c b/awkgram.c index 431954d9..84140eef 100644 --- a/awkgram.c +++ b/awkgram.c @@ -5374,10 +5374,8 @@ yylex(void) pushback(); break; case ']': - if (tokstart[0] == '[' - && (tok == tokstart + 1 - || (tok == tokstart + 2 - && tokstart[1] == '^'))) + if (tok[-1] == '[' + || (tok[-2] == '[' && tok[-1] == '^')) /* do nothing */; else in_brack--; diff --git a/awkgram.y b/awkgram.y index 9cf88da3..267cf077 100644 --- a/awkgram.y +++ b/awkgram.y @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -3035,10 +3035,8 @@ yylex(void) pushback(); break; case ']': - if (tokstart[0] == '[' - && (tok == tokstart + 1 - || (tok == tokstart + 2 - && tokstart[1] == '^'))) + if (tok[-1] == '[' + || (tok[-2] == '[' && tok[-1] == '^')) /* do nothing */; else in_brack--; diff --git a/test/ChangeLog b/test/ChangeLog index 8d39af74..95134f6b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-01-07 Arnold D. Robbins + + * Makefile.am (regexpbrack): New test. + * regexpbrack.awk, regexpbrack.in, regexpbrack.ok: New files. + 2014-12-24 Arnold D. Robbins * Makefile.am (badbuild): New test. diff --git a/test/Makefile.am b/test/Makefile.am index b93f851f..df0da10c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -742,6 +742,9 @@ EXTRA_DIST = \ regeq.awk \ regeq.in \ regeq.ok \ + regexpbrack.awk \ + regexpbrack.in \ + regexpbrack.ok \ regexprange.awk \ regexprange.ok \ reginttrad.awk \ @@ -999,7 +1002,7 @@ BASIC_TESTS = \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ diff --git a/test/Makefile.in b/test/Makefile.in index 7a281eca..5bd39f45 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,7 +17,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -989,6 +989,9 @@ EXTRA_DIST = \ regeq.awk \ regeq.in \ regeq.ok \ + regexpbrack.awk \ + regexpbrack.in \ + regexpbrack.ok \ regexprange.awk \ regexprange.ok \ reginttrad.awk \ @@ -1245,7 +1248,7 @@ BASIC_TESTS = \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ @@ -3122,6 +3125,11 @@ regeq: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index e1b92bf9..4104f142 100644 --- a/test/Maketests +++ b/test/Maketests @@ -697,6 +697,11 @@ regeq: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/regexpbrack.awk b/test/regexpbrack.awk new file mode 100644 index 00000000..136cd194 --- /dev/null +++ b/test/regexpbrack.awk @@ -0,0 +1,2 @@ +/[]+()0-9.,$%/'"-]*$/ +/^[]+()0-9.,$%/'"-]*$/ diff --git a/test/regexpbrack.in b/test/regexpbrack.in new file mode 100644 index 00000000..e69de29b diff --git a/test/regexpbrack.ok b/test/regexpbrack.ok new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3 From f70399532bd105c5f42ca040846aa537a8fa27bc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 7 Jan 2015 22:12:50 +0200 Subject: Fix count$ in printf for dynamic width/precision. --- ChangeLog | 2 ++ builtin.c | 7 +++++-- test/ChangeLog | 5 +++++ test/Makefile.am | 4 +++- test/Makefile.in | 9 ++++++++- test/Maketests | 5 +++++ test/printfbad4.awk | 5 +++++ test/printfbad4.ok | 2 ++ 8 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 test/printfbad4.awk create mode 100644 test/printfbad4.ok diff --git a/ChangeLog b/ChangeLog index 231288ab..e3a73a85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * configure.ac: Update debug flags if developing. * awkgram.y (yylex): Regex parsing bug fix for bracket expressions. Thanks to Mike Brennan for the report. + * builtin.c (format_tree): Catch non-use of count$ for dynamic + field width or precision. 2014-12-10 Arnold D. Robbins diff --git a/builtin.c b/builtin.c index 53210c4d..9b85de2b 100644 --- a/builtin.c +++ b/builtin.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -904,7 +904,10 @@ check_pos: case '*': if (cur == NULL) break; - if (! do_traditional && isdigit((unsigned char) *s1)) { + if (! do_traditional && used_dollar && ! isdigit((unsigned char) *s1)) { + fatal(_("fatal: must use `count$' on all formats or none")); + break; /* silence warnings */ + } else if (! do_traditional && isdigit((unsigned char) *s1)) { int val = 0; for (; n0 > 0 && *s1 && isdigit((unsigned char) *s1); s1++, n0--) { diff --git a/test/ChangeLog b/test/ChangeLog index 95134f6b..8d6086b3 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -3,6 +3,11 @@ * Makefile.am (regexpbrack): New test. * regexpbrack.awk, regexpbrack.in, regexpbrack.ok: New files. + Unrelated: + + * Makefile.am (printfbad4): New test. + * printfbad4.awk, printfbad4.ok: New files. + 2014-12-24 Arnold D. Robbins * Makefile.am (badbuild): New test. diff --git a/test/Makefile.am b/test/Makefile.am index df0da10c..12bde88d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -692,6 +692,8 @@ EXTRA_DIST = \ printfbad2.ok \ printfbad3.awk \ printfbad3.ok \ + printfbad4.awk \ + printfbad4.ok \ printfloat.awk \ printhuge.awk \ printhuge.ok \ @@ -1029,7 +1031,7 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ diff --git a/test/Makefile.in b/test/Makefile.in index 5bd39f45..55650e18 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -939,6 +939,8 @@ EXTRA_DIST = \ printfbad2.ok \ printfbad3.awk \ printfbad3.ok \ + printfbad4.awk \ + printfbad4.ok \ printfloat.awk \ printhuge.awk \ printhuge.ok \ @@ -1275,7 +1277,7 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ @@ -3590,6 +3592,11 @@ printfbad3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 4104f142..5c4c40f9 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1162,6 +1162,11 @@ printfbad3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/printfbad4.awk b/test/printfbad4.awk new file mode 100644 index 00000000..dd9220ae --- /dev/null +++ b/test/printfbad4.awk @@ -0,0 +1,5 @@ +BEGIN { + for (i = 1; i <= 10; i++) { + printf "%03$*d %2$d \n", 4, 5, i + } +} diff --git a/test/printfbad4.ok b/test/printfbad4.ok new file mode 100644 index 00000000..71eed3d6 --- /dev/null +++ b/test/printfbad4.ok @@ -0,0 +1,2 @@ +gawk: printfbad4.awk:3: fatal: fatal: must use `count$' on all formats or none +EXIT CODE: 2 -- cgit v1.2.3 From b1f63ac08d7da89ac7e8af4df5ca835527fc5b24 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 7 Jan 2015 22:23:19 +0200 Subject: Load PROCINFO and ENVIRON if using extensions. --- ChangeLog | 10 + awkgram.c | 734 ++++++++++++++++++++++++++-------------------------- awkgram.y | 16 +- extension/ChangeLog | 4 + extension/testext.c | 8 +- test/ChangeLog | 4 + test/testext.ok | 2 +- 7 files changed, 402 insertions(+), 376 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3a73a85..ef077154 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,16 @@ * builtin.c (format_tree): Catch non-use of count$ for dynamic field width or precision. + Unrelated: + + Load deferred variables if extensions are used; they might + want to access PROCINFO and/or ENVIRON. Thanks to Andrew Schorr + for pointing out the issue. + + * awkgram.y (extensions_used): New variable. Set it on @load. + (do_add_scrfile): Set it on -l. + (process_deferred): Check it also. + 2014-12-10 Arnold D. Robbins * dfa.c: Sync with GNU grep. diff --git a/awkgram.c b/awkgram.c index 84140eef..b24e6027 100644 --- a/awkgram.c +++ b/awkgram.c @@ -160,6 +160,7 @@ static int lasttok = 0; static bool eof_warned = false; /* GLOBAL: want warning for each file */ static int break_allowed; /* kludge for break */ static int continue_allowed; /* kludge for continue */ +static bool extensions_used = false; /* program uses extensions */ #define END_FILE -1000 #define END_SRC -2000 @@ -195,7 +196,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -#line 199 "awkgram.c" /* yacc.c:339 */ +#line 200 "awkgram.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -349,7 +350,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 353 "awkgram.c" /* yacc.c:358 */ +#line 354 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -651,25 +652,25 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 198, 198, 200, 205, 206, 212, 224, 228, 239, - 245, 250, 258, 266, 268, 273, 281, 283, 289, 290, - 292, 318, 329, 340, 346, 355, 365, 367, 369, 375, - 380, 381, 385, 404, 403, 437, 439, 444, 445, 458, - 463, 464, 468, 470, 472, 479, 569, 611, 653, 766, - 773, 780, 790, 799, 808, 817, 828, 844, 843, 867, - 879, 879, 977, 977, 1010, 1040, 1046, 1047, 1053, 1054, - 1061, 1066, 1078, 1092, 1094, 1102, 1107, 1109, 1117, 1119, - 1128, 1129, 1137, 1142, 1142, 1153, 1157, 1165, 1166, 1169, - 1171, 1176, 1177, 1186, 1187, 1192, 1197, 1203, 1205, 1207, - 1214, 1215, 1221, 1222, 1227, 1229, 1234, 1236, 1244, 1249, - 1258, 1265, 1267, 1269, 1285, 1295, 1302, 1304, 1309, 1311, - 1313, 1321, 1323, 1328, 1330, 1335, 1337, 1339, 1389, 1391, - 1393, 1395, 1397, 1399, 1401, 1403, 1417, 1422, 1427, 1452, - 1458, 1460, 1462, 1464, 1466, 1468, 1473, 1477, 1509, 1511, - 1517, 1523, 1536, 1537, 1538, 1543, 1548, 1552, 1556, 1571, - 1584, 1589, 1625, 1643, 1644, 1650, 1651, 1656, 1658, 1665, - 1682, 1699, 1701, 1708, 1713, 1721, 1731, 1743, 1752, 1756, - 1760, 1764, 1768, 1772, 1775, 1777, 1781, 1785, 1789 + 0, 199, 199, 201, 206, 207, 213, 225, 229, 240, + 246, 251, 259, 267, 269, 274, 283, 285, 291, 292, + 294, 320, 331, 342, 348, 357, 367, 369, 371, 377, + 382, 383, 387, 406, 405, 439, 441, 446, 447, 460, + 465, 466, 470, 472, 474, 481, 571, 613, 655, 768, + 775, 782, 792, 801, 810, 819, 830, 846, 845, 869, + 881, 881, 979, 979, 1012, 1042, 1048, 1049, 1055, 1056, + 1063, 1068, 1080, 1094, 1096, 1104, 1109, 1111, 1119, 1121, + 1130, 1131, 1139, 1144, 1144, 1155, 1159, 1167, 1168, 1171, + 1173, 1178, 1179, 1188, 1189, 1194, 1199, 1205, 1207, 1209, + 1216, 1217, 1223, 1224, 1229, 1231, 1236, 1238, 1246, 1251, + 1260, 1267, 1269, 1271, 1287, 1297, 1304, 1306, 1311, 1313, + 1315, 1323, 1325, 1330, 1332, 1337, 1339, 1341, 1391, 1393, + 1395, 1397, 1399, 1401, 1403, 1405, 1419, 1424, 1429, 1454, + 1460, 1462, 1464, 1466, 1468, 1470, 1475, 1479, 1511, 1513, + 1519, 1525, 1538, 1539, 1540, 1545, 1550, 1554, 1558, 1573, + 1586, 1591, 1627, 1645, 1646, 1652, 1653, 1658, 1660, 1667, + 1684, 1701, 1703, 1710, 1715, 1723, 1733, 1745, 1754, 1758, + 1762, 1766, 1770, 1774, 1777, 1779, 1783, 1787, 1791 }; #endif @@ -1842,26 +1843,26 @@ yyreduce: switch (yyn) { case 3: -#line 201 "awkgram.y" /* yacc.c:1646 */ +#line 202 "awkgram.y" /* yacc.c:1646 */ { rule = 0; yyerrok; } -#line 1851 "awkgram.c" /* yacc.c:1646 */ +#line 1852 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 207 "awkgram.y" /* yacc.c:1646 */ +#line 208 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); if (sourcefile == srcfiles) process_deferred(); } -#line 1861 "awkgram.c" /* yacc.c:1646 */ +#line 1862 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 213 "awkgram.y" /* yacc.c:1646 */ +#line 214 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -1870,19 +1871,19 @@ yyreduce: */ /* yyerrok; */ } -#line 1874 "awkgram.c" /* yacc.c:1646 */ +#line 1875 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 225 "awkgram.y" /* yacc.c:1646 */ +#line 226 "awkgram.y" /* yacc.c:1646 */ { (void) append_rule((yyvsp[-1]), (yyvsp[0])); } -#line 1882 "awkgram.c" /* yacc.c:1646 */ +#line 1883 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 229 "awkgram.y" /* yacc.c:1646 */ +#line 230 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1893,39 +1894,39 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1897 "awkgram.c" /* yacc.c:1646 */ +#line 1898 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 240 "awkgram.y" /* yacc.c:1646 */ +#line 241 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1907 "awkgram.c" /* yacc.c:1646 */ +#line 1908 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 246 "awkgram.y" /* yacc.c:1646 */ +#line 247 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1916 "awkgram.c" /* yacc.c:1646 */ +#line 1917 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 251 "awkgram.y" /* yacc.c:1646 */ +#line 252 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1925 "awkgram.c" /* yacc.c:1646 */ +#line 1926 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 259 "awkgram.y" /* yacc.c:1646 */ +#line 260 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1933,59 +1934,60 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1937 "awkgram.c" /* yacc.c:1646 */ +#line 1938 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 267 "awkgram.y" /* yacc.c:1646 */ +#line 268 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1943 "awkgram.c" /* yacc.c:1646 */ +#line 1944 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 269 "awkgram.y" /* yacc.c:1646 */ +#line 270 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1949 "awkgram.c" /* yacc.c:1646 */ +#line 1950 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 274 "awkgram.y" /* yacc.c:1646 */ +#line 275 "awkgram.y" /* yacc.c:1646 */ { + extensions_used = true; if (load_library((yyvsp[0])) < 0) YYABORT; efree((yyvsp[0])->lextok); bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1961 "awkgram.c" /* yacc.c:1646 */ +#line 1963 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 282 "awkgram.y" /* yacc.c:1646 */ +#line 284 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1967 "awkgram.c" /* yacc.c:1646 */ +#line 1969 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 284 "awkgram.y" /* yacc.c:1646 */ +#line 286 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1973 "awkgram.c" /* yacc.c:1646 */ +#line 1975 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 289 "awkgram.y" /* yacc.c:1646 */ +#line 291 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; rule = Rule; } -#line 1979 "awkgram.c" /* yacc.c:1646 */ +#line 1981 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 291 "awkgram.y" /* yacc.c:1646 */ +#line 293 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); rule = Rule; } -#line 1985 "awkgram.c" /* yacc.c:1646 */ +#line 1987 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 293 "awkgram.y" /* yacc.c:1646 */ +#line 295 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2011,11 +2013,11 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2015 "awkgram.c" /* yacc.c:1646 */ +#line 2017 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 319 "awkgram.y" /* yacc.c:1646 */ +#line 321 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; if (do_lint_old && ++begin_seen == 2) @@ -2026,11 +2028,11 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2030 "awkgram.c" /* yacc.c:1646 */ +#line 2032 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 330 "awkgram.y" /* yacc.c:1646 */ +#line 332 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; if (do_lint_old && ++end_seen == 2) @@ -2041,70 +2043,70 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2045 "awkgram.c" /* yacc.c:1646 */ +#line 2047 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 341 "awkgram.y" /* yacc.c:1646 */ +#line 343 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2055 "awkgram.c" /* yacc.c:1646 */ +#line 2057 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 347 "awkgram.y" /* yacc.c:1646 */ +#line 349 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2065 "awkgram.c" /* yacc.c:1646 */ +#line 2067 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 356 "awkgram.y" /* yacc.c:1646 */ +#line 358 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-3]) == NULL) (yyval) = list_create(instruction(Op_no_op)); else (yyval) = (yyvsp[-3]); } -#line 2076 "awkgram.c" /* yacc.c:1646 */ +#line 2078 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 366 "awkgram.y" /* yacc.c:1646 */ +#line 368 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2082 "awkgram.c" /* yacc.c:1646 */ +#line 2084 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 368 "awkgram.y" /* yacc.c:1646 */ +#line 370 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2088 "awkgram.c" /* yacc.c:1646 */ +#line 2090 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 370 "awkgram.y" /* yacc.c:1646 */ +#line 372 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2098 "awkgram.c" /* yacc.c:1646 */ +#line 2100 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 376 "awkgram.y" /* yacc.c:1646 */ +#line 378 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2104 "awkgram.c" /* yacc.c:1646 */ +#line 2106 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 386 "awkgram.y" /* yacc.c:1646 */ +#line 388 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-5])->source_file = source; if (install_function((yyvsp[-4])->lextok, (yyvsp[-5]), (yyvsp[-2])) < 0) @@ -2115,17 +2117,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2119 "awkgram.c" /* yacc.c:1646 */ +#line 2121 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 404 "awkgram.y" /* yacc.c:1646 */ +#line 406 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2125 "awkgram.c" /* yacc.c:1646 */ +#line 2127 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 406 "awkgram.y" /* yacc.c:1646 */ +#line 408 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2154,23 +2156,23 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2158 "awkgram.c" /* yacc.c:1646 */ +#line 2160 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 438 "awkgram.y" /* yacc.c:1646 */ +#line 440 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2164 "awkgram.c" /* yacc.c:1646 */ +#line 2166 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 444 "awkgram.y" /* yacc.c:1646 */ +#line 446 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2170 "awkgram.c" /* yacc.c:1646 */ +#line 2172 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 446 "awkgram.y" /* yacc.c:1646 */ +#line 448 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) (yyval) = (yyvsp[-1]); @@ -2183,40 +2185,40 @@ yyreduce: } yyerrok; } -#line 2187 "awkgram.c" /* yacc.c:1646 */ +#line 2189 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 459 "awkgram.y" /* yacc.c:1646 */ +#line 461 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2193 "awkgram.c" /* yacc.c:1646 */ +#line 2195 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 469 "awkgram.y" /* yacc.c:1646 */ +#line 471 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2199 "awkgram.c" /* yacc.c:1646 */ +#line 2201 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 471 "awkgram.y" /* yacc.c:1646 */ +#line 473 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2205 "awkgram.c" /* yacc.c:1646 */ +#line 2207 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 473 "awkgram.y" /* yacc.c:1646 */ +#line 475 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2216 "awkgram.c" /* yacc.c:1646 */ +#line 2218 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 480 "awkgram.y" /* yacc.c:1646 */ +#line 482 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2306,11 +2308,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2310 "awkgram.c" /* yacc.c:1646 */ +#line 2312 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 570 "awkgram.y" /* yacc.c:1646 */ +#line 572 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2352,11 +2354,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2356 "awkgram.c" /* yacc.c:1646 */ +#line 2358 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 612 "awkgram.y" /* yacc.c:1646 */ +#line 614 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2398,11 +2400,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2402 "awkgram.c" /* yacc.c:1646 */ +#line 2404 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 654 "awkgram.y" /* yacc.c:1646 */ +#line 656 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2515,44 +2517,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2519 "awkgram.c" /* yacc.c:1646 */ +#line 2521 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 767 "awkgram.y" /* yacc.c:1646 */ +#line 769 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2530 "awkgram.c" /* yacc.c:1646 */ +#line 2532 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 774 "awkgram.y" /* yacc.c:1646 */ +#line 776 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2541 "awkgram.c" /* yacc.c:1646 */ +#line 2543 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 781 "awkgram.y" /* yacc.c:1646 */ +#line 783 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2552 "awkgram.c" /* yacc.c:1646 */ +#line 2554 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 791 "awkgram.y" /* yacc.c:1646 */ +#line 793 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2561,11 +2563,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2565 "awkgram.c" /* yacc.c:1646 */ +#line 2567 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 800 "awkgram.y" /* yacc.c:1646 */ +#line 802 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2574,11 +2576,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2578 "awkgram.c" /* yacc.c:1646 */ +#line 2580 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 809 "awkgram.y" /* yacc.c:1646 */ +#line 811 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2587,11 +2589,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2591 "awkgram.c" /* yacc.c:1646 */ +#line 2593 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 818 "awkgram.y" /* yacc.c:1646 */ +#line 820 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2602,11 +2604,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2606 "awkgram.c" /* yacc.c:1646 */ +#line 2608 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 829 "awkgram.y" /* yacc.c:1646 */ +#line 831 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2621,20 +2623,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2625 "awkgram.c" /* yacc.c:1646 */ +#line 2627 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 844 "awkgram.y" /* yacc.c:1646 */ +#line 846 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2634 "awkgram.c" /* yacc.c:1646 */ +#line 2636 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 847 "awkgram.y" /* yacc.c:1646 */ +#line 849 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2655,17 +2657,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2659 "awkgram.c" /* yacc.c:1646 */ +#line 2661 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 879 "awkgram.y" /* yacc.c:1646 */ +#line 881 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2665 "awkgram.c" /* yacc.c:1646 */ +#line 2667 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 880 "awkgram.y" /* yacc.c:1646 */ +#line 882 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2762,17 +2764,17 @@ regular_print: } } } -#line 2766 "awkgram.c" /* yacc.c:1646 */ +#line 2768 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 977 "awkgram.y" /* yacc.c:1646 */ +#line 979 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2772 "awkgram.c" /* yacc.c:1646 */ +#line 2774 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 978 "awkgram.y" /* yacc.c:1646 */ +#line 980 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2805,11 +2807,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2809 "awkgram.c" /* yacc.c:1646 */ +#line 2811 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1015 "awkgram.y" /* yacc.c:1646 */ +#line 1017 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2835,52 +2837,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2839 "awkgram.c" /* yacc.c:1646 */ +#line 2841 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1041 "awkgram.y" /* yacc.c:1646 */ +#line 1043 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2845 "awkgram.c" /* yacc.c:1646 */ +#line 2847 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1046 "awkgram.y" /* yacc.c:1646 */ +#line 1048 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2851 "awkgram.c" /* yacc.c:1646 */ +#line 2853 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1048 "awkgram.y" /* yacc.c:1646 */ +#line 1050 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2857 "awkgram.c" /* yacc.c:1646 */ +#line 2859 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1053 "awkgram.y" /* yacc.c:1646 */ +#line 1055 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2863 "awkgram.c" /* yacc.c:1646 */ +#line 2865 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1055 "awkgram.y" /* yacc.c:1646 */ +#line 1057 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2874 "awkgram.c" /* yacc.c:1646 */ +#line 2876 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1062 "awkgram.y" /* yacc.c:1646 */ +#line 1064 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2880 "awkgram.c" /* yacc.c:1646 */ +#line 2882 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1067 "awkgram.y" /* yacc.c:1646 */ +#line 1069 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2892,11 +2894,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2896 "awkgram.c" /* yacc.c:1646 */ +#line 2898 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1079 "awkgram.y" /* yacc.c:1646 */ +#line 1081 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2907,17 +2909,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2911 "awkgram.c" /* yacc.c:1646 */ +#line 2913 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1093 "awkgram.y" /* yacc.c:1646 */ +#line 1095 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2917 "awkgram.c" /* yacc.c:1646 */ +#line 2919 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1095 "awkgram.y" /* yacc.c:1646 */ +#line 1097 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2925,71 +2927,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2929 "awkgram.c" /* yacc.c:1646 */ +#line 2931 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1103 "awkgram.y" /* yacc.c:1646 */ +#line 1105 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2938 "awkgram.c" /* yacc.c:1646 */ +#line 2940 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1108 "awkgram.y" /* yacc.c:1646 */ +#line 1110 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2944 "awkgram.c" /* yacc.c:1646 */ +#line 2946 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1110 "awkgram.y" /* yacc.c:1646 */ +#line 1112 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 2953 "awkgram.c" /* yacc.c:1646 */ +#line 2955 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1118 "awkgram.y" /* yacc.c:1646 */ +#line 1120 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2959 "awkgram.c" /* yacc.c:1646 */ +#line 2961 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1120 "awkgram.y" /* yacc.c:1646 */ +#line 1122 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2965 "awkgram.c" /* yacc.c:1646 */ +#line 2967 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1130 "awkgram.y" /* yacc.c:1646 */ +#line 1132 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2973 "awkgram.c" /* yacc.c:1646 */ +#line 2975 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1137 "awkgram.y" /* yacc.c:1646 */ +#line 1139 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 2983 "awkgram.c" /* yacc.c:1646 */ +#line 2985 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1142 "awkgram.y" /* yacc.c:1646 */ +#line 1144 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 2989 "awkgram.c" /* yacc.c:1646 */ +#line 2991 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1143 "awkgram.y" /* yacc.c:1646 */ +#line 1145 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -2997,136 +2999,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3001 "awkgram.c" /* yacc.c:1646 */ +#line 3003 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1154 "awkgram.y" /* yacc.c:1646 */ +#line 1156 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3009 "awkgram.c" /* yacc.c:1646 */ +#line 3011 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1159 "awkgram.y" /* yacc.c:1646 */ +#line 1161 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3017 "awkgram.c" /* yacc.c:1646 */ +#line 3019 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1176 "awkgram.y" /* yacc.c:1646 */ +#line 1178 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3023 "awkgram.c" /* yacc.c:1646 */ +#line 3025 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1178 "awkgram.y" /* yacc.c:1646 */ +#line 1180 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3032 "awkgram.c" /* yacc.c:1646 */ +#line 3034 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1186 "awkgram.y" /* yacc.c:1646 */ +#line 1188 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3038 "awkgram.c" /* yacc.c:1646 */ +#line 3040 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1188 "awkgram.y" /* yacc.c:1646 */ +#line 1190 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]) ; } -#line 3044 "awkgram.c" /* yacc.c:1646 */ +#line 3046 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1193 "awkgram.y" /* yacc.c:1646 */ +#line 1195 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3053 "awkgram.c" /* yacc.c:1646 */ +#line 3055 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1198 "awkgram.y" /* yacc.c:1646 */ +#line 1200 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3063 "awkgram.c" /* yacc.c:1646 */ +#line 3065 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1204 "awkgram.y" /* yacc.c:1646 */ +#line 1206 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3069 "awkgram.c" /* yacc.c:1646 */ +#line 3071 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1206 "awkgram.y" /* yacc.c:1646 */ +#line 1208 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3075 "awkgram.c" /* yacc.c:1646 */ +#line 3077 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1208 "awkgram.y" /* yacc.c:1646 */ +#line 1210 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3081 "awkgram.c" /* yacc.c:1646 */ +#line 3083 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1214 "awkgram.y" /* yacc.c:1646 */ +#line 1216 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3087 "awkgram.c" /* yacc.c:1646 */ +#line 3089 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1216 "awkgram.y" /* yacc.c:1646 */ +#line 1218 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3093 "awkgram.c" /* yacc.c:1646 */ +#line 3095 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1221 "awkgram.y" /* yacc.c:1646 */ +#line 1223 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3099 "awkgram.c" /* yacc.c:1646 */ +#line 3101 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1223 "awkgram.y" /* yacc.c:1646 */ +#line 1225 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3105 "awkgram.c" /* yacc.c:1646 */ +#line 3107 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1228 "awkgram.y" /* yacc.c:1646 */ +#line 1230 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3111 "awkgram.c" /* yacc.c:1646 */ +#line 3113 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1230 "awkgram.y" /* yacc.c:1646 */ +#line 1232 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3120 "awkgram.c" /* yacc.c:1646 */ +#line 3122 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1235 "awkgram.y" /* yacc.c:1646 */ +#line 1237 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3126 "awkgram.c" /* yacc.c:1646 */ +#line 3128 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1237 "awkgram.y" /* yacc.c:1646 */ +#line 1239 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3134,52 +3136,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3138 "awkgram.c" /* yacc.c:1646 */ +#line 3140 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1245 "awkgram.y" /* yacc.c:1646 */ +#line 1247 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3147 "awkgram.c" /* yacc.c:1646 */ +#line 3149 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1250 "awkgram.y" /* yacc.c:1646 */ +#line 1252 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3156 "awkgram.c" /* yacc.c:1646 */ +#line 3158 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1259 "awkgram.y" /* yacc.c:1646 */ +#line 1261 "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 3167 "awkgram.c" /* yacc.c:1646 */ +#line 3169 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1266 "awkgram.y" /* yacc.c:1646 */ +#line 1268 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3173 "awkgram.c" /* yacc.c:1646 */ +#line 3175 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1268 "awkgram.y" /* yacc.c:1646 */ +#line 1270 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3179 "awkgram.c" /* yacc.c:1646 */ +#line 3181 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1270 "awkgram.y" /* yacc.c:1646 */ +#line 1272 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3195,11 +3197,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3199 "awkgram.c" /* yacc.c:1646 */ +#line 3201 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1286 "awkgram.y" /* yacc.c:1646 */ +#line 1288 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3209,91 +3211,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3213 "awkgram.c" /* yacc.c:1646 */ +#line 3215 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1296 "awkgram.y" /* yacc.c:1646 */ +#line 1298 "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 3224 "awkgram.c" /* yacc.c:1646 */ +#line 3226 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1303 "awkgram.y" /* yacc.c:1646 */ +#line 1305 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3230 "awkgram.c" /* yacc.c:1646 */ +#line 3232 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1305 "awkgram.y" /* yacc.c:1646 */ +#line 1307 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3236 "awkgram.c" /* yacc.c:1646 */ +#line 3238 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1310 "awkgram.y" /* yacc.c:1646 */ +#line 1312 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3242 "awkgram.c" /* yacc.c:1646 */ +#line 3244 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1312 "awkgram.y" /* yacc.c:1646 */ +#line 1314 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3248 "awkgram.c" /* yacc.c:1646 */ +#line 3250 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1314 "awkgram.y" /* yacc.c:1646 */ +#line 1316 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3257 "awkgram.c" /* yacc.c:1646 */ +#line 3259 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1322 "awkgram.y" /* yacc.c:1646 */ +#line 1324 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3263 "awkgram.c" /* yacc.c:1646 */ +#line 3265 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1324 "awkgram.y" /* yacc.c:1646 */ +#line 1326 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3269 "awkgram.c" /* yacc.c:1646 */ +#line 3271 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1329 "awkgram.y" /* yacc.c:1646 */ +#line 1331 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3275 "awkgram.c" /* yacc.c:1646 */ +#line 3277 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1331 "awkgram.y" /* yacc.c:1646 */ +#line 1333 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3281 "awkgram.c" /* yacc.c:1646 */ +#line 3283 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1336 "awkgram.y" /* yacc.c:1646 */ +#line 1338 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3287 "awkgram.c" /* yacc.c:1646 */ +#line 3289 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1338 "awkgram.y" /* yacc.c:1646 */ +#line 1340 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3293 "awkgram.c" /* yacc.c:1646 */ +#line 3295 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1340 "awkgram.y" /* yacc.c:1646 */ +#line 1342 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3340,47 +3342,47 @@ regular_print: max_args = count; } } -#line 3344 "awkgram.c" /* yacc.c:1646 */ +#line 3346 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1392 "awkgram.y" /* yacc.c:1646 */ +#line 1394 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3350 "awkgram.c" /* yacc.c:1646 */ +#line 3352 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1394 "awkgram.y" /* yacc.c:1646 */ +#line 1396 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3356 "awkgram.c" /* yacc.c:1646 */ +#line 3358 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1396 "awkgram.y" /* yacc.c:1646 */ +#line 1398 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3362 "awkgram.c" /* yacc.c:1646 */ +#line 3364 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1398 "awkgram.y" /* yacc.c:1646 */ +#line 1400 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3368 "awkgram.c" /* yacc.c:1646 */ +#line 3370 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1400 "awkgram.y" /* yacc.c:1646 */ +#line 1402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3374 "awkgram.c" /* yacc.c:1646 */ +#line 3376 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1402 "awkgram.y" /* yacc.c:1646 */ +#line 1404 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3380 "awkgram.c" /* yacc.c:1646 */ +#line 3382 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1404 "awkgram.y" /* yacc.c:1646 */ +#line 1406 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3394,29 +3396,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3398 "awkgram.c" /* yacc.c:1646 */ +#line 3400 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1418 "awkgram.y" /* yacc.c:1646 */ +#line 1420 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3407 "awkgram.c" /* yacc.c:1646 */ +#line 3409 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1423 "awkgram.y" /* yacc.c:1646 */ +#line 1425 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3416 "awkgram.c" /* yacc.c:1646 */ +#line 3418 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1428 "awkgram.y" /* yacc.c:1646 */ +#line 1430 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3436,64 +3438,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3440 "awkgram.c" /* yacc.c:1646 */ +#line 3442 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1453 "awkgram.y" /* yacc.c:1646 */ +#line 1455 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3449 "awkgram.c" /* yacc.c:1646 */ +#line 3451 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1459 "awkgram.y" /* yacc.c:1646 */ +#line 1461 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3455 "awkgram.c" /* yacc.c:1646 */ +#line 3457 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1461 "awkgram.y" /* yacc.c:1646 */ +#line 1463 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3461 "awkgram.c" /* yacc.c:1646 */ +#line 3463 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1463 "awkgram.y" /* yacc.c:1646 */ +#line 1465 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3467 "awkgram.c" /* yacc.c:1646 */ +#line 3469 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1465 "awkgram.y" /* yacc.c:1646 */ +#line 1467 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3473 "awkgram.c" /* yacc.c:1646 */ +#line 3475 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1467 "awkgram.y" /* yacc.c:1646 */ +#line 1469 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3479 "awkgram.c" /* yacc.c:1646 */ +#line 3481 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1469 "awkgram.y" /* yacc.c:1646 */ +#line 1471 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3485 "awkgram.c" /* yacc.c:1646 */ +#line 3487 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1474 "awkgram.y" /* yacc.c:1646 */ +#line 1476 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3493 "awkgram.c" /* yacc.c:1646 */ +#line 3495 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1478 "awkgram.y" /* yacc.c:1646 */ +#line 1480 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3525,37 +3527,37 @@ regular_print: } } } -#line 3529 "awkgram.c" /* yacc.c:1646 */ +#line 3531 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1510 "awkgram.y" /* yacc.c:1646 */ +#line 1512 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3535 "awkgram.c" /* yacc.c:1646 */ +#line 3537 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1512 "awkgram.y" /* yacc.c:1646 */ +#line 1514 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3545 "awkgram.c" /* yacc.c:1646 */ +#line 3547 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1518 "awkgram.y" /* yacc.c:1646 */ +#line 1520 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3555 "awkgram.c" /* yacc.c:1646 */ +#line 3557 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1524 "awkgram.y" /* yacc.c:1646 */ +#line 1526 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3568,45 +3570,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3572 "awkgram.c" /* yacc.c:1646 */ +#line 3574 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1539 "awkgram.y" /* yacc.c:1646 */ +#line 1541 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3581 "awkgram.c" /* yacc.c:1646 */ +#line 3583 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1544 "awkgram.y" /* yacc.c:1646 */ +#line 1546 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3590 "awkgram.c" /* yacc.c:1646 */ +#line 3592 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1549 "awkgram.y" /* yacc.c:1646 */ +#line 1551 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3598 "awkgram.c" /* yacc.c:1646 */ +#line 3600 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1553 "awkgram.y" /* yacc.c:1646 */ +#line 1555 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3606 "awkgram.c" /* yacc.c:1646 */ +#line 3608 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1557 "awkgram.y" /* yacc.c:1646 */ +#line 1559 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3621,11 +3623,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3625 "awkgram.c" /* yacc.c:1646 */ +#line 3627 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1572 "awkgram.y" /* yacc.c:1646 */ +#line 1574 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3635,20 +3637,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3639 "awkgram.c" /* yacc.c:1646 */ +#line 3641 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1585 "awkgram.y" /* yacc.c:1646 */ +#line 1587 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3648 "awkgram.c" /* yacc.c:1646 */ +#line 3650 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1590 "awkgram.y" /* yacc.c:1646 */ +#line 1592 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3681,11 +3683,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3685 "awkgram.c" /* yacc.c:1646 */ +#line 3687 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1626 "awkgram.y" /* yacc.c:1646 */ +#line 1628 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3699,49 +3701,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3703 "awkgram.c" /* yacc.c:1646 */ +#line 3705 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1643 "awkgram.y" /* yacc.c:1646 */ +#line 1645 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3709 "awkgram.c" /* yacc.c:1646 */ +#line 3711 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1645 "awkgram.y" /* yacc.c:1646 */ +#line 1647 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3715 "awkgram.c" /* yacc.c:1646 */ +#line 3717 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1650 "awkgram.y" /* yacc.c:1646 */ +#line 1652 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3721 "awkgram.c" /* yacc.c:1646 */ +#line 3723 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1652 "awkgram.y" /* yacc.c:1646 */ +#line 1654 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3727 "awkgram.c" /* yacc.c:1646 */ +#line 3729 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1657 "awkgram.y" /* yacc.c:1646 */ +#line 1659 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3733 "awkgram.c" /* yacc.c:1646 */ +#line 3735 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1659 "awkgram.y" /* yacc.c:1646 */ +#line 1661 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3741 "awkgram.c" /* yacc.c:1646 */ +#line 3743 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1666 "awkgram.y" /* yacc.c:1646 */ +#line 1668 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3755,11 +3757,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3759 "awkgram.c" /* yacc.c:1646 */ +#line 3761 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1683 "awkgram.y" /* yacc.c:1646 */ +#line 1685 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3773,31 +3775,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3777 "awkgram.c" /* yacc.c:1646 */ +#line 3779 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1700 "awkgram.y" /* yacc.c:1646 */ +#line 1702 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3783 "awkgram.c" /* yacc.c:1646 */ +#line 3785 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1702 "awkgram.y" /* yacc.c:1646 */ +#line 1704 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3791 "awkgram.c" /* yacc.c:1646 */ +#line 3793 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1709 "awkgram.y" /* yacc.c:1646 */ +#line 1711 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3797 "awkgram.c" /* yacc.c:1646 */ +#line 3799 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1714 "awkgram.y" /* yacc.c:1646 */ +#line 1716 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3805,22 +3807,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3809 "awkgram.c" /* yacc.c:1646 */ +#line 3811 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1722 "awkgram.y" /* yacc.c:1646 */ +#line 1724 "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 3820 "awkgram.c" /* yacc.c:1646 */ +#line 3822 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1732 "awkgram.y" /* yacc.c:1646 */ +#line 1734 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3832,73 +3834,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3836 "awkgram.c" /* yacc.c:1646 */ +#line 3838 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1744 "awkgram.y" /* yacc.c:1646 */ +#line 1746 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3846 "awkgram.c" /* yacc.c:1646 */ +#line 3848 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1753 "awkgram.y" /* yacc.c:1646 */ +#line 1755 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3854 "awkgram.c" /* yacc.c:1646 */ +#line 3856 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1757 "awkgram.y" /* yacc.c:1646 */ +#line 1759 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3862 "awkgram.c" /* yacc.c:1646 */ +#line 3864 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1760 "awkgram.y" /* yacc.c:1646 */ +#line 1762 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3868 "awkgram.c" /* yacc.c:1646 */ +#line 3870 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1768 "awkgram.y" /* yacc.c:1646 */ +#line 1770 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3874 "awkgram.c" /* yacc.c:1646 */ +#line 3876 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1772 "awkgram.y" /* yacc.c:1646 */ +#line 1774 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3880 "awkgram.c" /* yacc.c:1646 */ +#line 3882 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1781 "awkgram.y" /* yacc.c:1646 */ +#line 1783 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3886 "awkgram.c" /* yacc.c:1646 */ +#line 3888 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1785 "awkgram.y" /* yacc.c:1646 */ +#line 1787 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3892 "awkgram.c" /* yacc.c:1646 */ +#line 3894 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1789 "awkgram.y" /* yacc.c:1646 */ +#line 1791 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3898 "awkgram.c" /* yacc.c:1646 */ +#line 3900 "awkgram.c" /* yacc.c:1646 */ break; -#line 3902 "awkgram.c" /* yacc.c:1646 */ +#line 3904 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4126,7 +4128,7 @@ yyreturn: #endif return yyresult; } -#line 1791 "awkgram.y" /* yacc.c:1906 */ +#line 1793 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -4683,6 +4685,8 @@ do_add_srcfile(enum srctype stype, char *src, char *path, SRCFILE *thisfile) s->prev = thisfile->prev; thisfile->prev->next = s; thisfile->prev = s; + if (stype == SRC_EXTLIB) + extensions_used = true; return s; } @@ -6811,6 +6815,7 @@ static bool is_deferred_variable(const char *name) { struct deferred_variable *dv; + for (dv = deferred_variables; dv != NULL; dv = dv->next) if (strcmp(name, dv->name) == 0) return true; @@ -6852,18 +6857,17 @@ variable(int location, char *name, NODETYPE type) return r; } -/* process_deferred --- if the program uses SYMTAB, load deferred variables */ +/* process_deferred --- if the program uses SYMTAB or extensions, load deferred variables */ static void process_deferred() { struct deferred_variable *dv; - if (! symtab_used) - return; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - (void) dv->load_func(); + if (symtab_used || extensions_used) { + for (dv = deferred_variables; dv != NULL; dv = dv->next) { + (void) dv->load_func(); + } } } diff --git a/awkgram.y b/awkgram.y index 267cf077..b43e305d 100644 --- a/awkgram.y +++ b/awkgram.y @@ -120,6 +120,7 @@ static int lasttok = 0; static bool eof_warned = false; /* GLOBAL: want warning for each file */ static int break_allowed; /* kludge for break */ static int continue_allowed; /* kludge for continue */ +static bool extensions_used = false; /* program uses extensions */ #define END_FILE -1000 #define END_SRC -2000 @@ -272,6 +273,7 @@ source library : FILENAME { + extensions_used = true; if (load_library($1) < 0) YYABORT; efree($1->lextok); @@ -2344,6 +2346,8 @@ do_add_srcfile(enum srctype stype, char *src, char *path, SRCFILE *thisfile) s->prev = thisfile->prev; thisfile->prev->next = s; thisfile->prev = s; + if (stype == SRC_EXTLIB) + extensions_used = true; return s; } @@ -4472,6 +4476,7 @@ static bool is_deferred_variable(const char *name) { struct deferred_variable *dv; + for (dv = deferred_variables; dv != NULL; dv = dv->next) if (strcmp(name, dv->name) == 0) return true; @@ -4513,18 +4518,17 @@ variable(int location, char *name, NODETYPE type) return r; } -/* process_deferred --- if the program uses SYMTAB, load deferred variables */ +/* process_deferred --- if the program uses SYMTAB or extensions, load deferred variables */ static void process_deferred() { struct deferred_variable *dv; - if (! symtab_used) - return; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - (void) dv->load_func(); + if (symtab_used || extensions_used) { + for (dv = deferred_variables; dv != NULL; dv = dv->next) { + (void) dv->load_func(); + } } } diff --git a/extension/ChangeLog b/extension/ChangeLog index 41c8a0e4..582a3440 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,7 @@ +2015-01-07 Arnold D. Robbins + + * testext.c (var_test): Adjust for PROCINFO now being there. + 2014-11-23 Arnold D. Robbins * inplace.c (do_inplace_begin): Jump through hoops to silence diff --git a/extension/testext.c b/extension/testext.c index 7462265b..4a1e7032 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2012, 2013, 2014 + * Copyright (C) 2012, 2013, 2014, 2015 * the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the @@ -302,11 +302,11 @@ var_test(int nargs, awk_value_t *result) goto out; } - /* look up PROCINFO - should fail */ + /* look up PROCINFO - should succeed fail */ if (sym_lookup("PROCINFO", AWK_ARRAY, & value)) - printf("var_test: sym_lookup of PROCINFO failed - got a value!\n"); + printf("var_test: sym_lookup of PROCINFO passed - got a value!\n"); else - printf("var_test: sym_lookup of PROCINFO passed - did not get a value\n"); + printf("var_test: sym_lookup of PROCINFO failed - did not get a value\n"); /* look up a reserved variable - should pass */ if (sym_lookup("ARGC", AWK_NUMBER, & value)) diff --git a/test/ChangeLog b/test/ChangeLog index 8d6086b3..2cc88514 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -8,6 +8,10 @@ * Makefile.am (printfbad4): New test. * printfbad4.awk, printfbad4.ok: New files. + Unrelated: + + * testext.ok: Adjust for code changes. + 2014-12-24 Arnold D. Robbins * Makefile.am (badbuild): New test. diff --git a/test/testext.ok b/test/testext.ok index 9b36bf72..a828ecb2 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -15,7 +15,7 @@ try_modify_environ: set_array_element of ENVIRON failed try_modify_environ: marking element "testext" for deletion try_del_environ() could not delete element - pass try_del_environ() could not add an element - pass -var_test: sym_lookup of PROCINFO passed - did not get a value +var_test: sym_lookup of PROCINFO passed - got a value! var_test: sym_lookup of ARGC passed - got a value! var_test: sym_update of ARGC failed - correctly var_test: sym_update("testvar") succeeded -- cgit v1.2.3 From 41483acb1969b24e336b11aaf3bfdc1dbdfe33a8 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 8 Jan 2015 09:20:09 -0500 Subject: Revert changes to API deferred variable creation, since this should be done at lookup time. --- ChangeLog | 10 ++++++++++ awk.h | 1 - awkgram.c | 39 ++++++++++++++++++--------------------- awkgram.y | 39 ++++++++++++++++++--------------------- gawkapi.c | 45 ++++----------------------------------------- 5 files changed, 50 insertions(+), 84 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e549065..0498088d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2015-01-08 Andrew J. Schorr + + Revert changes to API deferred variable creation -- these variables + should be created when lookup is called, not when update is called. + * awk.h (variable_create): Remove function declaration. + * awkgram.y (variable_create): Remove function. + (variable): Restore variable_create functionality inline. + * gawkapi.c (api_sym_update): Revert to using install_symbol, since the + deferred variable check should be done when lookup is called, not here. + 2015-01-07 Andrew J. Schorr * gawkapi.c (api_set_array_element): Remove stray call to diff --git a/awk.h b/awk.h index f624a876..bb63f65a 100644 --- a/awk.h +++ b/awk.h @@ -1318,7 +1318,6 @@ extern NODE *do_asorti(int nargs); extern unsigned long (*hash)(const char *s, size_t len, unsigned long hsize, size_t *code); extern void init_env_array(NODE *env_node); /* awkgram.c */ -extern NODE *variable_create(char *name, NODETYPE type, bool *is_deferred); extern NODE *variable(int location, char *name, NODETYPE type); extern int parse_program(INSTRUCTION **pcode); extern void track_ext_func(const char *name); diff --git a/awkgram.c b/awkgram.c index 249fdcdf..adb31d9c 100644 --- a/awkgram.c +++ b/awkgram.c @@ -7052,22 +7052,6 @@ is_deferred_variable(const char *name) return false; } -/* variable_create --- create a new variable */ -NODE * -variable_create(char *name, NODETYPE type, bool *is_deferred) -{ - struct deferred_variable *dv; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - if (strcmp(name, dv->name) == 0) { - efree(name); - *is_deferred = true; - return (*dv->load_func)(); - } - } - *is_deferred = false; - return install_symbol(name, type); -} /* variable --- make sure NAME is in the symbol table */ @@ -7075,7 +7059,6 @@ NODE * variable(int location, char *name, NODETYPE type) { NODE *r; - bool is_deferred; if ((r = lookup(name)) != NULL) { if (r->type == Node_func || r->type == Node_ext_func ) @@ -7083,11 +7066,25 @@ variable(int location, char *name, NODETYPE type) r->vname); if (r == symbol_table) symtab_used = true; - efree(name); - return r; + } else { + /* not found */ + struct deferred_variable *dv; + + for (dv = deferred_variables; true; dv = dv->next) { + if (dv == NULL) { + /* + * This is the only case in which we may not free the string. + */ + return install_symbol(name, type); + } + if (strcmp(name, dv->name) == 0) { + r = (*dv->load_func)(); + break; + } + } } - /* not found */ - return variable_create(name, type, & is_deferred); + efree(name); + return r; } /* process_deferred --- if the program uses SYMTAB, load deferred variables */ diff --git a/awkgram.y b/awkgram.y index 461bd6b0..52284af4 100644 --- a/awkgram.y +++ b/awkgram.y @@ -4714,22 +4714,6 @@ is_deferred_variable(const char *name) return false; } -/* variable_create --- create a new variable */ -NODE * -variable_create(char *name, NODETYPE type, bool *is_deferred) -{ - struct deferred_variable *dv; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - if (strcmp(name, dv->name) == 0) { - efree(name); - *is_deferred = true; - return (*dv->load_func)(); - } - } - *is_deferred = false; - return install_symbol(name, type); -} /* variable --- make sure NAME is in the symbol table */ @@ -4737,7 +4721,6 @@ NODE * variable(int location, char *name, NODETYPE type) { NODE *r; - bool is_deferred; if ((r = lookup(name)) != NULL) { if (r->type == Node_func || r->type == Node_ext_func ) @@ -4745,11 +4728,25 @@ variable(int location, char *name, NODETYPE type) r->vname); if (r == symbol_table) symtab_used = true; - efree(name); - return r; + } else { + /* not found */ + struct deferred_variable *dv; + + for (dv = deferred_variables; true; dv = dv->next) { + if (dv == NULL) { + /* + * This is the only case in which we may not free the string. + */ + return install_symbol(name, type); + } + if (strcmp(name, dv->name) == 0) { + r = (*dv->load_func)(); + break; + } + } } - /* not found */ - return variable_create(name, type, & is_deferred); + efree(name); + return r; } /* process_deferred --- if the program uses SYMTAB, load deferred variables */ diff --git a/gawkapi.c b/gawkapi.c index 749be178..f8d04986 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -579,48 +579,11 @@ api_sym_update(awk_ext_id_t id, if (node == NULL) { /* new value to be installed */ if (value->val_type == AWK_ARRAY) { - bool is_deferred; - array_node = awk_value_to_node(value); - /* - * use variable_create instead of install_symbol in - * case this is a deferred variable such as PROCINFO - * or ENVIRON - */ - node = variable_create(estrdup((char *) name, strlen(name)), Node_var_array, & is_deferred); - if (is_deferred) { - /* - * merge the user-supplied elements into the - * already-existing array. Since ENVIRON - * has special array_funcs, we need to retain - * the auto-created array! - */ - unsigned long nel; - NODE **list; - NODE akind; - unsigned long i; - - nel = assoc_length(array_node); - akind.flags = (AINDEX|AVALUE); - list = array_node->alist(array_node, & akind); - for (i = 0; i < nel; i++) { - NODE **aptr; - NODE *elem; - aptr = assoc_lookup(node, list[2*i]); - unref(*aptr); - elem = *aptr = dupnode(list[2*i+1]); - if (elem->type == Node_var_array) - elem->parent_array = node; - if (node->astore != NULL) - (*node->astore)(node, list[2*i]); - unref(list[2*i]); /* alist duped it */ - } - efree(list); - assoc_clear(array_node); - } else { - array_node->vname = node->vname; - *node = *array_node; - } + node = install_symbol(estrdup((char *) name, strlen(name)), + Node_var_array); + array_node->vname = node->vname; + *node = *array_node; freenode(array_node); value->array_cookie = node; /* pass new cookie back to extension */ } else { -- cgit v1.2.3 From f8fecb69346cbcd774a73a49322aeb8ddea73e44 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 8 Jan 2015 09:41:19 -0500 Subject: When an extension calls sym_lookup on a deferred variable, it should always succeed. --- ChangeLog | 9 +++++++++ awk.h | 1 + awkgram.c | 9 +++++++++ awkgram.y | 9 +++++++++ extension/ChangeLog | 6 ++++++ extension/testext.c | 18 ++++++++---------- gawkapi.c | 14 ++++++++++++-- test/ChangeLog | 4 ++++ test/testext.ok | 2 +- 9 files changed, 59 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0498088d..931972d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-01-08 Andrew J. Schorr + + * awk.h (deferred_create): Declare new function. + * awkgram.y (deferred_create): New function. + * gawkapi.c (lookup_deferred): New helper function to call lookup and + then deferred_create if lookup fails. + (api_sym_lookup, api_sym_update): Call lookup_deferred instead of + lookup. + 2015-01-08 Andrew J. Schorr Revert changes to API deferred variable creation -- these variables diff --git a/awk.h b/awk.h index bb63f65a..eddcb18f 100644 --- a/awk.h +++ b/awk.h @@ -1318,6 +1318,7 @@ extern NODE *do_asorti(int nargs); extern unsigned long (*hash)(const char *s, size_t len, unsigned long hsize, size_t *code); extern void init_env_array(NODE *env_node); /* awkgram.c */ +extern NODE *deferred_create(const char *name); extern NODE *variable(int location, char *name, NODETYPE type); extern int parse_program(INSTRUCTION **pcode); extern void track_ext_func(const char *name); diff --git a/awkgram.c b/awkgram.c index adb31d9c..bc79df58 100644 --- a/awkgram.c +++ b/awkgram.c @@ -7052,6 +7052,15 @@ is_deferred_variable(const char *name) return false; } +NODE * +deferred_create(const char *name) +{ + struct deferred_variable *dv; + for (dv = deferred_variables; dv != NULL; dv = dv->next) + if (strcmp(name, dv->name) == 0) + return (*dv->load_func)(); + return NULL; +} /* variable --- make sure NAME is in the symbol table */ diff --git a/awkgram.y b/awkgram.y index 52284af4..1399262d 100644 --- a/awkgram.y +++ b/awkgram.y @@ -4714,6 +4714,15 @@ is_deferred_variable(const char *name) return false; } +NODE * +deferred_create(const char *name) +{ + struct deferred_variable *dv; + for (dv = deferred_variables; dv != NULL; dv = dv->next) + if (strcmp(name, dv->name) == 0) + return (*dv->load_func)(); + return NULL; +} /* variable --- make sure NAME is in the symbol table */ diff --git a/extension/ChangeLog b/extension/ChangeLog index c8f77042..15153213 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2015-01-08 Andrew J. Schorr + + * testext.c (var_test): Lookup of PROCINFO should always succeed. + (test_deferred): PROCINFO should always be present, so call lookup + to grab it. + 2015-01-06 Andrew J. Schorr * testext.c (test_deferred): New function to help with testing diff --git a/extension/testext.c b/extension/testext.c index 7c61bb0d..42ec0915 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -303,11 +303,11 @@ var_test(int nargs, awk_value_t *result) goto out; } - /* look up PROCINFO - should fail */ + /* look up PROCINFO - should succeed */ if (sym_lookup("PROCINFO", AWK_ARRAY, & value)) - printf("var_test: sym_lookup of PROCINFO failed - got a value!\n"); + printf("var_test: sym_lookup of PROCINFO passed - got a value!\n"); else - printf("var_test: sym_lookup of PROCINFO passed - did not get a value\n"); + printf("var_test: sym_lookup of PROCINFO failed - did not get a value\n"); /* look up a reserved variable - should pass */ if (sym_lookup("ARGC", AWK_NUMBER, & value)) @@ -399,8 +399,11 @@ test_deferred(int nargs, awk_value_t *result) printf("test_deferred: nargs not right (%d should be 0)\n", nargs); goto out; } - arr.val_type = AWK_ARRAY; - arr.array_cookie = create_array(); + + if (! sym_lookup("PROCINFO", AWK_ARRAY, & arr)) { + printf("test_deferred: %d: sym_lookup failed\n", __LINE__); + goto out; + } for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { make_const_string(seed[i].name, strlen(seed[i].name), & index); @@ -411,11 +414,6 @@ test_deferred(int nargs, awk_value_t *result) } } - if (! sym_update("PROCINFO", & arr)) { - printf("test_deferred: %d: sym_update failed\n", __LINE__); - goto out; - } - /* test that it still contains the values we loaded */ for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { make_const_string(seed[i].name, strlen(seed[i].name), & index); diff --git a/gawkapi.c b/gawkapi.c index f8d04986..0213936a 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -486,6 +486,16 @@ node_to_awk_value(NODE *node, awk_value_t *val, awk_valtype_t wanted) return ret; } +static NODE * +lookup_deferred(const char *name) +{ + NODE *node; + + if ((node = lookup(name)) != NULL) + return node; + return deferred_create(name); +} + /* * Symbol table access: * - No access to special variables (NF, etc.) @@ -516,7 +526,7 @@ api_sym_lookup(awk_ext_id_t id, if ( name == NULL || *name == '\0' || result == NULL - || (node = lookup(name)) == NULL) + || (node = lookup_deferred(name)) == NULL) return awk_false; if (is_off_limits_var(name)) /* a built-in variable */ @@ -574,7 +584,7 @@ api_sym_update(awk_ext_id_t id, return awk_false; } - node = lookup(name); + node = lookup_deferred(name); if (node == NULL) { /* new value to be installed */ diff --git a/test/ChangeLog b/test/ChangeLog index 7522f7aa..06b4c8bc 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2015-01-08 Andrew J. Schorr + + * testext.ok: PROCINFO lookup should succeed. + 2015-01-06 Andrew J. Schorr * Makefile.am (EXTRA_DIST): Add defvar.awk and defvar.ok. diff --git a/test/testext.ok b/test/testext.ok index 5a78c159..9dae010f 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -15,7 +15,7 @@ try_modify_environ: set_array_element of ENVIRON failed try_modify_environ: marking element "testext" for deletion try_del_environ() could not delete element - pass try_del_environ() could not add an element - pass -var_test: sym_lookup of PROCINFO passed - did not get a value +var_test: sym_lookup of PROCINFO passed - got a value! var_test: sym_lookup of ARGC passed - got a value! var_test: sym_update of ARGC failed - correctly var_test: sym_update("testvar") succeeded -- cgit v1.2.3 From 0e829ea9a5062cac730f5a8368ab2062c1ef67fd Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 14 Jan 2015 19:51:49 +0200 Subject: Remove deferred variables. --- ChangeLog | 11 + awk.h | 1 - awkgram.c | 806 +++++++++++++++++++++++++------------------------------ awkgram.y | 88 +----- builtin.c | 3 + main.c | 6 +- test/ChangeLog | 4 + test/dumpvars.ok | 2 + test/id.ok | 1 + 9 files changed, 387 insertions(+), 535 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef077154..7de69351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2015-01-14 Arnold D. Robbins + + Remove deferred variables. + + * awk.h (register_deferred_variable): Remove declaration. + * awkgram.y (is_deferred_variable, process_deferred, + symtab_used, extensions_used, deferred_variables, + process_deferred): Remove declarations, bodies, and uses. + * builtin.c (do_length): Update comment. + * main.c (init_vars): Just call load_procinfo() and `load_environ()'. + 2015-01-07 Arnold D. Robbins * configure.ac: Update debug flags if developing. diff --git a/awk.h b/awk.h index 3abad6f8..92baa7a7 100644 --- a/awk.h +++ b/awk.h @@ -1322,7 +1322,6 @@ extern void shadow_funcs(void); extern int check_special(const char *name); extern SRCFILE *add_srcfile(enum srctype stype, char *src, SRCFILE *curr, bool *already_included, int *errcode); extern void free_srcfile(SRCFILE *thisfile); -extern void register_deferred_variable(const char *name, NODE *(*load_func)(void)); extern int files_are_same(char *path, SRCFILE *src); extern void valinfo(NODE *n, Func_print print_func, FILE *fp); extern void negate_num(NODE *n); diff --git a/awkgram.c b/awkgram.c index b24e6027..99f067e7 100644 --- a/awkgram.c +++ b/awkgram.c @@ -97,7 +97,6 @@ static int include_source(INSTRUCTION *file); static int load_library(INSTRUCTION *file); static void next_sourcefile(void); static char *tokexpand(void); -static bool is_deferred_variable(const char *name); #define instruction(t) bcalloc(t, 1, 0) @@ -119,8 +118,6 @@ static int count_expressions(INSTRUCTION **list, bool isarg); static INSTRUCTION *optimize_assignment(INSTRUCTION *exp); static void add_lint(INSTRUCTION *list, LINTTYPE linttype); -static void process_deferred(); - enum defref { FUNC_DEFINE, FUNC_USE, FUNC_EXT }; static void func_use(const char *name, enum defref how); static void check_funcs(void); @@ -131,7 +128,6 @@ static int one_line_close(int fd); static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ static char *in_function; /* parsing kludge */ -static bool symtab_used = false; /* program used SYMTAB */ static int rule = 0; const char *const ruletab[] = { @@ -160,7 +156,6 @@ static int lasttok = 0; static bool eof_warned = false; /* GLOBAL: want warning for each file */ static int break_allowed; /* kludge for break */ static int continue_allowed; /* kludge for continue */ -static bool extensions_used = false; /* program uses extensions */ #define END_FILE -1000 #define END_SRC -2000 @@ -196,7 +191,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -#line 200 "awkgram.c" /* yacc.c:339 */ +#line 195 "awkgram.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -350,7 +345,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 354 "awkgram.c" /* yacc.c:358 */ +#line 349 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -652,25 +647,25 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 199, 199, 201, 206, 207, 213, 225, 229, 240, - 246, 251, 259, 267, 269, 274, 283, 285, 291, 292, - 294, 320, 331, 342, 348, 357, 367, 369, 371, 377, - 382, 383, 387, 406, 405, 439, 441, 446, 447, 460, - 465, 466, 470, 472, 474, 481, 571, 613, 655, 768, - 775, 782, 792, 801, 810, 819, 830, 846, 845, 869, - 881, 881, 979, 979, 1012, 1042, 1048, 1049, 1055, 1056, - 1063, 1068, 1080, 1094, 1096, 1104, 1109, 1111, 1119, 1121, - 1130, 1131, 1139, 1144, 1144, 1155, 1159, 1167, 1168, 1171, - 1173, 1178, 1179, 1188, 1189, 1194, 1199, 1205, 1207, 1209, - 1216, 1217, 1223, 1224, 1229, 1231, 1236, 1238, 1246, 1251, - 1260, 1267, 1269, 1271, 1287, 1297, 1304, 1306, 1311, 1313, - 1315, 1323, 1325, 1330, 1332, 1337, 1339, 1341, 1391, 1393, - 1395, 1397, 1399, 1401, 1403, 1405, 1419, 1424, 1429, 1454, - 1460, 1462, 1464, 1466, 1468, 1470, 1475, 1479, 1511, 1513, - 1519, 1525, 1538, 1539, 1540, 1545, 1550, 1554, 1558, 1573, - 1586, 1591, 1627, 1645, 1646, 1652, 1653, 1658, 1660, 1667, - 1684, 1701, 1703, 1710, 1715, 1723, 1733, 1745, 1754, 1758, - 1762, 1766, 1770, 1774, 1777, 1779, 1783, 1787, 1791 + 0, 194, 194, 196, 201, 202, 206, 218, 222, 233, + 239, 244, 252, 260, 262, 267, 275, 277, 283, 284, + 286, 312, 323, 334, 340, 349, 359, 361, 363, 369, + 374, 375, 379, 398, 397, 431, 433, 438, 439, 452, + 457, 458, 462, 464, 466, 473, 563, 605, 647, 760, + 767, 774, 784, 793, 802, 811, 822, 838, 837, 861, + 873, 873, 971, 971, 1004, 1034, 1040, 1041, 1047, 1048, + 1055, 1060, 1072, 1086, 1088, 1096, 1101, 1103, 1111, 1113, + 1122, 1123, 1131, 1136, 1136, 1147, 1151, 1159, 1160, 1163, + 1165, 1170, 1171, 1180, 1181, 1186, 1191, 1197, 1199, 1201, + 1208, 1209, 1215, 1216, 1221, 1223, 1228, 1230, 1238, 1243, + 1252, 1259, 1261, 1263, 1279, 1289, 1296, 1298, 1303, 1305, + 1307, 1315, 1317, 1322, 1324, 1329, 1331, 1333, 1383, 1385, + 1387, 1389, 1391, 1393, 1395, 1397, 1411, 1416, 1421, 1446, + 1452, 1454, 1456, 1458, 1460, 1462, 1467, 1471, 1503, 1505, + 1511, 1517, 1530, 1531, 1532, 1537, 1542, 1546, 1550, 1565, + 1578, 1583, 1619, 1637, 1638, 1644, 1645, 1650, 1652, 1659, + 1676, 1693, 1695, 1702, 1707, 1715, 1725, 1737, 1746, 1750, + 1754, 1758, 1762, 1766, 1769, 1771, 1775, 1779, 1783 }; #endif @@ -1843,26 +1838,24 @@ yyreduce: switch (yyn) { case 3: -#line 202 "awkgram.y" /* yacc.c:1646 */ +#line 197 "awkgram.y" /* yacc.c:1646 */ { rule = 0; yyerrok; } -#line 1852 "awkgram.c" /* yacc.c:1646 */ +#line 1847 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 208 "awkgram.y" /* yacc.c:1646 */ +#line 203 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); - if (sourcefile == srcfiles) - process_deferred(); } -#line 1862 "awkgram.c" /* yacc.c:1646 */ +#line 1855 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 214 "awkgram.y" /* yacc.c:1646 */ +#line 207 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -1871,19 +1864,19 @@ yyreduce: */ /* yyerrok; */ } -#line 1875 "awkgram.c" /* yacc.c:1646 */ +#line 1868 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 226 "awkgram.y" /* yacc.c:1646 */ +#line 219 "awkgram.y" /* yacc.c:1646 */ { (void) append_rule((yyvsp[-1]), (yyvsp[0])); } -#line 1883 "awkgram.c" /* yacc.c:1646 */ +#line 1876 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 230 "awkgram.y" /* yacc.c:1646 */ +#line 223 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1894,39 +1887,39 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1898 "awkgram.c" /* yacc.c:1646 */ +#line 1891 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 241 "awkgram.y" /* yacc.c:1646 */ +#line 234 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1908 "awkgram.c" /* yacc.c:1646 */ +#line 1901 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 247 "awkgram.y" /* yacc.c:1646 */ +#line 240 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1917 "awkgram.c" /* yacc.c:1646 */ +#line 1910 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 252 "awkgram.y" /* yacc.c:1646 */ +#line 245 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1926 "awkgram.c" /* yacc.c:1646 */ +#line 1919 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 260 "awkgram.y" /* yacc.c:1646 */ +#line 253 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1934,60 +1927,59 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1938 "awkgram.c" /* yacc.c:1646 */ +#line 1931 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 268 "awkgram.y" /* yacc.c:1646 */ +#line 261 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1944 "awkgram.c" /* yacc.c:1646 */ +#line 1937 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 270 "awkgram.y" /* yacc.c:1646 */ +#line 263 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1950 "awkgram.c" /* yacc.c:1646 */ +#line 1943 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 275 "awkgram.y" /* yacc.c:1646 */ +#line 268 "awkgram.y" /* yacc.c:1646 */ { - extensions_used = true; if (load_library((yyvsp[0])) < 0) YYABORT; efree((yyvsp[0])->lextok); bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1963 "awkgram.c" /* yacc.c:1646 */ +#line 1955 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 284 "awkgram.y" /* yacc.c:1646 */ +#line 276 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1969 "awkgram.c" /* yacc.c:1646 */ +#line 1961 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 286 "awkgram.y" /* yacc.c:1646 */ +#line 278 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1975 "awkgram.c" /* yacc.c:1646 */ +#line 1967 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 291 "awkgram.y" /* yacc.c:1646 */ +#line 283 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; rule = Rule; } -#line 1981 "awkgram.c" /* yacc.c:1646 */ +#line 1973 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 293 "awkgram.y" /* yacc.c:1646 */ +#line 285 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); rule = Rule; } -#line 1987 "awkgram.c" /* yacc.c:1646 */ +#line 1979 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 295 "awkgram.y" /* yacc.c:1646 */ +#line 287 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2013,11 +2005,11 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2017 "awkgram.c" /* yacc.c:1646 */ +#line 2009 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 321 "awkgram.y" /* yacc.c:1646 */ +#line 313 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; if (do_lint_old && ++begin_seen == 2) @@ -2028,11 +2020,11 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2032 "awkgram.c" /* yacc.c:1646 */ +#line 2024 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 332 "awkgram.y" /* yacc.c:1646 */ +#line 324 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; if (do_lint_old && ++end_seen == 2) @@ -2043,70 +2035,70 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2047 "awkgram.c" /* yacc.c:1646 */ +#line 2039 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 343 "awkgram.y" /* yacc.c:1646 */ +#line 335 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2057 "awkgram.c" /* yacc.c:1646 */ +#line 2049 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 349 "awkgram.y" /* yacc.c:1646 */ +#line 341 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2067 "awkgram.c" /* yacc.c:1646 */ +#line 2059 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 358 "awkgram.y" /* yacc.c:1646 */ +#line 350 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-3]) == NULL) (yyval) = list_create(instruction(Op_no_op)); else (yyval) = (yyvsp[-3]); } -#line 2078 "awkgram.c" /* yacc.c:1646 */ +#line 2070 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 368 "awkgram.y" /* yacc.c:1646 */ +#line 360 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2084 "awkgram.c" /* yacc.c:1646 */ +#line 2076 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 370 "awkgram.y" /* yacc.c:1646 */ +#line 362 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2090 "awkgram.c" /* yacc.c:1646 */ +#line 2082 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 372 "awkgram.y" /* yacc.c:1646 */ +#line 364 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2100 "awkgram.c" /* yacc.c:1646 */ +#line 2092 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 378 "awkgram.y" /* yacc.c:1646 */ +#line 370 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2106 "awkgram.c" /* yacc.c:1646 */ +#line 2098 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 388 "awkgram.y" /* yacc.c:1646 */ +#line 380 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-5])->source_file = source; if (install_function((yyvsp[-4])->lextok, (yyvsp[-5]), (yyvsp[-2])) < 0) @@ -2117,17 +2109,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2121 "awkgram.c" /* yacc.c:1646 */ +#line 2113 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 406 "awkgram.y" /* yacc.c:1646 */ +#line 398 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2127 "awkgram.c" /* yacc.c:1646 */ +#line 2119 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 408 "awkgram.y" /* yacc.c:1646 */ +#line 400 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2156,23 +2148,23 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2160 "awkgram.c" /* yacc.c:1646 */ +#line 2152 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 440 "awkgram.y" /* yacc.c:1646 */ +#line 432 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2166 "awkgram.c" /* yacc.c:1646 */ +#line 2158 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 446 "awkgram.y" /* yacc.c:1646 */ +#line 438 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2172 "awkgram.c" /* yacc.c:1646 */ +#line 2164 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 448 "awkgram.y" /* yacc.c:1646 */ +#line 440 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) (yyval) = (yyvsp[-1]); @@ -2185,40 +2177,40 @@ yyreduce: } yyerrok; } -#line 2189 "awkgram.c" /* yacc.c:1646 */ +#line 2181 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 461 "awkgram.y" /* yacc.c:1646 */ +#line 453 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2195 "awkgram.c" /* yacc.c:1646 */ +#line 2187 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 471 "awkgram.y" /* yacc.c:1646 */ +#line 463 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2201 "awkgram.c" /* yacc.c:1646 */ +#line 2193 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 473 "awkgram.y" /* yacc.c:1646 */ +#line 465 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2207 "awkgram.c" /* yacc.c:1646 */ +#line 2199 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 475 "awkgram.y" /* yacc.c:1646 */ +#line 467 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2218 "awkgram.c" /* yacc.c:1646 */ +#line 2210 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 482 "awkgram.y" /* yacc.c:1646 */ +#line 474 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2308,11 +2300,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2312 "awkgram.c" /* yacc.c:1646 */ +#line 2304 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 572 "awkgram.y" /* yacc.c:1646 */ +#line 564 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2354,11 +2346,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2358 "awkgram.c" /* yacc.c:1646 */ +#line 2350 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 614 "awkgram.y" /* yacc.c:1646 */ +#line 606 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2400,11 +2392,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2404 "awkgram.c" /* yacc.c:1646 */ +#line 2396 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 656 "awkgram.y" /* yacc.c:1646 */ +#line 648 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2517,44 +2509,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2521 "awkgram.c" /* yacc.c:1646 */ +#line 2513 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 769 "awkgram.y" /* yacc.c:1646 */ +#line 761 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2532 "awkgram.c" /* yacc.c:1646 */ +#line 2524 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 776 "awkgram.y" /* yacc.c:1646 */ +#line 768 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2543 "awkgram.c" /* yacc.c:1646 */ +#line 2535 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 783 "awkgram.y" /* yacc.c:1646 */ +#line 775 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2554 "awkgram.c" /* yacc.c:1646 */ +#line 2546 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 793 "awkgram.y" /* yacc.c:1646 */ +#line 785 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2563,11 +2555,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2567 "awkgram.c" /* yacc.c:1646 */ +#line 2559 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 802 "awkgram.y" /* yacc.c:1646 */ +#line 794 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2576,11 +2568,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2580 "awkgram.c" /* yacc.c:1646 */ +#line 2572 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 811 "awkgram.y" /* yacc.c:1646 */ +#line 803 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2589,11 +2581,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2593 "awkgram.c" /* yacc.c:1646 */ +#line 2585 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 820 "awkgram.y" /* yacc.c:1646 */ +#line 812 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2604,11 +2596,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2608 "awkgram.c" /* yacc.c:1646 */ +#line 2600 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 831 "awkgram.y" /* yacc.c:1646 */ +#line 823 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2623,20 +2615,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2627 "awkgram.c" /* yacc.c:1646 */ +#line 2619 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 846 "awkgram.y" /* yacc.c:1646 */ +#line 838 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2636 "awkgram.c" /* yacc.c:1646 */ +#line 2628 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 849 "awkgram.y" /* yacc.c:1646 */ +#line 841 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2657,17 +2649,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2661 "awkgram.c" /* yacc.c:1646 */ +#line 2653 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 881 "awkgram.y" /* yacc.c:1646 */ +#line 873 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2667 "awkgram.c" /* yacc.c:1646 */ +#line 2659 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 882 "awkgram.y" /* yacc.c:1646 */ +#line 874 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2764,17 +2756,17 @@ regular_print: } } } -#line 2768 "awkgram.c" /* yacc.c:1646 */ +#line 2760 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 979 "awkgram.y" /* yacc.c:1646 */ +#line 971 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2774 "awkgram.c" /* yacc.c:1646 */ +#line 2766 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 980 "awkgram.y" /* yacc.c:1646 */ +#line 972 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2807,11 +2799,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2811 "awkgram.c" /* yacc.c:1646 */ +#line 2803 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1017 "awkgram.y" /* yacc.c:1646 */ +#line 1009 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2837,52 +2829,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2841 "awkgram.c" /* yacc.c:1646 */ +#line 2833 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1043 "awkgram.y" /* yacc.c:1646 */ +#line 1035 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2847 "awkgram.c" /* yacc.c:1646 */ +#line 2839 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1048 "awkgram.y" /* yacc.c:1646 */ +#line 1040 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2853 "awkgram.c" /* yacc.c:1646 */ +#line 2845 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1050 "awkgram.y" /* yacc.c:1646 */ +#line 1042 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2859 "awkgram.c" /* yacc.c:1646 */ +#line 2851 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1055 "awkgram.y" /* yacc.c:1646 */ +#line 1047 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2865 "awkgram.c" /* yacc.c:1646 */ +#line 2857 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1057 "awkgram.y" /* yacc.c:1646 */ +#line 1049 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2876 "awkgram.c" /* yacc.c:1646 */ +#line 2868 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1064 "awkgram.y" /* yacc.c:1646 */ +#line 1056 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2882 "awkgram.c" /* yacc.c:1646 */ +#line 2874 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1069 "awkgram.y" /* yacc.c:1646 */ +#line 1061 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2894,11 +2886,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2898 "awkgram.c" /* yacc.c:1646 */ +#line 2890 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1081 "awkgram.y" /* yacc.c:1646 */ +#line 1073 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2909,17 +2901,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2913 "awkgram.c" /* yacc.c:1646 */ +#line 2905 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1095 "awkgram.y" /* yacc.c:1646 */ +#line 1087 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2919 "awkgram.c" /* yacc.c:1646 */ +#line 2911 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1097 "awkgram.y" /* yacc.c:1646 */ +#line 1089 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2927,71 +2919,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2931 "awkgram.c" /* yacc.c:1646 */ +#line 2923 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1105 "awkgram.y" /* yacc.c:1646 */ +#line 1097 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2940 "awkgram.c" /* yacc.c:1646 */ +#line 2932 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1110 "awkgram.y" /* yacc.c:1646 */ +#line 1102 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2946 "awkgram.c" /* yacc.c:1646 */ +#line 2938 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1112 "awkgram.y" /* yacc.c:1646 */ +#line 1104 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 2955 "awkgram.c" /* yacc.c:1646 */ +#line 2947 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1120 "awkgram.y" /* yacc.c:1646 */ +#line 1112 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2961 "awkgram.c" /* yacc.c:1646 */ +#line 2953 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1122 "awkgram.y" /* yacc.c:1646 */ +#line 1114 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2967 "awkgram.c" /* yacc.c:1646 */ +#line 2959 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1132 "awkgram.y" /* yacc.c:1646 */ +#line 1124 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2975 "awkgram.c" /* yacc.c:1646 */ +#line 2967 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1139 "awkgram.y" /* yacc.c:1646 */ +#line 1131 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 2985 "awkgram.c" /* yacc.c:1646 */ +#line 2977 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1144 "awkgram.y" /* yacc.c:1646 */ +#line 1136 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 2991 "awkgram.c" /* yacc.c:1646 */ +#line 2983 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1145 "awkgram.y" /* yacc.c:1646 */ +#line 1137 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -2999,136 +2991,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3003 "awkgram.c" /* yacc.c:1646 */ +#line 2995 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1156 "awkgram.y" /* yacc.c:1646 */ +#line 1148 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3011 "awkgram.c" /* yacc.c:1646 */ +#line 3003 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1161 "awkgram.y" /* yacc.c:1646 */ +#line 1153 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3019 "awkgram.c" /* yacc.c:1646 */ +#line 3011 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1178 "awkgram.y" /* yacc.c:1646 */ +#line 1170 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3025 "awkgram.c" /* yacc.c:1646 */ +#line 3017 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1180 "awkgram.y" /* yacc.c:1646 */ +#line 1172 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3034 "awkgram.c" /* yacc.c:1646 */ +#line 3026 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1188 "awkgram.y" /* yacc.c:1646 */ +#line 1180 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3040 "awkgram.c" /* yacc.c:1646 */ +#line 3032 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1190 "awkgram.y" /* yacc.c:1646 */ +#line 1182 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]) ; } -#line 3046 "awkgram.c" /* yacc.c:1646 */ +#line 3038 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1195 "awkgram.y" /* yacc.c:1646 */ +#line 1187 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3055 "awkgram.c" /* yacc.c:1646 */ +#line 3047 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1200 "awkgram.y" /* yacc.c:1646 */ +#line 1192 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3065 "awkgram.c" /* yacc.c:1646 */ +#line 3057 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1206 "awkgram.y" /* yacc.c:1646 */ +#line 1198 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3071 "awkgram.c" /* yacc.c:1646 */ +#line 3063 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1208 "awkgram.y" /* yacc.c:1646 */ +#line 1200 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3077 "awkgram.c" /* yacc.c:1646 */ +#line 3069 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1210 "awkgram.y" /* yacc.c:1646 */ +#line 1202 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3083 "awkgram.c" /* yacc.c:1646 */ +#line 3075 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1216 "awkgram.y" /* yacc.c:1646 */ +#line 1208 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3089 "awkgram.c" /* yacc.c:1646 */ +#line 3081 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1218 "awkgram.y" /* yacc.c:1646 */ +#line 1210 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3095 "awkgram.c" /* yacc.c:1646 */ +#line 3087 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1223 "awkgram.y" /* yacc.c:1646 */ +#line 1215 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3101 "awkgram.c" /* yacc.c:1646 */ +#line 3093 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1225 "awkgram.y" /* yacc.c:1646 */ +#line 1217 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3107 "awkgram.c" /* yacc.c:1646 */ +#line 3099 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1230 "awkgram.y" /* yacc.c:1646 */ +#line 1222 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3113 "awkgram.c" /* yacc.c:1646 */ +#line 3105 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1232 "awkgram.y" /* yacc.c:1646 */ +#line 1224 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3122 "awkgram.c" /* yacc.c:1646 */ +#line 3114 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1237 "awkgram.y" /* yacc.c:1646 */ +#line 1229 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3128 "awkgram.c" /* yacc.c:1646 */ +#line 3120 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1239 "awkgram.y" /* yacc.c:1646 */ +#line 1231 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3136,52 +3128,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3140 "awkgram.c" /* yacc.c:1646 */ +#line 3132 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1247 "awkgram.y" /* yacc.c:1646 */ +#line 1239 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3149 "awkgram.c" /* yacc.c:1646 */ +#line 3141 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1252 "awkgram.y" /* yacc.c:1646 */ +#line 1244 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3158 "awkgram.c" /* yacc.c:1646 */ +#line 3150 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1261 "awkgram.y" /* yacc.c:1646 */ +#line 1253 "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 3169 "awkgram.c" /* yacc.c:1646 */ +#line 3161 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1268 "awkgram.y" /* yacc.c:1646 */ +#line 1260 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3175 "awkgram.c" /* yacc.c:1646 */ +#line 3167 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1270 "awkgram.y" /* yacc.c:1646 */ +#line 1262 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3181 "awkgram.c" /* yacc.c:1646 */ +#line 3173 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1272 "awkgram.y" /* yacc.c:1646 */ +#line 1264 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3197,11 +3189,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3201 "awkgram.c" /* yacc.c:1646 */ +#line 3193 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1288 "awkgram.y" /* yacc.c:1646 */ +#line 1280 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3211,91 +3203,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3215 "awkgram.c" /* yacc.c:1646 */ +#line 3207 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1298 "awkgram.y" /* yacc.c:1646 */ +#line 1290 "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 3226 "awkgram.c" /* yacc.c:1646 */ +#line 3218 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1305 "awkgram.y" /* yacc.c:1646 */ +#line 1297 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3232 "awkgram.c" /* yacc.c:1646 */ +#line 3224 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1307 "awkgram.y" /* yacc.c:1646 */ +#line 1299 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3238 "awkgram.c" /* yacc.c:1646 */ +#line 3230 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1312 "awkgram.y" /* yacc.c:1646 */ +#line 1304 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3244 "awkgram.c" /* yacc.c:1646 */ +#line 3236 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1314 "awkgram.y" /* yacc.c:1646 */ +#line 1306 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3250 "awkgram.c" /* yacc.c:1646 */ +#line 3242 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1316 "awkgram.y" /* yacc.c:1646 */ +#line 1308 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3259 "awkgram.c" /* yacc.c:1646 */ +#line 3251 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1324 "awkgram.y" /* yacc.c:1646 */ +#line 1316 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3265 "awkgram.c" /* yacc.c:1646 */ +#line 3257 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1326 "awkgram.y" /* yacc.c:1646 */ +#line 1318 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3271 "awkgram.c" /* yacc.c:1646 */ +#line 3263 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1331 "awkgram.y" /* yacc.c:1646 */ +#line 1323 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3277 "awkgram.c" /* yacc.c:1646 */ +#line 3269 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1333 "awkgram.y" /* yacc.c:1646 */ +#line 1325 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3283 "awkgram.c" /* yacc.c:1646 */ +#line 3275 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1338 "awkgram.y" /* yacc.c:1646 */ +#line 1330 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3289 "awkgram.c" /* yacc.c:1646 */ +#line 3281 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1340 "awkgram.y" /* yacc.c:1646 */ +#line 1332 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3295 "awkgram.c" /* yacc.c:1646 */ +#line 3287 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1342 "awkgram.y" /* yacc.c:1646 */ +#line 1334 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3342,47 +3334,47 @@ regular_print: max_args = count; } } -#line 3346 "awkgram.c" /* yacc.c:1646 */ +#line 3338 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1394 "awkgram.y" /* yacc.c:1646 */ +#line 1386 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3352 "awkgram.c" /* yacc.c:1646 */ +#line 3344 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1396 "awkgram.y" /* yacc.c:1646 */ +#line 1388 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3358 "awkgram.c" /* yacc.c:1646 */ +#line 3350 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1398 "awkgram.y" /* yacc.c:1646 */ +#line 1390 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3364 "awkgram.c" /* yacc.c:1646 */ +#line 3356 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1400 "awkgram.y" /* yacc.c:1646 */ +#line 1392 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3370 "awkgram.c" /* yacc.c:1646 */ +#line 3362 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1402 "awkgram.y" /* yacc.c:1646 */ +#line 1394 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3376 "awkgram.c" /* yacc.c:1646 */ +#line 3368 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1404 "awkgram.y" /* yacc.c:1646 */ +#line 1396 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3382 "awkgram.c" /* yacc.c:1646 */ +#line 3374 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1406 "awkgram.y" /* yacc.c:1646 */ +#line 1398 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3396,29 +3388,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3400 "awkgram.c" /* yacc.c:1646 */ +#line 3392 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1420 "awkgram.y" /* yacc.c:1646 */ +#line 1412 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3409 "awkgram.c" /* yacc.c:1646 */ +#line 3401 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1425 "awkgram.y" /* yacc.c:1646 */ +#line 1417 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3418 "awkgram.c" /* yacc.c:1646 */ +#line 3410 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1430 "awkgram.y" /* yacc.c:1646 */ +#line 1422 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3438,64 +3430,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3442 "awkgram.c" /* yacc.c:1646 */ +#line 3434 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1455 "awkgram.y" /* yacc.c:1646 */ +#line 1447 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3451 "awkgram.c" /* yacc.c:1646 */ +#line 3443 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1461 "awkgram.y" /* yacc.c:1646 */ +#line 1453 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3457 "awkgram.c" /* yacc.c:1646 */ +#line 3449 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1463 "awkgram.y" /* yacc.c:1646 */ +#line 1455 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3463 "awkgram.c" /* yacc.c:1646 */ +#line 3455 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1465 "awkgram.y" /* yacc.c:1646 */ +#line 1457 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3469 "awkgram.c" /* yacc.c:1646 */ +#line 3461 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1467 "awkgram.y" /* yacc.c:1646 */ +#line 1459 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3475 "awkgram.c" /* yacc.c:1646 */ +#line 3467 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1469 "awkgram.y" /* yacc.c:1646 */ +#line 1461 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3481 "awkgram.c" /* yacc.c:1646 */ +#line 3473 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1471 "awkgram.y" /* yacc.c:1646 */ +#line 1463 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3487 "awkgram.c" /* yacc.c:1646 */ +#line 3479 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1476 "awkgram.y" /* yacc.c:1646 */ +#line 1468 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3495 "awkgram.c" /* yacc.c:1646 */ +#line 3487 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1480 "awkgram.y" /* yacc.c:1646 */ +#line 1472 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3527,37 +3519,37 @@ regular_print: } } } -#line 3531 "awkgram.c" /* yacc.c:1646 */ +#line 3523 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1512 "awkgram.y" /* yacc.c:1646 */ +#line 1504 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3537 "awkgram.c" /* yacc.c:1646 */ +#line 3529 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1514 "awkgram.y" /* yacc.c:1646 */ +#line 1506 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3547 "awkgram.c" /* yacc.c:1646 */ +#line 3539 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1520 "awkgram.y" /* yacc.c:1646 */ +#line 1512 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3557 "awkgram.c" /* yacc.c:1646 */ +#line 3549 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1526 "awkgram.y" /* yacc.c:1646 */ +#line 1518 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3570,45 +3562,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3574 "awkgram.c" /* yacc.c:1646 */ +#line 3566 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1541 "awkgram.y" /* yacc.c:1646 */ +#line 1533 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3583 "awkgram.c" /* yacc.c:1646 */ +#line 3575 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1546 "awkgram.y" /* yacc.c:1646 */ +#line 1538 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3592 "awkgram.c" /* yacc.c:1646 */ +#line 3584 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1551 "awkgram.y" /* yacc.c:1646 */ +#line 1543 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3600 "awkgram.c" /* yacc.c:1646 */ +#line 3592 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1555 "awkgram.y" /* yacc.c:1646 */ +#line 1547 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3608 "awkgram.c" /* yacc.c:1646 */ +#line 3600 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1559 "awkgram.y" /* yacc.c:1646 */ +#line 1551 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3623,11 +3615,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3627 "awkgram.c" /* yacc.c:1646 */ +#line 3619 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1574 "awkgram.y" /* yacc.c:1646 */ +#line 1566 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3637,20 +3629,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3641 "awkgram.c" /* yacc.c:1646 */ +#line 3633 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1587 "awkgram.y" /* yacc.c:1646 */ +#line 1579 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3650 "awkgram.c" /* yacc.c:1646 */ +#line 3642 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1592 "awkgram.y" /* yacc.c:1646 */ +#line 1584 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3683,11 +3675,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3687 "awkgram.c" /* yacc.c:1646 */ +#line 3679 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1628 "awkgram.y" /* yacc.c:1646 */ +#line 1620 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3701,49 +3693,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3705 "awkgram.c" /* yacc.c:1646 */ +#line 3697 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1645 "awkgram.y" /* yacc.c:1646 */ +#line 1637 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3711 "awkgram.c" /* yacc.c:1646 */ +#line 3703 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1647 "awkgram.y" /* yacc.c:1646 */ +#line 1639 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3717 "awkgram.c" /* yacc.c:1646 */ +#line 3709 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1652 "awkgram.y" /* yacc.c:1646 */ +#line 1644 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3723 "awkgram.c" /* yacc.c:1646 */ +#line 3715 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1654 "awkgram.y" /* yacc.c:1646 */ +#line 1646 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3729 "awkgram.c" /* yacc.c:1646 */ +#line 3721 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1659 "awkgram.y" /* yacc.c:1646 */ +#line 1651 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3735 "awkgram.c" /* yacc.c:1646 */ +#line 3727 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1661 "awkgram.y" /* yacc.c:1646 */ +#line 1653 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3743 "awkgram.c" /* yacc.c:1646 */ +#line 3735 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1668 "awkgram.y" /* yacc.c:1646 */ +#line 1660 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3757,11 +3749,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3761 "awkgram.c" /* yacc.c:1646 */ +#line 3753 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1685 "awkgram.y" /* yacc.c:1646 */ +#line 1677 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3775,31 +3767,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3779 "awkgram.c" /* yacc.c:1646 */ +#line 3771 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1702 "awkgram.y" /* yacc.c:1646 */ +#line 1694 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3785 "awkgram.c" /* yacc.c:1646 */ +#line 3777 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1704 "awkgram.y" /* yacc.c:1646 */ +#line 1696 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3793 "awkgram.c" /* yacc.c:1646 */ +#line 3785 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1711 "awkgram.y" /* yacc.c:1646 */ +#line 1703 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3799 "awkgram.c" /* yacc.c:1646 */ +#line 3791 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1716 "awkgram.y" /* yacc.c:1646 */ +#line 1708 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3807,22 +3799,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3811 "awkgram.c" /* yacc.c:1646 */ +#line 3803 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1724 "awkgram.y" /* yacc.c:1646 */ +#line 1716 "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 3822 "awkgram.c" /* yacc.c:1646 */ +#line 3814 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1734 "awkgram.y" /* yacc.c:1646 */ +#line 1726 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3834,73 +3826,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3838 "awkgram.c" /* yacc.c:1646 */ +#line 3830 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1746 "awkgram.y" /* yacc.c:1646 */ +#line 1738 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3848 "awkgram.c" /* yacc.c:1646 */ +#line 3840 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1755 "awkgram.y" /* yacc.c:1646 */ +#line 1747 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3856 "awkgram.c" /* yacc.c:1646 */ +#line 3848 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1759 "awkgram.y" /* yacc.c:1646 */ +#line 1751 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3864 "awkgram.c" /* yacc.c:1646 */ +#line 3856 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1762 "awkgram.y" /* yacc.c:1646 */ +#line 1754 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3870 "awkgram.c" /* yacc.c:1646 */ +#line 3862 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1770 "awkgram.y" /* yacc.c:1646 */ +#line 1762 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3876 "awkgram.c" /* yacc.c:1646 */ +#line 3868 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1774 "awkgram.y" /* yacc.c:1646 */ +#line 1766 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3882 "awkgram.c" /* yacc.c:1646 */ +#line 3874 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1783 "awkgram.y" /* yacc.c:1646 */ +#line 1775 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3888 "awkgram.c" /* yacc.c:1646 */ +#line 3880 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1787 "awkgram.y" /* yacc.c:1646 */ +#line 1779 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3894 "awkgram.c" /* yacc.c:1646 */ +#line 3886 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1791 "awkgram.y" /* yacc.c:1646 */ +#line 1783 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3900 "awkgram.c" /* yacc.c:1646 */ +#line 3892 "awkgram.c" /* yacc.c:1646 */ break; -#line 3904 "awkgram.c" /* yacc.c:1646 */ +#line 3896 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4128,7 +4120,7 @@ yyreturn: #endif return yyresult; } -#line 1793 "awkgram.y" /* yacc.c:1906 */ +#line 1785 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -4685,8 +4677,6 @@ do_add_srcfile(enum srctype stype, char *src, char *path, SRCFILE *thisfile) s->prev = thisfile->prev; thisfile->prev->next = s; thisfile->prev = s; - if (stype == SRC_EXTLIB) - extensions_used = true; return s; } @@ -6585,7 +6575,7 @@ install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist) int pcount = 0; r = lookup(fname); - if (r != NULL || is_deferred_variable(fname)) { + if (r != NULL) { error_ln(fi->source_line, _("function name `%s' previously defined"), fname); return -1; } @@ -6778,51 +6768,6 @@ param_sanity(INSTRUCTION *arglist) } } -/* deferred variables --- those that are only defined if needed. */ - -/* - * Is there any reason to use a hash table for deferred variables? At the - * moment, there are only 1 to 3 such variables, so it may not be worth - * the overhead. If more modules start using this facility, it should - * probably be converted into a hash table. - */ - -static struct deferred_variable { - NODE *(*load_func)(void); - struct deferred_variable *next; - char name[1]; /* variable-length array */ -} *deferred_variables; - -/* register_deferred_variable --- add a var name and loading function to the list */ - -void -register_deferred_variable(const char *name, NODE *(*load_func)(void)) -{ - struct deferred_variable *dv; - size_t sl = strlen(name); - - emalloc(dv, struct deferred_variable *, sizeof(*dv)+sl, - "register_deferred_variable"); - dv->load_func = load_func; - dv->next = deferred_variables; - memcpy(dv->name, name, sl+1); - deferred_variables = dv; -} - -/* is_deferred_variable --- check if NAME is a deferred variable */ - -static bool -is_deferred_variable(const char *name) -{ - struct deferred_variable *dv; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) - if (strcmp(name, dv->name) == 0) - return true; - return false; -} - - /* variable --- make sure NAME is in the symbol table */ NODE * @@ -6834,43 +6779,14 @@ variable(int location, char *name, NODETYPE type) if (r->type == Node_func || r->type == Node_ext_func ) error_ln(location, _("function `%s' called with space between name and `(',\nor used as a variable or an array"), r->vname); - if (r == symbol_table) - symtab_used = true; } else { /* not found */ - struct deferred_variable *dv; - - for (dv = deferred_variables; true; dv = dv->next) { - if (dv == NULL) { - /* - * This is the only case in which we may not free the string. - */ - return install_symbol(name, type); - } - if (strcmp(name, dv->name) == 0) { - r = (*dv->load_func)(); - break; - } - } + return install_symbol(name, type); } efree(name); return r; } -/* process_deferred --- if the program uses SYMTAB or extensions, load deferred variables */ - -static void -process_deferred() -{ - struct deferred_variable *dv; - - if (symtab_used || extensions_used) { - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - (void) dv->load_func(); - } - } -} - /* make_regnode --- make a regular expression node */ static NODE * diff --git a/awkgram.y b/awkgram.y index b43e305d..7b2e2a60 100644 --- a/awkgram.y +++ b/awkgram.y @@ -57,7 +57,6 @@ static int include_source(INSTRUCTION *file); static int load_library(INSTRUCTION *file); static void next_sourcefile(void); static char *tokexpand(void); -static bool is_deferred_variable(const char *name); #define instruction(t) bcalloc(t, 1, 0) @@ -79,8 +78,6 @@ static int count_expressions(INSTRUCTION **list, bool isarg); static INSTRUCTION *optimize_assignment(INSTRUCTION *exp); static void add_lint(INSTRUCTION *list, LINTTYPE linttype); -static void process_deferred(); - enum defref { FUNC_DEFINE, FUNC_USE, FUNC_EXT }; static void func_use(const char *name, enum defref how); static void check_funcs(void); @@ -91,7 +88,6 @@ static int one_line_close(int fd); static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ static char *in_function; /* parsing kludge */ -static bool symtab_used = false; /* program used SYMTAB */ static int rule = 0; const char *const ruletab[] = { @@ -120,7 +116,6 @@ static int lasttok = 0; static bool eof_warned = false; /* GLOBAL: want warning for each file */ static int break_allowed; /* kludge for break */ static int continue_allowed; /* kludge for continue */ -static bool extensions_used = false; /* program uses extensions */ #define END_FILE -1000 #define END_SRC -2000 @@ -207,8 +202,6 @@ program | program LEX_EOF { next_sourcefile(); - if (sourcefile == srcfiles) - process_deferred(); } | program error { @@ -273,7 +266,6 @@ source library : FILENAME { - extensions_used = true; if (load_library($1) < 0) YYABORT; efree($1->lextok); @@ -2346,8 +2338,6 @@ do_add_srcfile(enum srctype stype, char *src, char *path, SRCFILE *thisfile) s->prev = thisfile->prev; thisfile->prev->next = s; thisfile->prev = s; - if (stype == SRC_EXTLIB) - extensions_used = true; return s; } @@ -4246,7 +4236,7 @@ install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist) int pcount = 0; r = lookup(fname); - if (r != NULL || is_deferred_variable(fname)) { + if (r != NULL) { error_ln(fi->source_line, _("function name `%s' previously defined"), fname); return -1; } @@ -4439,51 +4429,6 @@ param_sanity(INSTRUCTION *arglist) } } -/* deferred variables --- those that are only defined if needed. */ - -/* - * Is there any reason to use a hash table for deferred variables? At the - * moment, there are only 1 to 3 such variables, so it may not be worth - * the overhead. If more modules start using this facility, it should - * probably be converted into a hash table. - */ - -static struct deferred_variable { - NODE *(*load_func)(void); - struct deferred_variable *next; - char name[1]; /* variable-length array */ -} *deferred_variables; - -/* register_deferred_variable --- add a var name and loading function to the list */ - -void -register_deferred_variable(const char *name, NODE *(*load_func)(void)) -{ - struct deferred_variable *dv; - size_t sl = strlen(name); - - emalloc(dv, struct deferred_variable *, sizeof(*dv)+sl, - "register_deferred_variable"); - dv->load_func = load_func; - dv->next = deferred_variables; - memcpy(dv->name, name, sl+1); - deferred_variables = dv; -} - -/* is_deferred_variable --- check if NAME is a deferred variable */ - -static bool -is_deferred_variable(const char *name) -{ - struct deferred_variable *dv; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) - if (strcmp(name, dv->name) == 0) - return true; - return false; -} - - /* variable --- make sure NAME is in the symbol table */ NODE * @@ -4495,43 +4440,14 @@ variable(int location, char *name, NODETYPE type) if (r->type == Node_func || r->type == Node_ext_func ) error_ln(location, _("function `%s' called with space between name and `(',\nor used as a variable or an array"), r->vname); - if (r == symbol_table) - symtab_used = true; } else { /* not found */ - struct deferred_variable *dv; - - for (dv = deferred_variables; true; dv = dv->next) { - if (dv == NULL) { - /* - * This is the only case in which we may not free the string. - */ - return install_symbol(name, type); - } - if (strcmp(name, dv->name) == 0) { - r = (*dv->load_func)(); - break; - } - } + return install_symbol(name, type); } efree(name); return r; } -/* process_deferred --- if the program uses SYMTAB or extensions, load deferred variables */ - -static void -process_deferred() -{ - struct deferred_variable *dv; - - if (symtab_used || extensions_used) { - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - (void) dv->load_func(); - } - } -} - /* make_regnode --- make a regular expression node */ static NODE * diff --git a/builtin.c b/builtin.c index 9b85de2b..1383572a 100644 --- a/builtin.c +++ b/builtin.c @@ -510,6 +510,9 @@ do_length(int nargs) * Support for deferred loading of array elements requires that * we use the array length interface even though it isn't * necessary for the built-in array types. + * + * 1/2015: The deferred arrays are gone, but this is probably + * still a good idea. */ size = assoc_length(tmp); diff --git a/main.c b/main.c index 1323330c..b31c746a 100644 --- a/main.c +++ b/main.c @@ -807,10 +807,10 @@ init_vars() (*(vp->assign))(); } - /* Set up deferred variables (loaded only when accessed). */ + /* Load PROCINFO and ENVIRON */ if (! do_traditional) - register_deferred_variable("PROCINFO", load_procinfo); - register_deferred_variable("ENVIRON", load_environ); + load_procinfo(); + load_environ(); } /* path_environ --- put path variable into environment if not already there */ diff --git a/test/ChangeLog b/test/ChangeLog index 2cc88514..16ef6d56 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2015-01-14 Arnold D. Robbins + + * dumpvars.ok, id.ok: Updated after code changes. + 2015-01-07 Arnold D. Robbins * Makefile.am (regexpbrack): New test. diff --git a/test/dumpvars.ok b/test/dumpvars.ok index 73d3d306..5013b351 100644 --- a/test/dumpvars.ok +++ b/test/dumpvars.ok @@ -3,6 +3,7 @@ ARGIND: 0 ARGV: array, 1 elements BINMODE: 0 CONVFMT: "%.6g" +ENVIRON: array, 57 elements ERRNO: "" FIELDWIDTHS: "" FILENAME: "-" @@ -17,6 +18,7 @@ OFMT: "%.6g" OFS: " " ORS: "\n" PREC: 53 +PROCINFO: array, 28 elements RLENGTH: 0 ROUNDMODE: "N" RS: "\n" diff --git a/test/id.ok b/test/id.ok index a9f540e7..a3271cff 100644 --- a/test/id.ok +++ b/test/id.ok @@ -70,3 +70,4 @@ lshift -> builtin SYMTAB -> array strtonum -> builtin toupper -> builtin +ENVIRON -> array -- cgit v1.2.3 From 16d6377af8d1683a29b9dc7d7ab3e8d4bc1ebd48 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 14 Jan 2015 20:50:00 +0200 Subject: Fix dumpvars test after removing deferred variables. --- test/ChangeLog | 2 ++ test/Makefile.am | 2 +- test/Makefile.in | 2 +- test/dumpvars.ok | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index 16ef6d56..04e65b5a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,7 @@ 2015-01-14 Arnold D. Robbins + * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since + those can be different depending on who runs the test. * dumpvars.ok, id.ok: Updated after code changes. 2015-01-07 Arnold D. Robbins diff --git a/test/Makefile.am b/test/Makefile.am index 12bde88d..bd2903ab 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1679,7 +1679,7 @@ beginfile2: dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: diff --git a/test/Makefile.in b/test/Makefile.in index 55650e18..e01e273f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2105,7 +2105,7 @@ beginfile2: dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: diff --git a/test/dumpvars.ok b/test/dumpvars.ok index 5013b351..73d3d306 100644 --- a/test/dumpvars.ok +++ b/test/dumpvars.ok @@ -3,7 +3,6 @@ ARGIND: 0 ARGV: array, 1 elements BINMODE: 0 CONVFMT: "%.6g" -ENVIRON: array, 57 elements ERRNO: "" FIELDWIDTHS: "" FILENAME: "-" @@ -18,7 +17,6 @@ OFMT: "%.6g" OFS: " " ORS: "\n" PREC: 53 -PROCINFO: array, 28 elements RLENGTH: 0 ROUNDMODE: "N" RS: "\n" -- cgit v1.2.3 From f18e168ff20217143bd922f158a1c56058795e89 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 15 Jan 2015 06:11:56 +0200 Subject: Update TODO. --- TODO | 4 ---- 1 file changed, 4 deletions(-) diff --git a/TODO b/TODO index 235ded0e..3670f126 100644 --- a/TODO +++ b/TODO @@ -63,8 +63,6 @@ Major New Features Also needed: - Indirect calls of built-ins - Indirect calls of extension functions Indirect through array elements, not just scalar variables Some way to make regexp constants first class citizens: @@ -127,8 +125,6 @@ Things To Think About That May Never Happen Patch lexer for @include and @load to make quotes optional. (Really needed?) - ? Have strftime() pay attention to the value of ENVIRON["TZ"] - Add a lint check if the return value of a function is used but the function did not supply a value. -- cgit v1.2.3 From a59a81a68ca26293f8e3df25da2cfe20e61d7c85 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 15 Jan 2015 06:20:20 +0200 Subject: Sync some external files. --- ChangeLog | 6 ++++++ dfa.c | 2 +- dfa.h | 2 +- getopt.c | 4 ++-- getopt.h | 2 +- getopt1.c | 2 +- getopt_int.h | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7de69351..605ed80d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-01-15 Arnold D. Robbins + + * dfa.h, dfa.c: Sync with grep. Mainly copyright updates. + * getopt.c, getopt.h, getopt1.c getopt_int.h: Sync with GLIBC. + Mainly copyright updates, one minor code fix. + 2015-01-14 Arnold D. Robbins Remove deferred variables. diff --git a/dfa.c b/dfa.c index 2ea37b52..4b461fed 100644 --- a/dfa.c +++ b/dfa.c @@ -1,5 +1,5 @@ /* dfa.c - deterministic extended regexp routines for GNU - Copyright (C) 1988, 1998, 2000, 2002, 2004-2005, 2007-2014 Free Software + Copyright (C) 1988, 1998, 2000, 2002, 2004-2005, 2007-2015 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/dfa.h b/dfa.h index 4eb42968..79027810 100644 --- a/dfa.h +++ b/dfa.h @@ -1,5 +1,5 @@ /* dfa.h - declarations for GNU deterministic regexp compiler - Copyright (C) 1988, 1998, 2007, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 1988, 1998, 2007, 2009-2015 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/getopt.c b/getopt.c index 7bd42bb6..4de0b9a0 100644 --- a/getopt.c +++ b/getopt.c @@ -2,7 +2,7 @@ NOTE: getopt is part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987-2014 Free Software Foundation, Inc. + Copyright (C) 1987-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -613,7 +613,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, fputc_unlocked ('\n', fp); - if (__builtin_expect (fclose (fp) != EOF, 1)) + if (__glibc_likely (fclose (fp) != EOF)) { _IO_flockfile (stderr); diff --git a/getopt.h b/getopt.h index 4471bf54..75cd5e8d 100644 --- a/getopt.h +++ b/getopt.h @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-2014 Free Software Foundation, Inc. + Copyright (C) 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/getopt1.c b/getopt1.c index 32f2f6a6..b61041db 100644 --- a/getopt1.c +++ b/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-2014 Free Software Foundation, Inc. + Copyright (C) 1987-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/getopt_int.h b/getopt_int.h index d255c8ee..03d62277 100644 --- a/getopt_int.h +++ b/getopt_int.h @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-2014 Free Software Foundation, Inc. + Copyright (C) 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or -- cgit v1.2.3 From 85699a5cba88f4ee910e2c3ef42b5cc165102b51 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 16 Jan 2015 13:55:10 +0200 Subject: Bug fix in pretty-printing comments and test case. --- ChangeLog | 5 + awkgram.c | 701 +++++++++++++++++++++++++++--------------------------- awkgram.y | 1 + test/ChangeLog | 5 + test/Makefile.am | 5 + test/Makefile.in | 5 + test/profile8.awk | 9 + test/profile8.ok | 14 ++ 8 files changed, 395 insertions(+), 350 deletions(-) create mode 100644 test/profile8.awk create mode 100644 test/profile8.ok diff --git a/ChangeLog b/ChangeLog index cce38167..0101eb2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-01-16 Stephen Davies + + * awkgram.y (rule): Set first_rule to false. Catches more cases + for gathering comments. Thanks to Hermann Peifer for the test case. + 2015-01-15 Arnold D. Robbins * dfa.h, dfa.c: Sync with grep. Mainly copyright updates. diff --git a/awkgram.c b/awkgram.c index 2148dfa5..a10e3f67 100644 --- a/awkgram.c +++ b/awkgram.c @@ -657,25 +657,25 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 204, 204, 206, 211, 212, 216, 228, 232, 243, - 249, 254, 262, 270, 272, 277, 285, 287, 293, 301, - 311, 341, 355, 369, 377, 388, 400, 402, 404, 410, - 415, 416, 420, 455, 454, 488, 490, 495, 501, 529, - 534, 535, 539, 541, 543, 550, 640, 682, 724, 837, - 844, 851, 861, 870, 879, 888, 899, 915, 914, 938, - 950, 950, 1048, 1048, 1081, 1111, 1117, 1118, 1124, 1125, - 1132, 1137, 1149, 1163, 1165, 1173, 1178, 1180, 1188, 1190, - 1199, 1200, 1208, 1213, 1213, 1224, 1228, 1236, 1237, 1240, - 1242, 1247, 1248, 1257, 1258, 1263, 1268, 1274, 1276, 1278, - 1285, 1286, 1292, 1293, 1298, 1300, 1305, 1307, 1315, 1320, - 1329, 1336, 1338, 1340, 1356, 1366, 1373, 1375, 1380, 1382, - 1384, 1392, 1394, 1399, 1401, 1406, 1408, 1410, 1460, 1462, - 1464, 1466, 1468, 1470, 1472, 1474, 1488, 1493, 1498, 1523, - 1529, 1531, 1533, 1535, 1537, 1539, 1544, 1548, 1580, 1582, - 1588, 1594, 1607, 1608, 1609, 1614, 1619, 1623, 1627, 1642, - 1655, 1660, 1696, 1714, 1715, 1721, 1722, 1727, 1729, 1736, - 1753, 1770, 1772, 1779, 1784, 1792, 1802, 1814, 1823, 1827, - 1831, 1835, 1839, 1843, 1846, 1848, 1852, 1856, 1860 + 0, 204, 204, 206, 211, 212, 216, 228, 233, 244, + 250, 255, 263, 271, 273, 278, 286, 288, 294, 302, + 312, 342, 356, 370, 378, 389, 401, 403, 405, 411, + 416, 417, 421, 456, 455, 489, 491, 496, 502, 530, + 535, 536, 540, 542, 544, 551, 641, 683, 725, 838, + 845, 852, 862, 871, 880, 889, 900, 916, 915, 939, + 951, 951, 1049, 1049, 1082, 1112, 1118, 1119, 1125, 1126, + 1133, 1138, 1150, 1164, 1166, 1174, 1179, 1181, 1189, 1191, + 1200, 1201, 1209, 1214, 1214, 1225, 1229, 1237, 1238, 1241, + 1243, 1248, 1249, 1258, 1259, 1264, 1269, 1275, 1277, 1279, + 1286, 1287, 1293, 1294, 1299, 1301, 1306, 1308, 1316, 1321, + 1330, 1337, 1339, 1341, 1357, 1367, 1374, 1376, 1381, 1383, + 1385, 1393, 1395, 1400, 1402, 1407, 1409, 1411, 1461, 1463, + 1465, 1467, 1469, 1471, 1473, 1475, 1489, 1494, 1499, 1524, + 1530, 1532, 1534, 1536, 1538, 1540, 1545, 1549, 1581, 1583, + 1589, 1595, 1608, 1609, 1610, 1615, 1620, 1624, 1628, 1643, + 1656, 1661, 1697, 1715, 1716, 1722, 1723, 1728, 1730, 1737, + 1754, 1771, 1773, 1780, 1785, 1793, 1803, 1815, 1824, 1828, + 1832, 1836, 1840, 1844, 1847, 1849, 1853, 1857, 1861 }; #endif @@ -1881,12 +1881,13 @@ yyreduce: #line 229 "awkgram.y" /* yacc.c:1646 */ { (void) append_rule((yyvsp[-1]), (yyvsp[0])); + first_rule = false; } -#line 1886 "awkgram.c" /* yacc.c:1646 */ +#line 1887 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 233 "awkgram.y" /* yacc.c:1646 */ +#line 234 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1897,39 +1898,39 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1901 "awkgram.c" /* yacc.c:1646 */ +#line 1902 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 244 "awkgram.y" /* yacc.c:1646 */ +#line 245 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1911 "awkgram.c" /* yacc.c:1646 */ +#line 1912 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 250 "awkgram.y" /* yacc.c:1646 */ +#line 251 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1920 "awkgram.c" /* yacc.c:1646 */ +#line 1921 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 255 "awkgram.y" /* yacc.c:1646 */ +#line 256 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1929 "awkgram.c" /* yacc.c:1646 */ +#line 1930 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 263 "awkgram.y" /* yacc.c:1646 */ +#line 264 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1937,23 +1938,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1941 "awkgram.c" /* yacc.c:1646 */ +#line 1942 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 271 "awkgram.y" /* yacc.c:1646 */ +#line 272 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1947 "awkgram.c" /* yacc.c:1646 */ +#line 1948 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 273 "awkgram.y" /* yacc.c:1646 */ +#line 274 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1953 "awkgram.c" /* yacc.c:1646 */ +#line 1954 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 278 "awkgram.y" /* yacc.c:1646 */ +#line 279 "awkgram.y" /* yacc.c:1646 */ { if (load_library((yyvsp[0])) < 0) YYABORT; @@ -1961,23 +1962,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1965 "awkgram.c" /* yacc.c:1646 */ +#line 1966 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 286 "awkgram.y" /* yacc.c:1646 */ +#line 287 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1971 "awkgram.c" /* yacc.c:1646 */ +#line 1972 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 288 "awkgram.y" /* yacc.c:1646 */ +#line 289 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1977 "awkgram.c" /* yacc.c:1646 */ +#line 1978 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 293 "awkgram.y" /* yacc.c:1646 */ +#line 294 "awkgram.y" /* yacc.c:1646 */ { rule = Rule; if (comment != NULL) { @@ -1986,11 +1987,11 @@ yyreduce: } else (yyval) = NULL; } -#line 1990 "awkgram.c" /* yacc.c:1646 */ +#line 1991 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 302 "awkgram.y" /* yacc.c:1646 */ +#line 303 "awkgram.y" /* yacc.c:1646 */ { rule = Rule; if (comment != NULL) { @@ -1999,11 +2000,11 @@ yyreduce: } else (yyval) = (yyvsp[0]); } -#line 2003 "awkgram.c" /* yacc.c:1646 */ +#line 2004 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 312 "awkgram.y" /* yacc.c:1646 */ +#line 313 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2033,11 +2034,11 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2037 "awkgram.c" /* yacc.c:1646 */ +#line 2038 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 342 "awkgram.y" /* yacc.c:1646 */ +#line 343 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; @@ -2051,11 +2052,11 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2055 "awkgram.c" /* yacc.c:1646 */ +#line 2056 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 356 "awkgram.y" /* yacc.c:1646 */ +#line 357 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; @@ -2069,11 +2070,11 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2073 "awkgram.c" /* yacc.c:1646 */ +#line 2074 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 370 "awkgram.y" /* yacc.c:1646 */ +#line 371 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = BEGINFILE; @@ -2081,11 +2082,11 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2085 "awkgram.c" /* yacc.c:1646 */ +#line 2086 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 378 "awkgram.y" /* yacc.c:1646 */ +#line 379 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = ENDFILE; @@ -2093,11 +2094,11 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2097 "awkgram.c" /* yacc.c:1646 */ +#line 2098 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 389 "awkgram.y" /* yacc.c:1646 */ +#line 390 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; if ((yyvsp[-3]) == NULL) @@ -2106,39 +2107,39 @@ yyreduce: ip = (yyvsp[-3]); (yyval) = ip; } -#line 2110 "awkgram.c" /* yacc.c:1646 */ +#line 2111 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 401 "awkgram.y" /* yacc.c:1646 */ +#line 402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2116 "awkgram.c" /* yacc.c:1646 */ +#line 2117 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 403 "awkgram.y" /* yacc.c:1646 */ +#line 404 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2122 "awkgram.c" /* yacc.c:1646 */ +#line 2123 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 405 "awkgram.y" /* yacc.c:1646 */ +#line 406 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2132 "awkgram.c" /* yacc.c:1646 */ +#line 2133 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 411 "awkgram.y" /* yacc.c:1646 */ +#line 412 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2138 "awkgram.c" /* yacc.c:1646 */ +#line 2139 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 421 "awkgram.y" /* yacc.c:1646 */ +#line 422 "awkgram.y" /* yacc.c:1646 */ { /* * treat any comments between BOF and the first function @@ -2165,17 +2166,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2169 "awkgram.c" /* yacc.c:1646 */ +#line 2170 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 455 "awkgram.y" /* yacc.c:1646 */ +#line 456 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2175 "awkgram.c" /* yacc.c:1646 */ +#line 2176 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 457 "awkgram.y" /* yacc.c:1646 */ +#line 458 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2204,28 +2205,28 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2208 "awkgram.c" /* yacc.c:1646 */ +#line 2209 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 489 "awkgram.y" /* yacc.c:1646 */ +#line 490 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2214 "awkgram.c" /* yacc.c:1646 */ +#line 2215 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 495 "awkgram.y" /* yacc.c:1646 */ +#line 496 "awkgram.y" /* yacc.c:1646 */ { if (comment != NULL) { (yyval) = list_create(comment); comment = NULL; } else (yyval) = NULL; } -#line 2225 "awkgram.c" /* yacc.c:1646 */ +#line 2226 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 502 "awkgram.y" /* yacc.c:1646 */ +#line 503 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) { if (comment == NULL) @@ -2253,40 +2254,40 @@ yyreduce: } yyerrok; } -#line 2257 "awkgram.c" /* yacc.c:1646 */ +#line 2258 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 530 "awkgram.y" /* yacc.c:1646 */ +#line 531 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2263 "awkgram.c" /* yacc.c:1646 */ +#line 2264 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 540 "awkgram.y" /* yacc.c:1646 */ +#line 541 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2269 "awkgram.c" /* yacc.c:1646 */ +#line 2270 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 542 "awkgram.y" /* yacc.c:1646 */ +#line 543 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2275 "awkgram.c" /* yacc.c:1646 */ +#line 2276 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 544 "awkgram.y" /* yacc.c:1646 */ +#line 545 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2286 "awkgram.c" /* yacc.c:1646 */ +#line 2287 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 551 "awkgram.y" /* yacc.c:1646 */ +#line 552 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2376,11 +2377,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2380 "awkgram.c" /* yacc.c:1646 */ +#line 2381 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 641 "awkgram.y" /* yacc.c:1646 */ +#line 642 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2422,11 +2423,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2426 "awkgram.c" /* yacc.c:1646 */ +#line 2427 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 683 "awkgram.y" /* yacc.c:1646 */ +#line 684 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2468,11 +2469,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2472 "awkgram.c" /* yacc.c:1646 */ +#line 2473 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 725 "awkgram.y" /* yacc.c:1646 */ +#line 726 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2585,44 +2586,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2589 "awkgram.c" /* yacc.c:1646 */ +#line 2590 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 838 "awkgram.y" /* yacc.c:1646 */ +#line 839 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2600 "awkgram.c" /* yacc.c:1646 */ +#line 2601 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 845 "awkgram.y" /* yacc.c:1646 */ +#line 846 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2611 "awkgram.c" /* yacc.c:1646 */ +#line 2612 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 852 "awkgram.y" /* yacc.c:1646 */ +#line 853 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2622 "awkgram.c" /* yacc.c:1646 */ +#line 2623 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 862 "awkgram.y" /* yacc.c:1646 */ +#line 863 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2631,11 +2632,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2635 "awkgram.c" /* yacc.c:1646 */ +#line 2636 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 871 "awkgram.y" /* yacc.c:1646 */ +#line 872 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2644,11 +2645,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2648 "awkgram.c" /* yacc.c:1646 */ +#line 2649 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 880 "awkgram.y" /* yacc.c:1646 */ +#line 881 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2657,11 +2658,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2661 "awkgram.c" /* yacc.c:1646 */ +#line 2662 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 889 "awkgram.y" /* yacc.c:1646 */ +#line 890 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2672,11 +2673,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2676 "awkgram.c" /* yacc.c:1646 */ +#line 2677 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 900 "awkgram.y" /* yacc.c:1646 */ +#line 901 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2691,20 +2692,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2695 "awkgram.c" /* yacc.c:1646 */ +#line 2696 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 915 "awkgram.y" /* yacc.c:1646 */ +#line 916 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2704 "awkgram.c" /* yacc.c:1646 */ +#line 2705 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 918 "awkgram.y" /* yacc.c:1646 */ +#line 919 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2725,17 +2726,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2729 "awkgram.c" /* yacc.c:1646 */ +#line 2730 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 950 "awkgram.y" /* yacc.c:1646 */ +#line 951 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2735 "awkgram.c" /* yacc.c:1646 */ +#line 2736 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 951 "awkgram.y" /* yacc.c:1646 */ +#line 952 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2832,17 +2833,17 @@ regular_print: } } } -#line 2836 "awkgram.c" /* yacc.c:1646 */ +#line 2837 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 1048 "awkgram.y" /* yacc.c:1646 */ +#line 1049 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2842 "awkgram.c" /* yacc.c:1646 */ +#line 2843 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 1049 "awkgram.y" /* yacc.c:1646 */ +#line 1050 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2875,11 +2876,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2879 "awkgram.c" /* yacc.c:1646 */ +#line 2880 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1086 "awkgram.y" /* yacc.c:1646 */ +#line 1087 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2905,52 +2906,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2909 "awkgram.c" /* yacc.c:1646 */ +#line 2910 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1112 "awkgram.y" /* yacc.c:1646 */ +#line 1113 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2915 "awkgram.c" /* yacc.c:1646 */ +#line 2916 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1117 "awkgram.y" /* yacc.c:1646 */ +#line 1118 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2921 "awkgram.c" /* yacc.c:1646 */ +#line 2922 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1119 "awkgram.y" /* yacc.c:1646 */ +#line 1120 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2927 "awkgram.c" /* yacc.c:1646 */ +#line 2928 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1124 "awkgram.y" /* yacc.c:1646 */ +#line 1125 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2933 "awkgram.c" /* yacc.c:1646 */ +#line 2934 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1126 "awkgram.y" /* yacc.c:1646 */ +#line 1127 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2944 "awkgram.c" /* yacc.c:1646 */ +#line 2945 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1133 "awkgram.y" /* yacc.c:1646 */ +#line 1134 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2950 "awkgram.c" /* yacc.c:1646 */ +#line 2951 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1138 "awkgram.y" /* yacc.c:1646 */ +#line 1139 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2962,11 +2963,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2966 "awkgram.c" /* yacc.c:1646 */ +#line 2967 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1150 "awkgram.y" /* yacc.c:1646 */ +#line 1151 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2977,17 +2978,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2981 "awkgram.c" /* yacc.c:1646 */ +#line 2982 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1164 "awkgram.y" /* yacc.c:1646 */ +#line 1165 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2987 "awkgram.c" /* yacc.c:1646 */ +#line 2988 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1166 "awkgram.y" /* yacc.c:1646 */ +#line 1167 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2995,71 +2996,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2999 "awkgram.c" /* yacc.c:1646 */ +#line 3000 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1174 "awkgram.y" /* yacc.c:1646 */ +#line 1175 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3008 "awkgram.c" /* yacc.c:1646 */ +#line 3009 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1179 "awkgram.y" /* yacc.c:1646 */ +#line 1180 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3014 "awkgram.c" /* yacc.c:1646 */ +#line 3015 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1181 "awkgram.y" /* yacc.c:1646 */ +#line 1182 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 3023 "awkgram.c" /* yacc.c:1646 */ +#line 3024 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1189 "awkgram.y" /* yacc.c:1646 */ +#line 1190 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3029 "awkgram.c" /* yacc.c:1646 */ +#line 3030 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1191 "awkgram.y" /* yacc.c:1646 */ +#line 1192 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3035 "awkgram.c" /* yacc.c:1646 */ +#line 3036 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1201 "awkgram.y" /* yacc.c:1646 */ +#line 1202 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3043 "awkgram.c" /* yacc.c:1646 */ +#line 3044 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1208 "awkgram.y" /* yacc.c:1646 */ +#line 1209 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 3053 "awkgram.c" /* yacc.c:1646 */ +#line 3054 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1213 "awkgram.y" /* yacc.c:1646 */ +#line 1214 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3059 "awkgram.c" /* yacc.c:1646 */ +#line 3060 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1214 "awkgram.y" /* yacc.c:1646 */ +#line 1215 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -3067,136 +3068,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3071 "awkgram.c" /* yacc.c:1646 */ +#line 3072 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1225 "awkgram.y" /* yacc.c:1646 */ +#line 1226 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3079 "awkgram.c" /* yacc.c:1646 */ +#line 3080 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1230 "awkgram.y" /* yacc.c:1646 */ +#line 1231 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3087 "awkgram.c" /* yacc.c:1646 */ +#line 3088 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1247 "awkgram.y" /* yacc.c:1646 */ +#line 1248 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3093 "awkgram.c" /* yacc.c:1646 */ +#line 3094 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1249 "awkgram.y" /* yacc.c:1646 */ +#line 1250 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3102 "awkgram.c" /* yacc.c:1646 */ +#line 3103 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1257 "awkgram.y" /* yacc.c:1646 */ +#line 1258 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3108 "awkgram.c" /* yacc.c:1646 */ +#line 3109 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1259 "awkgram.y" /* yacc.c:1646 */ +#line 1260 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3114 "awkgram.c" /* yacc.c:1646 */ +#line 3115 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1264 "awkgram.y" /* yacc.c:1646 */ +#line 1265 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3123 "awkgram.c" /* yacc.c:1646 */ +#line 3124 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1269 "awkgram.y" /* yacc.c:1646 */ +#line 1270 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3133 "awkgram.c" /* yacc.c:1646 */ +#line 3134 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1275 "awkgram.y" /* yacc.c:1646 */ +#line 1276 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3139 "awkgram.c" /* yacc.c:1646 */ +#line 3140 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1277 "awkgram.y" /* yacc.c:1646 */ +#line 1278 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3145 "awkgram.c" /* yacc.c:1646 */ +#line 3146 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1279 "awkgram.y" /* yacc.c:1646 */ +#line 1280 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3151 "awkgram.c" /* yacc.c:1646 */ +#line 3152 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1285 "awkgram.y" /* yacc.c:1646 */ +#line 1286 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3157 "awkgram.c" /* yacc.c:1646 */ +#line 3158 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1287 "awkgram.y" /* yacc.c:1646 */ +#line 1288 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3163 "awkgram.c" /* yacc.c:1646 */ +#line 3164 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1292 "awkgram.y" /* yacc.c:1646 */ +#line 1293 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3169 "awkgram.c" /* yacc.c:1646 */ +#line 3170 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1294 "awkgram.y" /* yacc.c:1646 */ +#line 1295 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3175 "awkgram.c" /* yacc.c:1646 */ +#line 3176 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1299 "awkgram.y" /* yacc.c:1646 */ +#line 1300 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3181 "awkgram.c" /* yacc.c:1646 */ +#line 3182 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1301 "awkgram.y" /* yacc.c:1646 */ +#line 1302 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3190 "awkgram.c" /* yacc.c:1646 */ +#line 3191 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1306 "awkgram.y" /* yacc.c:1646 */ +#line 1307 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3196 "awkgram.c" /* yacc.c:1646 */ +#line 3197 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1308 "awkgram.y" /* yacc.c:1646 */ +#line 1309 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3204,52 +3205,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3208 "awkgram.c" /* yacc.c:1646 */ +#line 3209 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1316 "awkgram.y" /* yacc.c:1646 */ +#line 1317 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3217 "awkgram.c" /* yacc.c:1646 */ +#line 3218 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1321 "awkgram.y" /* yacc.c:1646 */ +#line 1322 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3226 "awkgram.c" /* yacc.c:1646 */ +#line 3227 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1330 "awkgram.y" /* yacc.c:1646 */ +#line 1331 "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 3237 "awkgram.c" /* yacc.c:1646 */ +#line 3238 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1337 "awkgram.y" /* yacc.c:1646 */ +#line 1338 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3243 "awkgram.c" /* yacc.c:1646 */ +#line 3244 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1339 "awkgram.y" /* yacc.c:1646 */ +#line 1340 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3249 "awkgram.c" /* yacc.c:1646 */ +#line 3250 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1341 "awkgram.y" /* yacc.c:1646 */ +#line 1342 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3265,11 +3266,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3269 "awkgram.c" /* yacc.c:1646 */ +#line 3270 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1357 "awkgram.y" /* yacc.c:1646 */ +#line 1358 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3279,91 +3280,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3283 "awkgram.c" /* yacc.c:1646 */ +#line 3284 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1367 "awkgram.y" /* yacc.c:1646 */ +#line 1368 "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 3294 "awkgram.c" /* yacc.c:1646 */ +#line 3295 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1374 "awkgram.y" /* yacc.c:1646 */ +#line 1375 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3300 "awkgram.c" /* yacc.c:1646 */ +#line 3301 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1376 "awkgram.y" /* yacc.c:1646 */ +#line 1377 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3306 "awkgram.c" /* yacc.c:1646 */ +#line 3307 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1381 "awkgram.y" /* yacc.c:1646 */ +#line 1382 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3312 "awkgram.c" /* yacc.c:1646 */ +#line 3313 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1383 "awkgram.y" /* yacc.c:1646 */ +#line 1384 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3318 "awkgram.c" /* yacc.c:1646 */ +#line 3319 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1385 "awkgram.y" /* yacc.c:1646 */ +#line 1386 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3327 "awkgram.c" /* yacc.c:1646 */ +#line 3328 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1393 "awkgram.y" /* yacc.c:1646 */ +#line 1394 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3333 "awkgram.c" /* yacc.c:1646 */ +#line 3334 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1395 "awkgram.y" /* yacc.c:1646 */ +#line 1396 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3339 "awkgram.c" /* yacc.c:1646 */ +#line 3340 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1400 "awkgram.y" /* yacc.c:1646 */ +#line 1401 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3345 "awkgram.c" /* yacc.c:1646 */ +#line 3346 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1402 "awkgram.y" /* yacc.c:1646 */ +#line 1403 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3351 "awkgram.c" /* yacc.c:1646 */ +#line 3352 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1407 "awkgram.y" /* yacc.c:1646 */ +#line 1408 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3357 "awkgram.c" /* yacc.c:1646 */ +#line 3358 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1409 "awkgram.y" /* yacc.c:1646 */ +#line 1410 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3363 "awkgram.c" /* yacc.c:1646 */ +#line 3364 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1411 "awkgram.y" /* yacc.c:1646 */ +#line 1412 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3410,47 +3411,47 @@ regular_print: max_args = count; } } -#line 3414 "awkgram.c" /* yacc.c:1646 */ +#line 3415 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1463 "awkgram.y" /* yacc.c:1646 */ +#line 1464 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3420 "awkgram.c" /* yacc.c:1646 */ +#line 3421 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1465 "awkgram.y" /* yacc.c:1646 */ +#line 1466 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3426 "awkgram.c" /* yacc.c:1646 */ +#line 3427 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1467 "awkgram.y" /* yacc.c:1646 */ +#line 1468 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3432 "awkgram.c" /* yacc.c:1646 */ +#line 3433 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1469 "awkgram.y" /* yacc.c:1646 */ +#line 1470 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3438 "awkgram.c" /* yacc.c:1646 */ +#line 3439 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1471 "awkgram.y" /* yacc.c:1646 */ +#line 1472 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3444 "awkgram.c" /* yacc.c:1646 */ +#line 3445 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1473 "awkgram.y" /* yacc.c:1646 */ +#line 1474 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3450 "awkgram.c" /* yacc.c:1646 */ +#line 3451 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1475 "awkgram.y" /* yacc.c:1646 */ +#line 1476 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3464,29 +3465,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3468 "awkgram.c" /* yacc.c:1646 */ +#line 3469 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1489 "awkgram.y" /* yacc.c:1646 */ +#line 1490 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3477 "awkgram.c" /* yacc.c:1646 */ +#line 3478 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1494 "awkgram.y" /* yacc.c:1646 */ +#line 1495 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3486 "awkgram.c" /* yacc.c:1646 */ +#line 3487 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1499 "awkgram.y" /* yacc.c:1646 */ +#line 1500 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3506,64 +3507,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3510 "awkgram.c" /* yacc.c:1646 */ +#line 3511 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1524 "awkgram.y" /* yacc.c:1646 */ +#line 1525 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3519 "awkgram.c" /* yacc.c:1646 */ +#line 3520 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1530 "awkgram.y" /* yacc.c:1646 */ +#line 1531 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3525 "awkgram.c" /* yacc.c:1646 */ +#line 3526 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1532 "awkgram.y" /* yacc.c:1646 */ +#line 1533 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3531 "awkgram.c" /* yacc.c:1646 */ +#line 3532 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1534 "awkgram.y" /* yacc.c:1646 */ +#line 1535 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3537 "awkgram.c" /* yacc.c:1646 */ +#line 3538 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1536 "awkgram.y" /* yacc.c:1646 */ +#line 1537 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3543 "awkgram.c" /* yacc.c:1646 */ +#line 3544 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1538 "awkgram.y" /* yacc.c:1646 */ +#line 1539 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3549 "awkgram.c" /* yacc.c:1646 */ +#line 3550 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1540 "awkgram.y" /* yacc.c:1646 */ +#line 1541 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3555 "awkgram.c" /* yacc.c:1646 */ +#line 3556 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1545 "awkgram.y" /* yacc.c:1646 */ +#line 1546 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3563 "awkgram.c" /* yacc.c:1646 */ +#line 3564 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1549 "awkgram.y" /* yacc.c:1646 */ +#line 1550 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3595,37 +3596,37 @@ regular_print: } } } -#line 3599 "awkgram.c" /* yacc.c:1646 */ +#line 3600 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1581 "awkgram.y" /* yacc.c:1646 */ +#line 1582 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3605 "awkgram.c" /* yacc.c:1646 */ +#line 3606 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1583 "awkgram.y" /* yacc.c:1646 */ +#line 1584 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3615 "awkgram.c" /* yacc.c:1646 */ +#line 3616 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1589 "awkgram.y" /* yacc.c:1646 */ +#line 1590 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3625 "awkgram.c" /* yacc.c:1646 */ +#line 3626 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1595 "awkgram.y" /* yacc.c:1646 */ +#line 1596 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3638,45 +3639,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3642 "awkgram.c" /* yacc.c:1646 */ +#line 3643 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1610 "awkgram.y" /* yacc.c:1646 */ +#line 1611 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3651 "awkgram.c" /* yacc.c:1646 */ +#line 3652 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1615 "awkgram.y" /* yacc.c:1646 */ +#line 1616 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3660 "awkgram.c" /* yacc.c:1646 */ +#line 3661 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1620 "awkgram.y" /* yacc.c:1646 */ +#line 1621 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3668 "awkgram.c" /* yacc.c:1646 */ +#line 3669 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1624 "awkgram.y" /* yacc.c:1646 */ +#line 1625 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3676 "awkgram.c" /* yacc.c:1646 */ +#line 3677 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1628 "awkgram.y" /* yacc.c:1646 */ +#line 1629 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3691,11 +3692,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3695 "awkgram.c" /* yacc.c:1646 */ +#line 3696 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1643 "awkgram.y" /* yacc.c:1646 */ +#line 1644 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3705,20 +3706,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3709 "awkgram.c" /* yacc.c:1646 */ +#line 3710 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1656 "awkgram.y" /* yacc.c:1646 */ +#line 1657 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3718 "awkgram.c" /* yacc.c:1646 */ +#line 3719 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1661 "awkgram.y" /* yacc.c:1646 */ +#line 1662 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3751,11 +3752,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3755 "awkgram.c" /* yacc.c:1646 */ +#line 3756 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1697 "awkgram.y" /* yacc.c:1646 */ +#line 1698 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3769,49 +3770,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3773 "awkgram.c" /* yacc.c:1646 */ +#line 3774 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1714 "awkgram.y" /* yacc.c:1646 */ +#line 1715 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3779 "awkgram.c" /* yacc.c:1646 */ +#line 3780 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1716 "awkgram.y" /* yacc.c:1646 */ +#line 1717 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3785 "awkgram.c" /* yacc.c:1646 */ +#line 3786 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1721 "awkgram.y" /* yacc.c:1646 */ +#line 1722 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3791 "awkgram.c" /* yacc.c:1646 */ +#line 3792 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1723 "awkgram.y" /* yacc.c:1646 */ +#line 1724 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3797 "awkgram.c" /* yacc.c:1646 */ +#line 3798 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1728 "awkgram.y" /* yacc.c:1646 */ +#line 1729 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3803 "awkgram.c" /* yacc.c:1646 */ +#line 3804 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1730 "awkgram.y" /* yacc.c:1646 */ +#line 1731 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3811 "awkgram.c" /* yacc.c:1646 */ +#line 3812 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1737 "awkgram.y" /* yacc.c:1646 */ +#line 1738 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3825,11 +3826,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3829 "awkgram.c" /* yacc.c:1646 */ +#line 3830 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1754 "awkgram.y" /* yacc.c:1646 */ +#line 1755 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3843,31 +3844,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3847 "awkgram.c" /* yacc.c:1646 */ +#line 3848 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1771 "awkgram.y" /* yacc.c:1646 */ +#line 1772 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3853 "awkgram.c" /* yacc.c:1646 */ +#line 3854 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1773 "awkgram.y" /* yacc.c:1646 */ +#line 1774 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3861 "awkgram.c" /* yacc.c:1646 */ +#line 3862 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1780 "awkgram.y" /* yacc.c:1646 */ +#line 1781 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3867 "awkgram.c" /* yacc.c:1646 */ +#line 3868 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1785 "awkgram.y" /* yacc.c:1646 */ +#line 1786 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3875,22 +3876,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3879 "awkgram.c" /* yacc.c:1646 */ +#line 3880 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1793 "awkgram.y" /* yacc.c:1646 */ +#line 1794 "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 3890 "awkgram.c" /* yacc.c:1646 */ +#line 3891 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1803 "awkgram.y" /* yacc.c:1646 */ +#line 1804 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3902,73 +3903,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3906 "awkgram.c" /* yacc.c:1646 */ +#line 3907 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1815 "awkgram.y" /* yacc.c:1646 */ +#line 1816 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3916 "awkgram.c" /* yacc.c:1646 */ +#line 3917 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1824 "awkgram.y" /* yacc.c:1646 */ +#line 1825 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3924 "awkgram.c" /* yacc.c:1646 */ +#line 3925 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1828 "awkgram.y" /* yacc.c:1646 */ +#line 1829 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3932 "awkgram.c" /* yacc.c:1646 */ +#line 3933 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1831 "awkgram.y" /* yacc.c:1646 */ +#line 1832 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3938 "awkgram.c" /* yacc.c:1646 */ +#line 3939 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1839 "awkgram.y" /* yacc.c:1646 */ +#line 1840 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3944 "awkgram.c" /* yacc.c:1646 */ +#line 3945 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1843 "awkgram.y" /* yacc.c:1646 */ +#line 1844 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3950 "awkgram.c" /* yacc.c:1646 */ +#line 3951 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1852 "awkgram.y" /* yacc.c:1646 */ +#line 1853 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3956 "awkgram.c" /* yacc.c:1646 */ +#line 3957 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1856 "awkgram.y" /* yacc.c:1646 */ +#line 1857 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3962 "awkgram.c" /* yacc.c:1646 */ +#line 3963 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1860 "awkgram.y" /* yacc.c:1646 */ +#line 1861 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3968 "awkgram.c" /* yacc.c:1646 */ +#line 3969 "awkgram.c" /* yacc.c:1646 */ break; -#line 3972 "awkgram.c" /* yacc.c:1646 */ +#line 3973 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4196,7 +4197,7 @@ yyreturn: #endif return yyresult; } -#line 1862 "awkgram.y" /* yacc.c:1906 */ +#line 1863 "awkgram.y" /* yacc.c:1906 */ struct token { diff --git a/awkgram.y b/awkgram.y index d054ec9b..5e3bade9 100644 --- a/awkgram.y +++ b/awkgram.y @@ -228,6 +228,7 @@ rule : pattern action { (void) append_rule($1, $2); + first_rule = false; } | pattern statement_term { diff --git a/test/ChangeLog b/test/ChangeLog index 500fdb02..75278015 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-01-16 Arnold D. Robbins + + * Makefile.am (profile8): New test. + * profile8.awk, profile8.ok: New files. + 2015-01-14 Arnold D. Robbins * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since diff --git a/test/Makefile.am b/test/Makefile.am index c3d8309d..a60547ff 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1727,6 +1727,11 @@ profile7: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile8: + @echo $@ + @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 diff --git a/test/Makefile.in b/test/Makefile.in index 3c036351..73012c81 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2152,6 +2152,11 @@ profile7: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile8: + @echo $@ + @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 diff --git a/test/profile8.awk b/test/profile8.awk new file mode 100644 index 00000000..16252cea --- /dev/null +++ b/test/profile8.awk @@ -0,0 +1,9 @@ +# Some +# header +# comments + +# Add up +{ sum += $1 } + +# Print sum +END { print sum } diff --git a/test/profile8.ok b/test/profile8.ok new file mode 100644 index 00000000..34f7a96b --- /dev/null +++ b/test/profile8.ok @@ -0,0 +1,14 @@ +# Some +# header +# comments + +# Add up +{ + sum += $1 +} + +# Print sum +END { + print sum +} + -- cgit v1.2.3 From f25f9c52b1ab284ac1055b4f8321a2da33e81fcb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 19 Jan 2015 05:29:09 +0200 Subject: Finish adding profile8 test. --- test/ChangeLog | 5 +++++ test/Makefile.am | 5 ++++- test/Makefile.in | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index 75278015..19105027 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-01-19 Arnold D. Robbins + + * Makefile.am (profile8): Actually add the test and the files. + Thanks to Hermann Peifer for the report. + 2015-01-16 Arnold D. Robbins * Makefile.am (profile8): New test. diff --git a/test/Makefile.am b/test/Makefile.am index a60547ff..8f501b56 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -715,6 +715,8 @@ EXTRA_DIST = \ profile6.ok \ profile7.awk \ profile7.ok \ + profile8.awk \ + profile8.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -1034,7 +1036,8 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ + profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ diff --git a/test/Makefile.in b/test/Makefile.in index 73012c81..d4097f3d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -962,6 +962,8 @@ EXTRA_DIST = \ profile6.ok \ profile7.awk \ profile7.ok \ + profile8.awk \ + profile8.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -1280,7 +1282,8 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ + profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ -- cgit v1.2.3 From a07103b076a9a88d89bf063396a74f2272749cf4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 19 Jan 2015 06:31:11 +0200 Subject: Update to bison 3.0.3. --- ChangeLog | 6 ++++++ NEWS | 3 ++- awkgram.c | 6 +++--- command.c | 6 +++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 605ed80d..05594a8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-01-19 Arnold D. Robbins + + * awkgram.c: Update to bison 3.0.3. + * command.c: Ditto. + * NEWS: Note same. + 2015-01-15 Arnold D. Robbins * dfa.h, dfa.c: Sync with grep. Mainly copyright updates. diff --git a/NEWS b/NEWS index 673c1cda..cbb2d227 100644 --- a/NEWS +++ b/NEWS @@ -41,7 +41,8 @@ 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. +10. Infrastructure upgrades: Automake 1.14.1, Gettext 0.19.3, Libtool 2.4.3, + Bison 3.0.3. XX. A number of bugs have been fixed. See the ChangeLog. diff --git a/awkgram.c b/awkgram.c index 99f067e7..2407d220 100644 --- a/awkgram.c +++ b/awkgram.c @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.3. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" diff --git a/command.c b/command.c index 2d4bc814..389814a5 100644 --- a/command.c +++ b/command.c @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.3. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" -- cgit v1.2.3 From d680707683794b92f2fc69e71dcb5b2a154598be Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 19 Jan 2015 06:32:17 +0200 Subject: Doc edits. --- doc/ChangeLog | 5 + doc/gawk.info | 1155 +++++++++++++++++++++++++++-------------------------- doc/gawk.texi | 34 +- doc/gawkinet.info | 6 +- doc/gawkinet.texi | 2 +- doc/gawktexi.in | 34 +- 6 files changed, 623 insertions(+), 613 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d2b9f236..7f2341b5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-19 Arnold D. Robbins + + * gawkinet.texi: Fix capitalization in document title. + * gawktexi.in: Here we again: Starting on more O'Reilly fixes. + 2014-12-26 Antonio Giovanni Colombo * gawktexi.in (Glossary): Really sort the items. diff --git a/doc/gawk.info b/doc/gawk.info index 4b016405..47f21442 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -9,7 +9,7 @@ START-INFO-DIR-ENTRY * awk: (gawk)Invoking gawk. Text scanning and processing. END-INFO-DIR-ENTRY - Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2014 + Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2015 Free Software Foundation, Inc. @@ -37,7 +37,7 @@ General Introduction This file documents `awk', a program that you can use to select particular records in a file and perform operations upon them. - Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2014 + Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2015 Free Software Foundation, Inc. @@ -747,10 +747,10 @@ and associative arrays. Those looking for something new can try out The programs in this book make clear that an AWK program is typically much smaller and faster to develop than a counterpart written -in C. Consequently, there is often a payoff to prototype an algorithm -or design in AWK to get it running quickly and expose problems early. -Often, the interpreted performance is adequate and the AWK prototype -becomes the product. +in C. Consequently, there is often a payoff to prototyping an +algorithm or design in AWK to get it running quickly and expose +problems early. Often, the interpreted performance is adequate and the +AWK prototype becomes the product. The new `pgawk' (profiling `gawk'), produces program execution counts. I recently experimented with an algorithm that for n lines of @@ -774,16 +774,16 @@ Foreword to the Fourth Edition ****************************** Some things don't change. Thirteen years ago I wrote: "If you use AWK -or want to learn how, then read this book." True then and still true +or want to learn how, then read this book." True then, and still true today. - Learning to use a programming language is more than mastering the -syntax. One needs to acquire an understanding of how to use the + Learning to use a programming language is about more than mastering +the syntax. One needs to acquire an understanding of how to use the features of the language to solve practical programming problems. A focus of this book is many examples that show how to use AWK. Some things do change. Our computers are much faster and have more -memory. Consequently, speed and storage inefficiencies of a high level +memory. Consequently, speed and storage inefficiencies of a high-level language matter less. Prototyping in AWK and then rewriting in C for performance reasons happens less, because more often the prototype is fast enough. @@ -792,9 +792,9 @@ fast enough. C++. With `gawk' 4.1 and later, you do not have to choose between writing your program in AWK or in C/C++. You can write most of your program in AWK and the aspects that require C/C++ capabilities can be -written in C/C++ and then the pieces glued together when the `gawk' +written in C/C++, and then the pieces glued together when the `gawk' module loads the C/C++ module as a dynamic plug-in. *note Dynamic -Extensions::, has all the details, and as expected, many examples to +Extensions::, has all the details, and, as expected, many examples to help you learn the ins and outs. I enjoy programming in AWK and had fun (re)reading this book. I @@ -833,7 +833,7 @@ So most of the time, we don't distinguish between `gawk' and other * Validate data - * Produce indexes and perform other document preparation tasks + * Produce indexes and perform other document-preparation tasks * Experiment with algorithms that you can adapt later to other computer languages @@ -925,7 +925,7 @@ advice from Richard Stallman. John Woods contributed parts of the code as well. In 1988 and 1989, David Trueman, with help from me, thoroughly reworked `gawk' for compatibility with the newer `awk'. Circa 1994, I became the primary maintainer. Current development -focuses on bug fixes, performance improvements, standards compliance +focuses on bug fixes, performance improvements, standards compliance, and, occasionally, new features. In May 1997, Ju"rgen Kahrs felt the need for network access from @@ -937,10 +937,10 @@ the `gawk' distribution). His code finally became part of the main John Haque rewrote the `gawk' internals, in the process providing an `awk'-level debugger. This version became available as `gawk' version -4.0, in 2011. +4.0 in 2011. - *Note Contributors::, for a full list of those who made important -contributions to `gawk'. + *Note Contributors::, for a full list of those who have made +important contributions to `gawk'.  File: gawk.info, Node: Names, Next: This Manual, Prev: History, Up: Preface @@ -953,7 +953,7 @@ provided in *note Language History::. The language described in this Info file is often referred to as "new `awk'." By analogy, the original version of `awk' is referred to as "old `awk'." - Today, on most systems, when you run the `awk' utility, you get some + Today, on most systems, when you run the `awk' utility you get some version of new `awk'.(1) If your system's standard `awk' is the old one, you will see something like this if you try the test program: @@ -1013,9 +1013,9 @@ in *note Sample Programs::, should be of interest. This Info file is split into several parts, as follows: - * Part I describes the `awk' language and `gawk' program in detail. - It starts with the basics, and continues through all of the - features of `awk'. It contains the following chapters: + * Part I describes the `awk' language and the `gawk' program in + detail. It starts with the basics, and continues through all of + the features of `awk'. It contains the following chapters: - *note Getting Started::, provides the essentials you need to know to begin using `awk'. @@ -1046,9 +1046,10 @@ in *note Sample Programs::, should be of interest. `gawk' use. - *note Arrays::, covers `awk''s one-and-only data structure: - associative arrays. Deleting array elements and whole arrays - is also described, as well as sorting arrays in `gawk'. It - also describes how `gawk' provides arrays of arrays. + the associative array. Deleting array elements and whole + arrays is also described, as well as sorting arrays in + `gawk'. It also describes how `gawk' provides arrays of + arrays. - *note Functions::, describes the built-in functions `awk' and `gawk' provide, as well as how to define your own functions. @@ -34301,558 +34302,558 @@ Index Tag Table: Node: Top1204 Node: Foreword342156 -Node: Foreword446598 -Node: Preface48120 -Ref: Preface-Footnote-150991 -Ref: Preface-Footnote-251098 -Ref: Preface-Footnote-351331 -Node: History51473 -Node: Names53819 -Ref: Names-Footnote-154913 -Node: This Manual55059 -Ref: This Manual-Footnote-161546 -Node: Conventions61646 -Node: Manual History63984 -Ref: Manual History-Footnote-166966 -Ref: Manual History-Footnote-267007 -Node: How To Contribute67081 -Node: Acknowledgments68210 -Node: Getting Started73015 -Node: Running gawk75448 -Node: One-shot76638 -Node: Read Terminal77886 -Node: Long79913 -Node: Executable Scripts81429 -Ref: Executable Scripts-Footnote-184218 -Node: Comments84321 -Node: Quoting86803 -Node: DOS Quoting92327 -Node: Sample Data Files93002 -Node: Very Simple95597 -Node: Two Rules100495 -Node: More Complex102381 -Node: Statements/Lines105243 -Ref: Statements/Lines-Footnote-1109698 -Node: Other Features109963 -Node: When110894 -Ref: When-Footnote-1112648 -Node: Intro Summary112713 -Node: Invoking Gawk113596 -Node: Command Line115110 -Node: Options115908 -Ref: Options-Footnote-1131841 -Ref: Options-Footnote-2132070 -Node: Other Arguments132095 -Node: Naming Standard Input135043 -Node: Environment Variables136136 -Node: AWKPATH Variable136694 -Ref: AWKPATH Variable-Footnote-1139997 -Ref: AWKPATH Variable-Footnote-2140042 -Node: AWKLIBPATH Variable140302 -Node: Other Environment Variables141445 -Node: Exit Status145173 -Node: Include Files145849 -Node: Loading Shared Libraries149446 -Node: Obsolete150873 -Node: Undocumented151570 -Node: Invoking Summary151837 -Node: Regexp153501 -Node: Regexp Usage154955 -Node: Escape Sequences156992 -Node: Regexp Operators163003 -Ref: Regexp Operators-Footnote-1170429 -Ref: Regexp Operators-Footnote-2170576 -Node: Bracket Expressions170674 -Ref: table-char-classes172689 -Node: Leftmost Longest175613 -Node: Computed Regexps176915 -Node: GNU Regexp Operators180312 -Node: Case-sensitivity183985 -Ref: Case-sensitivity-Footnote-1186870 -Ref: Case-sensitivity-Footnote-2187105 -Node: Regexp Summary187213 -Node: Reading Files188680 -Node: Records190774 -Node: awk split records191507 -Node: gawk split records196422 -Ref: gawk split records-Footnote-1200966 -Node: Fields201003 -Ref: Fields-Footnote-1203779 -Node: Nonconstant Fields203865 -Ref: Nonconstant Fields-Footnote-1206108 -Node: Changing Fields206312 -Node: Field Separators212241 -Node: Default Field Splitting214946 -Node: Regexp Field Splitting216063 -Node: Single Character Fields219413 -Node: Command Line Field Separator220472 -Node: Full Line Fields223684 -Ref: Full Line Fields-Footnote-1225201 -Ref: Full Line Fields-Footnote-2225247 -Node: Field Splitting Summary225348 -Node: Constant Size227422 -Node: Splitting By Content232011 -Ref: Splitting By Content-Footnote-1236005 -Node: Multiple Line236168 -Ref: Multiple Line-Footnote-1242054 -Node: Getline242233 -Node: Plain Getline244445 -Node: Getline/Variable247085 -Node: Getline/File248233 -Node: Getline/Variable/File249617 -Ref: Getline/Variable/File-Footnote-1251220 -Node: Getline/Pipe251307 -Node: Getline/Variable/Pipe253990 -Node: Getline/Coprocess255121 -Node: Getline/Variable/Coprocess256373 -Node: Getline Notes257112 -Node: Getline Summary259904 -Ref: table-getline-variants260316 -Node: Read Timeout261145 -Ref: Read Timeout-Footnote-1264970 -Node: Command-line directories265028 -Node: Input Summary265933 -Node: Input Exercises269234 -Node: Printing269962 -Node: Print271739 -Node: Print Examples273196 -Node: Output Separators275975 -Node: OFMT277993 -Node: Printf279347 -Node: Basic Printf280132 -Node: Control Letters281702 -Node: Format Modifiers285685 -Node: Printf Examples291694 -Node: Redirection294180 -Node: Special FD301021 -Ref: Special FD-Footnote-1304181 -Node: Special Files304255 -Node: Other Inherited Files304872 -Node: Special Network305872 -Node: Special Caveats306734 -Node: Close Files And Pipes307685 -Ref: Close Files And Pipes-Footnote-1314867 -Ref: Close Files And Pipes-Footnote-2315015 -Node: Output Summary315165 -Node: Output Exercises316163 -Node: Expressions316843 -Node: Values318028 -Node: Constants318706 -Node: Scalar Constants319397 -Ref: Scalar Constants-Footnote-1320256 -Node: Nondecimal-numbers320506 -Node: Regexp Constants323524 -Node: Using Constant Regexps324049 -Node: Variables327192 -Node: Using Variables327847 -Node: Assignment Options329758 -Node: Conversion331633 -Node: Strings And Numbers332157 -Ref: Strings And Numbers-Footnote-1335222 -Node: Locale influences conversions335331 -Ref: table-locale-affects338078 -Node: All Operators338666 -Node: Arithmetic Ops339296 -Node: Concatenation341801 -Ref: Concatenation-Footnote-1344620 -Node: Assignment Ops344726 -Ref: table-assign-ops349705 -Node: Increment Ops350977 -Node: Truth Values and Conditions354415 -Node: Truth Values355500 -Node: Typing and Comparison356549 -Node: Variable Typing357359 -Node: Comparison Operators361012 -Ref: table-relational-ops361422 -Node: POSIX String Comparison364917 -Ref: POSIX String Comparison-Footnote-1365989 -Node: Boolean Ops366127 -Ref: Boolean Ops-Footnote-1370606 -Node: Conditional Exp370697 -Node: Function Calls372424 -Node: Precedence376304 -Node: Locales379965 -Node: Expressions Summary381597 -Node: Patterns and Actions384157 -Node: Pattern Overview385277 -Node: Regexp Patterns386956 -Node: Expression Patterns387499 -Node: Ranges391209 -Node: BEGIN/END394315 -Node: Using BEGIN/END395076 -Ref: Using BEGIN/END-Footnote-1397810 -Node: I/O And BEGIN/END397916 -Node: BEGINFILE/ENDFILE400230 -Node: Empty403131 -Node: Using Shell Variables403448 -Node: Action Overview405721 -Node: Statements408047 -Node: If Statement409895 -Node: While Statement411390 -Node: Do Statement413419 -Node: For Statement414563 -Node: Switch Statement417720 -Node: Break Statement420102 -Node: Continue Statement422143 -Node: Next Statement423970 -Node: Nextfile Statement426351 -Node: Exit Statement428981 -Node: Built-in Variables431384 -Node: User-modified432517 -Ref: User-modified-Footnote-1440198 -Node: Auto-set440260 -Ref: Auto-set-Footnote-1453295 -Ref: Auto-set-Footnote-2453500 -Node: ARGC and ARGV453556 -Node: Pattern Action Summary457774 -Node: Arrays460201 -Node: Array Basics461530 -Node: Array Intro462374 -Ref: figure-array-elements464338 -Ref: Array Intro-Footnote-1466864 -Node: Reference to Elements466992 -Node: Assigning Elements469444 -Node: Array Example469935 -Node: Scanning an Array471693 -Node: Controlling Scanning474709 -Ref: Controlling Scanning-Footnote-1479905 -Node: Numeric Array Subscripts480221 -Node: Uninitialized Subscripts482406 -Node: Delete484023 -Ref: Delete-Footnote-1486766 -Node: Multidimensional486823 -Node: Multiscanning489920 -Node: Arrays of Arrays491509 -Node: Arrays Summary496268 -Node: Functions498360 -Node: Built-in499259 -Node: Calling Built-in500337 -Node: Numeric Functions502328 -Ref: Numeric Functions-Footnote-1506345 -Ref: Numeric Functions-Footnote-2506702 -Ref: Numeric Functions-Footnote-3506750 -Node: String Functions507022 -Ref: String Functions-Footnote-1530497 -Ref: String Functions-Footnote-2530626 -Ref: String Functions-Footnote-3530874 -Node: Gory Details530961 -Ref: table-sub-escapes532742 -Ref: table-sub-proposed534262 -Ref: table-posix-sub535626 -Ref: table-gensub-escapes537162 -Ref: Gory Details-Footnote-1537994 -Node: I/O Functions538145 -Ref: I/O Functions-Footnote-1545363 -Node: Time Functions545510 -Ref: Time Functions-Footnote-1555998 -Ref: Time Functions-Footnote-2556066 -Ref: Time Functions-Footnote-3556224 -Ref: Time Functions-Footnote-4556335 -Ref: Time Functions-Footnote-5556447 -Ref: Time Functions-Footnote-6556674 -Node: Bitwise Functions556940 -Ref: table-bitwise-ops557502 -Ref: Bitwise Functions-Footnote-1561811 -Node: Type Functions561980 -Node: I18N Functions563131 -Node: User-defined564776 -Node: Definition Syntax565581 -Ref: Definition Syntax-Footnote-1570988 -Node: Function Example571059 -Ref: Function Example-Footnote-1573978 -Node: Function Caveats574000 -Node: Calling A Function574518 -Node: Variable Scope575476 -Node: Pass By Value/Reference578464 -Node: Return Statement581959 -Node: Dynamic Typing584940 -Node: Indirect Calls585869 -Ref: Indirect Calls-Footnote-1597171 -Node: Functions Summary597299 -Node: Library Functions600001 -Ref: Library Functions-Footnote-1603610 -Ref: Library Functions-Footnote-2603753 -Node: Library Names603924 -Ref: Library Names-Footnote-1607378 -Ref: Library Names-Footnote-2607601 -Node: General Functions607687 -Node: Strtonum Function608790 -Node: Assert Function611812 -Node: Round Function615136 -Node: Cliff Random Function616677 -Node: Ordinal Functions617693 -Ref: Ordinal Functions-Footnote-1620756 -Ref: Ordinal Functions-Footnote-2621008 -Node: Join Function621219 -Ref: Join Function-Footnote-1622988 -Node: Getlocaltime Function623188 -Node: Readfile Function626932 -Node: Shell Quoting628902 -Node: Data File Management630303 -Node: Filetrans Function630935 -Node: Rewind Function634991 -Node: File Checking636378 -Ref: File Checking-Footnote-1637710 -Node: Empty Files637911 -Node: Ignoring Assigns639890 -Node: Getopt Function641441 -Ref: Getopt Function-Footnote-1652903 -Node: Passwd Functions653103 -Ref: Passwd Functions-Footnote-1661940 -Node: Group Functions662028 -Ref: Group Functions-Footnote-1669922 -Node: Walking Arrays670135 -Node: Library Functions Summary671738 -Node: Library Exercises673139 -Node: Sample Programs674419 -Node: Running Examples675189 -Node: Clones675917 -Node: Cut Program677141 -Node: Egrep Program686860 -Ref: Egrep Program-Footnote-1694358 -Node: Id Program694468 -Node: Split Program698113 -Ref: Split Program-Footnote-1701561 -Node: Tee Program701689 -Node: Uniq Program704478 -Node: Wc Program711897 -Ref: Wc Program-Footnote-1716147 -Node: Miscellaneous Programs716241 -Node: Dupword Program717454 -Node: Alarm Program719485 -Node: Translate Program724289 -Ref: Translate Program-Footnote-1728854 -Node: Labels Program729124 -Ref: Labels Program-Footnote-1732475 -Node: Word Sorting732559 -Node: History Sorting736630 -Node: Extract Program738466 -Node: Simple Sed745991 -Node: Igawk Program749059 -Ref: Igawk Program-Footnote-1763383 -Ref: Igawk Program-Footnote-2763584 -Ref: Igawk Program-Footnote-3763706 -Node: Anagram Program763821 -Node: Signature Program766878 -Node: Programs Summary768125 -Node: Programs Exercises769318 -Ref: Programs Exercises-Footnote-1773449 -Node: Advanced Features773540 -Node: Nondecimal Data775488 -Node: Array Sorting777078 -Node: Controlling Array Traversal777775 -Ref: Controlling Array Traversal-Footnote-1786108 -Node: Array Sorting Functions786226 -Ref: Array Sorting Functions-Footnote-1790115 -Node: Two-way I/O790311 -Ref: Two-way I/O-Footnote-1795256 -Ref: Two-way I/O-Footnote-2795442 -Node: TCP/IP Networking795524 -Node: Profiling798397 -Node: Advanced Features Summary805944 -Node: Internationalization807877 -Node: I18N and L10N809357 -Node: Explaining gettext810043 -Ref: Explaining gettext-Footnote-1815068 -Ref: Explaining gettext-Footnote-2815252 -Node: Programmer i18n815417 -Ref: Programmer i18n-Footnote-1820283 -Node: Translator i18n820332 -Node: String Extraction821126 -Ref: String Extraction-Footnote-1822257 -Node: Printf Ordering822343 -Ref: Printf Ordering-Footnote-1825129 -Node: I18N Portability825193 -Ref: I18N Portability-Footnote-1827648 -Node: I18N Example827711 -Ref: I18N Example-Footnote-1830514 -Node: Gawk I18N830586 -Node: I18N Summary831224 -Node: Debugger832563 -Node: Debugging833585 -Node: Debugging Concepts834026 -Node: Debugging Terms835879 -Node: Awk Debugging838451 -Node: Sample Debugging Session839345 -Node: Debugger Invocation839865 -Node: Finding The Bug841249 -Node: List of Debugger Commands847724 -Node: Breakpoint Control849057 -Node: Debugger Execution Control852753 -Node: Viewing And Changing Data856117 -Node: Execution Stack859495 -Node: Debugger Info861132 -Node: Miscellaneous Debugger Commands865149 -Node: Readline Support870178 -Node: Limitations871070 -Node: Debugging Summary873184 -Node: Arbitrary Precision Arithmetic874352 -Node: Computer Arithmetic875768 -Ref: table-numeric-ranges879366 -Ref: Computer Arithmetic-Footnote-1880225 -Node: Math Definitions880282 -Ref: table-ieee-formats883570 -Ref: Math Definitions-Footnote-1884174 -Node: MPFR features884279 -Node: FP Math Caution885950 -Ref: FP Math Caution-Footnote-1887000 -Node: Inexactness of computations887369 -Node: Inexact representation888328 -Node: Comparing FP Values889685 -Node: Errors accumulate890767 -Node: Getting Accuracy892200 -Node: Try To Round894862 -Node: Setting precision895761 -Ref: table-predefined-precision-strings896445 -Node: Setting the rounding mode898234 -Ref: table-gawk-rounding-modes898598 -Ref: Setting the rounding mode-Footnote-1902053 -Node: Arbitrary Precision Integers902232 -Ref: Arbitrary Precision Integers-Footnote-1905218 -Node: POSIX Floating Point Problems905367 -Ref: POSIX Floating Point Problems-Footnote-1909240 -Node: Floating point summary909278 -Node: Dynamic Extensions911472 -Node: Extension Intro913024 -Node: Plugin License914290 -Node: Extension Mechanism Outline915087 -Ref: figure-load-extension915515 -Ref: figure-register-new-function916995 -Ref: figure-call-new-function917999 -Node: Extension API Description919985 -Node: Extension API Functions Introduction921435 -Node: General Data Types926259 -Ref: General Data Types-Footnote-1931998 -Node: Memory Allocation Functions932297 -Ref: Memory Allocation Functions-Footnote-1935136 -Node: Constructor Functions935232 -Node: Registration Functions936966 -Node: Extension Functions937651 -Node: Exit Callback Functions939948 -Node: Extension Version String941196 -Node: Input Parsers941861 -Node: Output Wrappers951740 -Node: Two-way processors956255 -Node: Printing Messages958459 -Ref: Printing Messages-Footnote-1959535 -Node: Updating `ERRNO'959687 -Node: Requesting Values960427 -Ref: table-value-types-returned961155 -Node: Accessing Parameters962112 -Node: Symbol Table Access963343 -Node: Symbol table by name963857 -Node: Symbol table by cookie965838 -Ref: Symbol table by cookie-Footnote-1969982 -Node: Cached values970045 -Ref: Cached values-Footnote-1973544 -Node: Array Manipulation973635 -Ref: Array Manipulation-Footnote-1974733 -Node: Array Data Types974770 -Ref: Array Data Types-Footnote-1977425 -Node: Array Functions977517 -Node: Flattening Arrays981371 -Node: Creating Arrays988263 -Node: Extension API Variables993034 -Node: Extension Versioning993670 -Node: Extension API Informational Variables995571 -Node: Extension API Boilerplate996636 -Node: Finding Extensions1000445 -Node: Extension Example1001005 -Node: Internal File Description1001777 -Node: Internal File Ops1005844 -Ref: Internal File Ops-Footnote-11017514 -Node: Using Internal File Ops1017654 -Ref: Using Internal File Ops-Footnote-11020037 -Node: Extension Samples1020310 -Node: Extension Sample File Functions1021836 -Node: Extension Sample Fnmatch1029474 -Node: Extension Sample Fork1030965 -Node: Extension Sample Inplace1032180 -Node: Extension Sample Ord1033855 -Node: Extension Sample Readdir1034691 -Ref: table-readdir-file-types1035567 -Node: Extension Sample Revout1036378 -Node: Extension Sample Rev2way1036968 -Node: Extension Sample Read write array1037708 -Node: Extension Sample Readfile1039648 -Node: Extension Sample Time1040743 -Node: Extension Sample API Tests1042092 -Node: gawkextlib1042583 -Node: Extension summary1045241 -Node: Extension Exercises1048930 -Node: Language History1049652 -Node: V7/SVR3.11051308 -Node: SVR41053489 -Node: POSIX1054934 -Node: BTL1056323 -Node: POSIX/GNU1057057 -Node: Feature History1062621 -Node: Common Extensions1075719 -Node: Ranges and Locales1077043 -Ref: Ranges and Locales-Footnote-11081661 -Ref: Ranges and Locales-Footnote-21081688 -Ref: Ranges and Locales-Footnote-31081922 -Node: Contributors1082143 -Node: History summary1087684 -Node: Installation1089054 -Node: Gawk Distribution1090000 -Node: Getting1090484 -Node: Extracting1091307 -Node: Distribution contents1092942 -Node: Unix Installation1098659 -Node: Quick Installation1099276 -Node: Additional Configuration Options1101700 -Node: Configuration Philosophy1103438 -Node: Non-Unix Installation1105807 -Node: PC Installation1106265 -Node: PC Binary Installation1107584 -Node: PC Compiling1109432 -Ref: PC Compiling-Footnote-11112453 -Node: PC Testing1112562 -Node: PC Using1113738 -Node: Cygwin1117853 -Node: MSYS1118676 -Node: VMS Installation1119176 -Node: VMS Compilation1119968 -Ref: VMS Compilation-Footnote-11121190 -Node: VMS Dynamic Extensions1121248 -Node: VMS Installation Details1122932 -Node: VMS Running1125184 -Node: VMS GNV1128020 -Node: VMS Old Gawk1128754 -Node: Bugs1129224 -Node: Other Versions1133107 -Node: Installation summary1139535 -Node: Notes1140591 -Node: Compatibility Mode1141456 -Node: Additions1142238 -Node: Accessing The Source1143163 -Node: Adding Code1144599 -Node: New Ports1150764 -Node: Derived Files1155246 -Ref: Derived Files-Footnote-11160721 -Ref: Derived Files-Footnote-21160755 -Ref: Derived Files-Footnote-31161351 -Node: Future Extensions1161465 -Node: Implementation Limitations1162071 -Node: Extension Design1163319 -Node: Old Extension Problems1164473 -Ref: Old Extension Problems-Footnote-11165990 -Node: Extension New Mechanism Goals1166047 -Ref: Extension New Mechanism Goals-Footnote-11169407 -Node: Extension Other Design Decisions1169596 -Node: Extension Future Growth1171704 -Node: Old Extension Mechanism1172540 -Node: Notes summary1174302 -Node: Basic Concepts1175488 -Node: Basic High Level1176169 -Ref: figure-general-flow1176441 -Ref: figure-process-flow1177040 -Ref: Basic High Level-Footnote-11180269 -Node: Basic Data Typing1180454 -Node: Glossary1183782 -Node: Copying1208940 -Node: GNU Free Documentation License1246496 -Node: Index1271632 +Node: Foreword446600 +Node: Preface48131 +Ref: Preface-Footnote-151002 +Ref: Preface-Footnote-251109 +Ref: Preface-Footnote-351342 +Node: History51484 +Node: Names53835 +Ref: Names-Footnote-154928 +Node: This Manual55074 +Ref: This Manual-Footnote-161579 +Node: Conventions61679 +Node: Manual History64017 +Ref: Manual History-Footnote-166999 +Ref: Manual History-Footnote-267040 +Node: How To Contribute67114 +Node: Acknowledgments68243 +Node: Getting Started73048 +Node: Running gawk75481 +Node: One-shot76671 +Node: Read Terminal77919 +Node: Long79946 +Node: Executable Scripts81462 +Ref: Executable Scripts-Footnote-184251 +Node: Comments84354 +Node: Quoting86836 +Node: DOS Quoting92360 +Node: Sample Data Files93035 +Node: Very Simple95630 +Node: Two Rules100528 +Node: More Complex102414 +Node: Statements/Lines105276 +Ref: Statements/Lines-Footnote-1109731 +Node: Other Features109996 +Node: When110927 +Ref: When-Footnote-1112681 +Node: Intro Summary112746 +Node: Invoking Gawk113629 +Node: Command Line115143 +Node: Options115941 +Ref: Options-Footnote-1131874 +Ref: Options-Footnote-2132103 +Node: Other Arguments132128 +Node: Naming Standard Input135076 +Node: Environment Variables136169 +Node: AWKPATH Variable136727 +Ref: AWKPATH Variable-Footnote-1140030 +Ref: AWKPATH Variable-Footnote-2140075 +Node: AWKLIBPATH Variable140335 +Node: Other Environment Variables141478 +Node: Exit Status145206 +Node: Include Files145882 +Node: Loading Shared Libraries149479 +Node: Obsolete150906 +Node: Undocumented151603 +Node: Invoking Summary151870 +Node: Regexp153534 +Node: Regexp Usage154988 +Node: Escape Sequences157025 +Node: Regexp Operators163036 +Ref: Regexp Operators-Footnote-1170462 +Ref: Regexp Operators-Footnote-2170609 +Node: Bracket Expressions170707 +Ref: table-char-classes172722 +Node: Leftmost Longest175646 +Node: Computed Regexps176948 +Node: GNU Regexp Operators180345 +Node: Case-sensitivity184018 +Ref: Case-sensitivity-Footnote-1186903 +Ref: Case-sensitivity-Footnote-2187138 +Node: Regexp Summary187246 +Node: Reading Files188713 +Node: Records190807 +Node: awk split records191540 +Node: gawk split records196455 +Ref: gawk split records-Footnote-1200999 +Node: Fields201036 +Ref: Fields-Footnote-1203812 +Node: Nonconstant Fields203898 +Ref: Nonconstant Fields-Footnote-1206141 +Node: Changing Fields206345 +Node: Field Separators212274 +Node: Default Field Splitting214979 +Node: Regexp Field Splitting216096 +Node: Single Character Fields219446 +Node: Command Line Field Separator220505 +Node: Full Line Fields223717 +Ref: Full Line Fields-Footnote-1225234 +Ref: Full Line Fields-Footnote-2225280 +Node: Field Splitting Summary225381 +Node: Constant Size227455 +Node: Splitting By Content232044 +Ref: Splitting By Content-Footnote-1236038 +Node: Multiple Line236201 +Ref: Multiple Line-Footnote-1242087 +Node: Getline242266 +Node: Plain Getline244478 +Node: Getline/Variable247118 +Node: Getline/File248266 +Node: Getline/Variable/File249650 +Ref: Getline/Variable/File-Footnote-1251253 +Node: Getline/Pipe251340 +Node: Getline/Variable/Pipe254023 +Node: Getline/Coprocess255154 +Node: Getline/Variable/Coprocess256406 +Node: Getline Notes257145 +Node: Getline Summary259937 +Ref: table-getline-variants260349 +Node: Read Timeout261178 +Ref: Read Timeout-Footnote-1265003 +Node: Command-line directories265061 +Node: Input Summary265966 +Node: Input Exercises269267 +Node: Printing269995 +Node: Print271772 +Node: Print Examples273229 +Node: Output Separators276008 +Node: OFMT278026 +Node: Printf279380 +Node: Basic Printf280165 +Node: Control Letters281735 +Node: Format Modifiers285718 +Node: Printf Examples291727 +Node: Redirection294213 +Node: Special FD301054 +Ref: Special FD-Footnote-1304214 +Node: Special Files304288 +Node: Other Inherited Files304905 +Node: Special Network305905 +Node: Special Caveats306767 +Node: Close Files And Pipes307718 +Ref: Close Files And Pipes-Footnote-1314900 +Ref: Close Files And Pipes-Footnote-2315048 +Node: Output Summary315198 +Node: Output Exercises316196 +Node: Expressions316876 +Node: Values318061 +Node: Constants318739 +Node: Scalar Constants319430 +Ref: Scalar Constants-Footnote-1320289 +Node: Nondecimal-numbers320539 +Node: Regexp Constants323557 +Node: Using Constant Regexps324082 +Node: Variables327225 +Node: Using Variables327880 +Node: Assignment Options329791 +Node: Conversion331666 +Node: Strings And Numbers332190 +Ref: Strings And Numbers-Footnote-1335255 +Node: Locale influences conversions335364 +Ref: table-locale-affects338111 +Node: All Operators338699 +Node: Arithmetic Ops339329 +Node: Concatenation341834 +Ref: Concatenation-Footnote-1344653 +Node: Assignment Ops344759 +Ref: table-assign-ops349738 +Node: Increment Ops351010 +Node: Truth Values and Conditions354448 +Node: Truth Values355533 +Node: Typing and Comparison356582 +Node: Variable Typing357392 +Node: Comparison Operators361045 +Ref: table-relational-ops361455 +Node: POSIX String Comparison364950 +Ref: POSIX String Comparison-Footnote-1366022 +Node: Boolean Ops366160 +Ref: Boolean Ops-Footnote-1370639 +Node: Conditional Exp370730 +Node: Function Calls372457 +Node: Precedence376337 +Node: Locales379998 +Node: Expressions Summary381630 +Node: Patterns and Actions384190 +Node: Pattern Overview385310 +Node: Regexp Patterns386989 +Node: Expression Patterns387532 +Node: Ranges391242 +Node: BEGIN/END394348 +Node: Using BEGIN/END395109 +Ref: Using BEGIN/END-Footnote-1397843 +Node: I/O And BEGIN/END397949 +Node: BEGINFILE/ENDFILE400263 +Node: Empty403164 +Node: Using Shell Variables403481 +Node: Action Overview405754 +Node: Statements408080 +Node: If Statement409928 +Node: While Statement411423 +Node: Do Statement413452 +Node: For Statement414596 +Node: Switch Statement417753 +Node: Break Statement420135 +Node: Continue Statement422176 +Node: Next Statement424003 +Node: Nextfile Statement426384 +Node: Exit Statement429014 +Node: Built-in Variables431417 +Node: User-modified432550 +Ref: User-modified-Footnote-1440231 +Node: Auto-set440293 +Ref: Auto-set-Footnote-1453328 +Ref: Auto-set-Footnote-2453533 +Node: ARGC and ARGV453589 +Node: Pattern Action Summary457807 +Node: Arrays460234 +Node: Array Basics461563 +Node: Array Intro462407 +Ref: figure-array-elements464371 +Ref: Array Intro-Footnote-1466897 +Node: Reference to Elements467025 +Node: Assigning Elements469477 +Node: Array Example469968 +Node: Scanning an Array471726 +Node: Controlling Scanning474742 +Ref: Controlling Scanning-Footnote-1479938 +Node: Numeric Array Subscripts480254 +Node: Uninitialized Subscripts482439 +Node: Delete484056 +Ref: Delete-Footnote-1486799 +Node: Multidimensional486856 +Node: Multiscanning489953 +Node: Arrays of Arrays491542 +Node: Arrays Summary496301 +Node: Functions498393 +Node: Built-in499292 +Node: Calling Built-in500370 +Node: Numeric Functions502361 +Ref: Numeric Functions-Footnote-1506378 +Ref: Numeric Functions-Footnote-2506735 +Ref: Numeric Functions-Footnote-3506783 +Node: String Functions507055 +Ref: String Functions-Footnote-1530530 +Ref: String Functions-Footnote-2530659 +Ref: String Functions-Footnote-3530907 +Node: Gory Details530994 +Ref: table-sub-escapes532775 +Ref: table-sub-proposed534295 +Ref: table-posix-sub535659 +Ref: table-gensub-escapes537195 +Ref: Gory Details-Footnote-1538027 +Node: I/O Functions538178 +Ref: I/O Functions-Footnote-1545396 +Node: Time Functions545543 +Ref: Time Functions-Footnote-1556031 +Ref: Time Functions-Footnote-2556099 +Ref: Time Functions-Footnote-3556257 +Ref: Time Functions-Footnote-4556368 +Ref: Time Functions-Footnote-5556480 +Ref: Time Functions-Footnote-6556707 +Node: Bitwise Functions556973 +Ref: table-bitwise-ops557535 +Ref: Bitwise Functions-Footnote-1561844 +Node: Type Functions562013 +Node: I18N Functions563164 +Node: User-defined564809 +Node: Definition Syntax565614 +Ref: Definition Syntax-Footnote-1571021 +Node: Function Example571092 +Ref: Function Example-Footnote-1574011 +Node: Function Caveats574033 +Node: Calling A Function574551 +Node: Variable Scope575509 +Node: Pass By Value/Reference578497 +Node: Return Statement581992 +Node: Dynamic Typing584973 +Node: Indirect Calls585902 +Ref: Indirect Calls-Footnote-1597204 +Node: Functions Summary597332 +Node: Library Functions600034 +Ref: Library Functions-Footnote-1603643 +Ref: Library Functions-Footnote-2603786 +Node: Library Names603957 +Ref: Library Names-Footnote-1607411 +Ref: Library Names-Footnote-2607634 +Node: General Functions607720 +Node: Strtonum Function608823 +Node: Assert Function611845 +Node: Round Function615169 +Node: Cliff Random Function616710 +Node: Ordinal Functions617726 +Ref: Ordinal Functions-Footnote-1620789 +Ref: Ordinal Functions-Footnote-2621041 +Node: Join Function621252 +Ref: Join Function-Footnote-1623021 +Node: Getlocaltime Function623221 +Node: Readfile Function626965 +Node: Shell Quoting628935 +Node: Data File Management630336 +Node: Filetrans Function630968 +Node: Rewind Function635024 +Node: File Checking636411 +Ref: File Checking-Footnote-1637743 +Node: Empty Files637944 +Node: Ignoring Assigns639923 +Node: Getopt Function641474 +Ref: Getopt Function-Footnote-1652936 +Node: Passwd Functions653136 +Ref: Passwd Functions-Footnote-1661973 +Node: Group Functions662061 +Ref: Group Functions-Footnote-1669955 +Node: Walking Arrays670168 +Node: Library Functions Summary671771 +Node: Library Exercises673172 +Node: Sample Programs674452 +Node: Running Examples675222 +Node: Clones675950 +Node: Cut Program677174 +Node: Egrep Program686893 +Ref: Egrep Program-Footnote-1694391 +Node: Id Program694501 +Node: Split Program698146 +Ref: Split Program-Footnote-1701594 +Node: Tee Program701722 +Node: Uniq Program704511 +Node: Wc Program711930 +Ref: Wc Program-Footnote-1716180 +Node: Miscellaneous Programs716274 +Node: Dupword Program717487 +Node: Alarm Program719518 +Node: Translate Program724322 +Ref: Translate Program-Footnote-1728887 +Node: Labels Program729157 +Ref: Labels Program-Footnote-1732508 +Node: Word Sorting732592 +Node: History Sorting736663 +Node: Extract Program738499 +Node: Simple Sed746024 +Node: Igawk Program749092 +Ref: Igawk Program-Footnote-1763416 +Ref: Igawk Program-Footnote-2763617 +Ref: Igawk Program-Footnote-3763739 +Node: Anagram Program763854 +Node: Signature Program766911 +Node: Programs Summary768158 +Node: Programs Exercises769351 +Ref: Programs Exercises-Footnote-1773482 +Node: Advanced Features773573 +Node: Nondecimal Data775521 +Node: Array Sorting777111 +Node: Controlling Array Traversal777808 +Ref: Controlling Array Traversal-Footnote-1786141 +Node: Array Sorting Functions786259 +Ref: Array Sorting Functions-Footnote-1790148 +Node: Two-way I/O790344 +Ref: Two-way I/O-Footnote-1795289 +Ref: Two-way I/O-Footnote-2795475 +Node: TCP/IP Networking795557 +Node: Profiling798430 +Node: Advanced Features Summary805977 +Node: Internationalization807910 +Node: I18N and L10N809390 +Node: Explaining gettext810076 +Ref: Explaining gettext-Footnote-1815101 +Ref: Explaining gettext-Footnote-2815285 +Node: Programmer i18n815450 +Ref: Programmer i18n-Footnote-1820316 +Node: Translator i18n820365 +Node: String Extraction821159 +Ref: String Extraction-Footnote-1822290 +Node: Printf Ordering822376 +Ref: Printf Ordering-Footnote-1825162 +Node: I18N Portability825226 +Ref: I18N Portability-Footnote-1827681 +Node: I18N Example827744 +Ref: I18N Example-Footnote-1830547 +Node: Gawk I18N830619 +Node: I18N Summary831257 +Node: Debugger832596 +Node: Debugging833618 +Node: Debugging Concepts834059 +Node: Debugging Terms835912 +Node: Awk Debugging838484 +Node: Sample Debugging Session839378 +Node: Debugger Invocation839898 +Node: Finding The Bug841282 +Node: List of Debugger Commands847757 +Node: Breakpoint Control849090 +Node: Debugger Execution Control852786 +Node: Viewing And Changing Data856150 +Node: Execution Stack859528 +Node: Debugger Info861165 +Node: Miscellaneous Debugger Commands865182 +Node: Readline Support870211 +Node: Limitations871103 +Node: Debugging Summary873217 +Node: Arbitrary Precision Arithmetic874385 +Node: Computer Arithmetic875801 +Ref: table-numeric-ranges879399 +Ref: Computer Arithmetic-Footnote-1880258 +Node: Math Definitions880315 +Ref: table-ieee-formats883603 +Ref: Math Definitions-Footnote-1884207 +Node: MPFR features884312 +Node: FP Math Caution885983 +Ref: FP Math Caution-Footnote-1887033 +Node: Inexactness of computations887402 +Node: Inexact representation888361 +Node: Comparing FP Values889718 +Node: Errors accumulate890800 +Node: Getting Accuracy892233 +Node: Try To Round894895 +Node: Setting precision895794 +Ref: table-predefined-precision-strings896478 +Node: Setting the rounding mode898267 +Ref: table-gawk-rounding-modes898631 +Ref: Setting the rounding mode-Footnote-1902086 +Node: Arbitrary Precision Integers902265 +Ref: Arbitrary Precision Integers-Footnote-1905251 +Node: POSIX Floating Point Problems905400 +Ref: POSIX Floating Point Problems-Footnote-1909273 +Node: Floating point summary909311 +Node: Dynamic Extensions911505 +Node: Extension Intro913057 +Node: Plugin License914323 +Node: Extension Mechanism Outline915120 +Ref: figure-load-extension915548 +Ref: figure-register-new-function917028 +Ref: figure-call-new-function918032 +Node: Extension API Description920018 +Node: Extension API Functions Introduction921468 +Node: General Data Types926292 +Ref: General Data Types-Footnote-1932031 +Node: Memory Allocation Functions932330 +Ref: Memory Allocation Functions-Footnote-1935169 +Node: Constructor Functions935265 +Node: Registration Functions936999 +Node: Extension Functions937684 +Node: Exit Callback Functions939981 +Node: Extension Version String941229 +Node: Input Parsers941894 +Node: Output Wrappers951773 +Node: Two-way processors956288 +Node: Printing Messages958492 +Ref: Printing Messages-Footnote-1959568 +Node: Updating `ERRNO'959720 +Node: Requesting Values960460 +Ref: table-value-types-returned961188 +Node: Accessing Parameters962145 +Node: Symbol Table Access963376 +Node: Symbol table by name963890 +Node: Symbol table by cookie965871 +Ref: Symbol table by cookie-Footnote-1970015 +Node: Cached values970078 +Ref: Cached values-Footnote-1973577 +Node: Array Manipulation973668 +Ref: Array Manipulation-Footnote-1974766 +Node: Array Data Types974803 +Ref: Array Data Types-Footnote-1977458 +Node: Array Functions977550 +Node: Flattening Arrays981404 +Node: Creating Arrays988296 +Node: Extension API Variables993067 +Node: Extension Versioning993703 +Node: Extension API Informational Variables995604 +Node: Extension API Boilerplate996669 +Node: Finding Extensions1000478 +Node: Extension Example1001038 +Node: Internal File Description1001810 +Node: Internal File Ops1005877 +Ref: Internal File Ops-Footnote-11017547 +Node: Using Internal File Ops1017687 +Ref: Using Internal File Ops-Footnote-11020070 +Node: Extension Samples1020343 +Node: Extension Sample File Functions1021869 +Node: Extension Sample Fnmatch1029507 +Node: Extension Sample Fork1030998 +Node: Extension Sample Inplace1032213 +Node: Extension Sample Ord1033888 +Node: Extension Sample Readdir1034724 +Ref: table-readdir-file-types1035600 +Node: Extension Sample Revout1036411 +Node: Extension Sample Rev2way1037001 +Node: Extension Sample Read write array1037741 +Node: Extension Sample Readfile1039681 +Node: Extension Sample Time1040776 +Node: Extension Sample API Tests1042125 +Node: gawkextlib1042616 +Node: Extension summary1045274 +Node: Extension Exercises1048963 +Node: Language History1049685 +Node: V7/SVR3.11051341 +Node: SVR41053522 +Node: POSIX1054967 +Node: BTL1056356 +Node: POSIX/GNU1057090 +Node: Feature History1062654 +Node: Common Extensions1075752 +Node: Ranges and Locales1077076 +Ref: Ranges and Locales-Footnote-11081694 +Ref: Ranges and Locales-Footnote-21081721 +Ref: Ranges and Locales-Footnote-31081955 +Node: Contributors1082176 +Node: History summary1087717 +Node: Installation1089087 +Node: Gawk Distribution1090033 +Node: Getting1090517 +Node: Extracting1091340 +Node: Distribution contents1092975 +Node: Unix Installation1098692 +Node: Quick Installation1099309 +Node: Additional Configuration Options1101733 +Node: Configuration Philosophy1103471 +Node: Non-Unix Installation1105840 +Node: PC Installation1106298 +Node: PC Binary Installation1107617 +Node: PC Compiling1109465 +Ref: PC Compiling-Footnote-11112486 +Node: PC Testing1112595 +Node: PC Using1113771 +Node: Cygwin1117886 +Node: MSYS1118709 +Node: VMS Installation1119209 +Node: VMS Compilation1120001 +Ref: VMS Compilation-Footnote-11121223 +Node: VMS Dynamic Extensions1121281 +Node: VMS Installation Details1122965 +Node: VMS Running1125217 +Node: VMS GNV1128053 +Node: VMS Old Gawk1128787 +Node: Bugs1129257 +Node: Other Versions1133140 +Node: Installation summary1139568 +Node: Notes1140624 +Node: Compatibility Mode1141489 +Node: Additions1142271 +Node: Accessing The Source1143196 +Node: Adding Code1144632 +Node: New Ports1150797 +Node: Derived Files1155279 +Ref: Derived Files-Footnote-11160754 +Ref: Derived Files-Footnote-21160788 +Ref: Derived Files-Footnote-31161384 +Node: Future Extensions1161498 +Node: Implementation Limitations1162104 +Node: Extension Design1163352 +Node: Old Extension Problems1164506 +Ref: Old Extension Problems-Footnote-11166023 +Node: Extension New Mechanism Goals1166080 +Ref: Extension New Mechanism Goals-Footnote-11169440 +Node: Extension Other Design Decisions1169629 +Node: Extension Future Growth1171737 +Node: Old Extension Mechanism1172573 +Node: Notes summary1174335 +Node: Basic Concepts1175521 +Node: Basic High Level1176202 +Ref: figure-general-flow1176474 +Ref: figure-process-flow1177073 +Ref: Basic High Level-Footnote-11180302 +Node: Basic Data Typing1180487 +Node: Glossary1183815 +Node: Copying1208973 +Node: GNU Free Documentation License1246529 +Node: Index1271665  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 95844125..de2f6ace 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -207,7 +207,7 @@ @set FFN Filename @set DF datafile @set DDF Datafile -@set PVERSION Version +@set PVERSION version @end ifset @c For HTML, spell out email addresses, to avoid problems with @@ -304,7 +304,7 @@ All Rights Reserved. @end docbook @ifnotdocbook -Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2014 @* +Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2015 @* Free Software Foundation, Inc. @end ifnotdocbook @sp 2 @@ -1169,7 +1169,7 @@ interface to network protocols via special @file{/inet} files. The programs in this book make clear that an AWK program is typically much smaller and faster to develop than a counterpart written in C. -Consequently, there is often a payoff to prototype an +Consequently, there is often a payoff to prototyping an algorithm or design in AWK to get it running quickly and expose problems early. Often, the interpreted performance is adequate and the AWK prototype becomes the product. @@ -1246,15 +1246,15 @@ March 2001 Some things don't change. Thirteen years ago I wrote: ``If you use AWK or want to learn how, then read this book.'' -True then and still true today. +True then, and still true today. -Learning to use a programming language is more than mastering the +Learning to use a programming language is about more than mastering the syntax. One needs to acquire an understanding of how to use the features of the language to solve practical programming problems. A focus of this book is many examples that show how to use AWK. Some things do change. Our computers are much faster and have more memory. -Consequently, speed and storage inefficiencies of a high level language +Consequently, speed and storage inefficiencies of a high-level language matter less. Prototyping in AWK and then rewriting in C for performance reasons happens less, because more often the prototype is fast enough. @@ -1262,12 +1262,12 @@ Of course, there are computing operations that are best done in C or C++. With @command{gawk} 4.1 and later, you do not have to choose between writing your program in AWK or in C/C++. You can write most of your program in AWK and the aspects that require C/C++ capabilities can be written -in C/C++ and then the pieces glued together when the @command{gawk} module loads +in C/C++, and then the pieces glued together when the @command{gawk} module loads the C/C++ module as a dynamic plug-in. @c Chapter 16 @ref{Dynamic Extensions}, has all the -details, and as expected, many examples to help you learn the ins and outs. +details, and, as expected, many examples to help you learn the ins and outs. I enjoy programming in AWK and had fun (re)reading this book. I think you will too. @@ -1342,7 +1342,7 @@ Generate reports Validate data @item -Produce indexes and perform other document preparation tasks +Produce indexes and perform other document-preparation tasks @item Experiment with algorithms that you can adapt later to other computer @@ -1489,7 +1489,7 @@ help from me, thoroughly reworked @command{gawk} for compatibility with the newer @command{awk}. Circa 1994, I became the primary maintainer. Current development focuses on bug fixes, -performance improvements, standards compliance and, occasionally, new features. +performance improvements, standards compliance, and, occasionally, new features. In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding @@ -1502,10 +1502,10 @@ with @command{gawk} @value{PVERSION} 3.1. John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as -@command{gawk} @value{PVERSION} 4.0, in 2011. +@command{gawk} @value{PVERSION} 4.0 in 2011. @DBXREF{Contributors} -for a full list of those who made important contributions to @command{gawk}. +for a full list of those who have made important contributions to @command{gawk}. @node Names @unnumberedsec A Rose by Any Other Name @@ -1518,7 +1518,7 @@ is often referred to as ``new @command{awk}.'' By analogy, the original version of @command{awk} is referred to as ``old @command{awk}.'' -Today, on most systems, when you run the @command{awk} utility, +Today, on most systems, when you run the @command{awk} utility you get some version of new @command{awk}.@footnote{Only Solaris systems still use an old @command{awk} for the default @command{awk} utility. A more modern @command{awk} lives in @@ -1578,7 +1578,9 @@ the POSIX standard for @command{awk}. This @value{DOCUMENT} has the difficult task of being both a tutorial and a reference. If you are a novice, feel free to skip over details that seem too complex. You should also ignore the many cross-references; they are for the -expert user and for the online Info and HTML versions of the @value{DOCUMENT}. +expert user and for the Info and +@ulink{http://www.gnu.org/software/gawk/manual/, HTML} +versions of the @value{DOCUMENT}. @end ifnotinfo There are sidebars @@ -1611,7 +1613,7 @@ This @value{DOCUMENT} is split into several parts, as follows: @itemize @value{BULLET} @item -Part I describes the @command{awk} language and @command{gawk} program in detail. +Part I describes the @command{awk} language and the @command{gawk} program in detail. It starts with the basics, and continues through all of the features of @command{awk}. It contains the following chapters: @@ -1658,7 +1660,7 @@ doing something when a record is matched, and the predefined variables @item @ref{Arrays}, -covers @command{awk}'s one-and-only data structure: associative arrays. +covers @command{awk}'s one-and-only data structure: the associative array. Deleting array elements and whole arrays is also described, as well as sorting arrays in @command{gawk}. It also describes how @command{gawk} provides arrays of arrays. diff --git a/doc/gawkinet.info b/doc/gawkinet.info index 0a0d69d8..d726be0b 100644 --- a/doc/gawkinet.info +++ b/doc/gawkinet.info @@ -6,7 +6,7 @@ START-INFO-DIR-ENTRY * Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'. END-INFO-DIR-ENTRY - This is Edition 1.3 of `TCP/IP Internetworking With `gawk'', for the + This is Edition 1.3 of `TCP/IP Internetworking with `gawk'', for the 4.0.0 (or later) version of the GNU implementation of AWK. @@ -30,7 +30,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) This file documents the networking features in GNU `awk'. - This is Edition 1.3 of `TCP/IP Internetworking With `gawk'', for the + This is Edition 1.3 of `TCP/IP Internetworking with `gawk'', for the 4.0.0 (or later) version of the GNU implementation of AWK. @@ -61,7 +61,7 @@ General Introduction This file documents the networking features in GNU Awk (`gawk') version 4.0 and later. - This is Edition 1.3 of `TCP/IP Internetworking With `gawk'', for the + This is Edition 1.3 of `TCP/IP Internetworking with `gawk'', for the 4.0.0 (or later) version of the GNU implementation of AWK. diff --git a/doc/gawkinet.texi b/doc/gawkinet.texi index 40198e1d..10223239 100644 --- a/doc/gawkinet.texi +++ b/doc/gawkinet.texi @@ -60,7 +60,7 @@ @c fit into that chapter, thus this separate document. At over 50 @c pages, I think this is the right decision. ADR. -@set TITLE TCP/IP Internetworking With @command{gawk} +@set TITLE TCP/IP Internetworking with @command{gawk} @set EDITION 1.3 @set UPDATE-MONTH December, 2010 @c gawk versions: diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 8182790c..460fc7dd 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -202,7 +202,7 @@ @set FFN Filename @set DF datafile @set DDF Datafile -@set PVERSION Version +@set PVERSION version @end ifset @c For HTML, spell out email addresses, to avoid problems with @@ -299,7 +299,7 @@ All Rights Reserved. @end docbook @ifnotdocbook -Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2014 @* +Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2015 @* Free Software Foundation, Inc. @end ifnotdocbook @sp 2 @@ -1164,7 +1164,7 @@ interface to network protocols via special @file{/inet} files. The programs in this book make clear that an AWK program is typically much smaller and faster to develop than a counterpart written in C. -Consequently, there is often a payoff to prototype an +Consequently, there is often a payoff to prototyping an algorithm or design in AWK to get it running quickly and expose problems early. Often, the interpreted performance is adequate and the AWK prototype becomes the product. @@ -1241,15 +1241,15 @@ March 2001 Some things don't change. Thirteen years ago I wrote: ``If you use AWK or want to learn how, then read this book.'' -True then and still true today. +True then, and still true today. -Learning to use a programming language is more than mastering the +Learning to use a programming language is about more than mastering the syntax. One needs to acquire an understanding of how to use the features of the language to solve practical programming problems. A focus of this book is many examples that show how to use AWK. Some things do change. Our computers are much faster and have more memory. -Consequently, speed and storage inefficiencies of a high level language +Consequently, speed and storage inefficiencies of a high-level language matter less. Prototyping in AWK and then rewriting in C for performance reasons happens less, because more often the prototype is fast enough. @@ -1257,12 +1257,12 @@ Of course, there are computing operations that are best done in C or C++. With @command{gawk} 4.1 and later, you do not have to choose between writing your program in AWK or in C/C++. You can write most of your program in AWK and the aspects that require C/C++ capabilities can be written -in C/C++ and then the pieces glued together when the @command{gawk} module loads +in C/C++, and then the pieces glued together when the @command{gawk} module loads the C/C++ module as a dynamic plug-in. @c Chapter 16 @ref{Dynamic Extensions}, has all the -details, and as expected, many examples to help you learn the ins and outs. +details, and, as expected, many examples to help you learn the ins and outs. I enjoy programming in AWK and had fun (re)reading this book. I think you will too. @@ -1337,7 +1337,7 @@ Generate reports Validate data @item -Produce indexes and perform other document preparation tasks +Produce indexes and perform other document-preparation tasks @item Experiment with algorithms that you can adapt later to other computer @@ -1456,7 +1456,7 @@ help from me, thoroughly reworked @command{gawk} for compatibility with the newer @command{awk}. Circa 1994, I became the primary maintainer. Current development focuses on bug fixes, -performance improvements, standards compliance and, occasionally, new features. +performance improvements, standards compliance, and, occasionally, new features. In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding @@ -1469,10 +1469,10 @@ with @command{gawk} @value{PVERSION} 3.1. John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as -@command{gawk} @value{PVERSION} 4.0, in 2011. +@command{gawk} @value{PVERSION} 4.0 in 2011. @DBXREF{Contributors} -for a full list of those who made important contributions to @command{gawk}. +for a full list of those who have made important contributions to @command{gawk}. @node Names @unnumberedsec A Rose by Any Other Name @@ -1485,7 +1485,7 @@ is often referred to as ``new @command{awk}.'' By analogy, the original version of @command{awk} is referred to as ``old @command{awk}.'' -Today, on most systems, when you run the @command{awk} utility, +Today, on most systems, when you run the @command{awk} utility you get some version of new @command{awk}.@footnote{Only Solaris systems still use an old @command{awk} for the default @command{awk} utility. A more modern @command{awk} lives in @@ -1545,7 +1545,9 @@ the POSIX standard for @command{awk}. This @value{DOCUMENT} has the difficult task of being both a tutorial and a reference. If you are a novice, feel free to skip over details that seem too complex. You should also ignore the many cross-references; they are for the -expert user and for the online Info and HTML versions of the @value{DOCUMENT}. +expert user and for the Info and +@ulink{http://www.gnu.org/software/gawk/manual/, HTML} +versions of the @value{DOCUMENT}. @end ifnotinfo There are sidebars @@ -1578,7 +1580,7 @@ This @value{DOCUMENT} is split into several parts, as follows: @itemize @value{BULLET} @item -Part I describes the @command{awk} language and @command{gawk} program in detail. +Part I describes the @command{awk} language and the @command{gawk} program in detail. It starts with the basics, and continues through all of the features of @command{awk}. It contains the following chapters: @@ -1625,7 +1627,7 @@ doing something when a record is matched, and the predefined variables @item @ref{Arrays}, -covers @command{awk}'s one-and-only data structure: associative arrays. +covers @command{awk}'s one-and-only data structure: the associative array. Deleting array elements and whole arrays is also described, as well as sorting arrays in @command{gawk}. It also describes how @command{gawk} provides arrays of arrays. -- cgit v1.2.3 From 2d3f4ffebcb451da84ceb8a4be58bbb23946ee6e Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 19 Jan 2015 13:56:58 -0500 Subject: Revert "When an extension calls sym_lookup on a deferred variable, it should always succeed." This reverts commit f8fecb69346cbcd774a73a49322aeb8ddea73e44. --- ChangeLog | 9 --------- awk.h | 1 - awkgram.c | 9 --------- awkgram.y | 9 --------- extension/ChangeLog | 6 ------ extension/testext.c | 18 ++++++++++-------- gawkapi.c | 14 ++------------ test/ChangeLog | 4 ---- test/testext.ok | 2 +- 9 files changed, 13 insertions(+), 59 deletions(-) diff --git a/ChangeLog b/ChangeLog index 931972d3..0498088d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,3 @@ -2015-01-08 Andrew J. Schorr - - * awk.h (deferred_create): Declare new function. - * awkgram.y (deferred_create): New function. - * gawkapi.c (lookup_deferred): New helper function to call lookup and - then deferred_create if lookup fails. - (api_sym_lookup, api_sym_update): Call lookup_deferred instead of - lookup. - 2015-01-08 Andrew J. Schorr Revert changes to API deferred variable creation -- these variables diff --git a/awk.h b/awk.h index eddcb18f..bb63f65a 100644 --- a/awk.h +++ b/awk.h @@ -1318,7 +1318,6 @@ extern NODE *do_asorti(int nargs); extern unsigned long (*hash)(const char *s, size_t len, unsigned long hsize, size_t *code); extern void init_env_array(NODE *env_node); /* awkgram.c */ -extern NODE *deferred_create(const char *name); extern NODE *variable(int location, char *name, NODETYPE type); extern int parse_program(INSTRUCTION **pcode); extern void track_ext_func(const char *name); diff --git a/awkgram.c b/awkgram.c index bc79df58..adb31d9c 100644 --- a/awkgram.c +++ b/awkgram.c @@ -7052,15 +7052,6 @@ is_deferred_variable(const char *name) return false; } -NODE * -deferred_create(const char *name) -{ - struct deferred_variable *dv; - for (dv = deferred_variables; dv != NULL; dv = dv->next) - if (strcmp(name, dv->name) == 0) - return (*dv->load_func)(); - return NULL; -} /* variable --- make sure NAME is in the symbol table */ diff --git a/awkgram.y b/awkgram.y index 1399262d..52284af4 100644 --- a/awkgram.y +++ b/awkgram.y @@ -4714,15 +4714,6 @@ is_deferred_variable(const char *name) return false; } -NODE * -deferred_create(const char *name) -{ - struct deferred_variable *dv; - for (dv = deferred_variables; dv != NULL; dv = dv->next) - if (strcmp(name, dv->name) == 0) - return (*dv->load_func)(); - return NULL; -} /* variable --- make sure NAME is in the symbol table */ diff --git a/extension/ChangeLog b/extension/ChangeLog index 15153213..c8f77042 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,9 +1,3 @@ -2015-01-08 Andrew J. Schorr - - * testext.c (var_test): Lookup of PROCINFO should always succeed. - (test_deferred): PROCINFO should always be present, so call lookup - to grab it. - 2015-01-06 Andrew J. Schorr * testext.c (test_deferred): New function to help with testing diff --git a/extension/testext.c b/extension/testext.c index 42ec0915..7c61bb0d 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -303,11 +303,11 @@ var_test(int nargs, awk_value_t *result) goto out; } - /* look up PROCINFO - should succeed */ + /* look up PROCINFO - should fail */ if (sym_lookup("PROCINFO", AWK_ARRAY, & value)) - printf("var_test: sym_lookup of PROCINFO passed - got a value!\n"); + printf("var_test: sym_lookup of PROCINFO failed - got a value!\n"); else - printf("var_test: sym_lookup of PROCINFO failed - did not get a value\n"); + printf("var_test: sym_lookup of PROCINFO passed - did not get a value\n"); /* look up a reserved variable - should pass */ if (sym_lookup("ARGC", AWK_NUMBER, & value)) @@ -399,11 +399,8 @@ test_deferred(int nargs, awk_value_t *result) printf("test_deferred: nargs not right (%d should be 0)\n", nargs); goto out; } - - if (! sym_lookup("PROCINFO", AWK_ARRAY, & arr)) { - printf("test_deferred: %d: sym_lookup failed\n", __LINE__); - goto out; - } + arr.val_type = AWK_ARRAY; + arr.array_cookie = create_array(); for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { make_const_string(seed[i].name, strlen(seed[i].name), & index); @@ -414,6 +411,11 @@ test_deferred(int nargs, awk_value_t *result) } } + if (! sym_update("PROCINFO", & arr)) { + printf("test_deferred: %d: sym_update failed\n", __LINE__); + goto out; + } + /* test that it still contains the values we loaded */ for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { make_const_string(seed[i].name, strlen(seed[i].name), & index); diff --git a/gawkapi.c b/gawkapi.c index 0213936a..f8d04986 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -486,16 +486,6 @@ node_to_awk_value(NODE *node, awk_value_t *val, awk_valtype_t wanted) return ret; } -static NODE * -lookup_deferred(const char *name) -{ - NODE *node; - - if ((node = lookup(name)) != NULL) - return node; - return deferred_create(name); -} - /* * Symbol table access: * - No access to special variables (NF, etc.) @@ -526,7 +516,7 @@ api_sym_lookup(awk_ext_id_t id, if ( name == NULL || *name == '\0' || result == NULL - || (node = lookup_deferred(name)) == NULL) + || (node = lookup(name)) == NULL) return awk_false; if (is_off_limits_var(name)) /* a built-in variable */ @@ -584,7 +574,7 @@ api_sym_update(awk_ext_id_t id, return awk_false; } - node = lookup_deferred(name); + node = lookup(name); if (node == NULL) { /* new value to be installed */ diff --git a/test/ChangeLog b/test/ChangeLog index 06b4c8bc..7522f7aa 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,7 +1,3 @@ -2015-01-08 Andrew J. Schorr - - * testext.ok: PROCINFO lookup should succeed. - 2015-01-06 Andrew J. Schorr * Makefile.am (EXTRA_DIST): Add defvar.awk and defvar.ok. diff --git a/test/testext.ok b/test/testext.ok index 9dae010f..5a78c159 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -15,7 +15,7 @@ try_modify_environ: set_array_element of ENVIRON failed try_modify_environ: marking element "testext" for deletion try_del_environ() could not delete element - pass try_del_environ() could not add an element - pass -var_test: sym_lookup of PROCINFO passed - got a value! +var_test: sym_lookup of PROCINFO passed - did not get a value var_test: sym_lookup of ARGC passed - got a value! var_test: sym_update of ARGC failed - correctly var_test: sym_update("testvar") succeeded -- cgit v1.2.3 From 611ebfe5c55849245d47b4c5878eb85b27861f12 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 20 Jan 2015 21:55:01 +0200 Subject: O'Reilly fixes. --- doc/ChangeLog | 4 + doc/gawk.info | 1216 +++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 104 ++--- doc/gawktexi.in | 104 ++--- 4 files changed, 721 insertions(+), 707 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7f2341b5..f6c1eaf0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-01-20 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-01-19 Arnold D. Robbins * gawkinet.texi: Fix capitalization in document title. diff --git a/doc/gawk.info b/doc/gawk.info index 47f21442..3f32c445 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -1047,8 +1047,8 @@ in *note Sample Programs::, should be of interest. - *note Arrays::, covers `awk''s one-and-only data structure: the associative array. Deleting array elements and whole - arrays is also described, as well as sorting arrays in - `gawk'. It also describes how `gawk' provides arrays of + arrays is described, as well as sorting arrays in `gawk'. + The major node also describes how `gawk' provides arrays of arrays. - *note Functions::, describes the built-in functions `awk' and @@ -1057,14 +1057,13 @@ in *note Sample Programs::, should be of interest. indirectly. * Part II shows how to use `awk' and `gawk' for problem solving. - There is lots of code here for you to read and learn from. It - contains the following chapters: + There is lots of code here for you to read and learn from. This + part contains the following chapters: - - *note Library Functions::, which provides a number of - functions meant to be used from main `awk' programs. + - *note Library Functions::, provides a number of functions + meant to be used from main `awk' programs. - - *note Sample Programs::, which provides many sample `awk' - programs. + - *note Sample Programs::, provides many sample `awk' programs. Reading these two chapters allows you to see `awk' solving real problems. @@ -1096,7 +1095,7 @@ in *note Sample Programs::, should be of interest. It contains the following appendices: - *note Language History::, describes how the `awk' language - has evolved since its first release to present. It also + has evolved since its first release to the present. It also describes how `gawk' has acquired features over time. - *note Installation::, describes how to get `gawk', how to @@ -1113,7 +1112,7 @@ in *note Sample Programs::, should be of interest. material for those who are completely unfamiliar with computer programming. - The *note Glossary::, defines most, if not all of, the + The *note Glossary::, defines most, if not all, of the significant terms used throughout the Info file. If you find terms that you aren't familiar with, try looking them up here. @@ -1142,8 +1141,8 @@ node briefly documents the typographical conventions used in Texinfo. common shell primary and secondary prompts, `$' and `>'. Input that you type is shown `like this'. Output from the command is preceded by the glyph "-|". This typically represents the command's standard -output. Error messages, and other output on the command's standard -error, are preceded by the glyph "error-->". For example: +output. Error messages and other output on the command's standard +error are preceded by the glyph "error-->". For example: $ echo hi on stdout -| hi on stdout @@ -1155,7 +1154,7 @@ particular, there are special characters called "control characters." These are characters that you type by holding down both the `CONTROL' key and another key, at the same time. For example, a `Ctrl-d' is typed by first pressing and holding the `CONTROL' key, next pressing the `d' -key and finally releasing both keys. +key, and finally releasing both keys. For the sake of brevity, throughout this Info file, we refer to Brian Kernighan's version of `awk' as "BWK `awk'." (*Note Other @@ -1171,7 +1170,7 @@ Dark Corners Until the POSIX standard (and `GAWK: Effective AWK Programming'), many features of `awk' were either poorly documented or not documented at all. Descriptions of such features (often called "dark corners") -are noted in this Info file with "(d.c.)". They also appear in the +are noted in this Info file with "(d.c.)." They also appear in the index under the heading "dark corner." But, as noted by the opening quote, any coverage of dark corners is @@ -1194,8 +1193,8 @@ editor. GNU Emacs is the most widely used version of Emacs today. The GNU(1) Project is an ongoing effort on the part of the Free Software Foundation to create a complete, freely distributable, -POSIX-compliant computing environment. The FSF uses the "GNU General -Public License" (GPL) to ensure that their software's source code is +POSIX-compliant computing environment. The FSF uses the GNU General +Public License (GPL) to ensure that its software's source code is always available to the end user. A copy of the GPL is included for your reference (*note Copying::). The GPL applies to the C language source code for `gawk'. To find out more about the FSF and the GNU @@ -1223,26 +1222,26 @@ original, "old" version of `awk'. I started working with that version in the fall of 1988. As work on it progressed, the FSF published several preliminary versions (numbered -0.X). In 1996, Edition 1.0 was released with `gawk' 3.0.0. The FSF +0.X). In 1996, edition 1.0 was released with `gawk' 3.0.0. The FSF published the first two editions under the title `The GNU Awk User's Guide'. This edition maintains the basic structure of the previous editions. For FSF edition 4.0, the content was thoroughly reviewed and updated. All references to `gawk' versions prior to 4.0 were removed. Of -significant note for that edition was *note Debugger::. +significant note for that edition was the addition of *note Debugger::. For FSF edition 4.1, the content has been reorganized into parts, and the major new additions are *note Arbitrary Precision Arithmetic::, and *note Dynamic Extensions::. This Info file will undoubtedly continue to evolve. If you find an -error in this Info file, please report it! *Note Bugs::, for +error in the Info file, please report it! *Note Bugs::, for information on submitting problem reports electronically. ---------- Footnotes ---------- - (1) GNU stands for "GNU's not Unix." + (1) GNU stands for "GNU's Not Unix." (2) The terminology "GNU/Linux" is explained in the *note Glossary::. @@ -1286,7 +1285,7 @@ acknowledgments: this manual. Jay Fenlason contributed many ideas and sample programs. Richard Mlynarik and Robert Chassell gave helpful comments on drafts of this manual. The paper `A Supplemental - Document for `awk'' by John W. Pierce of the Chemistry Department + Document for AWK' by John W. Pierce of the Chemistry Department at UC San Diego, pinpointed several issues relevant both to `awk' implementation and to this manual, that would otherwise have escaped us. @@ -1299,7 +1298,7 @@ GNU Project. acknowledgements: The following people (in alphabetical order) provided helpful - comments on various versions of this book, Rick Adams, Dr. Nelson + comments on various versions of this book: Rick Adams, Dr. Nelson H.F. Beebe, Karl Berry, Dr. Michael Brennan, Rich Burridge, Claire Cloutier, Diane Close, Scott Deifik, Christopher ("Topher") Eliot, Jeffrey Friedl, Dr. Darrel Hankerson, Michal Jaegermann, Dr. @@ -1308,7 +1307,7 @@ acknowledgements: Robert J. Chassell provided much valuable advice on the use of Texinfo. He also deserves special thanks for convincing me _not_ - to title this Info file `How To Gawk Politely'. Karl Berry helped + to title this Info file `How to Gawk Politely'. Karl Berry helped significantly with the TeX part of Texinfo. I would like to thank Marshall and Elaine Hartholz of Seattle and @@ -1348,18 +1347,18 @@ of people. *Note Contributors::, for the full list. Thanks to Michael Brennan for the Forewords. Thanks to Patrice Dumas for the new `makeinfo' program. Thanks to -Karl Berry who continues to work to keep the Texinfo markup language +Karl Berry, who continues to work to keep the Texinfo markup language sane. Robert P.J. Day, Michael Brennan, and Brian Kernighan kindly acted as reviewers for the 2015 edition of this Info file. Their feedback helped improve the final work. - I would like to thank Brian Kernighan for invaluable assistance -during the testing and debugging of `gawk', and for ongoing help and -advice in clarifying numerous points about the language. We could not -have done nearly as good a job on either `gawk' or its documentation -without his help. + I would also like to thank Brian Kernighan for his invaluable +assistance during the testing and debugging of `gawk', and for his +ongoing help and advice in clarifying numerous points about the +language. We could not have done nearly as good a job on either `gawk' +or its documentation without his help. Brian is in a class by himself as a programmer and technical author. I have to thank him (yet again) for his ongoing friendship and for @@ -1402,10 +1401,10 @@ contain "function definitions", an advanced feature that we will ignore for now; *note User-defined::). Each rule specifies one pattern to search for and one action to perform upon finding the pattern. - Syntactically, a rule consists of a pattern followed by an action. -The action is enclosed in braces to separate it from the pattern. -Newlines usually separate rules. Therefore, an `awk' program looks -like this: + Syntactically, a rule consists of a "pattern" followed by an +"action". The action is enclosed in braces to separate it from the +pattern. Newlines usually separate rules. Therefore, an `awk' program +looks like this: PATTERN { ACTION } PATTERN { ACTION } @@ -1473,7 +1472,7 @@ program as the first argument of the `awk' command, like this: awk 'PROGRAM' INPUT-FILE1 INPUT-FILE2 ... -where PROGRAM consists of a series of PATTERNS and ACTIONS, as +where PROGRAM consists of a series of patterns and actions, as described earlier. This command format instructs the "shell", or command interpreter, @@ -1488,8 +1487,8 @@ programs from shell scripts, because it avoids the need for a separate file for the `awk' program. A self-contained shell script is more reliable because there are no other files to misplace. - Later in this chapter, *note Very Simple::, presents several short, -self-contained programs. + Later in this chapter, in *note Very Simple::, we'll see examples of +several short, self-contained programs.  File: gawk.info, Node: Read Terminal, Next: Long, Prev: One-shot, Up: Running gawk @@ -1504,7 +1503,7 @@ following command line: `awk' applies the PROGRAM to the "standard input", which usually means whatever you type on the keyboard. This continues until you indicate -end-of-file by typing `Ctrl-d'. (On other operating systems, the +end-of-file by typing `Ctrl-d'. (On non-POSIX operating systems, the end-of-file character may be different. For example, on OS/2, it is `Ctrl-z'.) @@ -1579,10 +1578,9 @@ that are provided on the `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 `\47'.) - If you want to clearly identify your `awk' program files as such, -you can add the extension `.awk' to the file name. This doesn't affect -the execution of the `awk' program but it does make "housekeeping" -easier. + If you want to clearly identify an `awk' program file as such, you +can add the extension `.awk' to the file name. This doesn't affect the +execution of the `awk' program but it does make "housekeeping" easier.  File: gawk.info, Node: Executable Scripts, Next: Comments, Prev: Long, Up: Running gawk @@ -1711,7 +1709,7 @@ at a later time.  File: gawk.info, Node: Quoting, Prev: Comments, Up: Running gawk -1.1.6 Shell-Quoting Issues +1.1.6 Shell Quoting Issues -------------------------- * Menu: @@ -1806,7 +1804,7 @@ shell quoting tricks, like this: -| Here is a single quote <'> This program consists of three concatenated quoted strings. The first -and the third are single quoted, the second is double quoted. +and the third are single-quoted, and the second is double-quoted. This can be "simplified" to: @@ -1833,8 +1831,7 @@ like so: $ awk 'BEGIN { print "Here is a double quote <\42>" }' -| Here is a double quote <"> -This works nicely, except that you should comment clearly what the -escapes mean. +This works nicely, but you should comment clearly what the escapes mean. A fourth option is to use command-line variable assignment, like this: @@ -1843,11 +1840,11 @@ this: -| Here is a single quote <'> (Here, the two string constants and the value of `sq' are -concatenated into a single string which is printed by `print'.) +concatenated into a single string that is printed by `print'.) If you really need both single and double quotes in your `awk' program, it is probably best to move it into a separate file, where the -shell won't be part of the picture, and you can say what you mean. +shell won't be part of the picture and you can say what you mean.  File: gawk.info, Node: DOS Quoting, Up: Quoting @@ -1905,7 +1902,7 @@ of green crates shipped, the number of red boxes shipped, the number of orange bags shipped, and the number of blue packages shipped, respectively. There are 16 entries, covering the 12 months of last year and the first four months of the current year. An empty line separates -the data for the two years. +the data for the two years: Jan 13 25 15 115 Feb 15 32 24 226 @@ -1937,7 +1934,7 @@ File: gawk.info, Node: Very Simple, Next: Two Rules, Prev: Sample Data Files, The following command runs a simple `awk' program that searches the input file `mail-list' for the character string `li' (a grouping of characters is usually called a "string"; the term "string" is based on -similar usage in English, such as "a string of pearls," or "a string of +similar usage in English, such as "a string of pearls" or "a string of cars in a train"): awk '/li/ { print $0 }' mail-list @@ -1973,24 +1970,25 @@ prints all lines matching the pattern `li'. By comparison, omitting the `print' statement but retaining the braces makes an empty action that does nothing (i.e., no lines are printed). - Many practical `awk' programs are just a line or two. Following is a -collection of useful, short programs to get you started. Some of these -programs contain constructs that haven't been covered yet. (The -description of the program will give you a good idea of what is going -on, but you'll need to read the rest of the Info file to become an -`awk' expert!) Most of the examples use a data file named `data'. -This is just a placeholder; if you use these programs yourself, -substitute your own file names for `data'. For future reference, note -that there is often more than one way to do things in `awk'. At some -point, you may want to look back at these examples and see if you can -come up with different ways to do the same things shown here: + Many practical `awk' programs are just a line or two long. +Following is a collection of useful, short programs to get you started. +Some of these programs contain constructs that haven't been covered +yet. (The description of the program will give you a good idea of what +is going on, but you'll need to read the rest of the Info file to +become an `awk' expert!) Most of the examples use a data file named +`data'. This is just a placeholder; if you use these programs +yourself, substitute your own file names for `data'. For future +reference, note that there is often more than one way to do things in +`awk'. At some point, you may want to look back at these examples and +see if you can come up with different ways to do the same things shown +here: * Print every line that is longer than 80 characters: awk 'length($0) > 80' data - The sole rule has a relational expression as its pattern and it - has no action--so it uses the default action, printing the record. + The sole rule has a relational expression as its pattern and has no + action--so it uses the default action, printing the record. * Print the length of the longest input line: @@ -2045,8 +2043,8 @@ come up with different ways to do the same things shown here: awk 'NR % 2 == 0' data - If you use the expression `NR % 2 == 1' instead, the program would - print the odd-numbered lines. + If you used the expression `NR % 2 == 1' instead, the program + would print the odd-numbered lines.  File: gawk.info, Node: Two Rules, Next: More Complex, Prev: Very Simple, Up: Getting Started @@ -32474,7 +32472,7 @@ Index * exit the debugger: Miscellaneous Debugger Commands. (line 99) * exp: Numeric Functions. (line 18) -* expand utility: Very Simple. (line 72) +* expand utility: Very Simple. (line 73) * Expat XML parser library: gawkextlib. (line 33) * exponent: Numeric Functions. (line 18) * expressions: Expressions. (line 6) @@ -34311,549 +34309,549 @@ Node: History51484 Node: Names53835 Ref: Names-Footnote-154928 Node: This Manual55074 -Ref: This Manual-Footnote-161579 -Node: Conventions61679 -Node: Manual History64017 -Ref: Manual History-Footnote-166999 -Ref: Manual History-Footnote-267040 -Node: How To Contribute67114 -Node: Acknowledgments68243 -Node: Getting Started73048 -Node: Running gawk75481 -Node: One-shot76671 -Node: Read Terminal77919 -Node: Long79946 -Node: Executable Scripts81462 -Ref: Executable Scripts-Footnote-184251 -Node: Comments84354 -Node: Quoting86836 -Node: DOS Quoting92360 -Node: Sample Data Files93035 -Node: Very Simple95630 -Node: Two Rules100528 -Node: More Complex102414 -Node: Statements/Lines105276 -Ref: Statements/Lines-Footnote-1109731 -Node: Other Features109996 -Node: When110927 -Ref: When-Footnote-1112681 -Node: Intro Summary112746 -Node: Invoking Gawk113629 -Node: Command Line115143 -Node: Options115941 -Ref: Options-Footnote-1131874 -Ref: Options-Footnote-2132103 -Node: Other Arguments132128 -Node: Naming Standard Input135076 -Node: Environment Variables136169 -Node: AWKPATH Variable136727 -Ref: AWKPATH Variable-Footnote-1140030 -Ref: AWKPATH Variable-Footnote-2140075 -Node: AWKLIBPATH Variable140335 -Node: Other Environment Variables141478 -Node: Exit Status145206 -Node: Include Files145882 -Node: Loading Shared Libraries149479 -Node: Obsolete150906 -Node: Undocumented151603 -Node: Invoking Summary151870 -Node: Regexp153534 -Node: Regexp Usage154988 -Node: Escape Sequences157025 -Node: Regexp Operators163036 -Ref: Regexp Operators-Footnote-1170462 -Ref: Regexp Operators-Footnote-2170609 -Node: Bracket Expressions170707 -Ref: table-char-classes172722 -Node: Leftmost Longest175646 -Node: Computed Regexps176948 -Node: GNU Regexp Operators180345 -Node: Case-sensitivity184018 -Ref: Case-sensitivity-Footnote-1186903 -Ref: Case-sensitivity-Footnote-2187138 -Node: Regexp Summary187246 -Node: Reading Files188713 -Node: Records190807 -Node: awk split records191540 -Node: gawk split records196455 -Ref: gawk split records-Footnote-1200999 -Node: Fields201036 -Ref: Fields-Footnote-1203812 -Node: Nonconstant Fields203898 -Ref: Nonconstant Fields-Footnote-1206141 -Node: Changing Fields206345 -Node: Field Separators212274 -Node: Default Field Splitting214979 -Node: Regexp Field Splitting216096 -Node: Single Character Fields219446 -Node: Command Line Field Separator220505 -Node: Full Line Fields223717 -Ref: Full Line Fields-Footnote-1225234 -Ref: Full Line Fields-Footnote-2225280 -Node: Field Splitting Summary225381 -Node: Constant Size227455 -Node: Splitting By Content232044 -Ref: Splitting By Content-Footnote-1236038 -Node: Multiple Line236201 -Ref: Multiple Line-Footnote-1242087 -Node: Getline242266 -Node: Plain Getline244478 -Node: Getline/Variable247118 -Node: Getline/File248266 -Node: Getline/Variable/File249650 -Ref: Getline/Variable/File-Footnote-1251253 -Node: Getline/Pipe251340 -Node: Getline/Variable/Pipe254023 -Node: Getline/Coprocess255154 -Node: Getline/Variable/Coprocess256406 -Node: Getline Notes257145 -Node: Getline Summary259937 -Ref: table-getline-variants260349 -Node: Read Timeout261178 -Ref: Read Timeout-Footnote-1265003 -Node: Command-line directories265061 -Node: Input Summary265966 -Node: Input Exercises269267 -Node: Printing269995 -Node: Print271772 -Node: Print Examples273229 -Node: Output Separators276008 -Node: OFMT278026 -Node: Printf279380 -Node: Basic Printf280165 -Node: Control Letters281735 -Node: Format Modifiers285718 -Node: Printf Examples291727 -Node: Redirection294213 -Node: Special FD301054 -Ref: Special FD-Footnote-1304214 -Node: Special Files304288 -Node: Other Inherited Files304905 -Node: Special Network305905 -Node: Special Caveats306767 -Node: Close Files And Pipes307718 -Ref: Close Files And Pipes-Footnote-1314900 -Ref: Close Files And Pipes-Footnote-2315048 -Node: Output Summary315198 -Node: Output Exercises316196 -Node: Expressions316876 -Node: Values318061 -Node: Constants318739 -Node: Scalar Constants319430 -Ref: Scalar Constants-Footnote-1320289 -Node: Nondecimal-numbers320539 -Node: Regexp Constants323557 -Node: Using Constant Regexps324082 -Node: Variables327225 -Node: Using Variables327880 -Node: Assignment Options329791 -Node: Conversion331666 -Node: Strings And Numbers332190 -Ref: Strings And Numbers-Footnote-1335255 -Node: Locale influences conversions335364 -Ref: table-locale-affects338111 -Node: All Operators338699 -Node: Arithmetic Ops339329 -Node: Concatenation341834 -Ref: Concatenation-Footnote-1344653 -Node: Assignment Ops344759 -Ref: table-assign-ops349738 -Node: Increment Ops351010 -Node: Truth Values and Conditions354448 -Node: Truth Values355533 -Node: Typing and Comparison356582 -Node: Variable Typing357392 -Node: Comparison Operators361045 -Ref: table-relational-ops361455 -Node: POSIX String Comparison364950 -Ref: POSIX String Comparison-Footnote-1366022 -Node: Boolean Ops366160 -Ref: Boolean Ops-Footnote-1370639 -Node: Conditional Exp370730 -Node: Function Calls372457 -Node: Precedence376337 -Node: Locales379998 -Node: Expressions Summary381630 -Node: Patterns and Actions384190 -Node: Pattern Overview385310 -Node: Regexp Patterns386989 -Node: Expression Patterns387532 -Node: Ranges391242 -Node: BEGIN/END394348 -Node: Using BEGIN/END395109 -Ref: Using BEGIN/END-Footnote-1397843 -Node: I/O And BEGIN/END397949 -Node: BEGINFILE/ENDFILE400263 -Node: Empty403164 -Node: Using Shell Variables403481 -Node: Action Overview405754 -Node: Statements408080 -Node: If Statement409928 -Node: While Statement411423 -Node: Do Statement413452 -Node: For Statement414596 -Node: Switch Statement417753 -Node: Break Statement420135 -Node: Continue Statement422176 -Node: Next Statement424003 -Node: Nextfile Statement426384 -Node: Exit Statement429014 -Node: Built-in Variables431417 -Node: User-modified432550 -Ref: User-modified-Footnote-1440231 -Node: Auto-set440293 -Ref: Auto-set-Footnote-1453328 -Ref: Auto-set-Footnote-2453533 -Node: ARGC and ARGV453589 -Node: Pattern Action Summary457807 -Node: Arrays460234 -Node: Array Basics461563 -Node: Array Intro462407 -Ref: figure-array-elements464371 -Ref: Array Intro-Footnote-1466897 -Node: Reference to Elements467025 -Node: Assigning Elements469477 -Node: Array Example469968 -Node: Scanning an Array471726 -Node: Controlling Scanning474742 -Ref: Controlling Scanning-Footnote-1479938 -Node: Numeric Array Subscripts480254 -Node: Uninitialized Subscripts482439 -Node: Delete484056 -Ref: Delete-Footnote-1486799 -Node: Multidimensional486856 -Node: Multiscanning489953 -Node: Arrays of Arrays491542 -Node: Arrays Summary496301 -Node: Functions498393 -Node: Built-in499292 -Node: Calling Built-in500370 -Node: Numeric Functions502361 -Ref: Numeric Functions-Footnote-1506378 -Ref: Numeric Functions-Footnote-2506735 -Ref: Numeric Functions-Footnote-3506783 -Node: String Functions507055 -Ref: String Functions-Footnote-1530530 -Ref: String Functions-Footnote-2530659 -Ref: String Functions-Footnote-3530907 -Node: Gory Details530994 -Ref: table-sub-escapes532775 -Ref: table-sub-proposed534295 -Ref: table-posix-sub535659 -Ref: table-gensub-escapes537195 -Ref: Gory Details-Footnote-1538027 -Node: I/O Functions538178 -Ref: I/O Functions-Footnote-1545396 -Node: Time Functions545543 -Ref: Time Functions-Footnote-1556031 -Ref: Time Functions-Footnote-2556099 -Ref: Time Functions-Footnote-3556257 -Ref: Time Functions-Footnote-4556368 -Ref: Time Functions-Footnote-5556480 -Ref: Time Functions-Footnote-6556707 -Node: Bitwise Functions556973 -Ref: table-bitwise-ops557535 -Ref: Bitwise Functions-Footnote-1561844 -Node: Type Functions562013 -Node: I18N Functions563164 -Node: User-defined564809 -Node: Definition Syntax565614 -Ref: Definition Syntax-Footnote-1571021 -Node: Function Example571092 -Ref: Function Example-Footnote-1574011 -Node: Function Caveats574033 -Node: Calling A Function574551 -Node: Variable Scope575509 -Node: Pass By Value/Reference578497 -Node: Return Statement581992 -Node: Dynamic Typing584973 -Node: Indirect Calls585902 -Ref: Indirect Calls-Footnote-1597204 -Node: Functions Summary597332 -Node: Library Functions600034 -Ref: Library Functions-Footnote-1603643 -Ref: Library Functions-Footnote-2603786 -Node: Library Names603957 -Ref: Library Names-Footnote-1607411 -Ref: Library Names-Footnote-2607634 -Node: General Functions607720 -Node: Strtonum Function608823 -Node: Assert Function611845 -Node: Round Function615169 -Node: Cliff Random Function616710 -Node: Ordinal Functions617726 -Ref: Ordinal Functions-Footnote-1620789 -Ref: Ordinal Functions-Footnote-2621041 -Node: Join Function621252 -Ref: Join Function-Footnote-1623021 -Node: Getlocaltime Function623221 -Node: Readfile Function626965 -Node: Shell Quoting628935 -Node: Data File Management630336 -Node: Filetrans Function630968 -Node: Rewind Function635024 -Node: File Checking636411 -Ref: File Checking-Footnote-1637743 -Node: Empty Files637944 -Node: Ignoring Assigns639923 -Node: Getopt Function641474 -Ref: Getopt Function-Footnote-1652936 -Node: Passwd Functions653136 -Ref: Passwd Functions-Footnote-1661973 -Node: Group Functions662061 -Ref: Group Functions-Footnote-1669955 -Node: Walking Arrays670168 -Node: Library Functions Summary671771 -Node: Library Exercises673172 -Node: Sample Programs674452 -Node: Running Examples675222 -Node: Clones675950 -Node: Cut Program677174 -Node: Egrep Program686893 -Ref: Egrep Program-Footnote-1694391 -Node: Id Program694501 -Node: Split Program698146 -Ref: Split Program-Footnote-1701594 -Node: Tee Program701722 -Node: Uniq Program704511 -Node: Wc Program711930 -Ref: Wc Program-Footnote-1716180 -Node: Miscellaneous Programs716274 -Node: Dupword Program717487 -Node: Alarm Program719518 -Node: Translate Program724322 -Ref: Translate Program-Footnote-1728887 -Node: Labels Program729157 -Ref: Labels Program-Footnote-1732508 -Node: Word Sorting732592 -Node: History Sorting736663 -Node: Extract Program738499 -Node: Simple Sed746024 -Node: Igawk Program749092 -Ref: Igawk Program-Footnote-1763416 -Ref: Igawk Program-Footnote-2763617 -Ref: Igawk Program-Footnote-3763739 -Node: Anagram Program763854 -Node: Signature Program766911 -Node: Programs Summary768158 -Node: Programs Exercises769351 -Ref: Programs Exercises-Footnote-1773482 -Node: Advanced Features773573 -Node: Nondecimal Data775521 -Node: Array Sorting777111 -Node: Controlling Array Traversal777808 -Ref: Controlling Array Traversal-Footnote-1786141 -Node: Array Sorting Functions786259 -Ref: Array Sorting Functions-Footnote-1790148 -Node: Two-way I/O790344 -Ref: Two-way I/O-Footnote-1795289 -Ref: Two-way I/O-Footnote-2795475 -Node: TCP/IP Networking795557 -Node: Profiling798430 -Node: Advanced Features Summary805977 -Node: Internationalization807910 -Node: I18N and L10N809390 -Node: Explaining gettext810076 -Ref: Explaining gettext-Footnote-1815101 -Ref: Explaining gettext-Footnote-2815285 -Node: Programmer i18n815450 -Ref: Programmer i18n-Footnote-1820316 -Node: Translator i18n820365 -Node: String Extraction821159 -Ref: String Extraction-Footnote-1822290 -Node: Printf Ordering822376 -Ref: Printf Ordering-Footnote-1825162 -Node: I18N Portability825226 -Ref: I18N Portability-Footnote-1827681 -Node: I18N Example827744 -Ref: I18N Example-Footnote-1830547 -Node: Gawk I18N830619 -Node: I18N Summary831257 -Node: Debugger832596 -Node: Debugging833618 -Node: Debugging Concepts834059 -Node: Debugging Terms835912 -Node: Awk Debugging838484 -Node: Sample Debugging Session839378 -Node: Debugger Invocation839898 -Node: Finding The Bug841282 -Node: List of Debugger Commands847757 -Node: Breakpoint Control849090 -Node: Debugger Execution Control852786 -Node: Viewing And Changing Data856150 -Node: Execution Stack859528 -Node: Debugger Info861165 -Node: Miscellaneous Debugger Commands865182 -Node: Readline Support870211 -Node: Limitations871103 -Node: Debugging Summary873217 -Node: Arbitrary Precision Arithmetic874385 -Node: Computer Arithmetic875801 -Ref: table-numeric-ranges879399 -Ref: Computer Arithmetic-Footnote-1880258 -Node: Math Definitions880315 -Ref: table-ieee-formats883603 -Ref: Math Definitions-Footnote-1884207 -Node: MPFR features884312 -Node: FP Math Caution885983 -Ref: FP Math Caution-Footnote-1887033 -Node: Inexactness of computations887402 -Node: Inexact representation888361 -Node: Comparing FP Values889718 -Node: Errors accumulate890800 -Node: Getting Accuracy892233 -Node: Try To Round894895 -Node: Setting precision895794 -Ref: table-predefined-precision-strings896478 -Node: Setting the rounding mode898267 -Ref: table-gawk-rounding-modes898631 -Ref: Setting the rounding mode-Footnote-1902086 -Node: Arbitrary Precision Integers902265 -Ref: Arbitrary Precision Integers-Footnote-1905251 -Node: POSIX Floating Point Problems905400 -Ref: POSIX Floating Point Problems-Footnote-1909273 -Node: Floating point summary909311 -Node: Dynamic Extensions911505 -Node: Extension Intro913057 -Node: Plugin License914323 -Node: Extension Mechanism Outline915120 -Ref: figure-load-extension915548 -Ref: figure-register-new-function917028 -Ref: figure-call-new-function918032 -Node: Extension API Description920018 -Node: Extension API Functions Introduction921468 -Node: General Data Types926292 -Ref: General Data Types-Footnote-1932031 -Node: Memory Allocation Functions932330 -Ref: Memory Allocation Functions-Footnote-1935169 -Node: Constructor Functions935265 -Node: Registration Functions936999 -Node: Extension Functions937684 -Node: Exit Callback Functions939981 -Node: Extension Version String941229 -Node: Input Parsers941894 -Node: Output Wrappers951773 -Node: Two-way processors956288 -Node: Printing Messages958492 -Ref: Printing Messages-Footnote-1959568 -Node: Updating `ERRNO'959720 -Node: Requesting Values960460 -Ref: table-value-types-returned961188 -Node: Accessing Parameters962145 -Node: Symbol Table Access963376 -Node: Symbol table by name963890 -Node: Symbol table by cookie965871 -Ref: Symbol table by cookie-Footnote-1970015 -Node: Cached values970078 -Ref: Cached values-Footnote-1973577 -Node: Array Manipulation973668 -Ref: Array Manipulation-Footnote-1974766 -Node: Array Data Types974803 -Ref: Array Data Types-Footnote-1977458 -Node: Array Functions977550 -Node: Flattening Arrays981404 -Node: Creating Arrays988296 -Node: Extension API Variables993067 -Node: Extension Versioning993703 -Node: Extension API Informational Variables995604 -Node: Extension API Boilerplate996669 -Node: Finding Extensions1000478 -Node: Extension Example1001038 -Node: Internal File Description1001810 -Node: Internal File Ops1005877 -Ref: Internal File Ops-Footnote-11017547 -Node: Using Internal File Ops1017687 -Ref: Using Internal File Ops-Footnote-11020070 -Node: Extension Samples1020343 -Node: Extension Sample File Functions1021869 -Node: Extension Sample Fnmatch1029507 -Node: Extension Sample Fork1030998 -Node: Extension Sample Inplace1032213 -Node: Extension Sample Ord1033888 -Node: Extension Sample Readdir1034724 -Ref: table-readdir-file-types1035600 -Node: Extension Sample Revout1036411 -Node: Extension Sample Rev2way1037001 -Node: Extension Sample Read write array1037741 -Node: Extension Sample Readfile1039681 -Node: Extension Sample Time1040776 -Node: Extension Sample API Tests1042125 -Node: gawkextlib1042616 -Node: Extension summary1045274 -Node: Extension Exercises1048963 -Node: Language History1049685 -Node: V7/SVR3.11051341 -Node: SVR41053522 -Node: POSIX1054967 -Node: BTL1056356 -Node: POSIX/GNU1057090 -Node: Feature History1062654 -Node: Common Extensions1075752 -Node: Ranges and Locales1077076 -Ref: Ranges and Locales-Footnote-11081694 -Ref: Ranges and Locales-Footnote-21081721 -Ref: Ranges and Locales-Footnote-31081955 -Node: Contributors1082176 -Node: History summary1087717 -Node: Installation1089087 -Node: Gawk Distribution1090033 -Node: Getting1090517 -Node: Extracting1091340 -Node: Distribution contents1092975 -Node: Unix Installation1098692 -Node: Quick Installation1099309 -Node: Additional Configuration Options1101733 -Node: Configuration Philosophy1103471 -Node: Non-Unix Installation1105840 -Node: PC Installation1106298 -Node: PC Binary Installation1107617 -Node: PC Compiling1109465 -Ref: PC Compiling-Footnote-11112486 -Node: PC Testing1112595 -Node: PC Using1113771 -Node: Cygwin1117886 -Node: MSYS1118709 -Node: VMS Installation1119209 -Node: VMS Compilation1120001 -Ref: VMS Compilation-Footnote-11121223 -Node: VMS Dynamic Extensions1121281 -Node: VMS Installation Details1122965 -Node: VMS Running1125217 -Node: VMS GNV1128053 -Node: VMS Old Gawk1128787 -Node: Bugs1129257 -Node: Other Versions1133140 -Node: Installation summary1139568 -Node: Notes1140624 -Node: Compatibility Mode1141489 -Node: Additions1142271 -Node: Accessing The Source1143196 -Node: Adding Code1144632 -Node: New Ports1150797 -Node: Derived Files1155279 -Ref: Derived Files-Footnote-11160754 -Ref: Derived Files-Footnote-21160788 -Ref: Derived Files-Footnote-31161384 -Node: Future Extensions1161498 -Node: Implementation Limitations1162104 -Node: Extension Design1163352 -Node: Old Extension Problems1164506 -Ref: Old Extension Problems-Footnote-11166023 -Node: Extension New Mechanism Goals1166080 -Ref: Extension New Mechanism Goals-Footnote-11169440 -Node: Extension Other Design Decisions1169629 -Node: Extension Future Growth1171737 -Node: Old Extension Mechanism1172573 -Node: Notes summary1174335 -Node: Basic Concepts1175521 -Node: Basic High Level1176202 -Ref: figure-general-flow1176474 -Ref: figure-process-flow1177073 -Ref: Basic High Level-Footnote-11180302 -Node: Basic Data Typing1180487 -Node: Glossary1183815 -Node: Copying1208973 -Node: GNU Free Documentation License1246529 -Node: Index1271665 +Ref: This Manual-Footnote-161574 +Node: Conventions61674 +Node: Manual History64011 +Ref: Manual History-Footnote-167004 +Ref: Manual History-Footnote-267045 +Node: How To Contribute67119 +Node: Acknowledgments68248 +Node: Getting Started73065 +Node: Running gawk75504 +Node: One-shot76694 +Node: Read Terminal77958 +Node: Long79989 +Node: Executable Scripts81502 +Ref: Executable Scripts-Footnote-184291 +Node: Comments84394 +Node: Quoting86876 +Node: DOS Quoting92394 +Node: Sample Data Files93069 +Node: Very Simple95664 +Node: Two Rules100563 +Node: More Complex102449 +Node: Statements/Lines105311 +Ref: Statements/Lines-Footnote-1109766 +Node: Other Features110031 +Node: When110962 +Ref: When-Footnote-1112716 +Node: Intro Summary112781 +Node: Invoking Gawk113664 +Node: Command Line115178 +Node: Options115976 +Ref: Options-Footnote-1131909 +Ref: Options-Footnote-2132138 +Node: Other Arguments132163 +Node: Naming Standard Input135111 +Node: Environment Variables136204 +Node: AWKPATH Variable136762 +Ref: AWKPATH Variable-Footnote-1140065 +Ref: AWKPATH Variable-Footnote-2140110 +Node: AWKLIBPATH Variable140370 +Node: Other Environment Variables141513 +Node: Exit Status145241 +Node: Include Files145917 +Node: Loading Shared Libraries149514 +Node: Obsolete150941 +Node: Undocumented151638 +Node: Invoking Summary151905 +Node: Regexp153569 +Node: Regexp Usage155023 +Node: Escape Sequences157060 +Node: Regexp Operators163071 +Ref: Regexp Operators-Footnote-1170497 +Ref: Regexp Operators-Footnote-2170644 +Node: Bracket Expressions170742 +Ref: table-char-classes172757 +Node: Leftmost Longest175681 +Node: Computed Regexps176983 +Node: GNU Regexp Operators180380 +Node: Case-sensitivity184053 +Ref: Case-sensitivity-Footnote-1186938 +Ref: Case-sensitivity-Footnote-2187173 +Node: Regexp Summary187281 +Node: Reading Files188748 +Node: Records190842 +Node: awk split records191575 +Node: gawk split records196490 +Ref: gawk split records-Footnote-1201034 +Node: Fields201071 +Ref: Fields-Footnote-1203847 +Node: Nonconstant Fields203933 +Ref: Nonconstant Fields-Footnote-1206176 +Node: Changing Fields206380 +Node: Field Separators212309 +Node: Default Field Splitting215014 +Node: Regexp Field Splitting216131 +Node: Single Character Fields219481 +Node: Command Line Field Separator220540 +Node: Full Line Fields223752 +Ref: Full Line Fields-Footnote-1225269 +Ref: Full Line Fields-Footnote-2225315 +Node: Field Splitting Summary225416 +Node: Constant Size227490 +Node: Splitting By Content232079 +Ref: Splitting By Content-Footnote-1236073 +Node: Multiple Line236236 +Ref: Multiple Line-Footnote-1242122 +Node: Getline242301 +Node: Plain Getline244513 +Node: Getline/Variable247153 +Node: Getline/File248301 +Node: Getline/Variable/File249685 +Ref: Getline/Variable/File-Footnote-1251288 +Node: Getline/Pipe251375 +Node: Getline/Variable/Pipe254058 +Node: Getline/Coprocess255189 +Node: Getline/Variable/Coprocess256441 +Node: Getline Notes257180 +Node: Getline Summary259972 +Ref: table-getline-variants260384 +Node: Read Timeout261213 +Ref: Read Timeout-Footnote-1265038 +Node: Command-line directories265096 +Node: Input Summary266001 +Node: Input Exercises269302 +Node: Printing270030 +Node: Print271807 +Node: Print Examples273264 +Node: Output Separators276043 +Node: OFMT278061 +Node: Printf279415 +Node: Basic Printf280200 +Node: Control Letters281770 +Node: Format Modifiers285753 +Node: Printf Examples291762 +Node: Redirection294248 +Node: Special FD301089 +Ref: Special FD-Footnote-1304249 +Node: Special Files304323 +Node: Other Inherited Files304940 +Node: Special Network305940 +Node: Special Caveats306802 +Node: Close Files And Pipes307753 +Ref: Close Files And Pipes-Footnote-1314935 +Ref: Close Files And Pipes-Footnote-2315083 +Node: Output Summary315233 +Node: Output Exercises316231 +Node: Expressions316911 +Node: Values318096 +Node: Constants318774 +Node: Scalar Constants319465 +Ref: Scalar Constants-Footnote-1320324 +Node: Nondecimal-numbers320574 +Node: Regexp Constants323592 +Node: Using Constant Regexps324117 +Node: Variables327260 +Node: Using Variables327915 +Node: Assignment Options329826 +Node: Conversion331701 +Node: Strings And Numbers332225 +Ref: Strings And Numbers-Footnote-1335290 +Node: Locale influences conversions335399 +Ref: table-locale-affects338146 +Node: All Operators338734 +Node: Arithmetic Ops339364 +Node: Concatenation341869 +Ref: Concatenation-Footnote-1344688 +Node: Assignment Ops344794 +Ref: table-assign-ops349773 +Node: Increment Ops351045 +Node: Truth Values and Conditions354483 +Node: Truth Values355568 +Node: Typing and Comparison356617 +Node: Variable Typing357427 +Node: Comparison Operators361080 +Ref: table-relational-ops361490 +Node: POSIX String Comparison364985 +Ref: POSIX String Comparison-Footnote-1366057 +Node: Boolean Ops366195 +Ref: Boolean Ops-Footnote-1370674 +Node: Conditional Exp370765 +Node: Function Calls372492 +Node: Precedence376372 +Node: Locales380033 +Node: Expressions Summary381665 +Node: Patterns and Actions384225 +Node: Pattern Overview385345 +Node: Regexp Patterns387024 +Node: Expression Patterns387567 +Node: Ranges391277 +Node: BEGIN/END394383 +Node: Using BEGIN/END395144 +Ref: Using BEGIN/END-Footnote-1397878 +Node: I/O And BEGIN/END397984 +Node: BEGINFILE/ENDFILE400298 +Node: Empty403199 +Node: Using Shell Variables403516 +Node: Action Overview405789 +Node: Statements408115 +Node: If Statement409963 +Node: While Statement411458 +Node: Do Statement413487 +Node: For Statement414631 +Node: Switch Statement417788 +Node: Break Statement420170 +Node: Continue Statement422211 +Node: Next Statement424038 +Node: Nextfile Statement426419 +Node: Exit Statement429049 +Node: Built-in Variables431452 +Node: User-modified432585 +Ref: User-modified-Footnote-1440266 +Node: Auto-set440328 +Ref: Auto-set-Footnote-1453363 +Ref: Auto-set-Footnote-2453568 +Node: ARGC and ARGV453624 +Node: Pattern Action Summary457842 +Node: Arrays460269 +Node: Array Basics461598 +Node: Array Intro462442 +Ref: figure-array-elements464406 +Ref: Array Intro-Footnote-1466932 +Node: Reference to Elements467060 +Node: Assigning Elements469512 +Node: Array Example470003 +Node: Scanning an Array471761 +Node: Controlling Scanning474777 +Ref: Controlling Scanning-Footnote-1479973 +Node: Numeric Array Subscripts480289 +Node: Uninitialized Subscripts482474 +Node: Delete484091 +Ref: Delete-Footnote-1486834 +Node: Multidimensional486891 +Node: Multiscanning489988 +Node: Arrays of Arrays491577 +Node: Arrays Summary496336 +Node: Functions498428 +Node: Built-in499327 +Node: Calling Built-in500405 +Node: Numeric Functions502396 +Ref: Numeric Functions-Footnote-1506413 +Ref: Numeric Functions-Footnote-2506770 +Ref: Numeric Functions-Footnote-3506818 +Node: String Functions507090 +Ref: String Functions-Footnote-1530565 +Ref: String Functions-Footnote-2530694 +Ref: String Functions-Footnote-3530942 +Node: Gory Details531029 +Ref: table-sub-escapes532810 +Ref: table-sub-proposed534330 +Ref: table-posix-sub535694 +Ref: table-gensub-escapes537230 +Ref: Gory Details-Footnote-1538062 +Node: I/O Functions538213 +Ref: I/O Functions-Footnote-1545431 +Node: Time Functions545578 +Ref: Time Functions-Footnote-1556066 +Ref: Time Functions-Footnote-2556134 +Ref: Time Functions-Footnote-3556292 +Ref: Time Functions-Footnote-4556403 +Ref: Time Functions-Footnote-5556515 +Ref: Time Functions-Footnote-6556742 +Node: Bitwise Functions557008 +Ref: table-bitwise-ops557570 +Ref: Bitwise Functions-Footnote-1561879 +Node: Type Functions562048 +Node: I18N Functions563199 +Node: User-defined564844 +Node: Definition Syntax565649 +Ref: Definition Syntax-Footnote-1571056 +Node: Function Example571127 +Ref: Function Example-Footnote-1574046 +Node: Function Caveats574068 +Node: Calling A Function574586 +Node: Variable Scope575544 +Node: Pass By Value/Reference578532 +Node: Return Statement582027 +Node: Dynamic Typing585008 +Node: Indirect Calls585937 +Ref: Indirect Calls-Footnote-1597239 +Node: Functions Summary597367 +Node: Library Functions600069 +Ref: Library Functions-Footnote-1603678 +Ref: Library Functions-Footnote-2603821 +Node: Library Names603992 +Ref: Library Names-Footnote-1607446 +Ref: Library Names-Footnote-2607669 +Node: General Functions607755 +Node: Strtonum Function608858 +Node: Assert Function611880 +Node: Round Function615204 +Node: Cliff Random Function616745 +Node: Ordinal Functions617761 +Ref: Ordinal Functions-Footnote-1620824 +Ref: Ordinal Functions-Footnote-2621076 +Node: Join Function621287 +Ref: Join Function-Footnote-1623056 +Node: Getlocaltime Function623256 +Node: Readfile Function627000 +Node: Shell Quoting628970 +Node: Data File Management630371 +Node: Filetrans Function631003 +Node: Rewind Function635059 +Node: File Checking636446 +Ref: File Checking-Footnote-1637778 +Node: Empty Files637979 +Node: Ignoring Assigns639958 +Node: Getopt Function641509 +Ref: Getopt Function-Footnote-1652971 +Node: Passwd Functions653171 +Ref: Passwd Functions-Footnote-1662008 +Node: Group Functions662096 +Ref: Group Functions-Footnote-1669990 +Node: Walking Arrays670203 +Node: Library Functions Summary671806 +Node: Library Exercises673207 +Node: Sample Programs674487 +Node: Running Examples675257 +Node: Clones675985 +Node: Cut Program677209 +Node: Egrep Program686928 +Ref: Egrep Program-Footnote-1694426 +Node: Id Program694536 +Node: Split Program698181 +Ref: Split Program-Footnote-1701629 +Node: Tee Program701757 +Node: Uniq Program704546 +Node: Wc Program711965 +Ref: Wc Program-Footnote-1716215 +Node: Miscellaneous Programs716309 +Node: Dupword Program717522 +Node: Alarm Program719553 +Node: Translate Program724357 +Ref: Translate Program-Footnote-1728922 +Node: Labels Program729192 +Ref: Labels Program-Footnote-1732543 +Node: Word Sorting732627 +Node: History Sorting736698 +Node: Extract Program738534 +Node: Simple Sed746059 +Node: Igawk Program749127 +Ref: Igawk Program-Footnote-1763451 +Ref: Igawk Program-Footnote-2763652 +Ref: Igawk Program-Footnote-3763774 +Node: Anagram Program763889 +Node: Signature Program766946 +Node: Programs Summary768193 +Node: Programs Exercises769386 +Ref: Programs Exercises-Footnote-1773517 +Node: Advanced Features773608 +Node: Nondecimal Data775556 +Node: Array Sorting777146 +Node: Controlling Array Traversal777843 +Ref: Controlling Array Traversal-Footnote-1786176 +Node: Array Sorting Functions786294 +Ref: Array Sorting Functions-Footnote-1790183 +Node: Two-way I/O790379 +Ref: Two-way I/O-Footnote-1795324 +Ref: Two-way I/O-Footnote-2795510 +Node: TCP/IP Networking795592 +Node: Profiling798465 +Node: Advanced Features Summary806012 +Node: Internationalization807945 +Node: I18N and L10N809425 +Node: Explaining gettext810111 +Ref: Explaining gettext-Footnote-1815136 +Ref: Explaining gettext-Footnote-2815320 +Node: Programmer i18n815485 +Ref: Programmer i18n-Footnote-1820351 +Node: Translator i18n820400 +Node: String Extraction821194 +Ref: String Extraction-Footnote-1822325 +Node: Printf Ordering822411 +Ref: Printf Ordering-Footnote-1825197 +Node: I18N Portability825261 +Ref: I18N Portability-Footnote-1827716 +Node: I18N Example827779 +Ref: I18N Example-Footnote-1830582 +Node: Gawk I18N830654 +Node: I18N Summary831292 +Node: Debugger832631 +Node: Debugging833653 +Node: Debugging Concepts834094 +Node: Debugging Terms835947 +Node: Awk Debugging838519 +Node: Sample Debugging Session839413 +Node: Debugger Invocation839933 +Node: Finding The Bug841317 +Node: List of Debugger Commands847792 +Node: Breakpoint Control849125 +Node: Debugger Execution Control852821 +Node: Viewing And Changing Data856185 +Node: Execution Stack859563 +Node: Debugger Info861200 +Node: Miscellaneous Debugger Commands865217 +Node: Readline Support870246 +Node: Limitations871138 +Node: Debugging Summary873252 +Node: Arbitrary Precision Arithmetic874420 +Node: Computer Arithmetic875836 +Ref: table-numeric-ranges879434 +Ref: Computer Arithmetic-Footnote-1880293 +Node: Math Definitions880350 +Ref: table-ieee-formats883638 +Ref: Math Definitions-Footnote-1884242 +Node: MPFR features884347 +Node: FP Math Caution886018 +Ref: FP Math Caution-Footnote-1887068 +Node: Inexactness of computations887437 +Node: Inexact representation888396 +Node: Comparing FP Values889753 +Node: Errors accumulate890835 +Node: Getting Accuracy892268 +Node: Try To Round894930 +Node: Setting precision895829 +Ref: table-predefined-precision-strings896513 +Node: Setting the rounding mode898302 +Ref: table-gawk-rounding-modes898666 +Ref: Setting the rounding mode-Footnote-1902121 +Node: Arbitrary Precision Integers902300 +Ref: Arbitrary Precision Integers-Footnote-1905286 +Node: POSIX Floating Point Problems905435 +Ref: POSIX Floating Point Problems-Footnote-1909308 +Node: Floating point summary909346 +Node: Dynamic Extensions911540 +Node: Extension Intro913092 +Node: Plugin License914358 +Node: Extension Mechanism Outline915155 +Ref: figure-load-extension915583 +Ref: figure-register-new-function917063 +Ref: figure-call-new-function918067 +Node: Extension API Description920053 +Node: Extension API Functions Introduction921503 +Node: General Data Types926327 +Ref: General Data Types-Footnote-1932066 +Node: Memory Allocation Functions932365 +Ref: Memory Allocation Functions-Footnote-1935204 +Node: Constructor Functions935300 +Node: Registration Functions937034 +Node: Extension Functions937719 +Node: Exit Callback Functions940016 +Node: Extension Version String941264 +Node: Input Parsers941929 +Node: Output Wrappers951808 +Node: Two-way processors956323 +Node: Printing Messages958527 +Ref: Printing Messages-Footnote-1959603 +Node: Updating `ERRNO'959755 +Node: Requesting Values960495 +Ref: table-value-types-returned961223 +Node: Accessing Parameters962180 +Node: Symbol Table Access963411 +Node: Symbol table by name963925 +Node: Symbol table by cookie965906 +Ref: Symbol table by cookie-Footnote-1970050 +Node: Cached values970113 +Ref: Cached values-Footnote-1973612 +Node: Array Manipulation973703 +Ref: Array Manipulation-Footnote-1974801 +Node: Array Data Types974838 +Ref: Array Data Types-Footnote-1977493 +Node: Array Functions977585 +Node: Flattening Arrays981439 +Node: Creating Arrays988331 +Node: Extension API Variables993102 +Node: Extension Versioning993738 +Node: Extension API Informational Variables995639 +Node: Extension API Boilerplate996704 +Node: Finding Extensions1000513 +Node: Extension Example1001073 +Node: Internal File Description1001845 +Node: Internal File Ops1005912 +Ref: Internal File Ops-Footnote-11017582 +Node: Using Internal File Ops1017722 +Ref: Using Internal File Ops-Footnote-11020105 +Node: Extension Samples1020378 +Node: Extension Sample File Functions1021904 +Node: Extension Sample Fnmatch1029542 +Node: Extension Sample Fork1031033 +Node: Extension Sample Inplace1032248 +Node: Extension Sample Ord1033923 +Node: Extension Sample Readdir1034759 +Ref: table-readdir-file-types1035635 +Node: Extension Sample Revout1036446 +Node: Extension Sample Rev2way1037036 +Node: Extension Sample Read write array1037776 +Node: Extension Sample Readfile1039716 +Node: Extension Sample Time1040811 +Node: Extension Sample API Tests1042160 +Node: gawkextlib1042651 +Node: Extension summary1045309 +Node: Extension Exercises1048998 +Node: Language History1049720 +Node: V7/SVR3.11051376 +Node: SVR41053557 +Node: POSIX1055002 +Node: BTL1056391 +Node: POSIX/GNU1057125 +Node: Feature History1062689 +Node: Common Extensions1075787 +Node: Ranges and Locales1077111 +Ref: Ranges and Locales-Footnote-11081729 +Ref: Ranges and Locales-Footnote-21081756 +Ref: Ranges and Locales-Footnote-31081990 +Node: Contributors1082211 +Node: History summary1087752 +Node: Installation1089122 +Node: Gawk Distribution1090068 +Node: Getting1090552 +Node: Extracting1091375 +Node: Distribution contents1093010 +Node: Unix Installation1098727 +Node: Quick Installation1099344 +Node: Additional Configuration Options1101768 +Node: Configuration Philosophy1103506 +Node: Non-Unix Installation1105875 +Node: PC Installation1106333 +Node: PC Binary Installation1107652 +Node: PC Compiling1109500 +Ref: PC Compiling-Footnote-11112521 +Node: PC Testing1112630 +Node: PC Using1113806 +Node: Cygwin1117921 +Node: MSYS1118744 +Node: VMS Installation1119244 +Node: VMS Compilation1120036 +Ref: VMS Compilation-Footnote-11121258 +Node: VMS Dynamic Extensions1121316 +Node: VMS Installation Details1123000 +Node: VMS Running1125252 +Node: VMS GNV1128088 +Node: VMS Old Gawk1128822 +Node: Bugs1129292 +Node: Other Versions1133175 +Node: Installation summary1139603 +Node: Notes1140659 +Node: Compatibility Mode1141524 +Node: Additions1142306 +Node: Accessing The Source1143231 +Node: Adding Code1144667 +Node: New Ports1150832 +Node: Derived Files1155314 +Ref: Derived Files-Footnote-11160789 +Ref: Derived Files-Footnote-21160823 +Ref: Derived Files-Footnote-31161419 +Node: Future Extensions1161533 +Node: Implementation Limitations1162139 +Node: Extension Design1163387 +Node: Old Extension Problems1164541 +Ref: Old Extension Problems-Footnote-11166058 +Node: Extension New Mechanism Goals1166115 +Ref: Extension New Mechanism Goals-Footnote-11169475 +Node: Extension Other Design Decisions1169664 +Node: Extension Future Growth1171772 +Node: Old Extension Mechanism1172608 +Node: Notes summary1174370 +Node: Basic Concepts1175556 +Node: Basic High Level1176237 +Ref: figure-general-flow1176509 +Ref: figure-process-flow1177108 +Ref: Basic High Level-Footnote-11180337 +Node: Basic Data Typing1180522 +Node: Glossary1183850 +Node: Copying1209008 +Node: GNU Free Documentation License1246564 +Node: Index1271700  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index de2f6ace..c0c672f1 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -56,7 +56,7 @@ @set PATCHLEVEL 2 @ifset FOR_PRINT -@set TITLE Effective Awk Programming +@set TITLE Effective awk Programming @end ifset @ifclear FOR_PRINT @set TITLE GAWK: Effective AWK Programming @@ -1579,7 +1579,7 @@ This @value{DOCUMENT} has the difficult task of being both a tutorial and a refe If you are a novice, feel free to skip over details that seem too complex. You should also ignore the many cross-references; they are for the expert user and for the Info and -@ulink{http://www.gnu.org/software/gawk/manual/, HTML} +@uref{http://www.gnu.org/software/gawk/manual/, HTML} versions of the @value{DOCUMENT}. @end ifnotinfo @@ -1661,9 +1661,9 @@ doing something when a record is matched, and the predefined variables @item @ref{Arrays}, covers @command{awk}'s one-and-only data structure: the associative array. -Deleting array elements and whole arrays is also described, as well as -sorting arrays in @command{gawk}. It also describes how @command{gawk} -provides arrays of arrays. +Deleting array elements and whole arrays is described, as well as +sorting arrays in @command{gawk}. The @value{CHAPTER} also describes how +@command{gawk} provides arrays of arrays. @item @ref{Functions}, @@ -1675,17 +1675,17 @@ as well as how to define your own functions. It also discusses how @item Part II shows how to use @command{awk} and @command{gawk} for problem solving. There is lots of code here for you to read and learn from. -It contains the following chapters: +This part contains the following chapters: @c nested @itemize @value{MINUS} @item -@ref{Library Functions}, which provides a number of functions meant to +@ref{Library Functions}, provides a number of functions meant to be used from main @command{awk} programs. @item @ref{Sample Programs}, -which provides many sample @command{awk} programs. +provides many sample @command{awk} programs. @end itemize Reading these two chapters allows you to see @command{awk} @@ -1738,7 +1738,7 @@ including the GNU General Public License: @item @ref{Language History}, describes how the @command{awk} language has evolved since -its first release to present. It also describes how @command{gawk} +its first release to the present. It also describes how @command{gawk} has acquired features over time. @item @@ -1781,7 +1781,7 @@ are completely unfamiliar with computer programming. @item @uref{http://www.gnu.org/software/gawk/manual/html_node/Glossary.html, The Glossary} -defines most, if not all of, the significant terms used +defines most, if not all, of the significant terms used throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. @@ -1808,7 +1808,7 @@ and some possible future directions for @command{gawk} development. provides some very cursory background material for those who are completely unfamiliar with computer programming. -The @ref{Glossary}, defines most, if not all of, the significant terms used +The @ref{Glossary}, defines most, if not all, of the significant terms used throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. @@ -1851,7 +1851,7 @@ This typically represents the command's standard output. Output from the command, usually its standard output, appears @code{like this}. @end ifset -Error messages, and other output on the command's standard error, are preceded +Error messages and other output on the command's standard error are preceded by the glyph ``@error{}''. For example: @example @@ -1878,7 +1878,7 @@ there are special characters called ``control characters.'' These are characters that you type by holding down both the @kbd{CONTROL} key and another key, at the same time. For example, a @kbd{Ctrl-d} is typed by first pressing and holding the @kbd{CONTROL} key, next -pressing the @kbd{d} key and finally releasing both keys. +pressing the @kbd{d} key, and finally releasing both keys. For the sake of brevity, throughout this @value{DOCUMENT}, we refer to Brian Kernighan's version of @command{awk} as ``BWK @command{awk}.'' @@ -1914,7 +1914,7 @@ the picture of a flashlight in the margin, as shown here. @value{DARKCORNER} @end iftex @ifnottex -``(d.c.)''. +``(d.c.).'' @end ifnottex @ifclear FOR_PRINT They also appear in the index under the heading ``dark corner.'' @@ -1949,12 +1949,12 @@ Emacs editor. GNU Emacs is the most widely used version of Emacs today. @cindex GPL (General Public License) @cindex General Public License, See GPL @cindex documentation, online -The GNU@footnote{GNU stands for ``GNU's not Unix.''} +The GNU@footnote{GNU stands for ``GNU's Not Unix.''} Project is an ongoing effort on the part of the Free Software Foundation to create a complete, freely distributable, POSIX-compliant computing environment. -The FSF uses the ``GNU General Public License'' (GPL) to ensure that -their software's +The FSF uses the GNU General Public License (GPL) to ensure that +its software's source code is always available to the end user. @ifclear FOR_PRINT A copy of the GPL is included @@ -2014,7 +2014,7 @@ version of @command{awk}. I started working with that version in the fall of 1988. As work on it progressed, the FSF published several preliminary versions (numbered 0.@var{x}). -In 1996, Edition 1.0 was released with @command{gawk} 3.0.0. +In 1996, edition 1.0 was released with @command{gawk} 3.0.0. The FSF published the first two editions under the title @cite{The GNU Awk User's Guide}. @ifset FOR_PRINT @@ -2026,7 +2026,7 @@ the third edition in 2001. This edition maintains the basic structure of the previous editions. For FSF edition 4.0, the content was thoroughly reviewed and updated. All references to @command{gawk} versions prior to 4.0 were removed. -Of significant note for that edition was @ref{Debugger}. +Of significant note for that edition was the addition of @ref{Debugger}. For FSF edition @ifclear FOR_PRINT @@ -2041,7 +2041,7 @@ and the major new additions are @ref{Arbitrary Precision Arithmetic}, and @ref{Dynamic Extensions}. This @value{DOCUMENT} will undoubtedly continue to evolve. If you -find an error in this @value{DOCUMENT}, please report it! @DBXREF{Bugs} +find an error in the @value{DOCUMENT}, please report it! @DBXREF{Bugs} for information on submitting problem reports electronically. @ifset FOR_PRINT @@ -2051,7 +2051,7 @@ for information on submitting problem reports electronically. You may have a newer version of @command{gawk} than the one described here. To find out what has changed, you should first look at the @file{NEWS} file in the @command{gawk} -distribution, which provides a high-level summary of what changed in +distribution, which provides a high-level summary of the changes in each release. You can then look at the @uref{http://www.gnu.org/software/gawk/manual/, @@ -2105,7 +2105,7 @@ The initial draft of @cite{The GAWK Manual} had the following acknowledgments: Many people need to be thanked for their assistance in producing this manual. Jay Fenlason contributed many ideas and sample programs. Richard Mlynarik and Robert Chassell gave helpful comments on drafts of this -manual. The paper @cite{A Supplemental Document for @command{awk}} by John W.@: +manual. The paper @cite{A Supplemental Document for AWK} by John W.@: Pierce of the Chemistry Department at UC San Diego, pinpointed several issues relevant both to @command{awk} implementation and to this manual, that would otherwise have escaped us. @@ -2116,12 +2116,18 @@ I would like to acknowledge Richard M.@: Stallman, for his vision of a better world and for his courage in founding the FSF and starting the GNU Project. +@ifclear FOR_PRINT Earlier editions of this @value{DOCUMENT} had the following acknowledgements: +@end ifclear +@ifset FOR_PRINT +The previous edition of this @value{DOCUMENT} had +the following acknowledgements: +@end ifset @quotation The following people (in alphabetical order) provided helpful comments on various -versions of this book, +versions of this book: Rick Adams, Dr.@: Nelson H.F. Beebe, Karl Berry, @@ -2149,7 +2155,7 @@ Robert J.@: Chassell provided much valuable advice on the use of Texinfo. He also deserves special thanks for convincing me @emph{not} to title this @value{DOCUMENT} -@cite{How To Gawk Politely}. +@cite{How to Gawk Politely}. Karl Berry helped significantly with the @TeX{} part of Texinfo. @cindex Hartholz, Marshall @@ -2233,9 +2239,9 @@ a number of people. @DBXREF{Contributors} for the full list. @ifset FOR_PRINT @cindex Oram, Andy -Thanks to Andy Oram, of O'Reilly Media, for initiating +Thanks to Andy Oram of O'Reilly Media for initiating the fourth edition and for his support during the work. -Thanks to Jasmine Kwityn for her copy-editing work. +Thanks to Jasmine Kwityn for her copyediting work. @end ifset Thanks to Michael Brennan for the Forewords. @@ -2243,7 +2249,7 @@ Thanks to Michael Brennan for the Forewords. @cindex Duman, Patrice @cindex Berry, Karl Thanks to Patrice Dumas for the new @command{makeinfo} program. -Thanks to Karl Berry who continues to work to keep +Thanks to Karl Berry, who continues to work to keep the Texinfo markup language sane. @cindex Kernighan, Brian @@ -2253,8 +2259,8 @@ Robert P.J.@: Day, Michael Brennan, and Brian Kernighan kindly acted as reviewers for the 2015 edition of this @value{DOCUMENT}. Their feedback helped improve the final work. -I would like to thank Brian Kernighan for invaluable assistance during the -testing and debugging of @command{gawk}, and for ongoing +I would also like to thank Brian Kernighan for his invaluable assistance during the +testing and debugging of @command{gawk}, and for his ongoing help and advice in clarifying numerous points about the language. We could not have done nearly as good a job on either @command{gawk} or its documentation without his help. @@ -2365,9 +2371,9 @@ an advanced feature that we will ignore for now; pattern to search for and one action to perform upon finding the pattern. -Syntactically, a rule consists of a pattern followed by an action. The -action is enclosed in braces to separate it from the pattern. -Newlines usually separate rules. Therefore, an @command{awk} +Syntactically, a rule consists of a @dfn{pattern} followed by an +@dfn{action}. The action is enclosed in braces to separate it from the +pattern. Newlines usually separate rules. Therefore, an @command{awk} program looks like this: @example @@ -2441,8 +2447,8 @@ awk '@var{program}' @var{input-file1} @var{input-file2} @dots{} @end example @noindent -where @var{program} consists of a series of @var{patterns} and -@var{actions}, as described earlier. +where @var{program} consists of a series of patterns and +actions, as described earlier. @cindex single quote (@code{'}) @cindex @code{'} (single quote) @@ -2461,12 +2467,12 @@ programs from shell scripts, because it avoids the need for a separate file for the @command{awk} program. A self-contained shell script is more reliable because there are no other files to misplace. -Later in this chapter, +Later in this chapter, in @ifdocbook the section @end ifdocbook @ref{Very Simple}, -presents several short, +we'll see examples of several short, self-contained programs. @node Read Terminal @@ -2487,10 +2493,10 @@ awk '@var{program}' which usually means whatever you type on the keyboard. This continues until you indicate end-of-file by typing @kbd{Ctrl-d}. @ifset FOR_PRINT -(On other operating systems, the end-of-file character may be different.) +(On non-POSIX operating systems, the end-of-file character may be different.) @end ifset @ifclear FOR_PRINT -(On other operating systems, the end-of-file character may be different. +(On non-POSIX operating systems, the end-of-file character may be different. For example, on OS/2, it is @kbd{Ctrl-z}.) @end ifclear @@ -2594,7 +2600,7 @@ text, instead of the magic @samp{\47}.) @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 your @command{awk} program files as such, +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 affect the execution of the @command{awk} program but it does make ``housekeeping'' easier. @@ -2808,7 +2814,7 @@ The next @value{SUBSECTION} describes the shell's quoting rules. @end quotation @node Quoting -@subsection Shell-Quoting Issues +@subsection Shell Quoting Issues @cindex shell quoting, rules for @menu @@ -2945,7 +2951,7 @@ $ @kbd{awk 'BEGIN @{ print "Here is a single quote <'"'"'>" @}'} @noindent This program consists of three concatenated quoted strings. The first and the -third are single quoted, the second is double quoted. +third are single-quoted, and the second is double-quoted. This can be ``simplified'' to: @@ -2984,7 +2990,7 @@ $ @kbd{awk 'BEGIN @{ print "Here is a double quote <\42>" @}'} @end example @noindent -This works nicely, except that you should comment clearly what the +This works nicely, but you should comment clearly what the escapes mean. A fourth option is to use command-line variable assignment, like this: @@ -2995,11 +3001,11 @@ $ @kbd{awk -v sq="'" 'BEGIN @{ print "Here is a single quote <" sq ">" @}'} @end example (Here, the two string constants and the value of @code{sq} are concatenated -into a single string which is printed by @code{print}.) +into a single string that is printed by @code{print}.) If you really need both single and double quotes in your @command{awk} program, it is probably best to move it into a separate file, where -the shell won't be part of the picture, and you can say what you mean. +the shell won't be part of the picture and you can say what you mean. @node DOS Quoting @subsubsection Quoting in MS-Windows Batch Files @@ -3098,7 +3104,7 @@ of green crates shipped, the number of red boxes shipped, the number of orange bags shipped, and the number of blue packages shipped, respectively. There are 16 entries, covering the 12 months of last year and the first four months of the current year. -An empty line separates the data for the two years. +An empty line separates the data for the two years: @example @c file eg/data/inventory-shipped @@ -3132,7 +3138,7 @@ The following command runs a simple @command{awk} program that searches the input file @file{mail-list} for the character string @samp{li} (a grouping of characters is usually called a @dfn{string}; the term @dfn{string} is based on similar usage in English, such -as ``a string of pearls,'' or ``a string of cars in a train''): +as ``a string of pearls'' or ``a string of cars in a train''): @example awk '/li/ @{ print $0 @}' mail-list @@ -3179,7 +3185,7 @@ omitting the @code{print} statement but retaining the braces makes an empty action that does nothing (i.e., no lines are printed). @cindex @command{awk} programs, one-line examples -Many practical @command{awk} programs are just a line or two. Following is a +Many practical @command{awk} programs are just a line or two long. Following is a collection of useful, short programs to get you started. Some of these programs contain constructs that haven't been covered yet. (The description of the program will give you a good idea of what is going on, but you'll @@ -3200,7 +3206,7 @@ Print every line that is longer than 80 characters: awk 'length($0) > 80' data @end example -The sole rule has a relational expression as its pattern and it has no +The sole rule has a relational expression as its pattern and has no action---so it uses the default action, printing the record. @item @@ -3287,7 +3293,7 @@ Print the even-numbered lines in the @value{DF}: awk 'NR % 2 == 0' data @end example -If you use the expression @samp{NR % 2 == 1} instead, +If you used the expression @samp{NR % 2 == 1} instead, the program would print the odd-numbered lines. @end itemize diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 460fc7dd..5cff1e5f 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -51,7 +51,7 @@ @set PATCHLEVEL 2 @ifset FOR_PRINT -@set TITLE Effective Awk Programming +@set TITLE Effective awk Programming @end ifset @ifclear FOR_PRINT @set TITLE GAWK: Effective AWK Programming @@ -1546,7 +1546,7 @@ This @value{DOCUMENT} has the difficult task of being both a tutorial and a refe If you are a novice, feel free to skip over details that seem too complex. You should also ignore the many cross-references; they are for the expert user and for the Info and -@ulink{http://www.gnu.org/software/gawk/manual/, HTML} +@uref{http://www.gnu.org/software/gawk/manual/, HTML} versions of the @value{DOCUMENT}. @end ifnotinfo @@ -1628,9 +1628,9 @@ doing something when a record is matched, and the predefined variables @item @ref{Arrays}, covers @command{awk}'s one-and-only data structure: the associative array. -Deleting array elements and whole arrays is also described, as well as -sorting arrays in @command{gawk}. It also describes how @command{gawk} -provides arrays of arrays. +Deleting array elements and whole arrays is described, as well as +sorting arrays in @command{gawk}. The @value{CHAPTER} also describes how +@command{gawk} provides arrays of arrays. @item @ref{Functions}, @@ -1642,17 +1642,17 @@ as well as how to define your own functions. It also discusses how @item Part II shows how to use @command{awk} and @command{gawk} for problem solving. There is lots of code here for you to read and learn from. -It contains the following chapters: +This part contains the following chapters: @c nested @itemize @value{MINUS} @item -@ref{Library Functions}, which provides a number of functions meant to +@ref{Library Functions}, provides a number of functions meant to be used from main @command{awk} programs. @item @ref{Sample Programs}, -which provides many sample @command{awk} programs. +provides many sample @command{awk} programs. @end itemize Reading these two chapters allows you to see @command{awk} @@ -1705,7 +1705,7 @@ including the GNU General Public License: @item @ref{Language History}, describes how the @command{awk} language has evolved since -its first release to present. It also describes how @command{gawk} +its first release to the present. It also describes how @command{gawk} has acquired features over time. @item @@ -1748,7 +1748,7 @@ are completely unfamiliar with computer programming. @item @uref{http://www.gnu.org/software/gawk/manual/html_node/Glossary.html, The Glossary} -defines most, if not all of, the significant terms used +defines most, if not all, of the significant terms used throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. @@ -1775,7 +1775,7 @@ and some possible future directions for @command{gawk} development. provides some very cursory background material for those who are completely unfamiliar with computer programming. -The @ref{Glossary}, defines most, if not all of, the significant terms used +The @ref{Glossary}, defines most, if not all, of the significant terms used throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. @@ -1818,7 +1818,7 @@ This typically represents the command's standard output. Output from the command, usually its standard output, appears @code{like this}. @end ifset -Error messages, and other output on the command's standard error, are preceded +Error messages and other output on the command's standard error are preceded by the glyph ``@error{}''. For example: @example @@ -1845,7 +1845,7 @@ there are special characters called ``control characters.'' These are characters that you type by holding down both the @kbd{CONTROL} key and another key, at the same time. For example, a @kbd{Ctrl-d} is typed by first pressing and holding the @kbd{CONTROL} key, next -pressing the @kbd{d} key and finally releasing both keys. +pressing the @kbd{d} key, and finally releasing both keys. For the sake of brevity, throughout this @value{DOCUMENT}, we refer to Brian Kernighan's version of @command{awk} as ``BWK @command{awk}.'' @@ -1881,7 +1881,7 @@ the picture of a flashlight in the margin, as shown here. @value{DARKCORNER} @end iftex @ifnottex -``(d.c.)''. +``(d.c.).'' @end ifnottex @ifclear FOR_PRINT They also appear in the index under the heading ``dark corner.'' @@ -1916,12 +1916,12 @@ Emacs editor. GNU Emacs is the most widely used version of Emacs today. @cindex GPL (General Public License) @cindex General Public License, See GPL @cindex documentation, online -The GNU@footnote{GNU stands for ``GNU's not Unix.''} +The GNU@footnote{GNU stands for ``GNU's Not Unix.''} Project is an ongoing effort on the part of the Free Software Foundation to create a complete, freely distributable, POSIX-compliant computing environment. -The FSF uses the ``GNU General Public License'' (GPL) to ensure that -their software's +The FSF uses the GNU General Public License (GPL) to ensure that +its software's source code is always available to the end user. @ifclear FOR_PRINT A copy of the GPL is included @@ -1981,7 +1981,7 @@ version of @command{awk}. I started working with that version in the fall of 1988. As work on it progressed, the FSF published several preliminary versions (numbered 0.@var{x}). -In 1996, Edition 1.0 was released with @command{gawk} 3.0.0. +In 1996, edition 1.0 was released with @command{gawk} 3.0.0. The FSF published the first two editions under the title @cite{The GNU Awk User's Guide}. @ifset FOR_PRINT @@ -1993,7 +1993,7 @@ the third edition in 2001. This edition maintains the basic structure of the previous editions. For FSF edition 4.0, the content was thoroughly reviewed and updated. All references to @command{gawk} versions prior to 4.0 were removed. -Of significant note for that edition was @ref{Debugger}. +Of significant note for that edition was the addition of @ref{Debugger}. For FSF edition @ifclear FOR_PRINT @@ -2008,7 +2008,7 @@ and the major new additions are @ref{Arbitrary Precision Arithmetic}, and @ref{Dynamic Extensions}. This @value{DOCUMENT} will undoubtedly continue to evolve. If you -find an error in this @value{DOCUMENT}, please report it! @DBXREF{Bugs} +find an error in the @value{DOCUMENT}, please report it! @DBXREF{Bugs} for information on submitting problem reports electronically. @ifset FOR_PRINT @@ -2018,7 +2018,7 @@ for information on submitting problem reports electronically. You may have a newer version of @command{gawk} than the one described here. To find out what has changed, you should first look at the @file{NEWS} file in the @command{gawk} -distribution, which provides a high-level summary of what changed in +distribution, which provides a high-level summary of the changes in each release. You can then look at the @uref{http://www.gnu.org/software/gawk/manual/, @@ -2072,7 +2072,7 @@ The initial draft of @cite{The GAWK Manual} had the following acknowledgments: Many people need to be thanked for their assistance in producing this manual. Jay Fenlason contributed many ideas and sample programs. Richard Mlynarik and Robert Chassell gave helpful comments on drafts of this -manual. The paper @cite{A Supplemental Document for @command{awk}} by John W.@: +manual. The paper @cite{A Supplemental Document for AWK} by John W.@: Pierce of the Chemistry Department at UC San Diego, pinpointed several issues relevant both to @command{awk} implementation and to this manual, that would otherwise have escaped us. @@ -2083,12 +2083,18 @@ I would like to acknowledge Richard M.@: Stallman, for his vision of a better world and for his courage in founding the FSF and starting the GNU Project. +@ifclear FOR_PRINT Earlier editions of this @value{DOCUMENT} had the following acknowledgements: +@end ifclear +@ifset FOR_PRINT +The previous edition of this @value{DOCUMENT} had +the following acknowledgements: +@end ifset @quotation The following people (in alphabetical order) provided helpful comments on various -versions of this book, +versions of this book: Rick Adams, Dr.@: Nelson H.F. Beebe, Karl Berry, @@ -2116,7 +2122,7 @@ Robert J.@: Chassell provided much valuable advice on the use of Texinfo. He also deserves special thanks for convincing me @emph{not} to title this @value{DOCUMENT} -@cite{How To Gawk Politely}. +@cite{How to Gawk Politely}. Karl Berry helped significantly with the @TeX{} part of Texinfo. @cindex Hartholz, Marshall @@ -2200,9 +2206,9 @@ a number of people. @DBXREF{Contributors} for the full list. @ifset FOR_PRINT @cindex Oram, Andy -Thanks to Andy Oram, of O'Reilly Media, for initiating +Thanks to Andy Oram of O'Reilly Media for initiating the fourth edition and for his support during the work. -Thanks to Jasmine Kwityn for her copy-editing work. +Thanks to Jasmine Kwityn for her copyediting work. @end ifset Thanks to Michael Brennan for the Forewords. @@ -2210,7 +2216,7 @@ Thanks to Michael Brennan for the Forewords. @cindex Duman, Patrice @cindex Berry, Karl Thanks to Patrice Dumas for the new @command{makeinfo} program. -Thanks to Karl Berry who continues to work to keep +Thanks to Karl Berry, who continues to work to keep the Texinfo markup language sane. @cindex Kernighan, Brian @@ -2220,8 +2226,8 @@ Robert P.J.@: Day, Michael Brennan, and Brian Kernighan kindly acted as reviewers for the 2015 edition of this @value{DOCUMENT}. Their feedback helped improve the final work. -I would like to thank Brian Kernighan for invaluable assistance during the -testing and debugging of @command{gawk}, and for ongoing +I would also like to thank Brian Kernighan for his invaluable assistance during the +testing and debugging of @command{gawk}, and for his ongoing help and advice in clarifying numerous points about the language. We could not have done nearly as good a job on either @command{gawk} or its documentation without his help. @@ -2332,9 +2338,9 @@ an advanced feature that we will ignore for now; pattern to search for and one action to perform upon finding the pattern. -Syntactically, a rule consists of a pattern followed by an action. The -action is enclosed in braces to separate it from the pattern. -Newlines usually separate rules. Therefore, an @command{awk} +Syntactically, a rule consists of a @dfn{pattern} followed by an +@dfn{action}. The action is enclosed in braces to separate it from the +pattern. Newlines usually separate rules. Therefore, an @command{awk} program looks like this: @example @@ -2408,8 +2414,8 @@ awk '@var{program}' @var{input-file1} @var{input-file2} @dots{} @end example @noindent -where @var{program} consists of a series of @var{patterns} and -@var{actions}, as described earlier. +where @var{program} consists of a series of patterns and +actions, as described earlier. @cindex single quote (@code{'}) @cindex @code{'} (single quote) @@ -2428,12 +2434,12 @@ programs from shell scripts, because it avoids the need for a separate file for the @command{awk} program. A self-contained shell script is more reliable because there are no other files to misplace. -Later in this chapter, +Later in this chapter, in @ifdocbook the section @end ifdocbook @ref{Very Simple}, -presents several short, +we'll see examples of several short, self-contained programs. @node Read Terminal @@ -2454,10 +2460,10 @@ awk '@var{program}' which usually means whatever you type on the keyboard. This continues until you indicate end-of-file by typing @kbd{Ctrl-d}. @ifset FOR_PRINT -(On other operating systems, the end-of-file character may be different.) +(On non-POSIX operating systems, the end-of-file character may be different.) @end ifset @ifclear FOR_PRINT -(On other operating systems, the end-of-file character may be different. +(On non-POSIX operating systems, the end-of-file character may be different. For example, on OS/2, it is @kbd{Ctrl-z}.) @end ifclear @@ -2561,7 +2567,7 @@ text, instead of the magic @samp{\47}.) @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 your @command{awk} program files as such, +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 affect the execution of the @command{awk} program but it does make ``housekeeping'' easier. @@ -2719,7 +2725,7 @@ The next @value{SUBSECTION} describes the shell's quoting rules. @end quotation @node Quoting -@subsection Shell-Quoting Issues +@subsection Shell Quoting Issues @cindex shell quoting, rules for @menu @@ -2856,7 +2862,7 @@ $ @kbd{awk 'BEGIN @{ print "Here is a single quote <'"'"'>" @}'} @noindent This program consists of three concatenated quoted strings. The first and the -third are single quoted, the second is double quoted. +third are single-quoted, and the second is double-quoted. This can be ``simplified'' to: @@ -2895,7 +2901,7 @@ $ @kbd{awk 'BEGIN @{ print "Here is a double quote <\42>" @}'} @end example @noindent -This works nicely, except that you should comment clearly what the +This works nicely, but you should comment clearly what the escapes mean. A fourth option is to use command-line variable assignment, like this: @@ -2906,11 +2912,11 @@ $ @kbd{awk -v sq="'" 'BEGIN @{ print "Here is a single quote <" sq ">" @}'} @end example (Here, the two string constants and the value of @code{sq} are concatenated -into a single string which is printed by @code{print}.) +into a single string that is printed by @code{print}.) If you really need both single and double quotes in your @command{awk} program, it is probably best to move it into a separate file, where -the shell won't be part of the picture, and you can say what you mean. +the shell won't be part of the picture and you can say what you mean. @node DOS Quoting @subsubsection Quoting in MS-Windows Batch Files @@ -3009,7 +3015,7 @@ of green crates shipped, the number of red boxes shipped, the number of orange bags shipped, and the number of blue packages shipped, respectively. There are 16 entries, covering the 12 months of last year and the first four months of the current year. -An empty line separates the data for the two years. +An empty line separates the data for the two years: @example @c file eg/data/inventory-shipped @@ -3043,7 +3049,7 @@ The following command runs a simple @command{awk} program that searches the input file @file{mail-list} for the character string @samp{li} (a grouping of characters is usually called a @dfn{string}; the term @dfn{string} is based on similar usage in English, such -as ``a string of pearls,'' or ``a string of cars in a train''): +as ``a string of pearls'' or ``a string of cars in a train''): @example awk '/li/ @{ print $0 @}' mail-list @@ -3090,7 +3096,7 @@ omitting the @code{print} statement but retaining the braces makes an empty action that does nothing (i.e., no lines are printed). @cindex @command{awk} programs, one-line examples -Many practical @command{awk} programs are just a line or two. Following is a +Many practical @command{awk} programs are just a line or two long. Following is a collection of useful, short programs to get you started. Some of these programs contain constructs that haven't been covered yet. (The description of the program will give you a good idea of what is going on, but you'll @@ -3111,7 +3117,7 @@ Print every line that is longer than 80 characters: awk 'length($0) > 80' data @end example -The sole rule has a relational expression as its pattern and it has no +The sole rule has a relational expression as its pattern and has no action---so it uses the default action, printing the record. @item @@ -3198,7 +3204,7 @@ Print the even-numbered lines in the @value{DF}: awk 'NR % 2 == 0' data @end example -If you use the expression @samp{NR % 2 == 1} instead, +If you used the expression @samp{NR % 2 == 1} instead, the program would print the odd-numbered lines. @end itemize -- cgit v1.2.3 From f1aae2393344a21675bc3d5f3c24f9b555c5744b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 20 Jan 2015 21:58:17 +0200 Subject: Remove unneeded calls to make_aname. --- ChangeLog | 9 ++++++++- gawkapi.c | 1 - symbol.c | 1 - 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05594a8c..57663dc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-01-20 Arnold D. Robbins + + * gawkapi.c (api_set_array_element): Remove useless call to + make_aname. + * symbol.c (load_symbols): Ditto. + Thanks to Andrew Schorr for pointing out the problem. + 2015-01-19 Arnold D. Robbins * awkgram.c: Update to bison 3.0.3. @@ -1585,7 +1592,7 @@ 2012-12-25 Arnold D. Robbins Remove sym-constant from API after discussions with John - Haque and Andy Schorr. + Haque and Andrew Schorr. * gawkapi.h (api_sym_constant): Removed field in API struct. (sym_constant): Remove macro. diff --git a/gawkapi.c b/gawkapi.c index 06f31929..fc6e159a 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -790,7 +790,6 @@ api_set_array_element(awk_ext_id_t id, awk_array_t a_cookie, elem->parent_array = array; elem->vname = estrdup(index->str_value.str, index->str_value.len); - make_aname(elem); } return awk_true; diff --git a/symbol.c b/symbol.c index e89214c0..23e04c03 100644 --- a/symbol.c +++ b/symbol.c @@ -565,7 +565,6 @@ load_symbols() sym_array->parent_array = PROCINFO_node; sym_array->vname = estrdup("identifiers", 11); - make_aname(sym_array); user = make_string("user", 4); extension = make_string("extension", 9); -- cgit v1.2.3 From 501f5c4fc53a1c74a8a4074832dcc2bd72224ed6 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 20 Jan 2015 22:00:37 +0200 Subject: Fix a typo. --- doc/gawk.info | 892 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 3 files changed, 448 insertions(+), 448 deletions(-) diff --git a/doc/gawk.info b/doc/gawk.info index 3f32c445..b81c0700 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -5916,7 +5916,7 @@ the same as specifying no timeout at all. implicit loop that reads input records and matches them against patterns, like so: - $ gawk 'BEGIN { PROCINFO["-", "READ_TIMEOUT"] = 5000 } + $ gawk 'BEGIN { PROCINFO["-", "READ_TIMEOUT"] = 5000 } > { print "You entered: " $0 }' gawk -| You entered: gawk @@ -34408,450 +34408,450 @@ Node: Getline Notes257180 Node: Getline Summary259972 Ref: table-getline-variants260384 Node: Read Timeout261213 -Ref: Read Timeout-Footnote-1265038 -Node: Command-line directories265096 -Node: Input Summary266001 -Node: Input Exercises269302 -Node: Printing270030 -Node: Print271807 -Node: Print Examples273264 -Node: Output Separators276043 -Node: OFMT278061 -Node: Printf279415 -Node: Basic Printf280200 -Node: Control Letters281770 -Node: Format Modifiers285753 -Node: Printf Examples291762 -Node: Redirection294248 -Node: Special FD301089 -Ref: Special FD-Footnote-1304249 -Node: Special Files304323 -Node: Other Inherited Files304940 -Node: Special Network305940 -Node: Special Caveats306802 -Node: Close Files And Pipes307753 -Ref: Close Files And Pipes-Footnote-1314935 -Ref: Close Files And Pipes-Footnote-2315083 -Node: Output Summary315233 -Node: Output Exercises316231 -Node: Expressions316911 -Node: Values318096 -Node: Constants318774 -Node: Scalar Constants319465 -Ref: Scalar Constants-Footnote-1320324 -Node: Nondecimal-numbers320574 -Node: Regexp Constants323592 -Node: Using Constant Regexps324117 -Node: Variables327260 -Node: Using Variables327915 -Node: Assignment Options329826 -Node: Conversion331701 -Node: Strings And Numbers332225 -Ref: Strings And Numbers-Footnote-1335290 -Node: Locale influences conversions335399 -Ref: table-locale-affects338146 -Node: All Operators338734 -Node: Arithmetic Ops339364 -Node: Concatenation341869 -Ref: Concatenation-Footnote-1344688 -Node: Assignment Ops344794 -Ref: table-assign-ops349773 -Node: Increment Ops351045 -Node: Truth Values and Conditions354483 -Node: Truth Values355568 -Node: Typing and Comparison356617 -Node: Variable Typing357427 -Node: Comparison Operators361080 -Ref: table-relational-ops361490 -Node: POSIX String Comparison364985 -Ref: POSIX String Comparison-Footnote-1366057 -Node: Boolean Ops366195 -Ref: Boolean Ops-Footnote-1370674 -Node: Conditional Exp370765 -Node: Function Calls372492 -Node: Precedence376372 -Node: Locales380033 -Node: Expressions Summary381665 -Node: Patterns and Actions384225 -Node: Pattern Overview385345 -Node: Regexp Patterns387024 -Node: Expression Patterns387567 -Node: Ranges391277 -Node: BEGIN/END394383 -Node: Using BEGIN/END395144 -Ref: Using BEGIN/END-Footnote-1397878 -Node: I/O And BEGIN/END397984 -Node: BEGINFILE/ENDFILE400298 -Node: Empty403199 -Node: Using Shell Variables403516 -Node: Action Overview405789 -Node: Statements408115 -Node: If Statement409963 -Node: While Statement411458 -Node: Do Statement413487 -Node: For Statement414631 -Node: Switch Statement417788 -Node: Break Statement420170 -Node: Continue Statement422211 -Node: Next Statement424038 -Node: Nextfile Statement426419 -Node: Exit Statement429049 -Node: Built-in Variables431452 -Node: User-modified432585 -Ref: User-modified-Footnote-1440266 -Node: Auto-set440328 -Ref: Auto-set-Footnote-1453363 -Ref: Auto-set-Footnote-2453568 -Node: ARGC and ARGV453624 -Node: Pattern Action Summary457842 -Node: Arrays460269 -Node: Array Basics461598 -Node: Array Intro462442 -Ref: figure-array-elements464406 -Ref: Array Intro-Footnote-1466932 -Node: Reference to Elements467060 -Node: Assigning Elements469512 -Node: Array Example470003 -Node: Scanning an Array471761 -Node: Controlling Scanning474777 -Ref: Controlling Scanning-Footnote-1479973 -Node: Numeric Array Subscripts480289 -Node: Uninitialized Subscripts482474 -Node: Delete484091 -Ref: Delete-Footnote-1486834 -Node: Multidimensional486891 -Node: Multiscanning489988 -Node: Arrays of Arrays491577 -Node: Arrays Summary496336 -Node: Functions498428 -Node: Built-in499327 -Node: Calling Built-in500405 -Node: Numeric Functions502396 -Ref: Numeric Functions-Footnote-1506413 -Ref: Numeric Functions-Footnote-2506770 -Ref: Numeric Functions-Footnote-3506818 -Node: String Functions507090 -Ref: String Functions-Footnote-1530565 -Ref: String Functions-Footnote-2530694 -Ref: String Functions-Footnote-3530942 -Node: Gory Details531029 -Ref: table-sub-escapes532810 -Ref: table-sub-proposed534330 -Ref: table-posix-sub535694 -Ref: table-gensub-escapes537230 -Ref: Gory Details-Footnote-1538062 -Node: I/O Functions538213 -Ref: I/O Functions-Footnote-1545431 -Node: Time Functions545578 -Ref: Time Functions-Footnote-1556066 -Ref: Time Functions-Footnote-2556134 -Ref: Time Functions-Footnote-3556292 -Ref: Time Functions-Footnote-4556403 -Ref: Time Functions-Footnote-5556515 -Ref: Time Functions-Footnote-6556742 -Node: Bitwise Functions557008 -Ref: table-bitwise-ops557570 -Ref: Bitwise Functions-Footnote-1561879 -Node: Type Functions562048 -Node: I18N Functions563199 -Node: User-defined564844 -Node: Definition Syntax565649 -Ref: Definition Syntax-Footnote-1571056 -Node: Function Example571127 -Ref: Function Example-Footnote-1574046 -Node: Function Caveats574068 -Node: Calling A Function574586 -Node: Variable Scope575544 -Node: Pass By Value/Reference578532 -Node: Return Statement582027 -Node: Dynamic Typing585008 -Node: Indirect Calls585937 -Ref: Indirect Calls-Footnote-1597239 -Node: Functions Summary597367 -Node: Library Functions600069 -Ref: Library Functions-Footnote-1603678 -Ref: Library Functions-Footnote-2603821 -Node: Library Names603992 -Ref: Library Names-Footnote-1607446 -Ref: Library Names-Footnote-2607669 -Node: General Functions607755 -Node: Strtonum Function608858 -Node: Assert Function611880 -Node: Round Function615204 -Node: Cliff Random Function616745 -Node: Ordinal Functions617761 -Ref: Ordinal Functions-Footnote-1620824 -Ref: Ordinal Functions-Footnote-2621076 -Node: Join Function621287 -Ref: Join Function-Footnote-1623056 -Node: Getlocaltime Function623256 -Node: Readfile Function627000 -Node: Shell Quoting628970 -Node: Data File Management630371 -Node: Filetrans Function631003 -Node: Rewind Function635059 -Node: File Checking636446 -Ref: File Checking-Footnote-1637778 -Node: Empty Files637979 -Node: Ignoring Assigns639958 -Node: Getopt Function641509 -Ref: Getopt Function-Footnote-1652971 -Node: Passwd Functions653171 -Ref: Passwd Functions-Footnote-1662008 -Node: Group Functions662096 -Ref: Group Functions-Footnote-1669990 -Node: Walking Arrays670203 -Node: Library Functions Summary671806 -Node: Library Exercises673207 -Node: Sample Programs674487 -Node: Running Examples675257 -Node: Clones675985 -Node: Cut Program677209 -Node: Egrep Program686928 -Ref: Egrep Program-Footnote-1694426 -Node: Id Program694536 -Node: Split Program698181 -Ref: Split Program-Footnote-1701629 -Node: Tee Program701757 -Node: Uniq Program704546 -Node: Wc Program711965 -Ref: Wc Program-Footnote-1716215 -Node: Miscellaneous Programs716309 -Node: Dupword Program717522 -Node: Alarm Program719553 -Node: Translate Program724357 -Ref: Translate Program-Footnote-1728922 -Node: Labels Program729192 -Ref: Labels Program-Footnote-1732543 -Node: Word Sorting732627 -Node: History Sorting736698 -Node: Extract Program738534 -Node: Simple Sed746059 -Node: Igawk Program749127 -Ref: Igawk Program-Footnote-1763451 -Ref: Igawk Program-Footnote-2763652 -Ref: Igawk Program-Footnote-3763774 -Node: Anagram Program763889 -Node: Signature Program766946 -Node: Programs Summary768193 -Node: Programs Exercises769386 -Ref: Programs Exercises-Footnote-1773517 -Node: Advanced Features773608 -Node: Nondecimal Data775556 -Node: Array Sorting777146 -Node: Controlling Array Traversal777843 -Ref: Controlling Array Traversal-Footnote-1786176 -Node: Array Sorting Functions786294 -Ref: Array Sorting Functions-Footnote-1790183 -Node: Two-way I/O790379 -Ref: Two-way I/O-Footnote-1795324 -Ref: Two-way I/O-Footnote-2795510 -Node: TCP/IP Networking795592 -Node: Profiling798465 -Node: Advanced Features Summary806012 -Node: Internationalization807945 -Node: I18N and L10N809425 -Node: Explaining gettext810111 -Ref: Explaining gettext-Footnote-1815136 -Ref: Explaining gettext-Footnote-2815320 -Node: Programmer i18n815485 -Ref: Programmer i18n-Footnote-1820351 -Node: Translator i18n820400 -Node: String Extraction821194 -Ref: String Extraction-Footnote-1822325 -Node: Printf Ordering822411 -Ref: Printf Ordering-Footnote-1825197 -Node: I18N Portability825261 -Ref: I18N Portability-Footnote-1827716 -Node: I18N Example827779 -Ref: I18N Example-Footnote-1830582 -Node: Gawk I18N830654 -Node: I18N Summary831292 -Node: Debugger832631 -Node: Debugging833653 -Node: Debugging Concepts834094 -Node: Debugging Terms835947 -Node: Awk Debugging838519 -Node: Sample Debugging Session839413 -Node: Debugger Invocation839933 -Node: Finding The Bug841317 -Node: List of Debugger Commands847792 -Node: Breakpoint Control849125 -Node: Debugger Execution Control852821 -Node: Viewing And Changing Data856185 -Node: Execution Stack859563 -Node: Debugger Info861200 -Node: Miscellaneous Debugger Commands865217 -Node: Readline Support870246 -Node: Limitations871138 -Node: Debugging Summary873252 -Node: Arbitrary Precision Arithmetic874420 -Node: Computer Arithmetic875836 -Ref: table-numeric-ranges879434 -Ref: Computer Arithmetic-Footnote-1880293 -Node: Math Definitions880350 -Ref: table-ieee-formats883638 -Ref: Math Definitions-Footnote-1884242 -Node: MPFR features884347 -Node: FP Math Caution886018 -Ref: FP Math Caution-Footnote-1887068 -Node: Inexactness of computations887437 -Node: Inexact representation888396 -Node: Comparing FP Values889753 -Node: Errors accumulate890835 -Node: Getting Accuracy892268 -Node: Try To Round894930 -Node: Setting precision895829 -Ref: table-predefined-precision-strings896513 -Node: Setting the rounding mode898302 -Ref: table-gawk-rounding-modes898666 -Ref: Setting the rounding mode-Footnote-1902121 -Node: Arbitrary Precision Integers902300 -Ref: Arbitrary Precision Integers-Footnote-1905286 -Node: POSIX Floating Point Problems905435 -Ref: POSIX Floating Point Problems-Footnote-1909308 -Node: Floating point summary909346 -Node: Dynamic Extensions911540 -Node: Extension Intro913092 -Node: Plugin License914358 -Node: Extension Mechanism Outline915155 -Ref: figure-load-extension915583 -Ref: figure-register-new-function917063 -Ref: figure-call-new-function918067 -Node: Extension API Description920053 -Node: Extension API Functions Introduction921503 -Node: General Data Types926327 -Ref: General Data Types-Footnote-1932066 -Node: Memory Allocation Functions932365 -Ref: Memory Allocation Functions-Footnote-1935204 -Node: Constructor Functions935300 -Node: Registration Functions937034 -Node: Extension Functions937719 -Node: Exit Callback Functions940016 -Node: Extension Version String941264 -Node: Input Parsers941929 -Node: Output Wrappers951808 -Node: Two-way processors956323 -Node: Printing Messages958527 -Ref: Printing Messages-Footnote-1959603 -Node: Updating `ERRNO'959755 -Node: Requesting Values960495 -Ref: table-value-types-returned961223 -Node: Accessing Parameters962180 -Node: Symbol Table Access963411 -Node: Symbol table by name963925 -Node: Symbol table by cookie965906 -Ref: Symbol table by cookie-Footnote-1970050 -Node: Cached values970113 -Ref: Cached values-Footnote-1973612 -Node: Array Manipulation973703 -Ref: Array Manipulation-Footnote-1974801 -Node: Array Data Types974838 -Ref: Array Data Types-Footnote-1977493 -Node: Array Functions977585 -Node: Flattening Arrays981439 -Node: Creating Arrays988331 -Node: Extension API Variables993102 -Node: Extension Versioning993738 -Node: Extension API Informational Variables995639 -Node: Extension API Boilerplate996704 -Node: Finding Extensions1000513 -Node: Extension Example1001073 -Node: Internal File Description1001845 -Node: Internal File Ops1005912 -Ref: Internal File Ops-Footnote-11017582 -Node: Using Internal File Ops1017722 -Ref: Using Internal File Ops-Footnote-11020105 -Node: Extension Samples1020378 -Node: Extension Sample File Functions1021904 -Node: Extension Sample Fnmatch1029542 -Node: Extension Sample Fork1031033 -Node: Extension Sample Inplace1032248 -Node: Extension Sample Ord1033923 -Node: Extension Sample Readdir1034759 -Ref: table-readdir-file-types1035635 -Node: Extension Sample Revout1036446 -Node: Extension Sample Rev2way1037036 -Node: Extension Sample Read write array1037776 -Node: Extension Sample Readfile1039716 -Node: Extension Sample Time1040811 -Node: Extension Sample API Tests1042160 -Node: gawkextlib1042651 -Node: Extension summary1045309 -Node: Extension Exercises1048998 -Node: Language History1049720 -Node: V7/SVR3.11051376 -Node: SVR41053557 -Node: POSIX1055002 -Node: BTL1056391 -Node: POSIX/GNU1057125 -Node: Feature History1062689 -Node: Common Extensions1075787 -Node: Ranges and Locales1077111 -Ref: Ranges and Locales-Footnote-11081729 -Ref: Ranges and Locales-Footnote-21081756 -Ref: Ranges and Locales-Footnote-31081990 -Node: Contributors1082211 -Node: History summary1087752 -Node: Installation1089122 -Node: Gawk Distribution1090068 -Node: Getting1090552 -Node: Extracting1091375 -Node: Distribution contents1093010 -Node: Unix Installation1098727 -Node: Quick Installation1099344 -Node: Additional Configuration Options1101768 -Node: Configuration Philosophy1103506 -Node: Non-Unix Installation1105875 -Node: PC Installation1106333 -Node: PC Binary Installation1107652 -Node: PC Compiling1109500 -Ref: PC Compiling-Footnote-11112521 -Node: PC Testing1112630 -Node: PC Using1113806 -Node: Cygwin1117921 -Node: MSYS1118744 -Node: VMS Installation1119244 -Node: VMS Compilation1120036 -Ref: VMS Compilation-Footnote-11121258 -Node: VMS Dynamic Extensions1121316 -Node: VMS Installation Details1123000 -Node: VMS Running1125252 -Node: VMS GNV1128088 -Node: VMS Old Gawk1128822 -Node: Bugs1129292 -Node: Other Versions1133175 -Node: Installation summary1139603 -Node: Notes1140659 -Node: Compatibility Mode1141524 -Node: Additions1142306 -Node: Accessing The Source1143231 -Node: Adding Code1144667 -Node: New Ports1150832 -Node: Derived Files1155314 -Ref: Derived Files-Footnote-11160789 -Ref: Derived Files-Footnote-21160823 -Ref: Derived Files-Footnote-31161419 -Node: Future Extensions1161533 -Node: Implementation Limitations1162139 -Node: Extension Design1163387 -Node: Old Extension Problems1164541 -Ref: Old Extension Problems-Footnote-11166058 -Node: Extension New Mechanism Goals1166115 -Ref: Extension New Mechanism Goals-Footnote-11169475 -Node: Extension Other Design Decisions1169664 -Node: Extension Future Growth1171772 -Node: Old Extension Mechanism1172608 -Node: Notes summary1174370 -Node: Basic Concepts1175556 -Node: Basic High Level1176237 -Ref: figure-general-flow1176509 -Ref: figure-process-flow1177108 -Ref: Basic High Level-Footnote-11180337 -Node: Basic Data Typing1180522 -Node: Glossary1183850 -Node: Copying1209008 -Node: GNU Free Documentation License1246564 -Node: Index1271700 +Ref: Read Timeout-Footnote-1265037 +Node: Command-line directories265095 +Node: Input Summary266000 +Node: Input Exercises269301 +Node: Printing270029 +Node: Print271806 +Node: Print Examples273263 +Node: Output Separators276042 +Node: OFMT278060 +Node: Printf279414 +Node: Basic Printf280199 +Node: Control Letters281769 +Node: Format Modifiers285752 +Node: Printf Examples291761 +Node: Redirection294247 +Node: Special FD301088 +Ref: Special FD-Footnote-1304248 +Node: Special Files304322 +Node: Other Inherited Files304939 +Node: Special Network305939 +Node: Special Caveats306801 +Node: Close Files And Pipes307752 +Ref: Close Files And Pipes-Footnote-1314934 +Ref: Close Files And Pipes-Footnote-2315082 +Node: Output Summary315232 +Node: Output Exercises316230 +Node: Expressions316910 +Node: Values318095 +Node: Constants318773 +Node: Scalar Constants319464 +Ref: Scalar Constants-Footnote-1320323 +Node: Nondecimal-numbers320573 +Node: Regexp Constants323591 +Node: Using Constant Regexps324116 +Node: Variables327259 +Node: Using Variables327914 +Node: Assignment Options329825 +Node: Conversion331700 +Node: Strings And Numbers332224 +Ref: Strings And Numbers-Footnote-1335289 +Node: Locale influences conversions335398 +Ref: table-locale-affects338145 +Node: All Operators338733 +Node: Arithmetic Ops339363 +Node: Concatenation341868 +Ref: Concatenation-Footnote-1344687 +Node: Assignment Ops344793 +Ref: table-assign-ops349772 +Node: Increment Ops351044 +Node: Truth Values and Conditions354482 +Node: Truth Values355567 +Node: Typing and Comparison356616 +Node: Variable Typing357426 +Node: Comparison Operators361079 +Ref: table-relational-ops361489 +Node: POSIX String Comparison364984 +Ref: POSIX String Comparison-Footnote-1366056 +Node: Boolean Ops366194 +Ref: Boolean Ops-Footnote-1370673 +Node: Conditional Exp370764 +Node: Function Calls372491 +Node: Precedence376371 +Node: Locales380032 +Node: Expressions Summary381664 +Node: Patterns and Actions384224 +Node: Pattern Overview385344 +Node: Regexp Patterns387023 +Node: Expression Patterns387566 +Node: Ranges391276 +Node: BEGIN/END394382 +Node: Using BEGIN/END395143 +Ref: Using BEGIN/END-Footnote-1397877 +Node: I/O And BEGIN/END397983 +Node: BEGINFILE/ENDFILE400297 +Node: Empty403198 +Node: Using Shell Variables403515 +Node: Action Overview405788 +Node: Statements408114 +Node: If Statement409962 +Node: While Statement411457 +Node: Do Statement413486 +Node: For Statement414630 +Node: Switch Statement417787 +Node: Break Statement420169 +Node: Continue Statement422210 +Node: Next Statement424037 +Node: Nextfile Statement426418 +Node: Exit Statement429048 +Node: Built-in Variables431451 +Node: User-modified432584 +Ref: User-modified-Footnote-1440265 +Node: Auto-set440327 +Ref: Auto-set-Footnote-1453362 +Ref: Auto-set-Footnote-2453567 +Node: ARGC and ARGV453623 +Node: Pattern Action Summary457841 +Node: Arrays460268 +Node: Array Basics461597 +Node: Array Intro462441 +Ref: figure-array-elements464405 +Ref: Array Intro-Footnote-1466931 +Node: Reference to Elements467059 +Node: Assigning Elements469511 +Node: Array Example470002 +Node: Scanning an Array471760 +Node: Controlling Scanning474776 +Ref: Controlling Scanning-Footnote-1479972 +Node: Numeric Array Subscripts480288 +Node: Uninitialized Subscripts482473 +Node: Delete484090 +Ref: Delete-Footnote-1486833 +Node: Multidimensional486890 +Node: Multiscanning489987 +Node: Arrays of Arrays491576 +Node: Arrays Summary496335 +Node: Functions498427 +Node: Built-in499326 +Node: Calling Built-in500404 +Node: Numeric Functions502395 +Ref: Numeric Functions-Footnote-1506412 +Ref: Numeric Functions-Footnote-2506769 +Ref: Numeric Functions-Footnote-3506817 +Node: String Functions507089 +Ref: String Functions-Footnote-1530564 +Ref: String Functions-Footnote-2530693 +Ref: String Functions-Footnote-3530941 +Node: Gory Details531028 +Ref: table-sub-escapes532809 +Ref: table-sub-proposed534329 +Ref: table-posix-sub535693 +Ref: table-gensub-escapes537229 +Ref: Gory Details-Footnote-1538061 +Node: I/O Functions538212 +Ref: I/O Functions-Footnote-1545430 +Node: Time Functions545577 +Ref: Time Functions-Footnote-1556065 +Ref: Time Functions-Footnote-2556133 +Ref: Time Functions-Footnote-3556291 +Ref: Time Functions-Footnote-4556402 +Ref: Time Functions-Footnote-5556514 +Ref: Time Functions-Footnote-6556741 +Node: Bitwise Functions557007 +Ref: table-bitwise-ops557569 +Ref: Bitwise Functions-Footnote-1561878 +Node: Type Functions562047 +Node: I18N Functions563198 +Node: User-defined564843 +Node: Definition Syntax565648 +Ref: Definition Syntax-Footnote-1571055 +Node: Function Example571126 +Ref: Function Example-Footnote-1574045 +Node: Function Caveats574067 +Node: Calling A Function574585 +Node: Variable Scope575543 +Node: Pass By Value/Reference578531 +Node: Return Statement582026 +Node: Dynamic Typing585007 +Node: Indirect Calls585936 +Ref: Indirect Calls-Footnote-1597238 +Node: Functions Summary597366 +Node: Library Functions600068 +Ref: Library Functions-Footnote-1603677 +Ref: Library Functions-Footnote-2603820 +Node: Library Names603991 +Ref: Library Names-Footnote-1607445 +Ref: Library Names-Footnote-2607668 +Node: General Functions607754 +Node: Strtonum Function608857 +Node: Assert Function611879 +Node: Round Function615203 +Node: Cliff Random Function616744 +Node: Ordinal Functions617760 +Ref: Ordinal Functions-Footnote-1620823 +Ref: Ordinal Functions-Footnote-2621075 +Node: Join Function621286 +Ref: Join Function-Footnote-1623055 +Node: Getlocaltime Function623255 +Node: Readfile Function626999 +Node: Shell Quoting628969 +Node: Data File Management630370 +Node: Filetrans Function631002 +Node: Rewind Function635058 +Node: File Checking636445 +Ref: File Checking-Footnote-1637777 +Node: Empty Files637978 +Node: Ignoring Assigns639957 +Node: Getopt Function641508 +Ref: Getopt Function-Footnote-1652970 +Node: Passwd Functions653170 +Ref: Passwd Functions-Footnote-1662007 +Node: Group Functions662095 +Ref: Group Functions-Footnote-1669989 +Node: Walking Arrays670202 +Node: Library Functions Summary671805 +Node: Library Exercises673206 +Node: Sample Programs674486 +Node: Running Examples675256 +Node: Clones675984 +Node: Cut Program677208 +Node: Egrep Program686927 +Ref: Egrep Program-Footnote-1694425 +Node: Id Program694535 +Node: Split Program698180 +Ref: Split Program-Footnote-1701628 +Node: Tee Program701756 +Node: Uniq Program704545 +Node: Wc Program711964 +Ref: Wc Program-Footnote-1716214 +Node: Miscellaneous Programs716308 +Node: Dupword Program717521 +Node: Alarm Program719552 +Node: Translate Program724356 +Ref: Translate Program-Footnote-1728921 +Node: Labels Program729191 +Ref: Labels Program-Footnote-1732542 +Node: Word Sorting732626 +Node: History Sorting736697 +Node: Extract Program738533 +Node: Simple Sed746058 +Node: Igawk Program749126 +Ref: Igawk Program-Footnote-1763450 +Ref: Igawk Program-Footnote-2763651 +Ref: Igawk Program-Footnote-3763773 +Node: Anagram Program763888 +Node: Signature Program766945 +Node: Programs Summary768192 +Node: Programs Exercises769385 +Ref: Programs Exercises-Footnote-1773516 +Node: Advanced Features773607 +Node: Nondecimal Data775555 +Node: Array Sorting777145 +Node: Controlling Array Traversal777842 +Ref: Controlling Array Traversal-Footnote-1786175 +Node: Array Sorting Functions786293 +Ref: Array Sorting Functions-Footnote-1790182 +Node: Two-way I/O790378 +Ref: Two-way I/O-Footnote-1795323 +Ref: Two-way I/O-Footnote-2795509 +Node: TCP/IP Networking795591 +Node: Profiling798464 +Node: Advanced Features Summary806011 +Node: Internationalization807944 +Node: I18N and L10N809424 +Node: Explaining gettext810110 +Ref: Explaining gettext-Footnote-1815135 +Ref: Explaining gettext-Footnote-2815319 +Node: Programmer i18n815484 +Ref: Programmer i18n-Footnote-1820350 +Node: Translator i18n820399 +Node: String Extraction821193 +Ref: String Extraction-Footnote-1822324 +Node: Printf Ordering822410 +Ref: Printf Ordering-Footnote-1825196 +Node: I18N Portability825260 +Ref: I18N Portability-Footnote-1827715 +Node: I18N Example827778 +Ref: I18N Example-Footnote-1830581 +Node: Gawk I18N830653 +Node: I18N Summary831291 +Node: Debugger832630 +Node: Debugging833652 +Node: Debugging Concepts834093 +Node: Debugging Terms835946 +Node: Awk Debugging838518 +Node: Sample Debugging Session839412 +Node: Debugger Invocation839932 +Node: Finding The Bug841316 +Node: List of Debugger Commands847791 +Node: Breakpoint Control849124 +Node: Debugger Execution Control852820 +Node: Viewing And Changing Data856184 +Node: Execution Stack859562 +Node: Debugger Info861199 +Node: Miscellaneous Debugger Commands865216 +Node: Readline Support870245 +Node: Limitations871137 +Node: Debugging Summary873251 +Node: Arbitrary Precision Arithmetic874419 +Node: Computer Arithmetic875835 +Ref: table-numeric-ranges879433 +Ref: Computer Arithmetic-Footnote-1880292 +Node: Math Definitions880349 +Ref: table-ieee-formats883637 +Ref: Math Definitions-Footnote-1884241 +Node: MPFR features884346 +Node: FP Math Caution886017 +Ref: FP Math Caution-Footnote-1887067 +Node: Inexactness of computations887436 +Node: Inexact representation888395 +Node: Comparing FP Values889752 +Node: Errors accumulate890834 +Node: Getting Accuracy892267 +Node: Try To Round894929 +Node: Setting precision895828 +Ref: table-predefined-precision-strings896512 +Node: Setting the rounding mode898301 +Ref: table-gawk-rounding-modes898665 +Ref: Setting the rounding mode-Footnote-1902120 +Node: Arbitrary Precision Integers902299 +Ref: Arbitrary Precision Integers-Footnote-1905285 +Node: POSIX Floating Point Problems905434 +Ref: POSIX Floating Point Problems-Footnote-1909307 +Node: Floating point summary909345 +Node: Dynamic Extensions911539 +Node: Extension Intro913091 +Node: Plugin License914357 +Node: Extension Mechanism Outline915154 +Ref: figure-load-extension915582 +Ref: figure-register-new-function917062 +Ref: figure-call-new-function918066 +Node: Extension API Description920052 +Node: Extension API Functions Introduction921502 +Node: General Data Types926326 +Ref: General Data Types-Footnote-1932065 +Node: Memory Allocation Functions932364 +Ref: Memory Allocation Functions-Footnote-1935203 +Node: Constructor Functions935299 +Node: Registration Functions937033 +Node: Extension Functions937718 +Node: Exit Callback Functions940015 +Node: Extension Version String941263 +Node: Input Parsers941928 +Node: Output Wrappers951807 +Node: Two-way processors956322 +Node: Printing Messages958526 +Ref: Printing Messages-Footnote-1959602 +Node: Updating `ERRNO'959754 +Node: Requesting Values960494 +Ref: table-value-types-returned961222 +Node: Accessing Parameters962179 +Node: Symbol Table Access963410 +Node: Symbol table by name963924 +Node: Symbol table by cookie965905 +Ref: Symbol table by cookie-Footnote-1970049 +Node: Cached values970112 +Ref: Cached values-Footnote-1973611 +Node: Array Manipulation973702 +Ref: Array Manipulation-Footnote-1974800 +Node: Array Data Types974837 +Ref: Array Data Types-Footnote-1977492 +Node: Array Functions977584 +Node: Flattening Arrays981438 +Node: Creating Arrays988330 +Node: Extension API Variables993101 +Node: Extension Versioning993737 +Node: Extension API Informational Variables995638 +Node: Extension API Boilerplate996703 +Node: Finding Extensions1000512 +Node: Extension Example1001072 +Node: Internal File Description1001844 +Node: Internal File Ops1005911 +Ref: Internal File Ops-Footnote-11017581 +Node: Using Internal File Ops1017721 +Ref: Using Internal File Ops-Footnote-11020104 +Node: Extension Samples1020377 +Node: Extension Sample File Functions1021903 +Node: Extension Sample Fnmatch1029541 +Node: Extension Sample Fork1031032 +Node: Extension Sample Inplace1032247 +Node: Extension Sample Ord1033922 +Node: Extension Sample Readdir1034758 +Ref: table-readdir-file-types1035634 +Node: Extension Sample Revout1036445 +Node: Extension Sample Rev2way1037035 +Node: Extension Sample Read write array1037775 +Node: Extension Sample Readfile1039715 +Node: Extension Sample Time1040810 +Node: Extension Sample API Tests1042159 +Node: gawkextlib1042650 +Node: Extension summary1045308 +Node: Extension Exercises1048997 +Node: Language History1049719 +Node: V7/SVR3.11051375 +Node: SVR41053556 +Node: POSIX1055001 +Node: BTL1056390 +Node: POSIX/GNU1057124 +Node: Feature History1062688 +Node: Common Extensions1075786 +Node: Ranges and Locales1077110 +Ref: Ranges and Locales-Footnote-11081728 +Ref: Ranges and Locales-Footnote-21081755 +Ref: Ranges and Locales-Footnote-31081989 +Node: Contributors1082210 +Node: History summary1087751 +Node: Installation1089121 +Node: Gawk Distribution1090067 +Node: Getting1090551 +Node: Extracting1091374 +Node: Distribution contents1093009 +Node: Unix Installation1098726 +Node: Quick Installation1099343 +Node: Additional Configuration Options1101767 +Node: Configuration Philosophy1103505 +Node: Non-Unix Installation1105874 +Node: PC Installation1106332 +Node: PC Binary Installation1107651 +Node: PC Compiling1109499 +Ref: PC Compiling-Footnote-11112520 +Node: PC Testing1112629 +Node: PC Using1113805 +Node: Cygwin1117920 +Node: MSYS1118743 +Node: VMS Installation1119243 +Node: VMS Compilation1120035 +Ref: VMS Compilation-Footnote-11121257 +Node: VMS Dynamic Extensions1121315 +Node: VMS Installation Details1122999 +Node: VMS Running1125251 +Node: VMS GNV1128087 +Node: VMS Old Gawk1128821 +Node: Bugs1129291 +Node: Other Versions1133174 +Node: Installation summary1139602 +Node: Notes1140658 +Node: Compatibility Mode1141523 +Node: Additions1142305 +Node: Accessing The Source1143230 +Node: Adding Code1144666 +Node: New Ports1150831 +Node: Derived Files1155313 +Ref: Derived Files-Footnote-11160788 +Ref: Derived Files-Footnote-21160822 +Ref: Derived Files-Footnote-31161418 +Node: Future Extensions1161532 +Node: Implementation Limitations1162138 +Node: Extension Design1163386 +Node: Old Extension Problems1164540 +Ref: Old Extension Problems-Footnote-11166057 +Node: Extension New Mechanism Goals1166114 +Ref: Extension New Mechanism Goals-Footnote-11169474 +Node: Extension Other Design Decisions1169663 +Node: Extension Future Growth1171771 +Node: Old Extension Mechanism1172607 +Node: Notes summary1174369 +Node: Basic Concepts1175555 +Node: Basic High Level1176236 +Ref: figure-general-flow1176508 +Ref: figure-process-flow1177107 +Ref: Basic High Level-Footnote-11180336 +Node: Basic Data Typing1180521 +Node: Glossary1183849 +Node: Copying1209007 +Node: GNU Free Documentation License1246563 +Node: Index1271699  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index c0c672f1..afb94551 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -8754,7 +8754,7 @@ loop that reads input records and matches them against patterns, like so: @example -$ @kbd{ gawk 'BEGIN @{ PROCINFO["-", "READ_TIMEOUT"] = 5000 @}} +$ @kbd{gawk 'BEGIN @{ PROCINFO["-", "READ_TIMEOUT"] = 5000 @}} > @kbd{@{ print "You entered: " $0 @}'} @kbd{gawk} @print{} You entered: gawk diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 5cff1e5f..b346e219 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -8355,7 +8355,7 @@ loop that reads input records and matches them against patterns, like so: @example -$ @kbd{ gawk 'BEGIN @{ PROCINFO["-", "READ_TIMEOUT"] = 5000 @}} +$ @kbd{gawk 'BEGIN @{ PROCINFO["-", "READ_TIMEOUT"] = 5000 @}} > @kbd{@{ print "You entered: " $0 @}'} @kbd{gawk} @print{} You entered: gawk -- cgit v1.2.3 From 1b2704c322317629cef59d247e45b3dba3c21992 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 21 Jan 2015 08:44:37 +0200 Subject: More O'Reilly fixes. --- doc/ChangeLog | 4 + doc/gawk.info | 1161 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 104 ++--- doc/gawktexi.in | 104 ++--- 4 files changed, 695 insertions(+), 678 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f6c1eaf0..63f6cd02 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-01-21 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-01-20 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index b81c0700..de004225 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -2277,9 +2277,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 @@ -2344,7 +2345,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 @@ -2411,8 +2412,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. @@ -2427,10 +2428,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' @@ -2471,7 +2472,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 @@ -2479,7 +2480,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' @@ -2514,7 +2515,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 @@ -2549,23 +2550,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. @@ -2627,15 +2628,15 @@ 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 the `-o' and FILE, if FILE is supplied. NOTE: Due to the way `gawk' has evolved, with this option - your program is still executed. This will change in the next - major release such that `gawk' will only pretty-print the + your program still executes. This will change in the next + major release, such that `gawk' will only pretty-print the program and not run it. `-O' @@ -2735,7 +2736,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. @@ -2894,7 +2895,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 @@ -2927,9 +2928,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 @@ -3035,7 +3036,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 @@ -3482,7 +3483,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 @@ -3544,7 +3545,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. @@ -3627,7 +3628,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 @@ -3658,10 +3659,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 @@ -3763,7 +3764,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 @@ -20564,8 +20565,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. @@ -21922,7 +21923,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 @@ -28270,7 +28271,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'. @@ -28502,7 +28503,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 @@ -34333,525 +34334,525 @@ Node: More Complex102449 Node: Statements/Lines105311 Ref: Statements/Lines-Footnote-1109766 Node: Other Features110031 -Node: When110962 -Ref: When-Footnote-1112716 -Node: Intro Summary112781 -Node: Invoking Gawk113664 -Node: Command Line115178 -Node: Options115976 -Ref: Options-Footnote-1131909 -Ref: Options-Footnote-2132138 -Node: Other Arguments132163 -Node: Naming Standard Input135111 -Node: Environment Variables136204 -Node: AWKPATH Variable136762 -Ref: AWKPATH Variable-Footnote-1140065 -Ref: AWKPATH Variable-Footnote-2140110 -Node: AWKLIBPATH Variable140370 -Node: Other Environment Variables141513 -Node: Exit Status145241 -Node: Include Files145917 -Node: Loading Shared Libraries149514 -Node: Obsolete150941 -Node: Undocumented151638 -Node: Invoking Summary151905 -Node: Regexp153569 -Node: Regexp Usage155023 -Node: Escape Sequences157060 -Node: Regexp Operators163071 -Ref: Regexp Operators-Footnote-1170497 -Ref: Regexp Operators-Footnote-2170644 -Node: Bracket Expressions170742 -Ref: table-char-classes172757 -Node: Leftmost Longest175681 -Node: Computed Regexps176983 -Node: GNU Regexp Operators180380 -Node: Case-sensitivity184053 -Ref: Case-sensitivity-Footnote-1186938 -Ref: Case-sensitivity-Footnote-2187173 -Node: Regexp Summary187281 -Node: Reading Files188748 -Node: Records190842 -Node: awk split records191575 -Node: gawk split records196490 -Ref: gawk split records-Footnote-1201034 -Node: Fields201071 -Ref: Fields-Footnote-1203847 -Node: Nonconstant Fields203933 -Ref: Nonconstant Fields-Footnote-1206176 -Node: Changing Fields206380 -Node: Field Separators212309 -Node: Default Field Splitting215014 -Node: Regexp Field Splitting216131 -Node: Single Character Fields219481 -Node: Command Line Field Separator220540 -Node: Full Line Fields223752 -Ref: Full Line Fields-Footnote-1225269 -Ref: Full Line Fields-Footnote-2225315 -Node: Field Splitting Summary225416 -Node: Constant Size227490 -Node: Splitting By Content232079 -Ref: Splitting By Content-Footnote-1236073 -Node: Multiple Line236236 -Ref: Multiple Line-Footnote-1242122 -Node: Getline242301 -Node: Plain Getline244513 -Node: Getline/Variable247153 -Node: Getline/File248301 -Node: Getline/Variable/File249685 -Ref: Getline/Variable/File-Footnote-1251288 -Node: Getline/Pipe251375 -Node: Getline/Variable/Pipe254058 -Node: Getline/Coprocess255189 -Node: Getline/Variable/Coprocess256441 -Node: Getline Notes257180 -Node: Getline Summary259972 -Ref: table-getline-variants260384 -Node: Read Timeout261213 -Ref: Read Timeout-Footnote-1265037 -Node: Command-line directories265095 -Node: Input Summary266000 -Node: Input Exercises269301 -Node: Printing270029 -Node: Print271806 -Node: Print Examples273263 -Node: Output Separators276042 -Node: OFMT278060 -Node: Printf279414 -Node: Basic Printf280199 -Node: Control Letters281769 -Node: Format Modifiers285752 -Node: Printf Examples291761 -Node: Redirection294247 -Node: Special FD301088 -Ref: Special FD-Footnote-1304248 -Node: Special Files304322 -Node: Other Inherited Files304939 -Node: Special Network305939 -Node: Special Caveats306801 -Node: Close Files And Pipes307752 -Ref: Close Files And Pipes-Footnote-1314934 -Ref: Close Files And Pipes-Footnote-2315082 -Node: Output Summary315232 -Node: Output Exercises316230 -Node: Expressions316910 -Node: Values318095 -Node: Constants318773 -Node: Scalar Constants319464 -Ref: Scalar Constants-Footnote-1320323 -Node: Nondecimal-numbers320573 -Node: Regexp Constants323591 -Node: Using Constant Regexps324116 -Node: Variables327259 -Node: Using Variables327914 -Node: Assignment Options329825 -Node: Conversion331700 -Node: Strings And Numbers332224 -Ref: Strings And Numbers-Footnote-1335289 -Node: Locale influences conversions335398 -Ref: table-locale-affects338145 -Node: All Operators338733 -Node: Arithmetic Ops339363 -Node: Concatenation341868 -Ref: Concatenation-Footnote-1344687 -Node: Assignment Ops344793 -Ref: table-assign-ops349772 -Node: Increment Ops351044 -Node: Truth Values and Conditions354482 -Node: Truth Values355567 -Node: Typing and Comparison356616 -Node: Variable Typing357426 -Node: Comparison Operators361079 -Ref: table-relational-ops361489 -Node: POSIX String Comparison364984 -Ref: POSIX String Comparison-Footnote-1366056 -Node: Boolean Ops366194 -Ref: Boolean Ops-Footnote-1370673 -Node: Conditional Exp370764 -Node: Function Calls372491 -Node: Precedence376371 -Node: Locales380032 -Node: Expressions Summary381664 -Node: Patterns and Actions384224 -Node: Pattern Overview385344 -Node: Regexp Patterns387023 -Node: Expression Patterns387566 -Node: Ranges391276 -Node: BEGIN/END394382 -Node: Using BEGIN/END395143 -Ref: Using BEGIN/END-Footnote-1397877 -Node: I/O And BEGIN/END397983 -Node: BEGINFILE/ENDFILE400297 -Node: Empty403198 -Node: Using Shell Variables403515 -Node: Action Overview405788 -Node: Statements408114 -Node: If Statement409962 -Node: While Statement411457 -Node: Do Statement413486 -Node: For Statement414630 -Node: Switch Statement417787 -Node: Break Statement420169 -Node: Continue Statement422210 -Node: Next Statement424037 -Node: Nextfile Statement426418 -Node: Exit Statement429048 -Node: Built-in Variables431451 -Node: User-modified432584 -Ref: User-modified-Footnote-1440265 -Node: Auto-set440327 -Ref: Auto-set-Footnote-1453362 -Ref: Auto-set-Footnote-2453567 -Node: ARGC and ARGV453623 -Node: Pattern Action Summary457841 -Node: Arrays460268 -Node: Array Basics461597 -Node: Array Intro462441 -Ref: figure-array-elements464405 -Ref: Array Intro-Footnote-1466931 -Node: Reference to Elements467059 -Node: Assigning Elements469511 -Node: Array Example470002 -Node: Scanning an Array471760 -Node: Controlling Scanning474776 -Ref: Controlling Scanning-Footnote-1479972 -Node: Numeric Array Subscripts480288 -Node: Uninitialized Subscripts482473 -Node: Delete484090 -Ref: Delete-Footnote-1486833 -Node: Multidimensional486890 -Node: Multiscanning489987 -Node: Arrays of Arrays491576 -Node: Arrays Summary496335 -Node: Functions498427 -Node: Built-in499326 -Node: Calling Built-in500404 -Node: Numeric Functions502395 -Ref: Numeric Functions-Footnote-1506412 -Ref: Numeric Functions-Footnote-2506769 -Ref: Numeric Functions-Footnote-3506817 -Node: String Functions507089 -Ref: String Functions-Footnote-1530564 -Ref: String Functions-Footnote-2530693 -Ref: String Functions-Footnote-3530941 -Node: Gory Details531028 -Ref: table-sub-escapes532809 -Ref: table-sub-proposed534329 -Ref: table-posix-sub535693 -Ref: table-gensub-escapes537229 -Ref: Gory Details-Footnote-1538061 -Node: I/O Functions538212 -Ref: I/O Functions-Footnote-1545430 -Node: Time Functions545577 -Ref: Time Functions-Footnote-1556065 -Ref: Time Functions-Footnote-2556133 -Ref: Time Functions-Footnote-3556291 -Ref: Time Functions-Footnote-4556402 -Ref: Time Functions-Footnote-5556514 -Ref: Time Functions-Footnote-6556741 -Node: Bitwise Functions557007 -Ref: table-bitwise-ops557569 -Ref: Bitwise Functions-Footnote-1561878 -Node: Type Functions562047 -Node: I18N Functions563198 -Node: User-defined564843 -Node: Definition Syntax565648 -Ref: Definition Syntax-Footnote-1571055 -Node: Function Example571126 -Ref: Function Example-Footnote-1574045 -Node: Function Caveats574067 -Node: Calling A Function574585 -Node: Variable Scope575543 -Node: Pass By Value/Reference578531 -Node: Return Statement582026 -Node: Dynamic Typing585007 -Node: Indirect Calls585936 -Ref: Indirect Calls-Footnote-1597238 -Node: Functions Summary597366 -Node: Library Functions600068 -Ref: Library Functions-Footnote-1603677 -Ref: Library Functions-Footnote-2603820 -Node: Library Names603991 -Ref: Library Names-Footnote-1607445 -Ref: Library Names-Footnote-2607668 -Node: General Functions607754 -Node: Strtonum Function608857 -Node: Assert Function611879 -Node: Round Function615203 -Node: Cliff Random Function616744 -Node: Ordinal Functions617760 -Ref: Ordinal Functions-Footnote-1620823 -Ref: Ordinal Functions-Footnote-2621075 -Node: Join Function621286 -Ref: Join Function-Footnote-1623055 -Node: Getlocaltime Function623255 -Node: Readfile Function626999 -Node: Shell Quoting628969 -Node: Data File Management630370 -Node: Filetrans Function631002 -Node: Rewind Function635058 -Node: File Checking636445 -Ref: File Checking-Footnote-1637777 -Node: Empty Files637978 -Node: Ignoring Assigns639957 -Node: Getopt Function641508 -Ref: Getopt Function-Footnote-1652970 -Node: Passwd Functions653170 -Ref: Passwd Functions-Footnote-1662007 -Node: Group Functions662095 -Ref: Group Functions-Footnote-1669989 -Node: Walking Arrays670202 -Node: Library Functions Summary671805 -Node: Library Exercises673206 -Node: Sample Programs674486 -Node: Running Examples675256 -Node: Clones675984 -Node: Cut Program677208 -Node: Egrep Program686927 -Ref: Egrep Program-Footnote-1694425 -Node: Id Program694535 -Node: Split Program698180 -Ref: Split Program-Footnote-1701628 -Node: Tee Program701756 -Node: Uniq Program704545 -Node: Wc Program711964 -Ref: Wc Program-Footnote-1716214 -Node: Miscellaneous Programs716308 -Node: Dupword Program717521 -Node: Alarm Program719552 -Node: Translate Program724356 -Ref: Translate Program-Footnote-1728921 -Node: Labels Program729191 -Ref: Labels Program-Footnote-1732542 -Node: Word Sorting732626 -Node: History Sorting736697 -Node: Extract Program738533 -Node: Simple Sed746058 -Node: Igawk Program749126 -Ref: Igawk Program-Footnote-1763450 -Ref: Igawk Program-Footnote-2763651 -Ref: Igawk Program-Footnote-3763773 -Node: Anagram Program763888 -Node: Signature Program766945 -Node: Programs Summary768192 -Node: Programs Exercises769385 -Ref: Programs Exercises-Footnote-1773516 -Node: Advanced Features773607 -Node: Nondecimal Data775555 -Node: Array Sorting777145 -Node: Controlling Array Traversal777842 -Ref: Controlling Array Traversal-Footnote-1786175 -Node: Array Sorting Functions786293 -Ref: Array Sorting Functions-Footnote-1790182 -Node: Two-way I/O790378 -Ref: Two-way I/O-Footnote-1795323 -Ref: Two-way I/O-Footnote-2795509 -Node: TCP/IP Networking795591 -Node: Profiling798464 -Node: Advanced Features Summary806011 -Node: Internationalization807944 -Node: I18N and L10N809424 -Node: Explaining gettext810110 -Ref: Explaining gettext-Footnote-1815135 -Ref: Explaining gettext-Footnote-2815319 -Node: Programmer i18n815484 -Ref: Programmer i18n-Footnote-1820350 -Node: Translator i18n820399 -Node: String Extraction821193 -Ref: String Extraction-Footnote-1822324 -Node: Printf Ordering822410 -Ref: Printf Ordering-Footnote-1825196 -Node: I18N Portability825260 -Ref: I18N Portability-Footnote-1827715 -Node: I18N Example827778 -Ref: I18N Example-Footnote-1830581 -Node: Gawk I18N830653 -Node: I18N Summary831291 -Node: Debugger832630 -Node: Debugging833652 -Node: Debugging Concepts834093 -Node: Debugging Terms835946 -Node: Awk Debugging838518 -Node: Sample Debugging Session839412 -Node: Debugger Invocation839932 -Node: Finding The Bug841316 -Node: List of Debugger Commands847791 -Node: Breakpoint Control849124 -Node: Debugger Execution Control852820 -Node: Viewing And Changing Data856184 -Node: Execution Stack859562 -Node: Debugger Info861199 -Node: Miscellaneous Debugger Commands865216 -Node: Readline Support870245 -Node: Limitations871137 -Node: Debugging Summary873251 -Node: Arbitrary Precision Arithmetic874419 -Node: Computer Arithmetic875835 -Ref: table-numeric-ranges879433 -Ref: Computer Arithmetic-Footnote-1880292 -Node: Math Definitions880349 -Ref: table-ieee-formats883637 -Ref: Math Definitions-Footnote-1884241 -Node: MPFR features884346 -Node: FP Math Caution886017 -Ref: FP Math Caution-Footnote-1887067 -Node: Inexactness of computations887436 -Node: Inexact representation888395 -Node: Comparing FP Values889752 -Node: Errors accumulate890834 -Node: Getting Accuracy892267 -Node: Try To Round894929 -Node: Setting precision895828 -Ref: table-predefined-precision-strings896512 -Node: Setting the rounding mode898301 -Ref: table-gawk-rounding-modes898665 -Ref: Setting the rounding mode-Footnote-1902120 -Node: Arbitrary Precision Integers902299 -Ref: Arbitrary Precision Integers-Footnote-1905285 -Node: POSIX Floating Point Problems905434 -Ref: POSIX Floating Point Problems-Footnote-1909307 -Node: Floating point summary909345 -Node: Dynamic Extensions911539 -Node: Extension Intro913091 -Node: Plugin License914357 -Node: Extension Mechanism Outline915154 -Ref: figure-load-extension915582 -Ref: figure-register-new-function917062 -Ref: figure-call-new-function918066 -Node: Extension API Description920052 -Node: Extension API Functions Introduction921502 -Node: General Data Types926326 -Ref: General Data Types-Footnote-1932065 -Node: Memory Allocation Functions932364 -Ref: Memory Allocation Functions-Footnote-1935203 -Node: Constructor Functions935299 -Node: Registration Functions937033 -Node: Extension Functions937718 -Node: Exit Callback Functions940015 -Node: Extension Version String941263 -Node: Input Parsers941928 -Node: Output Wrappers951807 -Node: Two-way processors956322 -Node: Printing Messages958526 -Ref: Printing Messages-Footnote-1959602 -Node: Updating `ERRNO'959754 -Node: Requesting Values960494 -Ref: table-value-types-returned961222 -Node: Accessing Parameters962179 -Node: Symbol Table Access963410 -Node: Symbol table by name963924 -Node: Symbol table by cookie965905 -Ref: Symbol table by cookie-Footnote-1970049 -Node: Cached values970112 -Ref: Cached values-Footnote-1973611 -Node: Array Manipulation973702 -Ref: Array Manipulation-Footnote-1974800 -Node: Array Data Types974837 -Ref: Array Data Types-Footnote-1977492 -Node: Array Functions977584 -Node: Flattening Arrays981438 -Node: Creating Arrays988330 -Node: Extension API Variables993101 -Node: Extension Versioning993737 -Node: Extension API Informational Variables995638 -Node: Extension API Boilerplate996703 -Node: Finding Extensions1000512 -Node: Extension Example1001072 -Node: Internal File Description1001844 -Node: Internal File Ops1005911 -Ref: Internal File Ops-Footnote-11017581 -Node: Using Internal File Ops1017721 -Ref: Using Internal File Ops-Footnote-11020104 -Node: Extension Samples1020377 -Node: Extension Sample File Functions1021903 -Node: Extension Sample Fnmatch1029541 -Node: Extension Sample Fork1031032 -Node: Extension Sample Inplace1032247 -Node: Extension Sample Ord1033922 -Node: Extension Sample Readdir1034758 -Ref: table-readdir-file-types1035634 -Node: Extension Sample Revout1036445 -Node: Extension Sample Rev2way1037035 -Node: Extension Sample Read write array1037775 -Node: Extension Sample Readfile1039715 -Node: Extension Sample Time1040810 -Node: Extension Sample API Tests1042159 -Node: gawkextlib1042650 -Node: Extension summary1045308 -Node: Extension Exercises1048997 -Node: Language History1049719 -Node: V7/SVR3.11051375 -Node: SVR41053556 -Node: POSIX1055001 -Node: BTL1056390 -Node: POSIX/GNU1057124 -Node: Feature History1062688 -Node: Common Extensions1075786 -Node: Ranges and Locales1077110 -Ref: Ranges and Locales-Footnote-11081728 -Ref: Ranges and Locales-Footnote-21081755 -Ref: Ranges and Locales-Footnote-31081989 -Node: Contributors1082210 -Node: History summary1087751 -Node: Installation1089121 -Node: Gawk Distribution1090067 -Node: Getting1090551 -Node: Extracting1091374 -Node: Distribution contents1093009 -Node: Unix Installation1098726 -Node: Quick Installation1099343 -Node: Additional Configuration Options1101767 -Node: Configuration Philosophy1103505 -Node: Non-Unix Installation1105874 -Node: PC Installation1106332 -Node: PC Binary Installation1107651 -Node: PC Compiling1109499 -Ref: PC Compiling-Footnote-11112520 -Node: PC Testing1112629 -Node: PC Using1113805 -Node: Cygwin1117920 -Node: MSYS1118743 -Node: VMS Installation1119243 -Node: VMS Compilation1120035 -Ref: VMS Compilation-Footnote-11121257 -Node: VMS Dynamic Extensions1121315 -Node: VMS Installation Details1122999 -Node: VMS Running1125251 -Node: VMS GNV1128087 -Node: VMS Old Gawk1128821 -Node: Bugs1129291 -Node: Other Versions1133174 -Node: Installation summary1139602 -Node: Notes1140658 -Node: Compatibility Mode1141523 -Node: Additions1142305 -Node: Accessing The Source1143230 -Node: Adding Code1144666 -Node: New Ports1150831 -Node: Derived Files1155313 -Ref: Derived Files-Footnote-11160788 -Ref: Derived Files-Footnote-21160822 -Ref: Derived Files-Footnote-31161418 -Node: Future Extensions1161532 -Node: Implementation Limitations1162138 -Node: Extension Design1163386 -Node: Old Extension Problems1164540 -Ref: Old Extension Problems-Footnote-11166057 -Node: Extension New Mechanism Goals1166114 -Ref: Extension New Mechanism Goals-Footnote-11169474 -Node: Extension Other Design Decisions1169663 -Node: Extension Future Growth1171771 -Node: Old Extension Mechanism1172607 -Node: Notes summary1174369 -Node: Basic Concepts1175555 -Node: Basic High Level1176236 -Ref: figure-general-flow1176508 -Ref: figure-process-flow1177107 -Ref: Basic High Level-Footnote-11180336 -Node: Basic Data Typing1180521 -Node: Glossary1183849 -Node: Copying1209007 -Node: GNU Free Documentation License1246563 -Node: Index1271699 +Node: When110967 +Ref: When-Footnote-1112721 +Node: Intro Summary112786 +Node: Invoking Gawk113670 +Node: Command Line115184 +Node: Options115982 +Ref: Options-Footnote-1131904 +Ref: Options-Footnote-2132133 +Node: Other Arguments132158 +Node: Naming Standard Input135106 +Node: Environment Variables136199 +Node: AWKPATH Variable136757 +Ref: AWKPATH Variable-Footnote-1140054 +Ref: AWKPATH Variable-Footnote-2140099 +Node: AWKLIBPATH Variable140359 +Node: Other Environment Variables141502 +Node: Exit Status145260 +Node: Include Files145936 +Node: Loading Shared Libraries149525 +Node: Obsolete150952 +Node: Undocumented151644 +Node: Invoking Summary151911 +Node: Regexp153574 +Node: Regexp Usage155028 +Node: Escape Sequences157065 +Node: Regexp Operators163075 +Ref: Regexp Operators-Footnote-1170485 +Ref: Regexp Operators-Footnote-2170632 +Node: Bracket Expressions170730 +Ref: table-char-classes172745 +Node: Leftmost Longest175670 +Node: Computed Regexps176972 +Node: GNU Regexp Operators180369 +Node: Case-sensitivity184042 +Ref: Case-sensitivity-Footnote-1186927 +Ref: Case-sensitivity-Footnote-2187162 +Node: Regexp Summary187270 +Node: Reading Files188737 +Node: Records190831 +Node: awk split records191564 +Node: gawk split records196479 +Ref: gawk split records-Footnote-1201023 +Node: Fields201060 +Ref: Fields-Footnote-1203836 +Node: Nonconstant Fields203922 +Ref: Nonconstant Fields-Footnote-1206165 +Node: Changing Fields206369 +Node: Field Separators212298 +Node: Default Field Splitting215003 +Node: Regexp Field Splitting216120 +Node: Single Character Fields219470 +Node: Command Line Field Separator220529 +Node: Full Line Fields223741 +Ref: Full Line Fields-Footnote-1225258 +Ref: Full Line Fields-Footnote-2225304 +Node: Field Splitting Summary225405 +Node: Constant Size227479 +Node: Splitting By Content232068 +Ref: Splitting By Content-Footnote-1236062 +Node: Multiple Line236225 +Ref: Multiple Line-Footnote-1242111 +Node: Getline242290 +Node: Plain Getline244502 +Node: Getline/Variable247142 +Node: Getline/File248290 +Node: Getline/Variable/File249674 +Ref: Getline/Variable/File-Footnote-1251277 +Node: Getline/Pipe251364 +Node: Getline/Variable/Pipe254047 +Node: Getline/Coprocess255178 +Node: Getline/Variable/Coprocess256430 +Node: Getline Notes257169 +Node: Getline Summary259961 +Ref: table-getline-variants260373 +Node: Read Timeout261202 +Ref: Read Timeout-Footnote-1265026 +Node: Command-line directories265084 +Node: Input Summary265989 +Node: Input Exercises269290 +Node: Printing270018 +Node: Print271795 +Node: Print Examples273252 +Node: Output Separators276031 +Node: OFMT278049 +Node: Printf279403 +Node: Basic Printf280188 +Node: Control Letters281758 +Node: Format Modifiers285741 +Node: Printf Examples291750 +Node: Redirection294236 +Node: Special FD301077 +Ref: Special FD-Footnote-1304237 +Node: Special Files304311 +Node: Other Inherited Files304928 +Node: Special Network305928 +Node: Special Caveats306790 +Node: Close Files And Pipes307741 +Ref: Close Files And Pipes-Footnote-1314923 +Ref: Close Files And Pipes-Footnote-2315071 +Node: Output Summary315221 +Node: Output Exercises316219 +Node: Expressions316899 +Node: Values318084 +Node: Constants318762 +Node: Scalar Constants319453 +Ref: Scalar Constants-Footnote-1320312 +Node: Nondecimal-numbers320562 +Node: Regexp Constants323580 +Node: Using Constant Regexps324105 +Node: Variables327248 +Node: Using Variables327903 +Node: Assignment Options329814 +Node: Conversion331689 +Node: Strings And Numbers332213 +Ref: Strings And Numbers-Footnote-1335278 +Node: Locale influences conversions335387 +Ref: table-locale-affects338134 +Node: All Operators338722 +Node: Arithmetic Ops339352 +Node: Concatenation341857 +Ref: Concatenation-Footnote-1344676 +Node: Assignment Ops344782 +Ref: table-assign-ops349761 +Node: Increment Ops351033 +Node: Truth Values and Conditions354471 +Node: Truth Values355556 +Node: Typing and Comparison356605 +Node: Variable Typing357415 +Node: Comparison Operators361068 +Ref: table-relational-ops361478 +Node: POSIX String Comparison364973 +Ref: POSIX String Comparison-Footnote-1366045 +Node: Boolean Ops366183 +Ref: Boolean Ops-Footnote-1370662 +Node: Conditional Exp370753 +Node: Function Calls372480 +Node: Precedence376360 +Node: Locales380021 +Node: Expressions Summary381653 +Node: Patterns and Actions384213 +Node: Pattern Overview385333 +Node: Regexp Patterns387012 +Node: Expression Patterns387555 +Node: Ranges391265 +Node: BEGIN/END394371 +Node: Using BEGIN/END395132 +Ref: Using BEGIN/END-Footnote-1397866 +Node: I/O And BEGIN/END397972 +Node: BEGINFILE/ENDFILE400286 +Node: Empty403187 +Node: Using Shell Variables403504 +Node: Action Overview405777 +Node: Statements408103 +Node: If Statement409951 +Node: While Statement411446 +Node: Do Statement413475 +Node: For Statement414619 +Node: Switch Statement417776 +Node: Break Statement420158 +Node: Continue Statement422199 +Node: Next Statement424026 +Node: Nextfile Statement426407 +Node: Exit Statement429037 +Node: Built-in Variables431440 +Node: User-modified432573 +Ref: User-modified-Footnote-1440254 +Node: Auto-set440316 +Ref: Auto-set-Footnote-1453351 +Ref: Auto-set-Footnote-2453556 +Node: ARGC and ARGV453612 +Node: Pattern Action Summary457830 +Node: Arrays460257 +Node: Array Basics461586 +Node: Array Intro462430 +Ref: figure-array-elements464394 +Ref: Array Intro-Footnote-1466920 +Node: Reference to Elements467048 +Node: Assigning Elements469500 +Node: Array Example469991 +Node: Scanning an Array471749 +Node: Controlling Scanning474765 +Ref: Controlling Scanning-Footnote-1479961 +Node: Numeric Array Subscripts480277 +Node: Uninitialized Subscripts482462 +Node: Delete484079 +Ref: Delete-Footnote-1486822 +Node: Multidimensional486879 +Node: Multiscanning489976 +Node: Arrays of Arrays491565 +Node: Arrays Summary496324 +Node: Functions498416 +Node: Built-in499315 +Node: Calling Built-in500393 +Node: Numeric Functions502384 +Ref: Numeric Functions-Footnote-1506401 +Ref: Numeric Functions-Footnote-2506758 +Ref: Numeric Functions-Footnote-3506806 +Node: String Functions507078 +Ref: String Functions-Footnote-1530553 +Ref: String Functions-Footnote-2530682 +Ref: String Functions-Footnote-3530930 +Node: Gory Details531017 +Ref: table-sub-escapes532798 +Ref: table-sub-proposed534318 +Ref: table-posix-sub535682 +Ref: table-gensub-escapes537218 +Ref: Gory Details-Footnote-1538050 +Node: I/O Functions538201 +Ref: I/O Functions-Footnote-1545419 +Node: Time Functions545566 +Ref: Time Functions-Footnote-1556054 +Ref: Time Functions-Footnote-2556122 +Ref: Time Functions-Footnote-3556280 +Ref: Time Functions-Footnote-4556391 +Ref: Time Functions-Footnote-5556503 +Ref: Time Functions-Footnote-6556730 +Node: Bitwise Functions556996 +Ref: table-bitwise-ops557558 +Ref: Bitwise Functions-Footnote-1561867 +Node: Type Functions562036 +Node: I18N Functions563187 +Node: User-defined564832 +Node: Definition Syntax565637 +Ref: Definition Syntax-Footnote-1571044 +Node: Function Example571115 +Ref: Function Example-Footnote-1574034 +Node: Function Caveats574056 +Node: Calling A Function574574 +Node: Variable Scope575532 +Node: Pass By Value/Reference578520 +Node: Return Statement582015 +Node: Dynamic Typing584996 +Node: Indirect Calls585925 +Ref: Indirect Calls-Footnote-1597227 +Node: Functions Summary597355 +Node: Library Functions600057 +Ref: Library Functions-Footnote-1603666 +Ref: Library Functions-Footnote-2603809 +Node: Library Names603980 +Ref: Library Names-Footnote-1607434 +Ref: Library Names-Footnote-2607657 +Node: General Functions607743 +Node: Strtonum Function608846 +Node: Assert Function611868 +Node: Round Function615192 +Node: Cliff Random Function616733 +Node: Ordinal Functions617749 +Ref: Ordinal Functions-Footnote-1620812 +Ref: Ordinal Functions-Footnote-2621064 +Node: Join Function621275 +Ref: Join Function-Footnote-1623044 +Node: Getlocaltime Function623244 +Node: Readfile Function626988 +Node: Shell Quoting628958 +Node: Data File Management630359 +Node: Filetrans Function630991 +Node: Rewind Function635047 +Node: File Checking636434 +Ref: File Checking-Footnote-1637766 +Node: Empty Files637967 +Node: Ignoring Assigns639946 +Node: Getopt Function641497 +Ref: Getopt Function-Footnote-1652959 +Node: Passwd Functions653159 +Ref: Passwd Functions-Footnote-1661996 +Node: Group Functions662084 +Ref: Group Functions-Footnote-1669978 +Node: Walking Arrays670191 +Node: Library Functions Summary671794 +Node: Library Exercises673195 +Node: Sample Programs674475 +Node: Running Examples675245 +Node: Clones675973 +Node: Cut Program677197 +Node: Egrep Program686916 +Ref: Egrep Program-Footnote-1694414 +Node: Id Program694524 +Node: Split Program698169 +Ref: Split Program-Footnote-1701617 +Node: Tee Program701745 +Node: Uniq Program704534 +Node: Wc Program711953 +Ref: Wc Program-Footnote-1716203 +Node: Miscellaneous Programs716297 +Node: Dupword Program717510 +Node: Alarm Program719541 +Node: Translate Program724345 +Ref: Translate Program-Footnote-1728910 +Node: Labels Program729180 +Ref: Labels Program-Footnote-1732531 +Node: Word Sorting732615 +Node: History Sorting736686 +Node: Extract Program738522 +Node: Simple Sed746047 +Node: Igawk Program749115 +Ref: Igawk Program-Footnote-1763439 +Ref: Igawk Program-Footnote-2763640 +Ref: Igawk Program-Footnote-3763762 +Node: Anagram Program763877 +Node: Signature Program766934 +Node: Programs Summary768181 +Node: Programs Exercises769374 +Ref: Programs Exercises-Footnote-1773505 +Node: Advanced Features773596 +Node: Nondecimal Data775544 +Node: Array Sorting777134 +Node: Controlling Array Traversal777831 +Ref: Controlling Array Traversal-Footnote-1786164 +Node: Array Sorting Functions786282 +Ref: Array Sorting Functions-Footnote-1790171 +Node: Two-way I/O790367 +Ref: Two-way I/O-Footnote-1795312 +Ref: Two-way I/O-Footnote-2795498 +Node: TCP/IP Networking795580 +Node: Profiling798453 +Node: Advanced Features Summary806000 +Node: Internationalization807933 +Node: I18N and L10N809413 +Node: Explaining gettext810099 +Ref: Explaining gettext-Footnote-1815124 +Ref: Explaining gettext-Footnote-2815308 +Node: Programmer i18n815473 +Ref: Programmer i18n-Footnote-1820339 +Node: Translator i18n820388 +Node: String Extraction821182 +Ref: String Extraction-Footnote-1822313 +Node: Printf Ordering822399 +Ref: Printf Ordering-Footnote-1825185 +Node: I18N Portability825249 +Ref: I18N Portability-Footnote-1827704 +Node: I18N Example827767 +Ref: I18N Example-Footnote-1830570 +Node: Gawk I18N830642 +Node: I18N Summary831280 +Node: Debugger832619 +Node: Debugging833641 +Node: Debugging Concepts834082 +Node: Debugging Terms835935 +Node: Awk Debugging838507 +Node: Sample Debugging Session839401 +Node: Debugger Invocation839921 +Node: Finding The Bug841305 +Node: List of Debugger Commands847780 +Node: Breakpoint Control849113 +Node: Debugger Execution Control852809 +Node: Viewing And Changing Data856173 +Node: Execution Stack859551 +Node: Debugger Info861188 +Node: Miscellaneous Debugger Commands865205 +Node: Readline Support870234 +Node: Limitations871126 +Node: Debugging Summary873240 +Node: Arbitrary Precision Arithmetic874408 +Node: Computer Arithmetic875824 +Ref: table-numeric-ranges879422 +Ref: Computer Arithmetic-Footnote-1880281 +Node: Math Definitions880338 +Ref: table-ieee-formats883626 +Ref: Math Definitions-Footnote-1884230 +Node: MPFR features884335 +Node: FP Math Caution886006 +Ref: FP Math Caution-Footnote-1887056 +Node: Inexactness of computations887425 +Node: Inexact representation888384 +Node: Comparing FP Values889741 +Node: Errors accumulate890823 +Node: Getting Accuracy892256 +Node: Try To Round894918 +Node: Setting precision895817 +Ref: table-predefined-precision-strings896501 +Node: Setting the rounding mode898290 +Ref: table-gawk-rounding-modes898654 +Ref: Setting the rounding mode-Footnote-1902109 +Node: Arbitrary Precision Integers902288 +Ref: Arbitrary Precision Integers-Footnote-1905274 +Node: POSIX Floating Point Problems905423 +Ref: POSIX Floating Point Problems-Footnote-1909296 +Node: Floating point summary909334 +Node: Dynamic Extensions911528 +Node: Extension Intro913080 +Node: Plugin License914346 +Node: Extension Mechanism Outline915143 +Ref: figure-load-extension915571 +Ref: figure-register-new-function917051 +Ref: figure-call-new-function918055 +Node: Extension API Description920041 +Node: Extension API Functions Introduction921491 +Node: General Data Types926315 +Ref: General Data Types-Footnote-1932054 +Node: Memory Allocation Functions932353 +Ref: Memory Allocation Functions-Footnote-1935192 +Node: Constructor Functions935288 +Node: Registration Functions937022 +Node: Extension Functions937707 +Node: Exit Callback Functions940004 +Node: Extension Version String941252 +Node: Input Parsers941917 +Node: Output Wrappers951796 +Node: Two-way processors956311 +Node: Printing Messages958515 +Ref: Printing Messages-Footnote-1959591 +Node: Updating `ERRNO'959743 +Node: Requesting Values960483 +Ref: table-value-types-returned961211 +Node: Accessing Parameters962168 +Node: Symbol Table Access963399 +Node: Symbol table by name963913 +Node: Symbol table by cookie965894 +Ref: Symbol table by cookie-Footnote-1970038 +Node: Cached values970101 +Ref: Cached values-Footnote-1973600 +Node: Array Manipulation973691 +Ref: Array Manipulation-Footnote-1974789 +Node: Array Data Types974826 +Ref: Array Data Types-Footnote-1977481 +Node: Array Functions977573 +Node: Flattening Arrays981427 +Node: Creating Arrays988319 +Node: Extension API Variables993090 +Node: Extension Versioning993726 +Node: Extension API Informational Variables995627 +Node: Extension API Boilerplate996692 +Node: Finding Extensions1000501 +Node: Extension Example1001061 +Node: Internal File Description1001833 +Node: Internal File Ops1005900 +Ref: Internal File Ops-Footnote-11017570 +Node: Using Internal File Ops1017710 +Ref: Using Internal File Ops-Footnote-11020093 +Node: Extension Samples1020366 +Node: Extension Sample File Functions1021892 +Node: Extension Sample Fnmatch1029530 +Node: Extension Sample Fork1031021 +Node: Extension Sample Inplace1032236 +Node: Extension Sample Ord1033911 +Node: Extension Sample Readdir1034747 +Ref: table-readdir-file-types1035623 +Node: Extension Sample Revout1036434 +Node: Extension Sample Rev2way1037024 +Node: Extension Sample Read write array1037764 +Node: Extension Sample Readfile1039704 +Node: Extension Sample Time1040799 +Node: Extension Sample API Tests1042148 +Node: gawkextlib1042639 +Node: Extension summary1045297 +Node: Extension Exercises1048986 +Node: Language History1049708 +Node: V7/SVR3.11051364 +Node: SVR41053545 +Node: POSIX1054990 +Node: BTL1056379 +Node: POSIX/GNU1057113 +Node: Feature History1062677 +Node: Common Extensions1075775 +Node: Ranges and Locales1077099 +Ref: Ranges and Locales-Footnote-11081717 +Ref: Ranges and Locales-Footnote-21081744 +Ref: Ranges and Locales-Footnote-31081978 +Node: Contributors1082199 +Node: History summary1087740 +Node: Installation1089110 +Node: Gawk Distribution1090056 +Node: Getting1090540 +Node: Extracting1091363 +Node: Distribution contents1092998 +Node: Unix Installation1098715 +Node: Quick Installation1099332 +Node: Additional Configuration Options1101756 +Node: Configuration Philosophy1103494 +Node: Non-Unix Installation1105863 +Node: PC Installation1106321 +Node: PC Binary Installation1107640 +Node: PC Compiling1109488 +Ref: PC Compiling-Footnote-11112509 +Node: PC Testing1112618 +Node: PC Using1113794 +Node: Cygwin1117909 +Node: MSYS1118732 +Node: VMS Installation1119232 +Node: VMS Compilation1120024 +Ref: VMS Compilation-Footnote-11121246 +Node: VMS Dynamic Extensions1121304 +Node: VMS Installation Details1122988 +Node: VMS Running1125240 +Node: VMS GNV1128076 +Node: VMS Old Gawk1128810 +Node: Bugs1129280 +Node: Other Versions1133163 +Node: Installation summary1139587 +Node: Notes1140643 +Node: Compatibility Mode1141508 +Node: Additions1142290 +Node: Accessing The Source1143215 +Node: Adding Code1144650 +Node: New Ports1150815 +Node: Derived Files1155297 +Ref: Derived Files-Footnote-11160772 +Ref: Derived Files-Footnote-21160806 +Ref: Derived Files-Footnote-31161402 +Node: Future Extensions1161516 +Node: Implementation Limitations1162122 +Node: Extension Design1163370 +Node: Old Extension Problems1164524 +Ref: Old Extension Problems-Footnote-11166041 +Node: Extension New Mechanism Goals1166098 +Ref: Extension New Mechanism Goals-Footnote-11169458 +Node: Extension Other Design Decisions1169647 +Node: Extension Future Growth1171755 +Node: Old Extension Mechanism1172591 +Node: Notes summary1174353 +Node: Basic Concepts1175539 +Node: Basic High Level1176220 +Ref: figure-general-flow1176492 +Ref: figure-process-flow1177091 +Ref: Basic High Level-Footnote-11180320 +Node: Basic Data Typing1180505 +Node: Glossary1183833 +Node: Copying1208991 +Node: GNU Free Documentation License1246547 +Node: Index1271683  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index afb94551..07630edf 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -3309,8 +3309,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: @@ -3575,7 +3580,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}. @@ -3629,7 +3634,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 @@ -3658,7 +3663,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 @@ -3745,8 +3750,8 @@ warning that the program is empty. 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 @@ -3773,7 +3778,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 @@ -3841,14 +3846,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} @@ -3905,7 +3910,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. @@ -3965,7 +3970,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. @@ -3977,7 +3982,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} @@ -3987,7 +3992,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. @@ -4072,7 +4077,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. @@ -4081,8 +4086,8 @@ No space is allowed between the @option{-o} and @var{file}, if @quotation NOTE Due to the way @command{gawk} has evolved, with this option -your program is still executed. This will change in the -next major release such that @command{gawk} will only +your program still executes. This will change in the +next major release, such that @command{gawk} will only pretty-print the program and not run it. @end quotation @@ -4118,7 +4123,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 @@ -4239,7 +4244,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. @@ -4429,7 +4434,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 @@ -4470,9 +4475,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 @@ -4582,7 +4587,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 @@ -4606,16 +4611,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 @@ -4652,7 +4657,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 @@ -4742,11 +4747,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. @@ -4759,8 +4765,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 @@ -4814,8 +4820,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}, @@ -4912,7 +4918,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 @@ -4949,7 +4955,7 @@ 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 @@ -5162,7 +5168,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 @@ -5232,7 +5238,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 @@ -5412,7 +5418,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 @@ -5535,7 +5541,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 @@ -5574,10 +5580,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 @@ -5706,7 +5712,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 @@ -28958,8 +28964,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, @@ -30607,7 +30613,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 @@ -38468,7 +38474,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}. @@ -38751,7 +38757,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: diff --git a/doc/gawktexi.in b/doc/gawktexi.in index b346e219..4d11a082 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -3220,8 +3220,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: @@ -3486,7 +3491,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}. @@ -3540,7 +3545,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 @@ -3569,7 +3574,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 @@ -3656,8 +3661,8 @@ warning that the program is empty. 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 @@ -3684,7 +3689,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 @@ -3752,14 +3757,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} @@ -3816,7 +3821,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. @@ -3876,7 +3881,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. @@ -3888,7 +3893,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} @@ -3898,7 +3903,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. @@ -3983,7 +3988,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. @@ -3992,8 +3997,8 @@ No space is allowed between the @option{-o} and @var{file}, if @quotation NOTE Due to the way @command{gawk} has evolved, with this option -your program is still executed. This will change in the -next major release such that @command{gawk} will only +your program still executes. This will change in the +next major release, such that @command{gawk} will only pretty-print the program and not run it. @end quotation @@ -4029,7 +4034,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 @@ -4150,7 +4155,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. @@ -4340,7 +4345,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 @@ -4381,9 +4386,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 @@ -4493,7 +4498,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 @@ -4517,16 +4522,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 @@ -4563,7 +4568,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 @@ -4653,11 +4658,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. @@ -4670,8 +4676,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 @@ -4725,8 +4731,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}, @@ -4823,7 +4829,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 @@ -4860,7 +4866,7 @@ 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 @@ -5073,7 +5079,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 @@ -5143,7 +5149,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 @@ -5240,7 +5246,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 @@ -5363,7 +5369,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 @@ -5402,10 +5408,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 @@ -5534,7 +5540,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 @@ -28051,8 +28057,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, @@ -29700,7 +29706,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 @@ -37561,7 +37567,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}. @@ -37844,7 +37850,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: -- cgit v1.2.3 From 8e0e08c84626633e1d4b7b431576d4ec7d8f10c4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 21 Jan 2015 08:46:41 +0200 Subject: Remove obsolete start/end of range indexing comments. --- doc/ChangeLog | 1 + doc/gawk.texi | 364 -------------------------------------------------------- doc/gawktexi.in | 364 -------------------------------------------------------- 3 files changed, 1 insertion(+), 728 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 63f6cd02..b78fcb6f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2015-01-21 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. + Remove obsolete start/end of range indexing comments. 2015-01-20 Arnold D. Robbins diff --git a/doc/gawk.texi b/doc/gawk.texi index 07630edf..ad4bae1e 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -2596,9 +2596,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 @@ -2972,8 +2970,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. @@ -3738,13 +3734,9 @@ 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. @@ -3833,8 +3825,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: @@ -4290,8 +4280,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 @@ -4961,7 +4949,6 @@ or C++ using the @code{@@load} statement and/or the @option{-l} option. @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 @@ -5400,7 +5387,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 @@ -5632,11 +5618,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) @@ -5780,7 +5764,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? @@ -5824,9 +5807,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 @@ -5977,17 +5958,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 @@ -6152,15 +6129,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 @@ -6252,8 +6225,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 @@ -6300,12 +6271,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 @@ -6356,9 +6325,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 @@ -6715,8 +6682,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 @@ -6724,7 +6689,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 @@ -6805,7 +6769,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 @@ -6866,7 +6829,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 @@ -7089,7 +7051,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 @@ -7105,9 +7066,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. @@ -7207,9 +7166,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 @@ -7313,8 +7270,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 @@ -7670,8 +7625,6 @@ will take effect. @end cartouche @end ifnotdocbook -@c ENDOFRANGE fisepr -@c ENDOFRANGE fisepg @node Constant Size @section Reading Fixed-Width Data @@ -7935,11 +7888,8 @@ last assigned to. @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 @@ -8106,16 +8056,11 @@ 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 @@ -8705,9 +8650,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 @@ -8942,7 +8884,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, @@ -8958,7 +8899,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} @@ -9138,7 +9078,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 @@ -9251,7 +9190,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 @@ -9449,7 +9387,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 @@ -9655,7 +9592,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} @@ -9736,14 +9672,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 @@ -10001,8 +9934,6 @@ 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 @@ -10112,7 +10043,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, @@ -10203,18 +10133,13 @@ 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 @@ -10491,10 +10416,6 @@ 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 @@ -10558,11 +10479,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 @@ -10605,7 +10524,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 @@ -10791,7 +10709,6 @@ $ @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 @@ -10803,7 +10720,6 @@ slashes, such as @code{@w{/^beginning and end$/}}. Most regexps used in 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 @node Using Constant Regexps @subsection Using Regular Expression Constants @@ -10914,7 +10830,6 @@ 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 @@ -11509,11 +11424,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 @@ -11819,16 +11731,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 @@ -11876,7 +11783,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 @@ -12010,9 +11916,6 @@ 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 @@ -12077,17 +11980,13 @@ 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 fixed type. Instead, they can be either a number or a string, depending @@ -12487,19 +12386,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 @@ -12645,8 +12538,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 @@ -12825,9 +12716,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 @@ -13012,8 +12901,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 @@ -13117,11 +13004,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 @@ -13417,9 +13302,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. @@ -13557,8 +13440,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 @@ -13679,7 +13560,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 @@ -13828,11 +13708,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, @@ -14550,15 +14427,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 @@ -14585,9 +14457,7 @@ their areas of activity. @node User-modified @subsection Built-In Variables That Control @command{awk} -@c STARTOFRANGE bvaru @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 @@ -14814,17 +14684,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 -@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 @@ -15232,8 +15096,6 @@ implementation issues.} neither @code{FUNCTAB} nor @code{SYMTAB} are available as elements within the @code{SYMTAB} array. @end quotation @end table -@c ENDOFRANGE bvconi -@c ENDOFRANGE vbconi @cindex sidebar, Changing @code{NR} and @code{FNR} @ifdocbook @@ -15526,7 +15388,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 @@ -15648,9 +15509,7 @@ 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. -@c STARTOFRANGE arrin @cindex arrays, indexing -@c STARTOFRANGE inarr @cindex indexing arrays @cindex associative arrays @cindex arrays, associative @@ -15853,8 +15712,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 @@ -16907,14 +16764,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. @@ -18621,13 +18475,9 @@ 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 @@ -18705,7 +18555,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} @@ -18954,7 +18803,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. @@ -19005,23 +18853,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.} @@ -19313,11 +19152,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 @@ -19397,15 +19231,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 @@ -19430,7 +19260,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 @@ -19677,12 +19506,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 @@ -19974,7 +19801,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 @@ -20102,7 +19928,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 @@ -20595,7 +20420,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} @@ -20617,11 +20441,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 @@ -20944,13 +20765,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 @@ -21066,10 +20883,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 @@ -21627,11 +21440,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. @@ -22023,22 +21833,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 @@ -22390,21 +22192,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 @@ -22751,21 +22545,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) @@ -23088,7 +22874,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 @@ -23177,10 +22962,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 @@ -23294,13 +23075,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 @@ -23370,7 +23147,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 @@ -23401,11 +23177,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. @@ -23713,21 +23486,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} @@ -23995,17 +23761,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. @@ -24134,16 +23895,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 @@ -24278,15 +24036,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 @@ -24399,18 +24154,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 @@ -24679,26 +24430,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: @@ -24868,13 +24610,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 @@ -25005,9 +24740,7 @@ Aharon Robbins 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, @@ -25159,15 +24892,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: @@ -25315,15 +25044,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.''} @@ -25387,7 +25112,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 @@ -25452,14 +25176,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 @@ -25521,7 +25241,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 @@ -25586,13 +25305,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}), @@ -25617,7 +25333,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 @@ -25660,15 +25375,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 @@ -25772,7 +25483,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 @@ -25918,9 +25628,6 @@ END @{ @} @c endfile @end example -@c ENDOFRANGE texse -@c ENDOFRANGE fitex -@c ENDOFRANGE extract @node Simple Sed @subsection A Simple Stream Editor @@ -25950,7 +25657,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 @@ -26027,14 +25733,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. @@ -26173,7 +25876,6 @@ program. The program is as follows: -@c STARTOFRANGE igawk @cindex @code{igawk.sh} program @example @c file eg/prog/igawk.sh @@ -26498,10 +26200,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 @@ -26525,7 +26223,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 @@ -26634,7 +26331,6 @@ babery yabber @dots{} @end example -@c ENDOFRANGE anagram @node Signature Program @subsection And Now for Something Completely Different @@ -26954,9 +26650,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 @@ -27666,7 +27360,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}) @@ -27783,13 +27476,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} @@ -28100,8 +27790,6 @@ When called this way, @command{gawk} ``pretty prints'' the program into The @option{--pretty-print} option still runs your program. This will change in the next major release. @end quotation -@c ENDOFRANGE awkp -@c ENDOFRANGE proawk @node Advanced Features Summary @section Summary @@ -28148,8 +27836,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} @@ -28162,7 +27848,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 @@ -28207,7 +27892,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. @@ -28259,7 +27943,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 @@ -28271,7 +27954,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 @@ -28399,11 +28081,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 @@ -28636,8 +28316,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 @@ -28813,7 +28491,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 @@ -29009,7 +28686,6 @@ a number of translations for its messages. @end itemize -@c ENDOFRANGE inloc @node Debugger @chapter Debugging @command{awk} Programs @@ -35442,9 +35118,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 @@ -35531,7 +35205,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 @@ -35646,7 +35319,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} @@ -35692,11 +35364,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 @@ -36006,9 +35675,6 @@ Ultrix @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 @@ -37057,9 +36723,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 @@ -37169,7 +36833,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, @@ -37362,7 +37025,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 @@ -37788,9 +37450,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 @@ -38298,8 +37958,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 @@ -38310,9 +37968,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 @@ -38409,12 +38065,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) @@ -38635,7 +38288,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 @@ -38673,15 +38325,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 @@ -38786,11 +38434,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} @@ -38957,9 +38602,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 @@ -39093,7 +38735,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. @@ -39282,7 +38923,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 @@ -39663,13 +39303,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 @@ -39907,7 +39544,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 diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 4d11a082..7379a9c9 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -2563,9 +2563,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 @@ -2883,8 +2881,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. @@ -3649,13 +3645,9 @@ 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. @@ -3744,8 +3736,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: @@ -4201,8 +4191,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 @@ -4872,7 +4860,6 @@ or C++ using the @code{@@load} statement and/or the @option{-l} option. @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 @@ -5228,7 +5215,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 @@ -5460,11 +5446,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) @@ -5608,7 +5592,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? @@ -5652,9 +5635,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 @@ -5761,17 +5742,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 @@ -5936,15 +5913,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 @@ -6036,8 +6009,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 @@ -6084,12 +6055,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 @@ -6140,9 +6109,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 @@ -6442,8 +6409,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 @@ -6451,7 +6416,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 @@ -6532,7 +6496,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 @@ -6593,7 +6556,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 @@ -6785,7 +6747,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 @@ -6801,9 +6762,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. @@ -6903,9 +6862,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 @@ -7009,8 +6966,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 @@ -7271,8 +7226,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 @@ -7536,11 +7489,8 @@ last assigned to. @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 @@ -7707,16 +7657,11 @@ 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 @@ -8306,9 +8251,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 @@ -8543,7 +8485,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, @@ -8559,7 +8500,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} @@ -8739,7 +8679,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 @@ -8852,7 +8791,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 @@ -9050,7 +8988,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 @@ -9256,7 +9193,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} @@ -9337,14 +9273,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 @@ -9561,8 +9494,6 @@ 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 @@ -9672,7 +9603,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, @@ -9763,18 +9693,13 @@ 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 @@ -9988,10 +9913,6 @@ 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 @@ -10055,11 +9976,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 @@ -10102,7 +10021,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 @@ -10259,7 +10177,6 @@ $ @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 @@ -10271,7 +10188,6 @@ slashes, such as @code{@w{/^beginning and end$/}}. Most regexps used in 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 @node Using Constant Regexps @subsection Using Regular Expression Constants @@ -10382,7 +10298,6 @@ 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 @@ -10948,11 +10863,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 @@ -11206,16 +11118,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 @@ -11263,7 +11170,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 @@ -11339,9 +11245,6 @@ 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 @@ -11406,17 +11309,13 @@ 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 fixed type. Instead, they can be either a number or a string, depending @@ -11816,19 +11715,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 @@ -11974,8 +11867,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 @@ -12154,9 +12045,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 @@ -12341,8 +12230,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 @@ -12446,11 +12333,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 @@ -12746,9 +12631,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. @@ -12886,8 +12769,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 @@ -13008,7 +12889,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 @@ -13157,11 +13037,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, @@ -13879,15 +13756,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 @@ -13914,9 +13786,7 @@ their areas of activity. @node User-modified @subsection Built-In Variables That Control @command{awk} -@c STARTOFRANGE bvaru @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 @@ -14143,17 +14013,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 -@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 @@ -14561,8 +14425,6 @@ implementation issues.} neither @code{FUNCTAB} nor @code{SYMTAB} are available as elements 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 @@ -14809,7 +14671,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 @@ -14931,9 +14792,7 @@ 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. -@c STARTOFRANGE arrin @cindex arrays, indexing -@c STARTOFRANGE inarr @cindex indexing arrays @cindex associative arrays @cindex arrays, associative @@ -15136,8 +14995,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 @@ -16190,14 +16047,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. @@ -17743,13 +17597,9 @@ 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 @@ -17827,7 +17677,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} @@ -18076,7 +17925,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. @@ -18127,23 +17975,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.} @@ -18435,11 +18274,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 @@ -18519,15 +18353,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 @@ -18552,7 +18382,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 @@ -18799,12 +18628,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 @@ -19096,7 +18923,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 @@ -19224,7 +19050,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 @@ -19717,7 +19542,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} @@ -19739,11 +19563,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 @@ -20066,13 +19887,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 @@ -20188,10 +20005,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 @@ -20749,11 +20562,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. @@ -21116,22 +20926,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 @@ -21483,21 +21285,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 @@ -21844,21 +21638,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) @@ -22181,7 +21967,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 @@ -22270,10 +22055,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 @@ -22387,13 +22168,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 @@ -22463,7 +22240,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 @@ -22494,11 +22270,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. @@ -22806,21 +22579,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} @@ -23088,17 +22854,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. @@ -23227,16 +22988,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 @@ -23371,15 +23129,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 @@ -23492,18 +23247,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 @@ -23772,26 +23523,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: @@ -23961,13 +23703,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 @@ -24098,9 +23833,7 @@ Aharon Robbins 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, @@ -24252,15 +23985,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: @@ -24408,15 +24137,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.''} @@ -24480,7 +24205,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 @@ -24545,14 +24269,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 @@ -24614,7 +24334,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 @@ -24679,13 +24398,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}), @@ -24710,7 +24426,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 @@ -24753,15 +24468,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 @@ -24865,7 +24576,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 @@ -25011,9 +24721,6 @@ END @{ @} @c endfile @end example -@c ENDOFRANGE texse -@c ENDOFRANGE fitex -@c ENDOFRANGE extract @node Simple Sed @subsection A Simple Stream Editor @@ -25043,7 +24750,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 @@ -25120,14 +24826,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. @@ -25266,7 +24969,6 @@ program. The program is as follows: -@c STARTOFRANGE igawk @cindex @code{igawk.sh} program @example @c file eg/prog/igawk.sh @@ -25591,10 +25293,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 @@ -25618,7 +25316,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 @@ -25727,7 +25424,6 @@ babery yabber @dots{} @end example -@c ENDOFRANGE anagram @node Signature Program @subsection And Now for Something Completely Different @@ -26047,9 +25743,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 @@ -26759,7 +26453,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}) @@ -26876,13 +26569,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} @@ -27193,8 +26883,6 @@ When called this way, @command{gawk} ``pretty prints'' the program into The @option{--pretty-print} option still runs your program. This will change in the next major release. @end quotation -@c ENDOFRANGE awkp -@c ENDOFRANGE proawk @node Advanced Features Summary @section Summary @@ -27241,8 +26929,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} @@ -27255,7 +26941,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 @@ -27300,7 +26985,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. @@ -27352,7 +27036,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 @@ -27364,7 +27047,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 @@ -27492,11 +27174,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 @@ -27729,8 +27409,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 @@ -27906,7 +27584,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 @@ -28102,7 +27779,6 @@ a number of translations for its messages. @end itemize -@c ENDOFRANGE inloc @node Debugger @chapter Debugging @command{awk} Programs @@ -34535,9 +34211,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 @@ -34624,7 +34298,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 @@ -34739,7 +34412,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} @@ -34785,11 +34457,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 @@ -35099,9 +34768,6 @@ Ultrix @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 @@ -36150,9 +35816,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 @@ -36262,7 +35926,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, @@ -36455,7 +36118,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 @@ -36881,9 +36543,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 @@ -37391,8 +37051,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 @@ -37403,9 +37061,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 @@ -37502,12 +37158,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) @@ -37728,7 +37381,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 @@ -37766,15 +37418,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 @@ -37879,11 +37527,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} @@ -38050,9 +37695,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 @@ -38186,7 +37828,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. @@ -38375,7 +38016,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 @@ -38756,13 +38396,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 @@ -39000,7 +38637,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 -- cgit v1.2.3 From 6f220759af1c8e37f56acd334a295daa8c4a2651 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 23 Jan 2015 13:04:09 +0200 Subject: More O'Reilly fixes. --- doc/ChangeLog | 4 + doc/gawk.info | 1289 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 232 +++++----- doc/gawktexi.in | 215 +++++----- 4 files changed, 889 insertions(+), 851 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b78fcb6f..d16c7c7e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-01-23 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-01-21 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index de004225..2a17cbcf 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -3802,8 +3802,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. @@ -3825,7 +3826,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 `'. The input contains four `a' characters. `awk' (and POSIX) regular @@ -3862,15 +3863,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 @@ -3967,7 +3969,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 @@ -3976,10 +3978,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'. @@ -4150,7 +4152,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::). @@ -4199,8 +4201,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 @@ -4215,14 +4217,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 @@ -4270,11 +4272,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::): @@ -4340,8 +4342,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 @@ -4439,12 +4441,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. @@ -4461,10 +4463,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 @@ -4512,8 +4513,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 @@ -4537,7 +4538,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.  @@ -4659,7 +4660,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 @@ -4679,7 +4680,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 @@ -4747,7 +4748,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 @@ -4946,11 +4947,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 @@ -4978,15 +4979,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 }' @@ -4999,6 +4999,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. @@ -5152,7 +5154,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") @@ -5185,10 +5187,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 @@ -5255,9 +5257,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 = "([^,]*)|(\"[^\"]+\")" @@ -5265,9 +5267,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 ---------- @@ -5305,7 +5306,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. @@ -5317,12 +5318,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 @@ -5330,17 +5331,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 @@ -5423,7 +5424,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. @@ -5561,7 +5562,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. @@ -5571,8 +5572,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 @@ -5708,8 +5709,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.  @@ -5745,15 +5746,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 @@ -5815,7 +5817,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 @@ -5823,15 +5825,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") @@ -5839,8 +5841,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, @@ -5884,8 +5886,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 @@ -5909,7 +5911,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. @@ -5949,7 +5951,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 @@ -6017,7 +6019,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. @@ -6031,19 +6033,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). @@ -6053,12 +6057,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. @@ -6152,7 +6155,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.  @@ -6300,7 +6303,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 @@ -6355,7 +6358,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. @@ -6382,7 +6385,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 @@ -6421,7 +6424,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 @@ -6446,7 +6449,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 @@ -6640,7 +6643,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 @@ -6679,7 +6682,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. @@ -6727,7 +6730,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 @@ -6767,7 +6770,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. @@ -6815,8 +6818,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 @@ -6840,7 +6843,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.) @@ -6873,14 +6876,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 `<', `<<', @@ -6905,7 +6908,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 @@ -6932,7 +6935,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. @@ -6965,7 +6968,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 @@ -7015,7 +7018,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' @@ -7024,7 +7027,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 @@ -7184,8 +7187,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. @@ -7211,8 +7214,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. @@ -28318,7 +28321,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' @@ -28558,7 +28561,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 @@ -31263,7 +31266,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) @@ -31498,7 +31501,7 @@ Index * \ (backslash), in escape sequences: Escape Sequences. (line 6) * \ (backslash), in escape sequences, POSIX and: Escape Sequences. (line 105) -* \ (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) @@ -31767,7 +31770,7 @@ Index * backslash (\), in escape sequences: Escape Sequences. (line 6) * backslash (\), in escape sequences, POSIX and: Escape Sequences. (line 105) -* 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) @@ -32364,7 +32367,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) @@ -32750,7 +32753,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) @@ -33027,7 +33030,7 @@ Index (line 13) * internationalization, localization: User-modified. (line 151) * internationalization, localization, character classes: Bracket Expressions. - (line 100) + (line 101) * internationalization, localization, gawk and: Internationalization. (line 13) * internationalization, localization, locale categories: Explaining gettext. @@ -33245,8 +33248,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. @@ -33672,8 +33675,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) @@ -33692,7 +33695,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 281) @@ -33889,7 +33892,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 211) @@ -33983,7 +33986,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) @@ -34118,7 +34121,7 @@ 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) @@ -34364,495 +34367,495 @@ Ref: Regexp Operators-Footnote-1170485 Ref: Regexp Operators-Footnote-2170632 Node: Bracket Expressions170730 Ref: table-char-classes172745 -Node: Leftmost Longest175670 -Node: Computed Regexps176972 -Node: GNU Regexp Operators180369 -Node: Case-sensitivity184042 -Ref: Case-sensitivity-Footnote-1186927 -Ref: Case-sensitivity-Footnote-2187162 -Node: Regexp Summary187270 -Node: Reading Files188737 -Node: Records190831 -Node: awk split records191564 -Node: gawk split records196479 -Ref: gawk split records-Footnote-1201023 -Node: Fields201060 -Ref: Fields-Footnote-1203836 -Node: Nonconstant Fields203922 -Ref: Nonconstant Fields-Footnote-1206165 -Node: Changing Fields206369 -Node: Field Separators212298 -Node: Default Field Splitting215003 -Node: Regexp Field Splitting216120 -Node: Single Character Fields219470 -Node: Command Line Field Separator220529 -Node: Full Line Fields223741 -Ref: Full Line Fields-Footnote-1225258 -Ref: Full Line Fields-Footnote-2225304 -Node: Field Splitting Summary225405 -Node: Constant Size227479 -Node: Splitting By Content232068 -Ref: Splitting By Content-Footnote-1236062 -Node: Multiple Line236225 -Ref: Multiple Line-Footnote-1242111 -Node: Getline242290 -Node: Plain Getline244502 -Node: Getline/Variable247142 -Node: Getline/File248290 -Node: Getline/Variable/File249674 -Ref: Getline/Variable/File-Footnote-1251277 -Node: Getline/Pipe251364 -Node: Getline/Variable/Pipe254047 -Node: Getline/Coprocess255178 -Node: Getline/Variable/Coprocess256430 -Node: Getline Notes257169 -Node: Getline Summary259961 -Ref: table-getline-variants260373 -Node: Read Timeout261202 -Ref: Read Timeout-Footnote-1265026 -Node: Command-line directories265084 -Node: Input Summary265989 -Node: Input Exercises269290 -Node: Printing270018 -Node: Print271795 -Node: Print Examples273252 -Node: Output Separators276031 -Node: OFMT278049 -Node: Printf279403 -Node: Basic Printf280188 -Node: Control Letters281758 -Node: Format Modifiers285741 -Node: Printf Examples291750 -Node: Redirection294236 -Node: Special FD301077 -Ref: Special FD-Footnote-1304237 -Node: Special Files304311 -Node: Other Inherited Files304928 -Node: Special Network305928 -Node: Special Caveats306790 -Node: Close Files And Pipes307741 -Ref: Close Files And Pipes-Footnote-1314923 -Ref: Close Files And Pipes-Footnote-2315071 -Node: Output Summary315221 -Node: Output Exercises316219 -Node: Expressions316899 -Node: Values318084 -Node: Constants318762 -Node: Scalar Constants319453 -Ref: Scalar Constants-Footnote-1320312 -Node: Nondecimal-numbers320562 -Node: Regexp Constants323580 -Node: Using Constant Regexps324105 -Node: Variables327248 -Node: Using Variables327903 -Node: Assignment Options329814 -Node: Conversion331689 -Node: Strings And Numbers332213 -Ref: Strings And Numbers-Footnote-1335278 -Node: Locale influences conversions335387 -Ref: table-locale-affects338134 -Node: All Operators338722 -Node: Arithmetic Ops339352 -Node: Concatenation341857 -Ref: Concatenation-Footnote-1344676 -Node: Assignment Ops344782 -Ref: table-assign-ops349761 -Node: Increment Ops351033 -Node: Truth Values and Conditions354471 -Node: Truth Values355556 -Node: Typing and Comparison356605 -Node: Variable Typing357415 -Node: Comparison Operators361068 -Ref: table-relational-ops361478 -Node: POSIX String Comparison364973 -Ref: POSIX String Comparison-Footnote-1366045 -Node: Boolean Ops366183 -Ref: Boolean Ops-Footnote-1370662 -Node: Conditional Exp370753 -Node: Function Calls372480 -Node: Precedence376360 -Node: Locales380021 -Node: Expressions Summary381653 -Node: Patterns and Actions384213 -Node: Pattern Overview385333 -Node: Regexp Patterns387012 -Node: Expression Patterns387555 -Node: Ranges391265 -Node: BEGIN/END394371 -Node: Using BEGIN/END395132 -Ref: Using BEGIN/END-Footnote-1397866 -Node: I/O And BEGIN/END397972 -Node: BEGINFILE/ENDFILE400286 -Node: Empty403187 -Node: Using Shell Variables403504 -Node: Action Overview405777 -Node: Statements408103 -Node: If Statement409951 -Node: While Statement411446 -Node: Do Statement413475 -Node: For Statement414619 -Node: Switch Statement417776 -Node: Break Statement420158 -Node: Continue Statement422199 -Node: Next Statement424026 -Node: Nextfile Statement426407 -Node: Exit Statement429037 -Node: Built-in Variables431440 -Node: User-modified432573 -Ref: User-modified-Footnote-1440254 -Node: Auto-set440316 -Ref: Auto-set-Footnote-1453351 -Ref: Auto-set-Footnote-2453556 -Node: ARGC and ARGV453612 -Node: Pattern Action Summary457830 -Node: Arrays460257 -Node: Array Basics461586 -Node: Array Intro462430 -Ref: figure-array-elements464394 -Ref: Array Intro-Footnote-1466920 -Node: Reference to Elements467048 -Node: Assigning Elements469500 -Node: Array Example469991 -Node: Scanning an Array471749 -Node: Controlling Scanning474765 -Ref: Controlling Scanning-Footnote-1479961 -Node: Numeric Array Subscripts480277 -Node: Uninitialized Subscripts482462 -Node: Delete484079 -Ref: Delete-Footnote-1486822 -Node: Multidimensional486879 -Node: Multiscanning489976 -Node: Arrays of Arrays491565 -Node: Arrays Summary496324 -Node: Functions498416 -Node: Built-in499315 -Node: Calling Built-in500393 -Node: Numeric Functions502384 -Ref: Numeric Functions-Footnote-1506401 -Ref: Numeric Functions-Footnote-2506758 -Ref: Numeric Functions-Footnote-3506806 -Node: String Functions507078 -Ref: String Functions-Footnote-1530553 -Ref: String Functions-Footnote-2530682 -Ref: String Functions-Footnote-3530930 -Node: Gory Details531017 -Ref: table-sub-escapes532798 -Ref: table-sub-proposed534318 -Ref: table-posix-sub535682 -Ref: table-gensub-escapes537218 -Ref: Gory Details-Footnote-1538050 -Node: I/O Functions538201 -Ref: I/O Functions-Footnote-1545419 -Node: Time Functions545566 -Ref: Time Functions-Footnote-1556054 -Ref: Time Functions-Footnote-2556122 -Ref: Time Functions-Footnote-3556280 -Ref: Time Functions-Footnote-4556391 -Ref: Time Functions-Footnote-5556503 -Ref: Time Functions-Footnote-6556730 -Node: Bitwise Functions556996 -Ref: table-bitwise-ops557558 -Ref: Bitwise Functions-Footnote-1561867 -Node: Type Functions562036 -Node: I18N Functions563187 -Node: User-defined564832 -Node: Definition Syntax565637 -Ref: Definition Syntax-Footnote-1571044 -Node: Function Example571115 -Ref: Function Example-Footnote-1574034 -Node: Function Caveats574056 -Node: Calling A Function574574 -Node: Variable Scope575532 -Node: Pass By Value/Reference578520 -Node: Return Statement582015 -Node: Dynamic Typing584996 -Node: Indirect Calls585925 -Ref: Indirect Calls-Footnote-1597227 -Node: Functions Summary597355 -Node: Library Functions600057 -Ref: Library Functions-Footnote-1603666 -Ref: Library Functions-Footnote-2603809 -Node: Library Names603980 -Ref: Library Names-Footnote-1607434 -Ref: Library Names-Footnote-2607657 -Node: General Functions607743 -Node: Strtonum Function608846 -Node: Assert Function611868 -Node: Round Function615192 -Node: Cliff Random Function616733 -Node: Ordinal Functions617749 -Ref: Ordinal Functions-Footnote-1620812 -Ref: Ordinal Functions-Footnote-2621064 -Node: Join Function621275 -Ref: Join Function-Footnote-1623044 -Node: Getlocaltime Function623244 -Node: Readfile Function626988 -Node: Shell Quoting628958 -Node: Data File Management630359 -Node: Filetrans Function630991 -Node: Rewind Function635047 -Node: File Checking636434 -Ref: File Checking-Footnote-1637766 -Node: Empty Files637967 -Node: Ignoring Assigns639946 -Node: Getopt Function641497 -Ref: Getopt Function-Footnote-1652959 -Node: Passwd Functions653159 -Ref: Passwd Functions-Footnote-1661996 -Node: Group Functions662084 -Ref: Group Functions-Footnote-1669978 -Node: Walking Arrays670191 -Node: Library Functions Summary671794 -Node: Library Exercises673195 -Node: Sample Programs674475 -Node: Running Examples675245 -Node: Clones675973 -Node: Cut Program677197 -Node: Egrep Program686916 -Ref: Egrep Program-Footnote-1694414 -Node: Id Program694524 -Node: Split Program698169 -Ref: Split Program-Footnote-1701617 -Node: Tee Program701745 -Node: Uniq Program704534 -Node: Wc Program711953 -Ref: Wc Program-Footnote-1716203 -Node: Miscellaneous Programs716297 -Node: Dupword Program717510 -Node: Alarm Program719541 -Node: Translate Program724345 -Ref: Translate Program-Footnote-1728910 -Node: Labels Program729180 -Ref: Labels Program-Footnote-1732531 -Node: Word Sorting732615 -Node: History Sorting736686 -Node: Extract Program738522 -Node: Simple Sed746047 -Node: Igawk Program749115 -Ref: Igawk Program-Footnote-1763439 -Ref: Igawk Program-Footnote-2763640 -Ref: Igawk Program-Footnote-3763762 -Node: Anagram Program763877 -Node: Signature Program766934 -Node: Programs Summary768181 -Node: Programs Exercises769374 -Ref: Programs Exercises-Footnote-1773505 -Node: Advanced Features773596 -Node: Nondecimal Data775544 -Node: Array Sorting777134 -Node: Controlling Array Traversal777831 -Ref: Controlling Array Traversal-Footnote-1786164 -Node: Array Sorting Functions786282 -Ref: Array Sorting Functions-Footnote-1790171 -Node: Two-way I/O790367 -Ref: Two-way I/O-Footnote-1795312 -Ref: Two-way I/O-Footnote-2795498 -Node: TCP/IP Networking795580 -Node: Profiling798453 -Node: Advanced Features Summary806000 -Node: Internationalization807933 -Node: I18N and L10N809413 -Node: Explaining gettext810099 -Ref: Explaining gettext-Footnote-1815124 -Ref: Explaining gettext-Footnote-2815308 -Node: Programmer i18n815473 -Ref: Programmer i18n-Footnote-1820339 -Node: Translator i18n820388 -Node: String Extraction821182 -Ref: String Extraction-Footnote-1822313 -Node: Printf Ordering822399 -Ref: Printf Ordering-Footnote-1825185 -Node: I18N Portability825249 -Ref: I18N Portability-Footnote-1827704 -Node: I18N Example827767 -Ref: I18N Example-Footnote-1830570 -Node: Gawk I18N830642 -Node: I18N Summary831280 -Node: Debugger832619 -Node: Debugging833641 -Node: Debugging Concepts834082 -Node: Debugging Terms835935 -Node: Awk Debugging838507 -Node: Sample Debugging Session839401 -Node: Debugger Invocation839921 -Node: Finding The Bug841305 -Node: List of Debugger Commands847780 -Node: Breakpoint Control849113 -Node: Debugger Execution Control852809 -Node: Viewing And Changing Data856173 -Node: Execution Stack859551 -Node: Debugger Info861188 -Node: Miscellaneous Debugger Commands865205 -Node: Readline Support870234 -Node: Limitations871126 -Node: Debugging Summary873240 -Node: Arbitrary Precision Arithmetic874408 -Node: Computer Arithmetic875824 -Ref: table-numeric-ranges879422 -Ref: Computer Arithmetic-Footnote-1880281 -Node: Math Definitions880338 -Ref: table-ieee-formats883626 -Ref: Math Definitions-Footnote-1884230 -Node: MPFR features884335 -Node: FP Math Caution886006 -Ref: FP Math Caution-Footnote-1887056 -Node: Inexactness of computations887425 -Node: Inexact representation888384 -Node: Comparing FP Values889741 -Node: Errors accumulate890823 -Node: Getting Accuracy892256 -Node: Try To Round894918 -Node: Setting precision895817 -Ref: table-predefined-precision-strings896501 -Node: Setting the rounding mode898290 -Ref: table-gawk-rounding-modes898654 -Ref: Setting the rounding mode-Footnote-1902109 -Node: Arbitrary Precision Integers902288 -Ref: Arbitrary Precision Integers-Footnote-1905274 -Node: POSIX Floating Point Problems905423 -Ref: POSIX Floating Point Problems-Footnote-1909296 -Node: Floating point summary909334 -Node: Dynamic Extensions911528 -Node: Extension Intro913080 -Node: Plugin License914346 -Node: Extension Mechanism Outline915143 -Ref: figure-load-extension915571 -Ref: figure-register-new-function917051 -Ref: figure-call-new-function918055 -Node: Extension API Description920041 -Node: Extension API Functions Introduction921491 -Node: General Data Types926315 -Ref: General Data Types-Footnote-1932054 -Node: Memory Allocation Functions932353 -Ref: Memory Allocation Functions-Footnote-1935192 -Node: Constructor Functions935288 -Node: Registration Functions937022 -Node: Extension Functions937707 -Node: Exit Callback Functions940004 -Node: Extension Version String941252 -Node: Input Parsers941917 -Node: Output Wrappers951796 -Node: Two-way processors956311 -Node: Printing Messages958515 -Ref: Printing Messages-Footnote-1959591 -Node: Updating `ERRNO'959743 -Node: Requesting Values960483 -Ref: table-value-types-returned961211 -Node: Accessing Parameters962168 -Node: Symbol Table Access963399 -Node: Symbol table by name963913 -Node: Symbol table by cookie965894 -Ref: Symbol table by cookie-Footnote-1970038 -Node: Cached values970101 -Ref: Cached values-Footnote-1973600 -Node: Array Manipulation973691 -Ref: Array Manipulation-Footnote-1974789 -Node: Array Data Types974826 -Ref: Array Data Types-Footnote-1977481 -Node: Array Functions977573 -Node: Flattening Arrays981427 -Node: Creating Arrays988319 -Node: Extension API Variables993090 -Node: Extension Versioning993726 -Node: Extension API Informational Variables995627 -Node: Extension API Boilerplate996692 -Node: Finding Extensions1000501 -Node: Extension Example1001061 -Node: Internal File Description1001833 -Node: Internal File Ops1005900 -Ref: Internal File Ops-Footnote-11017570 -Node: Using Internal File Ops1017710 -Ref: Using Internal File Ops-Footnote-11020093 -Node: Extension Samples1020366 -Node: Extension Sample File Functions1021892 -Node: Extension Sample Fnmatch1029530 -Node: Extension Sample Fork1031021 -Node: Extension Sample Inplace1032236 -Node: Extension Sample Ord1033911 -Node: Extension Sample Readdir1034747 -Ref: table-readdir-file-types1035623 -Node: Extension Sample Revout1036434 -Node: Extension Sample Rev2way1037024 -Node: Extension Sample Read write array1037764 -Node: Extension Sample Readfile1039704 -Node: Extension Sample Time1040799 -Node: Extension Sample API Tests1042148 -Node: gawkextlib1042639 -Node: Extension summary1045297 -Node: Extension Exercises1048986 -Node: Language History1049708 -Node: V7/SVR3.11051364 -Node: SVR41053545 -Node: POSIX1054990 -Node: BTL1056379 -Node: POSIX/GNU1057113 -Node: Feature History1062677 -Node: Common Extensions1075775 -Node: Ranges and Locales1077099 -Ref: Ranges and Locales-Footnote-11081717 -Ref: Ranges and Locales-Footnote-21081744 -Ref: Ranges and Locales-Footnote-31081978 -Node: Contributors1082199 -Node: History summary1087740 -Node: Installation1089110 -Node: Gawk Distribution1090056 -Node: Getting1090540 -Node: Extracting1091363 -Node: Distribution contents1092998 -Node: Unix Installation1098715 -Node: Quick Installation1099332 -Node: Additional Configuration Options1101756 -Node: Configuration Philosophy1103494 -Node: Non-Unix Installation1105863 -Node: PC Installation1106321 -Node: PC Binary Installation1107640 -Node: PC Compiling1109488 -Ref: PC Compiling-Footnote-11112509 -Node: PC Testing1112618 -Node: PC Using1113794 -Node: Cygwin1117909 -Node: MSYS1118732 -Node: VMS Installation1119232 -Node: VMS Compilation1120024 -Ref: VMS Compilation-Footnote-11121246 -Node: VMS Dynamic Extensions1121304 -Node: VMS Installation Details1122988 -Node: VMS Running1125240 -Node: VMS GNV1128076 -Node: VMS Old Gawk1128810 -Node: Bugs1129280 -Node: Other Versions1133163 -Node: Installation summary1139587 -Node: Notes1140643 -Node: Compatibility Mode1141508 -Node: Additions1142290 -Node: Accessing The Source1143215 -Node: Adding Code1144650 -Node: New Ports1150815 -Node: Derived Files1155297 -Ref: Derived Files-Footnote-11160772 -Ref: Derived Files-Footnote-21160806 -Ref: Derived Files-Footnote-31161402 -Node: Future Extensions1161516 -Node: Implementation Limitations1162122 -Node: Extension Design1163370 -Node: Old Extension Problems1164524 -Ref: Old Extension Problems-Footnote-11166041 -Node: Extension New Mechanism Goals1166098 -Ref: Extension New Mechanism Goals-Footnote-11169458 -Node: Extension Other Design Decisions1169647 -Node: Extension Future Growth1171755 -Node: Old Extension Mechanism1172591 -Node: Notes summary1174353 -Node: Basic Concepts1175539 -Node: Basic High Level1176220 -Ref: figure-general-flow1176492 -Ref: figure-process-flow1177091 -Ref: Basic High Level-Footnote-11180320 -Node: Basic Data Typing1180505 -Node: Glossary1183833 -Node: Copying1208991 -Node: GNU Free Documentation License1246547 -Node: Index1271683 +Node: Leftmost Longest175687 +Node: Computed Regexps176989 +Node: GNU Regexp Operators180418 +Node: Case-sensitivity184090 +Ref: Case-sensitivity-Footnote-1186975 +Ref: Case-sensitivity-Footnote-2187210 +Node: Regexp Summary187318 +Node: Reading Files188785 +Node: Records190878 +Node: awk split records191611 +Node: gawk split records196540 +Ref: gawk split records-Footnote-1201079 +Node: Fields201116 +Ref: Fields-Footnote-1203894 +Node: Nonconstant Fields203980 +Ref: Nonconstant Fields-Footnote-1206218 +Node: Changing Fields206421 +Node: Field Separators212352 +Node: Default Field Splitting215056 +Node: Regexp Field Splitting216173 +Node: Single Character Fields219523 +Node: Command Line Field Separator220582 +Node: Full Line Fields223799 +Ref: Full Line Fields-Footnote-1225320 +Ref: Full Line Fields-Footnote-2225366 +Node: Field Splitting Summary225467 +Node: Constant Size227541 +Node: Splitting By Content232124 +Ref: Splitting By Content-Footnote-1236089 +Node: Multiple Line236252 +Ref: Multiple Line-Footnote-1242133 +Node: Getline242312 +Node: Plain Getline244519 +Node: Getline/Variable247159 +Node: Getline/File248308 +Node: Getline/Variable/File249693 +Ref: Getline/Variable/File-Footnote-1251296 +Node: Getline/Pipe251383 +Node: Getline/Variable/Pipe254061 +Node: Getline/Coprocess255192 +Node: Getline/Variable/Coprocess256456 +Node: Getline Notes257195 +Node: Getline Summary259989 +Ref: table-getline-variants260401 +Node: Read Timeout261230 +Ref: Read Timeout-Footnote-1265067 +Node: Command-line directories265125 +Node: Input Summary266030 +Node: Input Exercises269415 +Node: Printing270143 +Node: Print271920 +Node: Print Examples273377 +Node: Output Separators276156 +Node: OFMT278174 +Node: Printf279529 +Node: Basic Printf280314 +Node: Control Letters281886 +Node: Format Modifiers285871 +Node: Printf Examples291881 +Node: Redirection294367 +Node: Special FD301205 +Ref: Special FD-Footnote-1304371 +Node: Special Files304445 +Node: Other Inherited Files305062 +Node: Special Network306062 +Node: Special Caveats306924 +Node: Close Files And Pipes307873 +Ref: Close Files And Pipes-Footnote-1315064 +Ref: Close Files And Pipes-Footnote-2315212 +Node: Output Summary315362 +Node: Output Exercises316360 +Node: Expressions317040 +Node: Values318225 +Node: Constants318903 +Node: Scalar Constants319594 +Ref: Scalar Constants-Footnote-1320453 +Node: Nondecimal-numbers320703 +Node: Regexp Constants323721 +Node: Using Constant Regexps324246 +Node: Variables327389 +Node: Using Variables328044 +Node: Assignment Options329955 +Node: Conversion331830 +Node: Strings And Numbers332354 +Ref: Strings And Numbers-Footnote-1335419 +Node: Locale influences conversions335528 +Ref: table-locale-affects338275 +Node: All Operators338863 +Node: Arithmetic Ops339493 +Node: Concatenation341998 +Ref: Concatenation-Footnote-1344817 +Node: Assignment Ops344923 +Ref: table-assign-ops349902 +Node: Increment Ops351174 +Node: Truth Values and Conditions354612 +Node: Truth Values355697 +Node: Typing and Comparison356746 +Node: Variable Typing357556 +Node: Comparison Operators361209 +Ref: table-relational-ops361619 +Node: POSIX String Comparison365114 +Ref: POSIX String Comparison-Footnote-1366186 +Node: Boolean Ops366324 +Ref: Boolean Ops-Footnote-1370803 +Node: Conditional Exp370894 +Node: Function Calls372621 +Node: Precedence376501 +Node: Locales380162 +Node: Expressions Summary381794 +Node: Patterns and Actions384354 +Node: Pattern Overview385474 +Node: Regexp Patterns387153 +Node: Expression Patterns387696 +Node: Ranges391406 +Node: BEGIN/END394512 +Node: Using BEGIN/END395273 +Ref: Using BEGIN/END-Footnote-1398007 +Node: I/O And BEGIN/END398113 +Node: BEGINFILE/ENDFILE400427 +Node: Empty403328 +Node: Using Shell Variables403645 +Node: Action Overview405918 +Node: Statements408244 +Node: If Statement410092 +Node: While Statement411587 +Node: Do Statement413616 +Node: For Statement414760 +Node: Switch Statement417917 +Node: Break Statement420299 +Node: Continue Statement422340 +Node: Next Statement424167 +Node: Nextfile Statement426548 +Node: Exit Statement429178 +Node: Built-in Variables431581 +Node: User-modified432714 +Ref: User-modified-Footnote-1440395 +Node: Auto-set440457 +Ref: Auto-set-Footnote-1453492 +Ref: Auto-set-Footnote-2453697 +Node: ARGC and ARGV453753 +Node: Pattern Action Summary457971 +Node: Arrays460398 +Node: Array Basics461727 +Node: Array Intro462571 +Ref: figure-array-elements464535 +Ref: Array Intro-Footnote-1467061 +Node: Reference to Elements467189 +Node: Assigning Elements469641 +Node: Array Example470132 +Node: Scanning an Array471890 +Node: Controlling Scanning474906 +Ref: Controlling Scanning-Footnote-1480102 +Node: Numeric Array Subscripts480418 +Node: Uninitialized Subscripts482603 +Node: Delete484220 +Ref: Delete-Footnote-1486963 +Node: Multidimensional487020 +Node: Multiscanning490117 +Node: Arrays of Arrays491706 +Node: Arrays Summary496465 +Node: Functions498557 +Node: Built-in499456 +Node: Calling Built-in500534 +Node: Numeric Functions502525 +Ref: Numeric Functions-Footnote-1506542 +Ref: Numeric Functions-Footnote-2506899 +Ref: Numeric Functions-Footnote-3506947 +Node: String Functions507219 +Ref: String Functions-Footnote-1530694 +Ref: String Functions-Footnote-2530823 +Ref: String Functions-Footnote-3531071 +Node: Gory Details531158 +Ref: table-sub-escapes532939 +Ref: table-sub-proposed534459 +Ref: table-posix-sub535823 +Ref: table-gensub-escapes537359 +Ref: Gory Details-Footnote-1538191 +Node: I/O Functions538342 +Ref: I/O Functions-Footnote-1545560 +Node: Time Functions545707 +Ref: Time Functions-Footnote-1556195 +Ref: Time Functions-Footnote-2556263 +Ref: Time Functions-Footnote-3556421 +Ref: Time Functions-Footnote-4556532 +Ref: Time Functions-Footnote-5556644 +Ref: Time Functions-Footnote-6556871 +Node: Bitwise Functions557137 +Ref: table-bitwise-ops557699 +Ref: Bitwise Functions-Footnote-1562008 +Node: Type Functions562177 +Node: I18N Functions563328 +Node: User-defined564973 +Node: Definition Syntax565778 +Ref: Definition Syntax-Footnote-1571185 +Node: Function Example571256 +Ref: Function Example-Footnote-1574175 +Node: Function Caveats574197 +Node: Calling A Function574715 +Node: Variable Scope575673 +Node: Pass By Value/Reference578661 +Node: Return Statement582156 +Node: Dynamic Typing585137 +Node: Indirect Calls586066 +Ref: Indirect Calls-Footnote-1597368 +Node: Functions Summary597496 +Node: Library Functions600198 +Ref: Library Functions-Footnote-1603807 +Ref: Library Functions-Footnote-2603950 +Node: Library Names604121 +Ref: Library Names-Footnote-1607575 +Ref: Library Names-Footnote-2607798 +Node: General Functions607884 +Node: Strtonum Function608987 +Node: Assert Function612009 +Node: Round Function615333 +Node: Cliff Random Function616874 +Node: Ordinal Functions617890 +Ref: Ordinal Functions-Footnote-1620953 +Ref: Ordinal Functions-Footnote-2621205 +Node: Join Function621416 +Ref: Join Function-Footnote-1623185 +Node: Getlocaltime Function623385 +Node: Readfile Function627129 +Node: Shell Quoting629099 +Node: Data File Management630500 +Node: Filetrans Function631132 +Node: Rewind Function635188 +Node: File Checking636575 +Ref: File Checking-Footnote-1637907 +Node: Empty Files638108 +Node: Ignoring Assigns640087 +Node: Getopt Function641638 +Ref: Getopt Function-Footnote-1653100 +Node: Passwd Functions653300 +Ref: Passwd Functions-Footnote-1662137 +Node: Group Functions662225 +Ref: Group Functions-Footnote-1670119 +Node: Walking Arrays670332 +Node: Library Functions Summary671935 +Node: Library Exercises673336 +Node: Sample Programs674616 +Node: Running Examples675386 +Node: Clones676114 +Node: Cut Program677338 +Node: Egrep Program687057 +Ref: Egrep Program-Footnote-1694555 +Node: Id Program694665 +Node: Split Program698310 +Ref: Split Program-Footnote-1701758 +Node: Tee Program701886 +Node: Uniq Program704675 +Node: Wc Program712094 +Ref: Wc Program-Footnote-1716344 +Node: Miscellaneous Programs716438 +Node: Dupword Program717651 +Node: Alarm Program719682 +Node: Translate Program724486 +Ref: Translate Program-Footnote-1729051 +Node: Labels Program729321 +Ref: Labels Program-Footnote-1732672 +Node: Word Sorting732756 +Node: History Sorting736827 +Node: Extract Program738663 +Node: Simple Sed746188 +Node: Igawk Program749256 +Ref: Igawk Program-Footnote-1763580 +Ref: Igawk Program-Footnote-2763781 +Ref: Igawk Program-Footnote-3763903 +Node: Anagram Program764018 +Node: Signature Program767075 +Node: Programs Summary768322 +Node: Programs Exercises769515 +Ref: Programs Exercises-Footnote-1773646 +Node: Advanced Features773737 +Node: Nondecimal Data775685 +Node: Array Sorting777275 +Node: Controlling Array Traversal777972 +Ref: Controlling Array Traversal-Footnote-1786305 +Node: Array Sorting Functions786423 +Ref: Array Sorting Functions-Footnote-1790312 +Node: Two-way I/O790508 +Ref: Two-way I/O-Footnote-1795453 +Ref: Two-way I/O-Footnote-2795639 +Node: TCP/IP Networking795721 +Node: Profiling798594 +Node: Advanced Features Summary806141 +Node: Internationalization808074 +Node: I18N and L10N809554 +Node: Explaining gettext810240 +Ref: Explaining gettext-Footnote-1815265 +Ref: Explaining gettext-Footnote-2815449 +Node: Programmer i18n815614 +Ref: Programmer i18n-Footnote-1820480 +Node: Translator i18n820529 +Node: String Extraction821323 +Ref: String Extraction-Footnote-1822454 +Node: Printf Ordering822540 +Ref: Printf Ordering-Footnote-1825326 +Node: I18N Portability825390 +Ref: I18N Portability-Footnote-1827845 +Node: I18N Example827908 +Ref: I18N Example-Footnote-1830711 +Node: Gawk I18N830783 +Node: I18N Summary831421 +Node: Debugger832760 +Node: Debugging833782 +Node: Debugging Concepts834223 +Node: Debugging Terms836076 +Node: Awk Debugging838648 +Node: Sample Debugging Session839542 +Node: Debugger Invocation840062 +Node: Finding The Bug841446 +Node: List of Debugger Commands847921 +Node: Breakpoint Control849254 +Node: Debugger Execution Control852950 +Node: Viewing And Changing Data856314 +Node: Execution Stack859692 +Node: Debugger Info861329 +Node: Miscellaneous Debugger Commands865346 +Node: Readline Support870375 +Node: Limitations871267 +Node: Debugging Summary873381 +Node: Arbitrary Precision Arithmetic874549 +Node: Computer Arithmetic875965 +Ref: table-numeric-ranges879563 +Ref: Computer Arithmetic-Footnote-1880422 +Node: Math Definitions880479 +Ref: table-ieee-formats883767 +Ref: Math Definitions-Footnote-1884371 +Node: MPFR features884476 +Node: FP Math Caution886147 +Ref: FP Math Caution-Footnote-1887197 +Node: Inexactness of computations887566 +Node: Inexact representation888525 +Node: Comparing FP Values889882 +Node: Errors accumulate890964 +Node: Getting Accuracy892397 +Node: Try To Round895059 +Node: Setting precision895958 +Ref: table-predefined-precision-strings896642 +Node: Setting the rounding mode898431 +Ref: table-gawk-rounding-modes898795 +Ref: Setting the rounding mode-Footnote-1902250 +Node: Arbitrary Precision Integers902429 +Ref: Arbitrary Precision Integers-Footnote-1905415 +Node: POSIX Floating Point Problems905564 +Ref: POSIX Floating Point Problems-Footnote-1909437 +Node: Floating point summary909475 +Node: Dynamic Extensions911669 +Node: Extension Intro913221 +Node: Plugin License914487 +Node: Extension Mechanism Outline915284 +Ref: figure-load-extension915712 +Ref: figure-register-new-function917192 +Ref: figure-call-new-function918196 +Node: Extension API Description920182 +Node: Extension API Functions Introduction921632 +Node: General Data Types926456 +Ref: General Data Types-Footnote-1932195 +Node: Memory Allocation Functions932494 +Ref: Memory Allocation Functions-Footnote-1935333 +Node: Constructor Functions935429 +Node: Registration Functions937163 +Node: Extension Functions937848 +Node: Exit Callback Functions940145 +Node: Extension Version String941393 +Node: Input Parsers942058 +Node: Output Wrappers951937 +Node: Two-way processors956452 +Node: Printing Messages958656 +Ref: Printing Messages-Footnote-1959732 +Node: Updating `ERRNO'959884 +Node: Requesting Values960624 +Ref: table-value-types-returned961352 +Node: Accessing Parameters962309 +Node: Symbol Table Access963540 +Node: Symbol table by name964054 +Node: Symbol table by cookie966035 +Ref: Symbol table by cookie-Footnote-1970179 +Node: Cached values970242 +Ref: Cached values-Footnote-1973741 +Node: Array Manipulation973832 +Ref: Array Manipulation-Footnote-1974930 +Node: Array Data Types974967 +Ref: Array Data Types-Footnote-1977622 +Node: Array Functions977714 +Node: Flattening Arrays981568 +Node: Creating Arrays988460 +Node: Extension API Variables993231 +Node: Extension Versioning993867 +Node: Extension API Informational Variables995768 +Node: Extension API Boilerplate996833 +Node: Finding Extensions1000642 +Node: Extension Example1001202 +Node: Internal File Description1001974 +Node: Internal File Ops1006041 +Ref: Internal File Ops-Footnote-11017711 +Node: Using Internal File Ops1017851 +Ref: Using Internal File Ops-Footnote-11020234 +Node: Extension Samples1020507 +Node: Extension Sample File Functions1022033 +Node: Extension Sample Fnmatch1029671 +Node: Extension Sample Fork1031162 +Node: Extension Sample Inplace1032377 +Node: Extension Sample Ord1034052 +Node: Extension Sample Readdir1034888 +Ref: table-readdir-file-types1035764 +Node: Extension Sample Revout1036575 +Node: Extension Sample Rev2way1037165 +Node: Extension Sample Read write array1037905 +Node: Extension Sample Readfile1039845 +Node: Extension Sample Time1040940 +Node: Extension Sample API Tests1042289 +Node: gawkextlib1042780 +Node: Extension summary1045438 +Node: Extension Exercises1049127 +Node: Language History1049849 +Node: V7/SVR3.11051505 +Node: SVR41053686 +Node: POSIX1055131 +Node: BTL1056520 +Node: POSIX/GNU1057254 +Node: Feature History1062818 +Node: Common Extensions1075916 +Node: Ranges and Locales1077240 +Ref: Ranges and Locales-Footnote-11081858 +Ref: Ranges and Locales-Footnote-21081885 +Ref: Ranges and Locales-Footnote-31082119 +Node: Contributors1082340 +Node: History summary1087881 +Node: Installation1089251 +Node: Gawk Distribution1090197 +Node: Getting1090681 +Node: Extracting1091504 +Node: Distribution contents1093139 +Node: Unix Installation1098856 +Node: Quick Installation1099473 +Node: Additional Configuration Options1101897 +Node: Configuration Philosophy1103635 +Node: Non-Unix Installation1106004 +Node: PC Installation1106462 +Node: PC Binary Installation1107781 +Node: PC Compiling1109629 +Ref: PC Compiling-Footnote-11112650 +Node: PC Testing1112759 +Node: PC Using1113935 +Node: Cygwin1118050 +Node: MSYS1118873 +Node: VMS Installation1119373 +Node: VMS Compilation1120165 +Ref: VMS Compilation-Footnote-11121387 +Node: VMS Dynamic Extensions1121445 +Node: VMS Installation Details1123129 +Node: VMS Running1125381 +Node: VMS GNV1128217 +Node: VMS Old Gawk1128951 +Node: Bugs1129421 +Node: Other Versions1133304 +Node: Installation summary1139728 +Node: Notes1140784 +Node: Compatibility Mode1141649 +Node: Additions1142431 +Node: Accessing The Source1143356 +Node: Adding Code1144791 +Node: New Ports1150948 +Node: Derived Files1155430 +Ref: Derived Files-Footnote-11160905 +Ref: Derived Files-Footnote-21160939 +Ref: Derived Files-Footnote-31161535 +Node: Future Extensions1161649 +Node: Implementation Limitations1162255 +Node: Extension Design1163503 +Node: Old Extension Problems1164657 +Ref: Old Extension Problems-Footnote-11166174 +Node: Extension New Mechanism Goals1166231 +Ref: Extension New Mechanism Goals-Footnote-11169591 +Node: Extension Other Design Decisions1169780 +Node: Extension Future Growth1171888 +Node: Old Extension Mechanism1172724 +Node: Notes summary1174486 +Node: Basic Concepts1175672 +Node: Basic High Level1176353 +Ref: figure-general-flow1176625 +Ref: figure-process-flow1177224 +Ref: Basic High Level-Footnote-11180453 +Node: Basic Data Typing1180638 +Node: Glossary1183966 +Node: Copying1209124 +Node: GNU Free Documentation License1246680 +Node: Index1271816  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index ad4bae1e..175c7af0 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -5716,11 +5716,11 @@ and numeric characters in your character set. @c Date: Tue, 01 Jul 2014 07:39:51 +0200 @c From: Hermann Peifer 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 @@ -5749,8 +5749,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. @@ -5779,7 +5779,7 @@ echo aaaabcd | awk '@{ sub(/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{}. The input contains four @samp{a} characters. @@ -5833,14 +5833,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 @@ -6040,7 +6040,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 @@ -6059,14 +6059,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 @@ -6299,7 +6299,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}). @@ -6350,8 +6350,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 @@ -6374,8 +6374,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 @@ -6436,8 +6436,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 @@ -6532,7 +6532,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. @@ -6713,11 +6713,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: @@ -6743,7 +6743,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: @@ -6798,13 +6798,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 @@ -6984,7 +6984,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 @@ -7013,7 +7013,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 @@ -7038,7 +7038,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 @@ -7132,7 +7132,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 @@ -7393,7 +7393,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 @@ -7439,7 +7439,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 @@ -7452,10 +7452,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 @}' @@ -7476,6 +7473,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 @end docbook @@ -7492,7 +7493,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 @@ -7505,10 +7506,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 @}' @@ -7528,6 +7526,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 @@ -7739,7 +7741,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") @@ -7775,14 +7777,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 @@ -7868,8 +7870,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 = "([^,]*)|(\"[^\"]+\")" @@ -7879,9 +7881,9 @@ 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 @@ -7924,7 +7926,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. @@ -7939,10 +7941,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{""}) @@ -7957,7 +7959,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 @@ -7965,10 +7967,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 @@ -8064,7 +8066,7 @@ then @command{gawk} sets @code{RT} to the null string. @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. @@ -8248,7 +8250,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. @@ -8263,7 +8265,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 @@ -8441,7 +8443,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 @@ -8489,7 +8491,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. @@ -8499,7 +8501,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" @@ -8582,7 +8584,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 @@ -8590,9 +8592,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. @@ -8601,7 +8609,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 @@ -8618,7 +8626,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}. @@ -8660,8 +8668,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} @@ -8692,7 +8700,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. @@ -8742,7 +8750,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 @@ -8808,7 +8816,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. @@ -8824,12 +8832,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 @@ -8846,11 +8854,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 @@ -8959,7 +8967,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 @@ -9150,7 +9158,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}). @@ -9221,7 +9229,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 @@ -9252,7 +9260,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 @@ -9299,8 +9307,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 @@ -9337,7 +9345,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 @@ -9581,7 +9589,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 @@ -9627,7 +9635,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. @@ -9687,7 +9695,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. @@ -9740,7 +9748,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 @@ -9779,7 +9787,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 @@ -9810,15 +9818,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{|&} @@ -9843,7 +9859,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.) @@ -9936,7 +9952,7 @@ command lines to be fed to the shell. @end ifnotdocbook @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 @@ -9949,7 +9965,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 @@ -9987,7 +10003,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 @@ -10032,7 +10048,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. @@ -10058,7 +10074,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 @@ -10115,7 +10131,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 @@ -10128,7 +10144,7 @@ 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. @@ -10350,9 +10366,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. @@ -10407,9 +10423,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. @@ -10429,8 +10445,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 @@ -38192,7 +38208,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}) @@ -38470,7 +38486,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}. @@ -38479,7 +38495,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 diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 7379a9c9..f112b351 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -5544,11 +5544,11 @@ and numeric characters in your character set. @c Date: Tue, 01 Jul 2014 07:39:51 +0200 @c From: Hermann Peifer 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 @@ -5577,8 +5577,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. @@ -5607,7 +5607,7 @@ echo aaaabcd | awk '@{ sub(/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{}. The input contains four @samp{a} characters. @@ -5661,14 +5661,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 @@ -5824,7 +5824,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 @@ -5843,14 +5843,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 @@ -6083,7 +6083,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}). @@ -6134,8 +6134,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 @@ -6158,8 +6158,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 @@ -6220,8 +6220,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 @@ -6316,7 +6316,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. @@ -6440,11 +6440,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: @@ -6470,7 +6470,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: @@ -6525,13 +6525,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 @@ -6711,7 +6711,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 @@ -6735,7 +6735,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 @@ -6828,7 +6828,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 @@ -7089,7 +7089,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 @@ -7130,7 +7130,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 @@ -7143,10 +7143,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 @}' @@ -7166,6 +7163,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 @@ -7340,7 +7341,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") @@ -7376,14 +7377,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 @@ -7469,8 +7470,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 = "([^,]*)|(\"[^\"]+\")" @@ -7480,9 +7481,9 @@ 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 @@ -7525,7 +7526,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. @@ -7540,10 +7541,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{""}) @@ -7558,7 +7559,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 @@ -7566,10 +7567,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 @@ -7665,7 +7666,7 @@ then @command{gawk} sets @code{RT} to the null string. @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. @@ -7849,7 +7850,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. @@ -7864,7 +7865,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 @@ -8042,7 +8043,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 @@ -8090,7 +8091,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. @@ -8100,7 +8101,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" @@ -8183,7 +8184,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 @@ -8191,9 +8192,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. @@ -8202,7 +8209,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 @@ -8219,7 +8226,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}. @@ -8261,8 +8268,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} @@ -8293,7 +8300,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. @@ -8343,7 +8350,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 @@ -8409,7 +8416,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. @@ -8425,12 +8432,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 @@ -8447,11 +8454,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 @@ -8560,7 +8567,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 @@ -8751,7 +8758,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}). @@ -8822,7 +8829,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 @@ -8853,7 +8860,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 @@ -8900,8 +8907,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 @@ -8938,7 +8945,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 @@ -9182,7 +9189,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 @@ -9228,7 +9235,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. @@ -9288,7 +9295,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. @@ -9341,7 +9348,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 @@ -9380,7 +9387,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 @@ -9411,15 +9418,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{|&} @@ -9444,7 +9459,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.) @@ -9496,7 +9511,7 @@ command lines to be fed to the shell. @end sidebar @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 @@ -9509,7 +9524,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 @@ -9547,7 +9562,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 @@ -9592,7 +9607,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. @@ -9618,7 +9633,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 @@ -9675,7 +9690,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 @@ -9688,7 +9703,7 @@ 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. @@ -9905,9 +9920,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. @@ -9926,8 +9941,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 @@ -37285,7 +37300,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}) @@ -37563,7 +37578,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}. @@ -37572,7 +37587,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 -- cgit v1.2.3 From 27522378506a1102a77a15d6db3b6682003f0c99 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 23 Jan 2015 13:58:57 +0200 Subject: Minor doc edit. --- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/gawk.texi b/doc/gawk.texi index 175c7af0..b2837f3c 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -9433,7 +9433,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 diff --git a/doc/gawktexi.in b/doc/gawktexi.in index f112b351..ade6466f 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -9033,7 +9033,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 -- cgit v1.2.3 From 65f80a8ce75f050e30a400ff5eee3c08366bb518 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 23 Jan 2015 14:06:20 +0200 Subject: Add more entries to the glossary. --- doc/ChangeLog | 1 + doc/gawk.info | 227 ++++++++++++++++++++++++++++++++++++++++++++++---------- doc/gawk.texi | 160 ++++++++++++++++++++++++++++++++++++++- doc/gawktexi.in | 160 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 500 insertions(+), 48 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d16c7c7e..2088bb0e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2015-01-23 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. + (Glossary): Many new entries from Antonio Giovanni Columbo. 2015-01-21 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index 2a17cbcf..365ca95c 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -29443,6 +29443,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. @@ -29478,6 +29493,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 @@ -29506,6 +29541,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 @@ -29533,9 +29581,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 @@ -29563,10 +29627,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' @@ -29580,6 +29655,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.) @@ -29686,6 +29767,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 @@ -29701,9 +29788,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'. @@ -29799,6 +29893,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 @@ -29836,6 +29936,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. @@ -29855,6 +29962,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. @@ -29870,6 +29982,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 @@ -29893,6 +30008,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, @@ -29909,6 +30027,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." @@ -29927,6 +30055,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". @@ -29988,6 +30125,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 @@ -30030,10 +30172,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 @@ -31629,7 +31776,7 @@ Index (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) @@ -31801,7 +31948,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) @@ -31883,7 +32030,7 @@ 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) @@ -31925,7 +32072,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. @@ -31936,7 +32083,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) @@ -32013,7 +32160,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) @@ -32059,7 +32206,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. @@ -32083,7 +32230,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. @@ -32429,7 +32576,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. @@ -32675,10 +32822,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) @@ -32692,7 +32839,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. @@ -32839,7 +32986,7 @@ Index (line 63) * gawkextlib: gawkextlib. (line 6) * gawkextlib project: gawkextlib. (line 6) -* 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) @@ -32897,18 +33044,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) @@ -33040,20 +33187,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) * 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) @@ -33062,7 +33209,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) @@ -33103,8 +33250,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) @@ -33149,7 +33296,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) @@ -33211,7 +33358,7 @@ Index * mawk utility <4>: Getline/Pipe. (line 62) * mawk utility: Escape Sequences. (line 117) * maximum precision supported by MPFR library: Auto-set. (line 221) -* 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. @@ -33239,7 +33386,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) @@ -33327,7 +33474,7 @@ Index * OFS variable <1>: User-modified. (line 113) * 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) @@ -33600,7 +33747,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) @@ -33962,7 +34109,7 @@ Index * square root: Numeric Functions. (line 77) * srand: Numeric Functions. (line 81) * 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) @@ -34147,14 +34294,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 117) * Unix awk, close() function and: Close Files And Pipes. @@ -34854,8 +35001,8 @@ Ref: figure-process-flow1177224 Ref: Basic High Level-Footnote-11180453 Node: Basic Data Typing1180638 Node: Glossary1183966 -Node: Copying1209124 -Node: GNU Free Documentation License1246680 -Node: Index1271816 +Node: Copying1215912 +Node: GNU Free Documentation License1253468 +Node: Index1278604  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index b2837f3c..c6fb0375 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -39610,6 +39610,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. @@ -39651,6 +39666,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 @@ -39682,6 +39716,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 @@ -39735,9 +39782,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 @@ -39777,11 +39840,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 @@ -39796,6 +39871,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 @@ -39950,6 +40032,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}.) @@ -39967,10 +40054,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}. @@ -40094,6 +40192,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 @@ -40133,6 +40237,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. @@ -40153,6 +40265,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. @@ -40167,6 +40284,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 @@ -40191,6 +40311,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. @@ -40208,6 +40331,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.'' @@ -40225,6 +40357,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}. @@ -40284,6 +40425,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 @@ -40334,9 +40481,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 ade6466f..e360a83b 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -38702,6 +38702,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. @@ -38743,6 +38758,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 @@ -38774,6 +38808,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 @@ -38827,9 +38874,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 @@ -38869,11 +38932,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 @@ -38888,6 +38963,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 @@ -39042,6 +39124,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}.) @@ -39059,10 +39146,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}. @@ -39186,6 +39284,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 @@ -39225,6 +39329,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. @@ -39245,6 +39357,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. @@ -39259,6 +39376,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 @@ -39283,6 +39403,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. @@ -39300,6 +39423,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.'' @@ -39317,6 +39449,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}. @@ -39376,6 +39517,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 @@ -39426,9 +39573,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 -- cgit v1.2.3 From 48f9d87c455f0804424977e2a2185de94bc2b0a3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 24 Jan 2015 19:46:06 +0200 Subject: Move to Bison 3.0.4. --- ChangeLog | 6 ++++++ NEWS | 2 +- awkgram.c | 4 ++-- command.c | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57663dc9..425ad1da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-01-24 Arnold D. Robbins + + Infrastructure updates. + + Bison 3.0.4. + 2015-01-20 Arnold D. Robbins * gawkapi.c (api_set_array_element): Remove useless call to diff --git a/NEWS b/NEWS index cbb2d227..4aebe68b 100644 --- a/NEWS +++ b/NEWS @@ -42,7 +42,7 @@ Changes from 4.1.1 to 4.1.2 has been updated and clarified. 10. Infrastructure upgrades: Automake 1.14.1, Gettext 0.19.3, Libtool 2.4.3, - Bison 3.0.3. + Bison 3.0.4. XX. A number of bugs have been fixed. See the ChangeLog. diff --git a/awkgram.c b/awkgram.c index 2407d220..53e35d2d 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" 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" -- cgit v1.2.3 From eccbbe18b119f60bcb4e33259f43f6f3cc0d2581 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 24 Jan 2015 19:51:55 +0200 Subject: Move to Automake 1.15. --- ChangeLog | 2 +- INSTALL | 6 +- Makefile.in | 47 ++++++----- aclocal.m4 | 65 ++++++++------- awklib/Makefile.in | 24 ++++-- compile | 2 +- config.guess | 169 +++------------------------------------ config.sub | 32 +++++--- configure | 13 +-- configure.ac | 2 +- depcomp | 37 ++++++++- doc/Makefile.in | 24 ++++-- extension/ChangeLog | 6 ++ extension/INSTALL | 6 +- extension/Makefile.in | 66 ++++++++------- extension/aclocal.m4 | 67 ++++++++-------- extension/build-aux/ar-lib | 2 +- extension/build-aux/compile | 2 +- extension/build-aux/config.guess | 169 +++------------------------------------ extension/build-aux/config.sub | 32 +++++--- extension/build-aux/depcomp | 37 ++++++++- extension/build-aux/install-sh | 31 +++++-- extension/build-aux/missing | 6 +- extension/configure | 13 +-- extension/configure.ac | 2 +- install-sh | 31 +++++-- missing | 6 +- test/Makefile.in | 26 ++++-- ylwrap | 59 ++++++++------ 29 files changed, 455 insertions(+), 529 deletions(-) diff --git a/ChangeLog b/ChangeLog index 425ad1da..06b07429 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ Infrastructure updates. - Bison 3.0.4. + Bison 3.0.4. Automake 1.15. 2015-01-20 Arnold D. Robbins 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 3f19f5fd..e93a6e60 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,12 +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 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 \ @@ -123,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 @@ -256,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 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) @@ -568,7 +578,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*) \ @@ -911,15 +920,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) @@ -955,17 +964,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 \ @@ -1155,6 +1164,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/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 # # 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/awklib/Makefile.in b/awklib/Makefile.in index 8555206c..610b6ee1 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, @@ -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 \ ?) ;; \ @@ -102,8 +112,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 \ @@ -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 = @@ -212,6 +221,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 @@ -370,7 +381,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*) \ @@ -698,6 +708,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-local \ uninstall-binSCRIPTS uninstall-local \ uninstall-pkglibexecPROGRAMS +.PRECIOUS: Makefile + all: $(srcdir)/stamp-eg $(AUXPROGS) igawk $(AUXAWK) 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 . # # 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 . 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 < -# include -#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 - 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 -# 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 <. # # 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 8e2cc7ca..605a7d17 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"} # 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 diff --git a/configure.ac b/configure.ac index 8d03ca1a..247d0838 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]) 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/Makefile.in b/doc/Makefile.in index b8743d28..30a371d7 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/extension/ChangeLog b/extension/ChangeLog index 582a3440..5a5a50ca 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2015-01-24 Arnold D. Robbins + + Infrastructure updates. + + Automake 1.15. + 2015-01-07 Arnold D. Robbins * 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..66f03ecb 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,21 +112,6 @@ 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 \ @@ -129,6 +124,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/dirfd.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 @@ -333,6 +330,20 @@ 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.rpath \ + $(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) @@ -606,7 +617,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 +1003,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 +1047,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 +1248,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..d1458f3c 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 # # 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, 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 . # # 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 . # # 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 . 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 < -# include -#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 - 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 -# 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 <. # # 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. @@ -191,6 +203,15 @@ if test $# -eq 0; then exit 0 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 @@ -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/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 , 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/configure b/extension/configure index 7ee9c0df..b51617de 100755 --- a/extension/configure +++ b/extension/configure @@ -2371,8 +2371,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 +3685,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 +3874,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 +4265,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # 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,6 +4453,7 @@ 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. diff --git a/extension/configure.ac b/extension/configure.ac index 1f876a0e..172ae1cc 100644 --- a/extension/configure.ac +++ b/extension/configure.ac @@ -33,7 +33,7 @@ AC_USE_SYSTEM_EXTENSIONS INSTALL="$ac_aux_dir/install-sh -c" export INSTALL -AM_INIT_AUTOMAKE([-Wall -Werror]) +AM_INIT_AUTOMAKE([1.15 -Wall -Werror]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.18.1]) 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. @@ -191,6 +203,15 @@ if test $# -eq 0; then exit 0 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 @@ -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/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 , 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/test/Makefile.in b/test/Makefile.in index e01e273f..215ba892 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@ @@ -1356,7 +1366,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*) \ @@ -1365,6 +1374,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 @@ -1523,6 +1533,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 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 . # @@ -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 -- cgit v1.2.3 From 00c2e96c7b391c7bc33373397006d7ba2e211113 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 24 Jan 2015 20:02:43 +0200 Subject: Update to Gettext 0.19.4. --- ChangeLog | 2 +- NEWS | 2 +- configure | 55 +- configure.ac | 2 +- extension/ChangeLog | 2 + extension/Makefile.in | 50 +- extension/aclocal.m4 | 9 - extension/configh.in | 22 - extension/configure | 2720 +++++--------------------------------------- extension/configure.ac | 3 - extension/m4/ChangeLog | 4 + extension/m4/gettext.m4 | 383 ------- extension/m4/iconv.m4 | 214 ---- extension/m4/intlmacosx.m4 | 51 - extension/m4/po.m4 | 449 -------- m4/ChangeLog | 5 + m4/iconv.m4 | 61 +- m4/po.m4 | 2 +- po/ChangeLog | 4 + po/POTFILES.in | 6 + 20 files changed, 376 insertions(+), 3670 deletions(-) delete mode 100644 extension/m4/gettext.m4 delete mode 100644 extension/m4/iconv.m4 delete mode 100644 extension/m4/intlmacosx.m4 delete mode 100644 extension/m4/po.m4 diff --git a/ChangeLog b/ChangeLog index 06b07429..d192854f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ Infrastructure updates. - Bison 3.0.4. Automake 1.15. + Bison 3.0.4. Automake 1.15. Gettext 0.19.4. 2015-01-20 Arnold D. Robbins diff --git a/NEWS b/NEWS index 4aebe68b..0ba86e61 100644 --- a/NEWS +++ b/NEWS @@ -41,7 +41,7 @@ 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, +10. Infrastructure upgrades: Automake 1.15, Gettext 0.19.4, Libtool 2.4.3, Bison 3.0.4. XX. A number of bugs have been fixed. See the ChangeLog. diff --git a/configure b/configure index 605a7d17..dd62a431 100755 --- a/configure +++ b/configure @@ -7524,36 +7524,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 #include -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; @@ -7566,14 +7572,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; @@ -7585,14 +7591,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; @@ -7605,14 +7611,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; @@ -7632,17 +7638,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 247d0838..1df240c7 100644 --- a/configure.ac +++ b/configure.ac @@ -138,7 +138,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/extension/ChangeLog b/extension/ChangeLog index 5a5a50ca..68479335 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -4,6 +4,8 @@ Automake 1.15. + * configure.ac: Remove gettext macros. + 2015-01-07 Arnold D. Robbins * testext.c (var_test): Adjust for PROCINFO now being there. diff --git a/extension/Makefile.in b/extension/Makefile.in index 66f03ecb..d7eb08f4 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -114,14 +114,9 @@ host_triplet = @host@ subdir = . 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 \ @@ -163,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@) @@ -174,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) \ @@ -334,7 +328,6 @@ 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.rpath \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/install-sh \ @@ -411,35 +404,23 @@ 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@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -454,17 +435,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@ diff --git a/extension/aclocal.m4 b/extension/aclocal.m4 index d1458f3c..d2e755e4 100644 --- a/extension/aclocal.m4 +++ b/extension/aclocal.m4 @@ -1211,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/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 header file. */ #undef HAVE_INTTYPES_H diff --git a/extension/configure b/extension/configure index b51617de..bb5dedf1 100755 --- a/extension/configure +++ b/extension/configure @@ -631,7 +631,6 @@ ac_includes_default="\ # include #endif" -gt_needs= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -653,16 +652,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 +660,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 +753,12 @@ 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_gnu_ld with_sysroot enable_libtool_lock ' @@ -1417,8 +1395,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,11 +1405,6 @@ 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-gnu-ld assume the C compiler uses GNU ld [default=no] @@ -1771,52 +1742,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 +1799,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 +2241,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 @@ -4272,2277 +4242,185 @@ mkdir_p='$(MKDIR_P)' AMTAR='$${TAR-tar}' -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -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 &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 -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 -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 -$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 -#include -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 -#include -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 -#include -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 -$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 -$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 +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - 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 +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - { $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" + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue else - gt_source="libc" + break 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode 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 + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - POSUB=po - fi + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi - INTLLIBS="$LIBINTL" +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" @@ -6983,6 +4861,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' @@ -15387,13 +13336,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 @@ -15684,7 +13626,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" ;; @@ -16376,119 +14317,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 diff --git a/extension/configure.ac b/extension/configure.ac index 172ae1cc..6a516cbc 100644 --- a/extension/configure.ac +++ b/extension/configure.ac @@ -35,9 +35,6 @@ export INSTALL AM_INIT_AUTOMAKE([1.15 -Wall -Werror]) -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.18.1]) - 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 + + * gettext.m4, iconv.m4, intlmacosx.m4, po.m4: Removed. + 2014-04-08 Arnold D. Robbins * 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 , 1995-2000. -dnl Bruno Haible , 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 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 -$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 -$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 -$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 -#include ], - [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 -#include ], - [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 -#include -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 -#include -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 ], - [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 ], [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/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 , 1995-2000. -dnl Bruno Haible , 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 < "$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" < /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" <> "$ac_file.tmp" < + + * iconv.m4: Upgrade to gettext-0.19.4. + * po.m4: Upgrade to gettext-0.19.4. + 2014-11-19 gettextize * 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 #include -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/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 + + * POTFILES.in: Brought up to date. + 2014-11-19 gettextize * 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 -- cgit v1.2.3 From d8e04682a95d856c0b7c97e5c965ea50bd9ac76b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 25 Jan 2015 18:52:06 +0200 Subject: Move to Libtool 2.4.5. --- NEWS | 2 +- extension/ChangeLog | 2 +- extension/Makefile.in | 1 + extension/build-aux/ltmain.sh | 130 +++++++++-- extension/configure | 462 ++++++++++++++++++++++++++++++++---- extension/m4/libtool.m4 | 527 ++++++++++++++++++++++++++++++++++-------- extension/m4/ltoptions.m4 | 57 ++++- extension/m4/ltsugar.m4 | 2 +- extension/m4/ltversion.m4 | 12 +- extension/m4/lt~obsolete.m4 | 2 +- 10 files changed, 1035 insertions(+), 162 deletions(-) diff --git a/NEWS b/NEWS index 0ba86e61..f708cfd0 100644 --- a/NEWS +++ b/NEWS @@ -41,7 +41,7 @@ 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.15, Gettext 0.19.4, Libtool 2.4.3, +10. Infrastructure upgrades: Automake 1.15, Gettext 0.19.4, Libtool 2.4.5, Bison 3.0.4. XX. A number of bugs have been fixed. See the ChangeLog. diff --git a/extension/ChangeLog b/extension/ChangeLog index 68479335..e30ad593 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -2,7 +2,7 @@ Infrastructure updates. - Automake 1.15. + Automake 1.15. Libtool 2.4.5. * configure.ac: Remove gettext macros. diff --git a/extension/Makefile.in b/extension/Makefile.in index d7eb08f4..2a6ef5e0 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -418,6 +418,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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 , 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/configure b/extension/configure index bb5dedf1..6818958b 100755 --- a/extension/configure +++ b/extension/configure @@ -636,6 +636,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS pkgextensiondir +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -758,6 +759,7 @@ enable_static enable_shared with_pic enable_fast_install +with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock @@ -770,7 +772,8 @@ CFLAGS LDFLAGS LIBS CPPFLAGS -CPP' +CPP +LT_SYS_LIBRARY_PATH' # Initialize some variables set by options. @@ -1407,6 +1410,9 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --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). @@ -1420,6 +1426,8 @@ Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory 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. @@ -4844,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' @@ -6087,6 +6095,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac fi @@ -7134,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; @@ -8141,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 @@ -8260,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 + + + + + + + @@ -8379,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 @@ -8698,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*) @@ -8794,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*) @@ -9434,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 @@ -9507,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' @@ -9636,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 @@ -9656,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 @@ -9675,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].*) @@ -9702,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 @@ -9714,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 @@ -9721,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' @@ -9836,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 ;; @@ -10156,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 @@ -10201,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*) @@ -10725,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 @@ -10761,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.so # instead of lib.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 ;; @@ -10962,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 ;; @@ -11022,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' @@ -11177,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" @@ -11246,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*) @@ -11326,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' @@ -11381,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" + @@ -11855,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"))); @@ -11961,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"))); @@ -12110,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 @@ -13351,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"`' @@ -13471,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"`' @@ -13589,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 @@ -14364,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. @@ -14382,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 @@ -14611,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 @@ -14760,6 +15086,64 @@ hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG +_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 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,11 +737,24 @@ _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 # ### END LIBTOOL CONFIG +_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 @@ -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.so # instead of lib.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. # -- cgit v1.2.3 From 2443fb7afd788395e1c6baf067299f42317df21b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 25 Jan 2015 18:55:25 +0200 Subject: Fix a bad URL in the doc. --- doc/ChangeLog | 4 ++++ doc/gawk.info | 8 ++++---- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 2088bb0e..b2b08e15 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-01-25 Arnold D. Robbins + + * gawktexi.in: Fix a bad URL. + 2015-01-23 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index 365ca95c..a6b8fac0 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -29614,7 +29614,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'. @@ -35001,8 +35001,8 @@ Ref: figure-process-flow1177224 Ref: Basic High Level-Footnote-11180453 Node: Basic Data Typing1180638 Node: Glossary1183966 -Node: Copying1215912 -Node: GNU Free Documentation License1253468 -Node: Index1278604 +Node: Copying1215895 +Node: GNU Free Documentation License1253451 +Node: Index1278587  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index c6fb0375..55c49a39 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -39824,7 +39824,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}. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index e360a83b..941da485 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -38916,7 +38916,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}. -- cgit v1.2.3 From e7df7131092924b2d4ef1f41bac3d03affa9485b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 25 Jan 2015 19:54:07 +0200 Subject: Fix another bad URL. --- doc/ChangeLog | 2 +- doc/gawk.info | 296 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 4 files changed, 151 insertions(+), 151 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f1e23e7e..bd4ca80c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,6 @@ 2015-01-25 Arnold D. Robbins - * gawktexi.in: Fix a bad URL. + * gawktexi.in: Fix a bad URL. And another one. 2015-01-23 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index 372c6ddc..2af7b429 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -22510,7 +22510,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 @@ -35011,152 +35011,152 @@ Node: Setting the rounding mode900775 Ref: table-gawk-rounding-modes901139 Ref: Setting the rounding mode-Footnote-1904594 Node: Arbitrary Precision Integers904773 -Ref: Arbitrary Precision Integers-Footnote-1909672 -Node: POSIX Floating Point Problems909821 -Ref: POSIX Floating Point Problems-Footnote-1913694 -Node: Floating point summary913732 -Node: Dynamic Extensions915926 -Node: Extension Intro917478 -Node: Plugin License918744 -Node: Extension Mechanism Outline919541 -Ref: figure-load-extension919969 -Ref: figure-register-new-function921449 -Ref: figure-call-new-function922453 -Node: Extension API Description924439 -Node: Extension API Functions Introduction925889 -Node: General Data Types930713 -Ref: General Data Types-Footnote-1936452 -Node: Memory Allocation Functions936751 -Ref: Memory Allocation Functions-Footnote-1939590 -Node: Constructor Functions939686 -Node: Registration Functions941420 -Node: Extension Functions942105 -Node: Exit Callback Functions944402 -Node: Extension Version String945650 -Node: Input Parsers946315 -Node: Output Wrappers956194 -Node: Two-way processors960709 -Node: Printing Messages962913 -Ref: Printing Messages-Footnote-1963989 -Node: Updating `ERRNO'964141 -Node: Requesting Values964881 -Ref: table-value-types-returned965609 -Node: Accessing Parameters966566 -Node: Symbol Table Access967797 -Node: Symbol table by name968311 -Node: Symbol table by cookie970292 -Ref: Symbol table by cookie-Footnote-1974436 -Node: Cached values974499 -Ref: Cached values-Footnote-1977998 -Node: Array Manipulation978089 -Ref: Array Manipulation-Footnote-1979187 -Node: Array Data Types979224 -Ref: Array Data Types-Footnote-1981879 -Node: Array Functions981971 -Node: Flattening Arrays985825 -Node: Creating Arrays992717 -Node: Extension API Variables997488 -Node: Extension Versioning998124 -Node: Extension API Informational Variables1000025 -Node: Extension API Boilerplate1001090 -Node: Finding Extensions1004899 -Node: Extension Example1005459 -Node: Internal File Description1006231 -Node: Internal File Ops1010298 -Ref: Internal File Ops-Footnote-11021968 -Node: Using Internal File Ops1022108 -Ref: Using Internal File Ops-Footnote-11024491 -Node: Extension Samples1024764 -Node: Extension Sample File Functions1026290 -Node: Extension Sample Fnmatch1033928 -Node: Extension Sample Fork1035419 -Node: Extension Sample Inplace1036634 -Node: Extension Sample Ord1038309 -Node: Extension Sample Readdir1039145 -Ref: table-readdir-file-types1040021 -Node: Extension Sample Revout1040832 -Node: Extension Sample Rev2way1041422 -Node: Extension Sample Read write array1042162 -Node: Extension Sample Readfile1044102 -Node: Extension Sample Time1045197 -Node: Extension Sample API Tests1046546 -Node: gawkextlib1047037 -Node: Extension summary1049695 -Node: Extension Exercises1053384 -Node: Language History1054106 -Node: V7/SVR3.11055762 -Node: SVR41057943 -Node: POSIX1059388 -Node: BTL1060777 -Node: POSIX/GNU1061511 -Node: Feature History1067135 -Node: Common Extensions1080233 -Node: Ranges and Locales1081557 -Ref: Ranges and Locales-Footnote-11086175 -Ref: Ranges and Locales-Footnote-21086202 -Ref: Ranges and Locales-Footnote-31086436 -Node: Contributors1086657 -Node: History summary1092198 -Node: Installation1093568 -Node: Gawk Distribution1094514 -Node: Getting1094998 -Node: Extracting1095821 -Node: Distribution contents1097456 -Node: Unix Installation1103521 -Node: Quick Installation1104204 -Node: Shell Startup Files1106615 -Node: Additional Configuration Options1107694 -Node: Configuration Philosophy1109433 -Node: Non-Unix Installation1111802 -Node: PC Installation1112260 -Node: PC Binary Installation1113579 -Node: PC Compiling1115427 -Ref: PC Compiling-Footnote-11118448 -Node: PC Testing1118557 -Node: PC Using1119733 -Node: Cygwin1123848 -Node: MSYS1124671 -Node: VMS Installation1125171 -Node: VMS Compilation1125963 -Ref: VMS Compilation-Footnote-11127185 -Node: VMS Dynamic Extensions1127243 -Node: VMS Installation Details1128927 -Node: VMS Running1131179 -Node: VMS GNV1134015 -Node: VMS Old Gawk1134749 -Node: Bugs1135219 -Node: Other Versions1139102 -Node: Installation summary1145526 -Node: Notes1146582 -Node: Compatibility Mode1147447 -Node: Additions1148229 -Node: Accessing The Source1149154 -Node: Adding Code1150589 -Node: New Ports1156746 -Node: Derived Files1161228 -Ref: Derived Files-Footnote-11166703 -Ref: Derived Files-Footnote-21166737 -Ref: Derived Files-Footnote-31167333 -Node: Future Extensions1167447 -Node: Implementation Limitations1168053 -Node: Extension Design1169301 -Node: Old Extension Problems1170455 -Ref: Old Extension Problems-Footnote-11171972 -Node: Extension New Mechanism Goals1172029 -Ref: Extension New Mechanism Goals-Footnote-11175389 -Node: Extension Other Design Decisions1175578 -Node: Extension Future Growth1177686 -Node: Old Extension Mechanism1178522 -Node: Notes summary1180284 -Node: Basic Concepts1181470 -Node: Basic High Level1182151 -Ref: figure-general-flow1182423 -Ref: figure-process-flow1183022 -Ref: Basic High Level-Footnote-11186251 -Node: Basic Data Typing1186436 -Node: Glossary1189764 -Node: Copying1221693 -Node: GNU Free Documentation License1259249 -Node: Index1284385 +Ref: Arbitrary Precision Integers-Footnote-1909673 +Node: POSIX Floating Point Problems909822 +Ref: POSIX Floating Point Problems-Footnote-1913695 +Node: Floating point summary913733 +Node: Dynamic Extensions915927 +Node: Extension Intro917479 +Node: Plugin License918745 +Node: Extension Mechanism Outline919542 +Ref: figure-load-extension919970 +Ref: figure-register-new-function921450 +Ref: figure-call-new-function922454 +Node: Extension API Description924440 +Node: Extension API Functions Introduction925890 +Node: General Data Types930714 +Ref: General Data Types-Footnote-1936453 +Node: Memory Allocation Functions936752 +Ref: Memory Allocation Functions-Footnote-1939591 +Node: Constructor Functions939687 +Node: Registration Functions941421 +Node: Extension Functions942106 +Node: Exit Callback Functions944403 +Node: Extension Version String945651 +Node: Input Parsers946316 +Node: Output Wrappers956195 +Node: Two-way processors960710 +Node: Printing Messages962914 +Ref: Printing Messages-Footnote-1963990 +Node: Updating `ERRNO'964142 +Node: Requesting Values964882 +Ref: table-value-types-returned965610 +Node: Accessing Parameters966567 +Node: Symbol Table Access967798 +Node: Symbol table by name968312 +Node: Symbol table by cookie970293 +Ref: Symbol table by cookie-Footnote-1974437 +Node: Cached values974500 +Ref: Cached values-Footnote-1977999 +Node: Array Manipulation978090 +Ref: Array Manipulation-Footnote-1979188 +Node: Array Data Types979225 +Ref: Array Data Types-Footnote-1981880 +Node: Array Functions981972 +Node: Flattening Arrays985826 +Node: Creating Arrays992718 +Node: Extension API Variables997489 +Node: Extension Versioning998125 +Node: Extension API Informational Variables1000026 +Node: Extension API Boilerplate1001091 +Node: Finding Extensions1004900 +Node: Extension Example1005460 +Node: Internal File Description1006232 +Node: Internal File Ops1010299 +Ref: Internal File Ops-Footnote-11021969 +Node: Using Internal File Ops1022109 +Ref: Using Internal File Ops-Footnote-11024492 +Node: Extension Samples1024765 +Node: Extension Sample File Functions1026291 +Node: Extension Sample Fnmatch1033929 +Node: Extension Sample Fork1035420 +Node: Extension Sample Inplace1036635 +Node: Extension Sample Ord1038310 +Node: Extension Sample Readdir1039146 +Ref: table-readdir-file-types1040022 +Node: Extension Sample Revout1040833 +Node: Extension Sample Rev2way1041423 +Node: Extension Sample Read write array1042163 +Node: Extension Sample Readfile1044103 +Node: Extension Sample Time1045198 +Node: Extension Sample API Tests1046547 +Node: gawkextlib1047038 +Node: Extension summary1049696 +Node: Extension Exercises1053385 +Node: Language History1054107 +Node: V7/SVR3.11055763 +Node: SVR41057944 +Node: POSIX1059389 +Node: BTL1060778 +Node: POSIX/GNU1061512 +Node: Feature History1067136 +Node: Common Extensions1080234 +Node: Ranges and Locales1081558 +Ref: Ranges and Locales-Footnote-11086176 +Ref: Ranges and Locales-Footnote-21086203 +Ref: Ranges and Locales-Footnote-31086437 +Node: Contributors1086658 +Node: History summary1092199 +Node: Installation1093569 +Node: Gawk Distribution1094515 +Node: Getting1094999 +Node: Extracting1095822 +Node: Distribution contents1097457 +Node: Unix Installation1103522 +Node: Quick Installation1104205 +Node: Shell Startup Files1106616 +Node: Additional Configuration Options1107695 +Node: Configuration Philosophy1109434 +Node: Non-Unix Installation1111803 +Node: PC Installation1112261 +Node: PC Binary Installation1113580 +Node: PC Compiling1115428 +Ref: PC Compiling-Footnote-11118449 +Node: PC Testing1118558 +Node: PC Using1119734 +Node: Cygwin1123849 +Node: MSYS1124672 +Node: VMS Installation1125172 +Node: VMS Compilation1125964 +Ref: VMS Compilation-Footnote-11127186 +Node: VMS Dynamic Extensions1127244 +Node: VMS Installation Details1128928 +Node: VMS Running1131180 +Node: VMS GNV1134016 +Node: VMS Old Gawk1134750 +Node: Bugs1135220 +Node: Other Versions1139103 +Node: Installation summary1145527 +Node: Notes1146583 +Node: Compatibility Mode1147448 +Node: Additions1148230 +Node: Accessing The Source1149155 +Node: Adding Code1150590 +Node: New Ports1156747 +Node: Derived Files1161229 +Ref: Derived Files-Footnote-11166704 +Ref: Derived Files-Footnote-21166738 +Ref: Derived Files-Footnote-31167334 +Node: Future Extensions1167448 +Node: Implementation Limitations1168054 +Node: Extension Design1169302 +Node: Old Extension Problems1170456 +Ref: Old Extension Problems-Footnote-11171973 +Node: Extension New Mechanism Goals1172030 +Ref: Extension New Mechanism Goals-Footnote-11175390 +Node: Extension Other Design Decisions1175579 +Node: Extension Future Growth1177687 +Node: Old Extension Mechanism1178523 +Node: Notes summary1180285 +Node: Basic Concepts1181471 +Node: Basic High Level1182152 +Ref: figure-general-flow1182424 +Ref: figure-process-flow1183023 +Ref: Basic High Level-Footnote-11186252 +Node: Basic Data Typing1186437 +Node: Glossary1189765 +Node: Copying1221694 +Node: GNU Free Documentation License1259250 +Node: Index1284386  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index dd5507d5..a0995368 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -31007,7 +31007,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 diff --git a/doc/gawktexi.in b/doc/gawktexi.in index b366f0d1..dfa8cc03 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -30099,7 +30099,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 -- cgit v1.2.3 From 547b160b254cc6501578c69ea38228ca2d829c49 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 25 Jan 2015 22:20:30 +0200 Subject: More O'Reilly edits. --- doc/ChangeLog | 1 + doc/gawk.info | 1084 +++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 189 +++++----- doc/gawktexi.in | 183 +++++----- 4 files changed, 734 insertions(+), 723 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b2b08e15..0118d300 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2015-01-25 Arnold D. Robbins * gawktexi.in: Fix a bad URL. + More O'Reilly fixes. 2015-01-23 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index a6b8fac0..e32e2511 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -7266,9 +7266,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: @@ -7287,8 +7287,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: @@ -7333,14 +7333,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. @@ -7360,14 +7360,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 @@ -7375,13 +7375,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: @@ -7400,11 +7400,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 }' @@ -7431,12 +7431,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 @@ -7488,7 +7488,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: @@ -7511,10 +7511,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 @@ -7522,7 +7523,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. @@ -7551,14 +7552,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 @@ -7755,7 +7756,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 @@ -7771,10 +7772,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 @@ -7782,7 +7783,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: @@ -7963,7 +7964,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.  @@ -8080,7 +8081,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_. @@ -8098,14 +8099,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 @@ -8190,8 +8191,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? @@ -8206,7 +8207,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. @@ -8221,7 +8222,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. @@ -8275,10 +8276,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: @@ -8299,16 +8300,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. @@ -8350,12 +8351,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 @@ -8454,7 +8456,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." @@ -8513,7 +8515,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 @@ -8576,7 +8578,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 @@ -8629,15 +8631,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': @@ -8671,7 +8673,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 @@ -8806,7 +8808,7 @@ precedence: Increment, decrement. `^ **' - Exponentiation. These operators group right-to-left. + Exponentiation. These operators group right to left. `+ - !' Unary plus, minus, logical "not." @@ -8833,7 +8835,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)'. `~ !~' @@ -8843,16 +8845,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. @@ -8920,24 +8922,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::. @@ -9111,7 +9113,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::.  @@ -9131,8 +9133,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 @@ -9250,7 +9252,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. @@ -9276,7 +9278,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 @@ -9337,7 +9339,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).) @@ -9347,16 +9349,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 @@ -9401,11 +9402,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. @@ -9602,15 +9603,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 @@ -9633,7 +9634,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: { @@ -9689,7 +9690,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 @@ -9765,7 +9766,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) { @@ -10008,12 +10009,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 @@ -10041,9 +10041,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' @@ -10101,7 +10101,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 @@ -33018,7 +33018,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) @@ -34586,423 +34586,423 @@ Ref: Close Files And Pipes-Footnote-2315212 Node: Output Summary315362 Node: Output Exercises316360 Node: Expressions317040 -Node: Values318225 -Node: Constants318903 -Node: Scalar Constants319594 -Ref: Scalar Constants-Footnote-1320453 -Node: Nondecimal-numbers320703 -Node: Regexp Constants323721 -Node: Using Constant Regexps324246 -Node: Variables327389 -Node: Using Variables328044 -Node: Assignment Options329955 -Node: Conversion331830 -Node: Strings And Numbers332354 -Ref: Strings And Numbers-Footnote-1335419 -Node: Locale influences conversions335528 -Ref: table-locale-affects338275 -Node: All Operators338863 -Node: Arithmetic Ops339493 -Node: Concatenation341998 -Ref: Concatenation-Footnote-1344817 -Node: Assignment Ops344923 -Ref: table-assign-ops349902 -Node: Increment Ops351174 -Node: Truth Values and Conditions354612 -Node: Truth Values355697 -Node: Typing and Comparison356746 -Node: Variable Typing357556 -Node: Comparison Operators361209 -Ref: table-relational-ops361619 -Node: POSIX String Comparison365114 -Ref: POSIX String Comparison-Footnote-1366186 -Node: Boolean Ops366324 -Ref: Boolean Ops-Footnote-1370803 -Node: Conditional Exp370894 -Node: Function Calls372621 -Node: Precedence376501 -Node: Locales380162 -Node: Expressions Summary381794 -Node: Patterns and Actions384354 -Node: Pattern Overview385474 -Node: Regexp Patterns387153 -Node: Expression Patterns387696 -Node: Ranges391406 -Node: BEGIN/END394512 -Node: Using BEGIN/END395273 -Ref: Using BEGIN/END-Footnote-1398007 -Node: I/O And BEGIN/END398113 -Node: BEGINFILE/ENDFILE400427 -Node: Empty403328 -Node: Using Shell Variables403645 -Node: Action Overview405918 -Node: Statements408244 -Node: If Statement410092 -Node: While Statement411587 -Node: Do Statement413616 -Node: For Statement414760 -Node: Switch Statement417917 -Node: Break Statement420299 -Node: Continue Statement422340 -Node: Next Statement424167 -Node: Nextfile Statement426548 -Node: Exit Statement429178 -Node: Built-in Variables431581 -Node: User-modified432714 -Ref: User-modified-Footnote-1440395 -Node: Auto-set440457 -Ref: Auto-set-Footnote-1453492 -Ref: Auto-set-Footnote-2453697 -Node: ARGC and ARGV453753 -Node: Pattern Action Summary457971 -Node: Arrays460398 -Node: Array Basics461727 -Node: Array Intro462571 -Ref: figure-array-elements464535 -Ref: Array Intro-Footnote-1467061 -Node: Reference to Elements467189 -Node: Assigning Elements469641 -Node: Array Example470132 -Node: Scanning an Array471890 -Node: Controlling Scanning474906 -Ref: Controlling Scanning-Footnote-1480102 -Node: Numeric Array Subscripts480418 -Node: Uninitialized Subscripts482603 -Node: Delete484220 -Ref: Delete-Footnote-1486963 -Node: Multidimensional487020 -Node: Multiscanning490117 -Node: Arrays of Arrays491706 -Node: Arrays Summary496465 -Node: Functions498557 -Node: Built-in499456 -Node: Calling Built-in500534 -Node: Numeric Functions502525 -Ref: Numeric Functions-Footnote-1506542 -Ref: Numeric Functions-Footnote-2506899 -Ref: Numeric Functions-Footnote-3506947 -Node: String Functions507219 -Ref: String Functions-Footnote-1530694 -Ref: String Functions-Footnote-2530823 -Ref: String Functions-Footnote-3531071 -Node: Gory Details531158 -Ref: table-sub-escapes532939 -Ref: table-sub-proposed534459 -Ref: table-posix-sub535823 -Ref: table-gensub-escapes537359 -Ref: Gory Details-Footnote-1538191 -Node: I/O Functions538342 -Ref: I/O Functions-Footnote-1545560 -Node: Time Functions545707 -Ref: Time Functions-Footnote-1556195 -Ref: Time Functions-Footnote-2556263 -Ref: Time Functions-Footnote-3556421 -Ref: Time Functions-Footnote-4556532 -Ref: Time Functions-Footnote-5556644 -Ref: Time Functions-Footnote-6556871 -Node: Bitwise Functions557137 -Ref: table-bitwise-ops557699 -Ref: Bitwise Functions-Footnote-1562008 -Node: Type Functions562177 -Node: I18N Functions563328 -Node: User-defined564973 -Node: Definition Syntax565778 -Ref: Definition Syntax-Footnote-1571185 -Node: Function Example571256 -Ref: Function Example-Footnote-1574175 -Node: Function Caveats574197 -Node: Calling A Function574715 -Node: Variable Scope575673 -Node: Pass By Value/Reference578661 -Node: Return Statement582156 -Node: Dynamic Typing585137 -Node: Indirect Calls586066 -Ref: Indirect Calls-Footnote-1597368 -Node: Functions Summary597496 -Node: Library Functions600198 -Ref: Library Functions-Footnote-1603807 -Ref: Library Functions-Footnote-2603950 -Node: Library Names604121 -Ref: Library Names-Footnote-1607575 -Ref: Library Names-Footnote-2607798 -Node: General Functions607884 -Node: Strtonum Function608987 -Node: Assert Function612009 -Node: Round Function615333 -Node: Cliff Random Function616874 -Node: Ordinal Functions617890 -Ref: Ordinal Functions-Footnote-1620953 -Ref: Ordinal Functions-Footnote-2621205 -Node: Join Function621416 -Ref: Join Function-Footnote-1623185 -Node: Getlocaltime Function623385 -Node: Readfile Function627129 -Node: Shell Quoting629099 -Node: Data File Management630500 -Node: Filetrans Function631132 -Node: Rewind Function635188 -Node: File Checking636575 -Ref: File Checking-Footnote-1637907 -Node: Empty Files638108 -Node: Ignoring Assigns640087 -Node: Getopt Function641638 -Ref: Getopt Function-Footnote-1653100 -Node: Passwd Functions653300 -Ref: Passwd Functions-Footnote-1662137 -Node: Group Functions662225 -Ref: Group Functions-Footnote-1670119 -Node: Walking Arrays670332 -Node: Library Functions Summary671935 -Node: Library Exercises673336 -Node: Sample Programs674616 -Node: Running Examples675386 -Node: Clones676114 -Node: Cut Program677338 -Node: Egrep Program687057 -Ref: Egrep Program-Footnote-1694555 -Node: Id Program694665 -Node: Split Program698310 -Ref: Split Program-Footnote-1701758 -Node: Tee Program701886 -Node: Uniq Program704675 -Node: Wc Program712094 -Ref: Wc Program-Footnote-1716344 -Node: Miscellaneous Programs716438 -Node: Dupword Program717651 -Node: Alarm Program719682 -Node: Translate Program724486 -Ref: Translate Program-Footnote-1729051 -Node: Labels Program729321 -Ref: Labels Program-Footnote-1732672 -Node: Word Sorting732756 -Node: History Sorting736827 -Node: Extract Program738663 -Node: Simple Sed746188 -Node: Igawk Program749256 -Ref: Igawk Program-Footnote-1763580 -Ref: Igawk Program-Footnote-2763781 -Ref: Igawk Program-Footnote-3763903 -Node: Anagram Program764018 -Node: Signature Program767075 -Node: Programs Summary768322 -Node: Programs Exercises769515 -Ref: Programs Exercises-Footnote-1773646 -Node: Advanced Features773737 -Node: Nondecimal Data775685 -Node: Array Sorting777275 -Node: Controlling Array Traversal777972 -Ref: Controlling Array Traversal-Footnote-1786305 -Node: Array Sorting Functions786423 -Ref: Array Sorting Functions-Footnote-1790312 -Node: Two-way I/O790508 -Ref: Two-way I/O-Footnote-1795453 -Ref: Two-way I/O-Footnote-2795639 -Node: TCP/IP Networking795721 -Node: Profiling798594 -Node: Advanced Features Summary806141 -Node: Internationalization808074 -Node: I18N and L10N809554 -Node: Explaining gettext810240 -Ref: Explaining gettext-Footnote-1815265 -Ref: Explaining gettext-Footnote-2815449 -Node: Programmer i18n815614 -Ref: Programmer i18n-Footnote-1820480 -Node: Translator i18n820529 -Node: String Extraction821323 -Ref: String Extraction-Footnote-1822454 -Node: Printf Ordering822540 -Ref: Printf Ordering-Footnote-1825326 -Node: I18N Portability825390 -Ref: I18N Portability-Footnote-1827845 -Node: I18N Example827908 -Ref: I18N Example-Footnote-1830711 -Node: Gawk I18N830783 -Node: I18N Summary831421 -Node: Debugger832760 -Node: Debugging833782 -Node: Debugging Concepts834223 -Node: Debugging Terms836076 -Node: Awk Debugging838648 -Node: Sample Debugging Session839542 -Node: Debugger Invocation840062 -Node: Finding The Bug841446 -Node: List of Debugger Commands847921 -Node: Breakpoint Control849254 -Node: Debugger Execution Control852950 -Node: Viewing And Changing Data856314 -Node: Execution Stack859692 -Node: Debugger Info861329 -Node: Miscellaneous Debugger Commands865346 -Node: Readline Support870375 -Node: Limitations871267 -Node: Debugging Summary873381 -Node: Arbitrary Precision Arithmetic874549 -Node: Computer Arithmetic875965 -Ref: table-numeric-ranges879563 -Ref: Computer Arithmetic-Footnote-1880422 -Node: Math Definitions880479 -Ref: table-ieee-formats883767 -Ref: Math Definitions-Footnote-1884371 -Node: MPFR features884476 -Node: FP Math Caution886147 -Ref: FP Math Caution-Footnote-1887197 -Node: Inexactness of computations887566 -Node: Inexact representation888525 -Node: Comparing FP Values889882 -Node: Errors accumulate890964 -Node: Getting Accuracy892397 -Node: Try To Round895059 -Node: Setting precision895958 -Ref: table-predefined-precision-strings896642 -Node: Setting the rounding mode898431 -Ref: table-gawk-rounding-modes898795 -Ref: Setting the rounding mode-Footnote-1902250 -Node: Arbitrary Precision Integers902429 -Ref: Arbitrary Precision Integers-Footnote-1905415 -Node: POSIX Floating Point Problems905564 -Ref: POSIX Floating Point Problems-Footnote-1909437 -Node: Floating point summary909475 -Node: Dynamic Extensions911669 -Node: Extension Intro913221 -Node: Plugin License914487 -Node: Extension Mechanism Outline915284 -Ref: figure-load-extension915712 -Ref: figure-register-new-function917192 -Ref: figure-call-new-function918196 -Node: Extension API Description920182 -Node: Extension API Functions Introduction921632 -Node: General Data Types926456 -Ref: General Data Types-Footnote-1932195 -Node: Memory Allocation Functions932494 -Ref: Memory Allocation Functions-Footnote-1935333 -Node: Constructor Functions935429 -Node: Registration Functions937163 -Node: Extension Functions937848 -Node: Exit Callback Functions940145 -Node: Extension Version String941393 -Node: Input Parsers942058 -Node: Output Wrappers951937 -Node: Two-way processors956452 -Node: Printing Messages958656 -Ref: Printing Messages-Footnote-1959732 -Node: Updating `ERRNO'959884 -Node: Requesting Values960624 -Ref: table-value-types-returned961352 -Node: Accessing Parameters962309 -Node: Symbol Table Access963540 -Node: Symbol table by name964054 -Node: Symbol table by cookie966035 -Ref: Symbol table by cookie-Footnote-1970179 -Node: Cached values970242 -Ref: Cached values-Footnote-1973741 -Node: Array Manipulation973832 -Ref: Array Manipulation-Footnote-1974930 -Node: Array Data Types974967 -Ref: Array Data Types-Footnote-1977622 -Node: Array Functions977714 -Node: Flattening Arrays981568 -Node: Creating Arrays988460 -Node: Extension API Variables993231 -Node: Extension Versioning993867 -Node: Extension API Informational Variables995768 -Node: Extension API Boilerplate996833 -Node: Finding Extensions1000642 -Node: Extension Example1001202 -Node: Internal File Description1001974 -Node: Internal File Ops1006041 -Ref: Internal File Ops-Footnote-11017711 -Node: Using Internal File Ops1017851 -Ref: Using Internal File Ops-Footnote-11020234 -Node: Extension Samples1020507 -Node: Extension Sample File Functions1022033 -Node: Extension Sample Fnmatch1029671 -Node: Extension Sample Fork1031162 -Node: Extension Sample Inplace1032377 -Node: Extension Sample Ord1034052 -Node: Extension Sample Readdir1034888 -Ref: table-readdir-file-types1035764 -Node: Extension Sample Revout1036575 -Node: Extension Sample Rev2way1037165 -Node: Extension Sample Read write array1037905 -Node: Extension Sample Readfile1039845 -Node: Extension Sample Time1040940 -Node: Extension Sample API Tests1042289 -Node: gawkextlib1042780 -Node: Extension summary1045438 -Node: Extension Exercises1049127 -Node: Language History1049849 -Node: V7/SVR3.11051505 -Node: SVR41053686 -Node: POSIX1055131 -Node: BTL1056520 -Node: POSIX/GNU1057254 -Node: Feature History1062818 -Node: Common Extensions1075916 -Node: Ranges and Locales1077240 -Ref: Ranges and Locales-Footnote-11081858 -Ref: Ranges and Locales-Footnote-21081885 -Ref: Ranges and Locales-Footnote-31082119 -Node: Contributors1082340 -Node: History summary1087881 -Node: Installation1089251 -Node: Gawk Distribution1090197 -Node: Getting1090681 -Node: Extracting1091504 -Node: Distribution contents1093139 -Node: Unix Installation1098856 -Node: Quick Installation1099473 -Node: Additional Configuration Options1101897 -Node: Configuration Philosophy1103635 -Node: Non-Unix Installation1106004 -Node: PC Installation1106462 -Node: PC Binary Installation1107781 -Node: PC Compiling1109629 -Ref: PC Compiling-Footnote-11112650 -Node: PC Testing1112759 -Node: PC Using1113935 -Node: Cygwin1118050 -Node: MSYS1118873 -Node: VMS Installation1119373 -Node: VMS Compilation1120165 -Ref: VMS Compilation-Footnote-11121387 -Node: VMS Dynamic Extensions1121445 -Node: VMS Installation Details1123129 -Node: VMS Running1125381 -Node: VMS GNV1128217 -Node: VMS Old Gawk1128951 -Node: Bugs1129421 -Node: Other Versions1133304 -Node: Installation summary1139728 -Node: Notes1140784 -Node: Compatibility Mode1141649 -Node: Additions1142431 -Node: Accessing The Source1143356 -Node: Adding Code1144791 -Node: New Ports1150948 -Node: Derived Files1155430 -Ref: Derived Files-Footnote-11160905 -Ref: Derived Files-Footnote-21160939 -Ref: Derived Files-Footnote-31161535 -Node: Future Extensions1161649 -Node: Implementation Limitations1162255 -Node: Extension Design1163503 -Node: Old Extension Problems1164657 -Ref: Old Extension Problems-Footnote-11166174 -Node: Extension New Mechanism Goals1166231 -Ref: Extension New Mechanism Goals-Footnote-11169591 -Node: Extension Other Design Decisions1169780 -Node: Extension Future Growth1171888 -Node: Old Extension Mechanism1172724 -Node: Notes summary1174486 -Node: Basic Concepts1175672 -Node: Basic High Level1176353 -Ref: figure-general-flow1176625 -Ref: figure-process-flow1177224 -Ref: Basic High Level-Footnote-11180453 -Node: Basic Data Typing1180638 -Node: Glossary1183966 -Node: Copying1215895 -Node: GNU Free Documentation License1253451 -Node: Index1278587 +Node: Values318229 +Node: Constants318906 +Node: Scalar Constants319597 +Ref: Scalar Constants-Footnote-1320459 +Node: Nondecimal-numbers320709 +Node: Regexp Constants323719 +Node: Using Constant Regexps324245 +Node: Variables327408 +Node: Using Variables328065 +Node: Assignment Options329976 +Node: Conversion331851 +Node: Strings And Numbers332375 +Ref: Strings And Numbers-Footnote-1335440 +Node: Locale influences conversions335549 +Ref: table-locale-affects338295 +Node: All Operators338887 +Node: Arithmetic Ops339516 +Node: Concatenation342021 +Ref: Concatenation-Footnote-1344840 +Node: Assignment Ops344947 +Ref: table-assign-ops349926 +Node: Increment Ops351236 +Node: Truth Values and Conditions354667 +Node: Truth Values355750 +Node: Typing and Comparison356799 +Node: Variable Typing357615 +Node: Comparison Operators361282 +Ref: table-relational-ops361692 +Node: POSIX String Comparison365187 +Ref: POSIX String Comparison-Footnote-1366259 +Node: Boolean Ops366398 +Ref: Boolean Ops-Footnote-1370876 +Node: Conditional Exp370967 +Node: Function Calls372705 +Node: Precedence376585 +Node: Locales380245 +Node: Expressions Summary381877 +Node: Patterns and Actions384448 +Node: Pattern Overview385568 +Node: Regexp Patterns387247 +Node: Expression Patterns387790 +Node: Ranges391499 +Node: BEGIN/END394606 +Node: Using BEGIN/END395367 +Ref: Using BEGIN/END-Footnote-1398103 +Node: I/O And BEGIN/END398209 +Node: BEGINFILE/ENDFILE400524 +Node: Empty403421 +Node: Using Shell Variables403738 +Node: Action Overview406011 +Node: Statements408337 +Node: If Statement410185 +Node: While Statement411680 +Node: Do Statement413708 +Node: For Statement414856 +Node: Switch Statement418014 +Node: Break Statement420396 +Node: Continue Statement422437 +Node: Next Statement424264 +Node: Nextfile Statement426645 +Node: Exit Statement429273 +Node: Built-in Variables431684 +Node: User-modified432817 +Ref: User-modified-Footnote-1440498 +Node: Auto-set440560 +Ref: Auto-set-Footnote-1453595 +Ref: Auto-set-Footnote-2453800 +Node: ARGC and ARGV453856 +Node: Pattern Action Summary458074 +Node: Arrays460501 +Node: Array Basics461830 +Node: Array Intro462674 +Ref: figure-array-elements464638 +Ref: Array Intro-Footnote-1467164 +Node: Reference to Elements467292 +Node: Assigning Elements469744 +Node: Array Example470235 +Node: Scanning an Array471993 +Node: Controlling Scanning475009 +Ref: Controlling Scanning-Footnote-1480205 +Node: Numeric Array Subscripts480521 +Node: Uninitialized Subscripts482706 +Node: Delete484323 +Ref: Delete-Footnote-1487066 +Node: Multidimensional487123 +Node: Multiscanning490220 +Node: Arrays of Arrays491809 +Node: Arrays Summary496568 +Node: Functions498660 +Node: Built-in499559 +Node: Calling Built-in500637 +Node: Numeric Functions502628 +Ref: Numeric Functions-Footnote-1506645 +Ref: Numeric Functions-Footnote-2507002 +Ref: Numeric Functions-Footnote-3507050 +Node: String Functions507322 +Ref: String Functions-Footnote-1530797 +Ref: String Functions-Footnote-2530926 +Ref: String Functions-Footnote-3531174 +Node: Gory Details531261 +Ref: table-sub-escapes533042 +Ref: table-sub-proposed534562 +Ref: table-posix-sub535926 +Ref: table-gensub-escapes537462 +Ref: Gory Details-Footnote-1538294 +Node: I/O Functions538445 +Ref: I/O Functions-Footnote-1545663 +Node: Time Functions545810 +Ref: Time Functions-Footnote-1556298 +Ref: Time Functions-Footnote-2556366 +Ref: Time Functions-Footnote-3556524 +Ref: Time Functions-Footnote-4556635 +Ref: Time Functions-Footnote-5556747 +Ref: Time Functions-Footnote-6556974 +Node: Bitwise Functions557240 +Ref: table-bitwise-ops557802 +Ref: Bitwise Functions-Footnote-1562111 +Node: Type Functions562280 +Node: I18N Functions563431 +Node: User-defined565076 +Node: Definition Syntax565881 +Ref: Definition Syntax-Footnote-1571288 +Node: Function Example571359 +Ref: Function Example-Footnote-1574278 +Node: Function Caveats574300 +Node: Calling A Function574818 +Node: Variable Scope575776 +Node: Pass By Value/Reference578764 +Node: Return Statement582259 +Node: Dynamic Typing585240 +Node: Indirect Calls586169 +Ref: Indirect Calls-Footnote-1597471 +Node: Functions Summary597599 +Node: Library Functions600301 +Ref: Library Functions-Footnote-1603910 +Ref: Library Functions-Footnote-2604053 +Node: Library Names604224 +Ref: Library Names-Footnote-1607678 +Ref: Library Names-Footnote-2607901 +Node: General Functions607987 +Node: Strtonum Function609090 +Node: Assert Function612112 +Node: Round Function615436 +Node: Cliff Random Function616977 +Node: Ordinal Functions617993 +Ref: Ordinal Functions-Footnote-1621056 +Ref: Ordinal Functions-Footnote-2621308 +Node: Join Function621519 +Ref: Join Function-Footnote-1623288 +Node: Getlocaltime Function623488 +Node: Readfile Function627232 +Node: Shell Quoting629202 +Node: Data File Management630603 +Node: Filetrans Function631235 +Node: Rewind Function635291 +Node: File Checking636678 +Ref: File Checking-Footnote-1638010 +Node: Empty Files638211 +Node: Ignoring Assigns640190 +Node: Getopt Function641741 +Ref: Getopt Function-Footnote-1653203 +Node: Passwd Functions653403 +Ref: Passwd Functions-Footnote-1662240 +Node: Group Functions662328 +Ref: Group Functions-Footnote-1670222 +Node: Walking Arrays670435 +Node: Library Functions Summary672038 +Node: Library Exercises673439 +Node: Sample Programs674719 +Node: Running Examples675489 +Node: Clones676217 +Node: Cut Program677441 +Node: Egrep Program687160 +Ref: Egrep Program-Footnote-1694658 +Node: Id Program694768 +Node: Split Program698413 +Ref: Split Program-Footnote-1701861 +Node: Tee Program701989 +Node: Uniq Program704778 +Node: Wc Program712197 +Ref: Wc Program-Footnote-1716447 +Node: Miscellaneous Programs716541 +Node: Dupword Program717754 +Node: Alarm Program719785 +Node: Translate Program724589 +Ref: Translate Program-Footnote-1729154 +Node: Labels Program729424 +Ref: Labels Program-Footnote-1732775 +Node: Word Sorting732859 +Node: History Sorting736930 +Node: Extract Program738766 +Node: Simple Sed746291 +Node: Igawk Program749359 +Ref: Igawk Program-Footnote-1763683 +Ref: Igawk Program-Footnote-2763884 +Ref: Igawk Program-Footnote-3764006 +Node: Anagram Program764121 +Node: Signature Program767178 +Node: Programs Summary768425 +Node: Programs Exercises769618 +Ref: Programs Exercises-Footnote-1773749 +Node: Advanced Features773840 +Node: Nondecimal Data775788 +Node: Array Sorting777378 +Node: Controlling Array Traversal778075 +Ref: Controlling Array Traversal-Footnote-1786408 +Node: Array Sorting Functions786526 +Ref: Array Sorting Functions-Footnote-1790415 +Node: Two-way I/O790611 +Ref: Two-way I/O-Footnote-1795556 +Ref: Two-way I/O-Footnote-2795742 +Node: TCP/IP Networking795824 +Node: Profiling798697 +Node: Advanced Features Summary806244 +Node: Internationalization808177 +Node: I18N and L10N809657 +Node: Explaining gettext810343 +Ref: Explaining gettext-Footnote-1815368 +Ref: Explaining gettext-Footnote-2815552 +Node: Programmer i18n815717 +Ref: Programmer i18n-Footnote-1820583 +Node: Translator i18n820632 +Node: String Extraction821426 +Ref: String Extraction-Footnote-1822557 +Node: Printf Ordering822643 +Ref: Printf Ordering-Footnote-1825429 +Node: I18N Portability825493 +Ref: I18N Portability-Footnote-1827948 +Node: I18N Example828011 +Ref: I18N Example-Footnote-1830814 +Node: Gawk I18N830886 +Node: I18N Summary831524 +Node: Debugger832863 +Node: Debugging833885 +Node: Debugging Concepts834326 +Node: Debugging Terms836179 +Node: Awk Debugging838751 +Node: Sample Debugging Session839645 +Node: Debugger Invocation840165 +Node: Finding The Bug841549 +Node: List of Debugger Commands848024 +Node: Breakpoint Control849357 +Node: Debugger Execution Control853053 +Node: Viewing And Changing Data856417 +Node: Execution Stack859795 +Node: Debugger Info861432 +Node: Miscellaneous Debugger Commands865449 +Node: Readline Support870478 +Node: Limitations871370 +Node: Debugging Summary873484 +Node: Arbitrary Precision Arithmetic874652 +Node: Computer Arithmetic876068 +Ref: table-numeric-ranges879666 +Ref: Computer Arithmetic-Footnote-1880525 +Node: Math Definitions880582 +Ref: table-ieee-formats883870 +Ref: Math Definitions-Footnote-1884474 +Node: MPFR features884579 +Node: FP Math Caution886250 +Ref: FP Math Caution-Footnote-1887300 +Node: Inexactness of computations887669 +Node: Inexact representation888628 +Node: Comparing FP Values889985 +Node: Errors accumulate891067 +Node: Getting Accuracy892500 +Node: Try To Round895162 +Node: Setting precision896061 +Ref: table-predefined-precision-strings896745 +Node: Setting the rounding mode898534 +Ref: table-gawk-rounding-modes898898 +Ref: Setting the rounding mode-Footnote-1902353 +Node: Arbitrary Precision Integers902532 +Ref: Arbitrary Precision Integers-Footnote-1905518 +Node: POSIX Floating Point Problems905667 +Ref: POSIX Floating Point Problems-Footnote-1909540 +Node: Floating point summary909578 +Node: Dynamic Extensions911772 +Node: Extension Intro913324 +Node: Plugin License914590 +Node: Extension Mechanism Outline915387 +Ref: figure-load-extension915815 +Ref: figure-register-new-function917295 +Ref: figure-call-new-function918299 +Node: Extension API Description920285 +Node: Extension API Functions Introduction921735 +Node: General Data Types926559 +Ref: General Data Types-Footnote-1932298 +Node: Memory Allocation Functions932597 +Ref: Memory Allocation Functions-Footnote-1935436 +Node: Constructor Functions935532 +Node: Registration Functions937266 +Node: Extension Functions937951 +Node: Exit Callback Functions940248 +Node: Extension Version String941496 +Node: Input Parsers942161 +Node: Output Wrappers952040 +Node: Two-way processors956555 +Node: Printing Messages958759 +Ref: Printing Messages-Footnote-1959835 +Node: Updating `ERRNO'959987 +Node: Requesting Values960727 +Ref: table-value-types-returned961455 +Node: Accessing Parameters962412 +Node: Symbol Table Access963643 +Node: Symbol table by name964157 +Node: Symbol table by cookie966138 +Ref: Symbol table by cookie-Footnote-1970282 +Node: Cached values970345 +Ref: Cached values-Footnote-1973844 +Node: Array Manipulation973935 +Ref: Array Manipulation-Footnote-1975033 +Node: Array Data Types975070 +Ref: Array Data Types-Footnote-1977725 +Node: Array Functions977817 +Node: Flattening Arrays981671 +Node: Creating Arrays988563 +Node: Extension API Variables993334 +Node: Extension Versioning993970 +Node: Extension API Informational Variables995871 +Node: Extension API Boilerplate996936 +Node: Finding Extensions1000745 +Node: Extension Example1001305 +Node: Internal File Description1002077 +Node: Internal File Ops1006144 +Ref: Internal File Ops-Footnote-11017814 +Node: Using Internal File Ops1017954 +Ref: Using Internal File Ops-Footnote-11020337 +Node: Extension Samples1020610 +Node: Extension Sample File Functions1022136 +Node: Extension Sample Fnmatch1029774 +Node: Extension Sample Fork1031265 +Node: Extension Sample Inplace1032480 +Node: Extension Sample Ord1034155 +Node: Extension Sample Readdir1034991 +Ref: table-readdir-file-types1035867 +Node: Extension Sample Revout1036678 +Node: Extension Sample Rev2way1037268 +Node: Extension Sample Read write array1038008 +Node: Extension Sample Readfile1039948 +Node: Extension Sample Time1041043 +Node: Extension Sample API Tests1042392 +Node: gawkextlib1042883 +Node: Extension summary1045541 +Node: Extension Exercises1049230 +Node: Language History1049952 +Node: V7/SVR3.11051608 +Node: SVR41053789 +Node: POSIX1055234 +Node: BTL1056623 +Node: POSIX/GNU1057357 +Node: Feature History1062921 +Node: Common Extensions1076019 +Node: Ranges and Locales1077343 +Ref: Ranges and Locales-Footnote-11081961 +Ref: Ranges and Locales-Footnote-21081988 +Ref: Ranges and Locales-Footnote-31082222 +Node: Contributors1082443 +Node: History summary1087984 +Node: Installation1089354 +Node: Gawk Distribution1090300 +Node: Getting1090784 +Node: Extracting1091607 +Node: Distribution contents1093242 +Node: Unix Installation1098959 +Node: Quick Installation1099576 +Node: Additional Configuration Options1102000 +Node: Configuration Philosophy1103738 +Node: Non-Unix Installation1106107 +Node: PC Installation1106565 +Node: PC Binary Installation1107884 +Node: PC Compiling1109732 +Ref: PC Compiling-Footnote-11112753 +Node: PC Testing1112862 +Node: PC Using1114038 +Node: Cygwin1118153 +Node: MSYS1118976 +Node: VMS Installation1119476 +Node: VMS Compilation1120268 +Ref: VMS Compilation-Footnote-11121490 +Node: VMS Dynamic Extensions1121548 +Node: VMS Installation Details1123232 +Node: VMS Running1125484 +Node: VMS GNV1128320 +Node: VMS Old Gawk1129054 +Node: Bugs1129524 +Node: Other Versions1133407 +Node: Installation summary1139831 +Node: Notes1140887 +Node: Compatibility Mode1141752 +Node: Additions1142534 +Node: Accessing The Source1143459 +Node: Adding Code1144894 +Node: New Ports1151051 +Node: Derived Files1155533 +Ref: Derived Files-Footnote-11161008 +Ref: Derived Files-Footnote-21161042 +Ref: Derived Files-Footnote-31161638 +Node: Future Extensions1161752 +Node: Implementation Limitations1162358 +Node: Extension Design1163606 +Node: Old Extension Problems1164760 +Ref: Old Extension Problems-Footnote-11166277 +Node: Extension New Mechanism Goals1166334 +Ref: Extension New Mechanism Goals-Footnote-11169694 +Node: Extension Other Design Decisions1169883 +Node: Extension Future Growth1171991 +Node: Old Extension Mechanism1172827 +Node: Notes summary1174589 +Node: Basic Concepts1175775 +Node: Basic High Level1176456 +Ref: figure-general-flow1176728 +Ref: figure-process-flow1177327 +Ref: Basic High Level-Footnote-11180556 +Node: Basic Data Typing1180741 +Node: Glossary1184069 +Node: Copying1215998 +Node: GNU Free Documentation License1253554 +Node: Index1278690  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 55c49a39..12b07bba 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -10508,7 +10508,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. @@ -10527,7 +10527,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. @@ -10577,7 +10577,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 @@ -10589,7 +10589,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. @@ -10604,15 +10604,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, @@ -10623,13 +10623,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: @@ -10657,11 +10657,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: @@ -10730,12 +10730,12 @@ $ @kbd{gawk 'BEGIN @{ printf "0x11 is <%s>\n", 0x11 @}'} @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). +but could be more complex expressions). @node Using Constant Regexps @subsection Using Regular Expression Constants @@ -10815,7 +10815,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 @@ -10841,7 +10841,7 @@ 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 @@ -10852,7 +10852,7 @@ this way is probably not what was intended. @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. @@ -10880,17 +10880,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 @@ -11147,7 +11147,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 @@ -11165,7 +11165,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}. @@ -11173,7 +11173,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 @@ -11351,7 +11351,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: @@ -11601,7 +11601,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}. @@ -11637,17 +11637,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 @@ -11843,8 +11843,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 @@ -11868,7 +11868,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. @@ -11895,8 +11895,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 @@ -11920,7 +11920,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. @@ -11936,8 +11936,8 @@ You should avoid such things in your own programs. @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. @@ -12004,7 +12004,7 @@ the string constant @code{"0"} is actually true, because it is non-null. @cindex operators, relational, See operators@comma{} comparison @cindex variable typing @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} @@ -12033,20 +12033,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 @@ -12190,13 +12190,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 @@ -12326,7 +12326,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.'' @@ -12385,7 +12385,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, @@ -12492,7 +12492,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 @@ -12564,8 +12564,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} @@ -12574,8 +12574,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}: @@ -12623,7 +12623,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 @@ -12797,7 +12797,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 @@ -12863,7 +12863,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)}. @@ -12881,17 +12881,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 @@ -12908,7 +12908,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 @@ -12982,8 +12982,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 @@ -12994,7 +12994,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 @@ -13003,7 +13003,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 @@ -13030,7 +13030,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 @@ -13221,7 +13221,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 @@ -13247,7 +13247,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 @@ -13391,7 +13391,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 @@ -13419,7 +13419,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} @@ -13508,7 +13508,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}.) @@ -13519,8 +13519,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. @@ -13529,7 +13529,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 @@ -13605,11 +13605,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 @@ -13868,13 +13868,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. @@ -13904,9 +13904,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 @{ @@ -13973,7 +13973,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 @@ -14064,7 +14064,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 @@ -14238,7 +14238,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}. @@ -14366,7 +14371,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 @@ -14404,7 +14409,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. @@ -14472,7 +14477,7 @@ their areas of activity. @end menu @node User-modified -@subsection Built-In Variables That Control @command{awk} +@subsection Built-in Variables That Control @command{awk} @cindex predefined variables, user-modifiable @cindex user-modifiable variables diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 941da485..6d1bc395 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -10004,7 +10004,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. @@ -10023,7 +10023,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. @@ -10073,7 +10073,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 @@ -10085,7 +10085,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. @@ -10100,15 +10100,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, @@ -10119,13 +10119,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: @@ -10153,11 +10153,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: @@ -10197,12 +10197,12 @@ $ @kbd{gawk 'BEGIN @{ printf "0x11 is <%s>\n", 0x11 @}'} @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). +but could be more complex expressions). @node Using Constant Regexps @subsection Using Regular Expression Constants @@ -10282,7 +10282,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 @@ -10308,7 +10308,7 @@ 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 @@ -10319,7 +10319,7 @@ this way is probably not what was intended. @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. @@ -10347,17 +10347,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 @@ -10585,7 +10585,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 @@ -10603,7 +10603,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}. @@ -10611,7 +10611,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 @@ -10789,7 +10789,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: @@ -11039,7 +11039,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}. @@ -11075,17 +11075,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 @@ -11224,8 +11224,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 @@ -11249,7 +11249,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. @@ -11264,8 +11264,8 @@ You should avoid such things in your own programs. @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. @@ -11332,7 +11332,7 @@ the string constant @code{"0"} is actually true, because it is non-null. @cindex operators, relational, See operators@comma{} comparison @cindex variable typing @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} @@ -11361,20 +11361,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 @@ -11518,13 +11518,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 @@ -11654,7 +11654,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.'' @@ -11713,7 +11713,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, @@ -11820,7 +11820,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 @@ -11892,8 +11892,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} @@ -11902,8 +11902,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}: @@ -11951,7 +11951,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 @@ -12125,7 +12125,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 @@ -12191,7 +12191,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)}. @@ -12209,17 +12209,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 @@ -12236,7 +12236,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 @@ -12310,8 +12310,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 @@ -12322,7 +12322,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 @@ -12331,7 +12331,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 @@ -12358,7 +12358,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 @@ -12549,7 +12549,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 @@ -12575,7 +12575,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 @@ -12719,7 +12719,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 @@ -12747,7 +12747,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} @@ -12836,7 +12836,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}.) @@ -12847,8 +12847,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. @@ -12857,7 +12857,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 @@ -12933,11 +12933,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 @@ -13196,13 +13196,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. @@ -13232,9 +13232,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 @{ @@ -13301,7 +13301,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 @@ -13392,7 +13392,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 @@ -13566,7 +13566,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}. @@ -13694,7 +13699,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 @@ -13732,7 +13737,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. @@ -13800,7 +13805,7 @@ their areas of activity. @end menu @node User-modified -@subsection Built-In Variables That Control @command{awk} +@subsection Built-in Variables That Control @command{awk} @cindex predefined variables, user-modifiable @cindex user-modifiable variables -- cgit v1.2.3 From 762f30020bfa5e333345adc25d34da84918faa96 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 26 Jan 2015 22:35:52 +0200 Subject: More O'Reilly fixes. --- doc/ChangeLog | 4 + doc/gawk.info | 801 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 44 ++-- doc/gawktexi.in | 44 ++-- 4 files changed, 449 insertions(+), 444 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0118d300..48d05b05 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-01-26 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-01-25 Arnold D. Robbins * gawktexi.in: Fix a bad URL. diff --git a/doc/gawk.info b/doc/gawk.info index e32e2511..ef092701 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -10125,11 +10125,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 @@ -10176,7 +10176,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 @@ -10196,7 +10196,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 @@ -10204,17 +10204,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 @@ -10264,7 +10265,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 @@ -10368,14 +10369,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 @@ -10410,7 +10411,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 @@ -10431,7 +10432,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. @@ -10520,7 +10521,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 @@ -10570,7 +10571,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' @@ -10709,7 +10710,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::,).  @@ -10720,14 +10721,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). @@ -10748,11 +10749,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. @@ -32489,7 +32490,7 @@ Index (line 77) * differences in awk and gawk, SYMTAB variable: Auto-set. (line 269) * 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. @@ -32977,7 +32978,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 269) -* 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 302) @@ -33175,7 +33176,7 @@ Index * 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 101) * internationalization, localization, gawk and: Internationalization. @@ -33471,7 +33472,7 @@ 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 753) @@ -33524,7 +33525,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. @@ -33664,7 +33665,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 341) -* 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) @@ -33679,7 +33680,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) @@ -33794,7 +33795,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. @@ -33906,8 +33907,8 @@ Index * round to nearest integer: Numeric Functions. (line 23) * 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) @@ -33964,12 +33965,12 @@ 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) @@ -34101,7 +34102,7 @@ Index * split.awk program: Split Program. (line 30) * sprintf <1>: String Functions. (line 383) * 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 77) @@ -34163,7 +34164,7 @@ Index (line 43) * sub() function, arguments of: String Functions. (line 462) * 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) @@ -34171,7 +34172,7 @@ 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) @@ -34210,7 +34211,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) @@ -34649,360 +34650,360 @@ Node: Nextfile Statement426645 Node: Exit Statement429273 Node: Built-in Variables431684 Node: User-modified432817 -Ref: User-modified-Footnote-1440498 -Node: Auto-set440560 -Ref: Auto-set-Footnote-1453595 -Ref: Auto-set-Footnote-2453800 -Node: ARGC and ARGV453856 -Node: Pattern Action Summary458074 -Node: Arrays460501 -Node: Array Basics461830 -Node: Array Intro462674 -Ref: figure-array-elements464638 -Ref: Array Intro-Footnote-1467164 -Node: Reference to Elements467292 -Node: Assigning Elements469744 -Node: Array Example470235 -Node: Scanning an Array471993 -Node: Controlling Scanning475009 -Ref: Controlling Scanning-Footnote-1480205 -Node: Numeric Array Subscripts480521 -Node: Uninitialized Subscripts482706 -Node: Delete484323 -Ref: Delete-Footnote-1487066 -Node: Multidimensional487123 -Node: Multiscanning490220 -Node: Arrays of Arrays491809 -Node: Arrays Summary496568 -Node: Functions498660 -Node: Built-in499559 -Node: Calling Built-in500637 -Node: Numeric Functions502628 -Ref: Numeric Functions-Footnote-1506645 -Ref: Numeric Functions-Footnote-2507002 -Ref: Numeric Functions-Footnote-3507050 -Node: String Functions507322 -Ref: String Functions-Footnote-1530797 -Ref: String Functions-Footnote-2530926 -Ref: String Functions-Footnote-3531174 -Node: Gory Details531261 -Ref: table-sub-escapes533042 -Ref: table-sub-proposed534562 -Ref: table-posix-sub535926 -Ref: table-gensub-escapes537462 -Ref: Gory Details-Footnote-1538294 -Node: I/O Functions538445 -Ref: I/O Functions-Footnote-1545663 -Node: Time Functions545810 -Ref: Time Functions-Footnote-1556298 -Ref: Time Functions-Footnote-2556366 -Ref: Time Functions-Footnote-3556524 -Ref: Time Functions-Footnote-4556635 -Ref: Time Functions-Footnote-5556747 -Ref: Time Functions-Footnote-6556974 -Node: Bitwise Functions557240 -Ref: table-bitwise-ops557802 -Ref: Bitwise Functions-Footnote-1562111 -Node: Type Functions562280 -Node: I18N Functions563431 -Node: User-defined565076 -Node: Definition Syntax565881 -Ref: Definition Syntax-Footnote-1571288 -Node: Function Example571359 -Ref: Function Example-Footnote-1574278 -Node: Function Caveats574300 -Node: Calling A Function574818 -Node: Variable Scope575776 -Node: Pass By Value/Reference578764 -Node: Return Statement582259 -Node: Dynamic Typing585240 -Node: Indirect Calls586169 -Ref: Indirect Calls-Footnote-1597471 -Node: Functions Summary597599 -Node: Library Functions600301 -Ref: Library Functions-Footnote-1603910 -Ref: Library Functions-Footnote-2604053 -Node: Library Names604224 -Ref: Library Names-Footnote-1607678 -Ref: Library Names-Footnote-2607901 -Node: General Functions607987 -Node: Strtonum Function609090 -Node: Assert Function612112 -Node: Round Function615436 -Node: Cliff Random Function616977 -Node: Ordinal Functions617993 -Ref: Ordinal Functions-Footnote-1621056 -Ref: Ordinal Functions-Footnote-2621308 -Node: Join Function621519 -Ref: Join Function-Footnote-1623288 -Node: Getlocaltime Function623488 -Node: Readfile Function627232 -Node: Shell Quoting629202 -Node: Data File Management630603 -Node: Filetrans Function631235 -Node: Rewind Function635291 -Node: File Checking636678 -Ref: File Checking-Footnote-1638010 -Node: Empty Files638211 -Node: Ignoring Assigns640190 -Node: Getopt Function641741 -Ref: Getopt Function-Footnote-1653203 -Node: Passwd Functions653403 -Ref: Passwd Functions-Footnote-1662240 -Node: Group Functions662328 -Ref: Group Functions-Footnote-1670222 -Node: Walking Arrays670435 -Node: Library Functions Summary672038 -Node: Library Exercises673439 -Node: Sample Programs674719 -Node: Running Examples675489 -Node: Clones676217 -Node: Cut Program677441 -Node: Egrep Program687160 -Ref: Egrep Program-Footnote-1694658 -Node: Id Program694768 -Node: Split Program698413 -Ref: Split Program-Footnote-1701861 -Node: Tee Program701989 -Node: Uniq Program704778 -Node: Wc Program712197 -Ref: Wc Program-Footnote-1716447 -Node: Miscellaneous Programs716541 -Node: Dupword Program717754 -Node: Alarm Program719785 -Node: Translate Program724589 -Ref: Translate Program-Footnote-1729154 -Node: Labels Program729424 -Ref: Labels Program-Footnote-1732775 -Node: Word Sorting732859 -Node: History Sorting736930 -Node: Extract Program738766 -Node: Simple Sed746291 -Node: Igawk Program749359 -Ref: Igawk Program-Footnote-1763683 -Ref: Igawk Program-Footnote-2763884 -Ref: Igawk Program-Footnote-3764006 -Node: Anagram Program764121 -Node: Signature Program767178 -Node: Programs Summary768425 -Node: Programs Exercises769618 -Ref: Programs Exercises-Footnote-1773749 -Node: Advanced Features773840 -Node: Nondecimal Data775788 -Node: Array Sorting777378 -Node: Controlling Array Traversal778075 -Ref: Controlling Array Traversal-Footnote-1786408 -Node: Array Sorting Functions786526 -Ref: Array Sorting Functions-Footnote-1790415 -Node: Two-way I/O790611 -Ref: Two-way I/O-Footnote-1795556 -Ref: Two-way I/O-Footnote-2795742 -Node: TCP/IP Networking795824 -Node: Profiling798697 -Node: Advanced Features Summary806244 -Node: Internationalization808177 -Node: I18N and L10N809657 -Node: Explaining gettext810343 -Ref: Explaining gettext-Footnote-1815368 -Ref: Explaining gettext-Footnote-2815552 -Node: Programmer i18n815717 -Ref: Programmer i18n-Footnote-1820583 -Node: Translator i18n820632 -Node: String Extraction821426 -Ref: String Extraction-Footnote-1822557 -Node: Printf Ordering822643 -Ref: Printf Ordering-Footnote-1825429 -Node: I18N Portability825493 -Ref: I18N Portability-Footnote-1827948 -Node: I18N Example828011 -Ref: I18N Example-Footnote-1830814 -Node: Gawk I18N830886 -Node: I18N Summary831524 -Node: Debugger832863 -Node: Debugging833885 -Node: Debugging Concepts834326 -Node: Debugging Terms836179 -Node: Awk Debugging838751 -Node: Sample Debugging Session839645 -Node: Debugger Invocation840165 -Node: Finding The Bug841549 -Node: List of Debugger Commands848024 -Node: Breakpoint Control849357 -Node: Debugger Execution Control853053 -Node: Viewing And Changing Data856417 -Node: Execution Stack859795 -Node: Debugger Info861432 -Node: Miscellaneous Debugger Commands865449 -Node: Readline Support870478 -Node: Limitations871370 -Node: Debugging Summary873484 -Node: Arbitrary Precision Arithmetic874652 -Node: Computer Arithmetic876068 -Ref: table-numeric-ranges879666 -Ref: Computer Arithmetic-Footnote-1880525 -Node: Math Definitions880582 -Ref: table-ieee-formats883870 -Ref: Math Definitions-Footnote-1884474 -Node: MPFR features884579 -Node: FP Math Caution886250 -Ref: FP Math Caution-Footnote-1887300 -Node: Inexactness of computations887669 -Node: Inexact representation888628 -Node: Comparing FP Values889985 -Node: Errors accumulate891067 -Node: Getting Accuracy892500 -Node: Try To Round895162 -Node: Setting precision896061 -Ref: table-predefined-precision-strings896745 -Node: Setting the rounding mode898534 -Ref: table-gawk-rounding-modes898898 -Ref: Setting the rounding mode-Footnote-1902353 -Node: Arbitrary Precision Integers902532 -Ref: Arbitrary Precision Integers-Footnote-1905518 -Node: POSIX Floating Point Problems905667 -Ref: POSIX Floating Point Problems-Footnote-1909540 -Node: Floating point summary909578 -Node: Dynamic Extensions911772 -Node: Extension Intro913324 -Node: Plugin License914590 -Node: Extension Mechanism Outline915387 -Ref: figure-load-extension915815 -Ref: figure-register-new-function917295 -Ref: figure-call-new-function918299 -Node: Extension API Description920285 -Node: Extension API Functions Introduction921735 -Node: General Data Types926559 -Ref: General Data Types-Footnote-1932298 -Node: Memory Allocation Functions932597 -Ref: Memory Allocation Functions-Footnote-1935436 -Node: Constructor Functions935532 -Node: Registration Functions937266 -Node: Extension Functions937951 -Node: Exit Callback Functions940248 -Node: Extension Version String941496 -Node: Input Parsers942161 -Node: Output Wrappers952040 -Node: Two-way processors956555 -Node: Printing Messages958759 -Ref: Printing Messages-Footnote-1959835 -Node: Updating `ERRNO'959987 -Node: Requesting Values960727 -Ref: table-value-types-returned961455 -Node: Accessing Parameters962412 -Node: Symbol Table Access963643 -Node: Symbol table by name964157 -Node: Symbol table by cookie966138 -Ref: Symbol table by cookie-Footnote-1970282 -Node: Cached values970345 -Ref: Cached values-Footnote-1973844 -Node: Array Manipulation973935 -Ref: Array Manipulation-Footnote-1975033 -Node: Array Data Types975070 -Ref: Array Data Types-Footnote-1977725 -Node: Array Functions977817 -Node: Flattening Arrays981671 -Node: Creating Arrays988563 -Node: Extension API Variables993334 -Node: Extension Versioning993970 -Node: Extension API Informational Variables995871 -Node: Extension API Boilerplate996936 -Node: Finding Extensions1000745 -Node: Extension Example1001305 -Node: Internal File Description1002077 -Node: Internal File Ops1006144 -Ref: Internal File Ops-Footnote-11017814 -Node: Using Internal File Ops1017954 -Ref: Using Internal File Ops-Footnote-11020337 -Node: Extension Samples1020610 -Node: Extension Sample File Functions1022136 -Node: Extension Sample Fnmatch1029774 -Node: Extension Sample Fork1031265 -Node: Extension Sample Inplace1032480 -Node: Extension Sample Ord1034155 -Node: Extension Sample Readdir1034991 -Ref: table-readdir-file-types1035867 -Node: Extension Sample Revout1036678 -Node: Extension Sample Rev2way1037268 -Node: Extension Sample Read write array1038008 -Node: Extension Sample Readfile1039948 -Node: Extension Sample Time1041043 -Node: Extension Sample API Tests1042392 -Node: gawkextlib1042883 -Node: Extension summary1045541 -Node: Extension Exercises1049230 -Node: Language History1049952 -Node: V7/SVR3.11051608 -Node: SVR41053789 -Node: POSIX1055234 -Node: BTL1056623 -Node: POSIX/GNU1057357 -Node: Feature History1062921 -Node: Common Extensions1076019 -Node: Ranges and Locales1077343 -Ref: Ranges and Locales-Footnote-11081961 -Ref: Ranges and Locales-Footnote-21081988 -Ref: Ranges and Locales-Footnote-31082222 -Node: Contributors1082443 -Node: History summary1087984 -Node: Installation1089354 -Node: Gawk Distribution1090300 -Node: Getting1090784 -Node: Extracting1091607 -Node: Distribution contents1093242 -Node: Unix Installation1098959 -Node: Quick Installation1099576 -Node: Additional Configuration Options1102000 -Node: Configuration Philosophy1103738 -Node: Non-Unix Installation1106107 -Node: PC Installation1106565 -Node: PC Binary Installation1107884 -Node: PC Compiling1109732 -Ref: PC Compiling-Footnote-11112753 -Node: PC Testing1112862 -Node: PC Using1114038 -Node: Cygwin1118153 -Node: MSYS1118976 -Node: VMS Installation1119476 -Node: VMS Compilation1120268 -Ref: VMS Compilation-Footnote-11121490 -Node: VMS Dynamic Extensions1121548 -Node: VMS Installation Details1123232 -Node: VMS Running1125484 -Node: VMS GNV1128320 -Node: VMS Old Gawk1129054 -Node: Bugs1129524 -Node: Other Versions1133407 -Node: Installation summary1139831 -Node: Notes1140887 -Node: Compatibility Mode1141752 -Node: Additions1142534 -Node: Accessing The Source1143459 -Node: Adding Code1144894 -Node: New Ports1151051 -Node: Derived Files1155533 -Ref: Derived Files-Footnote-11161008 -Ref: Derived Files-Footnote-21161042 -Ref: Derived Files-Footnote-31161638 -Node: Future Extensions1161752 -Node: Implementation Limitations1162358 -Node: Extension Design1163606 -Node: Old Extension Problems1164760 -Ref: Old Extension Problems-Footnote-11166277 -Node: Extension New Mechanism Goals1166334 -Ref: Extension New Mechanism Goals-Footnote-11169694 -Node: Extension Other Design Decisions1169883 -Node: Extension Future Growth1171991 -Node: Old Extension Mechanism1172827 -Node: Notes summary1174589 -Node: Basic Concepts1175775 -Node: Basic High Level1176456 -Ref: figure-general-flow1176728 -Ref: figure-process-flow1177327 -Ref: Basic High Level-Footnote-11180556 -Node: Basic Data Typing1180741 -Node: Glossary1184069 -Node: Copying1215998 -Node: GNU Free Documentation License1253554 -Node: Index1278690 +Ref: User-modified-Footnote-1440520 +Node: Auto-set440582 +Ref: Auto-set-Footnote-1453634 +Ref: Auto-set-Footnote-2453839 +Node: ARGC and ARGV453895 +Node: Pattern Action Summary458113 +Node: Arrays460546 +Node: Array Basics461875 +Node: Array Intro462719 +Ref: figure-array-elements464683 +Ref: Array Intro-Footnote-1467209 +Node: Reference to Elements467337 +Node: Assigning Elements469789 +Node: Array Example470280 +Node: Scanning an Array472038 +Node: Controlling Scanning475054 +Ref: Controlling Scanning-Footnote-1480250 +Node: Numeric Array Subscripts480566 +Node: Uninitialized Subscripts482751 +Node: Delete484368 +Ref: Delete-Footnote-1487111 +Node: Multidimensional487168 +Node: Multiscanning490265 +Node: Arrays of Arrays491854 +Node: Arrays Summary496613 +Node: Functions498705 +Node: Built-in499604 +Node: Calling Built-in500682 +Node: Numeric Functions502673 +Ref: Numeric Functions-Footnote-1506690 +Ref: Numeric Functions-Footnote-2507047 +Ref: Numeric Functions-Footnote-3507095 +Node: String Functions507367 +Ref: String Functions-Footnote-1530842 +Ref: String Functions-Footnote-2530971 +Ref: String Functions-Footnote-3531219 +Node: Gory Details531306 +Ref: table-sub-escapes533087 +Ref: table-sub-proposed534607 +Ref: table-posix-sub535971 +Ref: table-gensub-escapes537507 +Ref: Gory Details-Footnote-1538339 +Node: I/O Functions538490 +Ref: I/O Functions-Footnote-1545708 +Node: Time Functions545855 +Ref: Time Functions-Footnote-1556343 +Ref: Time Functions-Footnote-2556411 +Ref: Time Functions-Footnote-3556569 +Ref: Time Functions-Footnote-4556680 +Ref: Time Functions-Footnote-5556792 +Ref: Time Functions-Footnote-6557019 +Node: Bitwise Functions557285 +Ref: table-bitwise-ops557847 +Ref: Bitwise Functions-Footnote-1562156 +Node: Type Functions562325 +Node: I18N Functions563476 +Node: User-defined565121 +Node: Definition Syntax565926 +Ref: Definition Syntax-Footnote-1571333 +Node: Function Example571404 +Ref: Function Example-Footnote-1574323 +Node: Function Caveats574345 +Node: Calling A Function574863 +Node: Variable Scope575821 +Node: Pass By Value/Reference578809 +Node: Return Statement582304 +Node: Dynamic Typing585285 +Node: Indirect Calls586214 +Ref: Indirect Calls-Footnote-1597516 +Node: Functions Summary597644 +Node: Library Functions600346 +Ref: Library Functions-Footnote-1603955 +Ref: Library Functions-Footnote-2604098 +Node: Library Names604269 +Ref: Library Names-Footnote-1607723 +Ref: Library Names-Footnote-2607946 +Node: General Functions608032 +Node: Strtonum Function609135 +Node: Assert Function612157 +Node: Round Function615481 +Node: Cliff Random Function617022 +Node: Ordinal Functions618038 +Ref: Ordinal Functions-Footnote-1621101 +Ref: Ordinal Functions-Footnote-2621353 +Node: Join Function621564 +Ref: Join Function-Footnote-1623333 +Node: Getlocaltime Function623533 +Node: Readfile Function627277 +Node: Shell Quoting629247 +Node: Data File Management630648 +Node: Filetrans Function631280 +Node: Rewind Function635336 +Node: File Checking636723 +Ref: File Checking-Footnote-1638055 +Node: Empty Files638256 +Node: Ignoring Assigns640235 +Node: Getopt Function641786 +Ref: Getopt Function-Footnote-1653248 +Node: Passwd Functions653448 +Ref: Passwd Functions-Footnote-1662285 +Node: Group Functions662373 +Ref: Group Functions-Footnote-1670267 +Node: Walking Arrays670480 +Node: Library Functions Summary672083 +Node: Library Exercises673484 +Node: Sample Programs674764 +Node: Running Examples675534 +Node: Clones676262 +Node: Cut Program677486 +Node: Egrep Program687205 +Ref: Egrep Program-Footnote-1694703 +Node: Id Program694813 +Node: Split Program698458 +Ref: Split Program-Footnote-1701906 +Node: Tee Program702034 +Node: Uniq Program704823 +Node: Wc Program712242 +Ref: Wc Program-Footnote-1716492 +Node: Miscellaneous Programs716586 +Node: Dupword Program717799 +Node: Alarm Program719830 +Node: Translate Program724634 +Ref: Translate Program-Footnote-1729199 +Node: Labels Program729469 +Ref: Labels Program-Footnote-1732820 +Node: Word Sorting732904 +Node: History Sorting736975 +Node: Extract Program738811 +Node: Simple Sed746336 +Node: Igawk Program749404 +Ref: Igawk Program-Footnote-1763728 +Ref: Igawk Program-Footnote-2763929 +Ref: Igawk Program-Footnote-3764051 +Node: Anagram Program764166 +Node: Signature Program767223 +Node: Programs Summary768470 +Node: Programs Exercises769663 +Ref: Programs Exercises-Footnote-1773794 +Node: Advanced Features773885 +Node: Nondecimal Data775833 +Node: Array Sorting777423 +Node: Controlling Array Traversal778120 +Ref: Controlling Array Traversal-Footnote-1786453 +Node: Array Sorting Functions786571 +Ref: Array Sorting Functions-Footnote-1790460 +Node: Two-way I/O790656 +Ref: Two-way I/O-Footnote-1795601 +Ref: Two-way I/O-Footnote-2795787 +Node: TCP/IP Networking795869 +Node: Profiling798742 +Node: Advanced Features Summary806289 +Node: Internationalization808222 +Node: I18N and L10N809702 +Node: Explaining gettext810388 +Ref: Explaining gettext-Footnote-1815413 +Ref: Explaining gettext-Footnote-2815597 +Node: Programmer i18n815762 +Ref: Programmer i18n-Footnote-1820628 +Node: Translator i18n820677 +Node: String Extraction821471 +Ref: String Extraction-Footnote-1822602 +Node: Printf Ordering822688 +Ref: Printf Ordering-Footnote-1825474 +Node: I18N Portability825538 +Ref: I18N Portability-Footnote-1827993 +Node: I18N Example828056 +Ref: I18N Example-Footnote-1830859 +Node: Gawk I18N830931 +Node: I18N Summary831569 +Node: Debugger832908 +Node: Debugging833930 +Node: Debugging Concepts834371 +Node: Debugging Terms836224 +Node: Awk Debugging838796 +Node: Sample Debugging Session839690 +Node: Debugger Invocation840210 +Node: Finding The Bug841594 +Node: List of Debugger Commands848069 +Node: Breakpoint Control849402 +Node: Debugger Execution Control853098 +Node: Viewing And Changing Data856462 +Node: Execution Stack859840 +Node: Debugger Info861477 +Node: Miscellaneous Debugger Commands865494 +Node: Readline Support870523 +Node: Limitations871415 +Node: Debugging Summary873529 +Node: Arbitrary Precision Arithmetic874697 +Node: Computer Arithmetic876113 +Ref: table-numeric-ranges879711 +Ref: Computer Arithmetic-Footnote-1880570 +Node: Math Definitions880627 +Ref: table-ieee-formats883915 +Ref: Math Definitions-Footnote-1884519 +Node: MPFR features884624 +Node: FP Math Caution886295 +Ref: FP Math Caution-Footnote-1887345 +Node: Inexactness of computations887714 +Node: Inexact representation888673 +Node: Comparing FP Values890030 +Node: Errors accumulate891112 +Node: Getting Accuracy892545 +Node: Try To Round895207 +Node: Setting precision896106 +Ref: table-predefined-precision-strings896790 +Node: Setting the rounding mode898579 +Ref: table-gawk-rounding-modes898943 +Ref: Setting the rounding mode-Footnote-1902398 +Node: Arbitrary Precision Integers902577 +Ref: Arbitrary Precision Integers-Footnote-1905563 +Node: POSIX Floating Point Problems905712 +Ref: POSIX Floating Point Problems-Footnote-1909585 +Node: Floating point summary909623 +Node: Dynamic Extensions911817 +Node: Extension Intro913369 +Node: Plugin License914635 +Node: Extension Mechanism Outline915432 +Ref: figure-load-extension915860 +Ref: figure-register-new-function917340 +Ref: figure-call-new-function918344 +Node: Extension API Description920330 +Node: Extension API Functions Introduction921780 +Node: General Data Types926604 +Ref: General Data Types-Footnote-1932343 +Node: Memory Allocation Functions932642 +Ref: Memory Allocation Functions-Footnote-1935481 +Node: Constructor Functions935577 +Node: Registration Functions937311 +Node: Extension Functions937996 +Node: Exit Callback Functions940293 +Node: Extension Version String941541 +Node: Input Parsers942206 +Node: Output Wrappers952085 +Node: Two-way processors956600 +Node: Printing Messages958804 +Ref: Printing Messages-Footnote-1959880 +Node: Updating `ERRNO'960032 +Node: Requesting Values960772 +Ref: table-value-types-returned961500 +Node: Accessing Parameters962457 +Node: Symbol Table Access963688 +Node: Symbol table by name964202 +Node: Symbol table by cookie966183 +Ref: Symbol table by cookie-Footnote-1970327 +Node: Cached values970390 +Ref: Cached values-Footnote-1973889 +Node: Array Manipulation973980 +Ref: Array Manipulation-Footnote-1975078 +Node: Array Data Types975115 +Ref: Array Data Types-Footnote-1977770 +Node: Array Functions977862 +Node: Flattening Arrays981716 +Node: Creating Arrays988608 +Node: Extension API Variables993379 +Node: Extension Versioning994015 +Node: Extension API Informational Variables995916 +Node: Extension API Boilerplate996981 +Node: Finding Extensions1000790 +Node: Extension Example1001350 +Node: Internal File Description1002122 +Node: Internal File Ops1006189 +Ref: Internal File Ops-Footnote-11017859 +Node: Using Internal File Ops1017999 +Ref: Using Internal File Ops-Footnote-11020382 +Node: Extension Samples1020655 +Node: Extension Sample File Functions1022181 +Node: Extension Sample Fnmatch1029819 +Node: Extension Sample Fork1031310 +Node: Extension Sample Inplace1032525 +Node: Extension Sample Ord1034200 +Node: Extension Sample Readdir1035036 +Ref: table-readdir-file-types1035912 +Node: Extension Sample Revout1036723 +Node: Extension Sample Rev2way1037313 +Node: Extension Sample Read write array1038053 +Node: Extension Sample Readfile1039993 +Node: Extension Sample Time1041088 +Node: Extension Sample API Tests1042437 +Node: gawkextlib1042928 +Node: Extension summary1045586 +Node: Extension Exercises1049275 +Node: Language History1049997 +Node: V7/SVR3.11051653 +Node: SVR41053834 +Node: POSIX1055279 +Node: BTL1056668 +Node: POSIX/GNU1057402 +Node: Feature History1062966 +Node: Common Extensions1076064 +Node: Ranges and Locales1077388 +Ref: Ranges and Locales-Footnote-11082006 +Ref: Ranges and Locales-Footnote-21082033 +Ref: Ranges and Locales-Footnote-31082267 +Node: Contributors1082488 +Node: History summary1088029 +Node: Installation1089399 +Node: Gawk Distribution1090345 +Node: Getting1090829 +Node: Extracting1091652 +Node: Distribution contents1093287 +Node: Unix Installation1099004 +Node: Quick Installation1099621 +Node: Additional Configuration Options1102045 +Node: Configuration Philosophy1103783 +Node: Non-Unix Installation1106152 +Node: PC Installation1106610 +Node: PC Binary Installation1107929 +Node: PC Compiling1109777 +Ref: PC Compiling-Footnote-11112798 +Node: PC Testing1112907 +Node: PC Using1114083 +Node: Cygwin1118198 +Node: MSYS1119021 +Node: VMS Installation1119521 +Node: VMS Compilation1120313 +Ref: VMS Compilation-Footnote-11121535 +Node: VMS Dynamic Extensions1121593 +Node: VMS Installation Details1123277 +Node: VMS Running1125529 +Node: VMS GNV1128365 +Node: VMS Old Gawk1129099 +Node: Bugs1129569 +Node: Other Versions1133452 +Node: Installation summary1139876 +Node: Notes1140932 +Node: Compatibility Mode1141797 +Node: Additions1142579 +Node: Accessing The Source1143504 +Node: Adding Code1144939 +Node: New Ports1151096 +Node: Derived Files1155578 +Ref: Derived Files-Footnote-11161053 +Ref: Derived Files-Footnote-21161087 +Ref: Derived Files-Footnote-31161683 +Node: Future Extensions1161797 +Node: Implementation Limitations1162403 +Node: Extension Design1163651 +Node: Old Extension Problems1164805 +Ref: Old Extension Problems-Footnote-11166322 +Node: Extension New Mechanism Goals1166379 +Ref: Extension New Mechanism Goals-Footnote-11169739 +Node: Extension Other Design Decisions1169928 +Node: Extension Future Growth1172036 +Node: Old Extension Mechanism1172872 +Node: Notes summary1174634 +Node: Basic Concepts1175820 +Node: Basic High Level1176501 +Ref: figure-general-flow1176773 +Ref: figure-process-flow1177372 +Ref: Basic High Level-Footnote-11180601 +Node: Basic Data Typing1180786 +Node: Glossary1184114 +Node: Copying1216043 +Node: GNU Free Documentation License1253599 +Node: Index1278735  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 12b07bba..f354318f 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -14506,7 +14506,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 @@ -14514,7 +14514,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 @@ -14589,7 +14589,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()} @@ -14615,7 +14615,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 @@ -14627,7 +14627,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 @@ -14642,7 +14642,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. @@ -14660,7 +14660,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 @@ -14689,7 +14689,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}). @@ -14707,7 +14707,7 @@ The default value of @code{TEXTDOMAIN} is @code{"messages"}. @end table @node Auto-set -@subsection Built-In Variables That Convey Information +@subsection Built-in Variables That Convey Information @cindex predefined variables, conveying information @cindex variables, predefined conveying information @@ -14851,12 +14851,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 @@ -14906,7 +14906,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: @@ -14926,7 +14926,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" @@ -15047,7 +15047,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 @@ -15114,7 +15114,7 @@ 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 @@ -15334,7 +15334,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}). @@ -15348,15 +15348,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 @@ -15386,12 +15386,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. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 6d1bc395..a94d11b7 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -13834,7 +13834,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 @@ -13842,7 +13842,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 @@ -13917,7 +13917,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()} @@ -13943,7 +13943,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 @@ -13955,7 +13955,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 @@ -13970,7 +13970,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. @@ -13988,7 +13988,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 @@ -14017,7 +14017,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}). @@ -14035,7 +14035,7 @@ The default value of @code{TEXTDOMAIN} is @code{"messages"}. @end table @node Auto-set -@subsection Built-In Variables That Convey Information +@subsection Built-in Variables That Convey Information @cindex predefined variables, conveying information @cindex variables, predefined conveying information @@ -14179,12 +14179,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 @@ -14234,7 +14234,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: @@ -14254,7 +14254,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" @@ -14375,7 +14375,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 @@ -14442,7 +14442,7 @@ 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 @@ -14616,7 +14616,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}). @@ -14630,15 +14630,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 @@ -14668,12 +14668,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. -- cgit v1.2.3 From 62fe40d1944810a79c13bd519a5f1157c49cefb6 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 27 Jan 2015 06:21:23 +0200 Subject: O'Reilly fixes. --- doc/ChangeLog | 4 + doc/gawk.info | 804 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 120 +++++---- doc/gawktexi.in | 120 +++++---- 4 files changed, 547 insertions(+), 501 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 48d05b05..6efc88b3 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-01-27 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-01-26 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index ef092701..80cca4be 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -10855,9 +10855,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} @@ -10866,17 +10866,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) @@ -10885,11 +10887,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 @@ -10900,17 +10904,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. @@ -10934,7 +10940,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] @@ -10942,8 +10948,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 @@ -11010,7 +11016,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 @@ -11081,7 +11087,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 @@ -11164,7 +11170,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. @@ -11212,22 +11218,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 @@ -11413,8 +11423,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) @@ -11617,7 +11627,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': @@ -11626,7 +11636,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: @@ -11644,8 +11654,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]" @@ -11653,7 +11663,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: @@ -11674,7 +11684,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]) @@ -11756,9 +11766,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. @@ -11766,7 +11776,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. @@ -12319,7 +12329,7 @@ Options::): 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" @@ -31743,7 +31753,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) @@ -31770,7 +31780,7 @@ 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. @@ -32063,7 +32073,7 @@ 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, array indices and: Array Intro. (line 100) * case sensitivity, converting case: String Functions. (line 522) * case sensitivity, example programs: Library Functions. (line 53) * case sensitivity, gawk: Case-sensitivity. (line 26) @@ -32936,7 +32946,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) @@ -33103,7 +33113,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. @@ -34093,7 +34103,7 @@ 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) @@ -34659,351 +34669,351 @@ Node: Pattern Action Summary458113 Node: Arrays460546 Node: Array Basics461875 Node: Array Intro462719 -Ref: figure-array-elements464683 -Ref: Array Intro-Footnote-1467209 -Node: Reference to Elements467337 -Node: Assigning Elements469789 -Node: Array Example470280 -Node: Scanning an Array472038 -Node: Controlling Scanning475054 -Ref: Controlling Scanning-Footnote-1480250 -Node: Numeric Array Subscripts480566 -Node: Uninitialized Subscripts482751 -Node: Delete484368 -Ref: Delete-Footnote-1487111 -Node: Multidimensional487168 -Node: Multiscanning490265 -Node: Arrays of Arrays491854 -Node: Arrays Summary496613 -Node: Functions498705 -Node: Built-in499604 -Node: Calling Built-in500682 -Node: Numeric Functions502673 -Ref: Numeric Functions-Footnote-1506690 -Ref: Numeric Functions-Footnote-2507047 -Ref: Numeric Functions-Footnote-3507095 -Node: String Functions507367 -Ref: String Functions-Footnote-1530842 -Ref: String Functions-Footnote-2530971 -Ref: String Functions-Footnote-3531219 -Node: Gory Details531306 -Ref: table-sub-escapes533087 -Ref: table-sub-proposed534607 -Ref: table-posix-sub535971 -Ref: table-gensub-escapes537507 -Ref: Gory Details-Footnote-1538339 -Node: I/O Functions538490 -Ref: I/O Functions-Footnote-1545708 -Node: Time Functions545855 -Ref: Time Functions-Footnote-1556343 -Ref: Time Functions-Footnote-2556411 -Ref: Time Functions-Footnote-3556569 -Ref: Time Functions-Footnote-4556680 -Ref: Time Functions-Footnote-5556792 -Ref: Time Functions-Footnote-6557019 -Node: Bitwise Functions557285 -Ref: table-bitwise-ops557847 -Ref: Bitwise Functions-Footnote-1562156 -Node: Type Functions562325 -Node: I18N Functions563476 -Node: User-defined565121 -Node: Definition Syntax565926 -Ref: Definition Syntax-Footnote-1571333 -Node: Function Example571404 -Ref: Function Example-Footnote-1574323 -Node: Function Caveats574345 -Node: Calling A Function574863 -Node: Variable Scope575821 -Node: Pass By Value/Reference578809 -Node: Return Statement582304 -Node: Dynamic Typing585285 -Node: Indirect Calls586214 -Ref: Indirect Calls-Footnote-1597516 -Node: Functions Summary597644 -Node: Library Functions600346 -Ref: Library Functions-Footnote-1603955 -Ref: Library Functions-Footnote-2604098 -Node: Library Names604269 -Ref: Library Names-Footnote-1607723 -Ref: Library Names-Footnote-2607946 -Node: General Functions608032 -Node: Strtonum Function609135 -Node: Assert Function612157 -Node: Round Function615481 -Node: Cliff Random Function617022 -Node: Ordinal Functions618038 -Ref: Ordinal Functions-Footnote-1621101 -Ref: Ordinal Functions-Footnote-2621353 -Node: Join Function621564 -Ref: Join Function-Footnote-1623333 -Node: Getlocaltime Function623533 -Node: Readfile Function627277 -Node: Shell Quoting629247 -Node: Data File Management630648 -Node: Filetrans Function631280 -Node: Rewind Function635336 -Node: File Checking636723 -Ref: File Checking-Footnote-1638055 -Node: Empty Files638256 -Node: Ignoring Assigns640235 -Node: Getopt Function641786 -Ref: Getopt Function-Footnote-1653248 -Node: Passwd Functions653448 -Ref: Passwd Functions-Footnote-1662285 -Node: Group Functions662373 -Ref: Group Functions-Footnote-1670267 -Node: Walking Arrays670480 -Node: Library Functions Summary672083 -Node: Library Exercises673484 -Node: Sample Programs674764 -Node: Running Examples675534 -Node: Clones676262 -Node: Cut Program677486 -Node: Egrep Program687205 -Ref: Egrep Program-Footnote-1694703 -Node: Id Program694813 -Node: Split Program698458 -Ref: Split Program-Footnote-1701906 -Node: Tee Program702034 -Node: Uniq Program704823 -Node: Wc Program712242 -Ref: Wc Program-Footnote-1716492 -Node: Miscellaneous Programs716586 -Node: Dupword Program717799 -Node: Alarm Program719830 -Node: Translate Program724634 -Ref: Translate Program-Footnote-1729199 -Node: Labels Program729469 -Ref: Labels Program-Footnote-1732820 -Node: Word Sorting732904 -Node: History Sorting736975 -Node: Extract Program738811 -Node: Simple Sed746336 -Node: Igawk Program749404 -Ref: Igawk Program-Footnote-1763728 -Ref: Igawk Program-Footnote-2763929 -Ref: Igawk Program-Footnote-3764051 -Node: Anagram Program764166 -Node: Signature Program767223 -Node: Programs Summary768470 -Node: Programs Exercises769663 -Ref: Programs Exercises-Footnote-1773794 -Node: Advanced Features773885 -Node: Nondecimal Data775833 -Node: Array Sorting777423 -Node: Controlling Array Traversal778120 -Ref: Controlling Array Traversal-Footnote-1786453 -Node: Array Sorting Functions786571 -Ref: Array Sorting Functions-Footnote-1790460 -Node: Two-way I/O790656 -Ref: Two-way I/O-Footnote-1795601 -Ref: Two-way I/O-Footnote-2795787 -Node: TCP/IP Networking795869 -Node: Profiling798742 -Node: Advanced Features Summary806289 -Node: Internationalization808222 -Node: I18N and L10N809702 -Node: Explaining gettext810388 -Ref: Explaining gettext-Footnote-1815413 -Ref: Explaining gettext-Footnote-2815597 -Node: Programmer i18n815762 -Ref: Programmer i18n-Footnote-1820628 -Node: Translator i18n820677 -Node: String Extraction821471 -Ref: String Extraction-Footnote-1822602 -Node: Printf Ordering822688 -Ref: Printf Ordering-Footnote-1825474 -Node: I18N Portability825538 -Ref: I18N Portability-Footnote-1827993 -Node: I18N Example828056 -Ref: I18N Example-Footnote-1830859 -Node: Gawk I18N830931 -Node: I18N Summary831569 -Node: Debugger832908 -Node: Debugging833930 -Node: Debugging Concepts834371 -Node: Debugging Terms836224 -Node: Awk Debugging838796 -Node: Sample Debugging Session839690 -Node: Debugger Invocation840210 -Node: Finding The Bug841594 -Node: List of Debugger Commands848069 -Node: Breakpoint Control849402 -Node: Debugger Execution Control853098 -Node: Viewing And Changing Data856462 -Node: Execution Stack859840 -Node: Debugger Info861477 -Node: Miscellaneous Debugger Commands865494 -Node: Readline Support870523 -Node: Limitations871415 -Node: Debugging Summary873529 -Node: Arbitrary Precision Arithmetic874697 -Node: Computer Arithmetic876113 -Ref: table-numeric-ranges879711 -Ref: Computer Arithmetic-Footnote-1880570 -Node: Math Definitions880627 -Ref: table-ieee-formats883915 -Ref: Math Definitions-Footnote-1884519 -Node: MPFR features884624 -Node: FP Math Caution886295 -Ref: FP Math Caution-Footnote-1887345 -Node: Inexactness of computations887714 -Node: Inexact representation888673 -Node: Comparing FP Values890030 -Node: Errors accumulate891112 -Node: Getting Accuracy892545 -Node: Try To Round895207 -Node: Setting precision896106 -Ref: table-predefined-precision-strings896790 -Node: Setting the rounding mode898579 -Ref: table-gawk-rounding-modes898943 -Ref: Setting the rounding mode-Footnote-1902398 -Node: Arbitrary Precision Integers902577 -Ref: Arbitrary Precision Integers-Footnote-1905563 -Node: POSIX Floating Point Problems905712 -Ref: POSIX Floating Point Problems-Footnote-1909585 -Node: Floating point summary909623 -Node: Dynamic Extensions911817 -Node: Extension Intro913369 -Node: Plugin License914635 -Node: Extension Mechanism Outline915432 -Ref: figure-load-extension915860 -Ref: figure-register-new-function917340 -Ref: figure-call-new-function918344 -Node: Extension API Description920330 -Node: Extension API Functions Introduction921780 -Node: General Data Types926604 -Ref: General Data Types-Footnote-1932343 -Node: Memory Allocation Functions932642 -Ref: Memory Allocation Functions-Footnote-1935481 -Node: Constructor Functions935577 -Node: Registration Functions937311 -Node: Extension Functions937996 -Node: Exit Callback Functions940293 -Node: Extension Version String941541 -Node: Input Parsers942206 -Node: Output Wrappers952085 -Node: Two-way processors956600 -Node: Printing Messages958804 -Ref: Printing Messages-Footnote-1959880 -Node: Updating `ERRNO'960032 -Node: Requesting Values960772 -Ref: table-value-types-returned961500 -Node: Accessing Parameters962457 -Node: Symbol Table Access963688 -Node: Symbol table by name964202 -Node: Symbol table by cookie966183 -Ref: Symbol table by cookie-Footnote-1970327 -Node: Cached values970390 -Ref: Cached values-Footnote-1973889 -Node: Array Manipulation973980 -Ref: Array Manipulation-Footnote-1975078 -Node: Array Data Types975115 -Ref: Array Data Types-Footnote-1977770 -Node: Array Functions977862 -Node: Flattening Arrays981716 -Node: Creating Arrays988608 -Node: Extension API Variables993379 -Node: Extension Versioning994015 -Node: Extension API Informational Variables995916 -Node: Extension API Boilerplate996981 -Node: Finding Extensions1000790 -Node: Extension Example1001350 -Node: Internal File Description1002122 -Node: Internal File Ops1006189 -Ref: Internal File Ops-Footnote-11017859 -Node: Using Internal File Ops1017999 -Ref: Using Internal File Ops-Footnote-11020382 -Node: Extension Samples1020655 -Node: Extension Sample File Functions1022181 -Node: Extension Sample Fnmatch1029819 -Node: Extension Sample Fork1031310 -Node: Extension Sample Inplace1032525 -Node: Extension Sample Ord1034200 -Node: Extension Sample Readdir1035036 -Ref: table-readdir-file-types1035912 -Node: Extension Sample Revout1036723 -Node: Extension Sample Rev2way1037313 -Node: Extension Sample Read write array1038053 -Node: Extension Sample Readfile1039993 -Node: Extension Sample Time1041088 -Node: Extension Sample API Tests1042437 -Node: gawkextlib1042928 -Node: Extension summary1045586 -Node: Extension Exercises1049275 -Node: Language History1049997 -Node: V7/SVR3.11051653 -Node: SVR41053834 -Node: POSIX1055279 -Node: BTL1056668 -Node: POSIX/GNU1057402 -Node: Feature History1062966 -Node: Common Extensions1076064 -Node: Ranges and Locales1077388 -Ref: Ranges and Locales-Footnote-11082006 -Ref: Ranges and Locales-Footnote-21082033 -Ref: Ranges and Locales-Footnote-31082267 -Node: Contributors1082488 -Node: History summary1088029 -Node: Installation1089399 -Node: Gawk Distribution1090345 -Node: Getting1090829 -Node: Extracting1091652 -Node: Distribution contents1093287 -Node: Unix Installation1099004 -Node: Quick Installation1099621 -Node: Additional Configuration Options1102045 -Node: Configuration Philosophy1103783 -Node: Non-Unix Installation1106152 -Node: PC Installation1106610 -Node: PC Binary Installation1107929 -Node: PC Compiling1109777 -Ref: PC Compiling-Footnote-11112798 -Node: PC Testing1112907 -Node: PC Using1114083 -Node: Cygwin1118198 -Node: MSYS1119021 -Node: VMS Installation1119521 -Node: VMS Compilation1120313 -Ref: VMS Compilation-Footnote-11121535 -Node: VMS Dynamic Extensions1121593 -Node: VMS Installation Details1123277 -Node: VMS Running1125529 -Node: VMS GNV1128365 -Node: VMS Old Gawk1129099 -Node: Bugs1129569 -Node: Other Versions1133452 -Node: Installation summary1139876 -Node: Notes1140932 -Node: Compatibility Mode1141797 -Node: Additions1142579 -Node: Accessing The Source1143504 -Node: Adding Code1144939 -Node: New Ports1151096 -Node: Derived Files1155578 -Ref: Derived Files-Footnote-11161053 -Ref: Derived Files-Footnote-21161087 -Ref: Derived Files-Footnote-31161683 -Node: Future Extensions1161797 -Node: Implementation Limitations1162403 -Node: Extension Design1163651 -Node: Old Extension Problems1164805 -Ref: Old Extension Problems-Footnote-11166322 -Node: Extension New Mechanism Goals1166379 -Ref: Extension New Mechanism Goals-Footnote-11169739 -Node: Extension Other Design Decisions1169928 -Node: Extension Future Growth1172036 -Node: Old Extension Mechanism1172872 -Node: Notes summary1174634 -Node: Basic Concepts1175820 -Node: Basic High Level1176501 -Ref: figure-general-flow1176773 -Ref: figure-process-flow1177372 -Ref: Basic High Level-Footnote-11180601 -Node: Basic Data Typing1180786 -Node: Glossary1184114 -Node: Copying1216043 -Node: GNU Free Documentation License1253599 -Node: Index1278735 +Ref: figure-array-elements464653 +Ref: Array Intro-Footnote-1467273 +Node: Reference to Elements467401 +Node: Assigning Elements469863 +Node: Array Example470354 +Node: Scanning an Array472113 +Node: Controlling Scanning475133 +Ref: Controlling Scanning-Footnote-1480527 +Node: Numeric Array Subscripts480843 +Node: Uninitialized Subscripts483028 +Node: Delete484645 +Ref: Delete-Footnote-1487394 +Node: Multidimensional487451 +Node: Multiscanning490548 +Node: Arrays of Arrays492137 +Node: Arrays Summary496891 +Node: Functions498982 +Node: Built-in499881 +Node: Calling Built-in500959 +Node: Numeric Functions502950 +Ref: Numeric Functions-Footnote-1506967 +Ref: Numeric Functions-Footnote-2507324 +Ref: Numeric Functions-Footnote-3507372 +Node: String Functions507644 +Ref: String Functions-Footnote-1531121 +Ref: String Functions-Footnote-2531250 +Ref: String Functions-Footnote-3531498 +Node: Gory Details531585 +Ref: table-sub-escapes533366 +Ref: table-sub-proposed534886 +Ref: table-posix-sub536250 +Ref: table-gensub-escapes537786 +Ref: Gory Details-Footnote-1538618 +Node: I/O Functions538769 +Ref: I/O Functions-Footnote-1545987 +Node: Time Functions546134 +Ref: Time Functions-Footnote-1556622 +Ref: Time Functions-Footnote-2556690 +Ref: Time Functions-Footnote-3556848 +Ref: Time Functions-Footnote-4556959 +Ref: Time Functions-Footnote-5557071 +Ref: Time Functions-Footnote-6557298 +Node: Bitwise Functions557564 +Ref: table-bitwise-ops558126 +Ref: Bitwise Functions-Footnote-1562435 +Node: Type Functions562604 +Node: I18N Functions563755 +Node: User-defined565400 +Node: Definition Syntax566205 +Ref: Definition Syntax-Footnote-1571612 +Node: Function Example571683 +Ref: Function Example-Footnote-1574602 +Node: Function Caveats574624 +Node: Calling A Function575142 +Node: Variable Scope576100 +Node: Pass By Value/Reference579088 +Node: Return Statement582583 +Node: Dynamic Typing585564 +Node: Indirect Calls586493 +Ref: Indirect Calls-Footnote-1597795 +Node: Functions Summary597923 +Node: Library Functions600625 +Ref: Library Functions-Footnote-1604234 +Ref: Library Functions-Footnote-2604377 +Node: Library Names604548 +Ref: Library Names-Footnote-1608002 +Ref: Library Names-Footnote-2608225 +Node: General Functions608311 +Node: Strtonum Function609414 +Node: Assert Function612436 +Node: Round Function615760 +Node: Cliff Random Function617301 +Node: Ordinal Functions618317 +Ref: Ordinal Functions-Footnote-1621380 +Ref: Ordinal Functions-Footnote-2621632 +Node: Join Function621843 +Ref: Join Function-Footnote-1623612 +Node: Getlocaltime Function623812 +Node: Readfile Function627556 +Node: Shell Quoting629526 +Node: Data File Management630927 +Node: Filetrans Function631559 +Node: Rewind Function635615 +Node: File Checking637002 +Ref: File Checking-Footnote-1638334 +Node: Empty Files638535 +Node: Ignoring Assigns640514 +Node: Getopt Function642065 +Ref: Getopt Function-Footnote-1653527 +Node: Passwd Functions653727 +Ref: Passwd Functions-Footnote-1662564 +Node: Group Functions662652 +Ref: Group Functions-Footnote-1670546 +Node: Walking Arrays670759 +Node: Library Functions Summary672362 +Node: Library Exercises673763 +Node: Sample Programs675043 +Node: Running Examples675813 +Node: Clones676541 +Node: Cut Program677765 +Node: Egrep Program687484 +Ref: Egrep Program-Footnote-1694982 +Node: Id Program695092 +Node: Split Program698737 +Ref: Split Program-Footnote-1702185 +Node: Tee Program702313 +Node: Uniq Program705102 +Node: Wc Program712521 +Ref: Wc Program-Footnote-1716771 +Node: Miscellaneous Programs716865 +Node: Dupword Program718078 +Node: Alarm Program720109 +Node: Translate Program724913 +Ref: Translate Program-Footnote-1729478 +Node: Labels Program729748 +Ref: Labels Program-Footnote-1733099 +Node: Word Sorting733183 +Node: History Sorting737254 +Node: Extract Program739090 +Node: Simple Sed746615 +Node: Igawk Program749683 +Ref: Igawk Program-Footnote-1764007 +Ref: Igawk Program-Footnote-2764208 +Ref: Igawk Program-Footnote-3764330 +Node: Anagram Program764445 +Node: Signature Program767502 +Node: Programs Summary768749 +Node: Programs Exercises769942 +Ref: Programs Exercises-Footnote-1774073 +Node: Advanced Features774164 +Node: Nondecimal Data776112 +Node: Array Sorting777702 +Node: Controlling Array Traversal778399 +Ref: Controlling Array Traversal-Footnote-1786732 +Node: Array Sorting Functions786850 +Ref: Array Sorting Functions-Footnote-1790739 +Node: Two-way I/O790935 +Ref: Two-way I/O-Footnote-1795880 +Ref: Two-way I/O-Footnote-2796066 +Node: TCP/IP Networking796148 +Node: Profiling799021 +Node: Advanced Features Summary806568 +Node: Internationalization808501 +Node: I18N and L10N809981 +Node: Explaining gettext810667 +Ref: Explaining gettext-Footnote-1815692 +Ref: Explaining gettext-Footnote-2815876 +Node: Programmer i18n816041 +Ref: Programmer i18n-Footnote-1820907 +Node: Translator i18n820956 +Node: String Extraction821750 +Ref: String Extraction-Footnote-1822881 +Node: Printf Ordering822967 +Ref: Printf Ordering-Footnote-1825753 +Node: I18N Portability825817 +Ref: I18N Portability-Footnote-1828272 +Node: I18N Example828335 +Ref: I18N Example-Footnote-1831138 +Node: Gawk I18N831210 +Node: I18N Summary831848 +Node: Debugger833187 +Node: Debugging834209 +Node: Debugging Concepts834650 +Node: Debugging Terms836503 +Node: Awk Debugging839075 +Node: Sample Debugging Session839969 +Node: Debugger Invocation840489 +Node: Finding The Bug841873 +Node: List of Debugger Commands848348 +Node: Breakpoint Control849681 +Node: Debugger Execution Control853377 +Node: Viewing And Changing Data856741 +Node: Execution Stack860119 +Node: Debugger Info861756 +Node: Miscellaneous Debugger Commands865773 +Node: Readline Support870802 +Node: Limitations871694 +Node: Debugging Summary873808 +Node: Arbitrary Precision Arithmetic874976 +Node: Computer Arithmetic876392 +Ref: table-numeric-ranges879990 +Ref: Computer Arithmetic-Footnote-1880849 +Node: Math Definitions880906 +Ref: table-ieee-formats884194 +Ref: Math Definitions-Footnote-1884798 +Node: MPFR features884903 +Node: FP Math Caution886574 +Ref: FP Math Caution-Footnote-1887624 +Node: Inexactness of computations887993 +Node: Inexact representation888952 +Node: Comparing FP Values890309 +Node: Errors accumulate891391 +Node: Getting Accuracy892824 +Node: Try To Round895486 +Node: Setting precision896385 +Ref: table-predefined-precision-strings897069 +Node: Setting the rounding mode898858 +Ref: table-gawk-rounding-modes899222 +Ref: Setting the rounding mode-Footnote-1902677 +Node: Arbitrary Precision Integers902856 +Ref: Arbitrary Precision Integers-Footnote-1905842 +Node: POSIX Floating Point Problems905991 +Ref: POSIX Floating Point Problems-Footnote-1909864 +Node: Floating point summary909902 +Node: Dynamic Extensions912096 +Node: Extension Intro913648 +Node: Plugin License914914 +Node: Extension Mechanism Outline915711 +Ref: figure-load-extension916139 +Ref: figure-register-new-function917619 +Ref: figure-call-new-function918623 +Node: Extension API Description920609 +Node: Extension API Functions Introduction922059 +Node: General Data Types926883 +Ref: General Data Types-Footnote-1932622 +Node: Memory Allocation Functions932921 +Ref: Memory Allocation Functions-Footnote-1935760 +Node: Constructor Functions935856 +Node: Registration Functions937590 +Node: Extension Functions938275 +Node: Exit Callback Functions940572 +Node: Extension Version String941820 +Node: Input Parsers942485 +Node: Output Wrappers952364 +Node: Two-way processors956879 +Node: Printing Messages959083 +Ref: Printing Messages-Footnote-1960159 +Node: Updating `ERRNO'960311 +Node: Requesting Values961051 +Ref: table-value-types-returned961779 +Node: Accessing Parameters962736 +Node: Symbol Table Access963967 +Node: Symbol table by name964481 +Node: Symbol table by cookie966462 +Ref: Symbol table by cookie-Footnote-1970606 +Node: Cached values970669 +Ref: Cached values-Footnote-1974168 +Node: Array Manipulation974259 +Ref: Array Manipulation-Footnote-1975357 +Node: Array Data Types975394 +Ref: Array Data Types-Footnote-1978049 +Node: Array Functions978141 +Node: Flattening Arrays981995 +Node: Creating Arrays988887 +Node: Extension API Variables993658 +Node: Extension Versioning994294 +Node: Extension API Informational Variables996195 +Node: Extension API Boilerplate997260 +Node: Finding Extensions1001069 +Node: Extension Example1001629 +Node: Internal File Description1002401 +Node: Internal File Ops1006468 +Ref: Internal File Ops-Footnote-11018138 +Node: Using Internal File Ops1018278 +Ref: Using Internal File Ops-Footnote-11020661 +Node: Extension Samples1020934 +Node: Extension Sample File Functions1022460 +Node: Extension Sample Fnmatch1030098 +Node: Extension Sample Fork1031589 +Node: Extension Sample Inplace1032804 +Node: Extension Sample Ord1034479 +Node: Extension Sample Readdir1035315 +Ref: table-readdir-file-types1036191 +Node: Extension Sample Revout1037002 +Node: Extension Sample Rev2way1037592 +Node: Extension Sample Read write array1038332 +Node: Extension Sample Readfile1040272 +Node: Extension Sample Time1041367 +Node: Extension Sample API Tests1042716 +Node: gawkextlib1043207 +Node: Extension summary1045865 +Node: Extension Exercises1049554 +Node: Language History1050276 +Node: V7/SVR3.11051932 +Node: SVR41054113 +Node: POSIX1055558 +Node: BTL1056947 +Node: POSIX/GNU1057681 +Node: Feature History1063245 +Node: Common Extensions1076343 +Node: Ranges and Locales1077667 +Ref: Ranges and Locales-Footnote-11082285 +Ref: Ranges and Locales-Footnote-21082312 +Ref: Ranges and Locales-Footnote-31082546 +Node: Contributors1082767 +Node: History summary1088308 +Node: Installation1089678 +Node: Gawk Distribution1090624 +Node: Getting1091108 +Node: Extracting1091931 +Node: Distribution contents1093566 +Node: Unix Installation1099283 +Node: Quick Installation1099900 +Node: Additional Configuration Options1102324 +Node: Configuration Philosophy1104062 +Node: Non-Unix Installation1106431 +Node: PC Installation1106889 +Node: PC Binary Installation1108208 +Node: PC Compiling1110056 +Ref: PC Compiling-Footnote-11113077 +Node: PC Testing1113186 +Node: PC Using1114362 +Node: Cygwin1118477 +Node: MSYS1119300 +Node: VMS Installation1119800 +Node: VMS Compilation1120592 +Ref: VMS Compilation-Footnote-11121814 +Node: VMS Dynamic Extensions1121872 +Node: VMS Installation Details1123556 +Node: VMS Running1125808 +Node: VMS GNV1128644 +Node: VMS Old Gawk1129378 +Node: Bugs1129848 +Node: Other Versions1133731 +Node: Installation summary1140155 +Node: Notes1141211 +Node: Compatibility Mode1142076 +Node: Additions1142858 +Node: Accessing The Source1143783 +Node: Adding Code1145218 +Node: New Ports1151375 +Node: Derived Files1155857 +Ref: Derived Files-Footnote-11161332 +Ref: Derived Files-Footnote-21161366 +Ref: Derived Files-Footnote-31161962 +Node: Future Extensions1162076 +Node: Implementation Limitations1162682 +Node: Extension Design1163930 +Node: Old Extension Problems1165084 +Ref: Old Extension Problems-Footnote-11166601 +Node: Extension New Mechanism Goals1166658 +Ref: Extension New Mechanism Goals-Footnote-11170018 +Node: Extension Other Design Decisions1170207 +Node: Extension Future Growth1172315 +Node: Old Extension Mechanism1173151 +Node: Notes summary1174913 +Node: Basic Concepts1176099 +Node: Basic High Level1176780 +Ref: figure-general-flow1177052 +Ref: figure-process-flow1177651 +Ref: Basic High Level-Footnote-11180880 +Node: Basic Data Typing1181065 +Node: Glossary1184393 +Node: Copying1216322 +Node: GNU Free Documentation License1253878 +Node: Index1279014  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index f354318f..48583f4d 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -15494,15 +15494,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, }: +@inlineraw{docbook, }, @end ifdocbook +conceptually, if the element values are eight, @code{"foo"}, +@code{""}, and 30. @ifnotdocbook @float Figure,figure-array-elements @@ -15527,7 +15529,7 @@ as shown in @inlineraw{docbook, }: @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. @cindex arrays, indexing @@ -15539,19 +15541,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 - - + + Index @@ -15597,20 +15601,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 - - + + Index @@ -15662,19 +15668,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 - - + + Index @@ -15716,7 +15723,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 @@ -15741,7 +15748,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}] @@ -15751,8 +15758,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 @@ -15844,7 +15854,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 @@ -15938,7 +15948,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. @@ -16035,7 +16045,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 @@ -16092,21 +16102,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 @@ -16329,7 +16344,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 @@ -16589,7 +16604,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}: @@ -16601,7 +16616,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: @@ -16625,7 +16640,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 @@ -16636,7 +16652,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 @@ -16666,7 +16682,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 @@ -16766,9 +16782,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}. @@ -16777,7 +16793,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 @@ -17498,7 +17514,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 diff --git a/doc/gawktexi.in b/doc/gawktexi.in index a94d11b7..8fd84288 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -14776,15 +14776,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, }: +@inlineraw{docbook, }, @end ifdocbook +conceptually, if the element values are eight, @code{"foo"}, +@code{""}, and 30. @ifnotdocbook @float Figure,figure-array-elements @@ -14809,7 +14811,7 @@ as shown in @inlineraw{docbook, }: @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. @cindex arrays, indexing @@ -14821,19 +14823,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 - - + + Index @@ -14879,20 +14883,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 - - + + Index @@ -14944,19 +14950,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 - - + + Index @@ -14998,7 +15005,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 @@ -15023,7 +15030,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}] @@ -15033,8 +15040,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 @@ -15126,7 +15136,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 @@ -15220,7 +15230,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. @@ -15317,7 +15327,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 @@ -15374,21 +15384,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 @@ -15611,7 +15626,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 @@ -15871,7 +15886,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}: @@ -15883,7 +15898,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: @@ -15907,7 +15922,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 @@ -15918,7 +15934,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 @@ -15948,7 +15964,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 @@ -16048,9 +16064,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}. @@ -16059,7 +16075,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 @@ -16780,7 +16796,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 -- cgit v1.2.3 From 5153d0f04b7ad460b23ae5a011061f7b93a122ef Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 27 Jan 2015 20:57:58 +0200 Subject: O'Reilly edits and other fixes. --- awklib/eg/lib/bits2str.awk | 2 +- doc/ChangeLog | 1 + doc/gawk.info | 899 +++++++++++++++++++++++---------------------- doc/gawk.texi | 120 +++--- doc/gawktexi.in | 116 +++--- 5 files changed, 574 insertions(+), 564 deletions(-) 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/doc/ChangeLog b/doc/ChangeLog index 6efc88b3..ecf05dee 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2015-01-27 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. + And still more. Also, fix @code --> @command in a number of places. 2015-01-26 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index 80cca4be..6a107df5 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -11796,7 +11796,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: @@ -11808,7 +11810,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 @@ -11833,7 +11835,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 @@ -11870,9 +11872,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 @@ -11913,7 +11916,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) { @@ -12003,7 +12006,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()' @@ -12074,7 +12077,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: @@ -12162,7 +12165,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, @@ -12206,9 +12209,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 @@ -12216,7 +12219,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 @@ -12283,8 +12286,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 @@ -12317,12 +12320,12 @@ 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: @@ -12346,17 +12349,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 @@ -12457,7 +12461,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 @@ -12582,11 +12586,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 ------- --------- -------------- @@ -12601,10 +12605,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 @@ -12628,10 +12632,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. @@ -12661,7 +12665,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 @@ -12688,9 +12692,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 ---------- @@ -12717,10 +12721,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::). @@ -12738,7 +12742,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 @@ -12755,16 +12759,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'), @@ -12773,9 +12778,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 @@ -12804,7 +12809,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' @@ -12893,14 +12898,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 @@ -12923,9 +12928,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. @@ -13066,23 +13071,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 @@ -13099,8 +13104,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 @@ -13217,7 +13222,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 @@ -13273,7 +13278,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) { @@ -13331,9 +13336,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 @@ -31453,7 +31458,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) @@ -31512,7 +31517,7 @@ Index * --re-interval option: Options. (line 281) * --sandbox option: Options. (line 288) * --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) @@ -31814,7 +31819,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) @@ -32021,7 +32026,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) @@ -32047,8 +32052,8 @@ Index * 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) @@ -32074,7 +32079,7 @@ Index * 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 100) -* case sensitivity, converting case: String Functions. (line 522) +* 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) @@ -32203,9 +32208,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) @@ -32283,7 +32288,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) @@ -32819,7 +32824,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) @@ -33078,7 +33083,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) @@ -33181,7 +33186,7 @@ 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. @@ -33202,7 +33207,7 @@ Index * 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 461) * ISO 8859-1: Glossary. (line 197) @@ -33362,7 +33367,7 @@ 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) @@ -33453,7 +33458,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. @@ -33623,7 +33628,7 @@ Index * portability, operators: Increment Ops. (line 60) * portability, operators, not in POSIX awk: Precedence. (line 98) * portability, POSIXLY_CORRECT environment variable: Options. (line 361) -* 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. @@ -33872,7 +33877,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) * return debugger command: Debugger Execution Control. (line 54) * return statement, user-defined functions: Return Statement. (line 6) @@ -34029,14 +34034,14 @@ Index (line 14) * sidebar, Changing NR and FNR: Auto-set. (line 312) * sidebar, Controlling Output Buffering with system(): I/O Functions. - (line 138) + (line 139) * sidebar, Escape Sequences for Metacharacters: Escape Sequences. (line 134) * 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. @@ -34110,7 +34115,7 @@ Index * 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 114) * sprintf() function, print/printf statements and: Round Function. @@ -34156,7 +34161,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) @@ -34166,13 +34171,13 @@ 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 146) * subscripts in arrays, multidimensional: Multidimensional. (line 10) @@ -34186,15 +34191,15 @@ Index * 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 237) * switch statement: Switch Statement. (line 6) * SYMTAB array: Auto-set. (line 269) * 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) @@ -34244,8 +34249,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) @@ -34264,14 +34269,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) @@ -34281,8 +34286,8 @@ Index * troubleshooting, regexp constants vs. string constants: Computed Regexps. (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) @@ -34686,334 +34691,334 @@ Node: Multiscanning490548 Node: Arrays of Arrays492137 Node: Arrays Summary496891 Node: Functions498982 -Node: Built-in499881 -Node: Calling Built-in500959 -Node: Numeric Functions502950 -Ref: Numeric Functions-Footnote-1506967 -Ref: Numeric Functions-Footnote-2507324 -Ref: Numeric Functions-Footnote-3507372 -Node: String Functions507644 -Ref: String Functions-Footnote-1531121 -Ref: String Functions-Footnote-2531250 -Ref: String Functions-Footnote-3531498 -Node: Gory Details531585 -Ref: table-sub-escapes533366 -Ref: table-sub-proposed534886 -Ref: table-posix-sub536250 -Ref: table-gensub-escapes537786 -Ref: Gory Details-Footnote-1538618 -Node: I/O Functions538769 -Ref: I/O Functions-Footnote-1545987 -Node: Time Functions546134 -Ref: Time Functions-Footnote-1556622 -Ref: Time Functions-Footnote-2556690 -Ref: Time Functions-Footnote-3556848 -Ref: Time Functions-Footnote-4556959 -Ref: Time Functions-Footnote-5557071 -Ref: Time Functions-Footnote-6557298 -Node: Bitwise Functions557564 -Ref: table-bitwise-ops558126 -Ref: Bitwise Functions-Footnote-1562435 -Node: Type Functions562604 -Node: I18N Functions563755 -Node: User-defined565400 -Node: Definition Syntax566205 -Ref: Definition Syntax-Footnote-1571612 -Node: Function Example571683 -Ref: Function Example-Footnote-1574602 -Node: Function Caveats574624 -Node: Calling A Function575142 -Node: Variable Scope576100 -Node: Pass By Value/Reference579088 -Node: Return Statement582583 -Node: Dynamic Typing585564 -Node: Indirect Calls586493 -Ref: Indirect Calls-Footnote-1597795 -Node: Functions Summary597923 -Node: Library Functions600625 -Ref: Library Functions-Footnote-1604234 -Ref: Library Functions-Footnote-2604377 -Node: Library Names604548 -Ref: Library Names-Footnote-1608002 -Ref: Library Names-Footnote-2608225 -Node: General Functions608311 -Node: Strtonum Function609414 -Node: Assert Function612436 -Node: Round Function615760 -Node: Cliff Random Function617301 -Node: Ordinal Functions618317 -Ref: Ordinal Functions-Footnote-1621380 -Ref: Ordinal Functions-Footnote-2621632 -Node: Join Function621843 -Ref: Join Function-Footnote-1623612 -Node: Getlocaltime Function623812 -Node: Readfile Function627556 -Node: Shell Quoting629526 -Node: Data File Management630927 -Node: Filetrans Function631559 -Node: Rewind Function635615 -Node: File Checking637002 -Ref: File Checking-Footnote-1638334 -Node: Empty Files638535 -Node: Ignoring Assigns640514 -Node: Getopt Function642065 -Ref: Getopt Function-Footnote-1653527 -Node: Passwd Functions653727 -Ref: Passwd Functions-Footnote-1662564 -Node: Group Functions662652 -Ref: Group Functions-Footnote-1670546 -Node: Walking Arrays670759 -Node: Library Functions Summary672362 -Node: Library Exercises673763 -Node: Sample Programs675043 -Node: Running Examples675813 -Node: Clones676541 -Node: Cut Program677765 -Node: Egrep Program687484 -Ref: Egrep Program-Footnote-1694982 -Node: Id Program695092 -Node: Split Program698737 -Ref: Split Program-Footnote-1702185 -Node: Tee Program702313 -Node: Uniq Program705102 -Node: Wc Program712521 -Ref: Wc Program-Footnote-1716771 -Node: Miscellaneous Programs716865 -Node: Dupword Program718078 -Node: Alarm Program720109 -Node: Translate Program724913 -Ref: Translate Program-Footnote-1729478 -Node: Labels Program729748 -Ref: Labels Program-Footnote-1733099 -Node: Word Sorting733183 -Node: History Sorting737254 -Node: Extract Program739090 -Node: Simple Sed746615 -Node: Igawk Program749683 -Ref: Igawk Program-Footnote-1764007 -Ref: Igawk Program-Footnote-2764208 -Ref: Igawk Program-Footnote-3764330 -Node: Anagram Program764445 -Node: Signature Program767502 -Node: Programs Summary768749 -Node: Programs Exercises769942 -Ref: Programs Exercises-Footnote-1774073 -Node: Advanced Features774164 -Node: Nondecimal Data776112 -Node: Array Sorting777702 -Node: Controlling Array Traversal778399 -Ref: Controlling Array Traversal-Footnote-1786732 -Node: Array Sorting Functions786850 -Ref: Array Sorting Functions-Footnote-1790739 -Node: Two-way I/O790935 -Ref: Two-way I/O-Footnote-1795880 -Ref: Two-way I/O-Footnote-2796066 -Node: TCP/IP Networking796148 -Node: Profiling799021 -Node: Advanced Features Summary806568 -Node: Internationalization808501 -Node: I18N and L10N809981 -Node: Explaining gettext810667 -Ref: Explaining gettext-Footnote-1815692 -Ref: Explaining gettext-Footnote-2815876 -Node: Programmer i18n816041 -Ref: Programmer i18n-Footnote-1820907 -Node: Translator i18n820956 -Node: String Extraction821750 -Ref: String Extraction-Footnote-1822881 -Node: Printf Ordering822967 -Ref: Printf Ordering-Footnote-1825753 -Node: I18N Portability825817 -Ref: I18N Portability-Footnote-1828272 -Node: I18N Example828335 -Ref: I18N Example-Footnote-1831138 -Node: Gawk I18N831210 -Node: I18N Summary831848 -Node: Debugger833187 -Node: Debugging834209 -Node: Debugging Concepts834650 -Node: Debugging Terms836503 -Node: Awk Debugging839075 -Node: Sample Debugging Session839969 -Node: Debugger Invocation840489 -Node: Finding The Bug841873 -Node: List of Debugger Commands848348 -Node: Breakpoint Control849681 -Node: Debugger Execution Control853377 -Node: Viewing And Changing Data856741 -Node: Execution Stack860119 -Node: Debugger Info861756 -Node: Miscellaneous Debugger Commands865773 -Node: Readline Support870802 -Node: Limitations871694 -Node: Debugging Summary873808 -Node: Arbitrary Precision Arithmetic874976 -Node: Computer Arithmetic876392 -Ref: table-numeric-ranges879990 -Ref: Computer Arithmetic-Footnote-1880849 -Node: Math Definitions880906 -Ref: table-ieee-formats884194 -Ref: Math Definitions-Footnote-1884798 -Node: MPFR features884903 -Node: FP Math Caution886574 -Ref: FP Math Caution-Footnote-1887624 -Node: Inexactness of computations887993 -Node: Inexact representation888952 -Node: Comparing FP Values890309 -Node: Errors accumulate891391 -Node: Getting Accuracy892824 -Node: Try To Round895486 -Node: Setting precision896385 -Ref: table-predefined-precision-strings897069 -Node: Setting the rounding mode898858 -Ref: table-gawk-rounding-modes899222 -Ref: Setting the rounding mode-Footnote-1902677 -Node: Arbitrary Precision Integers902856 -Ref: Arbitrary Precision Integers-Footnote-1905842 -Node: POSIX Floating Point Problems905991 -Ref: POSIX Floating Point Problems-Footnote-1909864 -Node: Floating point summary909902 -Node: Dynamic Extensions912096 -Node: Extension Intro913648 -Node: Plugin License914914 -Node: Extension Mechanism Outline915711 -Ref: figure-load-extension916139 -Ref: figure-register-new-function917619 -Ref: figure-call-new-function918623 -Node: Extension API Description920609 -Node: Extension API Functions Introduction922059 -Node: General Data Types926883 -Ref: General Data Types-Footnote-1932622 -Node: Memory Allocation Functions932921 -Ref: Memory Allocation Functions-Footnote-1935760 -Node: Constructor Functions935856 -Node: Registration Functions937590 -Node: Extension Functions938275 -Node: Exit Callback Functions940572 -Node: Extension Version String941820 -Node: Input Parsers942485 -Node: Output Wrappers952364 -Node: Two-way processors956879 -Node: Printing Messages959083 -Ref: Printing Messages-Footnote-1960159 -Node: Updating `ERRNO'960311 -Node: Requesting Values961051 -Ref: table-value-types-returned961779 -Node: Accessing Parameters962736 -Node: Symbol Table Access963967 -Node: Symbol table by name964481 -Node: Symbol table by cookie966462 -Ref: Symbol table by cookie-Footnote-1970606 -Node: Cached values970669 -Ref: Cached values-Footnote-1974168 -Node: Array Manipulation974259 -Ref: Array Manipulation-Footnote-1975357 -Node: Array Data Types975394 -Ref: Array Data Types-Footnote-1978049 -Node: Array Functions978141 -Node: Flattening Arrays981995 -Node: Creating Arrays988887 -Node: Extension API Variables993658 -Node: Extension Versioning994294 -Node: Extension API Informational Variables996195 -Node: Extension API Boilerplate997260 -Node: Finding Extensions1001069 -Node: Extension Example1001629 -Node: Internal File Description1002401 -Node: Internal File Ops1006468 -Ref: Internal File Ops-Footnote-11018138 -Node: Using Internal File Ops1018278 -Ref: Using Internal File Ops-Footnote-11020661 -Node: Extension Samples1020934 -Node: Extension Sample File Functions1022460 -Node: Extension Sample Fnmatch1030098 -Node: Extension Sample Fork1031589 -Node: Extension Sample Inplace1032804 -Node: Extension Sample Ord1034479 -Node: Extension Sample Readdir1035315 -Ref: table-readdir-file-types1036191 -Node: Extension Sample Revout1037002 -Node: Extension Sample Rev2way1037592 -Node: Extension Sample Read write array1038332 -Node: Extension Sample Readfile1040272 -Node: Extension Sample Time1041367 -Node: Extension Sample API Tests1042716 -Node: gawkextlib1043207 -Node: Extension summary1045865 -Node: Extension Exercises1049554 -Node: Language History1050276 -Node: V7/SVR3.11051932 -Node: SVR41054113 -Node: POSIX1055558 -Node: BTL1056947 -Node: POSIX/GNU1057681 -Node: Feature History1063245 -Node: Common Extensions1076343 -Node: Ranges and Locales1077667 -Ref: Ranges and Locales-Footnote-11082285 -Ref: Ranges and Locales-Footnote-21082312 -Ref: Ranges and Locales-Footnote-31082546 -Node: Contributors1082767 -Node: History summary1088308 -Node: Installation1089678 -Node: Gawk Distribution1090624 -Node: Getting1091108 -Node: Extracting1091931 -Node: Distribution contents1093566 -Node: Unix Installation1099283 -Node: Quick Installation1099900 -Node: Additional Configuration Options1102324 -Node: Configuration Philosophy1104062 -Node: Non-Unix Installation1106431 -Node: PC Installation1106889 -Node: PC Binary Installation1108208 -Node: PC Compiling1110056 -Ref: PC Compiling-Footnote-11113077 -Node: PC Testing1113186 -Node: PC Using1114362 -Node: Cygwin1118477 -Node: MSYS1119300 -Node: VMS Installation1119800 -Node: VMS Compilation1120592 -Ref: VMS Compilation-Footnote-11121814 -Node: VMS Dynamic Extensions1121872 -Node: VMS Installation Details1123556 -Node: VMS Running1125808 -Node: VMS GNV1128644 -Node: VMS Old Gawk1129378 -Node: Bugs1129848 -Node: Other Versions1133731 -Node: Installation summary1140155 -Node: Notes1141211 -Node: Compatibility Mode1142076 -Node: Additions1142858 -Node: Accessing The Source1143783 -Node: Adding Code1145218 -Node: New Ports1151375 -Node: Derived Files1155857 -Ref: Derived Files-Footnote-11161332 -Ref: Derived Files-Footnote-21161366 -Ref: Derived Files-Footnote-31161962 -Node: Future Extensions1162076 -Node: Implementation Limitations1162682 -Node: Extension Design1163930 -Node: Old Extension Problems1165084 -Ref: Old Extension Problems-Footnote-11166601 -Node: Extension New Mechanism Goals1166658 -Ref: Extension New Mechanism Goals-Footnote-11170018 -Node: Extension Other Design Decisions1170207 -Node: Extension Future Growth1172315 -Node: Old Extension Mechanism1173151 -Node: Notes summary1174913 -Node: Basic Concepts1176099 -Node: Basic High Level1176780 -Ref: figure-general-flow1177052 -Ref: figure-process-flow1177651 -Ref: Basic High Level-Footnote-11180880 -Node: Basic Data Typing1181065 -Node: Glossary1184393 -Node: Copying1216322 -Node: GNU Free Documentation License1253878 -Node: Index1279014 +Node: Built-in500021 +Node: Calling Built-in501099 +Node: Numeric Functions503094 +Ref: Numeric Functions-Footnote-1507110 +Ref: Numeric Functions-Footnote-2507467 +Ref: Numeric Functions-Footnote-3507515 +Node: String Functions507787 +Ref: String Functions-Footnote-1531288 +Ref: String Functions-Footnote-2531417 +Ref: String Functions-Footnote-3531665 +Node: Gory Details531752 +Ref: table-sub-escapes533533 +Ref: table-sub-proposed535048 +Ref: table-posix-sub536410 +Ref: table-gensub-escapes537947 +Ref: Gory Details-Footnote-1538780 +Node: I/O Functions538931 +Ref: I/O Functions-Footnote-1546167 +Node: Time Functions546314 +Ref: Time Functions-Footnote-1556823 +Ref: Time Functions-Footnote-2556891 +Ref: Time Functions-Footnote-3557049 +Ref: Time Functions-Footnote-4557160 +Ref: Time Functions-Footnote-5557272 +Ref: Time Functions-Footnote-6557499 +Node: Bitwise Functions557765 +Ref: table-bitwise-ops558327 +Ref: Bitwise Functions-Footnote-1562639 +Node: Type Functions562811 +Node: I18N Functions563962 +Node: User-defined565607 +Node: Definition Syntax566412 +Ref: Definition Syntax-Footnote-1571819 +Node: Function Example571890 +Ref: Function Example-Footnote-1574809 +Node: Function Caveats574831 +Node: Calling A Function575349 +Node: Variable Scope576307 +Node: Pass By Value/Reference579295 +Node: Return Statement582790 +Node: Dynamic Typing585771 +Node: Indirect Calls586700 +Ref: Indirect Calls-Footnote-1598002 +Node: Functions Summary598130 +Node: Library Functions600832 +Ref: Library Functions-Footnote-1604441 +Ref: Library Functions-Footnote-2604584 +Node: Library Names604755 +Ref: Library Names-Footnote-1608209 +Ref: Library Names-Footnote-2608432 +Node: General Functions608518 +Node: Strtonum Function609621 +Node: Assert Function612643 +Node: Round Function615967 +Node: Cliff Random Function617508 +Node: Ordinal Functions618524 +Ref: Ordinal Functions-Footnote-1621587 +Ref: Ordinal Functions-Footnote-2621839 +Node: Join Function622050 +Ref: Join Function-Footnote-1623819 +Node: Getlocaltime Function624019 +Node: Readfile Function627763 +Node: Shell Quoting629733 +Node: Data File Management631134 +Node: Filetrans Function631766 +Node: Rewind Function635822 +Node: File Checking637209 +Ref: File Checking-Footnote-1638541 +Node: Empty Files638742 +Node: Ignoring Assigns640721 +Node: Getopt Function642272 +Ref: Getopt Function-Footnote-1653734 +Node: Passwd Functions653934 +Ref: Passwd Functions-Footnote-1662771 +Node: Group Functions662859 +Ref: Group Functions-Footnote-1670753 +Node: Walking Arrays670966 +Node: Library Functions Summary672569 +Node: Library Exercises673970 +Node: Sample Programs675250 +Node: Running Examples676020 +Node: Clones676748 +Node: Cut Program677972 +Node: Egrep Program687691 +Ref: Egrep Program-Footnote-1695189 +Node: Id Program695299 +Node: Split Program698944 +Ref: Split Program-Footnote-1702392 +Node: Tee Program702520 +Node: Uniq Program705309 +Node: Wc Program712728 +Ref: Wc Program-Footnote-1716978 +Node: Miscellaneous Programs717072 +Node: Dupword Program718285 +Node: Alarm Program720316 +Node: Translate Program725120 +Ref: Translate Program-Footnote-1729685 +Node: Labels Program729955 +Ref: Labels Program-Footnote-1733306 +Node: Word Sorting733390 +Node: History Sorting737461 +Node: Extract Program739297 +Node: Simple Sed746822 +Node: Igawk Program749890 +Ref: Igawk Program-Footnote-1764214 +Ref: Igawk Program-Footnote-2764415 +Ref: Igawk Program-Footnote-3764537 +Node: Anagram Program764652 +Node: Signature Program767709 +Node: Programs Summary768956 +Node: Programs Exercises770149 +Ref: Programs Exercises-Footnote-1774280 +Node: Advanced Features774371 +Node: Nondecimal Data776319 +Node: Array Sorting777909 +Node: Controlling Array Traversal778606 +Ref: Controlling Array Traversal-Footnote-1786939 +Node: Array Sorting Functions787057 +Ref: Array Sorting Functions-Footnote-1790946 +Node: Two-way I/O791142 +Ref: Two-way I/O-Footnote-1796087 +Ref: Two-way I/O-Footnote-2796273 +Node: TCP/IP Networking796355 +Node: Profiling799228 +Node: Advanced Features Summary806775 +Node: Internationalization808708 +Node: I18N and L10N810188 +Node: Explaining gettext810874 +Ref: Explaining gettext-Footnote-1815899 +Ref: Explaining gettext-Footnote-2816083 +Node: Programmer i18n816248 +Ref: Programmer i18n-Footnote-1821114 +Node: Translator i18n821163 +Node: String Extraction821957 +Ref: String Extraction-Footnote-1823088 +Node: Printf Ordering823174 +Ref: Printf Ordering-Footnote-1825960 +Node: I18N Portability826024 +Ref: I18N Portability-Footnote-1828479 +Node: I18N Example828542 +Ref: I18N Example-Footnote-1831345 +Node: Gawk I18N831417 +Node: I18N Summary832055 +Node: Debugger833394 +Node: Debugging834416 +Node: Debugging Concepts834857 +Node: Debugging Terms836710 +Node: Awk Debugging839282 +Node: Sample Debugging Session840176 +Node: Debugger Invocation840696 +Node: Finding The Bug842080 +Node: List of Debugger Commands848555 +Node: Breakpoint Control849888 +Node: Debugger Execution Control853584 +Node: Viewing And Changing Data856948 +Node: Execution Stack860326 +Node: Debugger Info861963 +Node: Miscellaneous Debugger Commands865980 +Node: Readline Support871009 +Node: Limitations871901 +Node: Debugging Summary874015 +Node: Arbitrary Precision Arithmetic875183 +Node: Computer Arithmetic876599 +Ref: table-numeric-ranges880197 +Ref: Computer Arithmetic-Footnote-1881056 +Node: Math Definitions881113 +Ref: table-ieee-formats884401 +Ref: Math Definitions-Footnote-1885005 +Node: MPFR features885110 +Node: FP Math Caution886781 +Ref: FP Math Caution-Footnote-1887831 +Node: Inexactness of computations888200 +Node: Inexact representation889159 +Node: Comparing FP Values890516 +Node: Errors accumulate891598 +Node: Getting Accuracy893031 +Node: Try To Round895693 +Node: Setting precision896592 +Ref: table-predefined-precision-strings897276 +Node: Setting the rounding mode899065 +Ref: table-gawk-rounding-modes899429 +Ref: Setting the rounding mode-Footnote-1902884 +Node: Arbitrary Precision Integers903063 +Ref: Arbitrary Precision Integers-Footnote-1906049 +Node: POSIX Floating Point Problems906198 +Ref: POSIX Floating Point Problems-Footnote-1910071 +Node: Floating point summary910109 +Node: Dynamic Extensions912303 +Node: Extension Intro913855 +Node: Plugin License915121 +Node: Extension Mechanism Outline915918 +Ref: figure-load-extension916346 +Ref: figure-register-new-function917826 +Ref: figure-call-new-function918830 +Node: Extension API Description920816 +Node: Extension API Functions Introduction922266 +Node: General Data Types927090 +Ref: General Data Types-Footnote-1932829 +Node: Memory Allocation Functions933128 +Ref: Memory Allocation Functions-Footnote-1935967 +Node: Constructor Functions936063 +Node: Registration Functions937797 +Node: Extension Functions938482 +Node: Exit Callback Functions940779 +Node: Extension Version String942027 +Node: Input Parsers942692 +Node: Output Wrappers952571 +Node: Two-way processors957086 +Node: Printing Messages959290 +Ref: Printing Messages-Footnote-1960366 +Node: Updating `ERRNO'960518 +Node: Requesting Values961258 +Ref: table-value-types-returned961986 +Node: Accessing Parameters962943 +Node: Symbol Table Access964174 +Node: Symbol table by name964688 +Node: Symbol table by cookie966669 +Ref: Symbol table by cookie-Footnote-1970813 +Node: Cached values970876 +Ref: Cached values-Footnote-1974375 +Node: Array Manipulation974466 +Ref: Array Manipulation-Footnote-1975564 +Node: Array Data Types975601 +Ref: Array Data Types-Footnote-1978256 +Node: Array Functions978348 +Node: Flattening Arrays982202 +Node: Creating Arrays989094 +Node: Extension API Variables993865 +Node: Extension Versioning994501 +Node: Extension API Informational Variables996402 +Node: Extension API Boilerplate997467 +Node: Finding Extensions1001276 +Node: Extension Example1001836 +Node: Internal File Description1002608 +Node: Internal File Ops1006675 +Ref: Internal File Ops-Footnote-11018345 +Node: Using Internal File Ops1018485 +Ref: Using Internal File Ops-Footnote-11020868 +Node: Extension Samples1021141 +Node: Extension Sample File Functions1022667 +Node: Extension Sample Fnmatch1030305 +Node: Extension Sample Fork1031796 +Node: Extension Sample Inplace1033011 +Node: Extension Sample Ord1034686 +Node: Extension Sample Readdir1035522 +Ref: table-readdir-file-types1036398 +Node: Extension Sample Revout1037209 +Node: Extension Sample Rev2way1037799 +Node: Extension Sample Read write array1038539 +Node: Extension Sample Readfile1040479 +Node: Extension Sample Time1041574 +Node: Extension Sample API Tests1042923 +Node: gawkextlib1043414 +Node: Extension summary1046072 +Node: Extension Exercises1049761 +Node: Language History1050483 +Node: V7/SVR3.11052139 +Node: SVR41054320 +Node: POSIX1055765 +Node: BTL1057154 +Node: POSIX/GNU1057888 +Node: Feature History1063452 +Node: Common Extensions1076550 +Node: Ranges and Locales1077874 +Ref: Ranges and Locales-Footnote-11082492 +Ref: Ranges and Locales-Footnote-21082519 +Ref: Ranges and Locales-Footnote-31082753 +Node: Contributors1082974 +Node: History summary1088515 +Node: Installation1089885 +Node: Gawk Distribution1090831 +Node: Getting1091315 +Node: Extracting1092138 +Node: Distribution contents1093773 +Node: Unix Installation1099490 +Node: Quick Installation1100107 +Node: Additional Configuration Options1102531 +Node: Configuration Philosophy1104269 +Node: Non-Unix Installation1106638 +Node: PC Installation1107096 +Node: PC Binary Installation1108415 +Node: PC Compiling1110263 +Ref: PC Compiling-Footnote-11113284 +Node: PC Testing1113393 +Node: PC Using1114569 +Node: Cygwin1118684 +Node: MSYS1119507 +Node: VMS Installation1120007 +Node: VMS Compilation1120799 +Ref: VMS Compilation-Footnote-11122021 +Node: VMS Dynamic Extensions1122079 +Node: VMS Installation Details1123763 +Node: VMS Running1126015 +Node: VMS GNV1128851 +Node: VMS Old Gawk1129585 +Node: Bugs1130055 +Node: Other Versions1133938 +Node: Installation summary1140362 +Node: Notes1141418 +Node: Compatibility Mode1142283 +Node: Additions1143065 +Node: Accessing The Source1143990 +Node: Adding Code1145425 +Node: New Ports1151582 +Node: Derived Files1156064 +Ref: Derived Files-Footnote-11161539 +Ref: Derived Files-Footnote-21161573 +Ref: Derived Files-Footnote-31162169 +Node: Future Extensions1162283 +Node: Implementation Limitations1162889 +Node: Extension Design1164137 +Node: Old Extension Problems1165291 +Ref: Old Extension Problems-Footnote-11166808 +Node: Extension New Mechanism Goals1166865 +Ref: Extension New Mechanism Goals-Footnote-11170225 +Node: Extension Other Design Decisions1170414 +Node: Extension Future Growth1172522 +Node: Old Extension Mechanism1173358 +Node: Notes summary1175120 +Node: Basic Concepts1176306 +Node: Basic High Level1176987 +Ref: figure-general-flow1177259 +Ref: figure-process-flow1177858 +Ref: Basic High Level-Footnote-11181087 +Node: Basic Data Typing1181272 +Node: Glossary1184600 +Node: Copying1216529 +Node: GNU Free Documentation License1254085 +Node: Index1279221  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 48583f4d..266b3898 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 @@ -955,7 +955,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 @@ -4680,7 +4680,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, @@ -4889,7 +4889,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 @@ -16818,6 +16818,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. @@ -16827,7 +16830,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 @@ -16850,7 +16853,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 @@ -16901,7 +16904,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. @@ -16965,7 +16968,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) @@ -17060,7 +17063,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 @@ -17149,7 +17152,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: @@ -17264,7 +17267,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} @@ -17347,7 +17350,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. @@ -17359,7 +17362,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: @@ -17448,7 +17451,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}). @@ -17495,13 +17498,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}). @@ -17539,19 +17542,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, @@ -17688,7 +17690,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 @@ -17880,8 +17882,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}. @@ -17939,7 +17941,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 @@ -17960,7 +17962,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 ... @@ -18005,7 +18007,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. @@ -18071,7 +18073,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. @@ -18139,7 +18141,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. @@ -18165,6 +18167,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. @@ -18191,7 +18194,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 @@ -18212,7 +18215,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 @@ -18223,7 +18226,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}. @@ -18241,8 +18244,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.} @@ -18292,8 +18295,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.} @@ -18337,7 +18340,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. @@ -18517,9 +18520,9 @@ you would see the latter (undesirable) output. @cindex files, log@comma{} timestamps in @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 @@ -18580,7 +18583,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 @@ -18740,12 +18743,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 @@ -18756,7 +18759,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 @@ -18776,8 +18779,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 @@ -18917,7 +18920,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 @@ -18975,7 +18978,7 @@ Operands | 0 | 1 | 0 | 1 | 0 | 1 -Bit Operator +Bit operator @@ -19039,10 +19042,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. @@ -19096,7 +19098,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) @{ @@ -20390,7 +20392,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 @@ -30917,7 +30919,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 @@ -31076,7 +31078,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. @@ -32040,7 +32042,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 @@ -32086,7 +32088,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 @@ -32869,7 +32871,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. @@ -37173,7 +37175,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. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 8fd84288..7fd947a5 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 @@ -950,7 +950,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 @@ -4591,7 +4591,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, @@ -4800,7 +4800,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 @@ -16100,6 +16100,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. @@ -16109,7 +16112,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 @@ -16132,7 +16135,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 @@ -16183,7 +16186,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. @@ -16247,7 +16250,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) @@ -16342,7 +16345,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 @@ -16431,7 +16434,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: @@ -16546,7 +16549,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} @@ -16629,7 +16632,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. @@ -16641,7 +16644,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: @@ -16730,7 +16733,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}). @@ -16777,13 +16780,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}). @@ -16821,19 +16824,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, @@ -16970,7 +16972,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 @@ -17129,8 +17131,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}. @@ -17188,7 +17190,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 @@ -17209,7 +17211,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 ... @@ -17254,7 +17256,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. @@ -17320,7 +17322,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. @@ -17388,7 +17390,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. @@ -17414,6 +17416,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. @@ -17440,7 +17443,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 @@ -17461,7 +17464,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 @@ -17472,7 +17475,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}. @@ -17485,8 +17488,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.} @@ -17529,7 +17532,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. @@ -17638,9 +17641,9 @@ you would see the latter (undesirable) output. @cindex files, log@comma{} timestamps in @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 @@ -17701,7 +17704,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 @@ -17861,12 +17864,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 @@ -17877,7 +17880,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 @@ -17897,8 +17900,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 @@ -18038,7 +18041,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 @@ -18096,7 +18099,7 @@ Operands | 0 | 1 | 0 | 1 | 0 | 1 -Bit Operator +Bit operator @@ -18160,10 +18163,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. @@ -18217,7 +18219,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) @{ @@ -19511,7 +19513,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 @@ -30009,7 +30011,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 @@ -30168,7 +30170,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. @@ -31132,7 +31134,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 @@ -31178,7 +31180,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 @@ -31961,7 +31963,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. @@ -36265,7 +36267,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. -- cgit v1.2.3 From 1bd1b885c7dd16b5e4ab78c040312f6f7d742784 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 30 Jan 2015 10:06:16 +0200 Subject: Disallow calling a function parameter. Check params are not function names. --- ChangeLog | 18 ++ NEWS | 13 +- awk.h | 1 + awkgram.c | 742 ++++++++++++++++++++++++++------------------------ awkgram.y | 24 +- doc/ChangeLog | 5 + doc/gawk.info | 632 +++++++++++++++++++++--------------------- doc/gawk.texi | 19 +- doc/gawktexi.in | 19 +- symbol.c | 55 ++++ test/ChangeLog | 8 + test/Makefile.am | 9 +- test/Makefile.in | 24 +- test/Maketests | 15 + test/callparam.awk | 6 + test/callparam.ok | 2 + test/exit.sh | 2 +- test/indirectcall.awk | 8 +- test/paramasfunc1.awk | 9 + test/paramasfunc1.ok | 3 + test/paramasfunc2.awk | 10 + test/paramasfunc2.ok | 3 + 22 files changed, 927 insertions(+), 700 deletions(-) create mode 100644 test/callparam.awk create mode 100644 test/callparam.ok create mode 100644 test/paramasfunc1.awk create mode 100644 test/paramasfunc1.ok create mode 100644 test/paramasfunc2.awk create mode 100644 test/paramasfunc2.ok diff --git a/ChangeLog b/ChangeLog index d192854f..e5c7c091 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2015-01-30 Arnold D. Robbins + + 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 Infrastructure updates. diff --git a/NEWS b/NEWS index f708cfd0..21568ea3 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,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. @@ -25,9 +26,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. @@ -44,6 +46,11 @@ Changes from 4.1.1 to 4.1.2 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. Changes from 4.1.0 to 4.1.1 diff --git a/awk.h b/awk.h index 92baa7a7..cdac139a 100644 --- a/awk.h +++ b/awk.h @@ -1607,6 +1607,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 53e35d2d..9a9ca13b 100644 --- a/awkgram.c +++ b/awkgram.c @@ -125,6 +125,7 @@ static void check_funcs(void); static ssize_t read_one_line(int fd, void *buffer, size_t count); static int one_line_close(int fd); +static bool at_seen = false; static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ static char *in_function; /* parsing kludge */ @@ -191,7 +192,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -#line 195 "awkgram.c" /* yacc.c:339 */ +#line 196 "awkgram.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -345,7 +346,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 349 "awkgram.c" /* yacc.c:358 */ +#line 350 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -647,25 +648,25 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 194, 194, 196, 201, 202, 206, 218, 222, 233, - 239, 244, 252, 260, 262, 267, 275, 277, 283, 284, - 286, 312, 323, 334, 340, 349, 359, 361, 363, 369, - 374, 375, 379, 398, 397, 431, 433, 438, 439, 452, - 457, 458, 462, 464, 466, 473, 563, 605, 647, 760, - 767, 774, 784, 793, 802, 811, 822, 838, 837, 861, - 873, 873, 971, 971, 1004, 1034, 1040, 1041, 1047, 1048, - 1055, 1060, 1072, 1086, 1088, 1096, 1101, 1103, 1111, 1113, - 1122, 1123, 1131, 1136, 1136, 1147, 1151, 1159, 1160, 1163, - 1165, 1170, 1171, 1180, 1181, 1186, 1191, 1197, 1199, 1201, - 1208, 1209, 1215, 1216, 1221, 1223, 1228, 1230, 1238, 1243, - 1252, 1259, 1261, 1263, 1279, 1289, 1296, 1298, 1303, 1305, - 1307, 1315, 1317, 1322, 1324, 1329, 1331, 1333, 1383, 1385, - 1387, 1389, 1391, 1393, 1395, 1397, 1411, 1416, 1421, 1446, - 1452, 1454, 1456, 1458, 1460, 1462, 1467, 1471, 1503, 1505, - 1511, 1517, 1530, 1531, 1532, 1537, 1542, 1546, 1550, 1565, - 1578, 1583, 1619, 1637, 1638, 1644, 1645, 1650, 1652, 1659, - 1676, 1693, 1695, 1702, 1707, 1715, 1725, 1737, 1746, 1750, - 1754, 1758, 1762, 1766, 1769, 1771, 1775, 1779, 1783 + 0, 195, 195, 197, 202, 203, 207, 219, 223, 234, + 240, 246, 255, 263, 265, 270, 278, 280, 286, 287, + 289, 315, 326, 337, 343, 352, 362, 364, 366, 372, + 380, 381, 385, 404, 403, 437, 439, 444, 445, 458, + 463, 464, 468, 470, 472, 479, 569, 611, 653, 766, + 773, 780, 790, 799, 808, 817, 828, 844, 843, 867, + 879, 879, 977, 977, 1010, 1040, 1046, 1047, 1053, 1054, + 1061, 1066, 1078, 1092, 1094, 1102, 1107, 1109, 1117, 1119, + 1128, 1129, 1137, 1142, 1142, 1153, 1157, 1165, 1166, 1169, + 1171, 1176, 1177, 1186, 1187, 1192, 1197, 1203, 1205, 1207, + 1214, 1215, 1221, 1222, 1227, 1229, 1234, 1236, 1244, 1249, + 1258, 1265, 1267, 1269, 1285, 1295, 1302, 1304, 1309, 1311, + 1313, 1321, 1323, 1328, 1330, 1335, 1337, 1339, 1389, 1391, + 1393, 1395, 1397, 1399, 1401, 1403, 1417, 1422, 1427, 1452, + 1458, 1460, 1462, 1464, 1466, 1468, 1473, 1477, 1509, 1511, + 1517, 1523, 1536, 1537, 1538, 1543, 1548, 1552, 1556, 1571, + 1584, 1589, 1626, 1655, 1656, 1662, 1663, 1668, 1670, 1677, + 1694, 1711, 1713, 1720, 1725, 1733, 1743, 1755, 1764, 1768, + 1772, 1776, 1780, 1784, 1787, 1789, 1793, 1797, 1801 }; #endif @@ -1838,24 +1839,24 @@ yyreduce: switch (yyn) { case 3: -#line 197 "awkgram.y" /* yacc.c:1646 */ +#line 198 "awkgram.y" /* yacc.c:1646 */ { rule = 0; yyerrok; } -#line 1847 "awkgram.c" /* yacc.c:1646 */ +#line 1848 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 203 "awkgram.y" /* yacc.c:1646 */ +#line 204 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); } -#line 1855 "awkgram.c" /* yacc.c:1646 */ +#line 1856 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 207 "awkgram.y" /* yacc.c:1646 */ +#line 208 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -1864,19 +1865,19 @@ yyreduce: */ /* yyerrok; */ } -#line 1868 "awkgram.c" /* yacc.c:1646 */ +#line 1869 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 219 "awkgram.y" /* yacc.c:1646 */ +#line 220 "awkgram.y" /* yacc.c:1646 */ { (void) append_rule((yyvsp[-1]), (yyvsp[0])); } -#line 1876 "awkgram.c" /* yacc.c:1646 */ +#line 1877 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 223 "awkgram.y" /* yacc.c:1646 */ +#line 224 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1887,39 +1888,41 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1891 "awkgram.c" /* yacc.c:1646 */ +#line 1892 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 234 "awkgram.y" /* yacc.c:1646 */ +#line 235 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1901 "awkgram.c" /* yacc.c:1646 */ +#line 1902 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 240 "awkgram.y" /* yacc.c:1646 */ +#line 241 "awkgram.y" /* yacc.c:1646 */ { want_source = false; + at_seen = false; yyerrok; } -#line 1910 "awkgram.c" /* yacc.c:1646 */ +#line 1912 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 245 "awkgram.y" /* yacc.c:1646 */ +#line 247 "awkgram.y" /* yacc.c:1646 */ { want_source = false; + at_seen = false; yyerrok; } -#line 1919 "awkgram.c" /* yacc.c:1646 */ +#line 1922 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 253 "awkgram.y" /* yacc.c:1646 */ +#line 256 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1927,23 +1930,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1931 "awkgram.c" /* yacc.c:1646 */ +#line 1934 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 261 "awkgram.y" /* yacc.c:1646 */ +#line 264 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1937 "awkgram.c" /* yacc.c:1646 */ +#line 1940 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 263 "awkgram.y" /* yacc.c:1646 */ +#line 266 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1943 "awkgram.c" /* yacc.c:1646 */ +#line 1946 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 268 "awkgram.y" /* yacc.c:1646 */ +#line 271 "awkgram.y" /* yacc.c:1646 */ { if (load_library((yyvsp[0])) < 0) YYABORT; @@ -1951,35 +1954,35 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1955 "awkgram.c" /* yacc.c:1646 */ +#line 1958 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 276 "awkgram.y" /* yacc.c:1646 */ +#line 279 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1961 "awkgram.c" /* yacc.c:1646 */ +#line 1964 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 278 "awkgram.y" /* yacc.c:1646 */ +#line 281 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1967 "awkgram.c" /* yacc.c:1646 */ +#line 1970 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 283 "awkgram.y" /* yacc.c:1646 */ +#line 286 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; rule = Rule; } -#line 1973 "awkgram.c" /* yacc.c:1646 */ +#line 1976 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 285 "awkgram.y" /* yacc.c:1646 */ +#line 288 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); rule = Rule; } -#line 1979 "awkgram.c" /* yacc.c:1646 */ +#line 1982 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 287 "awkgram.y" /* yacc.c:1646 */ +#line 290 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2005,11 +2008,11 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2009 "awkgram.c" /* yacc.c:1646 */ +#line 2012 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 313 "awkgram.y" /* yacc.c:1646 */ +#line 316 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; if (do_lint_old && ++begin_seen == 2) @@ -2020,11 +2023,11 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2024 "awkgram.c" /* yacc.c:1646 */ +#line 2027 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 324 "awkgram.y" /* yacc.c:1646 */ +#line 327 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; if (do_lint_old && ++end_seen == 2) @@ -2035,70 +2038,73 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2039 "awkgram.c" /* yacc.c:1646 */ +#line 2042 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 335 "awkgram.y" /* yacc.c:1646 */ +#line 338 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2049 "awkgram.c" /* yacc.c:1646 */ +#line 2052 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 341 "awkgram.y" /* yacc.c:1646 */ +#line 344 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2059 "awkgram.c" /* yacc.c:1646 */ +#line 2062 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 350 "awkgram.y" /* yacc.c:1646 */ +#line 353 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-3]) == NULL) (yyval) = list_create(instruction(Op_no_op)); else (yyval) = (yyvsp[-3]); } -#line 2070 "awkgram.c" /* yacc.c:1646 */ +#line 2073 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 360 "awkgram.y" /* yacc.c:1646 */ +#line 363 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2076 "awkgram.c" /* yacc.c:1646 */ +#line 2079 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 362 "awkgram.y" /* yacc.c:1646 */ +#line 365 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2082 "awkgram.c" /* yacc.c:1646 */ +#line 2085 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 364 "awkgram.y" /* yacc.c:1646 */ +#line 367 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2092 "awkgram.c" /* yacc.c:1646 */ +#line 2095 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 370 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2098 "awkgram.c" /* yacc.c:1646 */ +#line 373 "awkgram.y" /* yacc.c:1646 */ + { + (yyval) = (yyvsp[0]); + at_seen = false; + } +#line 2104 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 380 "awkgram.y" /* yacc.c:1646 */ +#line 386 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-5])->source_file = source; if (install_function((yyvsp[-4])->lextok, (yyvsp[-5]), (yyvsp[-2])) < 0) @@ -2109,17 +2115,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2113 "awkgram.c" /* yacc.c:1646 */ +#line 2119 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 398 "awkgram.y" /* yacc.c:1646 */ +#line 404 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2119 "awkgram.c" /* yacc.c:1646 */ +#line 2125 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 400 "awkgram.y" /* yacc.c:1646 */ +#line 406 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2148,23 +2154,23 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2152 "awkgram.c" /* yacc.c:1646 */ +#line 2158 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 432 "awkgram.y" /* yacc.c:1646 */ +#line 438 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2158 "awkgram.c" /* yacc.c:1646 */ +#line 2164 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 438 "awkgram.y" /* yacc.c:1646 */ +#line 444 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2164 "awkgram.c" /* yacc.c:1646 */ +#line 2170 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 440 "awkgram.y" /* yacc.c:1646 */ +#line 446 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) (yyval) = (yyvsp[-1]); @@ -2177,40 +2183,40 @@ yyreduce: } yyerrok; } -#line 2181 "awkgram.c" /* yacc.c:1646 */ +#line 2187 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 453 "awkgram.y" /* yacc.c:1646 */ +#line 459 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2187 "awkgram.c" /* yacc.c:1646 */ +#line 2193 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 463 "awkgram.y" /* yacc.c:1646 */ +#line 469 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2193 "awkgram.c" /* yacc.c:1646 */ +#line 2199 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 465 "awkgram.y" /* yacc.c:1646 */ +#line 471 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2199 "awkgram.c" /* yacc.c:1646 */ +#line 2205 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 467 "awkgram.y" /* yacc.c:1646 */ +#line 473 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2210 "awkgram.c" /* yacc.c:1646 */ +#line 2216 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 474 "awkgram.y" /* yacc.c:1646 */ +#line 480 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2300,11 +2306,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2304 "awkgram.c" /* yacc.c:1646 */ +#line 2310 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 564 "awkgram.y" /* yacc.c:1646 */ +#line 570 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2346,11 +2352,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2350 "awkgram.c" /* yacc.c:1646 */ +#line 2356 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 606 "awkgram.y" /* yacc.c:1646 */ +#line 612 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2392,11 +2398,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2396 "awkgram.c" /* yacc.c:1646 */ +#line 2402 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 648 "awkgram.y" /* yacc.c:1646 */ +#line 654 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2509,44 +2515,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2513 "awkgram.c" /* yacc.c:1646 */ +#line 2519 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 761 "awkgram.y" /* yacc.c:1646 */ +#line 767 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2524 "awkgram.c" /* yacc.c:1646 */ +#line 2530 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 768 "awkgram.y" /* yacc.c:1646 */ +#line 774 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2535 "awkgram.c" /* yacc.c:1646 */ +#line 2541 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 775 "awkgram.y" /* yacc.c:1646 */ +#line 781 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2546 "awkgram.c" /* yacc.c:1646 */ +#line 2552 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 785 "awkgram.y" /* yacc.c:1646 */ +#line 791 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2555,11 +2561,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2559 "awkgram.c" /* yacc.c:1646 */ +#line 2565 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 794 "awkgram.y" /* yacc.c:1646 */ +#line 800 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2568,11 +2574,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2572 "awkgram.c" /* yacc.c:1646 */ +#line 2578 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 803 "awkgram.y" /* yacc.c:1646 */ +#line 809 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2581,11 +2587,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2585 "awkgram.c" /* yacc.c:1646 */ +#line 2591 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 812 "awkgram.y" /* yacc.c:1646 */ +#line 818 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2596,11 +2602,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2600 "awkgram.c" /* yacc.c:1646 */ +#line 2606 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 823 "awkgram.y" /* yacc.c:1646 */ +#line 829 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2615,20 +2621,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2619 "awkgram.c" /* yacc.c:1646 */ +#line 2625 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 838 "awkgram.y" /* yacc.c:1646 */ +#line 844 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2628 "awkgram.c" /* yacc.c:1646 */ +#line 2634 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 841 "awkgram.y" /* yacc.c:1646 */ +#line 847 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2649,17 +2655,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2653 "awkgram.c" /* yacc.c:1646 */ +#line 2659 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 873 "awkgram.y" /* yacc.c:1646 */ +#line 879 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2659 "awkgram.c" /* yacc.c:1646 */ +#line 2665 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 874 "awkgram.y" /* yacc.c:1646 */ +#line 880 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2756,17 +2762,17 @@ regular_print: } } } -#line 2760 "awkgram.c" /* yacc.c:1646 */ +#line 2766 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 971 "awkgram.y" /* yacc.c:1646 */ +#line 977 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2766 "awkgram.c" /* yacc.c:1646 */ +#line 2772 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 972 "awkgram.y" /* yacc.c:1646 */ +#line 978 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2799,11 +2805,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2803 "awkgram.c" /* yacc.c:1646 */ +#line 2809 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1009 "awkgram.y" /* yacc.c:1646 */ +#line 1015 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2829,52 +2835,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2833 "awkgram.c" /* yacc.c:1646 */ +#line 2839 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1035 "awkgram.y" /* yacc.c:1646 */ +#line 1041 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2839 "awkgram.c" /* yacc.c:1646 */ +#line 2845 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1040 "awkgram.y" /* yacc.c:1646 */ +#line 1046 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2845 "awkgram.c" /* yacc.c:1646 */ +#line 2851 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1042 "awkgram.y" /* yacc.c:1646 */ +#line 1048 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2851 "awkgram.c" /* yacc.c:1646 */ +#line 2857 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1047 "awkgram.y" /* yacc.c:1646 */ +#line 1053 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2857 "awkgram.c" /* yacc.c:1646 */ +#line 2863 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1049 "awkgram.y" /* yacc.c:1646 */ +#line 1055 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2868 "awkgram.c" /* yacc.c:1646 */ +#line 2874 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1056 "awkgram.y" /* yacc.c:1646 */ +#line 1062 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2874 "awkgram.c" /* yacc.c:1646 */ +#line 2880 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1061 "awkgram.y" /* yacc.c:1646 */ +#line 1067 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2886,11 +2892,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2890 "awkgram.c" /* yacc.c:1646 */ +#line 2896 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1073 "awkgram.y" /* yacc.c:1646 */ +#line 1079 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2901,17 +2907,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2905 "awkgram.c" /* yacc.c:1646 */ +#line 2911 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1087 "awkgram.y" /* yacc.c:1646 */ +#line 1093 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2911 "awkgram.c" /* yacc.c:1646 */ +#line 2917 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1089 "awkgram.y" /* yacc.c:1646 */ +#line 1095 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2919,71 +2925,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2923 "awkgram.c" /* yacc.c:1646 */ +#line 2929 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1097 "awkgram.y" /* yacc.c:1646 */ +#line 1103 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2932 "awkgram.c" /* yacc.c:1646 */ +#line 2938 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1102 "awkgram.y" /* yacc.c:1646 */ +#line 1108 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2938 "awkgram.c" /* yacc.c:1646 */ +#line 2944 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1104 "awkgram.y" /* yacc.c:1646 */ +#line 1110 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 2947 "awkgram.c" /* yacc.c:1646 */ +#line 2953 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1112 "awkgram.y" /* yacc.c:1646 */ +#line 1118 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2953 "awkgram.c" /* yacc.c:1646 */ +#line 2959 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1114 "awkgram.y" /* yacc.c:1646 */ +#line 1120 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2959 "awkgram.c" /* yacc.c:1646 */ +#line 2965 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1124 "awkgram.y" /* yacc.c:1646 */ +#line 1130 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2967 "awkgram.c" /* yacc.c:1646 */ +#line 2973 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1131 "awkgram.y" /* yacc.c:1646 */ +#line 1137 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 2977 "awkgram.c" /* yacc.c:1646 */ +#line 2983 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1136 "awkgram.y" /* yacc.c:1646 */ +#line 1142 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 2983 "awkgram.c" /* yacc.c:1646 */ +#line 2989 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1137 "awkgram.y" /* yacc.c:1646 */ +#line 1143 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -2991,136 +2997,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 2995 "awkgram.c" /* yacc.c:1646 */ +#line 3001 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1148 "awkgram.y" /* yacc.c:1646 */ +#line 1154 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3003 "awkgram.c" /* yacc.c:1646 */ +#line 3009 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1153 "awkgram.y" /* yacc.c:1646 */ +#line 1159 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3011 "awkgram.c" /* yacc.c:1646 */ +#line 3017 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1170 "awkgram.y" /* yacc.c:1646 */ +#line 1176 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3017 "awkgram.c" /* yacc.c:1646 */ +#line 3023 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1172 "awkgram.y" /* yacc.c:1646 */ +#line 1178 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3026 "awkgram.c" /* yacc.c:1646 */ +#line 3032 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1180 "awkgram.y" /* yacc.c:1646 */ +#line 1186 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3032 "awkgram.c" /* yacc.c:1646 */ +#line 3038 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1182 "awkgram.y" /* yacc.c:1646 */ +#line 1188 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]) ; } -#line 3038 "awkgram.c" /* yacc.c:1646 */ +#line 3044 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1187 "awkgram.y" /* yacc.c:1646 */ +#line 1193 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3047 "awkgram.c" /* yacc.c:1646 */ +#line 3053 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1192 "awkgram.y" /* yacc.c:1646 */ +#line 1198 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3057 "awkgram.c" /* yacc.c:1646 */ +#line 3063 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1198 "awkgram.y" /* yacc.c:1646 */ +#line 1204 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3063 "awkgram.c" /* yacc.c:1646 */ +#line 3069 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1200 "awkgram.y" /* yacc.c:1646 */ +#line 1206 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3069 "awkgram.c" /* yacc.c:1646 */ +#line 3075 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1202 "awkgram.y" /* yacc.c:1646 */ +#line 1208 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3075 "awkgram.c" /* yacc.c:1646 */ +#line 3081 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1208 "awkgram.y" /* yacc.c:1646 */ +#line 1214 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3081 "awkgram.c" /* yacc.c:1646 */ +#line 3087 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1210 "awkgram.y" /* yacc.c:1646 */ +#line 1216 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3087 "awkgram.c" /* yacc.c:1646 */ +#line 3093 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1215 "awkgram.y" /* yacc.c:1646 */ +#line 1221 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3093 "awkgram.c" /* yacc.c:1646 */ +#line 3099 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1217 "awkgram.y" /* yacc.c:1646 */ +#line 1223 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3099 "awkgram.c" /* yacc.c:1646 */ +#line 3105 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1222 "awkgram.y" /* yacc.c:1646 */ +#line 1228 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3105 "awkgram.c" /* yacc.c:1646 */ +#line 3111 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1224 "awkgram.y" /* yacc.c:1646 */ +#line 1230 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3114 "awkgram.c" /* yacc.c:1646 */ +#line 3120 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1229 "awkgram.y" /* yacc.c:1646 */ +#line 1235 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3120 "awkgram.c" /* yacc.c:1646 */ +#line 3126 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1231 "awkgram.y" /* yacc.c:1646 */ +#line 1237 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3128,52 +3134,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3132 "awkgram.c" /* yacc.c:1646 */ +#line 3138 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1239 "awkgram.y" /* yacc.c:1646 */ +#line 1245 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3141 "awkgram.c" /* yacc.c:1646 */ +#line 3147 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1244 "awkgram.y" /* yacc.c:1646 */ +#line 1250 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3150 "awkgram.c" /* yacc.c:1646 */ +#line 3156 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1253 "awkgram.y" /* yacc.c:1646 */ +#line 1259 "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 3161 "awkgram.c" /* yacc.c:1646 */ +#line 3167 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1260 "awkgram.y" /* yacc.c:1646 */ +#line 1266 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3167 "awkgram.c" /* yacc.c:1646 */ +#line 3173 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1262 "awkgram.y" /* yacc.c:1646 */ +#line 1268 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3173 "awkgram.c" /* yacc.c:1646 */ +#line 3179 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1264 "awkgram.y" /* yacc.c:1646 */ +#line 1270 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3189,11 +3195,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3193 "awkgram.c" /* yacc.c:1646 */ +#line 3199 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1280 "awkgram.y" /* yacc.c:1646 */ +#line 1286 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3203,91 +3209,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3207 "awkgram.c" /* yacc.c:1646 */ +#line 3213 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1290 "awkgram.y" /* yacc.c:1646 */ +#line 1296 "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 3218 "awkgram.c" /* yacc.c:1646 */ +#line 3224 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1297 "awkgram.y" /* yacc.c:1646 */ +#line 1303 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3224 "awkgram.c" /* yacc.c:1646 */ +#line 3230 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1299 "awkgram.y" /* yacc.c:1646 */ +#line 1305 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3230 "awkgram.c" /* yacc.c:1646 */ +#line 3236 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1304 "awkgram.y" /* yacc.c:1646 */ +#line 1310 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3236 "awkgram.c" /* yacc.c:1646 */ +#line 3242 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1306 "awkgram.y" /* yacc.c:1646 */ +#line 1312 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3242 "awkgram.c" /* yacc.c:1646 */ +#line 3248 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1308 "awkgram.y" /* yacc.c:1646 */ +#line 1314 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3251 "awkgram.c" /* yacc.c:1646 */ +#line 3257 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1316 "awkgram.y" /* yacc.c:1646 */ +#line 1322 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3257 "awkgram.c" /* yacc.c:1646 */ +#line 3263 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1318 "awkgram.y" /* yacc.c:1646 */ +#line 1324 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3263 "awkgram.c" /* yacc.c:1646 */ +#line 3269 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1323 "awkgram.y" /* yacc.c:1646 */ +#line 1329 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3269 "awkgram.c" /* yacc.c:1646 */ +#line 3275 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1325 "awkgram.y" /* yacc.c:1646 */ +#line 1331 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3275 "awkgram.c" /* yacc.c:1646 */ +#line 3281 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1330 "awkgram.y" /* yacc.c:1646 */ +#line 1336 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3281 "awkgram.c" /* yacc.c:1646 */ +#line 3287 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1332 "awkgram.y" /* yacc.c:1646 */ +#line 1338 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3287 "awkgram.c" /* yacc.c:1646 */ +#line 3293 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1334 "awkgram.y" /* yacc.c:1646 */ +#line 1340 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3334,47 +3340,47 @@ regular_print: max_args = count; } } -#line 3338 "awkgram.c" /* yacc.c:1646 */ +#line 3344 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1386 "awkgram.y" /* yacc.c:1646 */ +#line 1392 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3344 "awkgram.c" /* yacc.c:1646 */ +#line 3350 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1388 "awkgram.y" /* yacc.c:1646 */ +#line 1394 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3350 "awkgram.c" /* yacc.c:1646 */ +#line 3356 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1390 "awkgram.y" /* yacc.c:1646 */ +#line 1396 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3356 "awkgram.c" /* yacc.c:1646 */ +#line 3362 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1392 "awkgram.y" /* yacc.c:1646 */ +#line 1398 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3362 "awkgram.c" /* yacc.c:1646 */ +#line 3368 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1394 "awkgram.y" /* yacc.c:1646 */ +#line 1400 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3368 "awkgram.c" /* yacc.c:1646 */ +#line 3374 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1396 "awkgram.y" /* yacc.c:1646 */ +#line 1402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3374 "awkgram.c" /* yacc.c:1646 */ +#line 3380 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1398 "awkgram.y" /* yacc.c:1646 */ +#line 1404 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3388,29 +3394,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3392 "awkgram.c" /* yacc.c:1646 */ +#line 3398 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1412 "awkgram.y" /* yacc.c:1646 */ +#line 1418 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3401 "awkgram.c" /* yacc.c:1646 */ +#line 3407 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1417 "awkgram.y" /* yacc.c:1646 */ +#line 1423 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3410 "awkgram.c" /* yacc.c:1646 */ +#line 3416 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1422 "awkgram.y" /* yacc.c:1646 */ +#line 1428 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3430,64 +3436,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3434 "awkgram.c" /* yacc.c:1646 */ +#line 3440 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1447 "awkgram.y" /* yacc.c:1646 */ +#line 1453 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3443 "awkgram.c" /* yacc.c:1646 */ +#line 3449 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1453 "awkgram.y" /* yacc.c:1646 */ +#line 1459 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3449 "awkgram.c" /* yacc.c:1646 */ +#line 3455 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1455 "awkgram.y" /* yacc.c:1646 */ +#line 1461 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3455 "awkgram.c" /* yacc.c:1646 */ +#line 3461 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1457 "awkgram.y" /* yacc.c:1646 */ +#line 1463 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3461 "awkgram.c" /* yacc.c:1646 */ +#line 3467 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1459 "awkgram.y" /* yacc.c:1646 */ +#line 1465 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3467 "awkgram.c" /* yacc.c:1646 */ +#line 3473 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1461 "awkgram.y" /* yacc.c:1646 */ +#line 1467 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3473 "awkgram.c" /* yacc.c:1646 */ +#line 3479 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1463 "awkgram.y" /* yacc.c:1646 */ +#line 1469 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3479 "awkgram.c" /* yacc.c:1646 */ +#line 3485 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1468 "awkgram.y" /* yacc.c:1646 */ +#line 1474 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3487 "awkgram.c" /* yacc.c:1646 */ +#line 3493 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1472 "awkgram.y" /* yacc.c:1646 */ +#line 1478 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3519,37 +3525,37 @@ regular_print: } } } -#line 3523 "awkgram.c" /* yacc.c:1646 */ +#line 3529 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1504 "awkgram.y" /* yacc.c:1646 */ +#line 1510 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3529 "awkgram.c" /* yacc.c:1646 */ +#line 3535 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1506 "awkgram.y" /* yacc.c:1646 */ +#line 1512 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3539 "awkgram.c" /* yacc.c:1646 */ +#line 3545 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1512 "awkgram.y" /* yacc.c:1646 */ +#line 1518 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3549 "awkgram.c" /* yacc.c:1646 */ +#line 3555 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1518 "awkgram.y" /* yacc.c:1646 */ +#line 1524 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3562,45 +3568,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3566 "awkgram.c" /* yacc.c:1646 */ +#line 3572 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1533 "awkgram.y" /* yacc.c:1646 */ +#line 1539 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3575 "awkgram.c" /* yacc.c:1646 */ +#line 3581 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1538 "awkgram.y" /* yacc.c:1646 */ +#line 1544 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3584 "awkgram.c" /* yacc.c:1646 */ +#line 3590 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1543 "awkgram.y" /* yacc.c:1646 */ +#line 1549 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3592 "awkgram.c" /* yacc.c:1646 */ +#line 3598 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1547 "awkgram.y" /* yacc.c:1646 */ +#line 1553 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3600 "awkgram.c" /* yacc.c:1646 */ +#line 3606 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1551 "awkgram.y" /* yacc.c:1646 */ +#line 1557 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3615,11 +3621,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3619 "awkgram.c" /* yacc.c:1646 */ +#line 3625 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1566 "awkgram.y" /* yacc.c:1646 */ +#line 1572 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3629,20 +3635,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3633 "awkgram.c" /* yacc.c:1646 */ +#line 3639 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1579 "awkgram.y" /* yacc.c:1646 */ +#line 1585 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3642 "awkgram.c" /* yacc.c:1646 */ +#line 3648 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1584 "awkgram.y" /* yacc.c:1646 */ +#line 1590 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3674,13 +3680,25 @@ regular_print: */ (yyval) = list_prepend((yyvsp[0]), t); + at_seen = false; } -#line 3679 "awkgram.c" /* yacc.c:1646 */ +#line 3686 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1620 "awkgram.y" /* yacc.c:1646 */ +#line 1627 "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; @@ -3693,49 +3711,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3697 "awkgram.c" /* yacc.c:1646 */ +#line 3715 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1637 "awkgram.y" /* yacc.c:1646 */ +#line 1655 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3703 "awkgram.c" /* yacc.c:1646 */ +#line 3721 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1639 "awkgram.y" /* yacc.c:1646 */ +#line 1657 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3709 "awkgram.c" /* yacc.c:1646 */ +#line 3727 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1644 "awkgram.y" /* yacc.c:1646 */ +#line 1662 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3715 "awkgram.c" /* yacc.c:1646 */ +#line 3733 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1646 "awkgram.y" /* yacc.c:1646 */ +#line 1664 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3721 "awkgram.c" /* yacc.c:1646 */ +#line 3739 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1651 "awkgram.y" /* yacc.c:1646 */ +#line 1669 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3727 "awkgram.c" /* yacc.c:1646 */ +#line 3745 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1653 "awkgram.y" /* yacc.c:1646 */ +#line 1671 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3735 "awkgram.c" /* yacc.c:1646 */ +#line 3753 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1660 "awkgram.y" /* yacc.c:1646 */ +#line 1678 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3749,11 +3767,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3753 "awkgram.c" /* yacc.c:1646 */ +#line 3771 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1677 "awkgram.y" /* yacc.c:1646 */ +#line 1695 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3767,31 +3785,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3771 "awkgram.c" /* yacc.c:1646 */ +#line 3789 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1694 "awkgram.y" /* yacc.c:1646 */ +#line 1712 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3777 "awkgram.c" /* yacc.c:1646 */ +#line 3795 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1696 "awkgram.y" /* yacc.c:1646 */ +#line 1714 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3785 "awkgram.c" /* yacc.c:1646 */ +#line 3803 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1703 "awkgram.y" /* yacc.c:1646 */ +#line 1721 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3791 "awkgram.c" /* yacc.c:1646 */ +#line 3809 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1708 "awkgram.y" /* yacc.c:1646 */ +#line 1726 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3799,22 +3817,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3803 "awkgram.c" /* yacc.c:1646 */ +#line 3821 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1716 "awkgram.y" /* yacc.c:1646 */ +#line 1734 "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 3814 "awkgram.c" /* yacc.c:1646 */ +#line 3832 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1726 "awkgram.y" /* yacc.c:1646 */ +#line 1744 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3826,73 +3844,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3830 "awkgram.c" /* yacc.c:1646 */ +#line 3848 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1738 "awkgram.y" /* yacc.c:1646 */ +#line 1756 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3840 "awkgram.c" /* yacc.c:1646 */ +#line 3858 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1747 "awkgram.y" /* yacc.c:1646 */ +#line 1765 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3848 "awkgram.c" /* yacc.c:1646 */ +#line 3866 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1751 "awkgram.y" /* yacc.c:1646 */ +#line 1769 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3856 "awkgram.c" /* yacc.c:1646 */ +#line 3874 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1754 "awkgram.y" /* yacc.c:1646 */ +#line 1772 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3862 "awkgram.c" /* yacc.c:1646 */ +#line 3880 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1762 "awkgram.y" /* yacc.c:1646 */ +#line 1780 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3868 "awkgram.c" /* yacc.c:1646 */ +#line 3886 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1766 "awkgram.y" /* yacc.c:1646 */ +#line 1784 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3874 "awkgram.c" /* yacc.c:1646 */ +#line 3892 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1775 "awkgram.y" /* yacc.c:1646 */ +#line 1793 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3880 "awkgram.c" /* yacc.c:1646 */ +#line 3898 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1779 "awkgram.y" /* yacc.c:1646 */ +#line 1797 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3886 "awkgram.c" /* yacc.c:1646 */ +#line 3904 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1783 "awkgram.y" /* yacc.c:1646 */ +#line 1801 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3892 "awkgram.c" /* yacc.c:1646 */ +#line 3910 "awkgram.c" /* yacc.c:1646 */ break; -#line 3896 "awkgram.c" /* yacc.c:1646 */ +#line 3914 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4120,7 +4138,7 @@ yyreturn: #endif return yyresult; } -#line 1785 "awkgram.y" /* yacc.c:1906 */ +#line 1803 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -4643,6 +4661,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 @@ -5453,6 +5474,7 @@ retry: return lasttok = NEWLINE; case '@': + at_seen = true; return lasttok = '@'; case '\\': diff --git a/awkgram.y b/awkgram.y index 7b2e2a60..55615c13 100644 --- a/awkgram.y +++ b/awkgram.y @@ -85,6 +85,7 @@ static void check_funcs(void); static ssize_t read_one_line(int fd, void *buffer, size_t count); static int one_line_close(int fd); +static bool at_seen = false; static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ static char *in_function; /* parsing kludge */ @@ -239,11 +240,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; } ; @@ -367,7 +370,10 @@ func_name YYABORT; } | '@' LEX_EVAL - { $$ = $2; } + { + $$ = $2; + at_seen = false; + } ; lex_builtin @@ -1612,12 +1618,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; @@ -2304,6 +2322,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 @@ -3114,6 +3135,7 @@ retry: return lasttok = NEWLINE; case '@': + at_seen = true; return lasttok = '@'; case '\\': diff --git a/doc/ChangeLog b/doc/ChangeLog index ecf05dee..61caac69 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-30 Arnold D. Robbins + + * 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 * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index 6a107df5..4e975b14 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -13459,11 +13459,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 @@ -14065,13 +14067,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 @@ -32157,7 +32159,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) @@ -32678,7 +32680,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) @@ -32895,7 +32897,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) @@ -33616,7 +33618,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) @@ -33661,7 +33663,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) @@ -33754,7 +33756,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. @@ -33823,7 +33825,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) @@ -33992,7 +33994,7 @@ Index * 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. @@ -34366,7 +34368,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) @@ -34723,302 +34725,302 @@ Node: Type Functions562811 Node: I18N Functions563962 Node: User-defined565607 Node: Definition Syntax566412 -Ref: Definition Syntax-Footnote-1571819 -Node: Function Example571890 -Ref: Function Example-Footnote-1574809 -Node: Function Caveats574831 -Node: Calling A Function575349 -Node: Variable Scope576307 -Node: Pass By Value/Reference579295 -Node: Return Statement582790 -Node: Dynamic Typing585771 -Node: Indirect Calls586700 -Ref: Indirect Calls-Footnote-1598002 -Node: Functions Summary598130 -Node: Library Functions600832 -Ref: Library Functions-Footnote-1604441 -Ref: Library Functions-Footnote-2604584 -Node: Library Names604755 -Ref: Library Names-Footnote-1608209 -Ref: Library Names-Footnote-2608432 -Node: General Functions608518 -Node: Strtonum Function609621 -Node: Assert Function612643 -Node: Round Function615967 -Node: Cliff Random Function617508 -Node: Ordinal Functions618524 -Ref: Ordinal Functions-Footnote-1621587 -Ref: Ordinal Functions-Footnote-2621839 -Node: Join Function622050 -Ref: Join Function-Footnote-1623819 -Node: Getlocaltime Function624019 -Node: Readfile Function627763 -Node: Shell Quoting629733 -Node: Data File Management631134 -Node: Filetrans Function631766 -Node: Rewind Function635822 -Node: File Checking637209 -Ref: File Checking-Footnote-1638541 -Node: Empty Files638742 -Node: Ignoring Assigns640721 -Node: Getopt Function642272 -Ref: Getopt Function-Footnote-1653734 -Node: Passwd Functions653934 -Ref: Passwd Functions-Footnote-1662771 -Node: Group Functions662859 -Ref: Group Functions-Footnote-1670753 -Node: Walking Arrays670966 -Node: Library Functions Summary672569 -Node: Library Exercises673970 -Node: Sample Programs675250 -Node: Running Examples676020 -Node: Clones676748 -Node: Cut Program677972 -Node: Egrep Program687691 -Ref: Egrep Program-Footnote-1695189 -Node: Id Program695299 -Node: Split Program698944 -Ref: Split Program-Footnote-1702392 -Node: Tee Program702520 -Node: Uniq Program705309 -Node: Wc Program712728 -Ref: Wc Program-Footnote-1716978 -Node: Miscellaneous Programs717072 -Node: Dupword Program718285 -Node: Alarm Program720316 -Node: Translate Program725120 -Ref: Translate Program-Footnote-1729685 -Node: Labels Program729955 -Ref: Labels Program-Footnote-1733306 -Node: Word Sorting733390 -Node: History Sorting737461 -Node: Extract Program739297 -Node: Simple Sed746822 -Node: Igawk Program749890 -Ref: Igawk Program-Footnote-1764214 -Ref: Igawk Program-Footnote-2764415 -Ref: Igawk Program-Footnote-3764537 -Node: Anagram Program764652 -Node: Signature Program767709 -Node: Programs Summary768956 -Node: Programs Exercises770149 -Ref: Programs Exercises-Footnote-1774280 -Node: Advanced Features774371 -Node: Nondecimal Data776319 -Node: Array Sorting777909 -Node: Controlling Array Traversal778606 -Ref: Controlling Array Traversal-Footnote-1786939 -Node: Array Sorting Functions787057 -Ref: Array Sorting Functions-Footnote-1790946 -Node: Two-way I/O791142 -Ref: Two-way I/O-Footnote-1796087 -Ref: Two-way I/O-Footnote-2796273 -Node: TCP/IP Networking796355 -Node: Profiling799228 -Node: Advanced Features Summary806775 -Node: Internationalization808708 -Node: I18N and L10N810188 -Node: Explaining gettext810874 -Ref: Explaining gettext-Footnote-1815899 -Ref: Explaining gettext-Footnote-2816083 -Node: Programmer i18n816248 -Ref: Programmer i18n-Footnote-1821114 -Node: Translator i18n821163 -Node: String Extraction821957 -Ref: String Extraction-Footnote-1823088 -Node: Printf Ordering823174 -Ref: Printf Ordering-Footnote-1825960 -Node: I18N Portability826024 -Ref: I18N Portability-Footnote-1828479 -Node: I18N Example828542 -Ref: I18N Example-Footnote-1831345 -Node: Gawk I18N831417 -Node: I18N Summary832055 -Node: Debugger833394 -Node: Debugging834416 -Node: Debugging Concepts834857 -Node: Debugging Terms836710 -Node: Awk Debugging839282 -Node: Sample Debugging Session840176 -Node: Debugger Invocation840696 -Node: Finding The Bug842080 -Node: List of Debugger Commands848555 -Node: Breakpoint Control849888 -Node: Debugger Execution Control853584 -Node: Viewing And Changing Data856948 -Node: Execution Stack860326 -Node: Debugger Info861963 -Node: Miscellaneous Debugger Commands865980 -Node: Readline Support871009 -Node: Limitations871901 -Node: Debugging Summary874015 -Node: Arbitrary Precision Arithmetic875183 -Node: Computer Arithmetic876599 -Ref: table-numeric-ranges880197 -Ref: Computer Arithmetic-Footnote-1881056 -Node: Math Definitions881113 -Ref: table-ieee-formats884401 -Ref: Math Definitions-Footnote-1885005 -Node: MPFR features885110 -Node: FP Math Caution886781 -Ref: FP Math Caution-Footnote-1887831 -Node: Inexactness of computations888200 -Node: Inexact representation889159 -Node: Comparing FP Values890516 -Node: Errors accumulate891598 -Node: Getting Accuracy893031 -Node: Try To Round895693 -Node: Setting precision896592 -Ref: table-predefined-precision-strings897276 -Node: Setting the rounding mode899065 -Ref: table-gawk-rounding-modes899429 -Ref: Setting the rounding mode-Footnote-1902884 -Node: Arbitrary Precision Integers903063 -Ref: Arbitrary Precision Integers-Footnote-1906049 -Node: POSIX Floating Point Problems906198 -Ref: POSIX Floating Point Problems-Footnote-1910071 -Node: Floating point summary910109 -Node: Dynamic Extensions912303 -Node: Extension Intro913855 -Node: Plugin License915121 -Node: Extension Mechanism Outline915918 -Ref: figure-load-extension916346 -Ref: figure-register-new-function917826 -Ref: figure-call-new-function918830 -Node: Extension API Description920816 -Node: Extension API Functions Introduction922266 -Node: General Data Types927090 -Ref: General Data Types-Footnote-1932829 -Node: Memory Allocation Functions933128 -Ref: Memory Allocation Functions-Footnote-1935967 -Node: Constructor Functions936063 -Node: Registration Functions937797 -Node: Extension Functions938482 -Node: Exit Callback Functions940779 -Node: Extension Version String942027 -Node: Input Parsers942692 -Node: Output Wrappers952571 -Node: Two-way processors957086 -Node: Printing Messages959290 -Ref: Printing Messages-Footnote-1960366 -Node: Updating `ERRNO'960518 -Node: Requesting Values961258 -Ref: table-value-types-returned961986 -Node: Accessing Parameters962943 -Node: Symbol Table Access964174 -Node: Symbol table by name964688 -Node: Symbol table by cookie966669 -Ref: Symbol table by cookie-Footnote-1970813 -Node: Cached values970876 -Ref: Cached values-Footnote-1974375 -Node: Array Manipulation974466 -Ref: Array Manipulation-Footnote-1975564 -Node: Array Data Types975601 -Ref: Array Data Types-Footnote-1978256 -Node: Array Functions978348 -Node: Flattening Arrays982202 -Node: Creating Arrays989094 -Node: Extension API Variables993865 -Node: Extension Versioning994501 -Node: Extension API Informational Variables996402 -Node: Extension API Boilerplate997467 -Node: Finding Extensions1001276 -Node: Extension Example1001836 -Node: Internal File Description1002608 -Node: Internal File Ops1006675 -Ref: Internal File Ops-Footnote-11018345 -Node: Using Internal File Ops1018485 -Ref: Using Internal File Ops-Footnote-11020868 -Node: Extension Samples1021141 -Node: Extension Sample File Functions1022667 -Node: Extension Sample Fnmatch1030305 -Node: Extension Sample Fork1031796 -Node: Extension Sample Inplace1033011 -Node: Extension Sample Ord1034686 -Node: Extension Sample Readdir1035522 -Ref: table-readdir-file-types1036398 -Node: Extension Sample Revout1037209 -Node: Extension Sample Rev2way1037799 -Node: Extension Sample Read write array1038539 -Node: Extension Sample Readfile1040479 -Node: Extension Sample Time1041574 -Node: Extension Sample API Tests1042923 -Node: gawkextlib1043414 -Node: Extension summary1046072 -Node: Extension Exercises1049761 -Node: Language History1050483 -Node: V7/SVR3.11052139 -Node: SVR41054320 -Node: POSIX1055765 -Node: BTL1057154 -Node: POSIX/GNU1057888 -Node: Feature History1063452 -Node: Common Extensions1076550 -Node: Ranges and Locales1077874 -Ref: Ranges and Locales-Footnote-11082492 -Ref: Ranges and Locales-Footnote-21082519 -Ref: Ranges and Locales-Footnote-31082753 -Node: Contributors1082974 -Node: History summary1088515 -Node: Installation1089885 -Node: Gawk Distribution1090831 -Node: Getting1091315 -Node: Extracting1092138 -Node: Distribution contents1093773 -Node: Unix Installation1099490 -Node: Quick Installation1100107 -Node: Additional Configuration Options1102531 -Node: Configuration Philosophy1104269 -Node: Non-Unix Installation1106638 -Node: PC Installation1107096 -Node: PC Binary Installation1108415 -Node: PC Compiling1110263 -Ref: PC Compiling-Footnote-11113284 -Node: PC Testing1113393 -Node: PC Using1114569 -Node: Cygwin1118684 -Node: MSYS1119507 -Node: VMS Installation1120007 -Node: VMS Compilation1120799 -Ref: VMS Compilation-Footnote-11122021 -Node: VMS Dynamic Extensions1122079 -Node: VMS Installation Details1123763 -Node: VMS Running1126015 -Node: VMS GNV1128851 -Node: VMS Old Gawk1129585 -Node: Bugs1130055 -Node: Other Versions1133938 -Node: Installation summary1140362 -Node: Notes1141418 -Node: Compatibility Mode1142283 -Node: Additions1143065 -Node: Accessing The Source1143990 -Node: Adding Code1145425 -Node: New Ports1151582 -Node: Derived Files1156064 -Ref: Derived Files-Footnote-11161539 -Ref: Derived Files-Footnote-21161573 -Ref: Derived Files-Footnote-31162169 -Node: Future Extensions1162283 -Node: Implementation Limitations1162889 -Node: Extension Design1164137 -Node: Old Extension Problems1165291 -Ref: Old Extension Problems-Footnote-11166808 -Node: Extension New Mechanism Goals1166865 -Ref: Extension New Mechanism Goals-Footnote-11170225 -Node: Extension Other Design Decisions1170414 -Node: Extension Future Growth1172522 -Node: Old Extension Mechanism1173358 -Node: Notes summary1175120 -Node: Basic Concepts1176306 -Node: Basic High Level1176987 -Ref: figure-general-flow1177259 -Ref: figure-process-flow1177858 -Ref: Basic High Level-Footnote-11181087 -Node: Basic Data Typing1181272 -Node: Glossary1184600 -Node: Copying1216529 -Node: GNU Free Documentation License1254085 -Node: Index1279221 +Ref: Definition Syntax-Footnote-1571911 +Node: Function Example571982 +Ref: Function Example-Footnote-1574901 +Node: Function Caveats574923 +Node: Calling A Function575441 +Node: Variable Scope576399 +Node: Pass By Value/Reference579387 +Node: Return Statement582882 +Node: Dynamic Typing585863 +Node: Indirect Calls586792 +Ref: Indirect Calls-Footnote-1598110 +Node: Functions Summary598238 +Node: Library Functions600940 +Ref: Library Functions-Footnote-1604549 +Ref: Library Functions-Footnote-2604692 +Node: Library Names604863 +Ref: Library Names-Footnote-1608317 +Ref: Library Names-Footnote-2608540 +Node: General Functions608626 +Node: Strtonum Function609729 +Node: Assert Function612751 +Node: Round Function616075 +Node: Cliff Random Function617616 +Node: Ordinal Functions618632 +Ref: Ordinal Functions-Footnote-1621695 +Ref: Ordinal Functions-Footnote-2621947 +Node: Join Function622158 +Ref: Join Function-Footnote-1623927 +Node: Getlocaltime Function624127 +Node: Readfile Function627871 +Node: Shell Quoting629841 +Node: Data File Management631242 +Node: Filetrans Function631874 +Node: Rewind Function635930 +Node: File Checking637317 +Ref: File Checking-Footnote-1638649 +Node: Empty Files638850 +Node: Ignoring Assigns640829 +Node: Getopt Function642380 +Ref: Getopt Function-Footnote-1653842 +Node: Passwd Functions654042 +Ref: Passwd Functions-Footnote-1662879 +Node: Group Functions662967 +Ref: Group Functions-Footnote-1670861 +Node: Walking Arrays671074 +Node: Library Functions Summary672677 +Node: Library Exercises674078 +Node: Sample Programs675358 +Node: Running Examples676128 +Node: Clones676856 +Node: Cut Program678080 +Node: Egrep Program687799 +Ref: Egrep Program-Footnote-1695297 +Node: Id Program695407 +Node: Split Program699052 +Ref: Split Program-Footnote-1702500 +Node: Tee Program702628 +Node: Uniq Program705417 +Node: Wc Program712836 +Ref: Wc Program-Footnote-1717086 +Node: Miscellaneous Programs717180 +Node: Dupword Program718393 +Node: Alarm Program720424 +Node: Translate Program725228 +Ref: Translate Program-Footnote-1729793 +Node: Labels Program730063 +Ref: Labels Program-Footnote-1733414 +Node: Word Sorting733498 +Node: History Sorting737569 +Node: Extract Program739405 +Node: Simple Sed746930 +Node: Igawk Program749998 +Ref: Igawk Program-Footnote-1764322 +Ref: Igawk Program-Footnote-2764523 +Ref: Igawk Program-Footnote-3764645 +Node: Anagram Program764760 +Node: Signature Program767817 +Node: Programs Summary769064 +Node: Programs Exercises770257 +Ref: Programs Exercises-Footnote-1774388 +Node: Advanced Features774479 +Node: Nondecimal Data776427 +Node: Array Sorting778017 +Node: Controlling Array Traversal778714 +Ref: Controlling Array Traversal-Footnote-1787047 +Node: Array Sorting Functions787165 +Ref: Array Sorting Functions-Footnote-1791054 +Node: Two-way I/O791250 +Ref: Two-way I/O-Footnote-1796195 +Ref: Two-way I/O-Footnote-2796381 +Node: TCP/IP Networking796463 +Node: Profiling799336 +Node: Advanced Features Summary806883 +Node: Internationalization808816 +Node: I18N and L10N810296 +Node: Explaining gettext810982 +Ref: Explaining gettext-Footnote-1816007 +Ref: Explaining gettext-Footnote-2816191 +Node: Programmer i18n816356 +Ref: Programmer i18n-Footnote-1821222 +Node: Translator i18n821271 +Node: String Extraction822065 +Ref: String Extraction-Footnote-1823196 +Node: Printf Ordering823282 +Ref: Printf Ordering-Footnote-1826068 +Node: I18N Portability826132 +Ref: I18N Portability-Footnote-1828587 +Node: I18N Example828650 +Ref: I18N Example-Footnote-1831453 +Node: Gawk I18N831525 +Node: I18N Summary832163 +Node: Debugger833502 +Node: Debugging834524 +Node: Debugging Concepts834965 +Node: Debugging Terms836818 +Node: Awk Debugging839390 +Node: Sample Debugging Session840284 +Node: Debugger Invocation840804 +Node: Finding The Bug842188 +Node: List of Debugger Commands848663 +Node: Breakpoint Control849996 +Node: Debugger Execution Control853692 +Node: Viewing And Changing Data857056 +Node: Execution Stack860434 +Node: Debugger Info862071 +Node: Miscellaneous Debugger Commands866088 +Node: Readline Support871117 +Node: Limitations872009 +Node: Debugging Summary874123 +Node: Arbitrary Precision Arithmetic875291 +Node: Computer Arithmetic876707 +Ref: table-numeric-ranges880305 +Ref: Computer Arithmetic-Footnote-1881164 +Node: Math Definitions881221 +Ref: table-ieee-formats884509 +Ref: Math Definitions-Footnote-1885113 +Node: MPFR features885218 +Node: FP Math Caution886889 +Ref: FP Math Caution-Footnote-1887939 +Node: Inexactness of computations888308 +Node: Inexact representation889267 +Node: Comparing FP Values890624 +Node: Errors accumulate891706 +Node: Getting Accuracy893139 +Node: Try To Round895801 +Node: Setting precision896700 +Ref: table-predefined-precision-strings897384 +Node: Setting the rounding mode899173 +Ref: table-gawk-rounding-modes899537 +Ref: Setting the rounding mode-Footnote-1902992 +Node: Arbitrary Precision Integers903171 +Ref: Arbitrary Precision Integers-Footnote-1906157 +Node: POSIX Floating Point Problems906306 +Ref: POSIX Floating Point Problems-Footnote-1910179 +Node: Floating point summary910217 +Node: Dynamic Extensions912411 +Node: Extension Intro913963 +Node: Plugin License915229 +Node: Extension Mechanism Outline916026 +Ref: figure-load-extension916454 +Ref: figure-register-new-function917934 +Ref: figure-call-new-function918938 +Node: Extension API Description920924 +Node: Extension API Functions Introduction922374 +Node: General Data Types927198 +Ref: General Data Types-Footnote-1932937 +Node: Memory Allocation Functions933236 +Ref: Memory Allocation Functions-Footnote-1936075 +Node: Constructor Functions936171 +Node: Registration Functions937905 +Node: Extension Functions938590 +Node: Exit Callback Functions940887 +Node: Extension Version String942135 +Node: Input Parsers942800 +Node: Output Wrappers952679 +Node: Two-way processors957194 +Node: Printing Messages959398 +Ref: Printing Messages-Footnote-1960474 +Node: Updating `ERRNO'960626 +Node: Requesting Values961366 +Ref: table-value-types-returned962094 +Node: Accessing Parameters963051 +Node: Symbol Table Access964282 +Node: Symbol table by name964796 +Node: Symbol table by cookie966777 +Ref: Symbol table by cookie-Footnote-1970921 +Node: Cached values970984 +Ref: Cached values-Footnote-1974483 +Node: Array Manipulation974574 +Ref: Array Manipulation-Footnote-1975672 +Node: Array Data Types975709 +Ref: Array Data Types-Footnote-1978364 +Node: Array Functions978456 +Node: Flattening Arrays982310 +Node: Creating Arrays989202 +Node: Extension API Variables993973 +Node: Extension Versioning994609 +Node: Extension API Informational Variables996510 +Node: Extension API Boilerplate997575 +Node: Finding Extensions1001384 +Node: Extension Example1001944 +Node: Internal File Description1002716 +Node: Internal File Ops1006783 +Ref: Internal File Ops-Footnote-11018453 +Node: Using Internal File Ops1018593 +Ref: Using Internal File Ops-Footnote-11020976 +Node: Extension Samples1021249 +Node: Extension Sample File Functions1022775 +Node: Extension Sample Fnmatch1030413 +Node: Extension Sample Fork1031904 +Node: Extension Sample Inplace1033119 +Node: Extension Sample Ord1034794 +Node: Extension Sample Readdir1035630 +Ref: table-readdir-file-types1036506 +Node: Extension Sample Revout1037317 +Node: Extension Sample Rev2way1037907 +Node: Extension Sample Read write array1038647 +Node: Extension Sample Readfile1040587 +Node: Extension Sample Time1041682 +Node: Extension Sample API Tests1043031 +Node: gawkextlib1043522 +Node: Extension summary1046180 +Node: Extension Exercises1049869 +Node: Language History1050591 +Node: V7/SVR3.11052247 +Node: SVR41054428 +Node: POSIX1055873 +Node: BTL1057262 +Node: POSIX/GNU1057996 +Node: Feature History1063560 +Node: Common Extensions1076658 +Node: Ranges and Locales1077982 +Ref: Ranges and Locales-Footnote-11082600 +Ref: Ranges and Locales-Footnote-21082627 +Ref: Ranges and Locales-Footnote-31082861 +Node: Contributors1083082 +Node: History summary1088623 +Node: Installation1089993 +Node: Gawk Distribution1090939 +Node: Getting1091423 +Node: Extracting1092246 +Node: Distribution contents1093881 +Node: Unix Installation1099598 +Node: Quick Installation1100215 +Node: Additional Configuration Options1102639 +Node: Configuration Philosophy1104377 +Node: Non-Unix Installation1106746 +Node: PC Installation1107204 +Node: PC Binary Installation1108523 +Node: PC Compiling1110371 +Ref: PC Compiling-Footnote-11113392 +Node: PC Testing1113501 +Node: PC Using1114677 +Node: Cygwin1118792 +Node: MSYS1119615 +Node: VMS Installation1120115 +Node: VMS Compilation1120907 +Ref: VMS Compilation-Footnote-11122129 +Node: VMS Dynamic Extensions1122187 +Node: VMS Installation Details1123871 +Node: VMS Running1126123 +Node: VMS GNV1128959 +Node: VMS Old Gawk1129693 +Node: Bugs1130163 +Node: Other Versions1134046 +Node: Installation summary1140470 +Node: Notes1141526 +Node: Compatibility Mode1142391 +Node: Additions1143173 +Node: Accessing The Source1144098 +Node: Adding Code1145533 +Node: New Ports1151690 +Node: Derived Files1156172 +Ref: Derived Files-Footnote-11161647 +Ref: Derived Files-Footnote-21161681 +Ref: Derived Files-Footnote-31162277 +Node: Future Extensions1162391 +Node: Implementation Limitations1162997 +Node: Extension Design1164245 +Node: Old Extension Problems1165399 +Ref: Old Extension Problems-Footnote-11166916 +Node: Extension New Mechanism Goals1166973 +Ref: Extension New Mechanism Goals-Footnote-11170333 +Node: Extension Other Design Decisions1170522 +Node: Extension Future Growth1172630 +Node: Old Extension Mechanism1173466 +Node: Notes summary1175228 +Node: Basic Concepts1176414 +Node: Basic High Level1177095 +Ref: figure-general-flow1177367 +Ref: figure-process-flow1177966 +Ref: Basic High Level-Footnote-11181195 +Node: Basic Data Typing1181380 +Node: Glossary1184708 +Node: Copying1216637 +Node: GNU Free Documentation License1254193 +Node: Index1279329  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 266b3898..df5afc63 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -19336,10 +19336,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 @@ -20056,13 +20061,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 diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 7fd947a5..0723a4c2 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -18457,10 +18457,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 @@ -19177,13 +19182,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 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 04e65b5a..97b3d40b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,11 @@ +2015-01-30 Arnold D. Robbins + + * 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-14 Arnold D. Robbins * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since diff --git a/test/Makefile.am b/test/Makefile.am index bd2903ab..4a90beb4 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 \ @@ -642,6 +644,10 @@ EXTRA_DIST = \ out1.ok \ out2.ok \ out3.ok \ + paramasfunc1.awk \ + paramasfunc1.ok \ + paramasfunc2.awk \ + paramasfunc2.ok \ paramdup.awk \ paramdup.ok \ paramres.awk \ @@ -983,7 +989,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 \ @@ -1001,6 +1007,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 215ba892..97171726 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -389,6 +389,8 @@ EXTRA_DIST = \ beginfile2.ok \ beginfile2.sh \ binmode1.ok \ + callparam.awk \ + callparam.ok \ charasbytes.awk \ charasbytes.in \ charasbytes.ok \ @@ -899,6 +901,10 @@ EXTRA_DIST = \ out1.ok \ out2.ok \ out3.ok \ + paramasfunc1.awk \ + paramasfunc1.ok \ + paramasfunc2.awk \ + paramasfunc2.ok \ paramdup.awk \ paramdup.ok \ paramres.awk \ @@ -1239,7 +1245,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 \ @@ -1257,6 +1263,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 \ @@ -2572,6 +2579,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: $$? >>_$@ @@ -3042,6 +3054,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 5c4c40f9..41c85c01 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 -- cgit v1.2.3 From bcb51623b8e156b03c2ae588906e4ed25fa3eba2 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 1 Feb 2015 20:53:05 +0200 Subject: Move param checking against function names into --posix. --- ChangeLog | 13 ++ NEWS | 2 +- awkgram.c | 2 +- awkgram.y | 2 +- doc/ChangeLog | 6 + doc/gawk.info | 627 +++++++++++++++++++++++++------------------------- doc/gawk.texi | 12 +- doc/gawktexi.in | 12 +- symbol.c | 36 +-- test/ChangeLog | 7 +- test/Makefile.am | 9 + test/Makefile.in | 20 +- test/Maketests | 10 - test/indirectcall.awk | 8 +- 14 files changed, 403 insertions(+), 363 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5c7c091..6f626cd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2015-02-01 Arnold D. Robbins + + Move POSIX requirement for disallowing paramater names with the + same name as a function into --posix. + + * NEWS: Document it. + * awkgram.y (parse_program): Check do_posix before calling + check_param_names(). + * symbol.c (check_param_names): Set up a fake node and call + in_array() for function parameter names instead of linear + searching the function list a second time. Thanks to Andrew + Schorr for the motivation. + 2015-01-30 Arnold D. Robbins Don't allow function parameter names to be the same as function diff --git a/NEWS b/NEWS index 21568ea3..ba86e965 100644 --- a/NEWS +++ b/NEWS @@ -49,7 +49,7 @@ Changes from 4.1.1 to 4.1.2 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. + since 3.1.7. With --posix, it now also checks for the latter. XX. A number of bugs have been fixed. See the ChangeLog. diff --git a/awkgram.c b/awkgram.c index 9a9ca13b..20d3506a 100644 --- a/awkgram.c +++ b/awkgram.c @@ -4661,7 +4661,7 @@ parse_program(INSTRUCTION **pcode) if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */ check_funcs(); - if (! check_param_names()) + if (do_posix && ! check_param_names()) errcount++; if (args_array == NULL) diff --git a/awkgram.y b/awkgram.y index 55615c13..ef7c139a 100644 --- a/awkgram.y +++ b/awkgram.y @@ -2322,7 +2322,7 @@ parse_program(INSTRUCTION **pcode) if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */ check_funcs(); - if (! check_param_names()) + if (do_posix && ! check_param_names()) errcount++; if (args_array == NULL) diff --git a/doc/ChangeLog b/doc/ChangeLog index 61caac69..904cd326 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-01 Arnold D. Robbins + + * gawktexi.in: POSIX requirement that function parameters cannot + have the same name as a function is now --posix. + Restore indirectcall example. + 2015-01-30 Arnold D. Robbins * gawktexi.in: Document POSIX requirement that function parameters diff --git a/doc/gawk.info b/doc/gawk.info index 4e975b14..ca168110 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -13464,8 +13464,11 @@ 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. + parameter have the same name as another function. + + Not all versions of `awk' enforce these restrictions. `gawk' + always enforces the first restriction. With `--posix' (*note + Options::), it also enforces the second restriction. Local variables act like the empty string if referenced where a string value is required, and like zero if referenced where a numeric @@ -14067,13 +14070,13 @@ using indirect function calls: # average --- return the average of the values in fields $first - $last - function average(first, last, the_sum, i) + function average(first, last, sum, i) { - the_sum = 0; + sum = 0; for (i = first; i <= last; i++) - the_sum += $i + sum += $i - return the_sum / (last - first + 1) + return sum / (last - first + 1) } # sum --- return the sum of the values in fields $first - $last @@ -32159,7 +32162,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 95) +* common extensions, func keyword: Definition Syntax. (line 98) * common extensions, length() applied to an array: String Functions. (line 201) * common extensions, RS as a regexp: gawk split records. (line 6) @@ -32680,7 +32683,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 95) +* extensions, common, func keyword: Definition Syntax. (line 98) * extensions, common, length() applied to an array: String Functions. (line 201) * extensions, common, RS as a regexp: gawk split records. (line 6) @@ -32897,7 +32900,7 @@ Index * functions, library, user database, reading: Passwd Functions. (line 6) * functions, names of: Definition Syntax. (line 23) -* functions, recursive: Definition Syntax. (line 85) +* functions, recursive: Definition Syntax. (line 88) * functions, string-translation: I18N Functions. (line 6) * functions, undefined: Pass By Value/Reference. (line 68) @@ -33618,7 +33621,7 @@ Index (line 65) * portability, deleting array elements: Delete. (line 56) * portability, example programs: Library Functions. (line 42) -* portability, functions, defining: Definition Syntax. (line 111) +* portability, functions, defining: Definition Syntax. (line 114) * portability, gawk: New Ports. (line 6) * portability, gettext library and: Explaining gettext. (line 11) * portability, internationalization and: I18N Portability. (line 6) @@ -33663,7 +33666,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 95) +* POSIX awk, function keyword in: Definition Syntax. (line 98) * 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) @@ -33756,7 +33759,7 @@ Index * programming conventions, functions, calling: Calling Built-in. (line 10) * programming conventions, functions, writing: Definition Syntax. - (line 67) + (line 70) * programming conventions, gawk extensions: Internal File Ops. (line 45) * programming conventions, private variable names: Library Names. @@ -33825,7 +33828,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 85) +* recursive functions: Definition Syntax. (line 88) * redirect gawk output, in debugger: Debugger Info. (line 72) * redirection of input: Getline/File. (line 6) * redirection of output: Redirection. (line 6) @@ -33994,7 +33997,7 @@ Index * set directory of message catalogs: I18N Functions. (line 12) * set watchpoint: Viewing And Changing Data. (line 67) -* shadowing of variable values: Definition Syntax. (line 73) +* shadowing of variable values: Definition Syntax. (line 76) * shell quoting, rules for: Quoting. (line 6) * shells, piping commands into: Redirection. (line 136) * shells, quoting: Using Shell Variables. @@ -34368,7 +34371,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 73) +* variables, shadowing: Definition Syntax. (line 76) * variables, types of: Assignment Ops. (line 40) * variables, types of, comparison expressions and: Typing and Comparison. (line 9) @@ -34725,302 +34728,302 @@ Node: Type Functions562811 Node: I18N Functions563962 Node: User-defined565607 Node: Definition Syntax566412 -Ref: Definition Syntax-Footnote-1571911 -Node: Function Example571982 -Ref: Function Example-Footnote-1574901 -Node: Function Caveats574923 -Node: Calling A Function575441 -Node: Variable Scope576399 -Node: Pass By Value/Reference579387 -Node: Return Statement582882 -Node: Dynamic Typing585863 -Node: Indirect Calls586792 -Ref: Indirect Calls-Footnote-1598110 -Node: Functions Summary598238 -Node: Library Functions600940 -Ref: Library Functions-Footnote-1604549 -Ref: Library Functions-Footnote-2604692 -Node: Library Names604863 -Ref: Library Names-Footnote-1608317 -Ref: Library Names-Footnote-2608540 -Node: General Functions608626 -Node: Strtonum Function609729 -Node: Assert Function612751 -Node: Round Function616075 -Node: Cliff Random Function617616 -Node: Ordinal Functions618632 -Ref: Ordinal Functions-Footnote-1621695 -Ref: Ordinal Functions-Footnote-2621947 -Node: Join Function622158 -Ref: Join Function-Footnote-1623927 -Node: Getlocaltime Function624127 -Node: Readfile Function627871 -Node: Shell Quoting629841 -Node: Data File Management631242 -Node: Filetrans Function631874 -Node: Rewind Function635930 -Node: File Checking637317 -Ref: File Checking-Footnote-1638649 -Node: Empty Files638850 -Node: Ignoring Assigns640829 -Node: Getopt Function642380 -Ref: Getopt Function-Footnote-1653842 -Node: Passwd Functions654042 -Ref: Passwd Functions-Footnote-1662879 -Node: Group Functions662967 -Ref: Group Functions-Footnote-1670861 -Node: Walking Arrays671074 -Node: Library Functions Summary672677 -Node: Library Exercises674078 -Node: Sample Programs675358 -Node: Running Examples676128 -Node: Clones676856 -Node: Cut Program678080 -Node: Egrep Program687799 -Ref: Egrep Program-Footnote-1695297 -Node: Id Program695407 -Node: Split Program699052 -Ref: Split Program-Footnote-1702500 -Node: Tee Program702628 -Node: Uniq Program705417 -Node: Wc Program712836 -Ref: Wc Program-Footnote-1717086 -Node: Miscellaneous Programs717180 -Node: Dupword Program718393 -Node: Alarm Program720424 -Node: Translate Program725228 -Ref: Translate Program-Footnote-1729793 -Node: Labels Program730063 -Ref: Labels Program-Footnote-1733414 -Node: Word Sorting733498 -Node: History Sorting737569 -Node: Extract Program739405 -Node: Simple Sed746930 -Node: Igawk Program749998 -Ref: Igawk Program-Footnote-1764322 -Ref: Igawk Program-Footnote-2764523 -Ref: Igawk Program-Footnote-3764645 -Node: Anagram Program764760 -Node: Signature Program767817 -Node: Programs Summary769064 -Node: Programs Exercises770257 -Ref: Programs Exercises-Footnote-1774388 -Node: Advanced Features774479 -Node: Nondecimal Data776427 -Node: Array Sorting778017 -Node: Controlling Array Traversal778714 -Ref: Controlling Array Traversal-Footnote-1787047 -Node: Array Sorting Functions787165 -Ref: Array Sorting Functions-Footnote-1791054 -Node: Two-way I/O791250 -Ref: Two-way I/O-Footnote-1796195 -Ref: Two-way I/O-Footnote-2796381 -Node: TCP/IP Networking796463 -Node: Profiling799336 -Node: Advanced Features Summary806883 -Node: Internationalization808816 -Node: I18N and L10N810296 -Node: Explaining gettext810982 -Ref: Explaining gettext-Footnote-1816007 -Ref: Explaining gettext-Footnote-2816191 -Node: Programmer i18n816356 -Ref: Programmer i18n-Footnote-1821222 -Node: Translator i18n821271 -Node: String Extraction822065 -Ref: String Extraction-Footnote-1823196 -Node: Printf Ordering823282 -Ref: Printf Ordering-Footnote-1826068 -Node: I18N Portability826132 -Ref: I18N Portability-Footnote-1828587 -Node: I18N Example828650 -Ref: I18N Example-Footnote-1831453 -Node: Gawk I18N831525 -Node: I18N Summary832163 -Node: Debugger833502 -Node: Debugging834524 -Node: Debugging Concepts834965 -Node: Debugging Terms836818 -Node: Awk Debugging839390 -Node: Sample Debugging Session840284 -Node: Debugger Invocation840804 -Node: Finding The Bug842188 -Node: List of Debugger Commands848663 -Node: Breakpoint Control849996 -Node: Debugger Execution Control853692 -Node: Viewing And Changing Data857056 -Node: Execution Stack860434 -Node: Debugger Info862071 -Node: Miscellaneous Debugger Commands866088 -Node: Readline Support871117 -Node: Limitations872009 -Node: Debugging Summary874123 -Node: Arbitrary Precision Arithmetic875291 -Node: Computer Arithmetic876707 -Ref: table-numeric-ranges880305 -Ref: Computer Arithmetic-Footnote-1881164 -Node: Math Definitions881221 -Ref: table-ieee-formats884509 -Ref: Math Definitions-Footnote-1885113 -Node: MPFR features885218 -Node: FP Math Caution886889 -Ref: FP Math Caution-Footnote-1887939 -Node: Inexactness of computations888308 -Node: Inexact representation889267 -Node: Comparing FP Values890624 -Node: Errors accumulate891706 -Node: Getting Accuracy893139 -Node: Try To Round895801 -Node: Setting precision896700 -Ref: table-predefined-precision-strings897384 -Node: Setting the rounding mode899173 -Ref: table-gawk-rounding-modes899537 -Ref: Setting the rounding mode-Footnote-1902992 -Node: Arbitrary Precision Integers903171 -Ref: Arbitrary Precision Integers-Footnote-1906157 -Node: POSIX Floating Point Problems906306 -Ref: POSIX Floating Point Problems-Footnote-1910179 -Node: Floating point summary910217 -Node: Dynamic Extensions912411 -Node: Extension Intro913963 -Node: Plugin License915229 -Node: Extension Mechanism Outline916026 -Ref: figure-load-extension916454 -Ref: figure-register-new-function917934 -Ref: figure-call-new-function918938 -Node: Extension API Description920924 -Node: Extension API Functions Introduction922374 -Node: General Data Types927198 -Ref: General Data Types-Footnote-1932937 -Node: Memory Allocation Functions933236 -Ref: Memory Allocation Functions-Footnote-1936075 -Node: Constructor Functions936171 -Node: Registration Functions937905 -Node: Extension Functions938590 -Node: Exit Callback Functions940887 -Node: Extension Version String942135 -Node: Input Parsers942800 -Node: Output Wrappers952679 -Node: Two-way processors957194 -Node: Printing Messages959398 -Ref: Printing Messages-Footnote-1960474 -Node: Updating `ERRNO'960626 -Node: Requesting Values961366 -Ref: table-value-types-returned962094 -Node: Accessing Parameters963051 -Node: Symbol Table Access964282 -Node: Symbol table by name964796 -Node: Symbol table by cookie966777 -Ref: Symbol table by cookie-Footnote-1970921 -Node: Cached values970984 -Ref: Cached values-Footnote-1974483 -Node: Array Manipulation974574 -Ref: Array Manipulation-Footnote-1975672 -Node: Array Data Types975709 -Ref: Array Data Types-Footnote-1978364 -Node: Array Functions978456 -Node: Flattening Arrays982310 -Node: Creating Arrays989202 -Node: Extension API Variables993973 -Node: Extension Versioning994609 -Node: Extension API Informational Variables996510 -Node: Extension API Boilerplate997575 -Node: Finding Extensions1001384 -Node: Extension Example1001944 -Node: Internal File Description1002716 -Node: Internal File Ops1006783 -Ref: Internal File Ops-Footnote-11018453 -Node: Using Internal File Ops1018593 -Ref: Using Internal File Ops-Footnote-11020976 -Node: Extension Samples1021249 -Node: Extension Sample File Functions1022775 -Node: Extension Sample Fnmatch1030413 -Node: Extension Sample Fork1031904 -Node: Extension Sample Inplace1033119 -Node: Extension Sample Ord1034794 -Node: Extension Sample Readdir1035630 -Ref: table-readdir-file-types1036506 -Node: Extension Sample Revout1037317 -Node: Extension Sample Rev2way1037907 -Node: Extension Sample Read write array1038647 -Node: Extension Sample Readfile1040587 -Node: Extension Sample Time1041682 -Node: Extension Sample API Tests1043031 -Node: gawkextlib1043522 -Node: Extension summary1046180 -Node: Extension Exercises1049869 -Node: Language History1050591 -Node: V7/SVR3.11052247 -Node: SVR41054428 -Node: POSIX1055873 -Node: BTL1057262 -Node: POSIX/GNU1057996 -Node: Feature History1063560 -Node: Common Extensions1076658 -Node: Ranges and Locales1077982 -Ref: Ranges and Locales-Footnote-11082600 -Ref: Ranges and Locales-Footnote-21082627 -Ref: Ranges and Locales-Footnote-31082861 -Node: Contributors1083082 -Node: History summary1088623 -Node: Installation1089993 -Node: Gawk Distribution1090939 -Node: Getting1091423 -Node: Extracting1092246 -Node: Distribution contents1093881 -Node: Unix Installation1099598 -Node: Quick Installation1100215 -Node: Additional Configuration Options1102639 -Node: Configuration Philosophy1104377 -Node: Non-Unix Installation1106746 -Node: PC Installation1107204 -Node: PC Binary Installation1108523 -Node: PC Compiling1110371 -Ref: PC Compiling-Footnote-11113392 -Node: PC Testing1113501 -Node: PC Using1114677 -Node: Cygwin1118792 -Node: MSYS1119615 -Node: VMS Installation1120115 -Node: VMS Compilation1120907 -Ref: VMS Compilation-Footnote-11122129 -Node: VMS Dynamic Extensions1122187 -Node: VMS Installation Details1123871 -Node: VMS Running1126123 -Node: VMS GNV1128959 -Node: VMS Old Gawk1129693 -Node: Bugs1130163 -Node: Other Versions1134046 -Node: Installation summary1140470 -Node: Notes1141526 -Node: Compatibility Mode1142391 -Node: Additions1143173 -Node: Accessing The Source1144098 -Node: Adding Code1145533 -Node: New Ports1151690 -Node: Derived Files1156172 -Ref: Derived Files-Footnote-11161647 -Ref: Derived Files-Footnote-21161681 -Ref: Derived Files-Footnote-31162277 -Node: Future Extensions1162391 -Node: Implementation Limitations1162997 -Node: Extension Design1164245 -Node: Old Extension Problems1165399 -Ref: Old Extension Problems-Footnote-11166916 -Node: Extension New Mechanism Goals1166973 -Ref: Extension New Mechanism Goals-Footnote-11170333 -Node: Extension Other Design Decisions1170522 -Node: Extension Future Growth1172630 -Node: Old Extension Mechanism1173466 -Node: Notes summary1175228 -Node: Basic Concepts1176414 -Node: Basic High Level1177095 -Ref: figure-general-flow1177367 -Ref: figure-process-flow1177966 -Ref: Basic High Level-Footnote-11181195 -Node: Basic Data Typing1181380 -Node: Glossary1184708 -Node: Copying1216637 -Node: GNU Free Documentation License1254193 -Node: Index1279329 +Ref: Definition Syntax-Footnote-1572044 +Node: Function Example572115 +Ref: Function Example-Footnote-1575034 +Node: Function Caveats575056 +Node: Calling A Function575574 +Node: Variable Scope576532 +Node: Pass By Value/Reference579520 +Node: Return Statement583015 +Node: Dynamic Typing585996 +Node: Indirect Calls586925 +Ref: Indirect Calls-Footnote-1598227 +Node: Functions Summary598355 +Node: Library Functions601057 +Ref: Library Functions-Footnote-1604666 +Ref: Library Functions-Footnote-2604809 +Node: Library Names604980 +Ref: Library Names-Footnote-1608434 +Ref: Library Names-Footnote-2608657 +Node: General Functions608743 +Node: Strtonum Function609846 +Node: Assert Function612868 +Node: Round Function616192 +Node: Cliff Random Function617733 +Node: Ordinal Functions618749 +Ref: Ordinal Functions-Footnote-1621812 +Ref: Ordinal Functions-Footnote-2622064 +Node: Join Function622275 +Ref: Join Function-Footnote-1624044 +Node: Getlocaltime Function624244 +Node: Readfile Function627988 +Node: Shell Quoting629958 +Node: Data File Management631359 +Node: Filetrans Function631991 +Node: Rewind Function636047 +Node: File Checking637434 +Ref: File Checking-Footnote-1638766 +Node: Empty Files638967 +Node: Ignoring Assigns640946 +Node: Getopt Function642497 +Ref: Getopt Function-Footnote-1653959 +Node: Passwd Functions654159 +Ref: Passwd Functions-Footnote-1662996 +Node: Group Functions663084 +Ref: Group Functions-Footnote-1670978 +Node: Walking Arrays671191 +Node: Library Functions Summary672794 +Node: Library Exercises674195 +Node: Sample Programs675475 +Node: Running Examples676245 +Node: Clones676973 +Node: Cut Program678197 +Node: Egrep Program687916 +Ref: Egrep Program-Footnote-1695414 +Node: Id Program695524 +Node: Split Program699169 +Ref: Split Program-Footnote-1702617 +Node: Tee Program702745 +Node: Uniq Program705534 +Node: Wc Program712953 +Ref: Wc Program-Footnote-1717203 +Node: Miscellaneous Programs717297 +Node: Dupword Program718510 +Node: Alarm Program720541 +Node: Translate Program725345 +Ref: Translate Program-Footnote-1729910 +Node: Labels Program730180 +Ref: Labels Program-Footnote-1733531 +Node: Word Sorting733615 +Node: History Sorting737686 +Node: Extract Program739522 +Node: Simple Sed747047 +Node: Igawk Program750115 +Ref: Igawk Program-Footnote-1764439 +Ref: Igawk Program-Footnote-2764640 +Ref: Igawk Program-Footnote-3764762 +Node: Anagram Program764877 +Node: Signature Program767934 +Node: Programs Summary769181 +Node: Programs Exercises770374 +Ref: Programs Exercises-Footnote-1774505 +Node: Advanced Features774596 +Node: Nondecimal Data776544 +Node: Array Sorting778134 +Node: Controlling Array Traversal778831 +Ref: Controlling Array Traversal-Footnote-1787164 +Node: Array Sorting Functions787282 +Ref: Array Sorting Functions-Footnote-1791171 +Node: Two-way I/O791367 +Ref: Two-way I/O-Footnote-1796312 +Ref: Two-way I/O-Footnote-2796498 +Node: TCP/IP Networking796580 +Node: Profiling799453 +Node: Advanced Features Summary807000 +Node: Internationalization808933 +Node: I18N and L10N810413 +Node: Explaining gettext811099 +Ref: Explaining gettext-Footnote-1816124 +Ref: Explaining gettext-Footnote-2816308 +Node: Programmer i18n816473 +Ref: Programmer i18n-Footnote-1821339 +Node: Translator i18n821388 +Node: String Extraction822182 +Ref: String Extraction-Footnote-1823313 +Node: Printf Ordering823399 +Ref: Printf Ordering-Footnote-1826185 +Node: I18N Portability826249 +Ref: I18N Portability-Footnote-1828704 +Node: I18N Example828767 +Ref: I18N Example-Footnote-1831570 +Node: Gawk I18N831642 +Node: I18N Summary832280 +Node: Debugger833619 +Node: Debugging834641 +Node: Debugging Concepts835082 +Node: Debugging Terms836935 +Node: Awk Debugging839507 +Node: Sample Debugging Session840401 +Node: Debugger Invocation840921 +Node: Finding The Bug842305 +Node: List of Debugger Commands848780 +Node: Breakpoint Control850113 +Node: Debugger Execution Control853809 +Node: Viewing And Changing Data857173 +Node: Execution Stack860551 +Node: Debugger Info862188 +Node: Miscellaneous Debugger Commands866205 +Node: Readline Support871234 +Node: Limitations872126 +Node: Debugging Summary874240 +Node: Arbitrary Precision Arithmetic875408 +Node: Computer Arithmetic876824 +Ref: table-numeric-ranges880422 +Ref: Computer Arithmetic-Footnote-1881281 +Node: Math Definitions881338 +Ref: table-ieee-formats884626 +Ref: Math Definitions-Footnote-1885230 +Node: MPFR features885335 +Node: FP Math Caution887006 +Ref: FP Math Caution-Footnote-1888056 +Node: Inexactness of computations888425 +Node: Inexact representation889384 +Node: Comparing FP Values890741 +Node: Errors accumulate891823 +Node: Getting Accuracy893256 +Node: Try To Round895918 +Node: Setting precision896817 +Ref: table-predefined-precision-strings897501 +Node: Setting the rounding mode899290 +Ref: table-gawk-rounding-modes899654 +Ref: Setting the rounding mode-Footnote-1903109 +Node: Arbitrary Precision Integers903288 +Ref: Arbitrary Precision Integers-Footnote-1906274 +Node: POSIX Floating Point Problems906423 +Ref: POSIX Floating Point Problems-Footnote-1910296 +Node: Floating point summary910334 +Node: Dynamic Extensions912528 +Node: Extension Intro914080 +Node: Plugin License915346 +Node: Extension Mechanism Outline916143 +Ref: figure-load-extension916571 +Ref: figure-register-new-function918051 +Ref: figure-call-new-function919055 +Node: Extension API Description921041 +Node: Extension API Functions Introduction922491 +Node: General Data Types927315 +Ref: General Data Types-Footnote-1933054 +Node: Memory Allocation Functions933353 +Ref: Memory Allocation Functions-Footnote-1936192 +Node: Constructor Functions936288 +Node: Registration Functions938022 +Node: Extension Functions938707 +Node: Exit Callback Functions941004 +Node: Extension Version String942252 +Node: Input Parsers942917 +Node: Output Wrappers952796 +Node: Two-way processors957311 +Node: Printing Messages959515 +Ref: Printing Messages-Footnote-1960591 +Node: Updating `ERRNO'960743 +Node: Requesting Values961483 +Ref: table-value-types-returned962211 +Node: Accessing Parameters963168 +Node: Symbol Table Access964399 +Node: Symbol table by name964913 +Node: Symbol table by cookie966894 +Ref: Symbol table by cookie-Footnote-1971038 +Node: Cached values971101 +Ref: Cached values-Footnote-1974600 +Node: Array Manipulation974691 +Ref: Array Manipulation-Footnote-1975789 +Node: Array Data Types975826 +Ref: Array Data Types-Footnote-1978481 +Node: Array Functions978573 +Node: Flattening Arrays982427 +Node: Creating Arrays989319 +Node: Extension API Variables994090 +Node: Extension Versioning994726 +Node: Extension API Informational Variables996627 +Node: Extension API Boilerplate997692 +Node: Finding Extensions1001501 +Node: Extension Example1002061 +Node: Internal File Description1002833 +Node: Internal File Ops1006900 +Ref: Internal File Ops-Footnote-11018570 +Node: Using Internal File Ops1018710 +Ref: Using Internal File Ops-Footnote-11021093 +Node: Extension Samples1021366 +Node: Extension Sample File Functions1022892 +Node: Extension Sample Fnmatch1030530 +Node: Extension Sample Fork1032021 +Node: Extension Sample Inplace1033236 +Node: Extension Sample Ord1034911 +Node: Extension Sample Readdir1035747 +Ref: table-readdir-file-types1036623 +Node: Extension Sample Revout1037434 +Node: Extension Sample Rev2way1038024 +Node: Extension Sample Read write array1038764 +Node: Extension Sample Readfile1040704 +Node: Extension Sample Time1041799 +Node: Extension Sample API Tests1043148 +Node: gawkextlib1043639 +Node: Extension summary1046297 +Node: Extension Exercises1049986 +Node: Language History1050708 +Node: V7/SVR3.11052364 +Node: SVR41054545 +Node: POSIX1055990 +Node: BTL1057379 +Node: POSIX/GNU1058113 +Node: Feature History1063677 +Node: Common Extensions1076775 +Node: Ranges and Locales1078099 +Ref: Ranges and Locales-Footnote-11082717 +Ref: Ranges and Locales-Footnote-21082744 +Ref: Ranges and Locales-Footnote-31082978 +Node: Contributors1083199 +Node: History summary1088740 +Node: Installation1090110 +Node: Gawk Distribution1091056 +Node: Getting1091540 +Node: Extracting1092363 +Node: Distribution contents1093998 +Node: Unix Installation1099715 +Node: Quick Installation1100332 +Node: Additional Configuration Options1102756 +Node: Configuration Philosophy1104494 +Node: Non-Unix Installation1106863 +Node: PC Installation1107321 +Node: PC Binary Installation1108640 +Node: PC Compiling1110488 +Ref: PC Compiling-Footnote-11113509 +Node: PC Testing1113618 +Node: PC Using1114794 +Node: Cygwin1118909 +Node: MSYS1119732 +Node: VMS Installation1120232 +Node: VMS Compilation1121024 +Ref: VMS Compilation-Footnote-11122246 +Node: VMS Dynamic Extensions1122304 +Node: VMS Installation Details1123988 +Node: VMS Running1126240 +Node: VMS GNV1129076 +Node: VMS Old Gawk1129810 +Node: Bugs1130280 +Node: Other Versions1134163 +Node: Installation summary1140587 +Node: Notes1141643 +Node: Compatibility Mode1142508 +Node: Additions1143290 +Node: Accessing The Source1144215 +Node: Adding Code1145650 +Node: New Ports1151807 +Node: Derived Files1156289 +Ref: Derived Files-Footnote-11161764 +Ref: Derived Files-Footnote-21161798 +Ref: Derived Files-Footnote-31162394 +Node: Future Extensions1162508 +Node: Implementation Limitations1163114 +Node: Extension Design1164362 +Node: Old Extension Problems1165516 +Ref: Old Extension Problems-Footnote-11167033 +Node: Extension New Mechanism Goals1167090 +Ref: Extension New Mechanism Goals-Footnote-11170450 +Node: Extension Other Design Decisions1170639 +Node: Extension Future Growth1172747 +Node: Old Extension Mechanism1173583 +Node: Notes summary1175345 +Node: Basic Concepts1176531 +Node: Basic High Level1177212 +Ref: figure-general-flow1177484 +Ref: figure-process-flow1178083 +Ref: Basic High Level-Footnote-11181312 +Node: Basic Data Typing1181497 +Node: Glossary1184825 +Node: Copying1216754 +Node: GNU Free Documentation License1254310 +Node: Index1279446  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index df5afc63..7e8d93de 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -19342,8 +19342,12 @@ According to the POSIX standard, function parameters cannot have the same name as one of the special predefined variables (@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. +@command{gawk} always enforces the first restriction. +With @option{--posix} (@pxref{Options}), +it also enforces the second restriction. @end quotation Local variables act like the empty string if referenced where a string @@ -20061,13 +20065,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, the_sum, i) +function average(first, last, sum, i) @{ - the_sum = 0; + sum = 0; for (i = first; i <= last; i++) - the_sum += $i + sum += $i - return the_sum / (last - first + 1) + return sum / (last - first + 1) @} # sum --- return the sum of the values in fields $first - $last diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 0723a4c2..125e8401 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -18463,8 +18463,12 @@ According to the POSIX standard, function parameters cannot have the same name as one of the special predefined variables (@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. +@command{gawk} always enforces the first restriction. +With @option{--posix} (@pxref{Options}), +it also enforces the second restriction. @end quotation Local variables act like the empty string if referenced where a string @@ -19182,13 +19186,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, the_sum, i) +function average(first, last, sum, i) @{ - the_sum = 0; + sum = 0; for (i = first; i <= last; i++) - the_sum += $i + sum += $i - return the_sum / (last - first + 1) + return sum / (last - first + 1) @} # sum --- return the sum of the values in fields $first - $last diff --git a/symbol.c b/symbol.c index 552c111e..cbfb1edf 100644 --- a/symbol.c +++ b/symbol.c @@ -630,14 +630,23 @@ load_symbols() bool check_param_names(void) { - int i, j, k; + int i, j; NODE **list; NODE *f; long max; bool result = true; + NODE n; + + if (func_table->table_size == 0) + return result; max = func_table->table_size * 2; + memset(& n, sizeof n, 0); + n.type = Node_val; + n.flags = STRING|STRCUR; + n.stfmt = -1; + /* * assoc_list() returns an array with two elements per awk array * element. Elements i and i+1 in the C array represent the key @@ -650,10 +659,6 @@ check_param_names(void) 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) @@ -662,16 +667,17 @@ check_param_names(void) /* 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; - } + + /* use a fake node to avoid malloc/free of make_string */ + n.stptr = f->fparms[j].param; + n.stlen = strlen(f->fparms[j].param); + + if (in_array(func_table, & n)) { + error( + _("function `%s': can't use function `%s' as a parameter name"), + list[i]->stptr, + f->fparms[j].param); + result = false; } } } diff --git a/test/ChangeLog b/test/ChangeLog index 97b3d40b..8672cb00 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,6 +1,11 @@ +2015-02-01 Arnold D. Robbins + + * Makefile.am (paramasfunc1, paramasfunc2): Now need --posix. + * indirectcall.awk: Restore after code change. + 2015-01-30 Arnold D. Robbins - * Makefile.in (callparam, paramasfunc1, paramasfunc2): New tests. + * Makefile.am (callparam, paramasfunc1, paramasfunc2): New tests. * callparam.awk, callparam.ok: New files. * paramasfunc1.awk, paramasfunc1.ok: New files. * paramasfunc2.awk, paramasfunc2.ok: New files. diff --git a/test/Makefile.am b/test/Makefile.am index 4a90beb4..3160494e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2011,6 +2011,15 @@ genpot: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +paramasfunc1:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc2:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index 97171726..d1bbf4f8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2447,6 +2447,16 @@ genpot: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc1:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc2:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -3054,16 +3064,6 @@ 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 41c85c01..f3639b0f 100644 --- a/test/Maketests +++ b/test/Maketests @@ -605,16 +605,6 @@ 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/indirectcall.awk b/test/indirectcall.awk index 74290973..5cfdd235 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, the_sum, i) +function average(first, last, sum, i) { - the_sum = 0; + sum = 0; for (i = first; i <= last; i++) - the_sum += $i + sum += $i - return the_sum / (last - first + 1) + return sum / (last - first + 1) } # sum --- return the average of the values in fields $first - $last -- cgit v1.2.3 From ec0a8d6c8ed3855b440aeb90b92088115212fb78 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 1 Feb 2015 21:48:46 +0200 Subject: More O'Reilly fixes. --- awklib/eg/lib/quicksort.awk | 5 +- doc/ChangeLog | 2 + doc/gawk.info | 688 ++++++++++++++++++++++---------------------- doc/gawk.texi | 67 ++--- doc/gawktexi.in | 67 ++--- 5 files changed, 420 insertions(+), 409 deletions(-) diff --git a/awklib/eg/lib/quicksort.awk b/awklib/eg/lib/quicksort.awk index 3ba2d6e3..e0ed8bc7 100644 --- a/awklib/eg/lib/quicksort.awk +++ b/awklib/eg/lib/quicksort.awk @@ -4,8 +4,9 @@ # Arnold Robbins, arnold@skeeve.com, Public Domain # January 2009 -# quicksort --- C.A.R. Hoare's quick sort algorithm. See Wikipedia -# or almost any algorithms or computer science text + +# quicksort --- C.A.R. Hoare's quicksort algorithm. See Wikipedia +# or almost any algorithms or computer science text. # # Adapted from K&R-II, page 110 diff --git a/doc/ChangeLog b/doc/ChangeLog index 904cd326..865e3431 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -4,6 +4,8 @@ have the same name as a function is now --posix. Restore indirectcall example. + More O'Reilly fixes. + 2015-01-30 Arnold D. Robbins * gawktexi.in: Document POSIX requirement that function parameters diff --git a/doc/gawk.info b/doc/gawk.info index ca168110..0e8bcb52 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -13317,13 +13317,14 @@ This program produces the following output when run: -| lshift(0x99, 2) = 0x264 = 0000001001100100 -| rshift(0x99, 2) = 0x26 = 00100110 - The `bits2str()' function turns a binary number into a string. The -number `1' represents a binary value where the rightmost bit is set to -1. Using this mask, the function repeatedly checks the rightmost bit. -ANDing the mask with the value indicates whether the rightmost bit is 1 -or not. If so, a `"1"' is concatenated onto the front of the string. -Otherwise, a `"0"' is added. The value is then shifted right by one -bit and the loop continues until there are no more 1 bits. + The `bits2str()' function turns a binary number into a string. +Initializing `mask' to one creates a binary value where the rightmost +bit is set to one. Using this mask, the function repeatedly checks the +rightmost bit. ANDing the mask with the value indicates whether the +rightmost bit is one or not. If so, a `"1"' is concatenated onto the +front of the string. Otherwise, a `"0"' is added. The value is then +shifted right by one bit and the loop continues until there are no more +one bits. If the initial value is zero, it returns a simple `"0"'. Otherwise, at the end, it pads the value with zeros to represent multiples of @@ -13352,7 +13353,7 @@ traverses every element of an array of arrays (*note Arrays of Arrays::). `isarray(X)' - Return a true value if X is an array. Otherwise return false. + Return a true value if X is an array. Otherwise, return false. `isarray()' is meant for use in two circumstances. The first is when traversing a multidimensional array: you can test if an element is @@ -13399,8 +13400,8 @@ brackets ([ ]): Return the plural form used for NUMBER of the translation of STRING1 and STRING2 in text domain DOMAIN for locale category CATEGORY. STRING1 is the English singular variant of a message, - and STRING2 the English plural variant of the same message. The - default value for DOMAIN is the current value of `TEXTDOMAIN'. + and STRING2 is the English plural variant of the same message. + The default value for DOMAIN is the current value of `TEXTDOMAIN'. The default value for CATEGORY is `"LC_MESSAGES"'.  @@ -13429,7 +13430,7 @@ File: gawk.info, Node: Definition Syntax, Next: Function Example, Up: User-de 9.2.1 Function Definition Syntax -------------------------------- - It's entirely fair to say that the `awk' syntax for local variable + It's entirely fair to say that the awk syntax for local variable definitions is appallingly awful. -- Brian Kernighan Definitions of functions can appear anywhere between the rules of an @@ -13472,9 +13473,9 @@ have a parameter with the same name as the function itself. Local variables act like the empty string if referenced where a string value is required, and like zero if referenced where a numeric -value is required. This is the same as regular variables that have -never been assigned a value. (There is more to understand about local -variables; *note Dynamic Typing::.) +value is required. This is the same as the behavior of regular +variables that have never been assigned a value. (There is more to +understand about local variables; *note Dynamic Typing::.) The BODY-OF-FUNCTION consists of `awk' statements. It is the most important part of the definition, because it says what the function @@ -13503,9 +13504,9 @@ function is supposed to be used. variable values hide, or "shadow", any variables of the same names used in the rest of the program. The shadowed variables are not accessible in the function definition, because there is no way to name them while -their names have been taken away for the local variables. All other -variables used in the `awk' program can be referenced or set normally -in the function's body. +their names have been taken away for the arguments and local variables. +All other variables used in the `awk' program can be referenced or set +normally in the function's body. The arguments and local variables last only as long as the function body is executing. Once the body finishes, you can once again access @@ -13558,7 +13559,7 @@ takes a number and prints it in a specific format: printf "%6.3g\n", num } -To illustrate, here is an `awk' rule that uses our `myprint' function: +To illustrate, here is an `awk' rule that uses our `myprint()' function: $3 > 0 { myprint($3) } @@ -13587,13 +13588,13 @@ extra whitespace signifies the start of the local variable list): When working with arrays, it is often necessary to delete all the elements in an array and start over with a new list of elements (*note Delete::). Instead of having to repeat this loop everywhere that you -need to clear out an array, your program can just call `delarray'. +need to clear out an array, your program can just call `delarray()'. (This guarantees portability. The use of `delete ARRAY' to delete the contents of an entire array is a relatively recent(1) addition to the POSIX standard.) The following is an example of a recursive function. It takes a -string as an input parameter and returns the string in backwards order. +string as an input parameter and returns the string in reverse order. Recursive functions must always have a test that stops the recursion. In this case, the recursion terminates when the input string is already empty: @@ -13684,14 +13685,14 @@ File: gawk.info, Node: Variable Scope, Next: Pass By Value/Reference, Prev: C 9.2.3.2 Controlling Variable Scope .................................. -Unlike many languages, there is no way to make a variable local to a +Unlike in many languages, there is no way to make a variable local to a `{' ... `}' block in `awk', but you can make a variable local to a function. It is good practice to do so whenever a variable is needed only in that function. To make a variable local to a function, simply declare the variable as an argument after the actual function arguments (*note Definition -Syntax::). Look at the following example where variable `i' is a +Syntax::). Look at the following example, where variable `i' is a global variable used by both functions `foo()' and `bar()': function bar() @@ -13727,7 +13728,7 @@ variable instance: foo's i=3 top's i=3 - If you want `i' to be local to both `foo()' and `bar()' do as + If you want `i' to be local to both `foo()' and `bar()', do as follows (the extra space before `i' is a coding convention to indicate that `i' is a local variable, not an argument): @@ -13809,7 +13810,7 @@ explicitly whether the arguments are passed "by value" or "by reference". Instead, the passing convention is determined at runtime when the -function is called according to the following rule: if the argument is +function is called, according to the following rule: if the argument is an array variable, then it is passed by reference. Otherwise, the argument is passed by value. @@ -13867,7 +13868,7 @@ function _are_ visible outside that function. stores `"two"' in the second element of `a'. Some `awk' implementations allow you to call a function that has not -been defined. They only report a problem at runtime when the program +been defined. They only report a problem at runtime, when the program actually tries to call the function. For example: BEGIN { @@ -13912,15 +13913,15 @@ undefined, and therefore, unpredictable. In practice, though, all versions of `awk' simply return the null string, which acts like zero if used in a numeric context. - A `return' statement with no value expression is assumed at the end -of every function definition. So if control reaches the end of the -function body, then technically, the function returns an unpredictable + A `return' statement without an EXPRESSION is assumed at the end of +every function definition. So, if control reaches the end of the +function body, then technically the function returns an unpredictable value. In practice, it returns the empty string. `awk' does _not_ warn you if you use the return value of such a function. Sometimes, you want to write a function for what it does, not for what it returns. Such a function corresponds to a `void' function in -C, C++ or Java, or to a `procedure' in Ada. Thus, it may be +C, C++, or Java, or to a `procedure' in Ada. Thus, it may be appropriate to not return any value; simply bear in mind that you should not be using the return value of such a function. @@ -14026,13 +14027,13 @@ you can specify the name of the function to call as a string variable, and then call the function. Let's look at an example. Suppose you have a file with your test scores for the classes you -are taking. The first field is the class name. The following fields -are the functions to call to process the data, up to a "marker" field +are taking, and you wish to get the sum and the average of your test +scores. The first field is the class name. The following fields are +the functions to call to process the data, up to a "marker" field `data:'. Following the marker, to the end of the record, are the various numeric test scores. - Here is the initial file; you wish to get the sum and the average of -your test scores: + Here is the initial file: Biology_101 sum average data: 87.0 92.4 78.5 94.9 Chemistry_305 sum average data: 75.2 98.3 94.7 88.2 @@ -14090,9 +14091,9 @@ using indirect function calls: return ret } - These two functions expect to work on fields; thus the parameters + These two functions expect to work on fields; thus, the parameters `first' and `last' indicate where in the fields to start and end. -Otherwise they perform the expected computations and are not unusual: +Otherwise, they perform the expected computations and are not unusual: # For each record, print the class name and the requested statistics { @@ -14145,18 +14146,19 @@ to force it to be a string value.) may think at first. The C and C++ languages provide "function pointers," which are a mechanism for calling a function chosen at runtime. One of the most well-known uses of this ability is the C -`qsort()' function, which sorts an array using the famous "quick sort" +`qsort()' function, which sorts an array using the famous "quicksort" algorithm (see the Wikipedia article -(http://en.wikipedia.org/wiki/Quick_sort) for more information). To -use this function, you supply a pointer to a comparison function. This +(http://en.wikipedia.org/wiki/Quicksort) for more information). To use +this function, you supply a pointer to a comparison function. This mechanism allows you to sort arbitrary data in an arbitrary fashion. We can do something similar using `gawk', like this: # quicksort.awk --- Quicksort algorithm, with user-supplied # comparison function - # quicksort --- C.A.R. Hoare's quick sort algorithm. See Wikipedia - # or almost any algorithms or computer science text + + # quicksort --- C.A.R. Hoare's quicksort algorithm. See Wikipedia + # or almost any algorithms or computer science text. function quicksort(data, left, right, less_than, i, last) { @@ -14185,7 +14187,7 @@ mechanism allows you to sort arbitrary data in an arbitrary fashion. The `quicksort()' function receives the `data' array, the starting and ending indices to sort (`left' and `right'), and the name of a function that performs a "less than" comparison. It then implements -the quick sort algorithm. +the quicksort algorithm. To make use of the sorting function, we return to our previous example. The first thing to do is write some comparison functions: @@ -34723,307 +34725,307 @@ Ref: Time Functions-Footnote-5557272 Ref: Time Functions-Footnote-6557499 Node: Bitwise Functions557765 Ref: table-bitwise-ops558327 -Ref: Bitwise Functions-Footnote-1562639 -Node: Type Functions562811 -Node: I18N Functions563962 -Node: User-defined565607 -Node: Definition Syntax566412 -Ref: Definition Syntax-Footnote-1572044 -Node: Function Example572115 -Ref: Function Example-Footnote-1575034 -Node: Function Caveats575056 -Node: Calling A Function575574 -Node: Variable Scope576532 -Node: Pass By Value/Reference579520 -Node: Return Statement583015 -Node: Dynamic Typing585996 -Node: Indirect Calls586925 -Ref: Indirect Calls-Footnote-1598227 -Node: Functions Summary598355 -Node: Library Functions601057 -Ref: Library Functions-Footnote-1604666 -Ref: Library Functions-Footnote-2604809 -Node: Library Names604980 -Ref: Library Names-Footnote-1608434 -Ref: Library Names-Footnote-2608657 -Node: General Functions608743 -Node: Strtonum Function609846 -Node: Assert Function612868 -Node: Round Function616192 -Node: Cliff Random Function617733 -Node: Ordinal Functions618749 -Ref: Ordinal Functions-Footnote-1621812 -Ref: Ordinal Functions-Footnote-2622064 -Node: Join Function622275 -Ref: Join Function-Footnote-1624044 -Node: Getlocaltime Function624244 -Node: Readfile Function627988 -Node: Shell Quoting629958 -Node: Data File Management631359 -Node: Filetrans Function631991 -Node: Rewind Function636047 -Node: File Checking637434 -Ref: File Checking-Footnote-1638766 -Node: Empty Files638967 -Node: Ignoring Assigns640946 -Node: Getopt Function642497 -Ref: Getopt Function-Footnote-1653959 -Node: Passwd Functions654159 -Ref: Passwd Functions-Footnote-1662996 -Node: Group Functions663084 -Ref: Group Functions-Footnote-1670978 -Node: Walking Arrays671191 -Node: Library Functions Summary672794 -Node: Library Exercises674195 -Node: Sample Programs675475 -Node: Running Examples676245 -Node: Clones676973 -Node: Cut Program678197 -Node: Egrep Program687916 -Ref: Egrep Program-Footnote-1695414 -Node: Id Program695524 -Node: Split Program699169 -Ref: Split Program-Footnote-1702617 -Node: Tee Program702745 -Node: Uniq Program705534 -Node: Wc Program712953 -Ref: Wc Program-Footnote-1717203 -Node: Miscellaneous Programs717297 -Node: Dupword Program718510 -Node: Alarm Program720541 -Node: Translate Program725345 -Ref: Translate Program-Footnote-1729910 -Node: Labels Program730180 -Ref: Labels Program-Footnote-1733531 -Node: Word Sorting733615 -Node: History Sorting737686 -Node: Extract Program739522 -Node: Simple Sed747047 -Node: Igawk Program750115 -Ref: Igawk Program-Footnote-1764439 -Ref: Igawk Program-Footnote-2764640 -Ref: Igawk Program-Footnote-3764762 -Node: Anagram Program764877 -Node: Signature Program767934 -Node: Programs Summary769181 -Node: Programs Exercises770374 -Ref: Programs Exercises-Footnote-1774505 -Node: Advanced Features774596 -Node: Nondecimal Data776544 -Node: Array Sorting778134 -Node: Controlling Array Traversal778831 -Ref: Controlling Array Traversal-Footnote-1787164 -Node: Array Sorting Functions787282 -Ref: Array Sorting Functions-Footnote-1791171 -Node: Two-way I/O791367 -Ref: Two-way I/O-Footnote-1796312 -Ref: Two-way I/O-Footnote-2796498 -Node: TCP/IP Networking796580 -Node: Profiling799453 -Node: Advanced Features Summary807000 -Node: Internationalization808933 -Node: I18N and L10N810413 -Node: Explaining gettext811099 -Ref: Explaining gettext-Footnote-1816124 -Ref: Explaining gettext-Footnote-2816308 -Node: Programmer i18n816473 -Ref: Programmer i18n-Footnote-1821339 -Node: Translator i18n821388 -Node: String Extraction822182 -Ref: String Extraction-Footnote-1823313 -Node: Printf Ordering823399 -Ref: Printf Ordering-Footnote-1826185 -Node: I18N Portability826249 -Ref: I18N Portability-Footnote-1828704 -Node: I18N Example828767 -Ref: I18N Example-Footnote-1831570 -Node: Gawk I18N831642 -Node: I18N Summary832280 -Node: Debugger833619 -Node: Debugging834641 -Node: Debugging Concepts835082 -Node: Debugging Terms836935 -Node: Awk Debugging839507 -Node: Sample Debugging Session840401 -Node: Debugger Invocation840921 -Node: Finding The Bug842305 -Node: List of Debugger Commands848780 -Node: Breakpoint Control850113 -Node: Debugger Execution Control853809 -Node: Viewing And Changing Data857173 -Node: Execution Stack860551 -Node: Debugger Info862188 -Node: Miscellaneous Debugger Commands866205 -Node: Readline Support871234 -Node: Limitations872126 -Node: Debugging Summary874240 -Node: Arbitrary Precision Arithmetic875408 -Node: Computer Arithmetic876824 -Ref: table-numeric-ranges880422 -Ref: Computer Arithmetic-Footnote-1881281 -Node: Math Definitions881338 -Ref: table-ieee-formats884626 -Ref: Math Definitions-Footnote-1885230 -Node: MPFR features885335 -Node: FP Math Caution887006 -Ref: FP Math Caution-Footnote-1888056 -Node: Inexactness of computations888425 -Node: Inexact representation889384 -Node: Comparing FP Values890741 -Node: Errors accumulate891823 -Node: Getting Accuracy893256 -Node: Try To Round895918 -Node: Setting precision896817 -Ref: table-predefined-precision-strings897501 -Node: Setting the rounding mode899290 -Ref: table-gawk-rounding-modes899654 -Ref: Setting the rounding mode-Footnote-1903109 -Node: Arbitrary Precision Integers903288 -Ref: Arbitrary Precision Integers-Footnote-1906274 -Node: POSIX Floating Point Problems906423 -Ref: POSIX Floating Point Problems-Footnote-1910296 -Node: Floating point summary910334 -Node: Dynamic Extensions912528 -Node: Extension Intro914080 -Node: Plugin License915346 -Node: Extension Mechanism Outline916143 -Ref: figure-load-extension916571 -Ref: figure-register-new-function918051 -Ref: figure-call-new-function919055 -Node: Extension API Description921041 -Node: Extension API Functions Introduction922491 -Node: General Data Types927315 -Ref: General Data Types-Footnote-1933054 -Node: Memory Allocation Functions933353 -Ref: Memory Allocation Functions-Footnote-1936192 -Node: Constructor Functions936288 -Node: Registration Functions938022 -Node: Extension Functions938707 -Node: Exit Callback Functions941004 -Node: Extension Version String942252 -Node: Input Parsers942917 -Node: Output Wrappers952796 -Node: Two-way processors957311 -Node: Printing Messages959515 -Ref: Printing Messages-Footnote-1960591 -Node: Updating `ERRNO'960743 -Node: Requesting Values961483 -Ref: table-value-types-returned962211 -Node: Accessing Parameters963168 -Node: Symbol Table Access964399 -Node: Symbol table by name964913 -Node: Symbol table by cookie966894 -Ref: Symbol table by cookie-Footnote-1971038 -Node: Cached values971101 -Ref: Cached values-Footnote-1974600 -Node: Array Manipulation974691 -Ref: Array Manipulation-Footnote-1975789 -Node: Array Data Types975826 -Ref: Array Data Types-Footnote-1978481 -Node: Array Functions978573 -Node: Flattening Arrays982427 -Node: Creating Arrays989319 -Node: Extension API Variables994090 -Node: Extension Versioning994726 -Node: Extension API Informational Variables996627 -Node: Extension API Boilerplate997692 -Node: Finding Extensions1001501 -Node: Extension Example1002061 -Node: Internal File Description1002833 -Node: Internal File Ops1006900 -Ref: Internal File Ops-Footnote-11018570 -Node: Using Internal File Ops1018710 -Ref: Using Internal File Ops-Footnote-11021093 -Node: Extension Samples1021366 -Node: Extension Sample File Functions1022892 -Node: Extension Sample Fnmatch1030530 -Node: Extension Sample Fork1032021 -Node: Extension Sample Inplace1033236 -Node: Extension Sample Ord1034911 -Node: Extension Sample Readdir1035747 -Ref: table-readdir-file-types1036623 -Node: Extension Sample Revout1037434 -Node: Extension Sample Rev2way1038024 -Node: Extension Sample Read write array1038764 -Node: Extension Sample Readfile1040704 -Node: Extension Sample Time1041799 -Node: Extension Sample API Tests1043148 -Node: gawkextlib1043639 -Node: Extension summary1046297 -Node: Extension Exercises1049986 -Node: Language History1050708 -Node: V7/SVR3.11052364 -Node: SVR41054545 -Node: POSIX1055990 -Node: BTL1057379 -Node: POSIX/GNU1058113 -Node: Feature History1063677 -Node: Common Extensions1076775 -Node: Ranges and Locales1078099 -Ref: Ranges and Locales-Footnote-11082717 -Ref: Ranges and Locales-Footnote-21082744 -Ref: Ranges and Locales-Footnote-31082978 -Node: Contributors1083199 -Node: History summary1088740 -Node: Installation1090110 -Node: Gawk Distribution1091056 -Node: Getting1091540 -Node: Extracting1092363 -Node: Distribution contents1093998 -Node: Unix Installation1099715 -Node: Quick Installation1100332 -Node: Additional Configuration Options1102756 -Node: Configuration Philosophy1104494 -Node: Non-Unix Installation1106863 -Node: PC Installation1107321 -Node: PC Binary Installation1108640 -Node: PC Compiling1110488 -Ref: PC Compiling-Footnote-11113509 -Node: PC Testing1113618 -Node: PC Using1114794 -Node: Cygwin1118909 -Node: MSYS1119732 -Node: VMS Installation1120232 -Node: VMS Compilation1121024 -Ref: VMS Compilation-Footnote-11122246 -Node: VMS Dynamic Extensions1122304 -Node: VMS Installation Details1123988 -Node: VMS Running1126240 -Node: VMS GNV1129076 -Node: VMS Old Gawk1129810 -Node: Bugs1130280 -Node: Other Versions1134163 -Node: Installation summary1140587 -Node: Notes1141643 -Node: Compatibility Mode1142508 -Node: Additions1143290 -Node: Accessing The Source1144215 -Node: Adding Code1145650 -Node: New Ports1151807 -Node: Derived Files1156289 -Ref: Derived Files-Footnote-11161764 -Ref: Derived Files-Footnote-21161798 -Ref: Derived Files-Footnote-31162394 -Node: Future Extensions1162508 -Node: Implementation Limitations1163114 -Node: Extension Design1164362 -Node: Old Extension Problems1165516 -Ref: Old Extension Problems-Footnote-11167033 -Node: Extension New Mechanism Goals1167090 -Ref: Extension New Mechanism Goals-Footnote-11170450 -Node: Extension Other Design Decisions1170639 -Node: Extension Future Growth1172747 -Node: Old Extension Mechanism1173583 -Node: Notes summary1175345 -Node: Basic Concepts1176531 -Node: Basic High Level1177212 -Ref: figure-general-flow1177484 -Ref: figure-process-flow1178083 -Ref: Basic High Level-Footnote-11181312 -Node: Basic Data Typing1181497 -Node: Glossary1184825 -Node: Copying1216754 -Node: GNU Free Documentation License1254310 -Node: Index1279446 +Ref: Bitwise Functions-Footnote-1562655 +Node: Type Functions562827 +Node: I18N Functions563979 +Node: User-defined565626 +Node: Definition Syntax566431 +Ref: Definition Syntax-Footnote-1572090 +Node: Function Example572161 +Ref: Function Example-Footnote-1575082 +Node: Function Caveats575104 +Node: Calling A Function575622 +Node: Variable Scope576580 +Node: Pass By Value/Reference579573 +Node: Return Statement583070 +Node: Dynamic Typing586049 +Node: Indirect Calls586978 +Ref: Indirect Calls-Footnote-1598284 +Node: Functions Summary598412 +Node: Library Functions601114 +Ref: Library Functions-Footnote-1604723 +Ref: Library Functions-Footnote-2604866 +Node: Library Names605037 +Ref: Library Names-Footnote-1608491 +Ref: Library Names-Footnote-2608714 +Node: General Functions608800 +Node: Strtonum Function609903 +Node: Assert Function612925 +Node: Round Function616249 +Node: Cliff Random Function617790 +Node: Ordinal Functions618806 +Ref: Ordinal Functions-Footnote-1621869 +Ref: Ordinal Functions-Footnote-2622121 +Node: Join Function622332 +Ref: Join Function-Footnote-1624101 +Node: Getlocaltime Function624301 +Node: Readfile Function628045 +Node: Shell Quoting630015 +Node: Data File Management631416 +Node: Filetrans Function632048 +Node: Rewind Function636104 +Node: File Checking637491 +Ref: File Checking-Footnote-1638823 +Node: Empty Files639024 +Node: Ignoring Assigns641003 +Node: Getopt Function642554 +Ref: Getopt Function-Footnote-1654016 +Node: Passwd Functions654216 +Ref: Passwd Functions-Footnote-1663053 +Node: Group Functions663141 +Ref: Group Functions-Footnote-1671035 +Node: Walking Arrays671248 +Node: Library Functions Summary672851 +Node: Library Exercises674252 +Node: Sample Programs675532 +Node: Running Examples676302 +Node: Clones677030 +Node: Cut Program678254 +Node: Egrep Program687973 +Ref: Egrep Program-Footnote-1695471 +Node: Id Program695581 +Node: Split Program699226 +Ref: Split Program-Footnote-1702674 +Node: Tee Program702802 +Node: Uniq Program705591 +Node: Wc Program713010 +Ref: Wc Program-Footnote-1717260 +Node: Miscellaneous Programs717354 +Node: Dupword Program718567 +Node: Alarm Program720598 +Node: Translate Program725402 +Ref: Translate Program-Footnote-1729967 +Node: Labels Program730237 +Ref: Labels Program-Footnote-1733588 +Node: Word Sorting733672 +Node: History Sorting737743 +Node: Extract Program739579 +Node: Simple Sed747104 +Node: Igawk Program750172 +Ref: Igawk Program-Footnote-1764496 +Ref: Igawk Program-Footnote-2764697 +Ref: Igawk Program-Footnote-3764819 +Node: Anagram Program764934 +Node: Signature Program767991 +Node: Programs Summary769238 +Node: Programs Exercises770431 +Ref: Programs Exercises-Footnote-1774562 +Node: Advanced Features774653 +Node: Nondecimal Data776601 +Node: Array Sorting778191 +Node: Controlling Array Traversal778888 +Ref: Controlling Array Traversal-Footnote-1787221 +Node: Array Sorting Functions787339 +Ref: Array Sorting Functions-Footnote-1791228 +Node: Two-way I/O791424 +Ref: Two-way I/O-Footnote-1796369 +Ref: Two-way I/O-Footnote-2796555 +Node: TCP/IP Networking796637 +Node: Profiling799510 +Node: Advanced Features Summary807057 +Node: Internationalization808990 +Node: I18N and L10N810470 +Node: Explaining gettext811156 +Ref: Explaining gettext-Footnote-1816181 +Ref: Explaining gettext-Footnote-2816365 +Node: Programmer i18n816530 +Ref: Programmer i18n-Footnote-1821396 +Node: Translator i18n821445 +Node: String Extraction822239 +Ref: String Extraction-Footnote-1823370 +Node: Printf Ordering823456 +Ref: Printf Ordering-Footnote-1826242 +Node: I18N Portability826306 +Ref: I18N Portability-Footnote-1828761 +Node: I18N Example828824 +Ref: I18N Example-Footnote-1831627 +Node: Gawk I18N831699 +Node: I18N Summary832337 +Node: Debugger833676 +Node: Debugging834698 +Node: Debugging Concepts835139 +Node: Debugging Terms836992 +Node: Awk Debugging839564 +Node: Sample Debugging Session840458 +Node: Debugger Invocation840978 +Node: Finding The Bug842362 +Node: List of Debugger Commands848837 +Node: Breakpoint Control850170 +Node: Debugger Execution Control853866 +Node: Viewing And Changing Data857230 +Node: Execution Stack860608 +Node: Debugger Info862245 +Node: Miscellaneous Debugger Commands866262 +Node: Readline Support871291 +Node: Limitations872183 +Node: Debugging Summary874297 +Node: Arbitrary Precision Arithmetic875465 +Node: Computer Arithmetic876881 +Ref: table-numeric-ranges880479 +Ref: Computer Arithmetic-Footnote-1881338 +Node: Math Definitions881395 +Ref: table-ieee-formats884683 +Ref: Math Definitions-Footnote-1885287 +Node: MPFR features885392 +Node: FP Math Caution887063 +Ref: FP Math Caution-Footnote-1888113 +Node: Inexactness of computations888482 +Node: Inexact representation889441 +Node: Comparing FP Values890798 +Node: Errors accumulate891880 +Node: Getting Accuracy893313 +Node: Try To Round895975 +Node: Setting precision896874 +Ref: table-predefined-precision-strings897558 +Node: Setting the rounding mode899347 +Ref: table-gawk-rounding-modes899711 +Ref: Setting the rounding mode-Footnote-1903166 +Node: Arbitrary Precision Integers903345 +Ref: Arbitrary Precision Integers-Footnote-1906331 +Node: POSIX Floating Point Problems906480 +Ref: POSIX Floating Point Problems-Footnote-1910353 +Node: Floating point summary910391 +Node: Dynamic Extensions912585 +Node: Extension Intro914137 +Node: Plugin License915403 +Node: Extension Mechanism Outline916200 +Ref: figure-load-extension916628 +Ref: figure-register-new-function918108 +Ref: figure-call-new-function919112 +Node: Extension API Description921098 +Node: Extension API Functions Introduction922548 +Node: General Data Types927372 +Ref: General Data Types-Footnote-1933111 +Node: Memory Allocation Functions933410 +Ref: Memory Allocation Functions-Footnote-1936249 +Node: Constructor Functions936345 +Node: Registration Functions938079 +Node: Extension Functions938764 +Node: Exit Callback Functions941061 +Node: Extension Version String942309 +Node: Input Parsers942974 +Node: Output Wrappers952853 +Node: Two-way processors957368 +Node: Printing Messages959572 +Ref: Printing Messages-Footnote-1960648 +Node: Updating `ERRNO'960800 +Node: Requesting Values961540 +Ref: table-value-types-returned962268 +Node: Accessing Parameters963225 +Node: Symbol Table Access964456 +Node: Symbol table by name964970 +Node: Symbol table by cookie966951 +Ref: Symbol table by cookie-Footnote-1971095 +Node: Cached values971158 +Ref: Cached values-Footnote-1974657 +Node: Array Manipulation974748 +Ref: Array Manipulation-Footnote-1975846 +Node: Array Data Types975883 +Ref: Array Data Types-Footnote-1978538 +Node: Array Functions978630 +Node: Flattening Arrays982484 +Node: Creating Arrays989376 +Node: Extension API Variables994147 +Node: Extension Versioning994783 +Node: Extension API Informational Variables996684 +Node: Extension API Boilerplate997749 +Node: Finding Extensions1001558 +Node: Extension Example1002118 +Node: Internal File Description1002890 +Node: Internal File Ops1006957 +Ref: Internal File Ops-Footnote-11018627 +Node: Using Internal File Ops1018767 +Ref: Using Internal File Ops-Footnote-11021150 +Node: Extension Samples1021423 +Node: Extension Sample File Functions1022949 +Node: Extension Sample Fnmatch1030587 +Node: Extension Sample Fork1032078 +Node: Extension Sample Inplace1033293 +Node: Extension Sample Ord1034968 +Node: Extension Sample Readdir1035804 +Ref: table-readdir-file-types1036680 +Node: Extension Sample Revout1037491 +Node: Extension Sample Rev2way1038081 +Node: Extension Sample Read write array1038821 +Node: Extension Sample Readfile1040761 +Node: Extension Sample Time1041856 +Node: Extension Sample API Tests1043205 +Node: gawkextlib1043696 +Node: Extension summary1046354 +Node: Extension Exercises1050043 +Node: Language History1050765 +Node: V7/SVR3.11052421 +Node: SVR41054602 +Node: POSIX1056047 +Node: BTL1057436 +Node: POSIX/GNU1058170 +Node: Feature History1063734 +Node: Common Extensions1076832 +Node: Ranges and Locales1078156 +Ref: Ranges and Locales-Footnote-11082774 +Ref: Ranges and Locales-Footnote-21082801 +Ref: Ranges and Locales-Footnote-31083035 +Node: Contributors1083256 +Node: History summary1088797 +Node: Installation1090167 +Node: Gawk Distribution1091113 +Node: Getting1091597 +Node: Extracting1092420 +Node: Distribution contents1094055 +Node: Unix Installation1099772 +Node: Quick Installation1100389 +Node: Additional Configuration Options1102813 +Node: Configuration Philosophy1104551 +Node: Non-Unix Installation1106920 +Node: PC Installation1107378 +Node: PC Binary Installation1108697 +Node: PC Compiling1110545 +Ref: PC Compiling-Footnote-11113566 +Node: PC Testing1113675 +Node: PC Using1114851 +Node: Cygwin1118966 +Node: MSYS1119789 +Node: VMS Installation1120289 +Node: VMS Compilation1121081 +Ref: VMS Compilation-Footnote-11122303 +Node: VMS Dynamic Extensions1122361 +Node: VMS Installation Details1124045 +Node: VMS Running1126297 +Node: VMS GNV1129133 +Node: VMS Old Gawk1129867 +Node: Bugs1130337 +Node: Other Versions1134220 +Node: Installation summary1140644 +Node: Notes1141700 +Node: Compatibility Mode1142565 +Node: Additions1143347 +Node: Accessing The Source1144272 +Node: Adding Code1145707 +Node: New Ports1151864 +Node: Derived Files1156346 +Ref: Derived Files-Footnote-11161821 +Ref: Derived Files-Footnote-21161855 +Ref: Derived Files-Footnote-31162451 +Node: Future Extensions1162565 +Node: Implementation Limitations1163171 +Node: Extension Design1164419 +Node: Old Extension Problems1165573 +Ref: Old Extension Problems-Footnote-11167090 +Node: Extension New Mechanism Goals1167147 +Ref: Extension New Mechanism Goals-Footnote-11170507 +Node: Extension Other Design Decisions1170696 +Node: Extension Future Growth1172804 +Node: Old Extension Mechanism1173640 +Node: Notes summary1175402 +Node: Basic Concepts1176588 +Node: Basic High Level1177269 +Ref: figure-general-flow1177541 +Ref: figure-process-flow1178140 +Ref: Basic High Level-Footnote-11181369 +Node: Basic Data Typing1181554 +Node: Glossary1184882 +Node: Copying1216811 +Node: GNU Free Documentation License1254367 +Node: Index1279503  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 7e8d93de..6b37e74b 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -19172,15 +19172,16 @@ $ @kbd{gawk -f testbits.awk} @cindex converting, numbers to strings @cindex number as string of bits The @code{bits2str()} function turns a binary number into a string. -The number @code{1} represents a binary value where the rightmost bit -is set to 1. Using this mask, +Initializing @code{mask} to one creates +a binary value where the rightmost bit +is set to one. Using this mask, the function repeatedly checks the rightmost bit. ANDing the mask with the value indicates whether the -rightmost bit is 1 or not. If so, a @code{"1"} is concatenated onto the front +rightmost bit is one or not. If so, a @code{"1"} is concatenated onto the front of the string. Otherwise, a @code{"0"} is added. The value is then shifted right by one bit and the loop continues -until there are no more 1 bits. +until there are no more one bits. If the initial value is zero, it returns a simple @code{"0"}. Otherwise, at the end, it pads the value with zeros to represent multiples @@ -19204,7 +19205,7 @@ that traverses every element of an array of arrays @cindexgawkfunc{isarray} @cindex scalar or array @item isarray(@var{x}) -Return a true value if @var{x} is an array. Otherwise return false. +Return a true value if @var{x} is an array. Otherwise, return false. @end table @code{isarray()} is meant for use in two circumstances. The first is when @@ -19265,7 +19266,7 @@ The default value for @var{category} is @code{"LC_MESSAGES"}. Return the plural form used for @var{number} of the translation of @var{string1} and @var{string2} in text domain @var{domain} for locale category @var{category}. @var{string1} is the -English singular variant of a message, and @var{string2} the English plural +English singular variant of a message, and @var{string2} is the English plural 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"}. @@ -19294,7 +19295,7 @@ them (i.e., to tell @command{awk} what they should do). @subsection Function Definition Syntax @quotation -@i{It's entirely fair to say that the @command{awk} syntax for local +@i{It's entirely fair to say that the awk syntax for local variable definitions is appallingly awful.} @author Brian Kernighan @end quotation @@ -19352,7 +19353,7 @@ it also enforces the second restriction. Local variables act like the empty string if referenced where a string value is required, and like zero if referenced where a numeric value -is required. This is the same as regular variables that have never been +is required. This is the same as the behavior of regular variables that have never been assigned a value. (There is more to understand about local variables; @pxref{Dynamic Typing}.) @@ -19386,7 +19387,7 @@ During execution of the function body, the arguments and local variable values hide, or @dfn{shadow}, any variables of the same names used in the rest of the program. The shadowed variables are not accessible in the function definition, because there is no way to name them while their -names have been taken away for the local variables. All other variables +names have been taken away for the arguments and local variables. All other variables used in the @command{awk} program can be referenced or set normally in the function's body. @@ -19453,7 +19454,7 @@ function myprint(num) @end example @noindent -To illustrate, here is an @command{awk} rule that uses our @code{myprint} +To illustrate, here is an @command{awk} rule that uses our @code{myprint()} function: @example @@ -19494,13 +19495,13 @@ in an array and start over with a new list of elements (@pxref{Delete}). Instead of having to repeat this loop everywhere that you need to clear out -an array, your program can just call @code{delarray}. +an array, your program can just call @code{delarray()}. (This guarantees portability. The use of @samp{delete @var{array}} to delete the contents of an entire array is a relatively recent@footnote{Late in 2012.} addition to the POSIX standard.) The following is an example of a recursive function. It takes a string -as an input parameter and returns the string in backwards order. +as an input parameter and returns the string in reverse order. Recursive functions must always have a test that stops the recursion. In this case, the recursion terminates when the input string is already empty: @@ -19597,7 +19598,7 @@ an error. @cindex local variables, in a function @cindex variables, local to a function -Unlike many languages, +Unlike in many languages, there is no way to make a variable local to a @code{@{} @dots{} @code{@}} block in @command{awk}, but you can make a variable local to a function. It is good practice to do so whenever a variable is needed only in that @@ -19606,7 +19607,7 @@ function. To make a variable local to a function, simply declare the variable as an argument after the actual function arguments (@pxref{Definition Syntax}). -Look at the following example where variable +Look at the following example, where variable @code{i} is a global variable used by both functions @code{foo()} and @code{bar()}: @@ -19647,7 +19648,7 @@ foo's i=3 top's i=3 @end example -If you want @code{i} to be local to both @code{foo()} and @code{bar()} do as +If you want @code{i} to be local to both @code{foo()} and @code{bar()}, do as follows (the extra space before @code{i} is a coding convention to indicate that @code{i} is a local variable, not an argument): @@ -19735,7 +19736,7 @@ declare explicitly whether the arguments are passed @dfn{by value} or @dfn{by reference}. Instead, the passing convention is determined at runtime when -the function is called according to the following rule: +the function is called, according to the following rule: if the argument is an array variable, then it is passed by reference. Otherwise, the argument is passed by value. @@ -19812,7 +19813,7 @@ prints @samp{a[1] = 1, a[2] = two, a[3] = 3}, because @cindex undefined functions @cindex functions, undefined Some @command{awk} implementations allow you to call a function that -has not been defined. They only report a problem at runtime when the +has not been defined. They only report a problem at runtime, when the program actually tries to call the function. For example: @example @@ -19871,15 +19872,15 @@ makes the returned value undefined, and therefore, unpredictable. In practice, though, all versions of @command{awk} simply return the null string, which acts like zero if used in a numeric context. -A @code{return} statement with no value expression is assumed at the end of -every function definition. So if control reaches the end of the function -body, then technically, the function returns an unpredictable value. +A @code{return} statement without an @var{expression} is assumed at the end of +every function definition. So, if control reaches the end of the function +body, then technically the function returns an unpredictable value. In practice, it returns the empty string. @command{awk} does @emph{not} warn you if you use the return value of such a function. Sometimes, you want to write a function for what it does, not for what it returns. Such a function corresponds to a @code{void} function -in C, C++ or Java, or to a @code{procedure} in Ada. Thus, it may be appropriate to not +in C, C++, or Java, or to a @code{procedure} in Ada. Thus, it may be appropriate to not return any value; simply bear in mind that you should not be using the return value of such a function. @@ -19998,13 +19999,15 @@ function calls, you can specify the name of the function to call as a string variable, and then call the function. Let's look at an example. Suppose you have a file with your test scores for the classes you -are taking. The first field is the class name. The following fields +are taking, and +you wish to get the sum and the average of +your test scores. +The first field is the class name. The following fields are the functions to call to process the data, up to a ``marker'' field @samp{data:}. Following the marker, to the end of the record, are the various numeric test scores. -Here is the initial file; you wish to get the sum and the average of -your test scores: +Here is the initial file: @example @c file eg/data/class_data1 @@ -20087,9 +20090,9 @@ function sum(first, last, ret, i) @c endfile @end example -These two functions expect to work on fields; thus the parameters +These two functions expect to work on fields; thus, the parameters @code{first} and @code{last} indicate where in the fields to start and end. -Otherwise they perform the expected computations and are not unusual: +Otherwise, they perform the expected computations and are not unusual: @example @c file eg/prog/indirectcall.awk @@ -20148,8 +20151,8 @@ The ability to use indirect function calls is more powerful than you may think at first. The C and C++ languages provide ``function pointers,'' which are a mechanism for calling a function chosen at runtime. One of the most well-known uses of this ability is the C @code{qsort()} function, which sorts -an array using the famous ``quick sort'' algorithm -(see @uref{http://en.wikipedia.org/wiki/Quick_sort, the Wikipedia article} +an array using the famous ``quicksort'' algorithm +(see @uref{http://en.wikipedia.org/wiki/Quicksort, the Wikipedia article} for more information). To use this function, you supply a pointer to a comparison function. This mechanism allows you to sort arbitrary data in an arbitrary fashion. @@ -20168,11 +20171,11 @@ We can do something similar using @command{gawk}, like this: # January 2009 @c endfile - @end ignore @c file eg/lib/quicksort.awk -# quicksort --- C.A.R. Hoare's quick sort algorithm. See Wikipedia -# or almost any algorithms or computer science text + +# quicksort --- C.A.R. Hoare's quicksort algorithm. See Wikipedia +# or almost any algorithms or computer science text. @c endfile @ignore @c file eg/lib/quicksort.awk @@ -20210,7 +20213,7 @@ function quicksort_swap(data, i, j, temp) The @code{quicksort()} function receives the @code{data} array, the starting and ending indices to sort (@code{left} and @code{right}), and the name of a function that -performs a ``less than'' comparison. It then implements the quick sort algorithm. +performs a ``less than'' comparison. It then implements the quicksort algorithm. To make use of the sorting function, we return to our previous example. The first thing to do is write some comparison functions: diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 125e8401..cc021c97 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -18293,15 +18293,16 @@ $ @kbd{gawk -f testbits.awk} @cindex converting, numbers to strings @cindex number as string of bits The @code{bits2str()} function turns a binary number into a string. -The number @code{1} represents a binary value where the rightmost bit -is set to 1. Using this mask, +Initializing @code{mask} to one creates +a binary value where the rightmost bit +is set to one. Using this mask, the function repeatedly checks the rightmost bit. ANDing the mask with the value indicates whether the -rightmost bit is 1 or not. If so, a @code{"1"} is concatenated onto the front +rightmost bit is one or not. If so, a @code{"1"} is concatenated onto the front of the string. Otherwise, a @code{"0"} is added. The value is then shifted right by one bit and the loop continues -until there are no more 1 bits. +until there are no more one bits. If the initial value is zero, it returns a simple @code{"0"}. Otherwise, at the end, it pads the value with zeros to represent multiples @@ -18325,7 +18326,7 @@ that traverses every element of an array of arrays @cindexgawkfunc{isarray} @cindex scalar or array @item isarray(@var{x}) -Return a true value if @var{x} is an array. Otherwise return false. +Return a true value if @var{x} is an array. Otherwise, return false. @end table @code{isarray()} is meant for use in two circumstances. The first is when @@ -18386,7 +18387,7 @@ The default value for @var{category} is @code{"LC_MESSAGES"}. Return the plural form used for @var{number} of the translation of @var{string1} and @var{string2} in text domain @var{domain} for locale category @var{category}. @var{string1} is the -English singular variant of a message, and @var{string2} the English plural +English singular variant of a message, and @var{string2} is the English plural 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"}. @@ -18415,7 +18416,7 @@ them (i.e., to tell @command{awk} what they should do). @subsection Function Definition Syntax @quotation -@i{It's entirely fair to say that the @command{awk} syntax for local +@i{It's entirely fair to say that the awk syntax for local variable definitions is appallingly awful.} @author Brian Kernighan @end quotation @@ -18473,7 +18474,7 @@ it also enforces the second restriction. Local variables act like the empty string if referenced where a string value is required, and like zero if referenced where a numeric value -is required. This is the same as regular variables that have never been +is required. This is the same as the behavior of regular variables that have never been assigned a value. (There is more to understand about local variables; @pxref{Dynamic Typing}.) @@ -18507,7 +18508,7 @@ During execution of the function body, the arguments and local variable values hide, or @dfn{shadow}, any variables of the same names used in the rest of the program. The shadowed variables are not accessible in the function definition, because there is no way to name them while their -names have been taken away for the local variables. All other variables +names have been taken away for the arguments and local variables. All other variables used in the @command{awk} program can be referenced or set normally in the function's body. @@ -18574,7 +18575,7 @@ function myprint(num) @end example @noindent -To illustrate, here is an @command{awk} rule that uses our @code{myprint} +To illustrate, here is an @command{awk} rule that uses our @code{myprint()} function: @example @@ -18615,13 +18616,13 @@ in an array and start over with a new list of elements (@pxref{Delete}). Instead of having to repeat this loop everywhere that you need to clear out -an array, your program can just call @code{delarray}. +an array, your program can just call @code{delarray()}. (This guarantees portability. The use of @samp{delete @var{array}} to delete the contents of an entire array is a relatively recent@footnote{Late in 2012.} addition to the POSIX standard.) The following is an example of a recursive function. It takes a string -as an input parameter and returns the string in backwards order. +as an input parameter and returns the string in reverse order. Recursive functions must always have a test that stops the recursion. In this case, the recursion terminates when the input string is already empty: @@ -18718,7 +18719,7 @@ an error. @cindex local variables, in a function @cindex variables, local to a function -Unlike many languages, +Unlike in many languages, there is no way to make a variable local to a @code{@{} @dots{} @code{@}} block in @command{awk}, but you can make a variable local to a function. It is good practice to do so whenever a variable is needed only in that @@ -18727,7 +18728,7 @@ function. To make a variable local to a function, simply declare the variable as an argument after the actual function arguments (@pxref{Definition Syntax}). -Look at the following example where variable +Look at the following example, where variable @code{i} is a global variable used by both functions @code{foo()} and @code{bar()}: @@ -18768,7 +18769,7 @@ foo's i=3 top's i=3 @end example -If you want @code{i} to be local to both @code{foo()} and @code{bar()} do as +If you want @code{i} to be local to both @code{foo()} and @code{bar()}, do as follows (the extra space before @code{i} is a coding convention to indicate that @code{i} is a local variable, not an argument): @@ -18856,7 +18857,7 @@ declare explicitly whether the arguments are passed @dfn{by value} or @dfn{by reference}. Instead, the passing convention is determined at runtime when -the function is called according to the following rule: +the function is called, according to the following rule: if the argument is an array variable, then it is passed by reference. Otherwise, the argument is passed by value. @@ -18933,7 +18934,7 @@ prints @samp{a[1] = 1, a[2] = two, a[3] = 3}, because @cindex undefined functions @cindex functions, undefined Some @command{awk} implementations allow you to call a function that -has not been defined. They only report a problem at runtime when the +has not been defined. They only report a problem at runtime, when the program actually tries to call the function. For example: @example @@ -18992,15 +18993,15 @@ makes the returned value undefined, and therefore, unpredictable. In practice, though, all versions of @command{awk} simply return the null string, which acts like zero if used in a numeric context. -A @code{return} statement with no value expression is assumed at the end of -every function definition. So if control reaches the end of the function -body, then technically, the function returns an unpredictable value. +A @code{return} statement without an @var{expression} is assumed at the end of +every function definition. So, if control reaches the end of the function +body, then technically the function returns an unpredictable value. In practice, it returns the empty string. @command{awk} does @emph{not} warn you if you use the return value of such a function. Sometimes, you want to write a function for what it does, not for what it returns. Such a function corresponds to a @code{void} function -in C, C++ or Java, or to a @code{procedure} in Ada. Thus, it may be appropriate to not +in C, C++, or Java, or to a @code{procedure} in Ada. Thus, it may be appropriate to not return any value; simply bear in mind that you should not be using the return value of such a function. @@ -19119,13 +19120,15 @@ function calls, you can specify the name of the function to call as a string variable, and then call the function. Let's look at an example. Suppose you have a file with your test scores for the classes you -are taking. The first field is the class name. The following fields +are taking, and +you wish to get the sum and the average of +your test scores. +The first field is the class name. The following fields are the functions to call to process the data, up to a ``marker'' field @samp{data:}. Following the marker, to the end of the record, are the various numeric test scores. -Here is the initial file; you wish to get the sum and the average of -your test scores: +Here is the initial file: @example @c file eg/data/class_data1 @@ -19208,9 +19211,9 @@ function sum(first, last, ret, i) @c endfile @end example -These two functions expect to work on fields; thus the parameters +These two functions expect to work on fields; thus, the parameters @code{first} and @code{last} indicate where in the fields to start and end. -Otherwise they perform the expected computations and are not unusual: +Otherwise, they perform the expected computations and are not unusual: @example @c file eg/prog/indirectcall.awk @@ -19269,8 +19272,8 @@ The ability to use indirect function calls is more powerful than you may think at first. The C and C++ languages provide ``function pointers,'' which are a mechanism for calling a function chosen at runtime. One of the most well-known uses of this ability is the C @code{qsort()} function, which sorts -an array using the famous ``quick sort'' algorithm -(see @uref{http://en.wikipedia.org/wiki/Quick_sort, the Wikipedia article} +an array using the famous ``quicksort'' algorithm +(see @uref{http://en.wikipedia.org/wiki/Quicksort, the Wikipedia article} for more information). To use this function, you supply a pointer to a comparison function. This mechanism allows you to sort arbitrary data in an arbitrary fashion. @@ -19289,11 +19292,11 @@ We can do something similar using @command{gawk}, like this: # January 2009 @c endfile - @end ignore @c file eg/lib/quicksort.awk -# quicksort --- C.A.R. Hoare's quick sort algorithm. See Wikipedia -# or almost any algorithms or computer science text + +# quicksort --- C.A.R. Hoare's quicksort algorithm. See Wikipedia +# or almost any algorithms or computer science text. @c endfile @ignore @c file eg/lib/quicksort.awk @@ -19331,7 +19334,7 @@ function quicksort_swap(data, i, j, temp) The @code{quicksort()} function receives the @code{data} array, the starting and ending indices to sort (@code{left} and @code{right}), and the name of a function that -performs a ``less than'' comparison. It then implements the quick sort algorithm. +performs a ``less than'' comparison. It then implements the quicksort algorithm. To make use of the sorting function, we return to our previous example. The first thing to do is write some comparison functions: -- cgit v1.2.3 From 6a4160dab42fb7e952b0b91a99eedd4bb6bb1d67 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 2 Feb 2015 06:13:07 +0200 Subject: More O'Reilly edits. --- awklib/eg/lib/assert.awk | 2 +- doc/ChangeLog | 4 + doc/gawk.info | 718 ++++++++++++++++++++++++----------------------- doc/gawk.texi | 94 ++++--- doc/gawktexi.in | 91 +++--- 5 files changed, 459 insertions(+), 450 deletions(-) diff --git a/awklib/eg/lib/assert.awk b/awklib/eg/lib/assert.awk index 75fd8853..c8e13490 100644 --- a/awklib/eg/lib/assert.awk +++ b/awklib/eg/lib/assert.awk @@ -1,4 +1,4 @@ -# assert --- assert that a condition is true. Otherwise exit. +# assert --- assert that a condition is true. Otherwise, exit. # # Arnold Robbins, arnold@skeeve.com, Public Domain diff --git a/doc/ChangeLog b/doc/ChangeLog index 865e3431..b4eb2c70 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-02 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-02-01 Arnold D. Robbins * gawktexi.in: POSIX requirement that function parameters cannot diff --git a/doc/gawk.info b/doc/gawk.info index 0e8bcb52..bebdf4bf 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -14427,7 +14427,7 @@ File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Functi *note User-defined::, describes how to write your own `awk' functions. Writing functions is important, because it allows you to encapsulate algorithms and program tasks in a single place. It simplifies -programming, making program development more manageable, and making +programming, making program development more manageable and making programs more readable. In their seminal 1976 book, `Software Tools',(1) Brian Kernighan and @@ -14532,7 +14532,7 @@ often use variable names like these for their own purposes. The example programs shown in this major node all start the names of their private variables with an underscore (`_'). Users generally don't use leading underscores in their variable names, so this -convention immediately decreases the chances that the variable name +convention immediately decreases the chances that the variable names will be accidentally shared with the user's program. In addition, several of the library functions use a prefix that helps @@ -14545,7 +14545,7 @@ for private function names.(1) As a final note on variable naming, if a function makes global variables available for use by a main program, it is a good convention -to start that variable's name with a capital letter--for example, +to start those variables' names with a capital letter--for example, `getopt()''s `Opterr' and `Optind' variables (*note Getopt Function::). The leading capital letter indicates that it is global, while the fact that the variable name is not all capital letters indicates that the @@ -14553,7 +14553,7 @@ variable is not one of `awk''s predefined variables, such as `FS'. It is also important that _all_ variables in library functions that do not need to save state are, in fact, declared local.(2) If this is -not done, the variable could accidentally be used in the user's +not done, the variables could accidentally be used in the user's program, leading to bugs that are very difficult to track down: function lib_func(x, y, l1, l2) @@ -14731,7 +14731,7 @@ for use in printing the diagnostic message. This is not possible in `awk', so this `assert()' function also requires a string version of the condition that is being tested. Following is the function: - # assert --- assert that a condition is true. Otherwise exit. + # assert --- assert that a condition is true. Otherwise, exit. function assert(condition, string) { @@ -14752,7 +14752,7 @@ the condition that is being tested. Following is the function: false, it prints a message to standard error, using the `string' parameter to describe the failed condition. It then sets the variable `_assert_exit' to one and executes the `exit' statement. The `exit' -statement jumps to the `END' rule. If the `END' rules finds +statement jumps to the `END' rule. If the `END' rule finds `_assert_exit' to be true, it exits immediately. The purpose of the test in the `END' rule is to keep any other `END' @@ -14967,9 +14967,9 @@ the strings in an array into one long string. The following function, `join()', accomplishes this task. It is used later in several of the application programs (*note Sample Programs::). - Good function design is important; this function needs to be general -but it should also have a reasonable default behavior. It is called -with an array as well as the beginning and ending indices of the + Good function design is important; this function needs to be +general, but it should also have a reasonable default behavior. It is +called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array indices are numeric--a reasonable assumption, as the array was likely created with `split()' (*note String Functions::): @@ -15088,7 +15088,7 @@ optional timestamp value to use instead of the current time.  File: gawk.info, Node: Readfile Function, Next: Shell Quoting, Prev: Getlocaltime Function, Up: General Functions -10.2.8 Reading a Whole File At Once +10.2.8 Reading a Whole File at Once ----------------------------------- Often, it is convenient to have the entire contents of a file available @@ -15130,13 +15130,13 @@ reads the entire contents of the named file in one shot: It works by setting `RS' to `^$', a regular expression that will never match if the file has contents. `gawk' reads data from the file -into `tmp' attempting to match `RS'. The match fails after each read, +into `tmp', attempting to match `RS'. The match fails after each read, but fails quickly, such that `gawk' fills `tmp' with the entire contents of the file. (*Note Records::, for information on `RT' and `RS'.) In the case that `file' is empty, the return value is the null -string. Thus calling code may use something like: +string. Thus, calling code may use something like: contents = readfile("/some/path") if (length(contents) == 0) @@ -15226,8 +15226,9 @@ File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Up: Data Fi The `BEGIN' and `END' rules are each executed exactly once, at the beginning and end of your `awk' program, respectively (*note BEGIN/END::). We (the `gawk' authors) once had a user who mistakenly -thought that the `BEGIN' rule is executed at the beginning of each data -file and the `END' rule is executed at the end of each data file. +thought that the `BEGIN' rules were executed at the beginning of each +data file and the `END' rules were executed at the end of each data +file. When informed that this was not the case, the user requested that we add new special patterns to `gawk', named `BEGIN_FILE' and `END_FILE', @@ -15261,7 +15262,7 @@ does so _portably_; this works with any implementation of `awk': This file must be loaded before the user's "main" program, so that the rule it supplies is executed first. - This rule relies on `awk''s `FILENAME' variable that automatically + This rule relies on `awk''s `FILENAME' variable, which automatically changes for each new data file. The current file name is saved in a private variable, `_oldfilename'. If `FILENAME' does not equal `_oldfilename', then a new data file is being processed and it is @@ -15276,7 +15277,7 @@ correctly even for the first data file. The program also supplies an `END' rule to do the final processing for the last file. Because this `END' rule comes before any `END' rules supplied in the "main" program, `endfile()' is called first. Once -again the value of multiple `BEGIN' and `END' rules should be clear. +again, the value of multiple `BEGIN' and `END' rules should be clear. If the same data file occurs twice in a row on the command line, then `endfile()' and `beginfile()' are not executed at the end of the first @@ -15303,7 +15304,7 @@ how it simplifies writing the main program. You are probably wondering, if `beginfile()' and `endfile()' functions can do the job, why does `gawk' have `BEGINFILE' and -`ENDFILE' patterns (*note BEGINFILE/ENDFILE::)? +`ENDFILE' patterns? Good question. Normally, if `awk' cannot open a file, this causes an immediate fatal error. In this case, there is no way for a @@ -15311,7 +15312,8 @@ user-defined function to deal with the problem, as the mechanism for calling it relies on the file being open and at the first record. Thus, the main reason for `BEGINFILE' is to give you a "hook" to catch files that cannot be processed. `ENDFILE' exists for symmetry, and because -it provides an easy way to do per-file cleanup processing. +it provides an easy way to do per-file cleanup processing. For more +information, refer to *note BEGINFILE/ENDFILE::.  File: gawk.info, Node: Rewind Function, Next: File Checking, Prev: Filetrans Function, Up: Data File Management @@ -15319,15 +15321,14 @@ File: gawk.info, Node: Rewind Function, Next: File Checking, Prev: Filetrans 10.3.2 Rereading the Current File --------------------------------- -Another request for a new built-in function was for a `rewind()' -function that would make it possible to reread the current file. The -requesting user didn't want to have to use `getline' (*note Getline::) -inside a loop. +Another request for a new built-in function was for a function that +would make it possible to reread the current file. The requesting user +didn't want to have to use `getline' (*note Getline::) inside a loop. However, as long as you are not in the `END' rule, it is quite easy to arrange to immediately close the current input file and then start -over with it from the top. For lack of a better name, we'll call it -`rewind()': +over with it from the top. For lack of a better name, we'll call the +function `rewind()': # rewind.awk --- rewind the current file and start over @@ -15385,7 +15386,7 @@ longer in the list). See also *note ARGC and ARGV::. Because `awk' variable names only allow the English letters, the regular expression check purposely does not use character classes such -as `[:alpha:]' and `[:alnum:]' (*note Bracket Expressions::) +as `[:alpha:]' and `[:alnum:]' (*note Bracket Expressions::). ---------- Footnotes ---------- @@ -15396,14 +15397,14 @@ opened. However, the code here provides a portable solution.  File: gawk.info, Node: Empty Files, Next: Ignoring Assigns, Prev: File Checking, Up: Data File Management -10.3.4 Checking for Zero-length Files +10.3.4 Checking for Zero-Length Files ------------------------------------- All known `awk' implementations silently skip over zero-length files. This is a by-product of `awk''s implicit read-a-record-and-match-against-the-rules loop: when `awk' tries to -read a record from an empty file, it immediately receives an end of -file indication, closes the file, and proceeds on to the next +read a record from an empty file, it immediately receives an +end-of-file indication, closes the file, and proceeds on to the next command-line data file, _without_ executing any user-level `awk' program code. @@ -15453,7 +15454,7 @@ File: gawk.info, Node: Ignoring Assigns, Prev: Empty Files, Up: Data File Man Occasionally, you might not want `awk' to process command-line variable assignments (*note Assignment Options::). In particular, if you have a file name that contains an `=' character, `awk' treats the file name as -an assignment, and does not process it. +an assignment and does not process it. Some users have suggested an additional command-line option for `gawk' to disable command-line assignments. However, some simple @@ -15743,8 +15744,8 @@ which is in `ARGV[0]': } } - The rest of the `BEGIN' rule is a simple test program. Here is the -result of two sample runs of the test program: + The rest of the `BEGIN' rule is a simple test program. Here are the +results of two sample runs of the test program: $ awk -f getopt.awk -v _getopt_test=1 -- -a -cbARG bax -x -| c = , Optarg = <> @@ -15790,10 +15791,10 @@ File: gawk.info, Node: Passwd Functions, Next: Group Functions, Prev: Getopt ============================== The `PROCINFO' array (*note Built-in Variables::) provides access to -the current user's real and effective user and group ID numbers, and if -available, the user's supplementary group set. However, because these -are numbers, they do not provide very useful information to the average -user. There needs to be some way to find the user information +the current user's real and effective user and group ID numbers, and, +if available, the user's supplementary group set. However, because +these are numbers, they do not provide very useful information to the +average user. There needs to be some way to find the user information associated with the user and group ID numbers. This minor node presents a suite of functions for retrieving information from the user database. *Note Group Functions::, for a similar suite that retrieves @@ -15804,7 +15805,7 @@ kept. Instead, it provides the `' header file and several C language subroutines for obtaining user information. The primary function is `getpwent()', for "get password entry." The "password" comes from the original user database file, `/etc/passwd', which stores -user information, along with the encrypted passwords (hence the name). +user information along with the encrypted passwords (hence the name). Although an `awk' program could simply read `/etc/passwd' directly, this file may not contain complete information about the system's set @@ -15852,7 +15853,7 @@ Encrypted password User-ID The user's numeric user ID number. (On some systems, it's a C - `long', and not an `int'. Thus we cast it to `long' for all + `long', and not an `int'. Thus, we cast it to `long' for all cases.) Group-ID @@ -15951,8 +15952,8 @@ or on some other `awk' implementation. `PROCINFO["FS"]', is similar. The main part of the function uses a loop to read database lines, -split the line into fields, and then store the line into each array as -necessary. When the loop is done, `_pw_init()' cleans up by closing +split the lines into fields, and then store the lines into each array +as necessary. When the loop is done, `_pw_init()' cleans up by closing the pipeline, setting `_pw_inited' to one, and restoring `FS' (and `FIELDWIDTHS' or `FPAT' if necessary), `RS', and `$0'. The use of `_pw_count' is explained shortly. @@ -16080,7 +16081,7 @@ Group Password Group ID Number The group's numeric group ID number; the association of name to number must be unique within the file. (On some systems it's a C - `long', and not an `int'. Thus we cast it to `long' for all + `long', and not an `int'. Thus, we cast it to `long' for all cases.) Group Member List @@ -16170,29 +16171,30 @@ to ensure that the database is scanned no more than once. The `_gr_init()' function first saves `FS', `RS', and `$0', and then sets `FS' and `RS' to the correct values for scanning the group information. It also takes care to note whether `FIELDWIDTHS' or `FPAT' is being -used, and to restore the appropriate field splitting mechanism. +used, and to restore the appropriate field-splitting mechanism. - The group information is stored is several associative arrays. The + The group information is stored in several associative arrays. The arrays are indexed by group name (`_gr_byname'), by group ID number (`_gr_bygid'), and by position in the database (`_gr_bycount'). There is an additional array indexed by username (`_gr_groupsbyuser'), which is a space-separated list of groups to which each user belongs. - Unlike the user database, it is possible to have multiple records in -the database for the same group. This is common when a group has a + Unlike in the user database, it is possible to have multiple records +in the database for the same group. This is common when a group has a large number of members. A pair of such entries might look like the following: - tvpeople:*:101:johny,jay,arsenio + tvpeople:*:101:johnny,jay,arsenio tvpeople:*:101:david,conan,tom,joan For this reason, `_gr_init()' looks to see if a group name or group -ID number is already seen. If it is, the usernames are simply +ID number is already seen. If so, the usernames are simply concatenated onto the previous list of users.(1) Finally, `_gr_init()' closes the pipeline to `grcat', restores `FS' -(and `FIELDWIDTHS' or `FPAT' if necessary), `RS', and `$0', initializes -`_gr_count' to zero (it is used later), and makes `_gr_inited' nonzero. +(and `FIELDWIDTHS' or `FPAT', if necessary), `RS', and `$0', +initializes `_gr_count' to zero (it is used later), and makes +`_gr_inited' nonzero. The `getgrnam()' function takes a group name as its argument, and if that group exists, it is returned. Otherwise, it relies on the array @@ -16255,9 +16257,9 @@ very simple, relying on `awk''s associative arrays to do work. ---------- Footnotes ---------- - (1) There is actually a subtle problem with the code just presented. -Suppose that the first time there were no names. This code adds the -names with a leading comma. It also doesn't check that there is a `$4'. + (1) There is a subtle problem with the code just presented. Suppose +that the first time there were no names. This code adds the names with +a leading comma. It also doesn't check that there is a `$4'.  File: gawk.info, Node: Walking Arrays, Next: Library Functions Summary, Prev: Group Functions, Up: Library Functions @@ -16266,11 +16268,11 @@ File: gawk.info, Node: Walking Arrays, Next: Library Functions Summary, Prev: ================================ *note Arrays of Arrays::, described how `gawk' provides arrays of -arrays. In particular, any element of an array may be either a scalar, +arrays. In particular, any element of an array may be either a scalar or another array. The `isarray()' function (*note Type Functions::) lets you distinguish an array from a scalar. The following function, -`walk_array()', recursively traverses an array, printing each element's -indices and value. You call it with the array and a string +`walk_array()', recursively traverses an array, printing the element +indices and values. You call it with the array and a string representing the name of the array: function walk_array(arr, name, i) @@ -16327,24 +16329,24 @@ File: gawk.info, Node: Library Functions Summary, Next: Library Exercises, Pr * The functions presented here fit into the following categories: General problems - Number-to-string conversion, assertions, rounding, random - number generation, converting characters to numbers, joining - strings, getting easily usable time-of-day information, and - reading a whole file in one shot. + Number-to-string conversion, testing assertions, rounding, + random number generation, converting characters to numbers, + joining strings, getting easily usable time-of-day + information, and reading a whole file in one shot Managing data files Noting data file boundaries, rereading the current file, checking for readable files, checking for zero-length files, - and treating assignments as file names. + and treating assignments as file names Processing command-line options - An `awk' version of the standard C `getopt()' function. + An `awk' version of the standard C `getopt()' function Reading the user and group databases - Two sets of routines that parallel the C library versions. + Two sets of routines that parallel the C library versions Traversing arrays of arrays - A simple function to traverse an array of arrays to any depth. + A simple function to traverse an array of arrays to any depth  @@ -31970,7 +31972,7 @@ Index * BEGINFILE pattern: BEGINFILE/ENDFILE. (line 6) * BEGINFILE pattern, Boolean patterns and: Expression Patterns. (line 69) -* beginfile() user-defined function: Filetrans Function. (line 61) +* beginfile() user-defined function: Filetrans Function. (line 62) * Bentley, Jon: Glossary. (line 207) * Benzinger, Michael: Contributors. (line 97) * Berry, Karl <1>: Ranges and Locales. (line 74) @@ -32589,9 +32591,9 @@ Index * END pattern, print statement and: I/O And BEGIN/END. (line 16) * ENDFILE pattern: BEGINFILE/ENDFILE. (line 6) * ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 69) -* endfile() user-defined function: Filetrans Function. (line 61) -* endgrent() function (C library): Group Functions. (line 211) -* endgrent() user-defined function: Group Functions. (line 214) +* endfile() user-defined function: Filetrans Function. (line 62) +* endgrent() function (C library): Group Functions. (line 212) +* endgrent() user-defined function: Group Functions. (line 215) * endpwent() function (C library): Passwd Functions. (line 207) * endpwent() user-defined function: Passwd Functions. (line 210) * English, Steve: Advanced Features. (line 6) @@ -33019,12 +33021,12 @@ Index * getaddrinfo() function (C library): TCP/IP Networking. (line 38) * getgrent() function (C library): Group Functions. (line 6) * getgrent() user-defined function: Group Functions. (line 6) -* getgrgid() function (C library): Group Functions. (line 182) -* getgrgid() user-defined function: Group Functions. (line 185) -* getgrnam() function (C library): Group Functions. (line 171) -* getgrnam() user-defined function: Group Functions. (line 176) -* getgruser() function (C library): Group Functions. (line 191) -* getgruser() function, user-defined: Group Functions. (line 194) +* getgrgid() function (C library): Group Functions. (line 183) +* getgrgid() user-defined function: Group Functions. (line 186) +* getgrnam() function (C library): Group Functions. (line 172) +* getgrnam() user-defined function: Group Functions. (line 177) +* getgruser() function (C library): Group Functions. (line 192) +* getgruser() function, user-defined: Group Functions. (line 195) * getline command: Reading Files. (line 20) * getline command, _gr_init() user-defined function: Group Functions. (line 83) @@ -33895,7 +33897,7 @@ Index (line 11) * revtwoway extension: Extension Sample Rev2way. (line 12) -* rewind() user-defined function: Rewind Function. (line 16) +* rewind() user-defined function: Rewind Function. (line 15) * right angle bracket (>), > operator <1>: Precedence. (line 65) * right angle bracket (>), > operator: Comparison Operators. (line 11) @@ -34056,7 +34058,7 @@ Index * sidebar, Recipe for a Programming Language: History. (line 6) * sidebar, RS = "\0" Is Not Portable: gawk split records. (line 63) * sidebar, So Why Does gawk Have BEGINFILE and ENDFILE?: Filetrans Function. - (line 82) + (line 83) * sidebar, Syntactic Ambiguities Between /= and Regular Expressions: Assignment Ops. (line 146) * sidebar, Understanding #!: Executable Scripts. (line 31) @@ -34743,289 +34745,289 @@ Node: Indirect Calls586978 Ref: Indirect Calls-Footnote-1598284 Node: Functions Summary598412 Node: Library Functions601114 -Ref: Library Functions-Footnote-1604723 -Ref: Library Functions-Footnote-2604866 -Node: Library Names605037 -Ref: Library Names-Footnote-1608491 -Ref: Library Names-Footnote-2608714 -Node: General Functions608800 -Node: Strtonum Function609903 -Node: Assert Function612925 -Node: Round Function616249 -Node: Cliff Random Function617790 -Node: Ordinal Functions618806 -Ref: Ordinal Functions-Footnote-1621869 -Ref: Ordinal Functions-Footnote-2622121 -Node: Join Function622332 -Ref: Join Function-Footnote-1624101 -Node: Getlocaltime Function624301 -Node: Readfile Function628045 -Node: Shell Quoting630015 -Node: Data File Management631416 -Node: Filetrans Function632048 -Node: Rewind Function636104 -Node: File Checking637491 -Ref: File Checking-Footnote-1638823 -Node: Empty Files639024 -Node: Ignoring Assigns641003 -Node: Getopt Function642554 -Ref: Getopt Function-Footnote-1654016 -Node: Passwd Functions654216 -Ref: Passwd Functions-Footnote-1663053 -Node: Group Functions663141 -Ref: Group Functions-Footnote-1671035 -Node: Walking Arrays671248 -Node: Library Functions Summary672851 -Node: Library Exercises674252 -Node: Sample Programs675532 -Node: Running Examples676302 -Node: Clones677030 -Node: Cut Program678254 -Node: Egrep Program687973 -Ref: Egrep Program-Footnote-1695471 -Node: Id Program695581 -Node: Split Program699226 -Ref: Split Program-Footnote-1702674 -Node: Tee Program702802 -Node: Uniq Program705591 -Node: Wc Program713010 -Ref: Wc Program-Footnote-1717260 -Node: Miscellaneous Programs717354 -Node: Dupword Program718567 -Node: Alarm Program720598 -Node: Translate Program725402 -Ref: Translate Program-Footnote-1729967 -Node: Labels Program730237 -Ref: Labels Program-Footnote-1733588 -Node: Word Sorting733672 -Node: History Sorting737743 -Node: Extract Program739579 -Node: Simple Sed747104 -Node: Igawk Program750172 -Ref: Igawk Program-Footnote-1764496 -Ref: Igawk Program-Footnote-2764697 -Ref: Igawk Program-Footnote-3764819 -Node: Anagram Program764934 -Node: Signature Program767991 -Node: Programs Summary769238 -Node: Programs Exercises770431 -Ref: Programs Exercises-Footnote-1774562 -Node: Advanced Features774653 -Node: Nondecimal Data776601 -Node: Array Sorting778191 -Node: Controlling Array Traversal778888 -Ref: Controlling Array Traversal-Footnote-1787221 -Node: Array Sorting Functions787339 -Ref: Array Sorting Functions-Footnote-1791228 -Node: Two-way I/O791424 -Ref: Two-way I/O-Footnote-1796369 -Ref: Two-way I/O-Footnote-2796555 -Node: TCP/IP Networking796637 -Node: Profiling799510 -Node: Advanced Features Summary807057 -Node: Internationalization808990 -Node: I18N and L10N810470 -Node: Explaining gettext811156 -Ref: Explaining gettext-Footnote-1816181 -Ref: Explaining gettext-Footnote-2816365 -Node: Programmer i18n816530 -Ref: Programmer i18n-Footnote-1821396 -Node: Translator i18n821445 -Node: String Extraction822239 -Ref: String Extraction-Footnote-1823370 -Node: Printf Ordering823456 -Ref: Printf Ordering-Footnote-1826242 -Node: I18N Portability826306 -Ref: I18N Portability-Footnote-1828761 -Node: I18N Example828824 -Ref: I18N Example-Footnote-1831627 -Node: Gawk I18N831699 -Node: I18N Summary832337 -Node: Debugger833676 -Node: Debugging834698 -Node: Debugging Concepts835139 -Node: Debugging Terms836992 -Node: Awk Debugging839564 -Node: Sample Debugging Session840458 -Node: Debugger Invocation840978 -Node: Finding The Bug842362 -Node: List of Debugger Commands848837 -Node: Breakpoint Control850170 -Node: Debugger Execution Control853866 -Node: Viewing And Changing Data857230 -Node: Execution Stack860608 -Node: Debugger Info862245 -Node: Miscellaneous Debugger Commands866262 -Node: Readline Support871291 -Node: Limitations872183 -Node: Debugging Summary874297 -Node: Arbitrary Precision Arithmetic875465 -Node: Computer Arithmetic876881 -Ref: table-numeric-ranges880479 -Ref: Computer Arithmetic-Footnote-1881338 -Node: Math Definitions881395 -Ref: table-ieee-formats884683 -Ref: Math Definitions-Footnote-1885287 -Node: MPFR features885392 -Node: FP Math Caution887063 -Ref: FP Math Caution-Footnote-1888113 -Node: Inexactness of computations888482 -Node: Inexact representation889441 -Node: Comparing FP Values890798 -Node: Errors accumulate891880 -Node: Getting Accuracy893313 -Node: Try To Round895975 -Node: Setting precision896874 -Ref: table-predefined-precision-strings897558 -Node: Setting the rounding mode899347 -Ref: table-gawk-rounding-modes899711 -Ref: Setting the rounding mode-Footnote-1903166 -Node: Arbitrary Precision Integers903345 -Ref: Arbitrary Precision Integers-Footnote-1906331 -Node: POSIX Floating Point Problems906480 -Ref: POSIX Floating Point Problems-Footnote-1910353 -Node: Floating point summary910391 -Node: Dynamic Extensions912585 -Node: Extension Intro914137 -Node: Plugin License915403 -Node: Extension Mechanism Outline916200 -Ref: figure-load-extension916628 -Ref: figure-register-new-function918108 -Ref: figure-call-new-function919112 -Node: Extension API Description921098 -Node: Extension API Functions Introduction922548 -Node: General Data Types927372 -Ref: General Data Types-Footnote-1933111 -Node: Memory Allocation Functions933410 -Ref: Memory Allocation Functions-Footnote-1936249 -Node: Constructor Functions936345 -Node: Registration Functions938079 -Node: Extension Functions938764 -Node: Exit Callback Functions941061 -Node: Extension Version String942309 -Node: Input Parsers942974 -Node: Output Wrappers952853 -Node: Two-way processors957368 -Node: Printing Messages959572 -Ref: Printing Messages-Footnote-1960648 -Node: Updating `ERRNO'960800 -Node: Requesting Values961540 -Ref: table-value-types-returned962268 -Node: Accessing Parameters963225 -Node: Symbol Table Access964456 -Node: Symbol table by name964970 -Node: Symbol table by cookie966951 -Ref: Symbol table by cookie-Footnote-1971095 -Node: Cached values971158 -Ref: Cached values-Footnote-1974657 -Node: Array Manipulation974748 -Ref: Array Manipulation-Footnote-1975846 -Node: Array Data Types975883 -Ref: Array Data Types-Footnote-1978538 -Node: Array Functions978630 -Node: Flattening Arrays982484 -Node: Creating Arrays989376 -Node: Extension API Variables994147 -Node: Extension Versioning994783 -Node: Extension API Informational Variables996684 -Node: Extension API Boilerplate997749 -Node: Finding Extensions1001558 -Node: Extension Example1002118 -Node: Internal File Description1002890 -Node: Internal File Ops1006957 -Ref: Internal File Ops-Footnote-11018627 -Node: Using Internal File Ops1018767 -Ref: Using Internal File Ops-Footnote-11021150 -Node: Extension Samples1021423 -Node: Extension Sample File Functions1022949 -Node: Extension Sample Fnmatch1030587 -Node: Extension Sample Fork1032078 -Node: Extension Sample Inplace1033293 -Node: Extension Sample Ord1034968 -Node: Extension Sample Readdir1035804 -Ref: table-readdir-file-types1036680 -Node: Extension Sample Revout1037491 -Node: Extension Sample Rev2way1038081 -Node: Extension Sample Read write array1038821 -Node: Extension Sample Readfile1040761 -Node: Extension Sample Time1041856 -Node: Extension Sample API Tests1043205 -Node: gawkextlib1043696 -Node: Extension summary1046354 -Node: Extension Exercises1050043 -Node: Language History1050765 -Node: V7/SVR3.11052421 -Node: SVR41054602 -Node: POSIX1056047 -Node: BTL1057436 -Node: POSIX/GNU1058170 -Node: Feature History1063734 -Node: Common Extensions1076832 -Node: Ranges and Locales1078156 -Ref: Ranges and Locales-Footnote-11082774 -Ref: Ranges and Locales-Footnote-21082801 -Ref: Ranges and Locales-Footnote-31083035 -Node: Contributors1083256 -Node: History summary1088797 -Node: Installation1090167 -Node: Gawk Distribution1091113 -Node: Getting1091597 -Node: Extracting1092420 -Node: Distribution contents1094055 -Node: Unix Installation1099772 -Node: Quick Installation1100389 -Node: Additional Configuration Options1102813 -Node: Configuration Philosophy1104551 -Node: Non-Unix Installation1106920 -Node: PC Installation1107378 -Node: PC Binary Installation1108697 -Node: PC Compiling1110545 -Ref: PC Compiling-Footnote-11113566 -Node: PC Testing1113675 -Node: PC Using1114851 -Node: Cygwin1118966 -Node: MSYS1119789 -Node: VMS Installation1120289 -Node: VMS Compilation1121081 -Ref: VMS Compilation-Footnote-11122303 -Node: VMS Dynamic Extensions1122361 -Node: VMS Installation Details1124045 -Node: VMS Running1126297 -Node: VMS GNV1129133 -Node: VMS Old Gawk1129867 -Node: Bugs1130337 -Node: Other Versions1134220 -Node: Installation summary1140644 -Node: Notes1141700 -Node: Compatibility Mode1142565 -Node: Additions1143347 -Node: Accessing The Source1144272 -Node: Adding Code1145707 -Node: New Ports1151864 -Node: Derived Files1156346 -Ref: Derived Files-Footnote-11161821 -Ref: Derived Files-Footnote-21161855 -Ref: Derived Files-Footnote-31162451 -Node: Future Extensions1162565 -Node: Implementation Limitations1163171 -Node: Extension Design1164419 -Node: Old Extension Problems1165573 -Ref: Old Extension Problems-Footnote-11167090 -Node: Extension New Mechanism Goals1167147 -Ref: Extension New Mechanism Goals-Footnote-11170507 -Node: Extension Other Design Decisions1170696 -Node: Extension Future Growth1172804 -Node: Old Extension Mechanism1173640 -Node: Notes summary1175402 -Node: Basic Concepts1176588 -Node: Basic High Level1177269 -Ref: figure-general-flow1177541 -Ref: figure-process-flow1178140 -Ref: Basic High Level-Footnote-11181369 -Node: Basic Data Typing1181554 -Node: Glossary1184882 -Node: Copying1216811 -Node: GNU Free Documentation License1254367 -Node: Index1279503 +Ref: Library Functions-Footnote-1604722 +Ref: Library Functions-Footnote-2604865 +Node: Library Names605036 +Ref: Library Names-Footnote-1608494 +Ref: Library Names-Footnote-2608717 +Node: General Functions608803 +Node: Strtonum Function609906 +Node: Assert Function612928 +Node: Round Function616252 +Node: Cliff Random Function617793 +Node: Ordinal Functions618809 +Ref: Ordinal Functions-Footnote-1621872 +Ref: Ordinal Functions-Footnote-2622124 +Node: Join Function622335 +Ref: Join Function-Footnote-1624105 +Node: Getlocaltime Function624305 +Node: Readfile Function628049 +Node: Shell Quoting630021 +Node: Data File Management631422 +Node: Filetrans Function632054 +Node: Rewind Function636150 +Node: File Checking637536 +Ref: File Checking-Footnote-1638869 +Node: Empty Files639070 +Node: Ignoring Assigns641049 +Node: Getopt Function642599 +Ref: Getopt Function-Footnote-1654063 +Node: Passwd Functions654263 +Ref: Passwd Functions-Footnote-1663103 +Node: Group Functions663191 +Ref: Group Functions-Footnote-1671088 +Node: Walking Arrays671293 +Node: Library Functions Summary672893 +Node: Library Exercises674297 +Node: Sample Programs675577 +Node: Running Examples676347 +Node: Clones677075 +Node: Cut Program678299 +Node: Egrep Program688018 +Ref: Egrep Program-Footnote-1695516 +Node: Id Program695626 +Node: Split Program699271 +Ref: Split Program-Footnote-1702719 +Node: Tee Program702847 +Node: Uniq Program705636 +Node: Wc Program713055 +Ref: Wc Program-Footnote-1717305 +Node: Miscellaneous Programs717399 +Node: Dupword Program718612 +Node: Alarm Program720643 +Node: Translate Program725447 +Ref: Translate Program-Footnote-1730012 +Node: Labels Program730282 +Ref: Labels Program-Footnote-1733633 +Node: Word Sorting733717 +Node: History Sorting737788 +Node: Extract Program739624 +Node: Simple Sed747149 +Node: Igawk Program750217 +Ref: Igawk Program-Footnote-1764541 +Ref: Igawk Program-Footnote-2764742 +Ref: Igawk Program-Footnote-3764864 +Node: Anagram Program764979 +Node: Signature Program768036 +Node: Programs Summary769283 +Node: Programs Exercises770476 +Ref: Programs Exercises-Footnote-1774607 +Node: Advanced Features774698 +Node: Nondecimal Data776646 +Node: Array Sorting778236 +Node: Controlling Array Traversal778933 +Ref: Controlling Array Traversal-Footnote-1787266 +Node: Array Sorting Functions787384 +Ref: Array Sorting Functions-Footnote-1791273 +Node: Two-way I/O791469 +Ref: Two-way I/O-Footnote-1796414 +Ref: Two-way I/O-Footnote-2796600 +Node: TCP/IP Networking796682 +Node: Profiling799555 +Node: Advanced Features Summary807102 +Node: Internationalization809035 +Node: I18N and L10N810515 +Node: Explaining gettext811201 +Ref: Explaining gettext-Footnote-1816226 +Ref: Explaining gettext-Footnote-2816410 +Node: Programmer i18n816575 +Ref: Programmer i18n-Footnote-1821441 +Node: Translator i18n821490 +Node: String Extraction822284 +Ref: String Extraction-Footnote-1823415 +Node: Printf Ordering823501 +Ref: Printf Ordering-Footnote-1826287 +Node: I18N Portability826351 +Ref: I18N Portability-Footnote-1828806 +Node: I18N Example828869 +Ref: I18N Example-Footnote-1831672 +Node: Gawk I18N831744 +Node: I18N Summary832382 +Node: Debugger833721 +Node: Debugging834743 +Node: Debugging Concepts835184 +Node: Debugging Terms837037 +Node: Awk Debugging839609 +Node: Sample Debugging Session840503 +Node: Debugger Invocation841023 +Node: Finding The Bug842407 +Node: List of Debugger Commands848882 +Node: Breakpoint Control850215 +Node: Debugger Execution Control853911 +Node: Viewing And Changing Data857275 +Node: Execution Stack860653 +Node: Debugger Info862290 +Node: Miscellaneous Debugger Commands866307 +Node: Readline Support871336 +Node: Limitations872228 +Node: Debugging Summary874342 +Node: Arbitrary Precision Arithmetic875510 +Node: Computer Arithmetic876926 +Ref: table-numeric-ranges880524 +Ref: Computer Arithmetic-Footnote-1881383 +Node: Math Definitions881440 +Ref: table-ieee-formats884728 +Ref: Math Definitions-Footnote-1885332 +Node: MPFR features885437 +Node: FP Math Caution887108 +Ref: FP Math Caution-Footnote-1888158 +Node: Inexactness of computations888527 +Node: Inexact representation889486 +Node: Comparing FP Values890843 +Node: Errors accumulate891925 +Node: Getting Accuracy893358 +Node: Try To Round896020 +Node: Setting precision896919 +Ref: table-predefined-precision-strings897603 +Node: Setting the rounding mode899392 +Ref: table-gawk-rounding-modes899756 +Ref: Setting the rounding mode-Footnote-1903211 +Node: Arbitrary Precision Integers903390 +Ref: Arbitrary Precision Integers-Footnote-1906376 +Node: POSIX Floating Point Problems906525 +Ref: POSIX Floating Point Problems-Footnote-1910398 +Node: Floating point summary910436 +Node: Dynamic Extensions912630 +Node: Extension Intro914182 +Node: Plugin License915448 +Node: Extension Mechanism Outline916245 +Ref: figure-load-extension916673 +Ref: figure-register-new-function918153 +Ref: figure-call-new-function919157 +Node: Extension API Description921143 +Node: Extension API Functions Introduction922593 +Node: General Data Types927417 +Ref: General Data Types-Footnote-1933156 +Node: Memory Allocation Functions933455 +Ref: Memory Allocation Functions-Footnote-1936294 +Node: Constructor Functions936390 +Node: Registration Functions938124 +Node: Extension Functions938809 +Node: Exit Callback Functions941106 +Node: Extension Version String942354 +Node: Input Parsers943019 +Node: Output Wrappers952898 +Node: Two-way processors957413 +Node: Printing Messages959617 +Ref: Printing Messages-Footnote-1960693 +Node: Updating `ERRNO'960845 +Node: Requesting Values961585 +Ref: table-value-types-returned962313 +Node: Accessing Parameters963270 +Node: Symbol Table Access964501 +Node: Symbol table by name965015 +Node: Symbol table by cookie966996 +Ref: Symbol table by cookie-Footnote-1971140 +Node: Cached values971203 +Ref: Cached values-Footnote-1974702 +Node: Array Manipulation974793 +Ref: Array Manipulation-Footnote-1975891 +Node: Array Data Types975928 +Ref: Array Data Types-Footnote-1978583 +Node: Array Functions978675 +Node: Flattening Arrays982529 +Node: Creating Arrays989421 +Node: Extension API Variables994192 +Node: Extension Versioning994828 +Node: Extension API Informational Variables996729 +Node: Extension API Boilerplate997794 +Node: Finding Extensions1001603 +Node: Extension Example1002163 +Node: Internal File Description1002935 +Node: Internal File Ops1007002 +Ref: Internal File Ops-Footnote-11018672 +Node: Using Internal File Ops1018812 +Ref: Using Internal File Ops-Footnote-11021195 +Node: Extension Samples1021468 +Node: Extension Sample File Functions1022994 +Node: Extension Sample Fnmatch1030632 +Node: Extension Sample Fork1032123 +Node: Extension Sample Inplace1033338 +Node: Extension Sample Ord1035013 +Node: Extension Sample Readdir1035849 +Ref: table-readdir-file-types1036725 +Node: Extension Sample Revout1037536 +Node: Extension Sample Rev2way1038126 +Node: Extension Sample Read write array1038866 +Node: Extension Sample Readfile1040806 +Node: Extension Sample Time1041901 +Node: Extension Sample API Tests1043250 +Node: gawkextlib1043741 +Node: Extension summary1046399 +Node: Extension Exercises1050088 +Node: Language History1050810 +Node: V7/SVR3.11052466 +Node: SVR41054647 +Node: POSIX1056092 +Node: BTL1057481 +Node: POSIX/GNU1058215 +Node: Feature History1063779 +Node: Common Extensions1076877 +Node: Ranges and Locales1078201 +Ref: Ranges and Locales-Footnote-11082819 +Ref: Ranges and Locales-Footnote-21082846 +Ref: Ranges and Locales-Footnote-31083080 +Node: Contributors1083301 +Node: History summary1088842 +Node: Installation1090212 +Node: Gawk Distribution1091158 +Node: Getting1091642 +Node: Extracting1092465 +Node: Distribution contents1094100 +Node: Unix Installation1099817 +Node: Quick Installation1100434 +Node: Additional Configuration Options1102858 +Node: Configuration Philosophy1104596 +Node: Non-Unix Installation1106965 +Node: PC Installation1107423 +Node: PC Binary Installation1108742 +Node: PC Compiling1110590 +Ref: PC Compiling-Footnote-11113611 +Node: PC Testing1113720 +Node: PC Using1114896 +Node: Cygwin1119011 +Node: MSYS1119834 +Node: VMS Installation1120334 +Node: VMS Compilation1121126 +Ref: VMS Compilation-Footnote-11122348 +Node: VMS Dynamic Extensions1122406 +Node: VMS Installation Details1124090 +Node: VMS Running1126342 +Node: VMS GNV1129178 +Node: VMS Old Gawk1129912 +Node: Bugs1130382 +Node: Other Versions1134265 +Node: Installation summary1140689 +Node: Notes1141745 +Node: Compatibility Mode1142610 +Node: Additions1143392 +Node: Accessing The Source1144317 +Node: Adding Code1145752 +Node: New Ports1151909 +Node: Derived Files1156391 +Ref: Derived Files-Footnote-11161866 +Ref: Derived Files-Footnote-21161900 +Ref: Derived Files-Footnote-31162496 +Node: Future Extensions1162610 +Node: Implementation Limitations1163216 +Node: Extension Design1164464 +Node: Old Extension Problems1165618 +Ref: Old Extension Problems-Footnote-11167135 +Node: Extension New Mechanism Goals1167192 +Ref: Extension New Mechanism Goals-Footnote-11170552 +Node: Extension Other Design Decisions1170741 +Node: Extension Future Growth1172849 +Node: Old Extension Mechanism1173685 +Node: Notes summary1175447 +Node: Basic Concepts1176633 +Node: Basic High Level1177314 +Ref: figure-general-flow1177586 +Ref: figure-process-flow1178185 +Ref: Basic High Level-Footnote-11181414 +Node: Basic Data Typing1181599 +Node: Glossary1184927 +Node: Copying1216856 +Node: GNU Free Documentation License1254412 +Node: Index1279548  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 6b37e74b..abc9fa9c 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -20500,7 +20500,7 @@ It contains the following chapters: your own @command{awk} functions. Writing functions is important, because it allows you to encapsulate algorithms and program tasks in a single place. It simplifies programming, making program development more -manageable, and making programs more readable. +manageable and making programs more readable. @cindex Kernighan, Brian @cindex Plauger, P.J.@: @@ -20629,7 +20629,7 @@ often use variable names like these for their own purposes. The example programs shown in this @value{CHAPTER} all start the names of their private variables with an underscore (@samp{_}). Users generally don't use leading underscores in their variable names, so this convention immediately -decreases the chances that the variable name will be accidentally shared +decreases the chances that the variable names will be accidentally shared with the user's program. @cindex @code{_} (underscore), in names of private variables @@ -20647,8 +20647,8 @@ show how our own @command{awk} programming style has evolved and to provide some basis for this discussion.} As a final note on variable naming, if a function makes global variables -available for use by a main program, it is a good convention to start that -variable's name with a capital letter---for +available for use by a main program, it is a good convention to start those +variables' names with a capital letter---for example, @code{getopt()}'s @code{Opterr} and @code{Optind} variables (@pxref{Getopt Function}). The leading capital letter indicates that it is global, while the fact that @@ -20659,7 +20659,7 @@ not one of @command{awk}'s predefined variables, such as @code{FS}. It is also important that @emph{all} variables in library functions that do not need to save state are, in fact, declared local.@footnote{@command{gawk}'s @option{--dump-variables} command-line -option is useful for verifying this.} If this is not done, the variable +option is useful for verifying this.} If this is not done, the variables could accidentally be used in the user's program, leading to bugs that are very difficult to track down: @@ -20857,7 +20857,7 @@ Following is the function: @example @c file eg/lib/assert.awk -# assert --- assert that a condition is true. Otherwise exit. +# assert --- assert that a condition is true. Otherwise, exit. @c endfile @ignore @@ -20893,7 +20893,7 @@ is false, it prints a message to standard error, using the @code{string} parameter to describe the failed condition. It then sets the variable @code{_assert_exit} to one and executes the @code{exit} statement. The @code{exit} statement jumps to the @code{END} rule. If the @code{END} -rules finds @code{_assert_exit} to be true, it exits immediately. +rule finds @code{_assert_exit} to be true, it exits immediately. The purpose of the test in the @code{END} rule is to keep any other @code{END} rules from running. When an assertion fails, the @@ -21185,7 +21185,7 @@ all the strings in an array into one long string. The following function, the application programs (@pxref{Sample Programs}). -Good function design is important; this function needs to be general but it +Good function design is important; this function needs to be general, but it should also have a reasonable default behavior. It is called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array indices are numeric---a reasonable @@ -21333,7 +21333,7 @@ allowed the user to supply an optional timestamp value to use instead of the current time. @node Readfile Function -@subsection Reading a Whole File At Once +@subsection Reading a Whole File at Once Often, it is convenient to have the entire contents of a file available in memory as a single string. A straightforward but naive way to @@ -21390,13 +21390,13 @@ function readfile(file, tmp, save_rs) It works by setting @code{RS} to @samp{^$}, a regular expression that will never match if the file has contents. @command{gawk} reads data from -the file into @code{tmp} attempting to match @code{RS}. The match fails +the file into @code{tmp}, attempting to match @code{RS}. The match fails after each read, but fails quickly, such that @command{gawk} fills @code{tmp} with the entire contents of the file. (@DBXREF{Records} for information on @code{RT} and @code{RS}.) In the case that @code{file} is empty, the return value is the null -string. Thus calling code may use something like: +string. Thus, calling code may use something like: @example contents = readfile("/some/path") @@ -21407,7 +21407,7 @@ if (length(contents) == 0) This tests the result to see if it is empty or not. An equivalent test would be @samp{contents == ""}. -@xref{Extension Sample Readfile}, for an extension function that +@DBXREF{Extension Sample Readfile} for an extension function that also reads an entire file into memory. @node Shell Quoting @@ -21514,8 +21514,8 @@ The @code{BEGIN} and @code{END} rules are each executed exactly once, at the beginning and end of your @command{awk} program, respectively (@pxref{BEGIN/END}). We (the @command{gawk} authors) once had a user who mistakenly thought that the -@code{BEGIN} rule is executed at the beginning of each @value{DF} and the -@code{END} rule is executed at the end of each @value{DF}. +@code{BEGIN} rules were executed at the beginning of each @value{DF} and the +@code{END} rules were executed at the end of each @value{DF}. When informed that this was not the case, the user requested that we add new special @@ -21555,7 +21555,7 @@ END @{ endfile(FILENAME) @} This file must be loaded before the user's ``main'' program, so that the rule it supplies is executed first. -This rule relies on @command{awk}'s @code{FILENAME} variable that +This rule relies on @command{awk}'s @code{FILENAME} variable, which automatically changes for each new @value{DF}. The current @value{FN} is saved in a private variable, @code{_oldfilename}. If @code{FILENAME} does not equal @code{_oldfilename}, then a new @value{DF} is being processed and @@ -21571,7 +21571,7 @@ first @value{DF}. The program also supplies an @code{END} rule to do the final processing for the last file. Because this @code{END} rule comes before any @code{END} rules supplied in the ``main'' program, @code{endfile()} is called first. Once -again the value of multiple @code{BEGIN} and @code{END} rules should be clear. +again, the value of multiple @code{BEGIN} and @code{END} rules should be clear. @cindex @code{beginfile()} user-defined function @cindex @code{endfile()} user-defined function @@ -21619,7 +21619,7 @@ how it simplifies writing the main program. You are probably wondering, if @code{beginfile()} and @code{endfile()} functions can do the job, why does @command{gawk} have -@code{BEGINFILE} and @code{ENDFILE} patterns (@pxref{BEGINFILE/ENDFILE})? +@code{BEGINFILE} and @code{ENDFILE} patterns? Good question. Normally, if @command{awk} cannot open a file, this causes an immediate fatal error. In this case, there is no way for a @@ -21628,6 +21628,7 @@ calling it relies on the file being open and at the first record. Thus, the main reason for @code{BEGINFILE} is to give you a ``hook'' to catch files that cannot be processed. @code{ENDFILE} exists for symmetry, and because it provides an easy way to do per-file cleanup processing. +For more information, refer to @ref{BEGINFILE/ENDFILE}. @docbook @@ -21642,7 +21643,7 @@ and because it provides an easy way to do per-file cleanup processing. You are probably wondering, if @code{beginfile()} and @code{endfile()} functions can do the job, why does @command{gawk} have -@code{BEGINFILE} and @code{ENDFILE} patterns (@pxref{BEGINFILE/ENDFILE})? +@code{BEGINFILE} and @code{ENDFILE} patterns? Good question. Normally, if @command{awk} cannot open a file, this causes an immediate fatal error. In this case, there is no way for a @@ -21651,6 +21652,7 @@ calling it relies on the file being open and at the first record. Thus, the main reason for @code{BEGINFILE} is to give you a ``hook'' to catch files that cannot be processed. @code{ENDFILE} exists for symmetry, and because it provides an easy way to do per-file cleanup processing. +For more information, refer to @ref{BEGINFILE/ENDFILE}. @end cartouche @end ifnotdocbook @@ -21658,7 +21660,7 @@ and because it provides an easy way to do per-file cleanup processing. @subsection Rereading the Current File @cindex files, reading -Another request for a new built-in function was for a @code{rewind()} +Another request for a new built-in function was for a function that would make it possible to reread the current file. The requesting user didn't want to have to use @code{getline} (@pxref{Getline}) @@ -21667,7 +21669,7 @@ inside a loop. However, as long as you are not in the @code{END} rule, it is quite easy to arrange to immediately close the current input file and then start over with it from the top. -For lack of a better name, we'll call it @code{rewind()}: +For lack of a better name, we'll call the function @code{rewind()}: @cindex @code{rewind()} user-defined function @example @@ -21760,16 +21762,16 @@ See also @ref{ARGC and ARGV}. Because @command{awk} variable names only allow the English letters, the regular expression check purposely does not use character classes such as @samp{[:alpha:]} and @samp{[:alnum:]} -(@pxref{Bracket Expressions}) +(@pxref{Bracket Expressions}). @node Empty Files -@subsection Checking for Zero-length Files +@subsection Checking for Zero-Length Files All known @command{awk} implementations silently skip over zero-length files. This is a by-product of @command{awk}'s implicit read-a-record-and-match-against-the-rules loop: when @command{awk} tries to read a record from an empty file, it immediately receives an -end of file indication, closes the file, and proceeds on to the next +end-of-file indication, closes the file, and proceeds on to the next command-line @value{DF}, @emph{without} executing any user-level @command{awk} program code. @@ -21834,7 +21836,7 @@ Occasionally, you might not want @command{awk} to process command-line variable assignments (@pxref{Assignment Options}). In particular, if you have a @value{FN} that contains an @samp{=} character, -@command{awk} treats the @value{FN} as an assignment, and does not process it. +@command{awk} treats the @value{FN} as an assignment and does not process it. Some users have suggested an additional command-line option for @command{gawk} to disable command-line assignments. However, some simple programming with @@ -22196,8 +22198,8 @@ BEGIN @{ @c endfile @end example -The rest of the @code{BEGIN} rule is a simple test program. Here is the -result of two sample runs of the test program: +The rest of the @code{BEGIN} rule is a simple test program. Here are the +results of two sample runs of the test program: @example $ @kbd{awk -f getopt.awk -v _getopt_test=1 -- -a -cbARG bax -x} @@ -22255,7 +22257,7 @@ use @code{getopt()} to process their arguments. The @code{PROCINFO} array (@pxref{Built-in Variables}) provides access to the current user's real and effective user and group ID -numbers, and if available, the user's supplementary group set. +numbers, and, if available, the user's supplementary group set. However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This @@ -22275,7 +22277,7 @@ kept. Instead, it provides the @code{} header file and several C language subroutines for obtaining user information. The primary function is @code{getpwent()}, for ``get password entry.'' The ``password'' comes from the original user database file, -@file{/etc/passwd}, which stores user information, along with the +@file{/etc/passwd}, which stores user information along with the encrypted passwords (hence the name). @cindex @command{pwcat} program @@ -22374,7 +22376,7 @@ The user's encrypted password. This may not be available on some systems. @item User-ID The user's numeric user ID number. -(On some systems, it's a C @code{long}, and not an @code{int}. Thus +(On some systems, it's a C @code{long}, and not an @code{int}. Thus, we cast it to @code{long} for all cases.) @item Group-ID @@ -22501,7 +22503,7 @@ The code that checks for using @code{FPAT}, using @code{using_fpat} and @code{PROCINFO["FS"]}, is similar. The main part of the function uses a loop to read database lines, split -the line into fields, and then store the line into each array as necessary. +the lines into fields, and then store the lines into each array as necessary. When the loop is done, @code{@w{_pw_init()}} cleans up by closing the pipeline, setting @code{@w{_pw_inited}} to one, and restoring @code{FS} (and @code{FIELDWIDTHS} or @code{FPAT} @@ -22718,7 +22720,7 @@ it is usually empty or set to @samp{*}. @item Group ID Number The group's numeric group ID number; the association of name to number must be unique within the file. -(On some systems it's a C @code{long}, and not an @code{int}. Thus +(On some systems it's a C @code{long}, and not an @code{int}. Thus, we cast it to @code{long} for all cases.) @item Group Member List @@ -22832,32 +22834,32 @@ The @code{@w{_gr_init()}} function first saves @code{FS}, @code{$0}, and then sets @code{FS} and @code{RS} to the correct values for scanning the group information. It also takes care to note whether @code{FIELDWIDTHS} or @code{FPAT} -is being used, and to restore the appropriate field splitting mechanism. +is being used, and to restore the appropriate field-splitting mechanism. -The group information is stored is several associative arrays. +The group information is stored in several associative arrays. The arrays are indexed by group name (@code{@w{_gr_byname}}), by group ID number (@code{@w{_gr_bygid}}), and by position in the database (@code{@w{_gr_bycount}}). There is an additional array indexed by username (@code{@w{_gr_groupsbyuser}}), which is a space-separated list of groups to which each user belongs. -Unlike the user database, it is possible to have multiple records in the +Unlike in the user database, it is possible to have multiple records in the database for the same group. This is common when a group has a large number of members. A pair of such entries might look like the following: @example -tvpeople:*:101:johny,jay,arsenio +tvpeople:*:101:johnny,jay,arsenio tvpeople:*:101:david,conan,tom,joan @end example For this reason, @code{_gr_init()} looks to see if a group name or -group ID number is already seen. If it is, the usernames are -simply concatenated onto the previous list of users.@footnote{There is actually a +group ID number is already seen. If so, the usernames are +simply concatenated onto the previous list of users.@footnote{There is a subtle problem with the code just presented. Suppose that the first time there were no names. This code adds the names with a leading comma. It also doesn't check that there is a @code{$4}.} Finally, @code{_gr_init()} closes the pipeline to @command{grcat}, restores -@code{FS} (and @code{FIELDWIDTHS} or @code{FPAT} if necessary), @code{RS}, and @code{$0}, +@code{FS} (and @code{FIELDWIDTHS} or @code{FPAT}, if necessary), @code{RS}, and @code{$0}, initializes @code{_gr_count} to zero (it is used later), and makes @code{_gr_inited} nonzero. @@ -22957,12 +22959,12 @@ uses these functions. @DBREF{Arrays of Arrays} described how @command{gawk} provides arrays of arrays. In particular, any element of -an array may be either a scalar, or another array. The +an array may be either a scalar or another array. The @code{isarray()} function (@pxref{Type Functions}) lets you distinguish an array from a scalar. The following function, @code{walk_array()}, recursively traverses -an array, printing each element's indices and value. +an array, printing the element indices and values. You call it with the array and a string representing the name of the array: @@ -23034,24 +23036,24 @@ The functions presented here fit into the following categories: @c nested list @table @asis @item General problems -Number-to-string conversion, assertions, rounding, random number +Number-to-string conversion, testing assertions, rounding, random number generation, converting characters to numbers, joining strings, getting easily usable time-of-day information, and reading a whole file in -one shot. +one shot @item Managing @value{DF}s Noting @value{DF} boundaries, rereading the current file, checking for readable files, checking for zero-length files, and treating assignments -as @value{FN}s. +as @value{FN}s @item Processing command-line options -An @command{awk} version of the standard C @code{getopt()} function. +An @command{awk} version of the standard C @code{getopt()} function @item Reading the user and group databases -Two sets of routines that parallel the C library versions. +Two sets of routines that parallel the C library versions @item Traversing arrays of arrays -A simple function to traverse an array of arrays to any depth. +A simple function to traverse an array of arrays to any depth @end table @c end nested list diff --git a/doc/gawktexi.in b/doc/gawktexi.in index cc021c97..2e2d0e04 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -19621,7 +19621,7 @@ It contains the following chapters: your own @command{awk} functions. Writing functions is important, because it allows you to encapsulate algorithms and program tasks in a single place. It simplifies programming, making program development more -manageable, and making programs more readable. +manageable and making programs more readable. @cindex Kernighan, Brian @cindex Plauger, P.J.@: @@ -19750,7 +19750,7 @@ often use variable names like these for their own purposes. The example programs shown in this @value{CHAPTER} all start the names of their private variables with an underscore (@samp{_}). Users generally don't use leading underscores in their variable names, so this convention immediately -decreases the chances that the variable name will be accidentally shared +decreases the chances that the variable names will be accidentally shared with the user's program. @cindex @code{_} (underscore), in names of private variables @@ -19768,8 +19768,8 @@ show how our own @command{awk} programming style has evolved and to provide some basis for this discussion.} As a final note on variable naming, if a function makes global variables -available for use by a main program, it is a good convention to start that -variable's name with a capital letter---for +available for use by a main program, it is a good convention to start those +variables' names with a capital letter---for example, @code{getopt()}'s @code{Opterr} and @code{Optind} variables (@pxref{Getopt Function}). The leading capital letter indicates that it is global, while the fact that @@ -19780,7 +19780,7 @@ not one of @command{awk}'s predefined variables, such as @code{FS}. It is also important that @emph{all} variables in library functions that do not need to save state are, in fact, declared local.@footnote{@command{gawk}'s @option{--dump-variables} command-line -option is useful for verifying this.} If this is not done, the variable +option is useful for verifying this.} If this is not done, the variables could accidentally be used in the user's program, leading to bugs that are very difficult to track down: @@ -19978,7 +19978,7 @@ Following is the function: @example @c file eg/lib/assert.awk -# assert --- assert that a condition is true. Otherwise exit. +# assert --- assert that a condition is true. Otherwise, exit. @c endfile @ignore @@ -20014,7 +20014,7 @@ is false, it prints a message to standard error, using the @code{string} parameter to describe the failed condition. It then sets the variable @code{_assert_exit} to one and executes the @code{exit} statement. The @code{exit} statement jumps to the @code{END} rule. If the @code{END} -rules finds @code{_assert_exit} to be true, it exits immediately. +rule finds @code{_assert_exit} to be true, it exits immediately. The purpose of the test in the @code{END} rule is to keep any other @code{END} rules from running. When an assertion fails, the @@ -20306,7 +20306,7 @@ all the strings in an array into one long string. The following function, the application programs (@pxref{Sample Programs}). -Good function design is important; this function needs to be general but it +Good function design is important; this function needs to be general, but it should also have a reasonable default behavior. It is called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array indices are numeric---a reasonable @@ -20454,7 +20454,7 @@ allowed the user to supply an optional timestamp value to use instead of the current time. @node Readfile Function -@subsection Reading a Whole File At Once +@subsection Reading a Whole File at Once Often, it is convenient to have the entire contents of a file available in memory as a single string. A straightforward but naive way to @@ -20511,13 +20511,13 @@ function readfile(file, tmp, save_rs) It works by setting @code{RS} to @samp{^$}, a regular expression that will never match if the file has contents. @command{gawk} reads data from -the file into @code{tmp} attempting to match @code{RS}. The match fails +the file into @code{tmp}, attempting to match @code{RS}. The match fails after each read, but fails quickly, such that @command{gawk} fills @code{tmp} with the entire contents of the file. (@DBXREF{Records} for information on @code{RT} and @code{RS}.) In the case that @code{file} is empty, the return value is the null -string. Thus calling code may use something like: +string. Thus, calling code may use something like: @example contents = readfile("/some/path") @@ -20528,7 +20528,7 @@ if (length(contents) == 0) This tests the result to see if it is empty or not. An equivalent test would be @samp{contents == ""}. -@xref{Extension Sample Readfile}, for an extension function that +@DBXREF{Extension Sample Readfile} for an extension function that also reads an entire file into memory. @node Shell Quoting @@ -20635,8 +20635,8 @@ The @code{BEGIN} and @code{END} rules are each executed exactly once, at the beginning and end of your @command{awk} program, respectively (@pxref{BEGIN/END}). We (the @command{gawk} authors) once had a user who mistakenly thought that the -@code{BEGIN} rule is executed at the beginning of each @value{DF} and the -@code{END} rule is executed at the end of each @value{DF}. +@code{BEGIN} rules were executed at the beginning of each @value{DF} and the +@code{END} rules were executed at the end of each @value{DF}. When informed that this was not the case, the user requested that we add new special @@ -20676,7 +20676,7 @@ END @{ endfile(FILENAME) @} This file must be loaded before the user's ``main'' program, so that the rule it supplies is executed first. -This rule relies on @command{awk}'s @code{FILENAME} variable that +This rule relies on @command{awk}'s @code{FILENAME} variable, which automatically changes for each new @value{DF}. The current @value{FN} is saved in a private variable, @code{_oldfilename}. If @code{FILENAME} does not equal @code{_oldfilename}, then a new @value{DF} is being processed and @@ -20692,7 +20692,7 @@ first @value{DF}. The program also supplies an @code{END} rule to do the final processing for the last file. Because this @code{END} rule comes before any @code{END} rules supplied in the ``main'' program, @code{endfile()} is called first. Once -again the value of multiple @code{BEGIN} and @code{END} rules should be clear. +again, the value of multiple @code{BEGIN} and @code{END} rules should be clear. @cindex @code{beginfile()} user-defined function @cindex @code{endfile()} user-defined function @@ -20735,7 +20735,7 @@ how it simplifies writing the main program. You are probably wondering, if @code{beginfile()} and @code{endfile()} functions can do the job, why does @command{gawk} have -@code{BEGINFILE} and @code{ENDFILE} patterns (@pxref{BEGINFILE/ENDFILE})? +@code{BEGINFILE} and @code{ENDFILE} patterns? Good question. Normally, if @command{awk} cannot open a file, this causes an immediate fatal error. In this case, there is no way for a @@ -20744,13 +20744,14 @@ calling it relies on the file being open and at the first record. Thus, the main reason for @code{BEGINFILE} is to give you a ``hook'' to catch files that cannot be processed. @code{ENDFILE} exists for symmetry, and because it provides an easy way to do per-file cleanup processing. +For more information, refer to @ref{BEGINFILE/ENDFILE}. @end sidebar @node Rewind Function @subsection Rereading the Current File @cindex files, reading -Another request for a new built-in function was for a @code{rewind()} +Another request for a new built-in function was for a function that would make it possible to reread the current file. The requesting user didn't want to have to use @code{getline} (@pxref{Getline}) @@ -20759,7 +20760,7 @@ inside a loop. However, as long as you are not in the @code{END} rule, it is quite easy to arrange to immediately close the current input file and then start over with it from the top. -For lack of a better name, we'll call it @code{rewind()}: +For lack of a better name, we'll call the function @code{rewind()}: @cindex @code{rewind()} user-defined function @example @@ -20852,16 +20853,16 @@ See also @ref{ARGC and ARGV}. Because @command{awk} variable names only allow the English letters, the regular expression check purposely does not use character classes such as @samp{[:alpha:]} and @samp{[:alnum:]} -(@pxref{Bracket Expressions}) +(@pxref{Bracket Expressions}). @node Empty Files -@subsection Checking for Zero-length Files +@subsection Checking for Zero-Length Files All known @command{awk} implementations silently skip over zero-length files. This is a by-product of @command{awk}'s implicit read-a-record-and-match-against-the-rules loop: when @command{awk} tries to read a record from an empty file, it immediately receives an -end of file indication, closes the file, and proceeds on to the next +end-of-file indication, closes the file, and proceeds on to the next command-line @value{DF}, @emph{without} executing any user-level @command{awk} program code. @@ -20926,7 +20927,7 @@ Occasionally, you might not want @command{awk} to process command-line variable assignments (@pxref{Assignment Options}). In particular, if you have a @value{FN} that contains an @samp{=} character, -@command{awk} treats the @value{FN} as an assignment, and does not process it. +@command{awk} treats the @value{FN} as an assignment and does not process it. Some users have suggested an additional command-line option for @command{gawk} to disable command-line assignments. However, some simple programming with @@ -21288,8 +21289,8 @@ BEGIN @{ @c endfile @end example -The rest of the @code{BEGIN} rule is a simple test program. Here is the -result of two sample runs of the test program: +The rest of the @code{BEGIN} rule is a simple test program. Here are the +results of two sample runs of the test program: @example $ @kbd{awk -f getopt.awk -v _getopt_test=1 -- -a -cbARG bax -x} @@ -21347,7 +21348,7 @@ use @code{getopt()} to process their arguments. The @code{PROCINFO} array (@pxref{Built-in Variables}) provides access to the current user's real and effective user and group ID -numbers, and if available, the user's supplementary group set. +numbers, and, if available, the user's supplementary group set. However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This @@ -21367,7 +21368,7 @@ kept. Instead, it provides the @code{} header file and several C language subroutines for obtaining user information. The primary function is @code{getpwent()}, for ``get password entry.'' The ``password'' comes from the original user database file, -@file{/etc/passwd}, which stores user information, along with the +@file{/etc/passwd}, which stores user information along with the encrypted passwords (hence the name). @cindex @command{pwcat} program @@ -21466,7 +21467,7 @@ The user's encrypted password. This may not be available on some systems. @item User-ID The user's numeric user ID number. -(On some systems, it's a C @code{long}, and not an @code{int}. Thus +(On some systems, it's a C @code{long}, and not an @code{int}. Thus, we cast it to @code{long} for all cases.) @item Group-ID @@ -21593,7 +21594,7 @@ The code that checks for using @code{FPAT}, using @code{using_fpat} and @code{PROCINFO["FS"]}, is similar. The main part of the function uses a loop to read database lines, split -the line into fields, and then store the line into each array as necessary. +the lines into fields, and then store the lines into each array as necessary. When the loop is done, @code{@w{_pw_init()}} cleans up by closing the pipeline, setting @code{@w{_pw_inited}} to one, and restoring @code{FS} (and @code{FIELDWIDTHS} or @code{FPAT} @@ -21810,7 +21811,7 @@ it is usually empty or set to @samp{*}. @item Group ID Number The group's numeric group ID number; the association of name to number must be unique within the file. -(On some systems it's a C @code{long}, and not an @code{int}. Thus +(On some systems it's a C @code{long}, and not an @code{int}. Thus, we cast it to @code{long} for all cases.) @item Group Member List @@ -21924,32 +21925,32 @@ The @code{@w{_gr_init()}} function first saves @code{FS}, @code{$0}, and then sets @code{FS} and @code{RS} to the correct values for scanning the group information. It also takes care to note whether @code{FIELDWIDTHS} or @code{FPAT} -is being used, and to restore the appropriate field splitting mechanism. +is being used, and to restore the appropriate field-splitting mechanism. -The group information is stored is several associative arrays. +The group information is stored in several associative arrays. The arrays are indexed by group name (@code{@w{_gr_byname}}), by group ID number (@code{@w{_gr_bygid}}), and by position in the database (@code{@w{_gr_bycount}}). There is an additional array indexed by username (@code{@w{_gr_groupsbyuser}}), which is a space-separated list of groups to which each user belongs. -Unlike the user database, it is possible to have multiple records in the +Unlike in the user database, it is possible to have multiple records in the database for the same group. This is common when a group has a large number of members. A pair of such entries might look like the following: @example -tvpeople:*:101:johny,jay,arsenio +tvpeople:*:101:johnny,jay,arsenio tvpeople:*:101:david,conan,tom,joan @end example For this reason, @code{_gr_init()} looks to see if a group name or -group ID number is already seen. If it is, the usernames are -simply concatenated onto the previous list of users.@footnote{There is actually a +group ID number is already seen. If so, the usernames are +simply concatenated onto the previous list of users.@footnote{There is a subtle problem with the code just presented. Suppose that the first time there were no names. This code adds the names with a leading comma. It also doesn't check that there is a @code{$4}.} Finally, @code{_gr_init()} closes the pipeline to @command{grcat}, restores -@code{FS} (and @code{FIELDWIDTHS} or @code{FPAT} if necessary), @code{RS}, and @code{$0}, +@code{FS} (and @code{FIELDWIDTHS} or @code{FPAT}, if necessary), @code{RS}, and @code{$0}, initializes @code{_gr_count} to zero (it is used later), and makes @code{_gr_inited} nonzero. @@ -22049,12 +22050,12 @@ uses these functions. @DBREF{Arrays of Arrays} described how @command{gawk} provides arrays of arrays. In particular, any element of -an array may be either a scalar, or another array. The +an array may be either a scalar or another array. The @code{isarray()} function (@pxref{Type Functions}) lets you distinguish an array from a scalar. The following function, @code{walk_array()}, recursively traverses -an array, printing each element's indices and value. +an array, printing the element indices and values. You call it with the array and a string representing the name of the array: @@ -22126,24 +22127,24 @@ The functions presented here fit into the following categories: @c nested list @table @asis @item General problems -Number-to-string conversion, assertions, rounding, random number +Number-to-string conversion, testing assertions, rounding, random number generation, converting characters to numbers, joining strings, getting easily usable time-of-day information, and reading a whole file in -one shot. +one shot @item Managing @value{DF}s Noting @value{DF} boundaries, rereading the current file, checking for readable files, checking for zero-length files, and treating assignments -as @value{FN}s. +as @value{FN}s @item Processing command-line options -An @command{awk} version of the standard C @code{getopt()} function. +An @command{awk} version of the standard C @code{getopt()} function @item Reading the user and group databases -Two sets of routines that parallel the C library versions. +Two sets of routines that parallel the C library versions @item Traversing arrays of arrays -A simple function to traverse an array of arrays to any depth. +A simple function to traverse an array of arrays to any depth @end table @c end nested list -- cgit v1.2.3 From 1e4b9e300f6bfb84e3187ba2085723d44af9c50f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 4 Feb 2015 06:16:22 +0200 Subject: More O'Reilly fixes, through Chapter 11. --- awklib/eg/prog/anagram.awk | 6 +- awklib/eg/prog/extract.awk | 2 +- awklib/eg/prog/translate.awk | 2 +- doc/ChangeLog | 4 + doc/gawk.info | 586 ++++++++++++++++++++++--------------------- doc/gawk.texi | 97 ++++--- doc/gawktexi.in | 97 ++++--- 7 files changed, 387 insertions(+), 407 deletions(-) diff --git a/awklib/eg/prog/anagram.awk b/awklib/eg/prog/anagram.awk index 7ca14559..df2768d9 100644 --- a/awklib/eg/prog/anagram.awk +++ b/awklib/eg/prog/anagram.awk @@ -1,5 +1,5 @@ -# anagram.awk --- An implementation of the anagram finding algorithm -# from Jon Bentley's "Programming Pearls", 2nd edition. +# anagram.awk --- An implementation of the anagram-finding algorithm +# from Jon Bentley's "Programming Pearls," 2nd edition. # Addison Wesley, 2000, ISBN 0-201-65788-0. # Column 2, Problem C, section 2.8, pp 18-20. # @@ -21,7 +21,7 @@ key = word2key($1) # Build signature data[key][$1] = $1 # Store word with signature } -# word2key --- split word apart into letters, sort, joining back together +# word2key --- split word apart into letters, sort, and join back together function word2key(word, a, i, n, result) { diff --git a/awklib/eg/prog/extract.awk b/awklib/eg/prog/extract.awk index 24f40ce5..f5dfcf40 100644 --- a/awklib/eg/prog/extract.awk +++ b/awklib/eg/prog/extract.awk @@ -1,4 +1,4 @@ -# extract.awk --- extract files and run programs from texinfo files +# extract.awk --- extract files and run programs from Texinfo files # # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 diff --git a/awklib/eg/prog/translate.awk b/awklib/eg/prog/translate.awk index cf7f3897..e7403717 100644 --- a/awklib/eg/prog/translate.awk +++ b/awklib/eg/prog/translate.awk @@ -4,7 +4,7 @@ # August 1989 # February 2009 - bug fix -# Bugs: does not handle things like: tr A-Z a-z, it has +# Bugs: does not handle things like tr A-Z a-z; it has # to be spelled out. However, if `to' is shorter than `from', # the last character in `to' is used for the rest of `from'. diff --git a/doc/ChangeLog b/doc/ChangeLog index b4eb2c70..95022eec 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-04 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-02-02 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index bebdf4bf..8e6a4f29 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -16441,7 +16441,7 @@ you. to replace the installed versions on your system. Nor may all of these programs be fully compliant with the most recent POSIX standard. This is not a problem; their purpose is to illustrate `awk' language -programming for "real world" tasks. +programming for "real-world" tasks. The programs are presented in alphabetical order. @@ -16467,7 +16467,7 @@ separated by TABs by default, but you may supply a command-line option to change the field "delimiter" (i.e., the field-separator character). `cut''s definition of fields is less general than `awk''s. - A common use of `cut' might be to pull out just the login name of + A common use of `cut' might be to pull out just the login names of logged-on users from the output of `who'. For example, the following pipeline generates a sorted, unique list of the logged-on users: @@ -16876,7 +16876,7 @@ unsuccessful match. If the line does not match, the `next' statement just moves on to the next record. A number of additional tests are made, but they are only done if we -are not counting lines. First, if the user only wants exit status +are not counting lines. First, if the user only wants the exit status (`no_print' is true), then it is enough to know that _one_ line in this file matched, and we can skip on to the next file with `nextfile'. Similarly, if we are only printing file names, we can print the file @@ -16910,7 +16910,7 @@ line is printed, with a leading file name and colon if necessary: } The `END' rule takes care of producing the correct exit status. If -there are no matches, the exit status is one; otherwise it is zero: +there are no matches, the exit status is one; otherwise, it is zero: END { exit (total == 0) @@ -16952,7 +16952,8 @@ a more palatable output than just individual numbers. Here is a simple version of `id' written in `awk'. It uses the user database library functions (*note Passwd Functions::) and the group -database library functions (*note Group Functions::): +database library functions (*note Group Functions::) from *note Library +Functions::. The program is fairly straightforward. All the work is done in the `BEGIN' rule. The user and group ID numbers are obtained from @@ -17049,8 +17050,8 @@ is as follows:(1) By default, the output files are named `xaa', `xab', and so on. Each file has 1,000 lines in it, with the likely exception of the last file. To change the number of lines in each file, supply a number on the -command line preceded with a minus (e.g., `-500' for files with 500 -lines in them instead of 1,000). To change the name of the output +command line preceded with a minus sign (e.g., `-500' for files with +500 lines in them instead of 1,000). To change the names of the output files to something like `myfileaa', `myfileab', and so on, supply an additional argument that specifies the file name prefix. @@ -17687,7 +17688,7 @@ checking and setting of defaults: the delay, the count, and the message to print. If the user supplied a message without the ASCII BEL character (known as the "alert" character, `"\a"'), then it is added to the message. (On many systems, printing the ASCII BEL generates an -audible alert. Thus when the alarm goes off, the system calls attention +audible alert. Thus, when the alarm goes off, the system calls attention to itself in case the user is not looking at the computer.) Just for a change, this program uses a `switch' statement (*note Switch Statement::), but the processing could be done with a series of @@ -17819,7 +17820,7 @@ the "from" list. Once upon a time, a user proposed adding a transliteration function to `gawk'. The following program was written to prove that character transliteration could be done with a user-level function. This program -is not as complete as the system `tr' utility but it does most of the +is not as complete as the system `tr' utility, but it does most of the job. The `translate' program was written long before `gawk' acquired the @@ -17829,13 +17830,13 @@ and `gsub()' built-in functions (*note String Functions::). There are two functions. The first, `stranslate()', takes three arguments: `from' - A list of characters from which to translate. + A list of characters from which to translate `to' - A list of characters to which to translate. + A list of characters to which to translate `target' - The string on which to do the translation. + The string on which to do the translation Associative arrays make the translation part fairly easy. `t_ar' holds the "to" characters, indexed by the "from" characters. Then a @@ -17843,7 +17844,7 @@ simple loop goes through `from', one character at a time. For each character in `from', if the character appears in `target', it is replaced with the corresponding `to' character. - The `translate()' function calls `stranslate()' using `$0' as the + The `translate()' function calls `stranslate()', using `$0' as the target. The main program sets two global variables, `FROM' and `TO', from the command line, and then changes `ARGV' so that `awk' reads from the standard input. @@ -17852,7 +17853,7 @@ the standard input. record: # translate.awk --- do tr-like stuff - # Bugs: does not handle things like: tr A-Z a-z, it has + # Bugs: does not handle things like tr A-Z a-z; it has # to be spelled out. However, if `to' is shorter than `from', # the last character in `to' is used for the rest of `from'. @@ -17930,13 +17931,13 @@ File: gawk.info, Node: Labels Program, Next: Word Sorting, Prev: Translate Pr 11.3.4 Printing Mailing Labels ------------------------------ -Here is a "real world"(1) program. This script reads lists of names and +Here is a "real-world"(1) program. This script reads lists of names and addresses and generates mailing labels. Each page of labels has 20 labels on it, two across and 10 down. The addresses are guaranteed to be no more than five lines of data. Each address is separated from the next by a blank line. - The basic idea is to read 20 labels worth of data. Each line of + The basic idea is to read 20 labels' worth of data. Each line of each label is stored in the `line' array. The single rule takes care of filling the `line' array and printing the page when 20 labels have been read. @@ -17948,13 +17949,13 @@ splits records at blank lines (*note Records::). It sets `MAXLINES' to Most of the work is done in the `printpage()' function. The label lines are stored sequentially in the `line' array. But they have to -print horizontally; `line[1]' next to `line[6]', `line[2]' next to +print horizontally: `line[1]' next to `line[6]', `line[2]' next to `line[7]', and so on. Two loops accomplish this. The outer loop, controlled by `i', steps through every 10 lines of data; this is each row of labels. The inner loop, controlled by `j', goes through the -lines within the row. As `j' goes from 0 to 4, `i+j' is the `j'-th -line in the row, and `i+j+5' is the entry next to it. The output ends -up looking something like this: +lines within the row. As `j' goes from 0 to 4, `i+j' is the `j'th line +in the row, and `i+j+5' is the entry next to it. The output ends up +looking something like this: line 1 line 6 line 2 line 7 @@ -18057,8 +18058,8 @@ a useful format. printf "%s\t%d\n", word, freq[word] } - The program relies on `awk''s default field splitting mechanism to -break each line up into "words," and uses an associative array named + The program relies on `awk''s default field-splitting mechanism to +break each line up into "words" and uses an associative array named `freq', indexed by each word, to count the number of times the word occurs. In the `END' rule, it prints the counts. @@ -18144,7 +18145,7 @@ File: gawk.info, Node: History Sorting, Next: Extract Program, Prev: Word Sor 11.3.6 Removing Duplicates from Unsorted Text --------------------------------------------- -The `uniq' program (*note Uniq Program::), removes duplicate lines from +The `uniq' program (*note Uniq Program::) removes duplicate lines from _sorted_ data. Suppose, however, you need to remove duplicate lines from a data @@ -18197,7 +18198,7 @@ hand. Here we present a program that can extract parts of a Texinfo input file into separate files. This Info file is written in Texinfo -(http://www.gnu.org/software/texinfo/), the GNU project's document +(http://www.gnu.org/software/texinfo/), the GNU Project's document formatting language. A single Texinfo source file can be used to produce both printed documentation, with TeX, and online documentation. (The Texinfo language is described fully, starting with *note @@ -18238,7 +18239,7 @@ them in a standard directory where `gawk' can find them. The Texinfo file looks something like this: ... - This program has a @code{BEGIN} rule, + This program has a @code{BEGIN} rule that prints a nice message: @example @@ -18263,7 +18264,7 @@ upper- and lowercase letters in the directives won't matter. given (`NF' is at least three) and also checking that the command exits with a zero exit status, signifying OK: - # extract.awk --- extract files and run programs from texinfo files + # extract.awk --- extract files and run programs from Texinfo files BEGIN { IGNORECASE = 1 } @@ -18290,11 +18291,11 @@ The variable `e' is used so that the rule fits nicely on the screen. file name is given in the directive. If the file named is not the current file, then the current file is closed. Keeping the current file open until a new file is encountered allows the use of the `>' -redirection for printing the contents, keeping open file management +redirection for printing the contents, keeping open-file management simple. The `for' loop does the work. It reads lines using `getline' (*note -Getline::). For an unexpected end of file, it calls the +Getline::). For an unexpected end-of-file, it calls the `unexpected_eof()' function. If the line is an "endfile" line, then it breaks out of the loop. If the line is an `@group' or `@end group' line, then it ignores it and goes on to the next line. Similarly, @@ -18384,10 +18385,10 @@ File: gawk.info, Node: Simple Sed, Next: Igawk Program, Prev: Extract Program 11.3.8 A Simple Stream Editor ----------------------------- -The `sed' utility is a stream editor, a program that reads a stream of -data, makes changes to it, and passes it on. It is often used to make -global changes to a large file or to a stream of data generated by a -pipeline of commands. Although `sed' is a complicated program in its +The `sed' utility is a "stream editor", a program that reads a stream +of data, makes changes to it, and passes it on. It is often used to +make global changes to a large file or to a stream of data generated by +a pipeline of commands. Although `sed' is a complicated program in its own right, its most common use is to perform global substitutions in the middle of a pipeline: @@ -18501,7 +18502,7 @@ include a library function twice. `igawk' should behave just like `gawk' externally. This means it should accept all of `gawk''s command-line arguments, including the -ability to have multiple source files specified via `-f', and the +ability to have multiple source files specified via `-f' and the ability to mix command-line and library source files. The program is written using the POSIX Shell (`sh') command @@ -18531,8 +18532,8 @@ language.(1) It works as follows: file names). This program uses shell variables extensively: for storing -command-line arguments, the text of the `awk' program that will expand -the user's program, for the user's original program, and for the +command-line arguments and the text of the `awk' program that will +expand the user's program, for the user's original program, and for the expanded program. Doing so removes some potential problems that might arise were we to use temporary files instead, at the cost of making the script somewhat more complicated. @@ -18790,7 +18791,7 @@ It's done in these steps: The last step is to call `gawk' with the expanded program, along with the original options and command-line arguments that the user -supplied. +supplied: eval gawk $opts -- '"$processed_program"' '"$@"' @@ -18853,15 +18854,15 @@ One word is an anagram of another if both words contain the same letters Column 2, Problem C, of Jon Bentley's `Programming Pearls', Second Edition, presents an elegant algorithm. The idea is to give words that are anagrams a common signature, sort all the words together by their -signature, and then print them. Dr. Bentley observes that taking the -letters in each word and sorting them produces that common signature. +signatures, and then print them. Dr. Bentley observes that taking the +letters in each word and sorting them produces those common signatures. 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: - # anagram.awk --- An implementation of the anagram finding algorithm - # from Jon Bentley's "Programming Pearls", 2nd edition. + # anagram.awk --- An implementation of the anagram-finding algorithm + # from Jon Bentley's "Programming Pearls," 2nd edition. # Addison Wesley, 2000, ISBN 0-201-65788-0. # Column 2, Problem C, section 2.8, pp 18-20. @@ -18881,7 +18882,7 @@ signature; the second dimension is the word itself: apart into individual letters, sorts the letters, and then joins them back together: - # word2key --- split word apart into letters, sort, joining back together + # word2key --- split word apart into letters, sort, and join back together function word2key(word, a, i, n, result) { @@ -18979,12 +18980,13 @@ File: gawk.info, Node: Programs Summary, Next: Programs Exercises, Prev: Misc characters. The ability to use `split()' with the empty string as the separator can considerably simplify such tasks. - * The library functions from *note Library Functions::, proved their - usefulness for a number of real (if small) programs. + * The examples here demonstrate the usefulness of the library + functions from *note Library Functions:: for a number of real (if + small) programs. * Besides reinventing POSIX wheels, other programs solved a - selection of interesting problems, such as finding duplicates - words in text, printing mailing labels, and finding anagrams. + selection of interesting problems, such as finding duplicate words + in text, printing mailing labels, and finding anagrams.  @@ -33119,7 +33121,7 @@ Index * hyphen (-), in bracket expressions: Bracket Expressions. (line 17) * i debugger command (alias for info): Debugger Info. (line 13) * id utility: Id Program. (line 6) -* id.awk program: Id Program. (line 30) +* id.awk program: Id Program. (line 31) * if statement: If Statement. (line 6) * if statement, actions, changing: Ranges. (line 25) * if statement, use of regexps in: Regexp Usage. (line 19) @@ -34783,251 +34785,251 @@ Node: Sample Programs675577 Node: Running Examples676347 Node: Clones677075 Node: Cut Program678299 -Node: Egrep Program688018 -Ref: Egrep Program-Footnote-1695516 -Node: Id Program695626 -Node: Split Program699271 -Ref: Split Program-Footnote-1702719 -Node: Tee Program702847 -Node: Uniq Program705636 -Node: Wc Program713055 -Ref: Wc Program-Footnote-1717305 -Node: Miscellaneous Programs717399 -Node: Dupword Program718612 -Node: Alarm Program720643 -Node: Translate Program725447 -Ref: Translate Program-Footnote-1730012 -Node: Labels Program730282 -Ref: Labels Program-Footnote-1733633 -Node: Word Sorting733717 -Node: History Sorting737788 -Node: Extract Program739624 -Node: Simple Sed747149 -Node: Igawk Program750217 -Ref: Igawk Program-Footnote-1764541 -Ref: Igawk Program-Footnote-2764742 -Ref: Igawk Program-Footnote-3764864 -Node: Anagram Program764979 -Node: Signature Program768036 -Node: Programs Summary769283 -Node: Programs Exercises770476 -Ref: Programs Exercises-Footnote-1774607 -Node: Advanced Features774698 -Node: Nondecimal Data776646 -Node: Array Sorting778236 -Node: Controlling Array Traversal778933 -Ref: Controlling Array Traversal-Footnote-1787266 -Node: Array Sorting Functions787384 -Ref: Array Sorting Functions-Footnote-1791273 -Node: Two-way I/O791469 -Ref: Two-way I/O-Footnote-1796414 -Ref: Two-way I/O-Footnote-2796600 -Node: TCP/IP Networking796682 -Node: Profiling799555 -Node: Advanced Features Summary807102 -Node: Internationalization809035 -Node: I18N and L10N810515 -Node: Explaining gettext811201 -Ref: Explaining gettext-Footnote-1816226 -Ref: Explaining gettext-Footnote-2816410 -Node: Programmer i18n816575 -Ref: Programmer i18n-Footnote-1821441 -Node: Translator i18n821490 -Node: String Extraction822284 -Ref: String Extraction-Footnote-1823415 -Node: Printf Ordering823501 -Ref: Printf Ordering-Footnote-1826287 -Node: I18N Portability826351 -Ref: I18N Portability-Footnote-1828806 -Node: I18N Example828869 -Ref: I18N Example-Footnote-1831672 -Node: Gawk I18N831744 -Node: I18N Summary832382 -Node: Debugger833721 -Node: Debugging834743 -Node: Debugging Concepts835184 -Node: Debugging Terms837037 -Node: Awk Debugging839609 -Node: Sample Debugging Session840503 -Node: Debugger Invocation841023 -Node: Finding The Bug842407 -Node: List of Debugger Commands848882 -Node: Breakpoint Control850215 -Node: Debugger Execution Control853911 -Node: Viewing And Changing Data857275 -Node: Execution Stack860653 -Node: Debugger Info862290 -Node: Miscellaneous Debugger Commands866307 -Node: Readline Support871336 -Node: Limitations872228 -Node: Debugging Summary874342 -Node: Arbitrary Precision Arithmetic875510 -Node: Computer Arithmetic876926 -Ref: table-numeric-ranges880524 -Ref: Computer Arithmetic-Footnote-1881383 -Node: Math Definitions881440 -Ref: table-ieee-formats884728 -Ref: Math Definitions-Footnote-1885332 -Node: MPFR features885437 -Node: FP Math Caution887108 -Ref: FP Math Caution-Footnote-1888158 -Node: Inexactness of computations888527 -Node: Inexact representation889486 -Node: Comparing FP Values890843 -Node: Errors accumulate891925 -Node: Getting Accuracy893358 -Node: Try To Round896020 -Node: Setting precision896919 -Ref: table-predefined-precision-strings897603 -Node: Setting the rounding mode899392 -Ref: table-gawk-rounding-modes899756 -Ref: Setting the rounding mode-Footnote-1903211 -Node: Arbitrary Precision Integers903390 -Ref: Arbitrary Precision Integers-Footnote-1906376 -Node: POSIX Floating Point Problems906525 -Ref: POSIX Floating Point Problems-Footnote-1910398 -Node: Floating point summary910436 -Node: Dynamic Extensions912630 -Node: Extension Intro914182 -Node: Plugin License915448 -Node: Extension Mechanism Outline916245 -Ref: figure-load-extension916673 -Ref: figure-register-new-function918153 -Ref: figure-call-new-function919157 -Node: Extension API Description921143 -Node: Extension API Functions Introduction922593 -Node: General Data Types927417 -Ref: General Data Types-Footnote-1933156 -Node: Memory Allocation Functions933455 -Ref: Memory Allocation Functions-Footnote-1936294 -Node: Constructor Functions936390 -Node: Registration Functions938124 -Node: Extension Functions938809 -Node: Exit Callback Functions941106 -Node: Extension Version String942354 -Node: Input Parsers943019 -Node: Output Wrappers952898 -Node: Two-way processors957413 -Node: Printing Messages959617 -Ref: Printing Messages-Footnote-1960693 -Node: Updating `ERRNO'960845 -Node: Requesting Values961585 -Ref: table-value-types-returned962313 -Node: Accessing Parameters963270 -Node: Symbol Table Access964501 -Node: Symbol table by name965015 -Node: Symbol table by cookie966996 -Ref: Symbol table by cookie-Footnote-1971140 -Node: Cached values971203 -Ref: Cached values-Footnote-1974702 -Node: Array Manipulation974793 -Ref: Array Manipulation-Footnote-1975891 -Node: Array Data Types975928 -Ref: Array Data Types-Footnote-1978583 -Node: Array Functions978675 -Node: Flattening Arrays982529 -Node: Creating Arrays989421 -Node: Extension API Variables994192 -Node: Extension Versioning994828 -Node: Extension API Informational Variables996729 -Node: Extension API Boilerplate997794 -Node: Finding Extensions1001603 -Node: Extension Example1002163 -Node: Internal File Description1002935 -Node: Internal File Ops1007002 -Ref: Internal File Ops-Footnote-11018672 -Node: Using Internal File Ops1018812 -Ref: Using Internal File Ops-Footnote-11021195 -Node: Extension Samples1021468 -Node: Extension Sample File Functions1022994 -Node: Extension Sample Fnmatch1030632 -Node: Extension Sample Fork1032123 -Node: Extension Sample Inplace1033338 -Node: Extension Sample Ord1035013 -Node: Extension Sample Readdir1035849 -Ref: table-readdir-file-types1036725 -Node: Extension Sample Revout1037536 -Node: Extension Sample Rev2way1038126 -Node: Extension Sample Read write array1038866 -Node: Extension Sample Readfile1040806 -Node: Extension Sample Time1041901 -Node: Extension Sample API Tests1043250 -Node: gawkextlib1043741 -Node: Extension summary1046399 -Node: Extension Exercises1050088 -Node: Language History1050810 -Node: V7/SVR3.11052466 -Node: SVR41054647 -Node: POSIX1056092 -Node: BTL1057481 -Node: POSIX/GNU1058215 -Node: Feature History1063779 -Node: Common Extensions1076877 -Node: Ranges and Locales1078201 -Ref: Ranges and Locales-Footnote-11082819 -Ref: Ranges and Locales-Footnote-21082846 -Ref: Ranges and Locales-Footnote-31083080 -Node: Contributors1083301 -Node: History summary1088842 -Node: Installation1090212 -Node: Gawk Distribution1091158 -Node: Getting1091642 -Node: Extracting1092465 -Node: Distribution contents1094100 -Node: Unix Installation1099817 -Node: Quick Installation1100434 -Node: Additional Configuration Options1102858 -Node: Configuration Philosophy1104596 -Node: Non-Unix Installation1106965 -Node: PC Installation1107423 -Node: PC Binary Installation1108742 -Node: PC Compiling1110590 -Ref: PC Compiling-Footnote-11113611 -Node: PC Testing1113720 -Node: PC Using1114896 -Node: Cygwin1119011 -Node: MSYS1119834 -Node: VMS Installation1120334 -Node: VMS Compilation1121126 -Ref: VMS Compilation-Footnote-11122348 -Node: VMS Dynamic Extensions1122406 -Node: VMS Installation Details1124090 -Node: VMS Running1126342 -Node: VMS GNV1129178 -Node: VMS Old Gawk1129912 -Node: Bugs1130382 -Node: Other Versions1134265 -Node: Installation summary1140689 -Node: Notes1141745 -Node: Compatibility Mode1142610 -Node: Additions1143392 -Node: Accessing The Source1144317 -Node: Adding Code1145752 -Node: New Ports1151909 -Node: Derived Files1156391 -Ref: Derived Files-Footnote-11161866 -Ref: Derived Files-Footnote-21161900 -Ref: Derived Files-Footnote-31162496 -Node: Future Extensions1162610 -Node: Implementation Limitations1163216 -Node: Extension Design1164464 -Node: Old Extension Problems1165618 -Ref: Old Extension Problems-Footnote-11167135 -Node: Extension New Mechanism Goals1167192 -Ref: Extension New Mechanism Goals-Footnote-11170552 -Node: Extension Other Design Decisions1170741 -Node: Extension Future Growth1172849 -Node: Old Extension Mechanism1173685 -Node: Notes summary1175447 -Node: Basic Concepts1176633 -Node: Basic High Level1177314 -Ref: figure-general-flow1177586 -Ref: figure-process-flow1178185 -Ref: Basic High Level-Footnote-11181414 -Node: Basic Data Typing1181599 -Node: Glossary1184927 -Node: Copying1216856 -Node: GNU Free Documentation License1254412 -Node: Index1279548 +Node: Egrep Program688019 +Ref: Egrep Program-Footnote-1695522 +Node: Id Program695632 +Node: Split Program699308 +Ref: Split Program-Footnote-1702762 +Node: Tee Program702890 +Node: Uniq Program705679 +Node: Wc Program713098 +Ref: Wc Program-Footnote-1717348 +Node: Miscellaneous Programs717442 +Node: Dupword Program718655 +Node: Alarm Program720686 +Node: Translate Program725491 +Ref: Translate Program-Footnote-1730054 +Node: Labels Program730324 +Ref: Labels Program-Footnote-1733675 +Node: Word Sorting733759 +Node: History Sorting737829 +Node: Extract Program739664 +Node: Simple Sed747188 +Node: Igawk Program750258 +Ref: Igawk Program-Footnote-1764584 +Ref: Igawk Program-Footnote-2764785 +Ref: Igawk Program-Footnote-3764907 +Node: Anagram Program765022 +Node: Signature Program768083 +Node: Programs Summary769330 +Node: Programs Exercises770550 +Ref: Programs Exercises-Footnote-1774681 +Node: Advanced Features774772 +Node: Nondecimal Data776720 +Node: Array Sorting778310 +Node: Controlling Array Traversal779007 +Ref: Controlling Array Traversal-Footnote-1787340 +Node: Array Sorting Functions787458 +Ref: Array Sorting Functions-Footnote-1791347 +Node: Two-way I/O791543 +Ref: Two-way I/O-Footnote-1796488 +Ref: Two-way I/O-Footnote-2796674 +Node: TCP/IP Networking796756 +Node: Profiling799629 +Node: Advanced Features Summary807176 +Node: Internationalization809109 +Node: I18N and L10N810589 +Node: Explaining gettext811275 +Ref: Explaining gettext-Footnote-1816300 +Ref: Explaining gettext-Footnote-2816484 +Node: Programmer i18n816649 +Ref: Programmer i18n-Footnote-1821515 +Node: Translator i18n821564 +Node: String Extraction822358 +Ref: String Extraction-Footnote-1823489 +Node: Printf Ordering823575 +Ref: Printf Ordering-Footnote-1826361 +Node: I18N Portability826425 +Ref: I18N Portability-Footnote-1828880 +Node: I18N Example828943 +Ref: I18N Example-Footnote-1831746 +Node: Gawk I18N831818 +Node: I18N Summary832456 +Node: Debugger833795 +Node: Debugging834817 +Node: Debugging Concepts835258 +Node: Debugging Terms837111 +Node: Awk Debugging839683 +Node: Sample Debugging Session840577 +Node: Debugger Invocation841097 +Node: Finding The Bug842481 +Node: List of Debugger Commands848956 +Node: Breakpoint Control850289 +Node: Debugger Execution Control853985 +Node: Viewing And Changing Data857349 +Node: Execution Stack860727 +Node: Debugger Info862364 +Node: Miscellaneous Debugger Commands866381 +Node: Readline Support871410 +Node: Limitations872302 +Node: Debugging Summary874416 +Node: Arbitrary Precision Arithmetic875584 +Node: Computer Arithmetic877000 +Ref: table-numeric-ranges880598 +Ref: Computer Arithmetic-Footnote-1881457 +Node: Math Definitions881514 +Ref: table-ieee-formats884802 +Ref: Math Definitions-Footnote-1885406 +Node: MPFR features885511 +Node: FP Math Caution887182 +Ref: FP Math Caution-Footnote-1888232 +Node: Inexactness of computations888601 +Node: Inexact representation889560 +Node: Comparing FP Values890917 +Node: Errors accumulate891999 +Node: Getting Accuracy893432 +Node: Try To Round896094 +Node: Setting precision896993 +Ref: table-predefined-precision-strings897677 +Node: Setting the rounding mode899466 +Ref: table-gawk-rounding-modes899830 +Ref: Setting the rounding mode-Footnote-1903285 +Node: Arbitrary Precision Integers903464 +Ref: Arbitrary Precision Integers-Footnote-1906450 +Node: POSIX Floating Point Problems906599 +Ref: POSIX Floating Point Problems-Footnote-1910472 +Node: Floating point summary910510 +Node: Dynamic Extensions912704 +Node: Extension Intro914256 +Node: Plugin License915522 +Node: Extension Mechanism Outline916319 +Ref: figure-load-extension916747 +Ref: figure-register-new-function918227 +Ref: figure-call-new-function919231 +Node: Extension API Description921217 +Node: Extension API Functions Introduction922667 +Node: General Data Types927491 +Ref: General Data Types-Footnote-1933230 +Node: Memory Allocation Functions933529 +Ref: Memory Allocation Functions-Footnote-1936368 +Node: Constructor Functions936464 +Node: Registration Functions938198 +Node: Extension Functions938883 +Node: Exit Callback Functions941180 +Node: Extension Version String942428 +Node: Input Parsers943093 +Node: Output Wrappers952972 +Node: Two-way processors957487 +Node: Printing Messages959691 +Ref: Printing Messages-Footnote-1960767 +Node: Updating `ERRNO'960919 +Node: Requesting Values961659 +Ref: table-value-types-returned962387 +Node: Accessing Parameters963344 +Node: Symbol Table Access964575 +Node: Symbol table by name965089 +Node: Symbol table by cookie967070 +Ref: Symbol table by cookie-Footnote-1971214 +Node: Cached values971277 +Ref: Cached values-Footnote-1974776 +Node: Array Manipulation974867 +Ref: Array Manipulation-Footnote-1975965 +Node: Array Data Types976002 +Ref: Array Data Types-Footnote-1978657 +Node: Array Functions978749 +Node: Flattening Arrays982603 +Node: Creating Arrays989495 +Node: Extension API Variables994266 +Node: Extension Versioning994902 +Node: Extension API Informational Variables996803 +Node: Extension API Boilerplate997868 +Node: Finding Extensions1001677 +Node: Extension Example1002237 +Node: Internal File Description1003009 +Node: Internal File Ops1007076 +Ref: Internal File Ops-Footnote-11018746 +Node: Using Internal File Ops1018886 +Ref: Using Internal File Ops-Footnote-11021269 +Node: Extension Samples1021542 +Node: Extension Sample File Functions1023068 +Node: Extension Sample Fnmatch1030706 +Node: Extension Sample Fork1032197 +Node: Extension Sample Inplace1033412 +Node: Extension Sample Ord1035087 +Node: Extension Sample Readdir1035923 +Ref: table-readdir-file-types1036799 +Node: Extension Sample Revout1037610 +Node: Extension Sample Rev2way1038200 +Node: Extension Sample Read write array1038940 +Node: Extension Sample Readfile1040880 +Node: Extension Sample Time1041975 +Node: Extension Sample API Tests1043324 +Node: gawkextlib1043815 +Node: Extension summary1046473 +Node: Extension Exercises1050162 +Node: Language History1050884 +Node: V7/SVR3.11052540 +Node: SVR41054721 +Node: POSIX1056166 +Node: BTL1057555 +Node: POSIX/GNU1058289 +Node: Feature History1063853 +Node: Common Extensions1076951 +Node: Ranges and Locales1078275 +Ref: Ranges and Locales-Footnote-11082893 +Ref: Ranges and Locales-Footnote-21082920 +Ref: Ranges and Locales-Footnote-31083154 +Node: Contributors1083375 +Node: History summary1088916 +Node: Installation1090286 +Node: Gawk Distribution1091232 +Node: Getting1091716 +Node: Extracting1092539 +Node: Distribution contents1094174 +Node: Unix Installation1099891 +Node: Quick Installation1100508 +Node: Additional Configuration Options1102932 +Node: Configuration Philosophy1104670 +Node: Non-Unix Installation1107039 +Node: PC Installation1107497 +Node: PC Binary Installation1108816 +Node: PC Compiling1110664 +Ref: PC Compiling-Footnote-11113685 +Node: PC Testing1113794 +Node: PC Using1114970 +Node: Cygwin1119085 +Node: MSYS1119908 +Node: VMS Installation1120408 +Node: VMS Compilation1121200 +Ref: VMS Compilation-Footnote-11122422 +Node: VMS Dynamic Extensions1122480 +Node: VMS Installation Details1124164 +Node: VMS Running1126416 +Node: VMS GNV1129252 +Node: VMS Old Gawk1129986 +Node: Bugs1130456 +Node: Other Versions1134339 +Node: Installation summary1140763 +Node: Notes1141819 +Node: Compatibility Mode1142684 +Node: Additions1143466 +Node: Accessing The Source1144391 +Node: Adding Code1145826 +Node: New Ports1151983 +Node: Derived Files1156465 +Ref: Derived Files-Footnote-11161940 +Ref: Derived Files-Footnote-21161974 +Ref: Derived Files-Footnote-31162570 +Node: Future Extensions1162684 +Node: Implementation Limitations1163290 +Node: Extension Design1164538 +Node: Old Extension Problems1165692 +Ref: Old Extension Problems-Footnote-11167209 +Node: Extension New Mechanism Goals1167266 +Ref: Extension New Mechanism Goals-Footnote-11170626 +Node: Extension Other Design Decisions1170815 +Node: Extension Future Growth1172923 +Node: Old Extension Mechanism1173759 +Node: Notes summary1175521 +Node: Basic Concepts1176707 +Node: Basic High Level1177388 +Ref: figure-general-flow1177660 +Ref: figure-process-flow1178259 +Ref: Basic High Level-Footnote-11181488 +Node: Basic Data Typing1181673 +Node: Glossary1185001 +Node: Copying1216930 +Node: GNU Free Documentation License1254486 +Node: Index1279622  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index abc9fa9c..9f06740c 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -23148,10 +23148,10 @@ in this @value{CHAPTER}. The second presents @command{awk} versions of several common POSIX utilities. These are programs that you are hopefully already familiar with, -and therefore, whose problems are understood. +and therefore whose problems are understood. By reimplementing these programs in @command{awk}, you can focus on the @command{awk}-related aspects of solving -the programming problem. +the programming problems. The third is a grab bag of interesting programs. These solve a number of different data-manipulation and management @@ -23211,7 +23211,7 @@ It should be noted that these programs are not necessarily intended to replace the installed versions on your system. Nor may all of these programs be fully compliant with the most recent POSIX standard. This is not a problem; their -purpose is to illustrate @command{awk} language programming for ``real world'' +purpose is to illustrate @command{awk} language programming for ``real-world'' tasks. The programs are presented in alphabetical order. @@ -23240,7 +23240,7 @@ but you may supply a command-line option to change the field @dfn{delimiter} (i.e., the field-separator character). @command{cut}'s definition of fields is less general than @command{awk}'s. -A common use of @command{cut} might be to pull out just the login name of +A common use of @command{cut} might be to pull out just the login names of logged-on users from the output of @command{who}. For example, the following pipeline generates a sorted, unique list of the logged-on users: @@ -23749,7 +23749,7 @@ successful or unsuccessful match. If the line does not match, the @code{next} statement just moves on to the next record. A number of additional tests are made, but they are only done if we -are not counting lines. First, if the user only wants exit status +are not counting lines. First, if the user only wants the exit status (@code{no_print} is true), then it is enough to know that @emph{one} line in this file matched, and we can skip on to the next file with @code{nextfile}. Similarly, if we are only printing @value{FN}s, we can @@ -23790,7 +23790,7 @@ if necessary: @end example The @code{END} rule takes care of producing the correct exit status. If -there are no matches, the exit status is one; otherwise it is zero: +there are no matches, the exit status is one; otherwise, it is zero: @example @c file eg/prog/egrep.awk @@ -23842,7 +23842,8 @@ Here is a simple version of @command{id} written in @command{awk}. It uses the user database library functions (@pxref{Passwd Functions}) and the group database library functions -(@pxref{Group Functions}): +(@pxref{Group Functions}) +from @ref{Library Functions}. The program is fairly straightforward. All the work is done in the @code{BEGIN} rule. The user and group ID numbers are obtained from @@ -23969,8 +23970,8 @@ By default, the output files are named @file{xaa}, @file{xab}, and so on. Each file has 1,000 lines in it, with the likely exception of the last file. To change the number of lines in each file, supply a number on the command line -preceded with a minus (e.g., @samp{-500} for files with 500 lines in them -instead of 1,000). To change the name of the output files to something like +preceded with a minus sign (e.g., @samp{-500} for files with 500 lines in them +instead of 1,000). To change the names of the output files to something like @file{myfileaa}, @file{myfileab}, and so on, supply an additional argument that specifies the @value{FN} prefix. @@ -24809,7 +24810,7 @@ checking and setting of defaults: the delay, the count, and the message to print. If the user supplied a message without the ASCII BEL character (known as the ``alert'' character, @code{"\a"}), then it is added to the message. (On many systems, printing the ASCII BEL generates an -audible alert. Thus when the alarm goes off, the system calls attention +audible alert. Thus, when the alarm goes off, the system calls attention to itself in case the user is not looking at the computer.) Just for a change, this program uses a @code{switch} statement (@pxref{Switch Statement}), but the processing could be done with a series of @@ -24978,7 +24979,7 @@ to @command{gawk}. @c at least theoretically The following program was written to prove that character transliteration could be done with a user-level -function. This program is not as complete as the system @command{tr} utility +function. This program is not as complete as the system @command{tr} utility, but it does most of the job. The @command{translate} program was written long before @command{gawk} @@ -24990,13 +24991,13 @@ takes three arguments: @table @code @item from -A list of characters from which to translate. +A list of characters from which to translate @item to -A list of characters to which to translate. +A list of characters to which to translate @item target -The string on which to do the translation. +The string on which to do the translation @end table Associative arrays make the translation part fairly easy. @code{t_ar} holds @@ -25005,7 +25006,7 @@ loop goes through @code{from}, one character at a time. For each character in @code{from}, if the character appears in @code{target}, it is replaced with the corresponding @code{to} character. -The @code{translate()} function calls @code{stranslate()} using @code{$0} +The @code{translate()} function calls @code{stranslate()}, using @code{$0} as the target. The main program sets two global variables, @code{FROM} and @code{TO}, from the command line, and then changes @code{ARGV} so that @command{awk} reads from the standard input. @@ -25027,7 +25028,7 @@ Finally, the processing rule simply calls @code{translate()} for each record: @c endfile @end ignore @c file eg/prog/translate.awk -# Bugs: does not handle things like: tr A-Z a-z, it has +# Bugs: does not handle things like tr A-Z a-z; it has # to be spelled out. However, if `to' is shorter than `from', # the last character in `to' is used for the rest of `from'. @@ -25103,7 +25104,7 @@ for inspiration. @cindex printing, mailing labels @cindex mailing labels@comma{} printing -Here is a ``real world''@footnote{``Real world'' is defined as +Here is a ``real-world''@footnote{``Real world'' is defined as ``a program actually used to get something done.''} program. This script reads lists of names and @@ -25112,7 +25113,7 @@ on it, two across and 10 down. The addresses are guaranteed to be no more than five lines of data. Each address is separated from the next by a blank line. -The basic idea is to read 20 labels worth of data. Each line of each label +The basic idea is to read 20 labels' worth of data. Each line of each label is stored in the @code{line} array. The single rule takes care of filling the @code{line} array and printing the page when 20 labels have been read. @@ -25135,12 +25136,12 @@ of lines on the page Most of the work is done in the @code{printpage()} function. The label lines are stored sequentially in the @code{line} array. But they -have to print horizontally; @code{line[1]} next to @code{line[6]}, +have to print horizontally: @code{line[1]} next to @code{line[6]}, @code{line[2]} next to @code{line[7]}, and so on. Two loops accomplish this. The outer loop, controlled by @code{i}, steps through every 10 lines of data; this is each row of labels. The inner loop, controlled by @code{j}, goes through the lines within the row. -As @code{j} goes from 0 to 4, @samp{i+j} is the @code{j}-th line in +As @code{j} goes from 0 to 4, @samp{i+j} is the @code{j}th line in the row, and @samp{i+j+5} is the entry next to it. The output ends up looking something like this: @@ -25258,8 +25259,8 @@ END @{ @} @end example -The program relies on @command{awk}'s default field splitting -mechanism to break each line up into ``words,'' and uses an +The program relies on @command{awk}'s default field-splitting +mechanism to break each line up into ``words'' and uses an associative array named @code{freq}, indexed by each word, to count the number of times the word occurs. In the @code{END} rule, it prints the counts. @@ -25364,7 +25365,7 @@ to use the @command{sort} program. @cindex lines, duplicate@comma{} removing The @command{uniq} program -(@pxref{Uniq Program}), +(@pxref{Uniq Program}) removes duplicate lines from @emph{sorted} data. Suppose, however, you need to remove duplicate lines from a @value{DF} but @@ -25451,7 +25452,7 @@ Texinfo input file into separate files. @cindex Texinfo This @value{DOCUMENT} is written in @uref{http://www.gnu.org/software/texinfo/, Texinfo}, -the GNU project's document formatting language. +the GNU Project's document formatting language. A single Texinfo source file can be used to produce both printed documentation, with @TeX{}, and online documentation. @ifnotinfo @@ -25510,7 +25511,7 @@ The Texinfo file looks something like this: @example @dots{} -This program has a @@code@{BEGIN@} rule, +This program has a @@code@{BEGIN@} rule that prints a nice message: @@example @@ -25539,7 +25540,7 @@ exits with a zero exit status, signifying OK: @cindex @code{extract.awk} program @example @c file eg/prog/extract.awk -# extract.awk --- extract files and run programs from texinfo files +# extract.awk --- extract files and run programs from Texinfo files @c endfile @ignore @c file eg/prog/extract.awk @@ -25580,12 +25581,12 @@ The second rule handles moving data into files. It verifies that a @value{FN} is given in the directive. If the file named is not the current file, then the current file is closed. Keeping the current file open until a new file is encountered allows the use of the @samp{>} -redirection for printing the contents, keeping open file management +redirection for printing the contents, keeping open-file management simple. The @code{for} loop does the work. It reads lines using @code{getline} (@pxref{Getline}). -For an unexpected end of file, it calls the @code{@w{unexpected_eof()}} +For an unexpected end-of-file, it calls the @code{@w{unexpected_eof()}} function. If the line is an ``endfile'' line, then it breaks out of the loop. If the line is an @samp{@@group} or @samp{@@end group} line, then it @@ -25687,7 +25688,7 @@ END @{ @cindex @command{sed} utility @cindex stream editors -The @command{sed} utility is a stream editor, a program that reads a +The @command{sed} utility is a @dfn{stream editor}, a program that reads a stream of data, makes changes to it, and passes it on. It is often used to make global changes to a large file or to a stream of data generated by a pipeline of commands. @@ -25832,7 +25833,7 @@ includes don't accidentally include a library function twice. @command{igawk} should behave just like @command{gawk} externally. This means it should accept all of @command{gawk}'s command-line arguments, including the ability to have multiple source files specified via -@option{-f}, and the ability to mix command-line and library source files. +@option{-f} and the ability to mix command-line and library source files. The program is written using the POSIX Shell (@command{sh}) command language.@footnote{Fully explaining the @command{sh} language is beyond @@ -25871,7 +25872,7 @@ Run the expanded program with @command{gawk} and any other original command-line arguments that the user supplied (such as the @value{DF} names). @end enumerate -This program uses shell variables extensively: for storing command-line arguments, +This program uses shell variables extensively: for storing command-line arguments and the text of the @command{awk} program that will expand the user's program, for the user's original program, and for the expanded program. Doing so removes some potential problems that might arise were we to use temporary files instead, @@ -26188,22 +26189,7 @@ Save the results of this processing in the shell variable The last step is to call @command{gawk} with the expanded program, along with the original -options and command-line arguments that the user supplied. - -@c this causes more problems than it solves, so leave it out. -@ignore -The special file @file{/dev/null} is passed as a @value{DF} to @command{gawk} -to handle an interesting case. Suppose that the user's program only has -a @code{BEGIN} rule and there are no @value{DF}s to read. -The program should exit without reading any @value{DF}s. -However, suppose that an included library file defines an @code{END} -rule of its own. In this case, @command{gawk} will hang, reading standard -input. In order to avoid this, @file{/dev/null} is explicitly added to the -command line. Reading from @file{/dev/null} always returns an immediate -end of file indication. - -@c Hmm. Add /dev/null if $# is 0? Still messes up ARGV. Sigh. -@end ignore +options and command-line arguments that the user supplied: @example @c file eg/prog/igawk.sh @@ -26269,8 +26255,8 @@ the same letters Column 2, Problem C, of Jon Bentley's @cite{Programming Pearls}, Second Edition, presents an elegant algorithm. The idea is to give words that are anagrams a common signature, sort all the words together by their -signature, and then print them. Dr.@: Bentley observes that taking the -letters in each word and sorting them produces that common signature. +signatures, and then print them. Dr.@: Bentley observes that taking the +letters in each word and sorting them produces those common signatures. The following program uses arrays of arrays to bring together words with the same signature and array sorting to print the words @@ -26279,8 +26265,8 @@ in sorted order: @cindex @code{anagram.awk} program @example @c file eg/prog/anagram.awk -# anagram.awk --- An implementation of the anagram finding algorithm -# from Jon Bentley's "Programming Pearls", 2nd edition. +# anagram.awk --- An implementation of the anagram-finding algorithm +# from Jon Bentley's "Programming Pearls," 2nd edition. # Addison Wesley, 2000, ISBN 0-201-65788-0. # Column 2, Problem C, section 2.8, pp 18-20. @c endfile @@ -26328,7 +26314,7 @@ sorts the letters, and then joins them back together: @example @c file eg/prog/anagram.awk -# word2key --- split word apart into letters, sort, joining back together +# word2key --- split word apart into letters, sort, and join back together function word2key(word, a, i, n, result) @{ @@ -26523,12 +26509,13 @@ characters. The ability to use @code{split()} with the empty string as the separator can considerably simplify such tasks. @item -The library functions from @ref{Library Functions}, proved their -usefulness for a number of real (if small) programs. +The examples here demonstrate the usefulness of the library +functions from @ref{Library Functions} +for a number of real (if small) programs. @item Besides reinventing POSIX wheels, other programs solved a selection of -interesting problems, such as finding duplicates words in text, printing +interesting problems, such as finding duplicate words in text, printing mailing labels, and finding anagrams. @end itemize diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 2e2d0e04..cfddbd16 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -22239,10 +22239,10 @@ in this @value{CHAPTER}. The second presents @command{awk} versions of several common POSIX utilities. These are programs that you are hopefully already familiar with, -and therefore, whose problems are understood. +and therefore whose problems are understood. By reimplementing these programs in @command{awk}, you can focus on the @command{awk}-related aspects of solving -the programming problem. +the programming problems. The third is a grab bag of interesting programs. These solve a number of different data-manipulation and management @@ -22302,7 +22302,7 @@ It should be noted that these programs are not necessarily intended to replace the installed versions on your system. Nor may all of these programs be fully compliant with the most recent POSIX standard. This is not a problem; their -purpose is to illustrate @command{awk} language programming for ``real world'' +purpose is to illustrate @command{awk} language programming for ``real-world'' tasks. The programs are presented in alphabetical order. @@ -22331,7 +22331,7 @@ but you may supply a command-line option to change the field @dfn{delimiter} (i.e., the field-separator character). @command{cut}'s definition of fields is less general than @command{awk}'s. -A common use of @command{cut} might be to pull out just the login name of +A common use of @command{cut} might be to pull out just the login names of logged-on users from the output of @command{who}. For example, the following pipeline generates a sorted, unique list of the logged-on users: @@ -22840,7 +22840,7 @@ successful or unsuccessful match. If the line does not match, the @code{next} statement just moves on to the next record. A number of additional tests are made, but they are only done if we -are not counting lines. First, if the user only wants exit status +are not counting lines. First, if the user only wants the exit status (@code{no_print} is true), then it is enough to know that @emph{one} line in this file matched, and we can skip on to the next file with @code{nextfile}. Similarly, if we are only printing @value{FN}s, we can @@ -22881,7 +22881,7 @@ if necessary: @end example The @code{END} rule takes care of producing the correct exit status. If -there are no matches, the exit status is one; otherwise it is zero: +there are no matches, the exit status is one; otherwise, it is zero: @example @c file eg/prog/egrep.awk @@ -22933,7 +22933,8 @@ Here is a simple version of @command{id} written in @command{awk}. It uses the user database library functions (@pxref{Passwd Functions}) and the group database library functions -(@pxref{Group Functions}): +(@pxref{Group Functions}) +from @ref{Library Functions}. The program is fairly straightforward. All the work is done in the @code{BEGIN} rule. The user and group ID numbers are obtained from @@ -23060,8 +23061,8 @@ By default, the output files are named @file{xaa}, @file{xab}, and so on. Each file has 1,000 lines in it, with the likely exception of the last file. To change the number of lines in each file, supply a number on the command line -preceded with a minus (e.g., @samp{-500} for files with 500 lines in them -instead of 1,000). To change the name of the output files to something like +preceded with a minus sign (e.g., @samp{-500} for files with 500 lines in them +instead of 1,000). To change the names of the output files to something like @file{myfileaa}, @file{myfileab}, and so on, supply an additional argument that specifies the @value{FN} prefix. @@ -23900,7 +23901,7 @@ checking and setting of defaults: the delay, the count, and the message to print. If the user supplied a message without the ASCII BEL character (known as the ``alert'' character, @code{"\a"}), then it is added to the message. (On many systems, printing the ASCII BEL generates an -audible alert. Thus when the alarm goes off, the system calls attention +audible alert. Thus, when the alarm goes off, the system calls attention to itself in case the user is not looking at the computer.) Just for a change, this program uses a @code{switch} statement (@pxref{Switch Statement}), but the processing could be done with a series of @@ -24069,7 +24070,7 @@ to @command{gawk}. @c at least theoretically The following program was written to prove that character transliteration could be done with a user-level -function. This program is not as complete as the system @command{tr} utility +function. This program is not as complete as the system @command{tr} utility, but it does most of the job. The @command{translate} program was written long before @command{gawk} @@ -24081,13 +24082,13 @@ takes three arguments: @table @code @item from -A list of characters from which to translate. +A list of characters from which to translate @item to -A list of characters to which to translate. +A list of characters to which to translate @item target -The string on which to do the translation. +The string on which to do the translation @end table Associative arrays make the translation part fairly easy. @code{t_ar} holds @@ -24096,7 +24097,7 @@ loop goes through @code{from}, one character at a time. For each character in @code{from}, if the character appears in @code{target}, it is replaced with the corresponding @code{to} character. -The @code{translate()} function calls @code{stranslate()} using @code{$0} +The @code{translate()} function calls @code{stranslate()}, using @code{$0} as the target. The main program sets two global variables, @code{FROM} and @code{TO}, from the command line, and then changes @code{ARGV} so that @command{awk} reads from the standard input. @@ -24118,7 +24119,7 @@ Finally, the processing rule simply calls @code{translate()} for each record: @c endfile @end ignore @c file eg/prog/translate.awk -# Bugs: does not handle things like: tr A-Z a-z, it has +# Bugs: does not handle things like tr A-Z a-z; it has # to be spelled out. However, if `to' is shorter than `from', # the last character in `to' is used for the rest of `from'. @@ -24194,7 +24195,7 @@ for inspiration. @cindex printing, mailing labels @cindex mailing labels@comma{} printing -Here is a ``real world''@footnote{``Real world'' is defined as +Here is a ``real-world''@footnote{``Real world'' is defined as ``a program actually used to get something done.''} program. This script reads lists of names and @@ -24203,7 +24204,7 @@ on it, two across and 10 down. The addresses are guaranteed to be no more than five lines of data. Each address is separated from the next by a blank line. -The basic idea is to read 20 labels worth of data. Each line of each label +The basic idea is to read 20 labels' worth of data. Each line of each label is stored in the @code{line} array. The single rule takes care of filling the @code{line} array and printing the page when 20 labels have been read. @@ -24226,12 +24227,12 @@ of lines on the page Most of the work is done in the @code{printpage()} function. The label lines are stored sequentially in the @code{line} array. But they -have to print horizontally; @code{line[1]} next to @code{line[6]}, +have to print horizontally: @code{line[1]} next to @code{line[6]}, @code{line[2]} next to @code{line[7]}, and so on. Two loops accomplish this. The outer loop, controlled by @code{i}, steps through every 10 lines of data; this is each row of labels. The inner loop, controlled by @code{j}, goes through the lines within the row. -As @code{j} goes from 0 to 4, @samp{i+j} is the @code{j}-th line in +As @code{j} goes from 0 to 4, @samp{i+j} is the @code{j}th line in the row, and @samp{i+j+5} is the entry next to it. The output ends up looking something like this: @@ -24349,8 +24350,8 @@ END @{ @} @end example -The program relies on @command{awk}'s default field splitting -mechanism to break each line up into ``words,'' and uses an +The program relies on @command{awk}'s default field-splitting +mechanism to break each line up into ``words'' and uses an associative array named @code{freq}, indexed by each word, to count the number of times the word occurs. In the @code{END} rule, it prints the counts. @@ -24455,7 +24456,7 @@ to use the @command{sort} program. @cindex lines, duplicate@comma{} removing The @command{uniq} program -(@pxref{Uniq Program}), +(@pxref{Uniq Program}) removes duplicate lines from @emph{sorted} data. Suppose, however, you need to remove duplicate lines from a @value{DF} but @@ -24542,7 +24543,7 @@ Texinfo input file into separate files. @cindex Texinfo This @value{DOCUMENT} is written in @uref{http://www.gnu.org/software/texinfo/, Texinfo}, -the GNU project's document formatting language. +the GNU Project's document formatting language. A single Texinfo source file can be used to produce both printed documentation, with @TeX{}, and online documentation. @ifnotinfo @@ -24601,7 +24602,7 @@ The Texinfo file looks something like this: @example @dots{} -This program has a @@code@{BEGIN@} rule, +This program has a @@code@{BEGIN@} rule that prints a nice message: @@example @@ -24630,7 +24631,7 @@ exits with a zero exit status, signifying OK: @cindex @code{extract.awk} program @example @c file eg/prog/extract.awk -# extract.awk --- extract files and run programs from texinfo files +# extract.awk --- extract files and run programs from Texinfo files @c endfile @ignore @c file eg/prog/extract.awk @@ -24671,12 +24672,12 @@ The second rule handles moving data into files. It verifies that a @value{FN} is given in the directive. If the file named is not the current file, then the current file is closed. Keeping the current file open until a new file is encountered allows the use of the @samp{>} -redirection for printing the contents, keeping open file management +redirection for printing the contents, keeping open-file management simple. The @code{for} loop does the work. It reads lines using @code{getline} (@pxref{Getline}). -For an unexpected end of file, it calls the @code{@w{unexpected_eof()}} +For an unexpected end-of-file, it calls the @code{@w{unexpected_eof()}} function. If the line is an ``endfile'' line, then it breaks out of the loop. If the line is an @samp{@@group} or @samp{@@end group} line, then it @@ -24778,7 +24779,7 @@ END @{ @cindex @command{sed} utility @cindex stream editors -The @command{sed} utility is a stream editor, a program that reads a +The @command{sed} utility is a @dfn{stream editor}, a program that reads a stream of data, makes changes to it, and passes it on. It is often used to make global changes to a large file or to a stream of data generated by a pipeline of commands. @@ -24923,7 +24924,7 @@ includes don't accidentally include a library function twice. @command{igawk} should behave just like @command{gawk} externally. This means it should accept all of @command{gawk}'s command-line arguments, including the ability to have multiple source files specified via -@option{-f}, and the ability to mix command-line and library source files. +@option{-f} and the ability to mix command-line and library source files. The program is written using the POSIX Shell (@command{sh}) command language.@footnote{Fully explaining the @command{sh} language is beyond @@ -24962,7 +24963,7 @@ Run the expanded program with @command{gawk} and any other original command-line arguments that the user supplied (such as the @value{DF} names). @end enumerate -This program uses shell variables extensively: for storing command-line arguments, +This program uses shell variables extensively: for storing command-line arguments and the text of the @command{awk} program that will expand the user's program, for the user's original program, and for the expanded program. Doing so removes some potential problems that might arise were we to use temporary files instead, @@ -25279,22 +25280,7 @@ Save the results of this processing in the shell variable The last step is to call @command{gawk} with the expanded program, along with the original -options and command-line arguments that the user supplied. - -@c this causes more problems than it solves, so leave it out. -@ignore -The special file @file{/dev/null} is passed as a @value{DF} to @command{gawk} -to handle an interesting case. Suppose that the user's program only has -a @code{BEGIN} rule and there are no @value{DF}s to read. -The program should exit without reading any @value{DF}s. -However, suppose that an included library file defines an @code{END} -rule of its own. In this case, @command{gawk} will hang, reading standard -input. In order to avoid this, @file{/dev/null} is explicitly added to the -command line. Reading from @file{/dev/null} always returns an immediate -end of file indication. - -@c Hmm. Add /dev/null if $# is 0? Still messes up ARGV. Sigh. -@end ignore +options and command-line arguments that the user supplied: @example @c file eg/prog/igawk.sh @@ -25360,8 +25346,8 @@ the same letters Column 2, Problem C, of Jon Bentley's @cite{Programming Pearls}, Second Edition, presents an elegant algorithm. The idea is to give words that are anagrams a common signature, sort all the words together by their -signature, and then print them. Dr.@: Bentley observes that taking the -letters in each word and sorting them produces that common signature. +signatures, and then print them. Dr.@: Bentley observes that taking the +letters in each word and sorting them produces those common signatures. The following program uses arrays of arrays to bring together words with the same signature and array sorting to print the words @@ -25370,8 +25356,8 @@ in sorted order: @cindex @code{anagram.awk} program @example @c file eg/prog/anagram.awk -# anagram.awk --- An implementation of the anagram finding algorithm -# from Jon Bentley's "Programming Pearls", 2nd edition. +# anagram.awk --- An implementation of the anagram-finding algorithm +# from Jon Bentley's "Programming Pearls," 2nd edition. # Addison Wesley, 2000, ISBN 0-201-65788-0. # Column 2, Problem C, section 2.8, pp 18-20. @c endfile @@ -25419,7 +25405,7 @@ sorts the letters, and then joins them back together: @example @c file eg/prog/anagram.awk -# word2key --- split word apart into letters, sort, joining back together +# word2key --- split word apart into letters, sort, and join back together function word2key(word, a, i, n, result) @{ @@ -25614,12 +25600,13 @@ characters. The ability to use @code{split()} with the empty string as the separator can considerably simplify such tasks. @item -The library functions from @ref{Library Functions}, proved their -usefulness for a number of real (if small) programs. +The examples here demonstrate the usefulness of the library +functions from @DBREF{Library Functions} +for a number of real (if small) programs. @item Besides reinventing POSIX wheels, other programs solved a selection of -interesting problems, such as finding duplicates words in text, printing +interesting problems, such as finding duplicate words in text, printing mailing labels, and finding anagrams. @end itemize -- cgit v1.2.3 From 98c6780098e577324c7642362a689c0d7dbe056d Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 4 Feb 2015 08:31:16 +0200 Subject: Update version-related stuff in the doc. --- doc/ChangeLog | 1 + doc/gawk.info | 1026 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 54 ++- doc/gawktexi.in | 52 ++- 4 files changed, 624 insertions(+), 509 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 43d935fa..e613ffa6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2015-02-04 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. + * gawktexi.in: Update various version-related bits of info. 2015-02-02 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index bfca7f05..f488769b 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -3453,8 +3453,8 @@ sequences apply to both string constants and regexp constants: would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. However, using more than two hexadecimal - digits produced undefined results. As of version *FIXME:* - 4.3.0, only two digits are processed. + digits produced undefined results. As of version 4.2, only + two digits are processed. `\/' A literal slash (necessary for regexp constants only). This @@ -19011,7 +19011,7 @@ File: gawk.info, Node: Programs Summary, Next: Programs Exercises, Prev: Misc the separator can considerably simplify such tasks. * The examples here demonstrate the usefulness of the library - functions from *note Library Functions:: for a number of real (if + functions from *note Library Functions::, for a number of real (if small) programs. * Besides reinventing POSIX wheels, other programs solved a @@ -26519,6 +26519,9 @@ the current version of `gawk'. - The `bindtextdomain()', `dcgettext()' and `dcngettext()' functions for internationalization (*note Programmer i18n::). + - The `div()' function for doing integer division and remainder + (*note Numeric Functions::). + * Changes and/or additions in the command-line options: - The `AWKPATH' environment variable for specifying a path @@ -26573,7 +26576,10 @@ the current version of `gawk'. - Ultrix - * Support for MirBSD was removed at `gawk' version 4.2. + * Support for the following systems was removed from the code for + `gawk' version 4.2: + + - MirBSD  @@ -26960,6 +26966,26 @@ in POSIX `awk', in the order they were added to `gawk'. * The dynamic extension interface was completely redone (*note Dynamic Extensions::). + * Support for Ultrix was removed. + + + Version 4.2 introduced the following changes: + + * Changes to `ENVIRON' are reflected into `gawk''s environment and + that of programs that it runs. *Note Auto-set::. + + * The `--pretty-print' option no longer runs the `awk' program too. + *Note Options::. + + * The `igawk' program and its manual page are no longer installed + when `gawk' is built. *Note Igawk Program::. + + * The `div()' function. *Note Numeric Functions::. + + * The maximum number of hexdecimal digits in `\x' escapes is now two. + *Note Escape Sequences::. + + * Support for MirBSD was removed.  File: gawk.info, Node: Common Extensions, Next: Ranges and Locales, Prev: Feature History, Up: Language History @@ -34689,501 +34715,501 @@ Node: Invoking Summary151836 Node: Regexp153499 Node: Regexp Usage154953 Node: Escape Sequences156990 -Node: Regexp Operators163230 -Ref: Regexp Operators-Footnote-1170640 -Ref: Regexp Operators-Footnote-2170787 -Node: Bracket Expressions170885 -Ref: table-char-classes172900 -Node: Leftmost Longest175842 -Node: Computed Regexps177144 -Node: GNU Regexp Operators180573 -Node: Case-sensitivity184245 -Ref: Case-sensitivity-Footnote-1187130 -Ref: Case-sensitivity-Footnote-2187365 -Node: Regexp Summary187473 -Node: Reading Files188940 -Node: Records191033 -Node: awk split records191766 -Node: gawk split records196695 -Ref: gawk split records-Footnote-1201234 -Node: Fields201271 -Ref: Fields-Footnote-1204049 -Node: Nonconstant Fields204135 -Ref: Nonconstant Fields-Footnote-1206373 -Node: Changing Fields206576 -Node: Field Separators212507 -Node: Default Field Splitting215211 -Node: Regexp Field Splitting216328 -Node: Single Character Fields219678 -Node: Command Line Field Separator220737 -Node: Full Line Fields223954 -Ref: Full Line Fields-Footnote-1225475 -Ref: Full Line Fields-Footnote-2225521 -Node: Field Splitting Summary225622 -Node: Constant Size227696 -Node: Splitting By Content232279 -Ref: Splitting By Content-Footnote-1236244 -Node: Multiple Line236407 -Ref: Multiple Line-Footnote-1242288 -Node: Getline242467 -Node: Plain Getline244674 -Node: Getline/Variable247314 -Node: Getline/File248463 -Node: Getline/Variable/File249848 -Ref: Getline/Variable/File-Footnote-1251451 -Node: Getline/Pipe251538 -Node: Getline/Variable/Pipe254216 -Node: Getline/Coprocess255347 -Node: Getline/Variable/Coprocess256611 -Node: Getline Notes257350 -Node: Getline Summary260144 -Ref: table-getline-variants260556 -Node: Read Timeout261385 -Ref: Read Timeout-Footnote-1265222 -Node: Command-line directories265280 -Node: Input Summary266185 -Node: Input Exercises269570 -Node: Printing270298 -Node: Print272075 -Node: Print Examples273532 -Node: Output Separators276311 -Node: OFMT278329 -Node: Printf279684 -Node: Basic Printf280469 -Node: Control Letters282041 -Node: Format Modifiers286026 -Node: Printf Examples292036 -Node: Redirection294522 -Node: Special FD301360 -Ref: Special FD-Footnote-1304526 -Node: Special Files304600 -Node: Other Inherited Files305217 -Node: Special Network306217 -Node: Special Caveats307079 -Node: Close Files And Pipes308028 -Ref: Close Files And Pipes-Footnote-1315219 -Ref: Close Files And Pipes-Footnote-2315367 -Node: Output Summary315517 -Node: Output Exercises316515 -Node: Expressions317195 -Node: Values318384 -Node: Constants319061 -Node: Scalar Constants319752 -Ref: Scalar Constants-Footnote-1320614 -Node: Nondecimal-numbers320864 -Node: Regexp Constants323874 -Node: Using Constant Regexps324400 -Node: Variables327563 -Node: Using Variables328220 -Node: Assignment Options330131 -Node: Conversion332006 -Node: Strings And Numbers332530 -Ref: Strings And Numbers-Footnote-1335595 -Node: Locale influences conversions335704 -Ref: table-locale-affects338450 -Node: All Operators339042 -Node: Arithmetic Ops339671 -Node: Concatenation342176 -Ref: Concatenation-Footnote-1344995 -Node: Assignment Ops345102 -Ref: table-assign-ops350081 -Node: Increment Ops351391 -Node: Truth Values and Conditions354822 -Node: Truth Values355905 -Node: Typing and Comparison356954 -Node: Variable Typing357770 -Node: Comparison Operators361437 -Ref: table-relational-ops361847 -Node: POSIX String Comparison365342 -Ref: POSIX String Comparison-Footnote-1366414 -Node: Boolean Ops366553 -Ref: Boolean Ops-Footnote-1371031 -Node: Conditional Exp371122 -Node: Function Calls372860 -Node: Precedence376740 -Node: Locales380400 -Node: Expressions Summary382032 -Node: Patterns and Actions384603 -Node: Pattern Overview385723 -Node: Regexp Patterns387402 -Node: Expression Patterns387945 -Node: Ranges391654 -Node: BEGIN/END394761 -Node: Using BEGIN/END395522 -Ref: Using BEGIN/END-Footnote-1398258 -Node: I/O And BEGIN/END398364 -Node: BEGINFILE/ENDFILE400679 -Node: Empty403576 -Node: Using Shell Variables403893 -Node: Action Overview406166 -Node: Statements408492 -Node: If Statement410340 -Node: While Statement411835 -Node: Do Statement413863 -Node: For Statement415011 -Node: Switch Statement418169 -Node: Break Statement420551 -Node: Continue Statement422592 -Node: Next Statement424419 -Node: Nextfile Statement426800 -Node: Exit Statement429428 -Node: Built-in Variables431839 -Node: User-modified432972 -Ref: User-modified-Footnote-1440675 -Node: Auto-set440737 -Ref: Auto-set-Footnote-1454446 -Ref: Auto-set-Footnote-2454651 -Node: ARGC and ARGV454707 -Node: Pattern Action Summary458925 -Node: Arrays461358 -Node: Array Basics462687 -Node: Array Intro463531 -Ref: figure-array-elements465465 -Ref: Array Intro-Footnote-1468085 -Node: Reference to Elements468213 -Node: Assigning Elements470675 -Node: Array Example471166 -Node: Scanning an Array472925 -Node: Controlling Scanning475945 -Ref: Controlling Scanning-Footnote-1481339 -Node: Numeric Array Subscripts481655 -Node: Uninitialized Subscripts483840 -Node: Delete485457 -Ref: Delete-Footnote-1488206 -Node: Multidimensional488263 -Node: Multiscanning491360 -Node: Arrays of Arrays492949 -Node: Arrays Summary497703 -Node: Functions499794 -Node: Built-in500833 -Node: Calling Built-in501911 -Node: Numeric Functions503906 -Ref: Numeric Functions-Footnote-1508724 -Ref: Numeric Functions-Footnote-2509081 -Ref: Numeric Functions-Footnote-3509129 -Node: String Functions509401 -Ref: String Functions-Footnote-1532902 -Ref: String Functions-Footnote-2533031 -Ref: String Functions-Footnote-3533279 -Node: Gory Details533366 -Ref: table-sub-escapes535147 -Ref: table-sub-proposed536662 -Ref: table-posix-sub538024 -Ref: table-gensub-escapes539561 -Ref: Gory Details-Footnote-1540394 -Node: I/O Functions540545 -Ref: I/O Functions-Footnote-1547781 -Node: Time Functions547928 -Ref: Time Functions-Footnote-1558437 -Ref: Time Functions-Footnote-2558505 -Ref: Time Functions-Footnote-3558663 -Ref: Time Functions-Footnote-4558774 -Ref: Time Functions-Footnote-5558886 -Ref: Time Functions-Footnote-6559113 -Node: Bitwise Functions559379 -Ref: table-bitwise-ops559941 -Ref: Bitwise Functions-Footnote-1564269 -Node: Type Functions564441 -Node: I18N Functions565593 -Node: User-defined567240 -Node: Definition Syntax568045 -Ref: Definition Syntax-Footnote-1573704 -Node: Function Example573775 -Ref: Function Example-Footnote-1576696 -Node: Function Caveats576718 -Node: Calling A Function577236 -Node: Variable Scope578194 -Node: Pass By Value/Reference581187 -Node: Return Statement584684 -Node: Dynamic Typing587663 -Node: Indirect Calls588592 -Ref: Indirect Calls-Footnote-1599898 -Node: Functions Summary600026 -Node: Library Functions602728 -Ref: Library Functions-Footnote-1606336 -Ref: Library Functions-Footnote-2606479 -Node: Library Names606650 -Ref: Library Names-Footnote-1610108 -Ref: Library Names-Footnote-2610331 -Node: General Functions610417 -Node: Strtonum Function611520 -Node: Assert Function614542 -Node: Round Function617866 -Node: Cliff Random Function619407 -Node: Ordinal Functions620423 -Ref: Ordinal Functions-Footnote-1623486 -Ref: Ordinal Functions-Footnote-2623738 -Node: Join Function623949 -Ref: Join Function-Footnote-1625719 -Node: Getlocaltime Function625919 -Node: Readfile Function629663 -Node: Shell Quoting631635 -Node: Data File Management633036 -Node: Filetrans Function633668 -Node: Rewind Function637764 -Node: File Checking639150 -Ref: File Checking-Footnote-1640483 -Node: Empty Files640684 -Node: Ignoring Assigns642663 -Node: Getopt Function644213 -Ref: Getopt Function-Footnote-1655677 -Node: Passwd Functions655877 -Ref: Passwd Functions-Footnote-1664717 -Node: Group Functions664805 -Ref: Group Functions-Footnote-1672702 -Node: Walking Arrays672907 -Node: Library Functions Summary674507 -Node: Library Exercises675911 -Node: Sample Programs677191 -Node: Running Examples677961 -Node: Clones678689 -Node: Cut Program679913 -Node: Egrep Program689633 -Ref: Egrep Program-Footnote-1697136 -Node: Id Program697246 -Node: Split Program700922 -Ref: Split Program-Footnote-1704376 -Node: Tee Program704504 -Node: Uniq Program707293 -Node: Wc Program714712 -Ref: Wc Program-Footnote-1718962 -Node: Miscellaneous Programs719056 -Node: Dupword Program720269 -Node: Alarm Program722300 -Node: Translate Program727105 -Ref: Translate Program-Footnote-1731668 -Node: Labels Program731938 -Ref: Labels Program-Footnote-1735289 -Node: Word Sorting735373 -Node: History Sorting739443 -Node: Extract Program741278 -Node: Simple Sed748802 -Node: Igawk Program751872 -Ref: Igawk Program-Footnote-1766198 -Ref: Igawk Program-Footnote-2766399 -Ref: Igawk Program-Footnote-3766521 -Node: Anagram Program766636 -Node: Signature Program769697 -Node: Programs Summary770944 -Node: Programs Exercises772164 -Ref: Programs Exercises-Footnote-1776295 -Node: Advanced Features776386 -Node: Nondecimal Data778334 -Node: Array Sorting779924 -Node: Controlling Array Traversal780621 -Ref: Controlling Array Traversal-Footnote-1788954 -Node: Array Sorting Functions789072 -Ref: Array Sorting Functions-Footnote-1792961 -Node: Two-way I/O793157 -Ref: Two-way I/O-Footnote-1798102 -Ref: Two-way I/O-Footnote-2798288 -Node: TCP/IP Networking798370 -Node: Profiling801243 -Node: Advanced Features Summary809520 -Node: Internationalization811453 -Node: I18N and L10N812933 -Node: Explaining gettext813619 -Ref: Explaining gettext-Footnote-1818644 -Ref: Explaining gettext-Footnote-2818828 -Node: Programmer i18n818993 -Ref: Programmer i18n-Footnote-1823859 -Node: Translator i18n823908 -Node: String Extraction824702 -Ref: String Extraction-Footnote-1825833 -Node: Printf Ordering825919 -Ref: Printf Ordering-Footnote-1828705 -Node: I18N Portability828769 -Ref: I18N Portability-Footnote-1831224 -Node: I18N Example831287 -Ref: I18N Example-Footnote-1834090 -Node: Gawk I18N834162 -Node: I18N Summary834800 -Node: Debugger836139 -Node: Debugging837161 -Node: Debugging Concepts837602 -Node: Debugging Terms839455 -Node: Awk Debugging842027 -Node: Sample Debugging Session842921 -Node: Debugger Invocation843441 -Node: Finding The Bug844825 -Node: List of Debugger Commands851300 -Node: Breakpoint Control852633 -Node: Debugger Execution Control856329 -Node: Viewing And Changing Data859693 -Node: Execution Stack863071 -Node: Debugger Info864708 -Node: Miscellaneous Debugger Commands868725 -Node: Readline Support873754 -Node: Limitations874646 -Node: Debugging Summary876760 -Node: Arbitrary Precision Arithmetic877928 -Node: Computer Arithmetic879344 -Ref: table-numeric-ranges882942 -Ref: Computer Arithmetic-Footnote-1883801 -Node: Math Definitions883858 -Ref: table-ieee-formats887146 -Ref: Math Definitions-Footnote-1887750 -Node: MPFR features887855 -Node: FP Math Caution889526 -Ref: FP Math Caution-Footnote-1890576 -Node: Inexactness of computations890945 -Node: Inexact representation891904 -Node: Comparing FP Values893261 -Node: Errors accumulate894343 -Node: Getting Accuracy895776 -Node: Try To Round898438 -Node: Setting precision899337 -Ref: table-predefined-precision-strings900021 -Node: Setting the rounding mode901810 -Ref: table-gawk-rounding-modes902174 -Ref: Setting the rounding mode-Footnote-1905629 -Node: Arbitrary Precision Integers905808 -Ref: Arbitrary Precision Integers-Footnote-1910708 -Node: POSIX Floating Point Problems910857 -Ref: POSIX Floating Point Problems-Footnote-1914730 -Node: Floating point summary914768 -Node: Dynamic Extensions916962 -Node: Extension Intro918514 -Node: Plugin License919780 -Node: Extension Mechanism Outline920577 -Ref: figure-load-extension921005 -Ref: figure-register-new-function922485 -Ref: figure-call-new-function923489 -Node: Extension API Description925475 -Node: Extension API Functions Introduction926925 -Node: General Data Types931749 -Ref: General Data Types-Footnote-1937488 -Node: Memory Allocation Functions937787 -Ref: Memory Allocation Functions-Footnote-1940626 -Node: Constructor Functions940722 -Node: Registration Functions942456 -Node: Extension Functions943141 -Node: Exit Callback Functions945438 -Node: Extension Version String946686 -Node: Input Parsers947351 -Node: Output Wrappers957230 -Node: Two-way processors961745 -Node: Printing Messages963949 -Ref: Printing Messages-Footnote-1965025 -Node: Updating `ERRNO'965177 -Node: Requesting Values965917 -Ref: table-value-types-returned966645 -Node: Accessing Parameters967602 -Node: Symbol Table Access968833 -Node: Symbol table by name969347 -Node: Symbol table by cookie971328 -Ref: Symbol table by cookie-Footnote-1975472 -Node: Cached values975535 -Ref: Cached values-Footnote-1979034 -Node: Array Manipulation979125 -Ref: Array Manipulation-Footnote-1980223 -Node: Array Data Types980260 -Ref: Array Data Types-Footnote-1982915 -Node: Array Functions983007 -Node: Flattening Arrays986861 -Node: Creating Arrays993753 -Node: Extension API Variables998524 -Node: Extension Versioning999160 -Node: Extension API Informational Variables1001061 -Node: Extension API Boilerplate1002126 -Node: Finding Extensions1005935 -Node: Extension Example1006495 -Node: Internal File Description1007267 -Node: Internal File Ops1011334 -Ref: Internal File Ops-Footnote-11023004 -Node: Using Internal File Ops1023144 -Ref: Using Internal File Ops-Footnote-11025527 -Node: Extension Samples1025800 -Node: Extension Sample File Functions1027326 -Node: Extension Sample Fnmatch1034964 -Node: Extension Sample Fork1036455 -Node: Extension Sample Inplace1037670 -Node: Extension Sample Ord1039345 -Node: Extension Sample Readdir1040181 -Ref: table-readdir-file-types1041057 -Node: Extension Sample Revout1041868 -Node: Extension Sample Rev2way1042458 -Node: Extension Sample Read write array1043198 -Node: Extension Sample Readfile1045138 -Node: Extension Sample Time1046233 -Node: Extension Sample API Tests1047582 -Node: gawkextlib1048073 -Node: Extension summary1050731 -Node: Extension Exercises1054420 -Node: Language History1055142 -Node: V7/SVR3.11056798 -Node: SVR41058979 -Node: POSIX1060424 -Node: BTL1061813 -Node: POSIX/GNU1062547 -Node: Feature History1068171 -Node: Common Extensions1081269 -Node: Ranges and Locales1082593 -Ref: Ranges and Locales-Footnote-11087211 -Ref: Ranges and Locales-Footnote-21087238 -Ref: Ranges and Locales-Footnote-31087472 -Node: Contributors1087693 -Node: History summary1093234 -Node: Installation1094604 -Node: Gawk Distribution1095550 -Node: Getting1096034 -Node: Extracting1096857 -Node: Distribution contents1098492 -Node: Unix Installation1104557 -Node: Quick Installation1105240 -Node: Shell Startup Files1107651 -Node: Additional Configuration Options1108730 -Node: Configuration Philosophy1110469 -Node: Non-Unix Installation1112838 -Node: PC Installation1113296 -Node: PC Binary Installation1114615 -Node: PC Compiling1116463 -Ref: PC Compiling-Footnote-11119484 -Node: PC Testing1119593 -Node: PC Using1120769 -Node: Cygwin1124884 -Node: MSYS1125707 -Node: VMS Installation1126207 -Node: VMS Compilation1126999 -Ref: VMS Compilation-Footnote-11128221 -Node: VMS Dynamic Extensions1128279 -Node: VMS Installation Details1129963 -Node: VMS Running1132215 -Node: VMS GNV1135051 -Node: VMS Old Gawk1135785 -Node: Bugs1136255 -Node: Other Versions1140138 -Node: Installation summary1146562 -Node: Notes1147618 -Node: Compatibility Mode1148483 -Node: Additions1149265 -Node: Accessing The Source1150190 -Node: Adding Code1151625 -Node: New Ports1157782 -Node: Derived Files1162264 -Ref: Derived Files-Footnote-11167739 -Ref: Derived Files-Footnote-21167773 -Ref: Derived Files-Footnote-31168369 -Node: Future Extensions1168483 -Node: Implementation Limitations1169089 -Node: Extension Design1170337 -Node: Old Extension Problems1171491 -Ref: Old Extension Problems-Footnote-11173008 -Node: Extension New Mechanism Goals1173065 -Ref: Extension New Mechanism Goals-Footnote-11176425 -Node: Extension Other Design Decisions1176614 -Node: Extension Future Growth1178722 -Node: Old Extension Mechanism1179558 -Node: Notes summary1181320 -Node: Basic Concepts1182506 -Node: Basic High Level1183187 -Ref: figure-general-flow1183459 -Ref: figure-process-flow1184058 -Ref: Basic High Level-Footnote-11187287 -Node: Basic Data Typing1187472 -Node: Glossary1190800 -Node: Copying1222729 -Node: GNU Free Documentation License1260285 -Node: Index1285421 +Node: Regexp Operators163219 +Ref: Regexp Operators-Footnote-1170629 +Ref: Regexp Operators-Footnote-2170776 +Node: Bracket Expressions170874 +Ref: table-char-classes172889 +Node: Leftmost Longest175831 +Node: Computed Regexps177133 +Node: GNU Regexp Operators180562 +Node: Case-sensitivity184234 +Ref: Case-sensitivity-Footnote-1187119 +Ref: Case-sensitivity-Footnote-2187354 +Node: Regexp Summary187462 +Node: Reading Files188929 +Node: Records191022 +Node: awk split records191755 +Node: gawk split records196684 +Ref: gawk split records-Footnote-1201223 +Node: Fields201260 +Ref: Fields-Footnote-1204038 +Node: Nonconstant Fields204124 +Ref: Nonconstant Fields-Footnote-1206362 +Node: Changing Fields206565 +Node: Field Separators212496 +Node: Default Field Splitting215200 +Node: Regexp Field Splitting216317 +Node: Single Character Fields219667 +Node: Command Line Field Separator220726 +Node: Full Line Fields223943 +Ref: Full Line Fields-Footnote-1225464 +Ref: Full Line Fields-Footnote-2225510 +Node: Field Splitting Summary225611 +Node: Constant Size227685 +Node: Splitting By Content232268 +Ref: Splitting By Content-Footnote-1236233 +Node: Multiple Line236396 +Ref: Multiple Line-Footnote-1242277 +Node: Getline242456 +Node: Plain Getline244663 +Node: Getline/Variable247303 +Node: Getline/File248452 +Node: Getline/Variable/File249837 +Ref: Getline/Variable/File-Footnote-1251440 +Node: Getline/Pipe251527 +Node: Getline/Variable/Pipe254205 +Node: Getline/Coprocess255336 +Node: Getline/Variable/Coprocess256600 +Node: Getline Notes257339 +Node: Getline Summary260133 +Ref: table-getline-variants260545 +Node: Read Timeout261374 +Ref: Read Timeout-Footnote-1265211 +Node: Command-line directories265269 +Node: Input Summary266174 +Node: Input Exercises269559 +Node: Printing270287 +Node: Print272064 +Node: Print Examples273521 +Node: Output Separators276300 +Node: OFMT278318 +Node: Printf279673 +Node: Basic Printf280458 +Node: Control Letters282030 +Node: Format Modifiers286015 +Node: Printf Examples292025 +Node: Redirection294511 +Node: Special FD301349 +Ref: Special FD-Footnote-1304515 +Node: Special Files304589 +Node: Other Inherited Files305206 +Node: Special Network306206 +Node: Special Caveats307068 +Node: Close Files And Pipes308017 +Ref: Close Files And Pipes-Footnote-1315208 +Ref: Close Files And Pipes-Footnote-2315356 +Node: Output Summary315506 +Node: Output Exercises316504 +Node: Expressions317184 +Node: Values318373 +Node: Constants319050 +Node: Scalar Constants319741 +Ref: Scalar Constants-Footnote-1320603 +Node: Nondecimal-numbers320853 +Node: Regexp Constants323863 +Node: Using Constant Regexps324389 +Node: Variables327552 +Node: Using Variables328209 +Node: Assignment Options330120 +Node: Conversion331995 +Node: Strings And Numbers332519 +Ref: Strings And Numbers-Footnote-1335584 +Node: Locale influences conversions335693 +Ref: table-locale-affects338439 +Node: All Operators339031 +Node: Arithmetic Ops339660 +Node: Concatenation342165 +Ref: Concatenation-Footnote-1344984 +Node: Assignment Ops345091 +Ref: table-assign-ops350070 +Node: Increment Ops351380 +Node: Truth Values and Conditions354811 +Node: Truth Values355894 +Node: Typing and Comparison356943 +Node: Variable Typing357759 +Node: Comparison Operators361426 +Ref: table-relational-ops361836 +Node: POSIX String Comparison365331 +Ref: POSIX String Comparison-Footnote-1366403 +Node: Boolean Ops366542 +Ref: Boolean Ops-Footnote-1371020 +Node: Conditional Exp371111 +Node: Function Calls372849 +Node: Precedence376729 +Node: Locales380389 +Node: Expressions Summary382021 +Node: Patterns and Actions384592 +Node: Pattern Overview385712 +Node: Regexp Patterns387391 +Node: Expression Patterns387934 +Node: Ranges391643 +Node: BEGIN/END394750 +Node: Using BEGIN/END395511 +Ref: Using BEGIN/END-Footnote-1398247 +Node: I/O And BEGIN/END398353 +Node: BEGINFILE/ENDFILE400668 +Node: Empty403565 +Node: Using Shell Variables403882 +Node: Action Overview406155 +Node: Statements408481 +Node: If Statement410329 +Node: While Statement411824 +Node: Do Statement413852 +Node: For Statement415000 +Node: Switch Statement418158 +Node: Break Statement420540 +Node: Continue Statement422581 +Node: Next Statement424408 +Node: Nextfile Statement426789 +Node: Exit Statement429417 +Node: Built-in Variables431828 +Node: User-modified432961 +Ref: User-modified-Footnote-1440664 +Node: Auto-set440726 +Ref: Auto-set-Footnote-1454435 +Ref: Auto-set-Footnote-2454640 +Node: ARGC and ARGV454696 +Node: Pattern Action Summary458914 +Node: Arrays461347 +Node: Array Basics462676 +Node: Array Intro463520 +Ref: figure-array-elements465454 +Ref: Array Intro-Footnote-1468074 +Node: Reference to Elements468202 +Node: Assigning Elements470664 +Node: Array Example471155 +Node: Scanning an Array472914 +Node: Controlling Scanning475934 +Ref: Controlling Scanning-Footnote-1481328 +Node: Numeric Array Subscripts481644 +Node: Uninitialized Subscripts483829 +Node: Delete485446 +Ref: Delete-Footnote-1488195 +Node: Multidimensional488252 +Node: Multiscanning491349 +Node: Arrays of Arrays492938 +Node: Arrays Summary497692 +Node: Functions499783 +Node: Built-in500822 +Node: Calling Built-in501900 +Node: Numeric Functions503895 +Ref: Numeric Functions-Footnote-1508713 +Ref: Numeric Functions-Footnote-2509070 +Ref: Numeric Functions-Footnote-3509118 +Node: String Functions509390 +Ref: String Functions-Footnote-1532891 +Ref: String Functions-Footnote-2533020 +Ref: String Functions-Footnote-3533268 +Node: Gory Details533355 +Ref: table-sub-escapes535136 +Ref: table-sub-proposed536651 +Ref: table-posix-sub538013 +Ref: table-gensub-escapes539550 +Ref: Gory Details-Footnote-1540383 +Node: I/O Functions540534 +Ref: I/O Functions-Footnote-1547770 +Node: Time Functions547917 +Ref: Time Functions-Footnote-1558426 +Ref: Time Functions-Footnote-2558494 +Ref: Time Functions-Footnote-3558652 +Ref: Time Functions-Footnote-4558763 +Ref: Time Functions-Footnote-5558875 +Ref: Time Functions-Footnote-6559102 +Node: Bitwise Functions559368 +Ref: table-bitwise-ops559930 +Ref: Bitwise Functions-Footnote-1564258 +Node: Type Functions564430 +Node: I18N Functions565582 +Node: User-defined567229 +Node: Definition Syntax568034 +Ref: Definition Syntax-Footnote-1573693 +Node: Function Example573764 +Ref: Function Example-Footnote-1576685 +Node: Function Caveats576707 +Node: Calling A Function577225 +Node: Variable Scope578183 +Node: Pass By Value/Reference581176 +Node: Return Statement584673 +Node: Dynamic Typing587652 +Node: Indirect Calls588581 +Ref: Indirect Calls-Footnote-1599887 +Node: Functions Summary600015 +Node: Library Functions602717 +Ref: Library Functions-Footnote-1606325 +Ref: Library Functions-Footnote-2606468 +Node: Library Names606639 +Ref: Library Names-Footnote-1610097 +Ref: Library Names-Footnote-2610320 +Node: General Functions610406 +Node: Strtonum Function611509 +Node: Assert Function614531 +Node: Round Function617855 +Node: Cliff Random Function619396 +Node: Ordinal Functions620412 +Ref: Ordinal Functions-Footnote-1623475 +Ref: Ordinal Functions-Footnote-2623727 +Node: Join Function623938 +Ref: Join Function-Footnote-1625708 +Node: Getlocaltime Function625908 +Node: Readfile Function629652 +Node: Shell Quoting631624 +Node: Data File Management633025 +Node: Filetrans Function633657 +Node: Rewind Function637753 +Node: File Checking639139 +Ref: File Checking-Footnote-1640472 +Node: Empty Files640673 +Node: Ignoring Assigns642652 +Node: Getopt Function644202 +Ref: Getopt Function-Footnote-1655666 +Node: Passwd Functions655866 +Ref: Passwd Functions-Footnote-1664706 +Node: Group Functions664794 +Ref: Group Functions-Footnote-1672691 +Node: Walking Arrays672896 +Node: Library Functions Summary674496 +Node: Library Exercises675900 +Node: Sample Programs677180 +Node: Running Examples677950 +Node: Clones678678 +Node: Cut Program679902 +Node: Egrep Program689622 +Ref: Egrep Program-Footnote-1697125 +Node: Id Program697235 +Node: Split Program700911 +Ref: Split Program-Footnote-1704365 +Node: Tee Program704493 +Node: Uniq Program707282 +Node: Wc Program714701 +Ref: Wc Program-Footnote-1718951 +Node: Miscellaneous Programs719045 +Node: Dupword Program720258 +Node: Alarm Program722289 +Node: Translate Program727094 +Ref: Translate Program-Footnote-1731657 +Node: Labels Program731927 +Ref: Labels Program-Footnote-1735278 +Node: Word Sorting735362 +Node: History Sorting739432 +Node: Extract Program741267 +Node: Simple Sed748791 +Node: Igawk Program751861 +Ref: Igawk Program-Footnote-1766187 +Ref: Igawk Program-Footnote-2766388 +Ref: Igawk Program-Footnote-3766510 +Node: Anagram Program766625 +Node: Signature Program769686 +Node: Programs Summary770933 +Node: Programs Exercises772154 +Ref: Programs Exercises-Footnote-1776285 +Node: Advanced Features776376 +Node: Nondecimal Data778324 +Node: Array Sorting779914 +Node: Controlling Array Traversal780611 +Ref: Controlling Array Traversal-Footnote-1788944 +Node: Array Sorting Functions789062 +Ref: Array Sorting Functions-Footnote-1792951 +Node: Two-way I/O793147 +Ref: Two-way I/O-Footnote-1798092 +Ref: Two-way I/O-Footnote-2798278 +Node: TCP/IP Networking798360 +Node: Profiling801233 +Node: Advanced Features Summary809510 +Node: Internationalization811443 +Node: I18N and L10N812923 +Node: Explaining gettext813609 +Ref: Explaining gettext-Footnote-1818634 +Ref: Explaining gettext-Footnote-2818818 +Node: Programmer i18n818983 +Ref: Programmer i18n-Footnote-1823849 +Node: Translator i18n823898 +Node: String Extraction824692 +Ref: String Extraction-Footnote-1825823 +Node: Printf Ordering825909 +Ref: Printf Ordering-Footnote-1828695 +Node: I18N Portability828759 +Ref: I18N Portability-Footnote-1831214 +Node: I18N Example831277 +Ref: I18N Example-Footnote-1834080 +Node: Gawk I18N834152 +Node: I18N Summary834790 +Node: Debugger836129 +Node: Debugging837151 +Node: Debugging Concepts837592 +Node: Debugging Terms839445 +Node: Awk Debugging842017 +Node: Sample Debugging Session842911 +Node: Debugger Invocation843431 +Node: Finding The Bug844815 +Node: List of Debugger Commands851290 +Node: Breakpoint Control852623 +Node: Debugger Execution Control856319 +Node: Viewing And Changing Data859683 +Node: Execution Stack863061 +Node: Debugger Info864698 +Node: Miscellaneous Debugger Commands868715 +Node: Readline Support873744 +Node: Limitations874636 +Node: Debugging Summary876750 +Node: Arbitrary Precision Arithmetic877918 +Node: Computer Arithmetic879334 +Ref: table-numeric-ranges882932 +Ref: Computer Arithmetic-Footnote-1883791 +Node: Math Definitions883848 +Ref: table-ieee-formats887136 +Ref: Math Definitions-Footnote-1887740 +Node: MPFR features887845 +Node: FP Math Caution889516 +Ref: FP Math Caution-Footnote-1890566 +Node: Inexactness of computations890935 +Node: Inexact representation891894 +Node: Comparing FP Values893251 +Node: Errors accumulate894333 +Node: Getting Accuracy895766 +Node: Try To Round898428 +Node: Setting precision899327 +Ref: table-predefined-precision-strings900011 +Node: Setting the rounding mode901800 +Ref: table-gawk-rounding-modes902164 +Ref: Setting the rounding mode-Footnote-1905619 +Node: Arbitrary Precision Integers905798 +Ref: Arbitrary Precision Integers-Footnote-1910698 +Node: POSIX Floating Point Problems910847 +Ref: POSIX Floating Point Problems-Footnote-1914720 +Node: Floating point summary914758 +Node: Dynamic Extensions916952 +Node: Extension Intro918504 +Node: Plugin License919770 +Node: Extension Mechanism Outline920567 +Ref: figure-load-extension920995 +Ref: figure-register-new-function922475 +Ref: figure-call-new-function923479 +Node: Extension API Description925465 +Node: Extension API Functions Introduction926915 +Node: General Data Types931739 +Ref: General Data Types-Footnote-1937478 +Node: Memory Allocation Functions937777 +Ref: Memory Allocation Functions-Footnote-1940616 +Node: Constructor Functions940712 +Node: Registration Functions942446 +Node: Extension Functions943131 +Node: Exit Callback Functions945428 +Node: Extension Version String946676 +Node: Input Parsers947341 +Node: Output Wrappers957220 +Node: Two-way processors961735 +Node: Printing Messages963939 +Ref: Printing Messages-Footnote-1965015 +Node: Updating `ERRNO'965167 +Node: Requesting Values965907 +Ref: table-value-types-returned966635 +Node: Accessing Parameters967592 +Node: Symbol Table Access968823 +Node: Symbol table by name969337 +Node: Symbol table by cookie971318 +Ref: Symbol table by cookie-Footnote-1975462 +Node: Cached values975525 +Ref: Cached values-Footnote-1979024 +Node: Array Manipulation979115 +Ref: Array Manipulation-Footnote-1980213 +Node: Array Data Types980250 +Ref: Array Data Types-Footnote-1982905 +Node: Array Functions982997 +Node: Flattening Arrays986851 +Node: Creating Arrays993743 +Node: Extension API Variables998514 +Node: Extension Versioning999150 +Node: Extension API Informational Variables1001051 +Node: Extension API Boilerplate1002116 +Node: Finding Extensions1005925 +Node: Extension Example1006485 +Node: Internal File Description1007257 +Node: Internal File Ops1011324 +Ref: Internal File Ops-Footnote-11022994 +Node: Using Internal File Ops1023134 +Ref: Using Internal File Ops-Footnote-11025517 +Node: Extension Samples1025790 +Node: Extension Sample File Functions1027316 +Node: Extension Sample Fnmatch1034954 +Node: Extension Sample Fork1036445 +Node: Extension Sample Inplace1037660 +Node: Extension Sample Ord1039335 +Node: Extension Sample Readdir1040171 +Ref: table-readdir-file-types1041047 +Node: Extension Sample Revout1041858 +Node: Extension Sample Rev2way1042448 +Node: Extension Sample Read write array1043188 +Node: Extension Sample Readfile1045128 +Node: Extension Sample Time1046223 +Node: Extension Sample API Tests1047572 +Node: gawkextlib1048063 +Node: Extension summary1050721 +Node: Extension Exercises1054410 +Node: Language History1055132 +Node: V7/SVR3.11056788 +Node: SVR41058969 +Node: POSIX1060414 +Node: BTL1061803 +Node: POSIX/GNU1062537 +Node: Feature History1068326 +Node: Common Extensions1082052 +Node: Ranges and Locales1083376 +Ref: Ranges and Locales-Footnote-11087994 +Ref: Ranges and Locales-Footnote-21088021 +Ref: Ranges and Locales-Footnote-31088255 +Node: Contributors1088476 +Node: History summary1094017 +Node: Installation1095387 +Node: Gawk Distribution1096333 +Node: Getting1096817 +Node: Extracting1097640 +Node: Distribution contents1099275 +Node: Unix Installation1105340 +Node: Quick Installation1106023 +Node: Shell Startup Files1108434 +Node: Additional Configuration Options1109513 +Node: Configuration Philosophy1111252 +Node: Non-Unix Installation1113621 +Node: PC Installation1114079 +Node: PC Binary Installation1115398 +Node: PC Compiling1117246 +Ref: PC Compiling-Footnote-11120267 +Node: PC Testing1120376 +Node: PC Using1121552 +Node: Cygwin1125667 +Node: MSYS1126490 +Node: VMS Installation1126990 +Node: VMS Compilation1127782 +Ref: VMS Compilation-Footnote-11129004 +Node: VMS Dynamic Extensions1129062 +Node: VMS Installation Details1130746 +Node: VMS Running1132998 +Node: VMS GNV1135834 +Node: VMS Old Gawk1136568 +Node: Bugs1137038 +Node: Other Versions1140921 +Node: Installation summary1147345 +Node: Notes1148401 +Node: Compatibility Mode1149266 +Node: Additions1150048 +Node: Accessing The Source1150973 +Node: Adding Code1152408 +Node: New Ports1158565 +Node: Derived Files1163047 +Ref: Derived Files-Footnote-11168522 +Ref: Derived Files-Footnote-21168556 +Ref: Derived Files-Footnote-31169152 +Node: Future Extensions1169266 +Node: Implementation Limitations1169872 +Node: Extension Design1171120 +Node: Old Extension Problems1172274 +Ref: Old Extension Problems-Footnote-11173791 +Node: Extension New Mechanism Goals1173848 +Ref: Extension New Mechanism Goals-Footnote-11177208 +Node: Extension Other Design Decisions1177397 +Node: Extension Future Growth1179505 +Node: Old Extension Mechanism1180341 +Node: Notes summary1182103 +Node: Basic Concepts1183289 +Node: Basic High Level1183970 +Ref: figure-general-flow1184242 +Ref: figure-process-flow1184841 +Ref: Basic High Level-Footnote-11188070 +Node: Basic Data Typing1188255 +Node: Glossary1191583 +Node: Copying1223512 +Node: GNU Free Documentation License1261068 +Node: Index1286204  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 0f4e1eb9..6233bb38 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -5178,13 +5178,12 @@ letters or numbers. @value{COMMONEXT} @quotation CAUTION In ISO C, the escape sequence continues until the first nonhexadecimal digit is seen. -@c FIXME: Add exact version here. For many years, @command{gawk} would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. However, using more than two hexadecimal digits produced undefined results. -As of @value{PVERSION} @strong{FIXME:} 4.3.0, only two digits +As of @value{PVERSION} 4.2, only two digits are processed. @end quotation @@ -26543,7 +26542,7 @@ the separator can considerably simplify such tasks. @item The examples here demonstrate the usefulness of the library -functions from @ref{Library Functions} +functions from @DBREF{Library Functions} for a number of real (if small) programs. @item @@ -35740,6 +35739,11 @@ The @code{isarray()} function to check if a variable is an array or not The @code{bindtextdomain()}, @code{dcgettext()} and @code{dcngettext()} functions for internationalization (@pxref{Programmer i18n}). + +@item +The @code{div()} function for doing integer +division and remainder +(@pxref{Numeric Functions}). @end itemize @item @@ -35873,8 +35877,14 @@ Ultrix @end itemize @item -@c FIXME: Verify the version here. -Support for MirBSD was removed at @command{gawk} @value{PVERSION} 4.2. +Support for the following systems was removed from the code +for @command{gawk} @value{PVERSION} 4.2: + +@c nested table +@itemize @value{MINUS} +@item +MirBSD +@end itemize @end itemize @@ -36488,6 +36498,40 @@ with a minimum of two The dynamic extension interface was completely redone (@pxref{Dynamic Extensions}). +@item +Support for Ultrix was removed. + +@end itemize + +Version 4.2 introduced the following changes: + +@itemize @bullet +@item +Changes to @code{ENVIRON} are reflected into @command{gawk}'s +environment and that of programs that it runs. +@xref{Auto-set}. + +@item +The @option{--pretty-print} option no longer runs the @command{awk} +program too. +@xref{Options}. + +@item +The @command{igawk} program and its manual page are no longer +installed when @command{gawk} is built. +@xref{Igawk Program}. + +@item +The @code{div()} function. +@xref{Numeric Functions}. + +@item +The maximum number of hexdecimal digits in @samp{\x} escapes +is now two. +@xref{Escape Sequences}. + +@item +Support for MirBSD was removed. @end itemize @c XXX ADD MORE STUFF HERE diff --git a/doc/gawktexi.in b/doc/gawktexi.in index ab1c0afc..8ce87b82 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -5089,13 +5089,12 @@ letters or numbers. @value{COMMONEXT} @quotation CAUTION In ISO C, the escape sequence continues until the first nonhexadecimal digit is seen. -@c FIXME: Add exact version here. For many years, @command{gawk} would continue incorporating hexadecimal digits into the value until a non-hexadecimal digit or the end of the string was encountered. However, using more than two hexadecimal digits produced undefined results. -As of @value{PVERSION} @strong{FIXME:} 4.3.0, only two digits +As of @value{PVERSION} 4.2, only two digits are processed. @end quotation @@ -34831,6 +34830,11 @@ The @code{isarray()} function to check if a variable is an array or not The @code{bindtextdomain()}, @code{dcgettext()} and @code{dcngettext()} functions for internationalization (@pxref{Programmer i18n}). + +@item +The @code{div()} function for doing integer +division and remainder +(@pxref{Numeric Functions}). @end itemize @item @@ -34964,8 +34968,14 @@ Ultrix @end itemize @item -@c FIXME: Verify the version here. -Support for MirBSD was removed at @command{gawk} @value{PVERSION} 4.2. +Support for the following systems was removed from the code +for @command{gawk} @value{PVERSION} 4.2: + +@c nested table +@itemize @value{MINUS} +@item +MirBSD +@end itemize @end itemize @@ -35579,6 +35589,40 @@ with a minimum of two The dynamic extension interface was completely redone (@pxref{Dynamic Extensions}). +@item +Support for Ultrix was removed. + +@end itemize + +Version 4.2 introduced the following changes: + +@itemize @bullet +@item +Changes to @code{ENVIRON} are reflected into @command{gawk}'s +environment and that of programs that it runs. +@xref{Auto-set}. + +@item +The @option{--pretty-print} option no longer runs the @command{awk} +program too. +@xref{Options}. + +@item +The @command{igawk} program and its manual page are no longer +installed when @command{gawk} is built. +@xref{Igawk Program}. + +@item +The @code{div()} function. +@xref{Numeric Functions}. + +@item +The maximum number of hexdecimal digits in @samp{\x} escapes +is now two. +@xref{Escape Sequences}. + +@item +Support for MirBSD was removed. @end itemize @c XXX ADD MORE STUFF HERE -- cgit v1.2.3 From 1736b4db53dc60f1e7a9659dc201e0562d43aa02 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 5 Feb 2015 09:53:05 -0500 Subject: Setting -v IGNORECASE=0 on the command line should now work properly. --- ChangeLog | 7 +++++++ eval.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f626cd7..f8cd101c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-02-05 Andrew J. Schorr + + * eval.c (set_IGNORECASE): If IGNORECASE has a numeric value, try + using that before treating it as a string. This fixes a problem + where setting -v IGNORECASE=0 on the command line was not working + properly. + 2015-02-01 Arnold D. Robbins Move POSIX requirement for disallowing paramater names with the diff --git a/eval.c b/eval.c index 82b11719..2ba79956 100644 --- a/eval.c +++ b/eval.c @@ -707,6 +707,8 @@ set_IGNORECASE() load_casetable(); if (do_traditional) IGNORECASE = false; + else if ((n->flags & (NUMCUR|NUMBER)) != 0) + IGNORECASE = ! iszero(n); else if ((n->flags & (STRING|STRCUR)) != 0) { if ((n->flags & MAYBE_NUM) == 0) { (void) force_string(n); @@ -715,9 +717,7 @@ set_IGNORECASE() (void) force_number(n); IGNORECASE = ! iszero(n); } - } else if ((n->flags & (NUMCUR|NUMBER)) != 0) - IGNORECASE = ! iszero(n); - else + } else IGNORECASE = false; /* shouldn't happen */ set_RS(); /* set_RS() calls set_FS() if need be, for us */ -- cgit v1.2.3 From 38162ad82080f1dd6f347fe2bc4e83478a7dc9c4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 6 Feb 2015 10:29:11 +0200 Subject: O'Reilly edits. --- doc/ChangeLog | 6 +- doc/gawk.info | 523 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 82 ++++----- doc/gawktexi.in | 80 ++++----- 4 files changed, 350 insertions(+), 341 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 95022eec..9fc7bdca 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-06 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-02-04 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. @@ -50,7 +54,7 @@ 2015-01-19 Arnold D. Robbins * gawkinet.texi: Fix capitalization in document title. - * gawktexi.in: Here we again: Starting on more O'Reilly fixes. + * gawktexi.in: Here we go again: Starting on more O'Reilly fixes. 2014-12-26 Antonio Giovanni Colombo diff --git a/doc/gawk.info b/doc/gawk.info index 8e6a4f29..9381b503 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -18981,7 +18981,7 @@ File: gawk.info, Node: Programs Summary, Next: Programs Exercises, Prev: Misc the separator can considerably simplify such tasks. * The examples here demonstrate the usefulness of the library - functions from *note Library Functions:: for a number of real (if + functions from *note Library Functions::, for a number of real (if small) programs. * Besides reinventing POSIX wheels, other programs solved a @@ -19103,16 +19103,16 @@ File: gawk.info, Node: Advanced Features, Next: Internationalization, Prev: S This major node discusses advanced features in `gawk'. It's a bit of a "grab bag" of items that are otherwise unrelated to each other. -First, a command-line option allows `gawk' to recognize nondecimal -numbers in input data, not just in `awk' programs. Then, `gawk''s -special features for sorting arrays are presented. Next, two-way I/O, -discussed briefly in earlier parts of this Info file, is described in -full detail, along with the basics of TCP/IP networking. Finally, -`gawk' can "profile" an `awk' program, making it possible to tune it -for performance. +First, we look at a command-line option that allows `gawk' to recognize +nondecimal numbers in input data, not just in `awk' programs. Then, +`gawk''s special features for sorting arrays are presented. Next, +two-way I/O, discussed briefly in earlier parts of this Info file, is +described in full detail, along with the basics of TCP/IP networking. +Finally, we see how `gawk' can "profile" an `awk' program, making it +possible to tune it for performance. - A number of advanced features require separate major nodes of their -own: + Additional advanced features are discussed in separate major nodes +of their own: * *note Internationalization::, discusses how to internationalize your `awk' programs, so that they can speak multiple national @@ -19186,7 +19186,7 @@ File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Nondecimal Dat 12.2 Controlling Array Traversal and Array Sorting ================================================== -`gawk' lets you control the order in which a `for (i in array)' loop +`gawk' lets you control the order in which a `for (INDX in ARRAY)' loop traverses an array. In addition, two built-in functions, `asort()' and `asorti()', let @@ -19205,9 +19205,9 @@ File: gawk.info, Node: Controlling Array Traversal, Next: Array Sorting Functi 12.2.1 Controlling Array Traversal ---------------------------------- -By default, the order in which a `for (i in array)' loop scans an array -is not defined; it is generally based upon the internal implementation -of arrays inside `awk'. +By default, the order in which a `for (INDX in ARRAY)' loop scans an +array is not defined; it is generally based upon the internal +implementation of arrays inside `awk'. Often, though, it is desirable to be able to loop over the elements in a particular order that you, the programmer, choose. `gawk' lets @@ -19229,21 +19229,22 @@ arguments: RETURN < 0; 0; OR > 0 } - Here, I1 and I2 are the indices, and V1 and V2 are the corresponding -values of the two elements being compared. Either V1 or V2, or both, -can be arrays if the array being traversed contains subarrays as values. -(*Note Arrays of Arrays::, for more information about subarrays.) The -three possible return values are interpreted as follows: + Here, `i1' and `i2' are the indices, and `v1' and `v2' are the +corresponding values of the two elements being compared. Either `v1' +or `v2', or both, can be arrays if the array being traversed contains +subarrays as values. (*Note Arrays of Arrays::, for more information +about subarrays.) The three possible return values are interpreted as +follows: `comp_func(i1, v1, i2, v2) < 0' - Index I1 comes before index I2 during loop traversal. + Index `i1' comes before index `i2' during loop traversal. `comp_func(i1, v1, i2, v2) == 0' - Indices I1 and I2 come together but the relative order with + Indices `i1' and `i2' come together, but the relative order with respect to each other is undefined. `comp_func(i1, v1, i2, v2) > 0' - Index I1 comes after index I2 during loop traversal. + Index `i1' comes after index `i2' during loop traversal. Our first comparison function can be used to scan an array in numerical order of the indices: @@ -19386,7 +19387,7 @@ elements compare equal. This is usually not a problem, but letting the tied elements come out in arbitrary order can be an issue, especially when comparing item values. The partial ordering of the equal elements may change the next time the array is traversed, if other elements are -added or removed from the array. One way to resolve ties when +added to or removed from the array. One way to resolve ties when comparing elements with otherwise equal values is to include the indices in the comparison rules. Note that doing this may make the loop traversal less efficient, so consider it only if necessary. The @@ -19420,14 +19421,14 @@ lowercase letters as equivalent or distinct. Another point to keep in mind is that in the case of subarrays, the element values can themselves be arrays; a production comparison -function should use the `isarray()' function (*note Type Functions::), +function should use the `isarray()' function (*note Type Functions::) to check for this, and choose a defined sorting order for subarrays. All sorting based on `PROCINFO["sorted_in"]' is disabled in POSIX mode, because the `PROCINFO' array is not special in that case. As a side note, sorting the array indices before traversing the -array has been reported to add 15% to 20% overhead to the execution +array has been reported to add a 15% to 20% overhead to the execution time of `awk' programs. For this reason, sorted array traversal is not the default. @@ -19476,8 +19477,8 @@ array is not affected. Often, what's needed is to sort on the values of the _indices_ instead of the values of the elements. To do that, use the `asorti()' function. The interface and behavior are identical to that of -`asort()', except that the index values are used for sorting, and -become the values of the result array: +`asort()', except that the index values are used for sorting and become +the values of the result array: { source[$0] = some_func($0) } @@ -19509,8 +19510,8 @@ chooses_, taking into account just the indices, just the values, or both. This is extremely powerful. Once the array is sorted, `asort()' takes the _values_ in their -final order, and uses them to fill in the result array, whereas -`asorti()' takes the _indices_ in their final order, and uses them to +final order and uses them to fill in the result array, whereas +`asorti()' takes the _indices_ in their final order and uses them to fill in the result array. NOTE: Copying array indices and elements isn't expensive in terms @@ -19708,7 +19709,7 @@ REMOTE-PORT name. NOTE: Failure in opening a two-way socket will result in a - non-fatal error being returned to the calling code. The value of + nonfatal error being returned to the calling code. The value of `ERRNO' indicates the error (*note Auto-set::). Consider the following very simple example: @@ -19789,8 +19790,8 @@ First, the `awk' program: junk Here is the `awkprof.out' that results from running the `gawk' -profiler on this program and data. (This example also illustrates that -`awk' programmers sometimes get up very early in the morning to work.) +profiler on this program and data (this example also illustrates that +`awk' programmers sometimes get up very early in the morning to work): # gawk profile, created Mon Sep 29 05:16:21 2014 @@ -19843,7 +19844,7 @@ profiler on this program and data. (This example also illustrates that output. They are as follows: * The program is printed in the order `BEGIN' rules, `BEGINFILE' - rules, pattern/action rules, `ENDFILE' rules, `END' rules and + rules, pattern-action rules, `ENDFILE' rules, `END' rules, and functions, listed alphabetically. Multiple `BEGIN' and `END' rules retain their separate identities, as do multiple `BEGINFILE' and `ENDFILE' rules. @@ -19888,15 +19889,15 @@ output. They are as follows: scalar, it gets parenthesized. * `gawk' supplies leading comments in front of the `BEGIN' and `END' - rules, the `BEGINFILE' and `ENDFILE' rules, the pattern/action + rules, the `BEGINFILE' and `ENDFILE' rules, the pattern-action rules, and the functions. The profiled version of your program may not look exactly like what you typed when you wrote it. This is because `gawk' creates the -profiled version by "pretty printing" its internal representation of +profiled version by "pretty-printing" its internal representation of the program. The advantage to this is that `gawk' can produce a -standard representation. The disadvantage is that all source-code +standard representation. The disadvantage is that all source code comments are lost. Also, things such as: /foo/ @@ -19945,15 +19946,15 @@ output profile file. produces the profile and the function call trace and then exits. When `gawk' runs on MS-Windows systems, it uses the `INT' and `QUIT' -signals for producing the profile and, in the case of the `INT' signal, +signals for producing the profile, and in the case of the `INT' signal, `gawk' exits. This is because these systems don't support the `kill' command, so the only signals you can deliver to a program are those generated by the keyboard. The `INT' signal is generated by the -`Ctrl-' or `Ctrl-' key, while the `QUIT' signal is generated -by the `Ctrl-<\>' key. +`Ctrl-c' or `Ctrl-BREAK' key, while the `QUIT' signal is generated by +the `Ctrl-\' key. Finally, `gawk' also accepts another option, `--pretty-print'. When -called this way, `gawk' "pretty prints" the program into `awkprof.out', +called this way, `gawk' "pretty-prints" the program into `awkprof.out', without any execution counts. NOTE: The `--pretty-print' option still runs your program. This @@ -19989,7 +19990,7 @@ File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanc two-way communications. * By using special file names with the `|&' operator, you can open a - TCP/IP (or UDP/IP) connection to remote hosts in the Internet. + TCP/IP (or UDP/IP) connection to remote hosts on the Internet. `gawk' supports both IPv4 and IPv6. * You can generate statement count profiles of your program. This @@ -19998,7 +19999,7 @@ File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanc `USR1' signal while profiling causes `gawk' to dump the profile and keep going, including a function call stack. - * You can also just "pretty print" the program. This currently also + * You can also just "pretty-print" the program. This currently also runs the program, but that will change in the next major release. @@ -34812,224 +34813,224 @@ Ref: Igawk Program-Footnote-3764907 Node: Anagram Program765022 Node: Signature Program768083 Node: Programs Summary769330 -Node: Programs Exercises770550 -Ref: Programs Exercises-Footnote-1774681 -Node: Advanced Features774772 -Node: Nondecimal Data776720 -Node: Array Sorting778310 -Node: Controlling Array Traversal779007 -Ref: Controlling Array Traversal-Footnote-1787340 -Node: Array Sorting Functions787458 -Ref: Array Sorting Functions-Footnote-1791347 -Node: Two-way I/O791543 -Ref: Two-way I/O-Footnote-1796488 -Ref: Two-way I/O-Footnote-2796674 -Node: TCP/IP Networking796756 -Node: Profiling799629 -Node: Advanced Features Summary807176 -Node: Internationalization809109 -Node: I18N and L10N810589 -Node: Explaining gettext811275 -Ref: Explaining gettext-Footnote-1816300 -Ref: Explaining gettext-Footnote-2816484 -Node: Programmer i18n816649 -Ref: Programmer i18n-Footnote-1821515 -Node: Translator i18n821564 -Node: String Extraction822358 -Ref: String Extraction-Footnote-1823489 -Node: Printf Ordering823575 -Ref: Printf Ordering-Footnote-1826361 -Node: I18N Portability826425 -Ref: I18N Portability-Footnote-1828880 -Node: I18N Example828943 -Ref: I18N Example-Footnote-1831746 -Node: Gawk I18N831818 -Node: I18N Summary832456 -Node: Debugger833795 -Node: Debugging834817 -Node: Debugging Concepts835258 -Node: Debugging Terms837111 -Node: Awk Debugging839683 -Node: Sample Debugging Session840577 -Node: Debugger Invocation841097 -Node: Finding The Bug842481 -Node: List of Debugger Commands848956 -Node: Breakpoint Control850289 -Node: Debugger Execution Control853985 -Node: Viewing And Changing Data857349 -Node: Execution Stack860727 -Node: Debugger Info862364 -Node: Miscellaneous Debugger Commands866381 -Node: Readline Support871410 -Node: Limitations872302 -Node: Debugging Summary874416 -Node: Arbitrary Precision Arithmetic875584 -Node: Computer Arithmetic877000 -Ref: table-numeric-ranges880598 -Ref: Computer Arithmetic-Footnote-1881457 -Node: Math Definitions881514 -Ref: table-ieee-formats884802 -Ref: Math Definitions-Footnote-1885406 -Node: MPFR features885511 -Node: FP Math Caution887182 -Ref: FP Math Caution-Footnote-1888232 -Node: Inexactness of computations888601 -Node: Inexact representation889560 -Node: Comparing FP Values890917 -Node: Errors accumulate891999 -Node: Getting Accuracy893432 -Node: Try To Round896094 -Node: Setting precision896993 -Ref: table-predefined-precision-strings897677 -Node: Setting the rounding mode899466 -Ref: table-gawk-rounding-modes899830 -Ref: Setting the rounding mode-Footnote-1903285 -Node: Arbitrary Precision Integers903464 -Ref: Arbitrary Precision Integers-Footnote-1906450 -Node: POSIX Floating Point Problems906599 -Ref: POSIX Floating Point Problems-Footnote-1910472 -Node: Floating point summary910510 -Node: Dynamic Extensions912704 -Node: Extension Intro914256 -Node: Plugin License915522 -Node: Extension Mechanism Outline916319 -Ref: figure-load-extension916747 -Ref: figure-register-new-function918227 -Ref: figure-call-new-function919231 -Node: Extension API Description921217 -Node: Extension API Functions Introduction922667 -Node: General Data Types927491 -Ref: General Data Types-Footnote-1933230 -Node: Memory Allocation Functions933529 -Ref: Memory Allocation Functions-Footnote-1936368 -Node: Constructor Functions936464 -Node: Registration Functions938198 -Node: Extension Functions938883 -Node: Exit Callback Functions941180 -Node: Extension Version String942428 -Node: Input Parsers943093 -Node: Output Wrappers952972 -Node: Two-way processors957487 -Node: Printing Messages959691 -Ref: Printing Messages-Footnote-1960767 -Node: Updating `ERRNO'960919 -Node: Requesting Values961659 -Ref: table-value-types-returned962387 -Node: Accessing Parameters963344 -Node: Symbol Table Access964575 -Node: Symbol table by name965089 -Node: Symbol table by cookie967070 -Ref: Symbol table by cookie-Footnote-1971214 -Node: Cached values971277 -Ref: Cached values-Footnote-1974776 -Node: Array Manipulation974867 -Ref: Array Manipulation-Footnote-1975965 -Node: Array Data Types976002 -Ref: Array Data Types-Footnote-1978657 -Node: Array Functions978749 -Node: Flattening Arrays982603 -Node: Creating Arrays989495 -Node: Extension API Variables994266 -Node: Extension Versioning994902 -Node: Extension API Informational Variables996803 -Node: Extension API Boilerplate997868 -Node: Finding Extensions1001677 -Node: Extension Example1002237 -Node: Internal File Description1003009 -Node: Internal File Ops1007076 -Ref: Internal File Ops-Footnote-11018746 -Node: Using Internal File Ops1018886 -Ref: Using Internal File Ops-Footnote-11021269 -Node: Extension Samples1021542 -Node: Extension Sample File Functions1023068 -Node: Extension Sample Fnmatch1030706 -Node: Extension Sample Fork1032197 -Node: Extension Sample Inplace1033412 -Node: Extension Sample Ord1035087 -Node: Extension Sample Readdir1035923 -Ref: table-readdir-file-types1036799 -Node: Extension Sample Revout1037610 -Node: Extension Sample Rev2way1038200 -Node: Extension Sample Read write array1038940 -Node: Extension Sample Readfile1040880 -Node: Extension Sample Time1041975 -Node: Extension Sample API Tests1043324 -Node: gawkextlib1043815 -Node: Extension summary1046473 -Node: Extension Exercises1050162 -Node: Language History1050884 -Node: V7/SVR3.11052540 -Node: SVR41054721 -Node: POSIX1056166 -Node: BTL1057555 -Node: POSIX/GNU1058289 -Node: Feature History1063853 -Node: Common Extensions1076951 -Node: Ranges and Locales1078275 -Ref: Ranges and Locales-Footnote-11082893 -Ref: Ranges and Locales-Footnote-21082920 -Ref: Ranges and Locales-Footnote-31083154 -Node: Contributors1083375 -Node: History summary1088916 -Node: Installation1090286 -Node: Gawk Distribution1091232 -Node: Getting1091716 -Node: Extracting1092539 -Node: Distribution contents1094174 -Node: Unix Installation1099891 -Node: Quick Installation1100508 -Node: Additional Configuration Options1102932 -Node: Configuration Philosophy1104670 -Node: Non-Unix Installation1107039 -Node: PC Installation1107497 -Node: PC Binary Installation1108816 -Node: PC Compiling1110664 -Ref: PC Compiling-Footnote-11113685 -Node: PC Testing1113794 -Node: PC Using1114970 -Node: Cygwin1119085 -Node: MSYS1119908 -Node: VMS Installation1120408 -Node: VMS Compilation1121200 -Ref: VMS Compilation-Footnote-11122422 -Node: VMS Dynamic Extensions1122480 -Node: VMS Installation Details1124164 -Node: VMS Running1126416 -Node: VMS GNV1129252 -Node: VMS Old Gawk1129986 -Node: Bugs1130456 -Node: Other Versions1134339 -Node: Installation summary1140763 -Node: Notes1141819 -Node: Compatibility Mode1142684 -Node: Additions1143466 -Node: Accessing The Source1144391 -Node: Adding Code1145826 -Node: New Ports1151983 -Node: Derived Files1156465 -Ref: Derived Files-Footnote-11161940 -Ref: Derived Files-Footnote-21161974 -Ref: Derived Files-Footnote-31162570 -Node: Future Extensions1162684 -Node: Implementation Limitations1163290 -Node: Extension Design1164538 -Node: Old Extension Problems1165692 -Ref: Old Extension Problems-Footnote-11167209 -Node: Extension New Mechanism Goals1167266 -Ref: Extension New Mechanism Goals-Footnote-11170626 -Node: Extension Other Design Decisions1170815 -Node: Extension Future Growth1172923 -Node: Old Extension Mechanism1173759 -Node: Notes summary1175521 -Node: Basic Concepts1176707 -Node: Basic High Level1177388 -Ref: figure-general-flow1177660 -Ref: figure-process-flow1178259 -Ref: Basic High Level-Footnote-11181488 -Node: Basic Data Typing1181673 -Node: Glossary1185001 -Node: Copying1216930 -Node: GNU Free Documentation License1254486 -Node: Index1279622 +Node: Programs Exercises770551 +Ref: Programs Exercises-Footnote-1774682 +Node: Advanced Features774773 +Node: Nondecimal Data776755 +Node: Array Sorting778345 +Node: Controlling Array Traversal779045 +Ref: Controlling Array Traversal-Footnote-1787411 +Node: Array Sorting Functions787529 +Ref: Array Sorting Functions-Footnote-1791415 +Node: Two-way I/O791611 +Ref: Two-way I/O-Footnote-1796556 +Ref: Two-way I/O-Footnote-2796742 +Node: TCP/IP Networking796824 +Node: Profiling799696 +Node: Advanced Features Summary807237 +Node: Internationalization809170 +Node: I18N and L10N810650 +Node: Explaining gettext811336 +Ref: Explaining gettext-Footnote-1816361 +Ref: Explaining gettext-Footnote-2816545 +Node: Programmer i18n816710 +Ref: Programmer i18n-Footnote-1821576 +Node: Translator i18n821625 +Node: String Extraction822419 +Ref: String Extraction-Footnote-1823550 +Node: Printf Ordering823636 +Ref: Printf Ordering-Footnote-1826422 +Node: I18N Portability826486 +Ref: I18N Portability-Footnote-1828941 +Node: I18N Example829004 +Ref: I18N Example-Footnote-1831807 +Node: Gawk I18N831879 +Node: I18N Summary832517 +Node: Debugger833856 +Node: Debugging834878 +Node: Debugging Concepts835319 +Node: Debugging Terms837172 +Node: Awk Debugging839744 +Node: Sample Debugging Session840638 +Node: Debugger Invocation841158 +Node: Finding The Bug842542 +Node: List of Debugger Commands849017 +Node: Breakpoint Control850350 +Node: Debugger Execution Control854046 +Node: Viewing And Changing Data857410 +Node: Execution Stack860788 +Node: Debugger Info862425 +Node: Miscellaneous Debugger Commands866442 +Node: Readline Support871471 +Node: Limitations872363 +Node: Debugging Summary874477 +Node: Arbitrary Precision Arithmetic875645 +Node: Computer Arithmetic877061 +Ref: table-numeric-ranges880659 +Ref: Computer Arithmetic-Footnote-1881518 +Node: Math Definitions881575 +Ref: table-ieee-formats884863 +Ref: Math Definitions-Footnote-1885467 +Node: MPFR features885572 +Node: FP Math Caution887243 +Ref: FP Math Caution-Footnote-1888293 +Node: Inexactness of computations888662 +Node: Inexact representation889621 +Node: Comparing FP Values890978 +Node: Errors accumulate892060 +Node: Getting Accuracy893493 +Node: Try To Round896155 +Node: Setting precision897054 +Ref: table-predefined-precision-strings897738 +Node: Setting the rounding mode899527 +Ref: table-gawk-rounding-modes899891 +Ref: Setting the rounding mode-Footnote-1903346 +Node: Arbitrary Precision Integers903525 +Ref: Arbitrary Precision Integers-Footnote-1906511 +Node: POSIX Floating Point Problems906660 +Ref: POSIX Floating Point Problems-Footnote-1910533 +Node: Floating point summary910571 +Node: Dynamic Extensions912765 +Node: Extension Intro914317 +Node: Plugin License915583 +Node: Extension Mechanism Outline916380 +Ref: figure-load-extension916808 +Ref: figure-register-new-function918288 +Ref: figure-call-new-function919292 +Node: Extension API Description921278 +Node: Extension API Functions Introduction922728 +Node: General Data Types927552 +Ref: General Data Types-Footnote-1933291 +Node: Memory Allocation Functions933590 +Ref: Memory Allocation Functions-Footnote-1936429 +Node: Constructor Functions936525 +Node: Registration Functions938259 +Node: Extension Functions938944 +Node: Exit Callback Functions941241 +Node: Extension Version String942489 +Node: Input Parsers943154 +Node: Output Wrappers953033 +Node: Two-way processors957548 +Node: Printing Messages959752 +Ref: Printing Messages-Footnote-1960828 +Node: Updating `ERRNO'960980 +Node: Requesting Values961720 +Ref: table-value-types-returned962448 +Node: Accessing Parameters963405 +Node: Symbol Table Access964636 +Node: Symbol table by name965150 +Node: Symbol table by cookie967131 +Ref: Symbol table by cookie-Footnote-1971275 +Node: Cached values971338 +Ref: Cached values-Footnote-1974837 +Node: Array Manipulation974928 +Ref: Array Manipulation-Footnote-1976026 +Node: Array Data Types976063 +Ref: Array Data Types-Footnote-1978718 +Node: Array Functions978810 +Node: Flattening Arrays982664 +Node: Creating Arrays989556 +Node: Extension API Variables994327 +Node: Extension Versioning994963 +Node: Extension API Informational Variables996864 +Node: Extension API Boilerplate997929 +Node: Finding Extensions1001738 +Node: Extension Example1002298 +Node: Internal File Description1003070 +Node: Internal File Ops1007137 +Ref: Internal File Ops-Footnote-11018807 +Node: Using Internal File Ops1018947 +Ref: Using Internal File Ops-Footnote-11021330 +Node: Extension Samples1021603 +Node: Extension Sample File Functions1023129 +Node: Extension Sample Fnmatch1030767 +Node: Extension Sample Fork1032258 +Node: Extension Sample Inplace1033473 +Node: Extension Sample Ord1035148 +Node: Extension Sample Readdir1035984 +Ref: table-readdir-file-types1036860 +Node: Extension Sample Revout1037671 +Node: Extension Sample Rev2way1038261 +Node: Extension Sample Read write array1039001 +Node: Extension Sample Readfile1040941 +Node: Extension Sample Time1042036 +Node: Extension Sample API Tests1043385 +Node: gawkextlib1043876 +Node: Extension summary1046534 +Node: Extension Exercises1050223 +Node: Language History1050945 +Node: V7/SVR3.11052601 +Node: SVR41054782 +Node: POSIX1056227 +Node: BTL1057616 +Node: POSIX/GNU1058350 +Node: Feature History1063914 +Node: Common Extensions1077012 +Node: Ranges and Locales1078336 +Ref: Ranges and Locales-Footnote-11082954 +Ref: Ranges and Locales-Footnote-21082981 +Ref: Ranges and Locales-Footnote-31083215 +Node: Contributors1083436 +Node: History summary1088977 +Node: Installation1090347 +Node: Gawk Distribution1091293 +Node: Getting1091777 +Node: Extracting1092600 +Node: Distribution contents1094235 +Node: Unix Installation1099952 +Node: Quick Installation1100569 +Node: Additional Configuration Options1102993 +Node: Configuration Philosophy1104731 +Node: Non-Unix Installation1107100 +Node: PC Installation1107558 +Node: PC Binary Installation1108877 +Node: PC Compiling1110725 +Ref: PC Compiling-Footnote-11113746 +Node: PC Testing1113855 +Node: PC Using1115031 +Node: Cygwin1119146 +Node: MSYS1119969 +Node: VMS Installation1120469 +Node: VMS Compilation1121261 +Ref: VMS Compilation-Footnote-11122483 +Node: VMS Dynamic Extensions1122541 +Node: VMS Installation Details1124225 +Node: VMS Running1126477 +Node: VMS GNV1129313 +Node: VMS Old Gawk1130047 +Node: Bugs1130517 +Node: Other Versions1134400 +Node: Installation summary1140824 +Node: Notes1141880 +Node: Compatibility Mode1142745 +Node: Additions1143527 +Node: Accessing The Source1144452 +Node: Adding Code1145887 +Node: New Ports1152044 +Node: Derived Files1156526 +Ref: Derived Files-Footnote-11162001 +Ref: Derived Files-Footnote-21162035 +Ref: Derived Files-Footnote-31162631 +Node: Future Extensions1162745 +Node: Implementation Limitations1163351 +Node: Extension Design1164599 +Node: Old Extension Problems1165753 +Ref: Old Extension Problems-Footnote-11167270 +Node: Extension New Mechanism Goals1167327 +Ref: Extension New Mechanism Goals-Footnote-11170687 +Node: Extension Other Design Decisions1170876 +Node: Extension Future Growth1172984 +Node: Old Extension Mechanism1173820 +Node: Notes summary1175582 +Node: Basic Concepts1176768 +Node: Basic High Level1177449 +Ref: figure-general-flow1177721 +Ref: figure-process-flow1178320 +Ref: Basic High Level-Footnote-11181549 +Node: Basic Data Typing1181734 +Node: Glossary1185062 +Node: Copying1216991 +Node: GNU Free Documentation License1254547 +Node: Index1279683  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 9f06740c..59f11cae 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -55,6 +55,7 @@ @set VERSION 4.1 @set PATCHLEVEL 2 +@set GAWKINETTITLE TCP/IP Internetworking with @command{gawk} @ifset FOR_PRINT @set TITLE Effective awk Programming @end ifset @@ -1495,7 +1496,7 @@ In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding features to do this for @command{gawk}. At that time, he also wrote the bulk of -@cite{TCP/IP Internetworking with @command{gawk}} +@cite{@value{GAWKINETTITLE}} (a separate document, available as part of the @command{gawk} distribution). His code finally became part of the main @command{gawk} distribution with @command{gawk} @value{PVERSION} 3.1. @@ -26510,7 +26511,7 @@ the separator can considerably simplify such tasks. @item The examples here demonstrate the usefulness of the library -functions from @ref{Library Functions} +functions from @DBREF{Library Functions} for a number of real (if small) programs. @item @@ -26711,18 +26712,18 @@ a violent psychopath who knows where you live.} This @value{CHAPTER} discusses advanced features in @command{gawk}. It's a bit of a ``grab bag'' of items that are otherwise unrelated to each other. -First, a command-line option allows @command{gawk} to recognize +First, we look at a command-line option that allows @command{gawk} to recognize nondecimal numbers in input data, not just in @command{awk} programs. Then, @command{gawk}'s special features for sorting arrays are presented. Next, two-way I/O, discussed briefly in earlier parts of this @value{DOCUMENT}, is described in full detail, along with the basics -of TCP/IP networking. Finally, @command{gawk} +of TCP/IP networking. Finally, we see how @command{gawk} can @dfn{profile} an @command{awk} program, making it possible to tune it for performance. @c FULLXREF ON -A number of advanced features require separate @value{CHAPTER}s of their +Additional advanced features are discussed in separate @value{CHAPTER}s of their own: @itemize @value{BULLET} @@ -26816,7 +26817,8 @@ This option may disappear in a future version of @command{gawk}. @node Array Sorting @section Controlling Array Traversal and Array Sorting -@command{gawk} lets you control the order in which a @samp{for (i in array)} +@command{gawk} lets you control the order in which a +@samp{for (@var{indx} in @var{array})} loop traverses an array. In addition, two built-in functions, @code{asort()} and @code{asorti()}, @@ -26832,7 +26834,7 @@ to order the elements during sorting. @node Controlling Array Traversal @subsection Controlling Array Traversal -By default, the order in which a @samp{for (i in array)} loop +By default, the order in which a @samp{for (@var{indx} in @var{array})} loop scans an array is not defined; it is generally based upon the internal implementation of arrays inside @command{awk}. @@ -26861,23 +26863,23 @@ function comp_func(i1, v1, i2, v2) @} @end example -Here, @var{i1} and @var{i2} are the indices, and @var{v1} and @var{v2} +Here, @code{i1} and @code{i2} are the indices, and @code{v1} and @code{v2} are the corresponding values of the two elements being compared. -Either @var{v1} or @var{v2}, or both, can be arrays if the array being +Either @code{v1} or @code{v2}, or both, can be arrays if the array being traversed contains subarrays as values. (@DBXREF{Arrays of Arrays} for more information about subarrays.) The three possible return values are interpreted as follows: @table @code @item comp_func(i1, v1, i2, v2) < 0 -Index @var{i1} comes before index @var{i2} during loop traversal. +Index @code{i1} comes before index @code{i2} during loop traversal. @item comp_func(i1, v1, i2, v2) == 0 -Indices @var{i1} and @var{i2} -come together but the relative order with respect to each other is undefined. +Indices @code{i1} and @code{i2} +come together, but the relative order with respect to each other is undefined. @item comp_func(i1, v1, i2, v2) > 0 -Index @var{i1} comes after index @var{i2} during loop traversal. +Index @code{i1} comes after index @code{i2} during loop traversal. @end table Our first comparison function can be used to scan an array in @@ -27038,7 +27040,7 @@ As already mentioned, the order of the indices is arbitrary if two elements compare equal. This is usually not a problem, but letting the tied elements come out in arbitrary order can be an issue, especially when comparing item values. The partial ordering of the equal elements -may change the next time the array is traversed, if other elements are added or +may change the next time the array is traversed, if other elements are added to or removed from the array. One way to resolve ties when comparing elements with otherwise equal values is to include the indices in the comparison rules. Note that doing this may make the loop traversal less efficient, @@ -27081,7 +27083,7 @@ equivalent or distinct. Another point to keep in mind is that in the case of subarrays, the element values can themselves be arrays; a production comparison function should use the @code{isarray()} function -(@pxref{Type Functions}), +(@pxref{Type Functions}) to check for this, and choose a defined sorting order for subarrays. All sorting based on @code{PROCINFO["sorted_in"]} @@ -27089,7 +27091,7 @@ is disabled in POSIX mode, because the @code{PROCINFO} array is not special in that case. As a side note, sorting the array indices before traversing -the array has been reported to add 15% to 20% overhead to the +the array has been reported to add a 15% to 20% overhead to the execution time of @command{awk} programs. For this reason, sorted array traversal is not the default. @@ -27148,7 +27150,7 @@ However, the @code{source} array is not affected. Often, what's needed is to sort on the values of the @emph{indices} instead of the values of the elements. To do that, use the @code{asorti()} function. The interface and behavior are identical to -that of @code{asort()}, except that the index values are used for sorting, +that of @code{asort()}, except that the index values are used for sorting and become the values of the result array: @example @@ -27183,8 +27185,8 @@ it chooses}, taking into account just the indices, just the values, or both. This is extremely powerful. Once the array is sorted, @code{asort()} takes the @emph{values} in -their final order, and uses them to fill in the result array, whereas -@code{asorti()} takes the @emph{indices} in their final order, and uses +their final order and uses them to fill in the result array, whereas +@code{asorti()} takes the @emph{indices} in their final order and uses them to fill in the result array. @cindex reference counting, sorting arrays @@ -27481,7 +27483,7 @@ service name. @cindex @command{gawk}, @code{ERRNO} variable in @cindex @code{ERRNO} variable @quotation NOTE -Failure in opening a two-way socket will result in a non-fatal error +Failure in opening a two-way socket will result in a nonfatal error being returned to the calling code. The value of @code{ERRNO} indicates the error (@pxref{Auto-set}). @end quotation @@ -27498,19 +27500,19 @@ BEGIN @{ @end example This program reads the current date and time from the local system's -TCP @samp{daytime} server. +TCP @code{daytime} server. It then prints the results and closes the connection. Because this topic is extensive, the use of @command{gawk} for TCP/IP programming is documented separately. @ifinfo See -@inforef{Top, , General Introduction, gawkinet, TCP/IP Internetworking with @command{gawk}}, +@inforef{Top, , General Introduction, gawkinet, @value{GAWKINETTITLE}}, @end ifinfo @ifnotinfo See @uref{http://www.gnu.org/software/gawk/manual/gawkinet/, -@cite{TCP/IP Internetworking with @command{gawk}}}, +@cite{@value{GAWKINETTITLE}}}, which comes as part of the @command{gawk} distribution, @end ifnotinfo for a much more complete introduction and discussion, as well as @@ -27586,9 +27588,9 @@ junk @end example Here is the @file{awkprof.out} that results from running the -@command{gawk} profiler on this program and data. (This example also +@command{gawk} profiler on this program and data (this example also illustrates that @command{awk} programmers sometimes get up very early -in the morning to work.) +in the morning to work): @cindex @code{BEGIN} pattern, and profiling @cindex @code{END} pattern, and profiling @@ -27648,8 +27650,8 @@ They are as follows: @item The program is printed in the order @code{BEGIN} rules, @code{BEGINFILE} rules, -pattern/action rules, -@code{ENDFILE} rules, @code{END} rules and functions, listed +pattern--action rules, +@code{ENDFILE} rules, @code{END} rules, and functions, listed alphabetically. Multiple @code{BEGIN} and @code{END} rules retain their separate identities, as do @@ -27657,7 +27659,7 @@ multiple @code{BEGINFILE} and @code{ENDFILE} rules. @cindex patterns, counts, in a profile @item -Pattern-action rules have two counts. +Pattern--action rules have two counts. The first count, to the left of the rule, shows how many times the rule's pattern was @emph{tested}. The second count, to the right of the rule's opening left brace @@ -27724,15 +27726,15 @@ the target of a redirection isn't a scalar, it gets parenthesized. @command{gawk} supplies leading comments in front of the @code{BEGIN} and @code{END} rules, the @code{BEGINFILE} and @code{ENDFILE} rules, -the pattern/action rules, and the functions. +the pattern--action rules, and the functions. @end itemize The profiled version of your program may not look exactly like what you typed when you wrote it. This is because @command{gawk} creates the -profiled version by ``pretty printing'' its internal representation of +profiled version by ``pretty-printing'' its internal representation of the program. The advantage to this is that @command{gawk} can produce -a standard representation. The disadvantage is that all source-code +a standard representation. The disadvantage is that all source code comments are lost. Also, things such as: @@ -27814,16 +27816,16 @@ If you use the @code{HUP} signal instead of the @code{USR1} signal, @cindex @code{SIGQUIT} signal (MS-Windows) @cindex signals, @code{QUIT}/@code{SIGQUIT} (MS-Windows) When @command{gawk} runs on MS-Windows systems, it uses the -@code{INT} and @code{QUIT} signals for producing the profile and, in +@code{INT} and @code{QUIT} signals for producing the profile, and in the case of the @code{INT} signal, @command{gawk} exits. This is because these systems don't support the @command{kill} command, so the only signals you can deliver to a program are those generated by the keyboard. The @code{INT} signal is generated by the -@kbd{Ctrl-@key{C}} or @kbd{Ctrl-@key{BREAK}} key, while the -@code{QUIT} signal is generated by the @kbd{Ctrl-@key{\}} key. +@kbd{Ctrl-c} or @kbd{Ctrl-BREAK} key, while the +@code{QUIT} signal is generated by the @kbd{Ctrl-\} key. Finally, @command{gawk} also accepts another option, @option{--pretty-print}. -When called this way, @command{gawk} ``pretty prints'' the program into +When called this way, @command{gawk} ``pretty-prints'' the program into @file{awkprof.out}, without any execution counts. @quotation NOTE @@ -27861,7 +27863,7 @@ optionally, close off one side of the two-way communications. @item By using special @value{FN}s with the @samp{|&} operator, you can open a -TCP/IP (or UDP/IP) connection to remote hosts in the Internet. @command{gawk} +TCP/IP (or UDP/IP) connection to remote hosts on the Internet. @command{gawk} supports both IPv4 and IPv6. @item @@ -27871,7 +27873,7 @@ you tune them more easily. Sending the @code{USR1} signal while profiling cause @command{gawk} to dump the profile and keep going, including a function call stack. @item -You can also just ``pretty print'' the program. This currently also runs +You can also just ``pretty-print'' the program. This currently also runs the program, but that will change in the next major release. @end itemize @@ -36970,10 +36972,10 @@ The generated Info file for this @value{DOCUMENT}. @item doc/gawkinet.texi The Texinfo source file for @ifinfo -@inforef{Top, , General Introduction, gawkinet, TCP/IP Internetworking with @command{gawk}}. +@inforef{Top, , General Introduction, gawkinet, @value{GAWKINETTITLE}}. @end ifinfo @ifnotinfo -@cite{TCP/IP Internetworking with @command{gawk}}. +@cite{@value{GAWKINETTITLE}}. @end ifnotinfo It should be processed with @TeX{} (via @command{texi2dvi} or @command{texi2pdf}) @@ -36982,7 +36984,7 @@ with @command{makeinfo} to produce an Info or HTML file. @item doc/gawkinet.info The generated Info file for -@cite{TCP/IP Internetworking with @command{gawk}}. +@cite{@value{GAWKINETTITLE}}. @item doc/igawk.1 The @command{troff} source for a manual page describing the @command{igawk} diff --git a/doc/gawktexi.in b/doc/gawktexi.in index cfddbd16..e02318bd 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -50,6 +50,7 @@ @set VERSION 4.1 @set PATCHLEVEL 2 +@set GAWKINETTITLE TCP/IP Internetworking with @command{gawk} @ifset FOR_PRINT @set TITLE Effective awk Programming @end ifset @@ -1462,7 +1463,7 @@ In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding features to do this for @command{gawk}. At that time, he also wrote the bulk of -@cite{TCP/IP Internetworking with @command{gawk}} +@cite{@value{GAWKINETTITLE}} (a separate document, available as part of the @command{gawk} distribution). His code finally became part of the main @command{gawk} distribution with @command{gawk} @value{PVERSION} 3.1. @@ -25802,18 +25803,18 @@ a violent psychopath who knows where you live.} This @value{CHAPTER} discusses advanced features in @command{gawk}. It's a bit of a ``grab bag'' of items that are otherwise unrelated to each other. -First, a command-line option allows @command{gawk} to recognize +First, we look at a command-line option that allows @command{gawk} to recognize nondecimal numbers in input data, not just in @command{awk} programs. Then, @command{gawk}'s special features for sorting arrays are presented. Next, two-way I/O, discussed briefly in earlier parts of this @value{DOCUMENT}, is described in full detail, along with the basics -of TCP/IP networking. Finally, @command{gawk} +of TCP/IP networking. Finally, we see how @command{gawk} can @dfn{profile} an @command{awk} program, making it possible to tune it for performance. @c FULLXREF ON -A number of advanced features require separate @value{CHAPTER}s of their +Additional advanced features are discussed in separate @value{CHAPTER}s of their own: @itemize @value{BULLET} @@ -25907,7 +25908,8 @@ This option may disappear in a future version of @command{gawk}. @node Array Sorting @section Controlling Array Traversal and Array Sorting -@command{gawk} lets you control the order in which a @samp{for (i in array)} +@command{gawk} lets you control the order in which a +@samp{for (@var{indx} in @var{array})} loop traverses an array. In addition, two built-in functions, @code{asort()} and @code{asorti()}, @@ -25923,7 +25925,7 @@ to order the elements during sorting. @node Controlling Array Traversal @subsection Controlling Array Traversal -By default, the order in which a @samp{for (i in array)} loop +By default, the order in which a @samp{for (@var{indx} in @var{array})} loop scans an array is not defined; it is generally based upon the internal implementation of arrays inside @command{awk}. @@ -25952,23 +25954,23 @@ function comp_func(i1, v1, i2, v2) @} @end example -Here, @var{i1} and @var{i2} are the indices, and @var{v1} and @var{v2} +Here, @code{i1} and @code{i2} are the indices, and @code{v1} and @code{v2} are the corresponding values of the two elements being compared. -Either @var{v1} or @var{v2}, or both, can be arrays if the array being +Either @code{v1} or @code{v2}, or both, can be arrays if the array being traversed contains subarrays as values. (@DBXREF{Arrays of Arrays} for more information about subarrays.) The three possible return values are interpreted as follows: @table @code @item comp_func(i1, v1, i2, v2) < 0 -Index @var{i1} comes before index @var{i2} during loop traversal. +Index @code{i1} comes before index @code{i2} during loop traversal. @item comp_func(i1, v1, i2, v2) == 0 -Indices @var{i1} and @var{i2} -come together but the relative order with respect to each other is undefined. +Indices @code{i1} and @code{i2} +come together, but the relative order with respect to each other is undefined. @item comp_func(i1, v1, i2, v2) > 0 -Index @var{i1} comes after index @var{i2} during loop traversal. +Index @code{i1} comes after index @code{i2} during loop traversal. @end table Our first comparison function can be used to scan an array in @@ -26129,7 +26131,7 @@ As already mentioned, the order of the indices is arbitrary if two elements compare equal. This is usually not a problem, but letting the tied elements come out in arbitrary order can be an issue, especially when comparing item values. The partial ordering of the equal elements -may change the next time the array is traversed, if other elements are added or +may change the next time the array is traversed, if other elements are added to or removed from the array. One way to resolve ties when comparing elements with otherwise equal values is to include the indices in the comparison rules. Note that doing this may make the loop traversal less efficient, @@ -26172,7 +26174,7 @@ equivalent or distinct. Another point to keep in mind is that in the case of subarrays, the element values can themselves be arrays; a production comparison function should use the @code{isarray()} function -(@pxref{Type Functions}), +(@pxref{Type Functions}) to check for this, and choose a defined sorting order for subarrays. All sorting based on @code{PROCINFO["sorted_in"]} @@ -26180,7 +26182,7 @@ is disabled in POSIX mode, because the @code{PROCINFO} array is not special in that case. As a side note, sorting the array indices before traversing -the array has been reported to add 15% to 20% overhead to the +the array has been reported to add a 15% to 20% overhead to the execution time of @command{awk} programs. For this reason, sorted array traversal is not the default. @@ -26239,7 +26241,7 @@ However, the @code{source} array is not affected. Often, what's needed is to sort on the values of the @emph{indices} instead of the values of the elements. To do that, use the @code{asorti()} function. The interface and behavior are identical to -that of @code{asort()}, except that the index values are used for sorting, +that of @code{asort()}, except that the index values are used for sorting and become the values of the result array: @example @@ -26274,8 +26276,8 @@ it chooses}, taking into account just the indices, just the values, or both. This is extremely powerful. Once the array is sorted, @code{asort()} takes the @emph{values} in -their final order, and uses them to fill in the result array, whereas -@code{asorti()} takes the @emph{indices} in their final order, and uses +their final order and uses them to fill in the result array, whereas +@code{asorti()} takes the @emph{indices} in their final order and uses them to fill in the result array. @cindex reference counting, sorting arrays @@ -26572,7 +26574,7 @@ service name. @cindex @command{gawk}, @code{ERRNO} variable in @cindex @code{ERRNO} variable @quotation NOTE -Failure in opening a two-way socket will result in a non-fatal error +Failure in opening a two-way socket will result in a nonfatal error being returned to the calling code. The value of @code{ERRNO} indicates the error (@pxref{Auto-set}). @end quotation @@ -26589,19 +26591,19 @@ BEGIN @{ @end example This program reads the current date and time from the local system's -TCP @samp{daytime} server. +TCP @code{daytime} server. It then prints the results and closes the connection. Because this topic is extensive, the use of @command{gawk} for TCP/IP programming is documented separately. @ifinfo See -@inforef{Top, , General Introduction, gawkinet, TCP/IP Internetworking with @command{gawk}}, +@inforef{Top, , General Introduction, gawkinet, @value{GAWKINETTITLE}}, @end ifinfo @ifnotinfo See @uref{http://www.gnu.org/software/gawk/manual/gawkinet/, -@cite{TCP/IP Internetworking with @command{gawk}}}, +@cite{@value{GAWKINETTITLE}}}, which comes as part of the @command{gawk} distribution, @end ifnotinfo for a much more complete introduction and discussion, as well as @@ -26677,9 +26679,9 @@ junk @end example Here is the @file{awkprof.out} that results from running the -@command{gawk} profiler on this program and data. (This example also +@command{gawk} profiler on this program and data (this example also illustrates that @command{awk} programmers sometimes get up very early -in the morning to work.) +in the morning to work): @cindex @code{BEGIN} pattern, and profiling @cindex @code{END} pattern, and profiling @@ -26739,8 +26741,8 @@ They are as follows: @item The program is printed in the order @code{BEGIN} rules, @code{BEGINFILE} rules, -pattern/action rules, -@code{ENDFILE} rules, @code{END} rules and functions, listed +pattern--action rules, +@code{ENDFILE} rules, @code{END} rules, and functions, listed alphabetically. Multiple @code{BEGIN} and @code{END} rules retain their separate identities, as do @@ -26748,7 +26750,7 @@ multiple @code{BEGINFILE} and @code{ENDFILE} rules. @cindex patterns, counts, in a profile @item -Pattern-action rules have two counts. +Pattern--action rules have two counts. The first count, to the left of the rule, shows how many times the rule's pattern was @emph{tested}. The second count, to the right of the rule's opening left brace @@ -26815,15 +26817,15 @@ the target of a redirection isn't a scalar, it gets parenthesized. @command{gawk} supplies leading comments in front of the @code{BEGIN} and @code{END} rules, the @code{BEGINFILE} and @code{ENDFILE} rules, -the pattern/action rules, and the functions. +the pattern--action rules, and the functions. @end itemize The profiled version of your program may not look exactly like what you typed when you wrote it. This is because @command{gawk} creates the -profiled version by ``pretty printing'' its internal representation of +profiled version by ``pretty-printing'' its internal representation of the program. The advantage to this is that @command{gawk} can produce -a standard representation. The disadvantage is that all source-code +a standard representation. The disadvantage is that all source code comments are lost. Also, things such as: @@ -26905,16 +26907,16 @@ If you use the @code{HUP} signal instead of the @code{USR1} signal, @cindex @code{SIGQUIT} signal (MS-Windows) @cindex signals, @code{QUIT}/@code{SIGQUIT} (MS-Windows) When @command{gawk} runs on MS-Windows systems, it uses the -@code{INT} and @code{QUIT} signals for producing the profile and, in +@code{INT} and @code{QUIT} signals for producing the profile, and in the case of the @code{INT} signal, @command{gawk} exits. This is because these systems don't support the @command{kill} command, so the only signals you can deliver to a program are those generated by the keyboard. The @code{INT} signal is generated by the -@kbd{Ctrl-@key{C}} or @kbd{Ctrl-@key{BREAK}} key, while the -@code{QUIT} signal is generated by the @kbd{Ctrl-@key{\}} key. +@kbd{Ctrl-c} or @kbd{Ctrl-BREAK} key, while the +@code{QUIT} signal is generated by the @kbd{Ctrl-\} key. Finally, @command{gawk} also accepts another option, @option{--pretty-print}. -When called this way, @command{gawk} ``pretty prints'' the program into +When called this way, @command{gawk} ``pretty-prints'' the program into @file{awkprof.out}, without any execution counts. @quotation NOTE @@ -26952,7 +26954,7 @@ optionally, close off one side of the two-way communications. @item By using special @value{FN}s with the @samp{|&} operator, you can open a -TCP/IP (or UDP/IP) connection to remote hosts in the Internet. @command{gawk} +TCP/IP (or UDP/IP) connection to remote hosts on the Internet. @command{gawk} supports both IPv4 and IPv6. @item @@ -26962,7 +26964,7 @@ you tune them more easily. Sending the @code{USR1} signal while profiling cause @command{gawk} to dump the profile and keep going, including a function call stack. @item -You can also just ``pretty print'' the program. This currently also runs +You can also just ``pretty-print'' the program. This currently also runs the program, but that will change in the next major release. @end itemize @@ -36061,10 +36063,10 @@ The generated Info file for this @value{DOCUMENT}. @item doc/gawkinet.texi The Texinfo source file for @ifinfo -@inforef{Top, , General Introduction, gawkinet, TCP/IP Internetworking with @command{gawk}}. +@inforef{Top, , General Introduction, gawkinet, @value{GAWKINETTITLE}}. @end ifinfo @ifnotinfo -@cite{TCP/IP Internetworking with @command{gawk}}. +@cite{@value{GAWKINETTITLE}}. @end ifnotinfo It should be processed with @TeX{} (via @command{texi2dvi} or @command{texi2pdf}) @@ -36073,7 +36075,7 @@ with @command{makeinfo} to produce an Info or HTML file. @item doc/gawkinet.info The generated Info file for -@cite{TCP/IP Internetworking with @command{gawk}}. +@cite{@value{GAWKINETTITLE}}. @item doc/igawk.1 The @command{troff} source for a manual page describing the @command{igawk} -- cgit v1.2.3 From 0acf419f9452f9f8133214742818d379ef779244 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 6 Feb 2015 11:24:52 +0200 Subject: Edits in NEWS. --- NEWS | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index ba86e965..faeb461f 100644 --- a/NEWS +++ b/NEWS @@ -21,8 +21,7 @@ Changes from 4.1.1 to 4.1.2 4. A number of bugs have been fixed in the MPFR code. -5. Indirect function calls now work for both built-in and - extension functions. +5. Indirect function calls now work for both built-in and extension functions. 6. Built-in functions are now included in FUNCTAB. @@ -46,7 +45,11 @@ Changes from 4.1.1 to 4.1.2 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 +11. If a user-defined function has a parameter with the same name as another + user-defined function, it is no longer possible to call the second + function from inside the first. + +12. 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. With --posix, it now also checks for the latter. -- cgit v1.2.3 From 871e6f0348f8e6ee82a9ddcfcf8f88f4c818e4ae Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 6 Feb 2015 11:25:10 +0200 Subject: Update copyright dates. --- awk.h | 2 +- gawkapi.c | 2 +- main.c | 4 ++-- symbol.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/awk.h b/awk.h index cdac139a..08c6891c 100644 --- a/awk.h +++ b/awk.h @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. diff --git a/gawkapi.c b/gawkapi.c index fc6e159a..3b495452 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2012-2014 the Free Software Foundation, Inc. + * Copyright (C) 2012-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. diff --git a/main.c b/main.c index b31c746a..62f99a59 100644 --- a/main.c +++ b/main.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -24,7 +24,7 @@ */ /* FIX THIS BEFORE EVERY RELEASE: */ -#define UPDATE_YEAR 2014 +#define UPDATE_YEAR 2015 #include "awk.h" #include "getopt.h" diff --git a/symbol.c b/symbol.c index cbfb1edf..d698299b 100644 --- a/symbol.c +++ b/symbol.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2013 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. -- cgit v1.2.3 From 840a7fd39249c6680e74dd72d1ba0c55174a4996 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 7 Feb 2015 20:01:44 +0200 Subject: Sync regex with GLIBC. --- ChangeLog | 5 +++++ regcomp.c | 18 +++++++++++++----- regex.c | 2 +- regex.h | 2 +- regex_internal.c | 2 +- regex_internal.h | 5 ++--- regexec.c | 10 ++++++---- 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8cd101c..9d175372 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-02-07 Arnold D. Robbins + + * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h, + regexec.c: Sync with GLIBC. Mostly copyright date updates. + 2015-02-05 Andrew J. Schorr * eval.c (set_IGNORECASE): If IGNORECASE has a numeric value, try diff --git a/regcomp.c b/regcomp.c index e0c460ff..a3148c0e 100644 --- a/regcomp.c +++ b/regcomp.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2013 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -17,6 +17,14 @@ License along with the GNU C Library; if not, see . */ +#ifdef HAVE_STDINT_H +#include +#endif + +#ifdef _LIBC +# include +#endif + static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern, size_t length, reg_syntax_t syntax); static void re_compile_fastmap_iter (regex_t *bufp, @@ -3175,6 +3183,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, re_token_t token2; start_elem.opr.name = start_name_buf; + start_elem.type = COLL_SYM; ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa, syntax, first_round); if (BE (ret != REG_NOERROR, 0)) @@ -3218,6 +3227,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, if (is_range_exp == 1) { end_elem.opr.name = end_name_buf; + end_elem.type = COLL_SYM; ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2, dfa, syntax, 1); if (BE (ret != REG_NOERROR, 0)) @@ -3491,8 +3501,6 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) int32_t idx1, idx2; unsigned int ch; size_t len; - /* This #include defines a local function! */ -# include /* Calculate the index for equivalence class. */ cp = name; table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); @@ -3502,7 +3510,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) _NL_COLLATE_EXTRAMB); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); - idx1 = findidx (&cp, -1); + idx1 = findidx (table, indirect, extra, &cp, -1); if (BE (idx1 == 0 || *cp != '\0', 0)) /* This isn't a valid character. */ return REG_ECOLLATE; @@ -3514,7 +3522,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) { char_buf[0] = ch; cp = char_buf; - idx2 = findidx (&cp, 1); + idx2 = findidx (table, indirect, extra, &cp, 1); /* idx2 = table[ch]; */ diff --git a/regex.c b/regex.c index f56e8692..ed6a4f5d 100644 --- a/regex.c +++ b/regex.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff --git a/regex.h b/regex.h index 56602961..cd470a04 100644 --- a/regex.h +++ b/regex.h @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library. - Copyright (C) 1985, 1989-2014 Free Software Foundation, Inc. + Copyright (C) 1985, 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/regex_internal.c b/regex_internal.c index 9e427081..5a5b9363 100644 --- a/regex_internal.c +++ b/regex_internal.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff --git a/regex_internal.h b/regex_internal.h index 3fc2fc58..9aab5e52 100644 --- a/regex_internal.h +++ b/regex_internal.h @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -79,7 +79,6 @@ is_blank (int c) # ifndef _RE_DEFINE_LOCALE_FUNCTIONS # define _RE_DEFINE_LOCALE_FUNCTIONS 1 # include -# include # include # endif #endif @@ -792,7 +791,7 @@ re_string_elem_size_at (const re_string_t *pstr, int idx) indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); p = pstr->mbs + idx; - findidx (&p, pstr->len - idx); + findidx (table, indirect, extra, &p, pstr->len - idx); return p - pstr->mbs - idx; } else diff --git a/regexec.c b/regexec.c index 77795f69..30f2ec74 100644 --- a/regexec.c +++ b/regexec.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2013 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -3762,6 +3762,10 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state, one collating element like '.', '[a-z]', opposite to the other nodes can only accept one byte. */ +# ifdef _LIBC +# include +# endif + static int internal_function check_node_accept_bytes (const re_dfa_t *dfa, int node_idx, @@ -3883,8 +3887,6 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx, const int32_t *table, *indirect; const unsigned char *weights, *extra; const char *collseqwc; - /* This #include defines a local function! */ -# include /* match with collating_symbol? */ if (cset->ncoll_syms) @@ -3940,7 +3942,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx, _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); - int32_t idx = findidx (&cp, elem_len); + int32_t idx = findidx (table, indirect, extra, &cp, elem_len); if (idx > 0) for (i = 0; i < cset->nequiv_classes; ++i) { -- cgit v1.2.3 From efbd4b724d239fa3c2d2929dc50e4bb4703489b9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Feb 2015 08:58:37 +0200 Subject: More edits. Through Chapter 14. --- doc/ChangeLog | 4 + doc/gawk.info | 599 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 146 +++++++------- doc/gawktexi.in | 146 +++++++------- 4 files changed, 445 insertions(+), 450 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9fc7bdca..319ecb2f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-08 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-02-06 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index 9381b503..5bfdd436 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -20043,7 +20043,7 @@ File: gawk.info, Node: I18N and L10N, Next: Explaining gettext, Up: Internati "Internationalization" means writing (or modifying) a program once, in such a way that it can use multiple languages without requiring further -source-code changes. "Localization" means providing the data necessary +source code changes. "Localization" means providing the data necessary for an internationalized program to work in a particular language. Most typically, these terms refer to features such as the language used for printing error messages, the language used to read responses, and @@ -20057,7 +20057,7 @@ File: gawk.info, Node: Explaining gettext, Next: Programmer i18n, Prev: I18N ================== `gawk' uses GNU `gettext' to provide its internationalization features. -The facilities in GNU `gettext' focus on messages; strings printed by a +The facilities in GNU `gettext' focus on messages: strings printed by a program, either directly or via formatting with `printf' or `sprintf()'.(1) @@ -20186,8 +20186,7 @@ File: gawk.info, Node: Programmer i18n, Next: Translator i18n, Prev: Explaini 13.3 Internationalizing `awk' Programs ====================================== -`gawk' provides the following variables and functions for -internationalization: +`gawk' provides the following variables for internationalization: `TEXTDOMAIN' This variable indicates the application's text domain. For @@ -20199,6 +20198,8 @@ internationalization: for translation at runtime. String constants without a leading underscore are not translated. + `gawk' provides the following functions for internationalization: + ``dcgettext(STRING' [`,' DOMAIN [`,' CATEGORY]]`)'' Return the translation of STRING in text domain DOMAIN for locale category CATEGORY. The default value for DOMAIN is the current @@ -20237,8 +20238,7 @@ internationalization: the null string (`""'), then `bindtextdomain()' returns the current binding for the given DOMAIN. - To use these facilities in your `awk' program, follow the steps -outlined in *note Explaining gettext::, like so: + To use these facilities in your `awk' program, follow these steps: 1. Set the variable `TEXTDOMAIN' to the text domain of your program. This is best done in a `BEGIN' rule (*note BEGIN/END::), or it can @@ -20460,7 +20460,7 @@ actually almost portable, requiring very little change: its value, leaving the original string constant as the result. * By defining "dummy" functions to replace `dcgettext()', - `dcngettext()' and `bindtextdomain()', the `awk' program can be + `dcngettext()', and `bindtextdomain()', the `awk' program can be made to run, but all the messages are output in the original language. For example: @@ -20595,8 +20595,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.4 +`gettext' utilities)Top:: gettext, GNU `gettext' utilities.) As of +this 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 @@ -20609,7 +20609,7 @@ File: gawk.info, Node: I18N Summary, Prev: Gawk I18N, Up: Internationalizatio ============ * Internationalization means writing a program such that it can use - multiple languages without requiring source-code changes. + multiple languages without requiring source code changes. Localization means providing the data necessary for an internationalized program to work in a particular language. @@ -20623,10 +20623,10 @@ File: gawk.info, Node: I18N Summary, Prev: Gawk I18N, Up: Internationalizatio file, and the `.po' files are compiled into `.gmo' files for use at runtime. - * You can use position specifications with `sprintf()' and `printf' - to rearrange the placement of argument values in formatted strings - and output. This is useful for the translations of format control - strings. + * You can use positional specifications with `sprintf()' and + `printf' to rearrange the placement of argument values in formatted + strings and output. This is useful for the translation of format + control strings. * The internationalization features have been designed so that they can be easily worked around in a standard `awk'. @@ -20682,8 +20682,7 @@ File: gawk.info, Node: Debugging Concepts, Next: Debugging Terms, Up: Debuggi --------------------------- (If you have used debuggers in other languages, you may want to skip -ahead to the next section on the specific features of the `gawk' -debugger.) +ahead to *note Awk Debugging::.) Of course, a debugging program cannot remove bugs for you, because it has no way of knowing what you or your users consider a "bug" versus @@ -20770,11 +20769,11 @@ defines terms used throughout the rest of this major node:  File: gawk.info, Node: Awk Debugging, Prev: Debugging Terms, Up: Debugging -14.1.3 Awk Debugging --------------------- +14.1.3 `awk' Debugging +---------------------- Debugging an `awk' program has some specific aspects that are not -shared with other programming languages. +shared with programs written in other languages. First of all, the fact that `awk' programs usually take input line by line from a file or files and operate on those lines using specific @@ -20792,8 +20791,8 @@ commands.  File: gawk.info, Node: Sample Debugging Session, Next: List of Debugger Commands, Prev: Debugging, Up: Debugger -14.2 Sample Debugging Session -============================= +14.2 Sample `gawk' Debugging Session +==================================== In order to illustrate the use of `gawk' as a debugger, let's look at a sample debugging session. We will use the `awk' implementation of the @@ -20812,8 +20811,8 @@ File: gawk.info, Node: Debugger Invocation, Next: Finding The Bug, Up: Sample -------------------------------- Starting the debugger is almost exactly like running `gawk' normally, -except you have to pass an additional option `--debug', or the -corresponding short option `-D'. The file(s) containing the program +except you have to pass an additional option, `--debug', or the +corresponding short option, `-D'. The file(s) containing the program and any supporting code are given on the command line as arguments to one or more `-f' options. (`gawk' is not designed to debug command-line programs, only programs contained in files.) In our case, we invoke @@ -20823,7 +20822,7 @@ the debugger like this: where both `getopt.awk' and `uniq.awk' are in `$AWKPATH'. (Experienced users of GDB or similar debuggers should note that this syntax is -slightly different from what they are used to. With the `gawk' +slightly different from what you are used to. With the `gawk' debugger, you give the arguments for running the program in the command line to the debugger rather than as part of the `run' command at the debugger prompt.) The `-1' is an option to `uniq.awk'. @@ -20947,10 +20946,10 @@ typing `n' (for "next"): -| 66 if (fcount > 0) { This tells us that `gawk' is now ready to execute line 66, which -decides whether to give the lines the special "field skipping" treatment +decides whether to give the lines the special "field-skipping" treatment indicated by the `-1' command-line option. (Notice that we skipped -from where we were before at line 63 to here, because the condition in -line 63 `if (fcount == 0 && charcount == 0)' was false.) +from where we were before, at line 63, to here, because the condition +in line 63, `if (fcount == 0 && charcount == 0)', was false.) Continuing to step, we now get to the splitting of the current and last records: @@ -21008,15 +21007,15 @@ mentioned): Well, here we are at our error (sorry to spoil the suspense). What we had in mind was to join the fields starting from the second one to -make the virtual record to compare, and if the first field was numbered -zero, this would work. Let's look at what we've got: +make the virtual record to compare, and if the first field were +numbered zero, this would work. Let's look at what we've got: gawk> p cline clast -| cline = "gawk is a wonderful program!" -| clast = "awk is a wonderful program!" Hey, those look pretty familiar! They're just our original, -unaltered, input records. A little thinking (the human brain is still +unaltered input records. A little thinking (the human brain is still the best debugging tool), and we realize that we were off by one! We get out of the debugger: @@ -21053,11 +21052,11 @@ categories: * Miscellaneous Each of these are discussed in the following subsections. In the -following descriptions, commands which may be abbreviated show the +following descriptions, commands that may be abbreviated show the abbreviation on a second description line. A debugger command name may also be truncated if that partial name is unambiguous. The debugger has the built-in capability to automatically repeat the previous command -just by hitting . This works for the commands `list', `next', +just by hitting `Enter'. This works for the commands `list', `next', `nexti', `step', `stepi', and `continue' executed without any argument. * Menu: @@ -21097,8 +21096,8 @@ The commands for controlling breakpoints are: Set a breakpoint at entry to (the first instruction of) function FUNCTION. - Each breakpoint is assigned a number which can be used to delete - it from the breakpoint list using the `delete' command. + Each breakpoint is assigned a number that can be used to delete it + from the breakpoint list using the `delete' command. With a breakpoint, you may also supply a condition. This is an `awk' expression (enclosed in double quotes) that the debugger @@ -21136,26 +21135,26 @@ The commands for controlling breakpoints are: `delete' [N1 N2 ...] [N-M] `d' [N1 N2 ...] [N-M] - Delete specified breakpoints or a range of breakpoints. Deletes - all defined breakpoints if no argument is supplied. + Delete specified breakpoints or a range of breakpoints. Delete all + defined breakpoints if no argument is supplied. `disable' [N1 N2 ... | N-M] Disable specified breakpoints or a range of breakpoints. Without - any argument, disables all breakpoints. + any argument, disable all breakpoints. `enable' [`del' | `once'] [N1 N2 ...] [N-M] `e' [`del' | `once'] [N1 N2 ...] [N-M] Enable specified breakpoints or a range of breakpoints. Without - any argument, enables all breakpoints. Optionally, you can - specify how to enable the breakpoint: + any argument, enable all breakpoints. Optionally, you can specify + how to enable the breakpoints: `del' - Enable the breakpoint(s) temporarily, then delete it when the - program stops at the breakpoint. + Enable the breakpoints temporarily, then delete each one when + the program stops at it. `once' - Enable the breakpoint(s) temporarily, then disable it when - the program stops at the breakpoint. + Enable the breakpoints temporarily, then disable each one when + the program stops at it. `ignore' N COUNT Ignore breakpoint number N the next COUNT times it is hit. @@ -21201,7 +21200,7 @@ execution of the program than we saw in our earlier example: `continue' [COUNT] `c' [COUNT] Resume program execution. If continued from a breakpoint and COUNT - is specified, ignores the breakpoint at that location the next + is specified, ignore the breakpoint at that location the next COUNT times before stopping. `finish' @@ -21236,10 +21235,10 @@ execution of the program than we saw in our earlier example: `step' [COUNT] `s' [COUNT] Continue execution until control reaches a different source line - in the current stack frame. `step' steps inside any function - called within the line. If the argument COUNT is supplied, steps - that many times before stopping, unless it encounters a breakpoint - or watchpoint. + in the current stack frame, stepping inside any function called + within the line. If the argument COUNT is supplied, steps that + many times before stopping, unless it encounters a breakpoint or + watchpoint. `stepi' [COUNT] `si' [COUNT] @@ -21320,13 +21319,13 @@ AWK STATEMENTS (`"'...`"'). You can also set special `awk' variables, such as `FS', `NF', - `NR', and son on. + `NR', and so on. `watch' VAR | `$'N [`"EXPRESSION"'] `w' VAR | `$'N [`"EXPRESSION"'] Add variable VAR (or field `$N') to the watch list. The debugger then stops whenever the value of the variable or field changes. - Each watched item is assigned a number which can be used to delete + Each watched item is assigned a number that can be used to delete it from the watch list using the `unwatch' command. With a watchpoint, you may also supply a condition. This is an @@ -21350,11 +21349,11 @@ File: gawk.info, Node: Execution Stack, Next: Debugger Info, Prev: Viewing An 14.3.4 Working with the Stack ----------------------------- -Whenever you run a program which contains any function calls, `gawk' +Whenever you run a program that contains any function calls, `gawk' maintains a stack of all of the function calls leading up to where the program is right now. You can see how you got to where you are, and also move around in the stack to see what the state of things was in the -functions which called the one you are in. The commands for doing this +functions that called the one you are in. The commands for doing this are: `backtrace' [COUNT] @@ -21374,8 +21373,8 @@ are: `frame' [N] `f' [N] Select and print stack frame N. Frame 0 is the currently - executing, or "innermost", frame (function call), frame 1 is the - frame that called the innermost one. The highest numbered frame is + executing, or "innermost", frame (function call); frame 1 is the + frame that called the innermost one. The highest-numbered frame is the one for the main program. The printed information consists of the frame number, function and argument names, source file, and the source line. @@ -21392,7 +21391,7 @@ File: gawk.info, Node: Debugger Info, Next: Miscellaneous Debugger Commands, Besides looking at the values of variables, there is often a need to get other sorts of information about the state of your program and of the -debugging environment itself. The `gawk' debugger has one command which +debugging environment itself. The `gawk' debugger has one command that provides this information, appropriately called `info'. `info' is used with one of a number of arguments that tell it exactly what you want to know: @@ -21449,11 +21448,12 @@ from a file. The commands are: option. The available options are: `history_size' - The maximum number of lines to keep in the history file + Set the maximum number of lines to keep in the history file `./.gawk_history'. The default is 100. `listsize' - The number of lines that `list' prints. The default is 15. + Specify the number of lines that `list' prints. The default + is 15. `outfile' Send `gawk' output to a file; debugger output still goes to @@ -21461,7 +21461,7 @@ from a file. The commands are: standard output. `prompt' - The debugger prompt. The default is `gawk> '. + Change the debugger prompt. The default is `gawk> '. `save_history' [`on' | `off'] Save command history to file `./.gawk_history'. The default @@ -21469,8 +21469,8 @@ from a file. The commands are: `save_options' [`on' | `off'] Save current options to file `./.gawkrc' upon exit. The - default is `on'. Options are read back in to the next - session upon startup. + default is `on'. Options are read back into the next session + upon startup. `trace' [`on' | `off'] Turn instruction tracing on or off. The default is `off'. @@ -21489,7 +21489,7 @@ from a file. The commands are: commands; however, the `gawk' debugger will not source the same file more than once in order to avoid infinite recursion. - In addition to, or instead of the `source' command, you can use + In addition to, or instead of, the `source' command, you can use the `-D FILE' or `--debug=FILE' command-line options to execute commands from a file non-interactively (*note Options::). @@ -21499,13 +21499,13 @@ File: gawk.info, Node: Miscellaneous Debugger Commands, Prev: Debugger Info, 14.3.6 Miscellaneous Commands ----------------------------- -There are a few more commands which do not fit into the previous +There are a few more commands that do not fit into the previous categories, as follows: `dump' [FILENAME] - Dump bytecode of the program to standard output or to the file + Dump byte code of the program to standard output or to the file named in FILENAME. This prints a representation of the internal - instructions which `gawk' executes to implement the `awk' commands + instructions that `gawk' executes to implement the `awk' commands in a program. This can be very enlightening, as the following partial dump of Davide Brini's obfuscated code (*note Signature Program::) demonstrates: @@ -21589,22 +21589,21 @@ categories, as follows: FILENAME. This command may change the current source file. FUNCTION - Print lines centered around beginning of the function + Print lines centered around the beginning of the function FUNCTION. This command may change the current source file. `quit' `q' Exit the debugger. Debugging is great fun, but sometimes we all have to tend to other obligations in life, and sometimes we find - the bug, and are free to go on to the next one! As we saw - earlier, if you are running a program, the debugger warns you if - you accidentally type `q' or `quit', to make sure you really want - to quit. + the bug and are free to go on to the next one! As we saw earlier, + if you are running a program, the debugger warns you when you type + `q' or `quit', to make sure you really want to quit. `trace' [`on' | `off'] - Turn on or off a continuous printing of instructions which are - about to be executed, along with printing the `awk' line which they - implement. The default is `off'. + Turn on or off continuous printing of the instructions that are + about to be executed, along with the `awk' lines they implement. + The default is `off'. It is to be hoped that most of the "opcodes" in these instructions are fairly self-explanatory, and using `stepi' and `nexti' while @@ -21617,7 +21616,7 @@ File: gawk.info, Node: Readline Support, Next: Limitations, Prev: List of Deb 14.4 Readline Support ===================== -If `gawk' is compiled with the `readline' library +If `gawk' is compiled with the GNU Readline library (http://cnswww.cns.cwru.edu/php/chet/readline/readline.html), you can take advantage of that library's command completion and history expansion features. The following types of completion are available: @@ -21647,7 +21646,7 @@ File: gawk.info, Node: Limitations, Next: Debugging Summary, Prev: Readline S We hope you find the `gawk' debugger useful and enjoyable to work with, but as with any program, especially in its early releases, it still has -some limitations. A few which are worth being aware of are: +some limitations. A few that it's worth being aware of are: * At this point, the debugger does not give a detailed explanation of what you did wrong when you type in something it doesn't like. @@ -21658,13 +21657,13 @@ some limitations. A few which are worth being aware of are: Commands:: (or if you are already familiar with `gawk' internals), you will realize that much of the internal manipulation of data in `gawk', as in many interpreters, is done on a stack. `Op_push', - `Op_pop', and the like, are the "bread and butter" of most `gawk' + `Op_pop', and the like are the "bread and butter" of most `gawk' code. Unfortunately, as of now, the `gawk' debugger does not allow you to examine the stack's contents. That is, the intermediate results of expression evaluation are on the stack, but cannot be - printed. Rather, only variables which are defined in the program + printed. Rather, only variables that are defined in the program can be printed. Of course, a workaround for this is to use more explicit variables at the debugging stage and then change back to obscure, perhaps more optimal code later. @@ -21676,12 +21675,12 @@ some limitations. A few which are worth being aware of are: * The `gawk' debugger is designed to be used by running a program (with all its parameters) on the command line, as described in *note Debugger Invocation::. There is no way (as of now) to - attach or "break in" to a running program. This seems reasonable - for a language which is used mainly for quickly executing, short + attach or "break into" a running program. This seems reasonable + for a language that is used mainly for quickly executing, short programs. - * The `gawk' debugger only accepts source supplied with the `-f' - option. + * The `gawk' debugger only accepts source code supplied with the + `-f' option.  File: gawk.info, Node: Debugging Summary, Prev: Limitations, Up: Debugger @@ -21690,8 +21689,8 @@ File: gawk.info, Node: Debugging Summary, Prev: Limitations, Up: Debugger ============ * Programs rarely work correctly the first time. Finding bugs is - "debugging" and a program that helps you find bugs is a - "debugger". `gawk' has a built-in debugger that works very + called debugging, and a program that helps you find bugs is a + debugger. `gawk' has a built-in debugger that works very similarly to the GNU Debugger, GDB. * Debuggers let you step through your program one statement at a @@ -21707,8 +21706,8 @@ File: gawk.info, Node: Debugging Summary, Prev: Limitations, Up: Debugger breakpoints, execution, viewing and changing data, working with the stack, getting information, and other tasks. - * If the `readline' library is available when `gawk' is compiled, it - is used by the debugger to provide command-line history and + * If the GNU Readline library is available when `gawk' is compiled, + it is used by the debugger to provide command-line history and editing. @@ -31575,7 +31574,7 @@ Index * -W option: Options. (line 46) * . (period), regexp operator: Regexp Operators. (line 44) * .gmo files: Explaining gettext. (line 42) -* .gmo files, specifying directory of <1>: Programmer i18n. (line 47) +* .gmo files, specifying directory of <1>: Programmer i18n. (line 48) * .gmo files, specifying directory of: Explaining gettext. (line 54) * .mo files, converting from .po: I18N Example. (line 64) * .po files <1>: Translator i18n. (line 6) @@ -31981,7 +31980,7 @@ Index * Berry, Karl <1>: Ranges and Locales. (line 74) * Berry, Karl: Acknowledgments. (line 33) * binary input/output: User-modified. (line 15) -* bindtextdomain <1>: Programmer i18n. (line 47) +* bindtextdomain <1>: Programmer i18n. (line 48) * bindtextdomain: I18N Functions. (line 12) * bindtextdomain() function (C library): Explaining gettext. (line 50) * bindtextdomain() function (gawk), portability and: I18N Portability. @@ -32315,11 +32314,11 @@ Index * Davies, Stephen <1>: Contributors. (line 74) * Davies, Stephen: Acknowledgments. (line 60) * Day, Robert P.J.: Acknowledgments. (line 78) -* dcgettext <1>: Programmer i18n. (line 19) +* dcgettext <1>: Programmer i18n. (line 20) * dcgettext: I18N Functions. (line 22) * dcgettext() function (gawk), portability and: I18N Portability. (line 33) -* dcngettext <1>: Programmer i18n. (line 36) +* dcngettext <1>: Programmer i18n. (line 37) * dcngettext: I18N Functions. (line 28) * dcngettext() function (gawk), portability and: I18N Portability. (line 33) @@ -32406,7 +32405,7 @@ Index * debugger commands, t (tbreak): Breakpoint Control. (line 90) * debugger commands, tbreak: Breakpoint Control. (line 90) * debugger commands, trace: Miscellaneous Debugger Commands. - (line 108) + (line 107) * debugger commands, u (until): Debugger Execution Control. (line 83) * debugger commands, undisplay: Viewing And Changing Data. @@ -32422,12 +32421,12 @@ Index (line 67) * debugger commands, where (backtrace): Execution Stack. (line 13) * debugger default list amount: Debugger Info. (line 69) -* debugger history file: Debugger Info. (line 80) +* debugger history file: Debugger Info. (line 81) * debugger history size: Debugger Info. (line 65) * debugger options: Debugger Info. (line 57) -* debugger prompt: Debugger Info. (line 77) +* debugger prompt: Debugger Info. (line 78) * debugger, how to start: Debugger Invocation. (line 6) -* debugger, read commands from a file: Debugger Info. (line 96) +* debugger, read commands from a file: Debugger Info. (line 97) * debugging awk programs: Debugger. (line 6) * debugging gawk, bug reports: Bugs. (line 9) * decimal point character, locale specific: Options. (line 272) @@ -32757,7 +32756,7 @@ Index * FILENAME variable, getline, setting with: Getline Notes. (line 19) * filenames, assignments as: Ignoring Assigns. (line 6) * files, .gmo: Explaining gettext. (line 42) -* files, .gmo, specifying directory of <1>: Programmer i18n. (line 47) +* files, .gmo, specifying directory of <1>: Programmer i18n. (line 48) * files, .gmo, specifying directory of: Explaining gettext. (line 54) * files, .mo, converting from .po: I18N Example. (line 64) * files, .po <1>: Translator i18n. (line 6) @@ -32784,7 +32783,7 @@ Index * files, message object, converting from portable object files: I18N Example. (line 64) * files, message object, specifying directory of <1>: Programmer i18n. - (line 47) + (line 48) * files, message object, specifying directory of: Explaining gettext. (line 54) * files, multiple passes over: Other Arguments. (line 56) @@ -33190,7 +33189,7 @@ Index * insomnia, cure for: Alarm Program. (line 6) * installation, VMS: VMS Installation. (line 6) * installing gawk: Installation. (line 6) -* instruction tracing, in debugger: Debugger Info. (line 89) +* instruction tracing, in debugger: Debugger Info. (line 90) * int: Numeric Functions. (line 23) * INT signal (MS-Windows): Profiling. (line 214) * integer array indices: Numeric Array Subscripts. @@ -33211,7 +33210,7 @@ Index * internationalization, localization, locale categories: Explaining gettext. (line 81) * internationalization, localization, marked strings: Programmer i18n. - (line 14) + (line 13) * internationalization, localization, portability and: I18N Portability. (line 6) * internationalizing a program: Explaining gettext. (line 6) @@ -33392,7 +33391,7 @@ Index * message object files, converting from portable object files: I18N Example. (line 64) * message object files, specifying directory of <1>: Programmer i18n. - (line 47) + (line 48) * message object files, specifying directory of: Explaining gettext. (line 54) * messages from extensions: Printing Messages. (line 6) @@ -33836,7 +33835,7 @@ Index * records, terminating: awk split records. (line 125) * records, treating files as: gawk split records. (line 93) * recursive functions: Definition Syntax. (line 88) -* redirect gawk output, in debugger: Debugger Info. (line 72) +* redirect gawk output, in debugger: Debugger Info. (line 73) * redirection of input: Getline/File. (line 6) * redirection of output: Redirection. (line 6) * reference counting, sorting arrays: Array Sorting Functions. @@ -33955,7 +33954,7 @@ Index * sample debugging session: Sample Debugging Session. (line 6) * sandbox mode: Options. (line 288) -* save debugger options: Debugger Info. (line 84) +* save debugger options: Debugger Info. (line 85) * scalar or array: Type Functions. (line 11) * scalar values: Basic Data Typing. (line 13) * scanning arrays: Scanning an Array. (line 6) @@ -34177,7 +34176,7 @@ Index * strings, converting, numbers to: User-modified. (line 30) * strings, empty, See null strings: awk split records. (line 115) * strings, extracting: String Extraction. (line 6) -* strings, for localization: Programmer i18n. (line 14) +* strings, for localization: Programmer i18n. (line 13) * strings, length limitations: Scalar Constants. (line 20) * strings, merging arrays into: Join Function. (line 6) * strings, null: Regexp Field Splitting. @@ -34237,7 +34236,7 @@ Index (line 6) * text, printing: Print. (line 22) * text, printing, unduplicated lines of: Uniq Program. (line 6) -* TEXTDOMAIN variable <1>: Programmer i18n. (line 9) +* TEXTDOMAIN variable <1>: Programmer i18n. (line 8) * TEXTDOMAIN variable: User-modified. (line 152) * TEXTDOMAIN variable, BEGIN pattern and: Programmer i18n. (line 60) * TEXTDOMAIN variable, portability and: I18N Portability. (line 20) @@ -34265,7 +34264,7 @@ Index * toupper: String Functions. (line 530) * tr utility: Translate Program. (line 6) * trace debugger command: Miscellaneous Debugger Commands. - (line 108) + (line 107) * traceback, display in debugger: Execution Stack. (line 13) * translate string: I18N Functions. (line 22) * translate.awk program: Translate Program. (line 55) @@ -34834,203 +34833,203 @@ Node: Explaining gettext811336 Ref: Explaining gettext-Footnote-1816361 Ref: Explaining gettext-Footnote-2816545 Node: Programmer i18n816710 -Ref: Programmer i18n-Footnote-1821576 -Node: Translator i18n821625 -Node: String Extraction822419 -Ref: String Extraction-Footnote-1823550 -Node: Printf Ordering823636 -Ref: Printf Ordering-Footnote-1826422 -Node: I18N Portability826486 -Ref: I18N Portability-Footnote-1828941 -Node: I18N Example829004 -Ref: I18N Example-Footnote-1831807 -Node: Gawk I18N831879 -Node: I18N Summary832517 -Node: Debugger833856 -Node: Debugging834878 -Node: Debugging Concepts835319 -Node: Debugging Terms837172 -Node: Awk Debugging839744 -Node: Sample Debugging Session840638 -Node: Debugger Invocation841158 -Node: Finding The Bug842542 -Node: List of Debugger Commands849017 -Node: Breakpoint Control850350 -Node: Debugger Execution Control854046 -Node: Viewing And Changing Data857410 -Node: Execution Stack860788 -Node: Debugger Info862425 -Node: Miscellaneous Debugger Commands866442 -Node: Readline Support871471 -Node: Limitations872363 -Node: Debugging Summary874477 -Node: Arbitrary Precision Arithmetic875645 -Node: Computer Arithmetic877061 -Ref: table-numeric-ranges880659 -Ref: Computer Arithmetic-Footnote-1881518 -Node: Math Definitions881575 -Ref: table-ieee-formats884863 -Ref: Math Definitions-Footnote-1885467 -Node: MPFR features885572 -Node: FP Math Caution887243 -Ref: FP Math Caution-Footnote-1888293 -Node: Inexactness of computations888662 -Node: Inexact representation889621 -Node: Comparing FP Values890978 -Node: Errors accumulate892060 -Node: Getting Accuracy893493 -Node: Try To Round896155 -Node: Setting precision897054 -Ref: table-predefined-precision-strings897738 -Node: Setting the rounding mode899527 -Ref: table-gawk-rounding-modes899891 -Ref: Setting the rounding mode-Footnote-1903346 -Node: Arbitrary Precision Integers903525 -Ref: Arbitrary Precision Integers-Footnote-1906511 -Node: POSIX Floating Point Problems906660 -Ref: POSIX Floating Point Problems-Footnote-1910533 -Node: Floating point summary910571 -Node: Dynamic Extensions912765 -Node: Extension Intro914317 -Node: Plugin License915583 -Node: Extension Mechanism Outline916380 -Ref: figure-load-extension916808 -Ref: figure-register-new-function918288 -Ref: figure-call-new-function919292 -Node: Extension API Description921278 -Node: Extension API Functions Introduction922728 -Node: General Data Types927552 -Ref: General Data Types-Footnote-1933291 -Node: Memory Allocation Functions933590 -Ref: Memory Allocation Functions-Footnote-1936429 -Node: Constructor Functions936525 -Node: Registration Functions938259 -Node: Extension Functions938944 -Node: Exit Callback Functions941241 -Node: Extension Version String942489 -Node: Input Parsers943154 -Node: Output Wrappers953033 -Node: Two-way processors957548 -Node: Printing Messages959752 -Ref: Printing Messages-Footnote-1960828 -Node: Updating `ERRNO'960980 -Node: Requesting Values961720 -Ref: table-value-types-returned962448 -Node: Accessing Parameters963405 -Node: Symbol Table Access964636 -Node: Symbol table by name965150 -Node: Symbol table by cookie967131 -Ref: Symbol table by cookie-Footnote-1971275 -Node: Cached values971338 -Ref: Cached values-Footnote-1974837 -Node: Array Manipulation974928 -Ref: Array Manipulation-Footnote-1976026 -Node: Array Data Types976063 -Ref: Array Data Types-Footnote-1978718 -Node: Array Functions978810 -Node: Flattening Arrays982664 -Node: Creating Arrays989556 -Node: Extension API Variables994327 -Node: Extension Versioning994963 -Node: Extension API Informational Variables996864 -Node: Extension API Boilerplate997929 -Node: Finding Extensions1001738 -Node: Extension Example1002298 -Node: Internal File Description1003070 -Node: Internal File Ops1007137 -Ref: Internal File Ops-Footnote-11018807 -Node: Using Internal File Ops1018947 -Ref: Using Internal File Ops-Footnote-11021330 -Node: Extension Samples1021603 -Node: Extension Sample File Functions1023129 -Node: Extension Sample Fnmatch1030767 -Node: Extension Sample Fork1032258 -Node: Extension Sample Inplace1033473 -Node: Extension Sample Ord1035148 -Node: Extension Sample Readdir1035984 -Ref: table-readdir-file-types1036860 -Node: Extension Sample Revout1037671 -Node: Extension Sample Rev2way1038261 -Node: Extension Sample Read write array1039001 -Node: Extension Sample Readfile1040941 -Node: Extension Sample Time1042036 -Node: Extension Sample API Tests1043385 -Node: gawkextlib1043876 -Node: Extension summary1046534 -Node: Extension Exercises1050223 -Node: Language History1050945 -Node: V7/SVR3.11052601 -Node: SVR41054782 -Node: POSIX1056227 -Node: BTL1057616 -Node: POSIX/GNU1058350 -Node: Feature History1063914 -Node: Common Extensions1077012 -Node: Ranges and Locales1078336 -Ref: Ranges and Locales-Footnote-11082954 -Ref: Ranges and Locales-Footnote-21082981 -Ref: Ranges and Locales-Footnote-31083215 -Node: Contributors1083436 -Node: History summary1088977 -Node: Installation1090347 -Node: Gawk Distribution1091293 -Node: Getting1091777 -Node: Extracting1092600 -Node: Distribution contents1094235 -Node: Unix Installation1099952 -Node: Quick Installation1100569 -Node: Additional Configuration Options1102993 -Node: Configuration Philosophy1104731 -Node: Non-Unix Installation1107100 -Node: PC Installation1107558 -Node: PC Binary Installation1108877 -Node: PC Compiling1110725 -Ref: PC Compiling-Footnote-11113746 -Node: PC Testing1113855 -Node: PC Using1115031 -Node: Cygwin1119146 -Node: MSYS1119969 -Node: VMS Installation1120469 -Node: VMS Compilation1121261 -Ref: VMS Compilation-Footnote-11122483 -Node: VMS Dynamic Extensions1122541 -Node: VMS Installation Details1124225 -Node: VMS Running1126477 -Node: VMS GNV1129313 -Node: VMS Old Gawk1130047 -Node: Bugs1130517 -Node: Other Versions1134400 -Node: Installation summary1140824 -Node: Notes1141880 -Node: Compatibility Mode1142745 -Node: Additions1143527 -Node: Accessing The Source1144452 -Node: Adding Code1145887 -Node: New Ports1152044 -Node: Derived Files1156526 -Ref: Derived Files-Footnote-11162001 -Ref: Derived Files-Footnote-21162035 -Ref: Derived Files-Footnote-31162631 -Node: Future Extensions1162745 -Node: Implementation Limitations1163351 -Node: Extension Design1164599 -Node: Old Extension Problems1165753 -Ref: Old Extension Problems-Footnote-11167270 -Node: Extension New Mechanism Goals1167327 -Ref: Extension New Mechanism Goals-Footnote-11170687 -Node: Extension Other Design Decisions1170876 -Node: Extension Future Growth1172984 -Node: Old Extension Mechanism1173820 -Node: Notes summary1175582 -Node: Basic Concepts1176768 -Node: Basic High Level1177449 -Ref: figure-general-flow1177721 -Ref: figure-process-flow1178320 -Ref: Basic High Level-Footnote-11181549 -Node: Basic Data Typing1181734 -Node: Glossary1185062 -Node: Copying1216991 -Node: GNU Free Documentation License1254547 -Node: Index1279683 +Ref: Programmer i18n-Footnote-1821586 +Node: Translator i18n821635 +Node: String Extraction822429 +Ref: String Extraction-Footnote-1823560 +Node: Printf Ordering823646 +Ref: Printf Ordering-Footnote-1826432 +Node: I18N Portability826496 +Ref: I18N Portability-Footnote-1828952 +Node: I18N Example829015 +Ref: I18N Example-Footnote-1831818 +Node: Gawk I18N831890 +Node: I18N Summary832534 +Node: Debugger833874 +Node: Debugging834896 +Node: Debugging Concepts835337 +Node: Debugging Terms837147 +Node: Awk Debugging839719 +Node: Sample Debugging Session840625 +Node: Debugger Invocation841159 +Node: Finding The Bug842544 +Node: List of Debugger Commands849023 +Node: Breakpoint Control850355 +Node: Debugger Execution Control854032 +Node: Viewing And Changing Data857391 +Node: Execution Stack860767 +Node: Debugger Info862402 +Node: Miscellaneous Debugger Commands866447 +Node: Readline Support871448 +Node: Limitations872342 +Node: Debugging Summary874457 +Node: Arbitrary Precision Arithmetic875631 +Node: Computer Arithmetic877047 +Ref: table-numeric-ranges880645 +Ref: Computer Arithmetic-Footnote-1881504 +Node: Math Definitions881561 +Ref: table-ieee-formats884849 +Ref: Math Definitions-Footnote-1885453 +Node: MPFR features885558 +Node: FP Math Caution887229 +Ref: FP Math Caution-Footnote-1888279 +Node: Inexactness of computations888648 +Node: Inexact representation889607 +Node: Comparing FP Values890964 +Node: Errors accumulate892046 +Node: Getting Accuracy893479 +Node: Try To Round896141 +Node: Setting precision897040 +Ref: table-predefined-precision-strings897724 +Node: Setting the rounding mode899513 +Ref: table-gawk-rounding-modes899877 +Ref: Setting the rounding mode-Footnote-1903332 +Node: Arbitrary Precision Integers903511 +Ref: Arbitrary Precision Integers-Footnote-1906497 +Node: POSIX Floating Point Problems906646 +Ref: POSIX Floating Point Problems-Footnote-1910519 +Node: Floating point summary910557 +Node: Dynamic Extensions912751 +Node: Extension Intro914303 +Node: Plugin License915569 +Node: Extension Mechanism Outline916366 +Ref: figure-load-extension916794 +Ref: figure-register-new-function918274 +Ref: figure-call-new-function919278 +Node: Extension API Description921264 +Node: Extension API Functions Introduction922714 +Node: General Data Types927538 +Ref: General Data Types-Footnote-1933277 +Node: Memory Allocation Functions933576 +Ref: Memory Allocation Functions-Footnote-1936415 +Node: Constructor Functions936511 +Node: Registration Functions938245 +Node: Extension Functions938930 +Node: Exit Callback Functions941227 +Node: Extension Version String942475 +Node: Input Parsers943140 +Node: Output Wrappers953019 +Node: Two-way processors957534 +Node: Printing Messages959738 +Ref: Printing Messages-Footnote-1960814 +Node: Updating `ERRNO'960966 +Node: Requesting Values961706 +Ref: table-value-types-returned962434 +Node: Accessing Parameters963391 +Node: Symbol Table Access964622 +Node: Symbol table by name965136 +Node: Symbol table by cookie967117 +Ref: Symbol table by cookie-Footnote-1971261 +Node: Cached values971324 +Ref: Cached values-Footnote-1974823 +Node: Array Manipulation974914 +Ref: Array Manipulation-Footnote-1976012 +Node: Array Data Types976049 +Ref: Array Data Types-Footnote-1978704 +Node: Array Functions978796 +Node: Flattening Arrays982650 +Node: Creating Arrays989542 +Node: Extension API Variables994313 +Node: Extension Versioning994949 +Node: Extension API Informational Variables996850 +Node: Extension API Boilerplate997915 +Node: Finding Extensions1001724 +Node: Extension Example1002284 +Node: Internal File Description1003056 +Node: Internal File Ops1007123 +Ref: Internal File Ops-Footnote-11018793 +Node: Using Internal File Ops1018933 +Ref: Using Internal File Ops-Footnote-11021316 +Node: Extension Samples1021589 +Node: Extension Sample File Functions1023115 +Node: Extension Sample Fnmatch1030753 +Node: Extension Sample Fork1032244 +Node: Extension Sample Inplace1033459 +Node: Extension Sample Ord1035134 +Node: Extension Sample Readdir1035970 +Ref: table-readdir-file-types1036846 +Node: Extension Sample Revout1037657 +Node: Extension Sample Rev2way1038247 +Node: Extension Sample Read write array1038987 +Node: Extension Sample Readfile1040927 +Node: Extension Sample Time1042022 +Node: Extension Sample API Tests1043371 +Node: gawkextlib1043862 +Node: Extension summary1046520 +Node: Extension Exercises1050209 +Node: Language History1050931 +Node: V7/SVR3.11052587 +Node: SVR41054768 +Node: POSIX1056213 +Node: BTL1057602 +Node: POSIX/GNU1058336 +Node: Feature History1063900 +Node: Common Extensions1076998 +Node: Ranges and Locales1078322 +Ref: Ranges and Locales-Footnote-11082940 +Ref: Ranges and Locales-Footnote-21082967 +Ref: Ranges and Locales-Footnote-31083201 +Node: Contributors1083422 +Node: History summary1088963 +Node: Installation1090333 +Node: Gawk Distribution1091279 +Node: Getting1091763 +Node: Extracting1092586 +Node: Distribution contents1094221 +Node: Unix Installation1099938 +Node: Quick Installation1100555 +Node: Additional Configuration Options1102979 +Node: Configuration Philosophy1104717 +Node: Non-Unix Installation1107086 +Node: PC Installation1107544 +Node: PC Binary Installation1108863 +Node: PC Compiling1110711 +Ref: PC Compiling-Footnote-11113732 +Node: PC Testing1113841 +Node: PC Using1115017 +Node: Cygwin1119132 +Node: MSYS1119955 +Node: VMS Installation1120455 +Node: VMS Compilation1121247 +Ref: VMS Compilation-Footnote-11122469 +Node: VMS Dynamic Extensions1122527 +Node: VMS Installation Details1124211 +Node: VMS Running1126463 +Node: VMS GNV1129299 +Node: VMS Old Gawk1130033 +Node: Bugs1130503 +Node: Other Versions1134386 +Node: Installation summary1140810 +Node: Notes1141866 +Node: Compatibility Mode1142731 +Node: Additions1143513 +Node: Accessing The Source1144438 +Node: Adding Code1145873 +Node: New Ports1152030 +Node: Derived Files1156512 +Ref: Derived Files-Footnote-11161987 +Ref: Derived Files-Footnote-21162021 +Ref: Derived Files-Footnote-31162617 +Node: Future Extensions1162731 +Node: Implementation Limitations1163337 +Node: Extension Design1164585 +Node: Old Extension Problems1165739 +Ref: Old Extension Problems-Footnote-11167256 +Node: Extension New Mechanism Goals1167313 +Ref: Extension New Mechanism Goals-Footnote-11170673 +Node: Extension Other Design Decisions1170862 +Node: Extension Future Growth1172970 +Node: Old Extension Mechanism1173806 +Node: Notes summary1175568 +Node: Basic Concepts1176754 +Node: Basic High Level1177435 +Ref: figure-general-flow1177707 +Ref: figure-process-flow1178306 +Ref: Basic High Level-Footnote-11181535 +Node: Basic Data Typing1181720 +Node: Glossary1185048 +Node: Copying1216977 +Node: GNU Free Documentation License1254533 +Node: Index1279669  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 59f11cae..ed7f4610 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -27922,7 +27922,7 @@ a requirement. @cindex localization @dfn{Internationalization} means writing (or modifying) a program once, in such a way that it can use multiple languages without requiring -further source-code changes. +further source code changes. @dfn{Localization} means providing the data necessary for an internationalized program to work in a particular language. Most typically, these terms refer to features such as the language @@ -27937,7 +27937,7 @@ monetary values are printed and read. @cindex @command{gettext} library @command{gawk} uses GNU @command{gettext} to provide its internationalization features. -The facilities in GNU @command{gettext} focus on messages; strings printed +The facilities in GNU @command{gettext} focus on messages: strings printed by a program, either directly or via formatting with @code{printf} or @code{sprintf()}.@footnote{For some operating systems, the @command{gawk} port doesn't support GNU @command{gettext}. @@ -28128,7 +28128,7 @@ All of the above. (Not too useful in the context of @command{gettext}.) @section Internationalizing @command{awk} Programs @cindex @command{awk} programs, internationalizing -@command{gawk} provides the following variables and functions for +@command{gawk} provides the following variables for internationalization: @table @code @@ -28144,7 +28144,12 @@ value is @code{"messages"}. String constants marked with a leading underscore are candidates for translation at runtime. String constants without a leading underscore are not translated. +@end table +@command{gawk} provides the following functions for +internationalization: + +@table @code @cindexgawkfunc{dcgettext} @item @code{dcgettext(@var{string}} [@code{,} @var{domain} [@code{,} @var{category}]]@code{)} Return the translation of @var{string} in @@ -28201,15 +28206,7 @@ If @var{directory} is the null string (@code{""}), then given @var{domain}. @end table -To use these facilities in your @command{awk} program, follow the steps -outlined in -@ifnotinfo -the previous @value{SECTION}, -@end ifnotinfo -@ifinfo -@ref{Explaining gettext}, -@end ifinfo -like so: +To use these facilities in your @command{awk} program, follow these steps: @enumerate @cindex @code{BEGIN} pattern, @code{TEXTDOMAIN} variable and @@ -28492,7 +28489,7 @@ the null string (@code{""}) as its value, leaving the original string constant a the result. @item -By defining ``dummy'' functions to replace @code{dcgettext()}, @code{dcngettext()} +By defining ``dummy'' functions to replace @code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()}, the @command{awk} program can be made to run, but all the messages are output in the original language. For example: @@ -28676,11 +28673,11 @@ using the GNU @command{gettext} package. (GNU @command{gettext} is described in complete detail in @ifinfo -@inforef{Top, , GNU @command{gettext} utilities, gettext, GNU gettext tools}.) +@inforef{Top, , GNU @command{gettext} utilities, gettext, GNU @command{gettext} utilities}.) @end ifinfo @ifnotinfo @uref{http://www.gnu.org/software/gettext/manual/, -@cite{GNU gettext tools}}.) +@cite{GNU @command{gettext} utilities}}.) @end ifnotinfo As of this writing, the latest version of GNU @command{gettext} is @uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.4.tar.gz, @@ -28696,7 +28693,7 @@ and fatal errors in the local language. @itemize @value{BULLET} @item Internationalization means writing a program such that it can use multiple -languages without requiring source-code changes. Localization means +languages without requiring source code changes. Localization means providing the data necessary for an internationalized program to work in a particular language. @@ -28713,9 +28710,9 @@ file, and the @file{.po} files are compiled into @file{.gmo} files for use at runtime. @item -You can use position specifications with @code{sprintf()} and +You can use positional specifications with @code{sprintf()} and @code{printf} to rearrange the placement of argument values in formatted -strings and output. This is useful for the translations of format +strings and output. This is useful for the translation of format control strings. @item @@ -28771,8 +28768,7 @@ the discussion of debugging in @command{gawk}. @subsection Debugging in General (If you have used debuggers in other languages, you may want to skip -ahead to the next section on the specific features of the @command{gawk} -debugger.) +ahead to @ref{Awk Debugging}.) Of course, a debugging program cannot remove bugs for you, because it has no way of knowing what you or your users consider a ``bug'' versus a @@ -28863,10 +28859,10 @@ and usually find the errant code quite quickly. @end table @node Awk Debugging -@subsection Awk Debugging +@subsection @command{awk} Debugging Debugging an @command{awk} program has some specific aspects that are -not shared with other programming languages. +not shared with programs written in other languages. First of all, the fact that @command{awk} programs usually take input line by line from a file or files and operate on those lines using specific @@ -28882,7 +28878,7 @@ to look at the individual primitive instructions carried out by the higher-level @command{awk} commands. @node Sample Debugging Session -@section Sample Debugging Session +@section Sample @command{gawk} Debugging Session @cindex sample debugging session In order to illustrate the use of @command{gawk} as a debugger, let's look at a sample @@ -28901,8 +28897,8 @@ as our example. @cindex debugger, how to start Starting the debugger is almost exactly like running @command{gawk} normally, -except you have to pass an additional option @option{--debug}, or the -corresponding short option @option{-D}. The file(s) containing the +except you have to pass an additional option, @option{--debug}, or the +corresponding short option, @option{-D}. The file(s) containing the program and any supporting code are given on the command line as arguments to one or more @option{-f} options. (@command{gawk} is not designed to debug command-line programs, only programs contained in files.) @@ -28915,7 +28911,7 @@ $ @kbd{gawk -D -f getopt.awk -f join.awk -f uniq.awk -1 inputfile} @noindent where both @file{getopt.awk} and @file{uniq.awk} are in @env{$AWKPATH}. (Experienced users of GDB or similar debuggers should note that -this syntax is slightly different from what they are used to. +this syntax is slightly different from what you are used to. With the @command{gawk} debugger, you give the arguments for running the program in the command line to the debugger rather than as part of the @code{run} command at the debugger prompt.) @@ -29069,10 +29065,10 @@ gawk> @kbd{n} @end example This tells us that @command{gawk} is now ready to execute line 66, which -decides whether to give the lines the special ``field skipping'' treatment +decides whether to give the lines the special ``field-skipping'' treatment indicated by the @option{-1} command-line option. (Notice that we skipped -from where we were before at line 63 to here, because the condition in line 63 -@samp{if (fcount == 0 && charcount == 0)} was false.) +from where we were before, at line 63, to here, because the condition +in line 63, @samp{if (fcount == 0 && charcount == 0)}, was false.) Continuing to step, we now get to the splitting of the current and last records: @@ -29146,7 +29142,7 @@ gawk> @kbd{n} Well, here we are at our error (sorry to spoil the suspense). What we had in mind was to join the fields starting from the second one to make -the virtual record to compare, and if the first field was numbered zero, +the virtual record to compare, and if the first field were numbered zero, this would work. Let's look at what we've got: @example @@ -29155,7 +29151,7 @@ gawk> @kbd{p cline clast} @print{} clast = "awk is a wonderful program!" @end example -Hey, those look pretty familiar! They're just our original, unaltered, +Hey, those look pretty familiar! They're just our original, unaltered input records. A little thinking (the human brain is still the best debugging tool), and we realize that we were off by one! @@ -29205,11 +29201,11 @@ Miscellaneous @end itemize Each of these are discussed in the following subsections. -In the following descriptions, commands which may be abbreviated +In the following descriptions, commands that may be abbreviated show the abbreviation on a second description line. A debugger command name may also be truncated if that partial name is unambiguous. The debugger has the built-in capability to -automatically repeat the previous command just by hitting @key{Enter}. +automatically repeat the previous command just by hitting @kbd{Enter}. This works for the commands @code{list}, @code{next}, @code{nexti}, @code{step}, @code{stepi}, and @code{continue} executed without any argument. @@ -29259,7 +29255,7 @@ Set a breakpoint at entry to (the first instruction of) function @var{function}. @end table -Each breakpoint is assigned a number which can be used to delete it from +Each breakpoint is assigned a number that can be used to delete it from the breakpoint list using the @code{delete} command. With a breakpoint, you may also supply a condition. This is an @@ -29311,7 +29307,7 @@ watchpoint is made unconditional). @cindex breakpoint, delete by number @item @code{delete} [@var{n1 n2} @dots{}] [@var{n}--@var{m}] @itemx @code{d} [@var{n1 n2} @dots{}] [@var{n}--@var{m}] -Delete specified breakpoints or a range of breakpoints. Deletes +Delete specified breakpoints or a range of breakpoints. Delete all defined breakpoints if no argument is supplied. @cindex debugger commands, @code{disable} @@ -29320,7 +29316,7 @@ all defined breakpoints if no argument is supplied. @cindex breakpoint, how to disable or enable @item @code{disable} [@var{n1 n2} @dots{} | @var{n}--@var{m}] Disable specified breakpoints or a range of breakpoints. Without -any argument, disables all breakpoints. +any argument, disable all breakpoints. @cindex debugger commands, @code{e} (@code{enable}) @cindex debugger commands, @code{enable} @@ -29330,18 +29326,18 @@ any argument, disables all breakpoints. @item @code{enable} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] @itemx @code{e} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] Enable specified breakpoints or a range of breakpoints. Without -any argument, enables all breakpoints. -Optionally, you can specify how to enable the breakpoint: +any argument, enable all breakpoints. +Optionally, you can specify how to enable the breakpoints: @c nested table @table @code @item del -Enable the breakpoint(s) temporarily, then delete it when -the program stops at the breakpoint. +Enable the breakpoints temporarily, then delete each one when +the program stops at it. @item once -Enable the breakpoint(s) temporarily, then disable it when -the program stops at the breakpoint. +Enable the breakpoints temporarily, then disable each one when +the program stops at it. @end table @cindex debugger commands, @code{ignore} @@ -29409,7 +29405,7 @@ gawk> @item @code{continue} [@var{count}] @itemx @code{c} [@var{count}] Resume program execution. If continued from a breakpoint and @var{count} is -specified, ignores the breakpoint at that location the next @var{count} times +specified, ignore the breakpoint at that location the next @var{count} times before stopping. @cindex debugger commands, @code{finish} @@ -29463,7 +29459,7 @@ automatic display variables, and debugger options. @item @code{step} [@var{count}] @itemx @code{s} [@var{count}] Continue execution until control reaches a different source line in the -current stack frame. @code{step} steps inside any function called within +current stack frame, stepping inside any function called within the line. If the argument @var{count} is supplied, steps that many times before stopping, unless it encounters a breakpoint or watchpoint. @@ -29576,7 +29572,7 @@ or field. String values must be enclosed between double quotes (@code{"}@dots{}@code{"}). You can also set special @command{awk} variables, such as @code{FS}, -@code{NF}, @code{NR}, and son on. +@code{NF}, @code{NR}, and so on. @cindex debugger commands, @code{w} (@code{watch}) @cindex debugger commands, @code{watch} @@ -29588,7 +29584,7 @@ You can also set special @command{awk} variables, such as @code{FS}, Add variable @var{var} (or field @code{$@var{n}}) to the watch list. The debugger then stops whenever the value of the variable or field changes. Each watched item is assigned a -number which can be used to delete it from the watch list using the +number that can be used to delete it from the watch list using the @code{unwatch} command. With a watchpoint, you may also supply a condition. This is an @@ -29616,11 +29612,11 @@ watch list. @node Execution Stack @subsection Working with the Stack -Whenever you run a program which contains any function calls, +Whenever you run a program that contains any function calls, @command{gawk} maintains a stack of all of the function calls leading up to where the program is right now. You can see how you got to where you are, and also move around in the stack to see what the state of things was in the -functions which called the one you are in. The commands for doing this are: +functions that called the one you are in. The commands for doing this are: @table @asis @cindex debugger commands, @code{bt} (@code{backtrace}) @@ -29655,8 +29651,8 @@ Then select and print the frame. @item @code{frame} [@var{n}] @itemx @code{f} [@var{n}] Select and print stack frame @var{n}. Frame 0 is the currently executing, -or @dfn{innermost}, frame (function call), frame 1 is the frame that -called the innermost one. The highest numbered frame is the one for the +or @dfn{innermost}, frame (function call); frame 1 is the frame that +called the innermost one. The highest-numbered frame is the one for the main program. The printed information consists of the frame number, function and argument names, source file, and the source line. @@ -29672,7 +29668,7 @@ Then select and print the frame. Besides looking at the values of variables, there is often a need to get other sorts of information about the state of your program and of the -debugging environment itself. The @command{gawk} debugger has one command which +debugging environment itself. The @command{gawk} debugger has one command that provides this information, appropriately called @code{info}. @code{info} is used with one of a number of arguments that tell it exactly what you want to know: @@ -29760,12 +29756,12 @@ The available options are: @table @asis @item @code{history_size} @cindex debugger history size -The maximum number of lines to keep in the history file @file{./.gawk_history}. -The default is 100. +Set the maximum number of lines to keep in the history file +@file{./.gawk_history}. The default is 100. @item @code{listsize} @cindex debugger default list amount -The number of lines that @code{list} prints. The default is 15. +Specify the number of lines that @code{list} prints. The default is 15. @item @code{outfile} @cindex redirect @command{gawk} output, in debugger @@ -29775,7 +29771,7 @@ standard output. @item @code{prompt} @cindex debugger prompt -The debugger prompt. The default is @samp{@w{gawk> }}. +Change the debugger prompt. The default is @samp{@w{gawk> }}. @item @code{save_history} [@code{on} | @code{off}] @cindex debugger history file @@ -29786,7 +29782,7 @@ The default is @code{on}. @cindex save debugger options Save current options to file @file{./.gawkrc} upon exit. The default is @code{on}. -Options are read back in to the next session upon startup. +Options are read back into the next session upon startup. @item @code{trace} [@code{on} | @code{off}] @cindex instruction tracing, in debugger @@ -29809,7 +29805,7 @@ command in the file. Also, the list of commands may include additional @code{source} commands; however, the @command{gawk} debugger will not source the same file more than once in order to avoid infinite recursion. -In addition to, or instead of the @code{source} command, you can use +In addition to, or instead of, the @code{source} command, you can use the @option{-D @var{file}} or @option{--debug=@var{file}} command-line options to execute commands from a file non-interactively (@pxref{Options}). @@ -29818,16 +29814,16 @@ options to execute commands from a file non-interactively @node Miscellaneous Debugger Commands @subsection Miscellaneous Commands -There are a few more commands which do not fit into the +There are a few more commands that do not fit into the previous categories, as follows: @table @asis @cindex debugger commands, @code{dump} @cindex @code{dump} debugger command @item @code{dump} [@var{filename}] -Dump bytecode of the program to standard output or to the file +Dump byte code of the program to standard output or to the file named in @var{filename}. This prints a representation of the internal -instructions which @command{gawk} executes to implement the @command{awk} +instructions that @command{gawk} executes to implement the @command{awk} commands in a program. This can be very enlightening, as the following partial dump of Davide Brini's obfuscated code (@pxref{Signature Program}) demonstrates: @@ -29924,7 +29920,7 @@ Print lines centered around line number @var{n} in source file @var{filename}. This command may change the current source file. @item @var{function} -Print lines centered around beginning of the +Print lines centered around the beginning of the function @var{function}. This command may change the current source file. @end table @@ -29936,16 +29932,16 @@ function @var{function}. This command may change the current source file. @item @code{quit} @itemx @code{q} Exit the debugger. Debugging is great fun, but sometimes we all have -to tend to other obligations in life, and sometimes we find the bug, +to tend to other obligations in life, and sometimes we find the bug and are free to go on to the next one! As we saw earlier, if you are -running a program, the debugger warns you if you accidentally type +running a program, the debugger warns you when you type @samp{q} or @samp{quit}, to make sure you really want to quit. @cindex debugger commands, @code{trace} @cindex @code{trace} debugger command @item @code{trace} [@code{on} | @code{off}] -Turn on or off a continuous printing of instructions which are about to -be executed, along with printing the @command{awk} line which they +Turn on or off continuous printing of the instructions that are about to +be executed, along with the @command{awk} lines they implement. The default is @code{off}. It is to be hoped that most of the ``opcodes'' in these instructions are @@ -29961,7 +29957,7 @@ fairly self-explanatory, and using @code{stepi} and @code{nexti} while If @command{gawk} is compiled with @uref{http://cnswww.cns.cwru.edu/php/chet/readline/readline.html, -the @code{readline} library}, you can take advantage of that library's +the GNU Readline library}, you can take advantage of that library's command completion and history expansion features. The following types of completion are available: @@ -29998,7 +29994,7 @@ and We hope you find the @command{gawk} debugger useful and enjoyable to work with, but as with any program, especially in its early releases, it still has -some limitations. A few which are worth being aware of are: +some limitations. A few that it's worth being aware of are: @itemize @value{BULLET} @item @@ -30014,13 +30010,13 @@ If you perused the dump of opcodes in @ref{Miscellaneous Debugger Commands} (or if you are already familiar with @command{gawk} internals), you will realize that much of the internal manipulation of data in @command{gawk}, as in many interpreters, is done on a stack. -@code{Op_push}, @code{Op_pop}, and the like, are the ``bread and butter'' of +@code{Op_push}, @code{Op_pop}, and the like are the ``bread and butter'' of most @command{gawk} code. Unfortunately, as of now, the @command{gawk} debugger does not allow you to examine the stack's contents. That is, the intermediate results of expression evaluation are on the -stack, but cannot be printed. Rather, only variables which are defined +stack, but cannot be printed. Rather, only variables that are defined in the program can be printed. Of course, a workaround for this is to use more explicit variables at the debugging stage and then change back to obscure, perhaps more optimal code later. @@ -30034,12 +30030,12 @@ programmer, you are expected to know the meaning of @item The @command{gawk} debugger is designed to be used by running a program (with all its parameters) on the command line, as described in @ref{Debugger Invocation}. -There is no way (as of now) to attach or ``break in'' to a running program. -This seems reasonable for a language which is used mainly for quickly +There is no way (as of now) to attach or ``break into'' a running program. +This seems reasonable for a language that is used mainly for quickly executing, short programs. @item -The @command{gawk} debugger only accepts source supplied with the @option{-f} option. +The @command{gawk} debugger only accepts source code supplied with the @option{-f} option. @end itemize @ignore @@ -30053,8 +30049,8 @@ be added, and of course feel free to try to add them yourself! @itemize @value{BULLET} @item Programs rarely work correctly the first time. Finding bugs -is @dfn{debugging} and a program that helps you find bugs is a -@dfn{debugger}. @command{gawk} has a built-in debugger that works very +is called debugging, and a program that helps you find bugs is a +debugger. @command{gawk} has a built-in debugger that works very similarly to the GNU Debugger, GDB. @item @@ -30074,7 +30070,7 @@ breakpoints, execution, viewing and changing data, working with the stack, getting information, and other tasks. @item -If the @code{readline} library is available when @command{gawk} is +If the GNU Readline library is available when @command{gawk} is compiled, it is used by the debugger to provide command-line history and editing. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index e02318bd..1156ffd5 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -27013,7 +27013,7 @@ a requirement. @cindex localization @dfn{Internationalization} means writing (or modifying) a program once, in such a way that it can use multiple languages without requiring -further source-code changes. +further source code changes. @dfn{Localization} means providing the data necessary for an internationalized program to work in a particular language. Most typically, these terms refer to features such as the language @@ -27028,7 +27028,7 @@ monetary values are printed and read. @cindex @command{gettext} library @command{gawk} uses GNU @command{gettext} to provide its internationalization features. -The facilities in GNU @command{gettext} focus on messages; strings printed +The facilities in GNU @command{gettext} focus on messages: strings printed by a program, either directly or via formatting with @code{printf} or @code{sprintf()}.@footnote{For some operating systems, the @command{gawk} port doesn't support GNU @command{gettext}. @@ -27219,7 +27219,7 @@ All of the above. (Not too useful in the context of @command{gettext}.) @section Internationalizing @command{awk} Programs @cindex @command{awk} programs, internationalizing -@command{gawk} provides the following variables and functions for +@command{gawk} provides the following variables for internationalization: @table @code @@ -27235,7 +27235,12 @@ value is @code{"messages"}. String constants marked with a leading underscore are candidates for translation at runtime. String constants without a leading underscore are not translated. +@end table +@command{gawk} provides the following functions for +internationalization: + +@table @code @cindexgawkfunc{dcgettext} @item @code{dcgettext(@var{string}} [@code{,} @var{domain} [@code{,} @var{category}]]@code{)} Return the translation of @var{string} in @@ -27292,15 +27297,7 @@ If @var{directory} is the null string (@code{""}), then given @var{domain}. @end table -To use these facilities in your @command{awk} program, follow the steps -outlined in -@ifnotinfo -the previous @value{SECTION}, -@end ifnotinfo -@ifinfo -@ref{Explaining gettext}, -@end ifinfo -like so: +To use these facilities in your @command{awk} program, follow these steps: @enumerate @cindex @code{BEGIN} pattern, @code{TEXTDOMAIN} variable and @@ -27583,7 +27580,7 @@ the null string (@code{""}) as its value, leaving the original string constant a the result. @item -By defining ``dummy'' functions to replace @code{dcgettext()}, @code{dcngettext()} +By defining ``dummy'' functions to replace @code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()}, the @command{awk} program can be made to run, but all the messages are output in the original language. For example: @@ -27767,11 +27764,11 @@ using the GNU @command{gettext} package. (GNU @command{gettext} is described in complete detail in @ifinfo -@inforef{Top, , GNU @command{gettext} utilities, gettext, GNU gettext tools}.) +@inforef{Top, , GNU @command{gettext} utilities, gettext, GNU @command{gettext} utilities}.) @end ifinfo @ifnotinfo @uref{http://www.gnu.org/software/gettext/manual/, -@cite{GNU gettext tools}}.) +@cite{GNU @command{gettext} utilities}}.) @end ifnotinfo As of this writing, the latest version of GNU @command{gettext} is @uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.4.tar.gz, @@ -27787,7 +27784,7 @@ and fatal errors in the local language. @itemize @value{BULLET} @item Internationalization means writing a program such that it can use multiple -languages without requiring source-code changes. Localization means +languages without requiring source code changes. Localization means providing the data necessary for an internationalized program to work in a particular language. @@ -27804,9 +27801,9 @@ file, and the @file{.po} files are compiled into @file{.gmo} files for use at runtime. @item -You can use position specifications with @code{sprintf()} and +You can use positional specifications with @code{sprintf()} and @code{printf} to rearrange the placement of argument values in formatted -strings and output. This is useful for the translations of format +strings and output. This is useful for the translation of format control strings. @item @@ -27862,8 +27859,7 @@ the discussion of debugging in @command{gawk}. @subsection Debugging in General (If you have used debuggers in other languages, you may want to skip -ahead to the next section on the specific features of the @command{gawk} -debugger.) +ahead to @ref{Awk Debugging}.) Of course, a debugging program cannot remove bugs for you, because it has no way of knowing what you or your users consider a ``bug'' versus a @@ -27954,10 +27950,10 @@ and usually find the errant code quite quickly. @end table @node Awk Debugging -@subsection Awk Debugging +@subsection @command{awk} Debugging Debugging an @command{awk} program has some specific aspects that are -not shared with other programming languages. +not shared with programs written in other languages. First of all, the fact that @command{awk} programs usually take input line by line from a file or files and operate on those lines using specific @@ -27973,7 +27969,7 @@ to look at the individual primitive instructions carried out by the higher-level @command{awk} commands. @node Sample Debugging Session -@section Sample Debugging Session +@section Sample @command{gawk} Debugging Session @cindex sample debugging session In order to illustrate the use of @command{gawk} as a debugger, let's look at a sample @@ -27992,8 +27988,8 @@ as our example. @cindex debugger, how to start Starting the debugger is almost exactly like running @command{gawk} normally, -except you have to pass an additional option @option{--debug}, or the -corresponding short option @option{-D}. The file(s) containing the +except you have to pass an additional option, @option{--debug}, or the +corresponding short option, @option{-D}. The file(s) containing the program and any supporting code are given on the command line as arguments to one or more @option{-f} options. (@command{gawk} is not designed to debug command-line programs, only programs contained in files.) @@ -28006,7 +28002,7 @@ $ @kbd{gawk -D -f getopt.awk -f join.awk -f uniq.awk -1 inputfile} @noindent where both @file{getopt.awk} and @file{uniq.awk} are in @env{$AWKPATH}. (Experienced users of GDB or similar debuggers should note that -this syntax is slightly different from what they are used to. +this syntax is slightly different from what you are used to. With the @command{gawk} debugger, you give the arguments for running the program in the command line to the debugger rather than as part of the @code{run} command at the debugger prompt.) @@ -28160,10 +28156,10 @@ gawk> @kbd{n} @end example This tells us that @command{gawk} is now ready to execute line 66, which -decides whether to give the lines the special ``field skipping'' treatment +decides whether to give the lines the special ``field-skipping'' treatment indicated by the @option{-1} command-line option. (Notice that we skipped -from where we were before at line 63 to here, because the condition in line 63 -@samp{if (fcount == 0 && charcount == 0)} was false.) +from where we were before, at line 63, to here, because the condition +in line 63, @samp{if (fcount == 0 && charcount == 0)}, was false.) Continuing to step, we now get to the splitting of the current and last records: @@ -28237,7 +28233,7 @@ gawk> @kbd{n} Well, here we are at our error (sorry to spoil the suspense). What we had in mind was to join the fields starting from the second one to make -the virtual record to compare, and if the first field was numbered zero, +the virtual record to compare, and if the first field were numbered zero, this would work. Let's look at what we've got: @example @@ -28246,7 +28242,7 @@ gawk> @kbd{p cline clast} @print{} clast = "awk is a wonderful program!" @end example -Hey, those look pretty familiar! They're just our original, unaltered, +Hey, those look pretty familiar! They're just our original, unaltered input records. A little thinking (the human brain is still the best debugging tool), and we realize that we were off by one! @@ -28296,11 +28292,11 @@ Miscellaneous @end itemize Each of these are discussed in the following subsections. -In the following descriptions, commands which may be abbreviated +In the following descriptions, commands that may be abbreviated show the abbreviation on a second description line. A debugger command name may also be truncated if that partial name is unambiguous. The debugger has the built-in capability to -automatically repeat the previous command just by hitting @key{Enter}. +automatically repeat the previous command just by hitting @kbd{Enter}. This works for the commands @code{list}, @code{next}, @code{nexti}, @code{step}, @code{stepi}, and @code{continue} executed without any argument. @@ -28350,7 +28346,7 @@ Set a breakpoint at entry to (the first instruction of) function @var{function}. @end table -Each breakpoint is assigned a number which can be used to delete it from +Each breakpoint is assigned a number that can be used to delete it from the breakpoint list using the @code{delete} command. With a breakpoint, you may also supply a condition. This is an @@ -28402,7 +28398,7 @@ watchpoint is made unconditional). @cindex breakpoint, delete by number @item @code{delete} [@var{n1 n2} @dots{}] [@var{n}--@var{m}] @itemx @code{d} [@var{n1 n2} @dots{}] [@var{n}--@var{m}] -Delete specified breakpoints or a range of breakpoints. Deletes +Delete specified breakpoints or a range of breakpoints. Delete all defined breakpoints if no argument is supplied. @cindex debugger commands, @code{disable} @@ -28411,7 +28407,7 @@ all defined breakpoints if no argument is supplied. @cindex breakpoint, how to disable or enable @item @code{disable} [@var{n1 n2} @dots{} | @var{n}--@var{m}] Disable specified breakpoints or a range of breakpoints. Without -any argument, disables all breakpoints. +any argument, disable all breakpoints. @cindex debugger commands, @code{e} (@code{enable}) @cindex debugger commands, @code{enable} @@ -28421,18 +28417,18 @@ any argument, disables all breakpoints. @item @code{enable} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] @itemx @code{e} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] Enable specified breakpoints or a range of breakpoints. Without -any argument, enables all breakpoints. -Optionally, you can specify how to enable the breakpoint: +any argument, enable all breakpoints. +Optionally, you can specify how to enable the breakpoints: @c nested table @table @code @item del -Enable the breakpoint(s) temporarily, then delete it when -the program stops at the breakpoint. +Enable the breakpoints temporarily, then delete each one when +the program stops at it. @item once -Enable the breakpoint(s) temporarily, then disable it when -the program stops at the breakpoint. +Enable the breakpoints temporarily, then disable each one when +the program stops at it. @end table @cindex debugger commands, @code{ignore} @@ -28500,7 +28496,7 @@ gawk> @item @code{continue} [@var{count}] @itemx @code{c} [@var{count}] Resume program execution. If continued from a breakpoint and @var{count} is -specified, ignores the breakpoint at that location the next @var{count} times +specified, ignore the breakpoint at that location the next @var{count} times before stopping. @cindex debugger commands, @code{finish} @@ -28554,7 +28550,7 @@ automatic display variables, and debugger options. @item @code{step} [@var{count}] @itemx @code{s} [@var{count}] Continue execution until control reaches a different source line in the -current stack frame. @code{step} steps inside any function called within +current stack frame, stepping inside any function called within the line. If the argument @var{count} is supplied, steps that many times before stopping, unless it encounters a breakpoint or watchpoint. @@ -28667,7 +28663,7 @@ or field. String values must be enclosed between double quotes (@code{"}@dots{}@code{"}). You can also set special @command{awk} variables, such as @code{FS}, -@code{NF}, @code{NR}, and son on. +@code{NF}, @code{NR}, and so on. @cindex debugger commands, @code{w} (@code{watch}) @cindex debugger commands, @code{watch} @@ -28679,7 +28675,7 @@ You can also set special @command{awk} variables, such as @code{FS}, Add variable @var{var} (or field @code{$@var{n}}) to the watch list. The debugger then stops whenever the value of the variable or field changes. Each watched item is assigned a -number which can be used to delete it from the watch list using the +number that can be used to delete it from the watch list using the @code{unwatch} command. With a watchpoint, you may also supply a condition. This is an @@ -28707,11 +28703,11 @@ watch list. @node Execution Stack @subsection Working with the Stack -Whenever you run a program which contains any function calls, +Whenever you run a program that contains any function calls, @command{gawk} maintains a stack of all of the function calls leading up to where the program is right now. You can see how you got to where you are, and also move around in the stack to see what the state of things was in the -functions which called the one you are in. The commands for doing this are: +functions that called the one you are in. The commands for doing this are: @table @asis @cindex debugger commands, @code{bt} (@code{backtrace}) @@ -28746,8 +28742,8 @@ Then select and print the frame. @item @code{frame} [@var{n}] @itemx @code{f} [@var{n}] Select and print stack frame @var{n}. Frame 0 is the currently executing, -or @dfn{innermost}, frame (function call), frame 1 is the frame that -called the innermost one. The highest numbered frame is the one for the +or @dfn{innermost}, frame (function call); frame 1 is the frame that +called the innermost one. The highest-numbered frame is the one for the main program. The printed information consists of the frame number, function and argument names, source file, and the source line. @@ -28763,7 +28759,7 @@ Then select and print the frame. Besides looking at the values of variables, there is often a need to get other sorts of information about the state of your program and of the -debugging environment itself. The @command{gawk} debugger has one command which +debugging environment itself. The @command{gawk} debugger has one command that provides this information, appropriately called @code{info}. @code{info} is used with one of a number of arguments that tell it exactly what you want to know: @@ -28851,12 +28847,12 @@ The available options are: @table @asis @item @code{history_size} @cindex debugger history size -The maximum number of lines to keep in the history file @file{./.gawk_history}. -The default is 100. +Set the maximum number of lines to keep in the history file +@file{./.gawk_history}. The default is 100. @item @code{listsize} @cindex debugger default list amount -The number of lines that @code{list} prints. The default is 15. +Specify the number of lines that @code{list} prints. The default is 15. @item @code{outfile} @cindex redirect @command{gawk} output, in debugger @@ -28866,7 +28862,7 @@ standard output. @item @code{prompt} @cindex debugger prompt -The debugger prompt. The default is @samp{@w{gawk> }}. +Change the debugger prompt. The default is @samp{@w{gawk> }}. @item @code{save_history} [@code{on} | @code{off}] @cindex debugger history file @@ -28877,7 +28873,7 @@ The default is @code{on}. @cindex save debugger options Save current options to file @file{./.gawkrc} upon exit. The default is @code{on}. -Options are read back in to the next session upon startup. +Options are read back into the next session upon startup. @item @code{trace} [@code{on} | @code{off}] @cindex instruction tracing, in debugger @@ -28900,7 +28896,7 @@ command in the file. Also, the list of commands may include additional @code{source} commands; however, the @command{gawk} debugger will not source the same file more than once in order to avoid infinite recursion. -In addition to, or instead of the @code{source} command, you can use +In addition to, or instead of, the @code{source} command, you can use the @option{-D @var{file}} or @option{--debug=@var{file}} command-line options to execute commands from a file non-interactively (@pxref{Options}). @@ -28909,16 +28905,16 @@ options to execute commands from a file non-interactively @node Miscellaneous Debugger Commands @subsection Miscellaneous Commands -There are a few more commands which do not fit into the +There are a few more commands that do not fit into the previous categories, as follows: @table @asis @cindex debugger commands, @code{dump} @cindex @code{dump} debugger command @item @code{dump} [@var{filename}] -Dump bytecode of the program to standard output or to the file +Dump byte code of the program to standard output or to the file named in @var{filename}. This prints a representation of the internal -instructions which @command{gawk} executes to implement the @command{awk} +instructions that @command{gawk} executes to implement the @command{awk} commands in a program. This can be very enlightening, as the following partial dump of Davide Brini's obfuscated code (@pxref{Signature Program}) demonstrates: @@ -29015,7 +29011,7 @@ Print lines centered around line number @var{n} in source file @var{filename}. This command may change the current source file. @item @var{function} -Print lines centered around beginning of the +Print lines centered around the beginning of the function @var{function}. This command may change the current source file. @end table @@ -29027,16 +29023,16 @@ function @var{function}. This command may change the current source file. @item @code{quit} @itemx @code{q} Exit the debugger. Debugging is great fun, but sometimes we all have -to tend to other obligations in life, and sometimes we find the bug, +to tend to other obligations in life, and sometimes we find the bug and are free to go on to the next one! As we saw earlier, if you are -running a program, the debugger warns you if you accidentally type +running a program, the debugger warns you when you type @samp{q} or @samp{quit}, to make sure you really want to quit. @cindex debugger commands, @code{trace} @cindex @code{trace} debugger command @item @code{trace} [@code{on} | @code{off}] -Turn on or off a continuous printing of instructions which are about to -be executed, along with printing the @command{awk} line which they +Turn on or off continuous printing of the instructions that are about to +be executed, along with the @command{awk} lines they implement. The default is @code{off}. It is to be hoped that most of the ``opcodes'' in these instructions are @@ -29052,7 +29048,7 @@ fairly self-explanatory, and using @code{stepi} and @code{nexti} while If @command{gawk} is compiled with @uref{http://cnswww.cns.cwru.edu/php/chet/readline/readline.html, -the @code{readline} library}, you can take advantage of that library's +the GNU Readline library}, you can take advantage of that library's command completion and history expansion features. The following types of completion are available: @@ -29089,7 +29085,7 @@ and We hope you find the @command{gawk} debugger useful and enjoyable to work with, but as with any program, especially in its early releases, it still has -some limitations. A few which are worth being aware of are: +some limitations. A few that it's worth being aware of are: @itemize @value{BULLET} @item @@ -29105,13 +29101,13 @@ If you perused the dump of opcodes in @ref{Miscellaneous Debugger Commands} (or if you are already familiar with @command{gawk} internals), you will realize that much of the internal manipulation of data in @command{gawk}, as in many interpreters, is done on a stack. -@code{Op_push}, @code{Op_pop}, and the like, are the ``bread and butter'' of +@code{Op_push}, @code{Op_pop}, and the like are the ``bread and butter'' of most @command{gawk} code. Unfortunately, as of now, the @command{gawk} debugger does not allow you to examine the stack's contents. That is, the intermediate results of expression evaluation are on the -stack, but cannot be printed. Rather, only variables which are defined +stack, but cannot be printed. Rather, only variables that are defined in the program can be printed. Of course, a workaround for this is to use more explicit variables at the debugging stage and then change back to obscure, perhaps more optimal code later. @@ -29125,12 +29121,12 @@ programmer, you are expected to know the meaning of @item The @command{gawk} debugger is designed to be used by running a program (with all its parameters) on the command line, as described in @ref{Debugger Invocation}. -There is no way (as of now) to attach or ``break in'' to a running program. -This seems reasonable for a language which is used mainly for quickly +There is no way (as of now) to attach or ``break into'' a running program. +This seems reasonable for a language that is used mainly for quickly executing, short programs. @item -The @command{gawk} debugger only accepts source supplied with the @option{-f} option. +The @command{gawk} debugger only accepts source code supplied with the @option{-f} option. @end itemize @ignore @@ -29144,8 +29140,8 @@ be added, and of course feel free to try to add them yourself! @itemize @value{BULLET} @item Programs rarely work correctly the first time. Finding bugs -is @dfn{debugging} and a program that helps you find bugs is a -@dfn{debugger}. @command{gawk} has a built-in debugger that works very +is called debugging, and a program that helps you find bugs is a +debugger. @command{gawk} has a built-in debugger that works very similarly to the GNU Debugger, GDB. @item @@ -29165,7 +29161,7 @@ breakpoints, execution, viewing and changing data, working with the stack, getting information, and other tasks. @item -If the @code{readline} library is available when @command{gawk} is +If the GNU Readline library is available when @command{gawk} is compiled, it is used by the debugger to provide command-line history and editing. -- cgit v1.2.3 From 2f9c84e82632cbce017a6d342acb3dede5e59e12 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Feb 2015 19:45:44 +0200 Subject: Reset non-fatal-io to 31 December, add fixes from Andrew Schorr. --- ChangeLog | 13 +++++++++++++ awk.h | 4 ++-- builtin.c | 23 +++++++++++------------ io.c | 40 ++++++++++++++-------------------------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ee6bf26..c61e8eec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2015-02-08 Andrew J. Schorr + + * awk.h (RED_NON_FATAL): Removed. + (redirect): Add new failure_fatal parameter. + (is_non_fatal_redirect): Add declaration. + * builtin.c (efwrite): Rework check for non-fatal. + (do_printf): Adjust calls to redirect. + (do_print_rec): Ditto. Move check for redirection error up. + * io.c (redflags2str): Remove RED_NON_FATAL. + (redirect): Add new failure_fatal parameter. Simplify the code. + (is_non_fatal_redirect): New function. + (do_getline_redir): Adjust calls to redirect. + 2014-12-27 Arnold D. Robbins * awk.h (is_non_fatal_std): Declare new function. diff --git a/awk.h b/awk.h index 81a0e91f..b1272ade 100644 --- a/awk.h +++ b/awk.h @@ -918,7 +918,6 @@ struct redirect { # define RED_PTY 512 # define RED_SOCKET 1024 # define RED_TCP 2048 -# define RED_NON_FATAL 4096 char *value; FILE *ifp; /* input fp, needed for PIPES_SIMULATED */ IOBUF *iop; @@ -1484,7 +1483,7 @@ extern void register_two_way_processor(awk_two_way_processor_t *processor); extern void set_FNR(void); extern void set_NR(void); -extern struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg); +extern struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg, bool failure_fatal); extern NODE *do_close(int nargs); extern int flush_io(void); extern int close_io(bool *stdio_problem); @@ -1497,6 +1496,7 @@ extern struct redirect *getredirect(const char *str, int len); extern bool inrec(IOBUF *iop, int *errcode); extern int nextfile(IOBUF **curfile, bool skipping); extern bool is_non_fatal_std(FILE *fp); +extern bool is_non_fatal_redirect(const char *str); /* main.c */ extern int arg_assign(char *arg, bool initing); extern int is_std_var(const char *var); diff --git a/builtin.c b/builtin.c index e80d46d4..aa8caf09 100644 --- a/builtin.c +++ b/builtin.c @@ -131,10 +131,9 @@ wrerror: /* otherwise die verbosely */ - if ( (rp != NULL && (rp->flag & RED_NON_FATAL) != 0) - || is_non_fatal_std(fp)) { + if ((rp != NULL) ? is_non_fatal_redirect(rp->value) : is_non_fatal_std(fp)) update_ERRNO_int(errno); - } else + else fatal(_("%s to \"%s\" failed (%s)"), from, rp ? rp->value : _("standard output"), errno ? strerror(errno) : _("reason unknown")); @@ -1649,7 +1648,7 @@ do_printf(int nargs, int redirtype) redir_exp = TOP(); if (redir_exp->type != Node_val) fatal(_("attempt to use array `%s' in a scalar context"), array_vname(redir_exp)); - rp = redirect(redir_exp, redirtype, & errflg); + rp = redirect(redir_exp, redirtype, & errflg, true); DEREF(redir_exp); decr_sp(); } @@ -1662,7 +1661,7 @@ do_printf(int nargs, int redirtype) redir_exp = PEEK(nargs); if (redir_exp->type != Node_val) fatal(_("attempt to use array `%s' in a scalar context"), array_vname(redir_exp)); - rp = redirect(redir_exp, redirtype, & errflg); + rp = redirect(redir_exp, redirtype, & errflg, true); if (rp != NULL) fp = rp->output.fp; else if (errflg) { @@ -2093,7 +2092,7 @@ do_print(int nargs, int redirtype) redir_exp = PEEK(nargs); if (redir_exp->type != Node_val) fatal(_("attempt to use array `%s' in a scalar context"), array_vname(redir_exp)); - rp = redirect(redir_exp, redirtype, & errflg); + rp = redirect(redir_exp, redirtype, & errflg, true); if (rp != NULL) fp = rp->output.fp; else if (errflg) { @@ -2161,7 +2160,7 @@ do_print_rec(int nargs, int redirtype) assert(nargs == 0); if (redirtype != 0) { redir_exp = TOP(); - rp = redirect(redir_exp, redirtype, & errflg); + rp = redirect(redir_exp, redirtype, & errflg, true); if (rp != NULL) fp = rp->output.fp; DEREF(redir_exp); @@ -2169,17 +2168,17 @@ do_print_rec(int nargs, int redirtype) } else fp = output_fp; + if (errflg) { + update_ERRNO_int(errflg); + return; + } + if (fp == NULL) return; if (! field0_valid) (void) get_field(0L, NULL); /* rebuild record */ - if (errflg) { - update_ERRNO_int(errflg); - return; - } - f0 = fields_arr[0]; if (do_lint && (f0->flags & NULL_FIELD) != 0) diff --git a/io.c b/io.c index b3819c01..db8a0a2b 100644 --- a/io.c +++ b/io.c @@ -261,7 +261,6 @@ struct recmatch { static int iop_close(IOBUF *iop); -struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg); static void close_one(void); static int close_redir(struct redirect *rp, bool exitwarn, two_way_close_type how); #ifndef PIPES_SIMULATED @@ -718,7 +717,6 @@ redflags2str(int flags) { RED_PTY, "RED_PTY" }, { RED_SOCKET, "RED_SOCKET" }, { RED_TCP, "RED_TCP" }, - { RED_NON_FATAL, "RED_NON_FATAL" }, { 0, NULL } }; @@ -728,7 +726,7 @@ redflags2str(int flags) /* redirect --- Redirection for printf and print commands */ struct redirect * -redirect(NODE *redir_exp, int redirtype, int *errflg) +redirect(NODE *redir_exp, int redirtype, int *errflg, bool failure_fatal) { struct redirect *rp; char *str; @@ -745,8 +743,6 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) static struct redirect *save_rp = NULL; /* hold onto rp that should * be freed for reuse */ - bool is_output = false; - bool is_non_fatal = false; if (do_sandbox) fatal(_("redirection not allowed in sandbox mode")); @@ -756,7 +752,6 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) tflag = RED_APPEND; /* FALL THROUGH */ case redirect_output: - is_output = true; outflag = (RED_FILE|RED_WRITE); tflag |= outflag; if (redirtype == redirect_output) @@ -765,7 +760,6 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) what = ">>"; break; case redirect_pipe: - is_output = true; tflag = (RED_PIPE|RED_WRITE); what = "|"; break; @@ -778,7 +772,6 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) what = "<"; break; case redirect_twoway: - is_output = true; tflag = (RED_READ|RED_WRITE|RED_TWOWAY); what = "|&"; break; @@ -800,14 +793,6 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) lintwarn(_("filename `%s' for `%s' redirection may be result of logical expression"), str, what); - /* input files/pipes are automatically nonfatal */ - if (is_output) { - is_non_fatal = (in_PROCINFO("nonfatal", NULL, NULL) != NULL - || in_PROCINFO(str, "nonfatal", NULL) != NULL); - if (is_non_fatal) - tflag |= RED_NON_FATAL; - } - #ifdef HAVE_SOCKETS /* * Use /inet4 to force IPv4, /inet6 to force IPv6, and plain @@ -907,7 +892,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) os_restore_mode(fileno(stdin)); /* - * Don't check is_non_fatal; see input pipe below. + * Don't check failure_fatal; see input pipe below. * Note that the failure happens upon failure to fork, * using a non-existant program will still succeed the * popen(). @@ -947,17 +932,11 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) case redirect_twoway: direction = "to/from"; if (! two_way_open(str, rp)) { -#ifdef HAVE_SOCKETS - if (inetfile(str, NULL)) { - *errflg = errno; - /* do not free rp, saving it for reuse (save_rp = rp) */ - return NULL; - } else if (is_non_fatal) { + if (! failure_fatal || is_non_fatal_redirect(str)) { *errflg = errno; /* do not free rp, saving it for reuse (save_rp = rp) */ return NULL; } else -#endif fatal(_("can't open two way pipe `%s' for input/output (%s)"), str, strerror(errno)); } @@ -1038,7 +1017,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) */ if (errflg != NULL) *errflg = errno; - if (! is_non_fatal && + if (failure_fatal && ! is_non_fatal_redirect(str) && (redirtype == redirect_output || redirtype == redirect_append)) { /* multiple messages make life easier for translators */ @@ -1104,6 +1083,15 @@ is_non_fatal_std(FILE *fp) return false; } +/* is_non_fatal_redirect --- return true if redirected I/O should be nonfatal */ + +bool +is_non_fatal_redirect(const char *str) +{ + return in_PROCINFO("nonfatal", NULL, NULL) != NULL + || in_PROCINFO(str, "nonfatal", NULL) != NULL; +} + /* close_one --- temporarily close an open file to re-use the fd */ static void @@ -2467,7 +2455,7 @@ do_getline_redir(int into_variable, enum redirval redirtype) assert(redirtype != redirect_none); redir_exp = TOP(); - rp = redirect(redir_exp, redirtype, & redir_error); + rp = redirect(redir_exp, redirtype, & redir_error, false); DEREF(redir_exp); decr_sp(); if (rp == NULL) { -- cgit v1.2.3 From 34c33ee0f9d3863f9ef381e499e396c9f447a941 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Feb 2015 19:50:27 +0200 Subject: Add tests for non fatal i/o. --- test/ChangeLog | 6 ++++++ test/Makefile.am | 5 +++++ test/Makefile.in | 15 +++++++++++++++ test/Maketests | 10 ++++++++++ test/nonfatal1.awk | 5 +++++ test/nonfatal1.ok | 2 ++ test/nonfatal2.awk | 5 +++++ test/nonfatal2.ok | 1 + 8 files changed, 49 insertions(+) create mode 100644 test/nonfatal1.awk create mode 100644 test/nonfatal1.ok create mode 100644 test/nonfatal2.awk create mode 100644 test/nonfatal2.ok diff --git a/test/ChangeLog b/test/ChangeLog index 2787b909..bff1d808 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2015-02-06 Arnold D. Robbins + + * Makefile.am (nonfatal1, nonfatal2): New tests. + * nonfatal1.awk, nonfatal1.ok: New files. + * nonfatal2.awk, nonfatal2.ok: New files. + 2014-12-24 Arnold D. Robbins * Makefile.am (badbuild): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 7335da32..802a3551 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -595,6 +595,10 @@ EXTRA_DIST = \ nondec.ok \ nondec2.awk \ nondec2.ok \ + nonfatal1.awk \ + nonfatal1.ok \ + nonfatal2.awk \ + nonfatal2.ok \ nonl.awk \ nonl.ok \ noparms.awk \ @@ -1028,6 +1032,7 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ + nonfatal1 nonfatal2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ diff --git a/test/Makefile.in b/test/Makefile.in index fa86fc7f..70dd1f4e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -842,6 +842,10 @@ EXTRA_DIST = \ nondec.ok \ nondec2.awk \ nondec2.ok \ + nonfatal1.awk \ + nonfatal1.ok \ + nonfatal2.awk \ + nonfatal2.ok \ nonl.awk \ nonl.ok \ noparms.awk \ @@ -1274,6 +1278,7 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ + nonfatal1 nonfatal2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ @@ -3568,6 +3573,16 @@ nondec: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + patsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index e1b92bf9..08085a0f 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1137,6 +1137,16 @@ nondec: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + patsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/nonfatal1.awk b/test/nonfatal1.awk new file mode 100644 index 00000000..83661284 --- /dev/null +++ b/test/nonfatal1.awk @@ -0,0 +1,5 @@ +BEGIN { + PROCINFO["nonfatal"] + print |& "/inet/tcp/0/ti10/357" + print ERRNO +} diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok new file mode 100644 index 00000000..b96b8e27 --- /dev/null +++ b/test/nonfatal1.ok @@ -0,0 +1,2 @@ +gawk: nonfatal1.awk:3: fatal: remote host and port information (ti10, 357) invalid +EXIT CODE: 2 diff --git a/test/nonfatal2.awk b/test/nonfatal2.awk new file mode 100644 index 00000000..f5db71c5 --- /dev/null +++ b/test/nonfatal2.awk @@ -0,0 +1,5 @@ +BEGIN { + PROCINFO["nonfatal"] = 1 + print > "/dev/no/such/file" + print ERRNO +} diff --git a/test/nonfatal2.ok b/test/nonfatal2.ok new file mode 100644 index 00000000..ddc88691 --- /dev/null +++ b/test/nonfatal2.ok @@ -0,0 +1 @@ +No such file or directory -- cgit v1.2.3 From 7f9f66525d7d82816eba352efdf58497373a47bf Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Feb 2015 20:01:32 +0200 Subject: Use "NONFATAL" for nonfatal I/O. --- ChangeLog | 8 +++++--- doc/ChangeLog | 1 + doc/gawk.info | 12 ++++++------ doc/gawk.texi | 12 ++++++------ doc/gawktexi.in | 12 ++++++------ io.c | 14 ++++++++------ test/ChangeLog | 4 ++++ test/nonfatal1.awk | 2 +- test/nonfatal2.awk | 2 +- 9 files changed, 38 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61362b78..0727c927 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -<<<<<<< HEAD +2015-02-08 Arnold D. Robbins + + * io.c: Make it "NONFATAL" everywhere. + 2015-02-08 Andrew J. Schorr * awk.h (RED_NON_FATAL): Removed. @@ -17,7 +20,7 @@ * awk.h (is_non_fatal_std): Declare new function. * io.c (is_non_fatal_std): New function. * builtin.c (efwrite): Call it. -======= + 2015-02-07 Arnold D. Robbins * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h, @@ -119,7 +122,6 @@ * awkgram.y (extensions_used): New variable. Set it on @load. (do_add_scrfile): Set it on -l. (process_deferred): Check it also. ->>>>>>> master 2014-12-24 Arnold D. Robbins diff --git a/doc/ChangeLog b/doc/ChangeLog index 5d8c4a5e..3840f933 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2015-02-08 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. + Make non-fatal i/o use "NONFATAL". 2015-02-06 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index d83370e8..118c814a 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -7226,10 +7226,10 @@ error message of your choosing before exiting. You can do this in one of two ways: * For all output files, by assigning any value to - `PROCINFO["nonfatal"]'. + `PROCINFO["NONFATAL"]'. * On a per-file basis, by assigning any value to `PROCINFO[FILENAME, - "nonfatal"]'. Here, FILENAME is the name of the file to which you + "NONFATAL"]'. Here, FILENAME is the name of the file to which you wish output to be nonfatal. Once you have enabled nonfatal output, you must check `ERRNO' after @@ -7239,7 +7239,7 @@ attempting the output. For example: $ gawk ' > BEGIN { - > PROCINFO["nonfatal"] = 1 + > PROCINFO["NONFATAL"] = 1 > ERRNO = 0 > print "hi" > "/no/such/file" > if (ERRNO) { @@ -7253,9 +7253,9 @@ attempting the output. For example: program code detect the problem and handle it. This mechanism works also for standard output and standard error. -For standard output, you may use `PROCINFO["-", "nonfatal"]' or -`PROCINFO["/dev/stdout", "nonfatal"]'. For standard error, use -`PROCINFO["/dev/stderr", "nonfatal"]'. +For standard output, you may use `PROCINFO["-", "NONFATAL"]' or +`PROCINFO["/dev/stdout", "NONFATAL"]'. For standard error, use +`PROCINFO["/dev/stderr", "NONFATAL"]'.  File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Nonfatal, Up: Printing diff --git a/doc/gawk.texi b/doc/gawk.texi index 81568fe7..1a239124 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -10458,11 +10458,11 @@ You can do this in one of two ways: @itemize @bullet @item -For all output files, by assigning any value to @code{PROCINFO["nonfatal"]}. +For all output files, by assigning any value to @code{PROCINFO["NONFATAL"]}. @item On a per-file basis, by assigning any value to -@code{PROCINFO[@var{filename}, "nonfatal"]}. +@code{PROCINFO[@var{filename}, "NONFATAL"]}. Here, @var{filename} is the name of the file to which you wish output to be nonfatal. @end itemize @@ -10475,7 +10475,7 @@ see if something went wrong. It is also a good idea to initialize @example $ @kbd{gawk '} > @kbd{BEGIN @{} -> @kbd{ PROCINFO["nonfatal"] = 1} +> @kbd{ PROCINFO["NONFATAL"] = 1} > @kbd{ ERRNO = 0} > @kbd{ print "hi" > "/no/such/file"} > @kbd{ if (ERRNO) @{} @@ -10490,9 +10490,9 @@ Here, @command{gawk} did not produce a fatal error; instead it let the @command{awk} program code detect the problem and handle it. This mechanism works also for standard output and standard error. -For standard output, you may use @code{PROCINFO["-", "nonfatal"]} -or @code{PROCINFO["/dev/stdout", "nonfatal"]}. For standard error, use -@code{PROCINFO["/dev/stderr", "nonfatal"]}. +For standard output, you may use @code{PROCINFO["-", "NONFATAL"]} +or @code{PROCINFO["/dev/stdout", "NONFATAL"]}. For standard error, use +@code{PROCINFO["/dev/stderr", "NONFATAL"]}. @node Output Summary @section Summary diff --git a/doc/gawktexi.in b/doc/gawktexi.in index e127f428..1e833fe2 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -9954,11 +9954,11 @@ You can do this in one of two ways: @itemize @bullet @item -For all output files, by assigning any value to @code{PROCINFO["nonfatal"]}. +For all output files, by assigning any value to @code{PROCINFO["NONFATAL"]}. @item On a per-file basis, by assigning any value to -@code{PROCINFO[@var{filename}, "nonfatal"]}. +@code{PROCINFO[@var{filename}, "NONFATAL"]}. Here, @var{filename} is the name of the file to which you wish output to be nonfatal. @end itemize @@ -9971,7 +9971,7 @@ see if something went wrong. It is also a good idea to initialize @example $ @kbd{gawk '} > @kbd{BEGIN @{} -> @kbd{ PROCINFO["nonfatal"] = 1} +> @kbd{ PROCINFO["NONFATAL"] = 1} > @kbd{ ERRNO = 0} > @kbd{ print "hi" > "/no/such/file"} > @kbd{ if (ERRNO) @{} @@ -9986,9 +9986,9 @@ Here, @command{gawk} did not produce a fatal error; instead it let the @command{awk} program code detect the problem and handle it. This mechanism works also for standard output and standard error. -For standard output, you may use @code{PROCINFO["-", "nonfatal"]} -or @code{PROCINFO["/dev/stdout", "nonfatal"]}. For standard error, use -@code{PROCINFO["/dev/stderr", "nonfatal"]}. +For standard output, you may use @code{PROCINFO["-", "NONFATAL"]} +or @code{PROCINFO["/dev/stdout", "NONFATAL"]}. For standard error, use +@code{PROCINFO["/dev/stderr", "NONFATAL"]}. @node Output Summary @section Summary diff --git a/io.c b/io.c index db8a0a2b..f975353e 100644 --- a/io.c +++ b/io.c @@ -1069,15 +1069,17 @@ getredirect(const char *str, int len) bool is_non_fatal_std(FILE *fp) { - if (in_PROCINFO("nonfatal", NULL, NULL)) + static const char nonfatal[] = "NONFATAL"; + + if (in_PROCINFO(nonfatal, NULL, NULL)) return true; /* yucky logic. sigh. */ if (fp == stdout) { - return ( in_PROCINFO("-", "nonfatal", NULL) != NULL - || in_PROCINFO("/dev/stdout", "nonfatal", NULL) != NULL); + return ( in_PROCINFO("-", nonfatal, NULL) != NULL + || in_PROCINFO("/dev/stdout", nonfatal, NULL) != NULL); } else if (fp == stderr) { - return (in_PROCINFO("/dev/stderr", "nonfatal", NULL) != NULL); + return (in_PROCINFO("/dev/stderr", nonfatal, NULL) != NULL); } return false; @@ -1088,8 +1090,8 @@ is_non_fatal_std(FILE *fp) bool is_non_fatal_redirect(const char *str) { - return in_PROCINFO("nonfatal", NULL, NULL) != NULL - || in_PROCINFO(str, "nonfatal", NULL) != NULL; + return in_PROCINFO("NONFATAL", NULL, NULL) != NULL + || in_PROCINFO(str, "NONFATAL", NULL) != NULL; } /* close_one --- temporarily close an open file to re-use the fd */ diff --git a/test/ChangeLog b/test/ChangeLog index b0979d8a..e888c669 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2015-02-08 Arnold D. Robbins + + * nonfatal1.awk, nonfatal2.awk: String is now "NONFATAL". + 2015-02-06 Arnold D. Robbins * Makefile.am (nonfatal1, nonfatal2): New tests. diff --git a/test/nonfatal1.awk b/test/nonfatal1.awk index 83661284..bf821d49 100644 --- a/test/nonfatal1.awk +++ b/test/nonfatal1.awk @@ -1,5 +1,5 @@ BEGIN { - PROCINFO["nonfatal"] + PROCINFO["NONFATAL"] print |& "/inet/tcp/0/ti10/357" print ERRNO } diff --git a/test/nonfatal2.awk b/test/nonfatal2.awk index f5db71c5..fedbba43 100644 --- a/test/nonfatal2.awk +++ b/test/nonfatal2.awk @@ -1,5 +1,5 @@ BEGIN { - PROCINFO["nonfatal"] = 1 + PROCINFO["NONFATAL"] = 1 print > "/dev/no/such/file" print ERRNO } -- cgit v1.2.3 From 1f6b16d2d233ecc7f99ea2460098d8eeec382942 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Feb 2015 20:50:31 +0200 Subject: O'Reilly fixes. Through chapter 15. --- doc/gawk.info | 429 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 109 ++++++++------ doc/gawktexi.in | 109 ++++++++------ 3 files changed, 348 insertions(+), 299 deletions(-) diff --git a/doc/gawk.info b/doc/gawk.info index 5bfdd436..c56ac89c 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -21768,7 +21768,7 @@ Decimal arithmetic sides) of the decimal point, and the results of a computation are always exact. - Some modern system can do decimal arithmetic in hardware, but + Some modern systems can do decimal arithmetic in hardware, but usually you need a special software library to provide access to these instructions. There are also libraries that do decimal arithmetic entirely in software. @@ -21822,12 +21822,6 @@ Numeric representation Minimum value Maximum value 32-bit unsigned integer 0 4,294,967,295 64-bit signed integer -9,223,372,036,854,775,8089,223,372,036,854,775,807 64-bit unsigned integer 0 18,446,744,073,709,551,615 -Single-precision `1.175494e-38' `3.402823e+38' -floating point -(approximate) -Double-precision `2.225074e-308' `1.797693e+308' -floating point -(approximate) Table 15.1: Value ranges for different numeric representations @@ -21843,7 +21837,7 @@ File: gawk.info, Node: Math Definitions, Next: MPFR features, Prev: Computer The rest of this major node uses a number of terms. Here are some informal definitions that should help you work your way through the -material here. +material here: "Accuracy" A floating-point calculation's accuracy is how close it comes to @@ -21863,7 +21857,7 @@ material here. number and infinity produce infinity. "NaN" - "Not A Number."(1) A special value that results from attempting a + "Not a number."(1) A special value that results from attempting a calculation that has no answer as a real number. In such a case, programs can either receive a floating-point exception, or get `NaN' back as the result. The IEEE 754 standard recommends that @@ -21889,15 +21883,15 @@ material here. PREC = 3.322 * DPS - Here, PREC denotes the binary precision (measured in bits) and DPS - (short for decimal places) is the decimal digits. + Here, _prec_ denotes the binary precision (measured in bits) and + _dps_ (short for decimal places) is the decimal digits. "Rounding mode" How numbers are rounded up or down when necessary. More details are provided later. "Significand" - A floating-point value consists the significand multiplied by 10 + A floating-point value consists of the significand multiplied by 10 to the power of the exponent. For example, in `1.2345e67', the significand is `1.2345'. @@ -21919,7 +21913,7 @@ precision formats to allow greater precisions and larger exponent ranges. (`awk' uses only the 64-bit double-precision format.) *note table-ieee-formats:: lists the precision and exponent field -values for the basic IEEE 754 binary formats: +values for the basic IEEE 754 binary formats. Name Total bits Precision Minimum Maximum exponent exponent @@ -21984,7 +21978,7 @@ File: gawk.info, Node: FP Math Caution, Next: Arbitrary Precision Integers, P Math class is tough! -- Teen Talk Barbie, July 1992 - This minor node provides a high level overview of the issues + This minor node provides a high-level overview of the issues involved when doing lots of floating-point arithmetic.(1) The discussion applies to both hardware and arbitrary-precision floating-point arithmetic. @@ -22005,8 +21999,8 @@ floating-point arithmetic. (1) There is a very nice paper on floating-point arithmetic (http://www.validlab.com/goldberg/paper.pdf) by David Goldberg, "What -Every Computer Scientist Should Know About Floating-point Arithmetic," -`ACM Computing Surveys' *23*, 1 (1991-03), 5-48. This is worth reading +Every Computer Scientist Should Know About Floating-Point Arithmetic," +`ACM Computing Surveys' *23*, 1 (1991-03): 5-48. This is worth reading if you are interested in the details, but it does require a background in computer science. @@ -22060,7 +22054,7 @@ number as you assigned to it: Often the error is so small you do not even notice it, and if you do, you can always specify how much precision you would like in your output. -Usually this is a format string like `"%.15g"', which when used in the +Usually this is a format string like `"%.15g"', which, when used in the previous example, produces an output identical to the input.  @@ -22100,7 +22094,7 @@ File: gawk.info, Node: Errors accumulate, Prev: Comparing FP Values, Up: Inex The loss of accuracy during a single computation with floating-point numbers usually isn't enough to worry about. However, if you compute a -value which is the result of a sequence of floating-point operations, +value that is the result of a sequence of floating-point operations, the error can accumulate and greatly affect the computation itself. Here is an attempt to compute the value of pi using one of its many series representations: @@ -22151,7 +22145,7 @@ easy answers. The standard rules of algebra often do not apply when using floating-point arithmetic. Among other things, the distributive and associative laws do not hold completely, and order of operation may be important for your computation. Rounding error, cumulative precision -loss and underflow are often troublesome. +loss, and underflow are often troublesome. When `gawk' tests the expressions `0.1 + 12.2' and `12.3' for equality using the machine double-precision arithmetic, it decides that @@ -22186,8 +22180,9 @@ illustrated by our earlier attempt to compute the value of pi. Extra precision can greatly enhance the stability and the accuracy of your computation in such cases. - Repeated addition is not necessarily equivalent to multiplication in -floating-point arithmetic. In the example in *note Errors accumulate::: + Additionally, you should understand that repeated addition is not +necessarily equivalent to multiplication in floating-point arithmetic. +In the example in *note Errors accumulate::: $ gawk 'BEGIN { > for (d = 1.1; d <= 1.5; d += 0.1) # loop five times (?) @@ -22242,7 +22237,7 @@ set the value to one of the predefined case-insensitive strings shown in *note table-predefined-precision-strings::, to emulate an IEEE 754 binary format. -`PREC' IEEE 754 Binary Format +`PREC' IEEE 754 binary format --------------------------------------------------- `"half"' 16-bit half-precision `"single"' Basic 32-bit single precision @@ -22275,14 +22270,14 @@ on arithmetic operations: example illustrates the differences among various ways to print a floating-point constant: - $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", 0.1) }' - -| 0.1000000000000000055511151 - $ gawk -M -v PREC=113 'BEGIN { printf("%0.25f\n", 0.1) }' - -| 0.1000000000000000000000000 - $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", "0.1") }' - -| 0.1000000000000000000000000 - $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", 1/10) }' - -| 0.1000000000000000000000000 + $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", 0.1) }' + -| 0.1000000000000000055511151 + $ gawk -M -v PREC=113 'BEGIN { printf("%0.25f\n", 0.1) }' + -| 0.1000000000000000000000000 + $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", "0.1") }' + -| 0.1000000000000000000000000 + $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", 1/10) }' + -| 0.1000000000000000000000000  File: gawk.info, Node: Setting the rounding mode, Prev: Setting precision, Up: FP Math Caution @@ -22290,15 +22285,15 @@ File: gawk.info, Node: Setting the rounding mode, Prev: Setting precision, Up 15.4.5 Setting the Rounding Mode -------------------------------- -The `ROUNDMODE' variable provides program level control over the +The `ROUNDMODE' variable provides program-level control over the rounding mode. The correspondence between `ROUNDMODE' and the IEEE rounding modes is shown in *note table-gawk-rounding-modes::. -Rounding Mode IEEE Name `ROUNDMODE' +Rounding mode IEEE name `ROUNDMODE' --------------------------------------------------------------------------- Round to nearest, ties to even `roundTiesToEven' `"N"' or `"n"' -Round toward plus Infinity `roundTowardPositive' `"U"' or `"u"' -Round toward negative Infinity `roundTowardNegative' `"D"' or `"d"' +Round toward positive infinity `roundTowardPositive' `"U"' or `"u"' +Round toward negative infinity `roundTowardNegative' `"D"' or `"d"' Round toward zero `roundTowardZero' `"Z"' or `"z"' Round to nearest, ties away `roundTiesToAway' `"A"' or `"a"' from zero @@ -22349,8 +22344,8 @@ distributes upward and downward rounds of exact halves, which might cause any accumulating round-off error to cancel itself out. This is the default rounding mode for IEEE 754 computing functions and operators. - The other rounding modes are rarely used. Round toward positive -infinity (`roundTowardPositive') and round toward negative infinity + The other rounding modes are rarely used. Rounding toward positive +infinity (`roundTowardPositive') and toward negative infinity (`roundTowardNegative') are often used to implement interval arithmetic, where you adjust the rounding mode to calculate upper and lower bounds for the range of output. The `roundTowardZero' mode can be @@ -22398,7 +22393,7 @@ floating-point values: If instead you were to compute the same value using arbitrary-precision floating-point values, the precision needed for -correct output (using the formula `prec = 3.322 * dps'), would be 3.322 +correct output (using the formula `prec = 3.322 * dps') would be 3.322 x 183231, or 608693. The result from an arithmetic operation with an integer and a @@ -22429,7 +22424,7 @@ interface to process arbitrary-precision integers or mixed-mode numbers as needed by an operation or function. In such a case, the precision is set to the minimum value necessary for exact conversion, and the working precision is not used for this purpose. If this is not what you need or -want, you can employ a subterfuge, and convert the integer to floating +want, you can employ a subterfuge and convert the integer to floating point first, like this: gawk -M 'BEGIN { n = 13; print (n + 0.0) % 2.0 }' @@ -22456,7 +22451,7 @@ File: gawk.info, Node: POSIX Floating Point Problems, Next: Floating point sum 15.6 Standards Versus Existing Practice ======================================= -Historically, `awk' has converted any non-numeric looking string to the +Historically, `awk' has converted any nonnumeric-looking string to the numeric value zero, when required. Furthermore, the original definition of the language and the original POSIX standards specified that `awk' only understands decimal numbers (base 10), and not octal @@ -22470,8 +22465,8 @@ These features are: hexadecimal notation (e.g., `0xDEADBEEF'). (Note: data values, _not_ source code constants.) - * Support for the special IEEE 754 floating-point values "Not A - Number" (NaN), positive Infinity ("inf"), and negative Infinity + * Support for the special IEEE 754 floating-point values "not a + number" (NaN), positive infinity ("inf"), and negative infinity ("-inf"). In particular, the format for these values is as specified by the ISO 1999 C standard, which ignores case and can allow implementation-dependent additional characters after the @@ -22488,21 +22483,21 @@ historical practice: values is also a very severe departure from historical practice. The second problem is that the `gawk' maintainer feels that this -interpretation of the standard, which requires a certain amount of +interpretation of the standard, which required 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 +intended by the standard developers. In other words, "We see how you got where you are, but we don't think that that's where you want to be." Recognizing these issues, but attempting to provide compatibility with the earlier versions of the standard, the 2008 POSIX standard added explicit wording to allow, but not require, that `awk' support -hexadecimal floating-point values and special values for "Not A Number" +hexadecimal floating-point values and special values for "not a number" and infinity. Although the `gawk' maintainer continues to feel that providing those features is inadvisable, nevertheless, on systems that support IEEE floating point, it seems reasonable to provide _some_ way to -support NaN and Infinity values. The solution implemented in `gawk' is +support NaN and infinity values. The solution implemented in `gawk' is as follows: * With the `--posix' command-line option, `gawk' becomes "hands @@ -22517,7 +22512,7 @@ as follows: $ echo 0xDeadBeef | gawk --posix '{ print $1 + 0 }' -| 3735928559 - * Without `--posix', `gawk' interprets the four strings `+inf', + * Without `--posix', `gawk' interprets the four string values `+inf', `-inf', `+nan', and `-nan' specially, producing the corresponding special numeric values. The leading sign acts a signal to `gawk' (and the user) that the value is really numeric. Hexadecimal @@ -22531,7 +22526,7 @@ as follows: $ echo 0xDeadBeef | gawk '{ print $1 + 0 }' -| 0 - `gawk' ignores case in the four special values. Thus `+nan' and + `gawk' ignores case in the four special values. Thus, `+nan' and `+NaN' are the same. ---------- Footnotes ---------- @@ -22548,9 +22543,9 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob floating-point values. Standard `awk' uses double-precision floating-point values. - * In the early 1990s, Barbie mistakenly said "Math class is tough!" + * In the early 1990s Barbie mistakenly said, "Math class is tough!" Although math isn't tough, floating-point arithmetic isn't the same - as pencil and paper math, and care must be taken: + as pencil-and-paper math, and care must be taken: - Not all numbers can be represented exactly. @@ -22571,7 +22566,7 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob rounding mode. * With `-M', `gawk' performs arbitrary-precision integer arithmetic - using the GMP library. This is faster and more space efficient + using the GMP library. This is faster and more space-efficient than using MPFR for the same calculations. * There are several "dark corners" with respect to floating-point @@ -22582,7 +22577,7 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob results from floating-point arithmetic. The lesson to remember is that floating-point arithmetic is always more complex than arithmetic using pencil and paper. In order to take advantage of - the power of computer floating point, you need to know its + the power of floating-point arithmetic, you need to know its limitations and work within them. For most casual use of floating-point arithmetic, you will often get the expected result if you simply round the display of your final results to the @@ -34865,171 +34860,171 @@ Node: Limitations872342 Node: Debugging Summary874457 Node: Arbitrary Precision Arithmetic875631 Node: Computer Arithmetic877047 -Ref: table-numeric-ranges880645 -Ref: Computer Arithmetic-Footnote-1881504 -Node: Math Definitions881561 -Ref: table-ieee-formats884849 -Ref: Math Definitions-Footnote-1885453 -Node: MPFR features885558 -Node: FP Math Caution887229 -Ref: FP Math Caution-Footnote-1888279 -Node: Inexactness of computations888648 -Node: Inexact representation889607 -Node: Comparing FP Values890964 -Node: Errors accumulate892046 -Node: Getting Accuracy893479 -Node: Try To Round896141 -Node: Setting precision897040 -Ref: table-predefined-precision-strings897724 -Node: Setting the rounding mode899513 -Ref: table-gawk-rounding-modes899877 -Ref: Setting the rounding mode-Footnote-1903332 -Node: Arbitrary Precision Integers903511 -Ref: Arbitrary Precision Integers-Footnote-1906497 -Node: POSIX Floating Point Problems906646 -Ref: POSIX Floating Point Problems-Footnote-1910519 -Node: Floating point summary910557 -Node: Dynamic Extensions912751 -Node: Extension Intro914303 -Node: Plugin License915569 -Node: Extension Mechanism Outline916366 -Ref: figure-load-extension916794 -Ref: figure-register-new-function918274 -Ref: figure-call-new-function919278 -Node: Extension API Description921264 -Node: Extension API Functions Introduction922714 -Node: General Data Types927538 -Ref: General Data Types-Footnote-1933277 -Node: Memory Allocation Functions933576 -Ref: Memory Allocation Functions-Footnote-1936415 -Node: Constructor Functions936511 -Node: Registration Functions938245 -Node: Extension Functions938930 -Node: Exit Callback Functions941227 -Node: Extension Version String942475 -Node: Input Parsers943140 -Node: Output Wrappers953019 -Node: Two-way processors957534 -Node: Printing Messages959738 -Ref: Printing Messages-Footnote-1960814 -Node: Updating `ERRNO'960966 -Node: Requesting Values961706 -Ref: table-value-types-returned962434 -Node: Accessing Parameters963391 -Node: Symbol Table Access964622 -Node: Symbol table by name965136 -Node: Symbol table by cookie967117 -Ref: Symbol table by cookie-Footnote-1971261 -Node: Cached values971324 -Ref: Cached values-Footnote-1974823 -Node: Array Manipulation974914 -Ref: Array Manipulation-Footnote-1976012 -Node: Array Data Types976049 -Ref: Array Data Types-Footnote-1978704 -Node: Array Functions978796 -Node: Flattening Arrays982650 -Node: Creating Arrays989542 -Node: Extension API Variables994313 -Node: Extension Versioning994949 -Node: Extension API Informational Variables996850 -Node: Extension API Boilerplate997915 -Node: Finding Extensions1001724 -Node: Extension Example1002284 -Node: Internal File Description1003056 -Node: Internal File Ops1007123 -Ref: Internal File Ops-Footnote-11018793 -Node: Using Internal File Ops1018933 -Ref: Using Internal File Ops-Footnote-11021316 -Node: Extension Samples1021589 -Node: Extension Sample File Functions1023115 -Node: Extension Sample Fnmatch1030753 -Node: Extension Sample Fork1032244 -Node: Extension Sample Inplace1033459 -Node: Extension Sample Ord1035134 -Node: Extension Sample Readdir1035970 -Ref: table-readdir-file-types1036846 -Node: Extension Sample Revout1037657 -Node: Extension Sample Rev2way1038247 -Node: Extension Sample Read write array1038987 -Node: Extension Sample Readfile1040927 -Node: Extension Sample Time1042022 -Node: Extension Sample API Tests1043371 -Node: gawkextlib1043862 -Node: Extension summary1046520 -Node: Extension Exercises1050209 -Node: Language History1050931 -Node: V7/SVR3.11052587 -Node: SVR41054768 -Node: POSIX1056213 -Node: BTL1057602 -Node: POSIX/GNU1058336 -Node: Feature History1063900 -Node: Common Extensions1076998 -Node: Ranges and Locales1078322 -Ref: Ranges and Locales-Footnote-11082940 -Ref: Ranges and Locales-Footnote-21082967 -Ref: Ranges and Locales-Footnote-31083201 -Node: Contributors1083422 -Node: History summary1088963 -Node: Installation1090333 -Node: Gawk Distribution1091279 -Node: Getting1091763 -Node: Extracting1092586 -Node: Distribution contents1094221 -Node: Unix Installation1099938 -Node: Quick Installation1100555 -Node: Additional Configuration Options1102979 -Node: Configuration Philosophy1104717 -Node: Non-Unix Installation1107086 -Node: PC Installation1107544 -Node: PC Binary Installation1108863 -Node: PC Compiling1110711 -Ref: PC Compiling-Footnote-11113732 -Node: PC Testing1113841 -Node: PC Using1115017 -Node: Cygwin1119132 -Node: MSYS1119955 -Node: VMS Installation1120455 -Node: VMS Compilation1121247 -Ref: VMS Compilation-Footnote-11122469 -Node: VMS Dynamic Extensions1122527 -Node: VMS Installation Details1124211 -Node: VMS Running1126463 -Node: VMS GNV1129299 -Node: VMS Old Gawk1130033 -Node: Bugs1130503 -Node: Other Versions1134386 -Node: Installation summary1140810 -Node: Notes1141866 -Node: Compatibility Mode1142731 -Node: Additions1143513 -Node: Accessing The Source1144438 -Node: Adding Code1145873 -Node: New Ports1152030 -Node: Derived Files1156512 -Ref: Derived Files-Footnote-11161987 -Ref: Derived Files-Footnote-21162021 -Ref: Derived Files-Footnote-31162617 -Node: Future Extensions1162731 -Node: Implementation Limitations1163337 -Node: Extension Design1164585 -Node: Old Extension Problems1165739 -Ref: Old Extension Problems-Footnote-11167256 -Node: Extension New Mechanism Goals1167313 -Ref: Extension New Mechanism Goals-Footnote-11170673 -Node: Extension Other Design Decisions1170862 -Node: Extension Future Growth1172970 -Node: Old Extension Mechanism1173806 -Node: Notes summary1175568 -Node: Basic Concepts1176754 -Node: Basic High Level1177435 -Ref: figure-general-flow1177707 -Ref: figure-process-flow1178306 -Ref: Basic High Level-Footnote-11181535 -Node: Basic Data Typing1181720 -Node: Glossary1185048 -Node: Copying1216977 -Node: GNU Free Documentation License1254533 -Node: Index1279669 +Ref: table-numeric-ranges880646 +Ref: Computer Arithmetic-Footnote-1881170 +Node: Math Definitions881227 +Ref: table-ieee-formats884522 +Ref: Math Definitions-Footnote-1885126 +Node: MPFR features885231 +Node: FP Math Caution886902 +Ref: FP Math Caution-Footnote-1887952 +Node: Inexactness of computations888321 +Node: Inexact representation889280 +Node: Comparing FP Values890638 +Node: Errors accumulate891720 +Node: Getting Accuracy893152 +Node: Try To Round895856 +Node: Setting precision896755 +Ref: table-predefined-precision-strings897439 +Node: Setting the rounding mode899268 +Ref: table-gawk-rounding-modes899632 +Ref: Setting the rounding mode-Footnote-1903084 +Node: Arbitrary Precision Integers903263 +Ref: Arbitrary Precision Integers-Footnote-1906247 +Node: POSIX Floating Point Problems906396 +Ref: POSIX Floating Point Problems-Footnote-1910275 +Node: Floating point summary910313 +Node: Dynamic Extensions912509 +Node: Extension Intro914061 +Node: Plugin License915327 +Node: Extension Mechanism Outline916124 +Ref: figure-load-extension916552 +Ref: figure-register-new-function918032 +Ref: figure-call-new-function919036 +Node: Extension API Description921022 +Node: Extension API Functions Introduction922472 +Node: General Data Types927296 +Ref: General Data Types-Footnote-1933035 +Node: Memory Allocation Functions933334 +Ref: Memory Allocation Functions-Footnote-1936173 +Node: Constructor Functions936269 +Node: Registration Functions938003 +Node: Extension Functions938688 +Node: Exit Callback Functions940985 +Node: Extension Version String942233 +Node: Input Parsers942898 +Node: Output Wrappers952777 +Node: Two-way processors957292 +Node: Printing Messages959496 +Ref: Printing Messages-Footnote-1960572 +Node: Updating `ERRNO'960724 +Node: Requesting Values961464 +Ref: table-value-types-returned962192 +Node: Accessing Parameters963149 +Node: Symbol Table Access964380 +Node: Symbol table by name964894 +Node: Symbol table by cookie966875 +Ref: Symbol table by cookie-Footnote-1971019 +Node: Cached values971082 +Ref: Cached values-Footnote-1974581 +Node: Array Manipulation974672 +Ref: Array Manipulation-Footnote-1975770 +Node: Array Data Types975807 +Ref: Array Data Types-Footnote-1978462 +Node: Array Functions978554 +Node: Flattening Arrays982408 +Node: Creating Arrays989300 +Node: Extension API Variables994071 +Node: Extension Versioning994707 +Node: Extension API Informational Variables996608 +Node: Extension API Boilerplate997673 +Node: Finding Extensions1001482 +Node: Extension Example1002042 +Node: Internal File Description1002814 +Node: Internal File Ops1006881 +Ref: Internal File Ops-Footnote-11018551 +Node: Using Internal File Ops1018691 +Ref: Using Internal File Ops-Footnote-11021074 +Node: Extension Samples1021347 +Node: Extension Sample File Functions1022873 +Node: Extension Sample Fnmatch1030511 +Node: Extension Sample Fork1032002 +Node: Extension Sample Inplace1033217 +Node: Extension Sample Ord1034892 +Node: Extension Sample Readdir1035728 +Ref: table-readdir-file-types1036604 +Node: Extension Sample Revout1037415 +Node: Extension Sample Rev2way1038005 +Node: Extension Sample Read write array1038745 +Node: Extension Sample Readfile1040685 +Node: Extension Sample Time1041780 +Node: Extension Sample API Tests1043129 +Node: gawkextlib1043620 +Node: Extension summary1046278 +Node: Extension Exercises1049967 +Node: Language History1050689 +Node: V7/SVR3.11052345 +Node: SVR41054526 +Node: POSIX1055971 +Node: BTL1057360 +Node: POSIX/GNU1058094 +Node: Feature History1063658 +Node: Common Extensions1076756 +Node: Ranges and Locales1078080 +Ref: Ranges and Locales-Footnote-11082698 +Ref: Ranges and Locales-Footnote-21082725 +Ref: Ranges and Locales-Footnote-31082959 +Node: Contributors1083180 +Node: History summary1088721 +Node: Installation1090091 +Node: Gawk Distribution1091037 +Node: Getting1091521 +Node: Extracting1092344 +Node: Distribution contents1093979 +Node: Unix Installation1099696 +Node: Quick Installation1100313 +Node: Additional Configuration Options1102737 +Node: Configuration Philosophy1104475 +Node: Non-Unix Installation1106844 +Node: PC Installation1107302 +Node: PC Binary Installation1108621 +Node: PC Compiling1110469 +Ref: PC Compiling-Footnote-11113490 +Node: PC Testing1113599 +Node: PC Using1114775 +Node: Cygwin1118890 +Node: MSYS1119713 +Node: VMS Installation1120213 +Node: VMS Compilation1121005 +Ref: VMS Compilation-Footnote-11122227 +Node: VMS Dynamic Extensions1122285 +Node: VMS Installation Details1123969 +Node: VMS Running1126221 +Node: VMS GNV1129057 +Node: VMS Old Gawk1129791 +Node: Bugs1130261 +Node: Other Versions1134144 +Node: Installation summary1140568 +Node: Notes1141624 +Node: Compatibility Mode1142489 +Node: Additions1143271 +Node: Accessing The Source1144196 +Node: Adding Code1145631 +Node: New Ports1151788 +Node: Derived Files1156270 +Ref: Derived Files-Footnote-11161745 +Ref: Derived Files-Footnote-21161779 +Ref: Derived Files-Footnote-31162375 +Node: Future Extensions1162489 +Node: Implementation Limitations1163095 +Node: Extension Design1164343 +Node: Old Extension Problems1165497 +Ref: Old Extension Problems-Footnote-11167014 +Node: Extension New Mechanism Goals1167071 +Ref: Extension New Mechanism Goals-Footnote-11170431 +Node: Extension Other Design Decisions1170620 +Node: Extension Future Growth1172728 +Node: Old Extension Mechanism1173564 +Node: Notes summary1175326 +Node: Basic Concepts1176512 +Node: Basic High Level1177193 +Ref: figure-general-flow1177465 +Ref: figure-process-flow1178064 +Ref: Basic High Level-Footnote-11181293 +Node: Basic Data Typing1181478 +Node: Glossary1184806 +Node: Copying1216735 +Node: GNU Free Documentation License1254291 +Node: Index1279427  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index ed7f4610..8cb24eaa 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -30134,7 +30134,7 @@ paper and pencil (and/or a calculator). In theory, numbers can have an arbitrary number of digits on either side (or both sides) of the decimal point, and the results of a computation are always exact. -Some modern system can do decimal arithmetic in hardware, but usually you +Some modern systems can do decimal arithmetic in hardware, but usually you need a special software library to provide access to these instructions. There are also libraries that do decimal arithmetic entirely in software. @@ -30190,8 +30190,34 @@ signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. @item 32-bit unsigned integer @tab 0 @tab 4,294,967,295 @item 64-bit signed integer @tab @minus{}9,223,372,036,854,775,808 @tab 9,223,372,036,854,775,807 @item 64-bit unsigned integer @tab 0 @tab 18,446,744,073,709,551,615 -@item Single-precision floating point (approximate) @tab @code{1.175494e-38} @tab @code{3.402823e+38} -@item Double-precision floating point (approximate) @tab @code{2.225074e-308} @tab @code{1.797693e+308} +@iftex +@item Single-precision floating point (approximate) @tab @math{1.175494^{-38}} @tab @math{3.402823^{38}} +@item Double-precision floating point (approximate) @tab @math{2.225074^{-308}} @tab @math{1.797693^{308}} +@end iftex +@ifnottex +@ifnotdocbook +@item Single-precision floating point (approximate) @tab 1.175494e-38 @tab 3.402823e38 +@item Double-precision floating point (approximate) @tab 2.225074e-308 @tab 1.797693e308 +@end ifnotdocbook +@end ifnottex +@ifdocbook +@item Single-precision floating point (approximate) @tab +@docbook +1.175494-38 +@end docbook +@tab +@docbook +3.40282338 +@end docbook +@item Double-precision floating point (approximate) @tab +@docbook +2.225074-308 +@end docbook +@tab +@docbook +1.797693308 +@end docbook +@end ifdocbook @end multitable @end float @@ -30200,7 +30226,7 @@ signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. The rest of this @value{CHAPTER} uses a number of terms. Here are some informal definitions that should help you work your way through the material -here. +here: @table @dfn @item Accuracy @@ -30221,7 +30247,7 @@ A special value representing infinity. Operations involving another number and infinity produce infinity. @item NaN -``Not A Number.''@footnote{Thanks to Michael Brennan for this description, +``Not a number.''@footnote{Thanks to Michael Brennan for this description, which we have paraphrased, and for the examples.} A special value that results from attempting a calculation that has no answer as a real number. In such a case, programs can either receive a floating-point exception, @@ -30264,8 +30290,8 @@ formula: @end display @noindent -Here, @var{prec} denotes the binary precision -(measured in bits) and @var{dps} (short for decimal places) +Here, @emph{prec} denotes the binary precision +(measured in bits) and @emph{dps} (short for decimal places) is the decimal digits. @item Rounding mode @@ -30273,7 +30299,7 @@ How numbers are rounded up or down when necessary. More details are provided later. @item Significand -A floating-point value consists the significand multiplied by 10 +A floating-point value consists of the significand multiplied by 10 to the power of the exponent. For example, in @code{1.2345e67}, the significand is @code{1.2345}. @@ -30297,7 +30323,7 @@ to allow greater precisions and larger exponent ranges. (@command{awk} uses only the 64-bit double-precision format.) @ref{table-ieee-formats} lists the precision and exponent -field values for the basic IEEE 754 binary formats: +field values for the basic IEEE 754 binary formats. @float Table,table-ieee-formats @caption{Basic IEEE format values} @@ -30361,12 +30387,12 @@ for more information. @author Teen Talk Barbie, July 1992 @end quotation -This @value{SECTION} provides a high level overview of the issues +This @value{SECTION} provides a high-level overview of the issues involved when doing lots of floating-point arithmetic.@footnote{There is a very nice @uref{http://www.validlab.com/goldberg/paper.pdf, paper on floating-point arithmetic} by David Goldberg, ``What Every -Computer Scientist Should Know About Floating-point Arithmetic,'' -@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03), 5-48. This is +Computer Scientist Should Know About Floating-Point Arithmetic,'' +@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03): 5-48. This is worth reading if you are interested in the details, but it does require a background in computer science.} The discussion applies to both hardware and arbitrary-precision @@ -30435,7 +30461,7 @@ $ @kbd{gawk 'BEGIN @{ x = 0.875; y = 0.425} Often the error is so small you do not even notice it, and if you do, you can always specify how much precision you would like in your output. -Usually this is a format string like @code{"%.15g"}, which when +Usually this is a format string like @code{"%.15g"}, which, when used in the previous example, produces an output identical to the input. @node Comparing FP Values @@ -30474,7 +30500,7 @@ else The loss of accuracy during a single computation with floating-point numbers usually isn't enough to worry about. However, if you compute a -value which is the result of a sequence of floating-point operations, +value that is the result of a sequence of floating-point operations, the error can accumulate and greatly affect the computation itself. Here is an attempt to compute the value of @value{PI} using one of its many series representations: @@ -30527,7 +30553,7 @@ no easy answers. The standard rules of algebra often do not apply when using floating-point arithmetic. Among other things, the distributive and associative laws do not hold completely, and order of operation may be important -for your computation. Rounding error, cumulative precision loss +for your computation. Rounding error, cumulative precision loss, and underflow are often troublesome. When @command{gawk} tests the expressions @samp{0.1 + 12.2} and @@ -30567,7 +30593,8 @@ by our earlier attempt to compute the value of @value{PI}. Extra precision can greatly enhance the stability and the accuracy of your computation in such cases. -Repeated addition is not necessarily equivalent to multiplication +Additionally, you should understand that +repeated addition is not necessarily equivalent to multiplication in floating-point arithmetic. In the example in @ref{Errors accumulate}: @@ -30630,7 +30657,7 @@ to emulate an IEEE 754 binary format. @float Table,table-predefined-precision-strings @caption{Predefined precision strings for @code{PREC}} @multitable {@code{"double"}} {12345678901234567890123456789012345} -@headitem @code{PREC} @tab IEEE 754 Binary Format +@headitem @code{PREC} @tab IEEE 754 binary format @item @code{"half"} @tab 16-bit half-precision @item @code{"single"} @tab Basic 32-bit single precision @item @code{"double"} @tab Basic 64-bit double precision @@ -30662,7 +30689,6 @@ than the default and cannot use a command-line assignment to @code{PREC}, you should either specify the constant as a string, or as a rational number, whenever possible. The following example illustrates the differences among various ways to print a floating-point constant: -@end quotation @example $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 0.1) @}'} @@ -30674,22 +30700,23 @@ $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", "0.1") @}'} $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 1/10) @}'} @print{} 0.1000000000000000000000000 @end example +@end quotation @node Setting the rounding mode @subsection Setting the Rounding Mode The @code{ROUNDMODE} variable provides -program level control over the rounding mode. +program-level control over the rounding mode. The correspondence between @code{ROUNDMODE} and the IEEE rounding modes is shown in @ref{table-gawk-rounding-modes}. @float Table,table-gawk-rounding-modes @caption{@command{gawk} rounding modes} @multitable @columnfractions .45 .30 .25 -@headitem Rounding Mode @tab IEEE Name @tab @code{ROUNDMODE} +@headitem Rounding mode @tab IEEE name @tab @code{ROUNDMODE} @item Round to nearest, ties to even @tab @code{roundTiesToEven} @tab @code{"N"} or @code{"n"} -@item Round toward plus Infinity @tab @code{roundTowardPositive} @tab @code{"U"} or @code{"u"} -@item Round toward negative Infinity @tab @code{roundTowardNegative} @tab @code{"D"} or @code{"d"} +@item Round toward positive infinity @tab @code{roundTowardPositive} @tab @code{"U"} or @code{"u"} +@item Round toward negative infinity @tab @code{roundTowardNegative} @tab @code{"D"} or @code{"d"} @item Round toward zero @tab @code{roundTowardZero} @tab @code{"Z"} or @code{"z"} @item Round to nearest, ties away from zero @tab @code{roundTiesToAway} @tab @code{"A"} or @code{"a"} @end multitable @@ -30750,8 +30777,8 @@ distributes upward and downward rounds of exact halves, which might cause any accumulating round-off error to cancel itself out. This is the default rounding mode for IEEE 754 computing functions and operators. -The other rounding modes are rarely used. Round toward positive infinity -(@code{roundTowardPositive}) and round toward negative infinity +The other rounding modes are rarely used. Rounding toward positive infinity +(@code{roundTowardPositive}) and toward negative infinity (@code{roundTowardNegative}) are often used to implement interval arithmetic, where you adjust the rounding mode to calculate upper and lower bounds for the range of output. The @code{roundTowardZero} mode can @@ -30808,17 +30835,17 @@ If instead you were to compute the same value using arbitrary-precision floating-point values, the precision needed for correct output (using the formula @iftex -@math{prec = 3.322 @cdot dps}), +@math{prec = 3.322 @cdot dps}) would be @math{3.322 @cdot 183231}, @end iftex @ifnottex @ifnotdocbook -@samp{prec = 3.322 * dps}), +@samp{prec = 3.322 * dps}) would be 3.322 x 183231, @end ifnotdocbook @end ifnottex @docbook -prec = 3.322 ⋅ dps), +prec = 3.322 ⋅ dps) would be prec = 3.322 ⋅ 183231, @c @end docbook @@ -30856,7 +30883,7 @@ interface to process arbitrary-precision integers or mixed-mode numbers as needed by an operation or function. In such a case, the precision is set to the minimum value necessary for exact conversion, and the working precision is not used for this purpose. If this is not what you need or -want, you can employ a subterfuge, and convert the integer to floating +want, you can employ a subterfuge and convert the integer to floating point first, like this: @example @@ -30880,7 +30907,7 @@ gawk -M 'BEGIN @{ n = 13; print n % 2 @}' @node POSIX Floating Point Problems @section Standards Versus Existing Practice -Historically, @command{awk} has converted any non-numeric looking string +Historically, @command{awk} has converted any nonnumeric-looking string to the numeric value zero, when required. Furthermore, the original definition of the language and the original POSIX standards specified that @command{awk} only understands decimal numbers (base 10), and not octal @@ -30897,8 +30924,8 @@ notation (e.g., @code{0xDEADBEEF}). (Note: data values, @emph{not} source code constants.) @item -Support for the special IEEE 754 floating-point values ``Not A Number'' -(NaN), positive Infinity (``inf''), and negative Infinity (``@minus{}inf''). +Support for the special IEEE 754 floating-point values ``not a number'' +(NaN), positive infinity (``inf''), and negative infinity (``@minus{}inf''). In particular, the format for these values is as specified by the ISO 1999 C standard, which ignores case and can allow implementation-dependent additional characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}. @@ -30919,21 +30946,21 @@ values is also a very severe departure from historical practice. @end itemize The second problem is that the @command{gawk} maintainer feels that this -interpretation of the standard, which requires a certain amount of +interpretation of the standard, which required 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 +intended by the standard developers. In other words, ``We see how you got where you are, but we don't think that that's where you want to be.'' Recognizing these issues, but attempting to provide compatibility with the earlier versions of the standard, the 2008 POSIX standard added explicit wording to allow, but not require, that @command{awk} support hexadecimal floating-point values and -special values for ``Not A Number'' and infinity. +special values for ``not a number'' and infinity. Although the @command{gawk} maintainer continues to feel that providing those features is inadvisable, nevertheless, on systems that support IEEE floating point, it seems -reasonable to provide @emph{some} way to support NaN and Infinity values. +reasonable to provide @emph{some} way to support NaN and infinity values. The solution implemented in @command{gawk} is as follows: @itemize @value{BULLET} @@ -30953,7 +30980,7 @@ $ @kbd{echo 0xDeadBeef | gawk --posix '@{ print $1 + 0 @}'} @end example @item -Without @option{--posix}, @command{gawk} interprets the four strings +Without @option{--posix}, @command{gawk} interprets the four string values @samp{+inf}, @samp{-inf}, @samp{+nan}, @@ -30975,7 +31002,7 @@ $ @kbd{echo 0xDeadBeef | gawk '@{ print $1 + 0 @}'} @end example @command{gawk} ignores case in the four special values. -Thus @samp{+nan} and @samp{+NaN} are the same. +Thus, @samp{+nan} and @samp{+NaN} are the same. @end itemize @node Floating point summary @@ -30988,9 +31015,9 @@ values. Standard @command{awk} uses double-precision floating-point values. @item -In the early 1990s, Barbie mistakenly said ``Math class is tough!'' +In the early 1990s Barbie mistakenly said, ``Math class is tough!'' Although math isn't tough, floating-point arithmetic isn't the same -as pencil and paper math, and care must be taken: +as pencil-and-paper math, and care must be taken: @c nested list @itemize @value{MINUS} @@ -31023,7 +31050,7 @@ arithmetic. Use @code{PREC} to set the precision in bits, and @item With @option{-M}, @command{gawk} performs arbitrary-precision integer arithmetic using the GMP library. -This is faster and more space efficient than using MPFR for +This is faster and more space-efficient than using MPFR for the same calculations. @item @@ -31035,7 +31062,7 @@ It pays to be aware of them. Overall, there is no need to be unduly suspicious about the results from floating-point arithmetic. The lesson to remember is that floating-point arithmetic is always more complex than arithmetic using pencil and -paper. In order to take advantage of the power of computer floating point, +paper. In order to take advantage of the power of floating-point arithmetic, you need to know its limitations and work within them. For most casual use of floating-point arithmetic, you will often get the expected result if you simply round the display of your final results to the correct number diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 1156ffd5..7c229020 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -29225,7 +29225,7 @@ paper and pencil (and/or a calculator). In theory, numbers can have an arbitrary number of digits on either side (or both sides) of the decimal point, and the results of a computation are always exact. -Some modern system can do decimal arithmetic in hardware, but usually you +Some modern systems can do decimal arithmetic in hardware, but usually you need a special software library to provide access to these instructions. There are also libraries that do decimal arithmetic entirely in software. @@ -29281,8 +29281,34 @@ signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. @item 32-bit unsigned integer @tab 0 @tab 4,294,967,295 @item 64-bit signed integer @tab @minus{}9,223,372,036,854,775,808 @tab 9,223,372,036,854,775,807 @item 64-bit unsigned integer @tab 0 @tab 18,446,744,073,709,551,615 -@item Single-precision floating point (approximate) @tab @code{1.175494e-38} @tab @code{3.402823e+38} -@item Double-precision floating point (approximate) @tab @code{2.225074e-308} @tab @code{1.797693e+308} +@iftex +@item Single-precision floating point (approximate) @tab @math{1.175494^{-38}} @tab @math{3.402823^{38}} +@item Double-precision floating point (approximate) @tab @math{2.225074^{-308}} @tab @math{1.797693^{308}} +@end iftex +@ifnottex +@ifnotdocbook +@item Single-precision floating point (approximate) @tab 1.175494e-38 @tab 3.402823e38 +@item Double-precision floating point (approximate) @tab 2.225074e-308 @tab 1.797693e308 +@end ifnotdocbook +@end ifnottex +@ifdocbook +@item Single-precision floating point (approximate) @tab +@docbook +1.175494-38 +@end docbook +@tab +@docbook +3.40282338 +@end docbook +@item Double-precision floating point (approximate) @tab +@docbook +2.225074-308 +@end docbook +@tab +@docbook +1.797693308 +@end docbook +@end ifdocbook @end multitable @end float @@ -29291,7 +29317,7 @@ signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. The rest of this @value{CHAPTER} uses a number of terms. Here are some informal definitions that should help you work your way through the material -here. +here: @table @dfn @item Accuracy @@ -29312,7 +29338,7 @@ A special value representing infinity. Operations involving another number and infinity produce infinity. @item NaN -``Not A Number.''@footnote{Thanks to Michael Brennan for this description, +``Not a number.''@footnote{Thanks to Michael Brennan for this description, which we have paraphrased, and for the examples.} A special value that results from attempting a calculation that has no answer as a real number. In such a case, programs can either receive a floating-point exception, @@ -29355,8 +29381,8 @@ formula: @end display @noindent -Here, @var{prec} denotes the binary precision -(measured in bits) and @var{dps} (short for decimal places) +Here, @emph{prec} denotes the binary precision +(measured in bits) and @emph{dps} (short for decimal places) is the decimal digits. @item Rounding mode @@ -29364,7 +29390,7 @@ How numbers are rounded up or down when necessary. More details are provided later. @item Significand -A floating-point value consists the significand multiplied by 10 +A floating-point value consists of the significand multiplied by 10 to the power of the exponent. For example, in @code{1.2345e67}, the significand is @code{1.2345}. @@ -29388,7 +29414,7 @@ to allow greater precisions and larger exponent ranges. (@command{awk} uses only the 64-bit double-precision format.) @ref{table-ieee-formats} lists the precision and exponent -field values for the basic IEEE 754 binary formats: +field values for the basic IEEE 754 binary formats. @float Table,table-ieee-formats @caption{Basic IEEE format values} @@ -29452,12 +29478,12 @@ for more information. @author Teen Talk Barbie, July 1992 @end quotation -This @value{SECTION} provides a high level overview of the issues +This @value{SECTION} provides a high-level overview of the issues involved when doing lots of floating-point arithmetic.@footnote{There is a very nice @uref{http://www.validlab.com/goldberg/paper.pdf, paper on floating-point arithmetic} by David Goldberg, ``What Every -Computer Scientist Should Know About Floating-point Arithmetic,'' -@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03), 5-48. This is +Computer Scientist Should Know About Floating-Point Arithmetic,'' +@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03): 5-48. This is worth reading if you are interested in the details, but it does require a background in computer science.} The discussion applies to both hardware and arbitrary-precision @@ -29526,7 +29552,7 @@ $ @kbd{gawk 'BEGIN @{ x = 0.875; y = 0.425} Often the error is so small you do not even notice it, and if you do, you can always specify how much precision you would like in your output. -Usually this is a format string like @code{"%.15g"}, which when +Usually this is a format string like @code{"%.15g"}, which, when used in the previous example, produces an output identical to the input. @node Comparing FP Values @@ -29565,7 +29591,7 @@ else The loss of accuracy during a single computation with floating-point numbers usually isn't enough to worry about. However, if you compute a -value which is the result of a sequence of floating-point operations, +value that is the result of a sequence of floating-point operations, the error can accumulate and greatly affect the computation itself. Here is an attempt to compute the value of @value{PI} using one of its many series representations: @@ -29618,7 +29644,7 @@ no easy answers. The standard rules of algebra often do not apply when using floating-point arithmetic. Among other things, the distributive and associative laws do not hold completely, and order of operation may be important -for your computation. Rounding error, cumulative precision loss +for your computation. Rounding error, cumulative precision loss, and underflow are often troublesome. When @command{gawk} tests the expressions @samp{0.1 + 12.2} and @@ -29658,7 +29684,8 @@ by our earlier attempt to compute the value of @value{PI}. Extra precision can greatly enhance the stability and the accuracy of your computation in such cases. -Repeated addition is not necessarily equivalent to multiplication +Additionally, you should understand that +repeated addition is not necessarily equivalent to multiplication in floating-point arithmetic. In the example in @ref{Errors accumulate}: @@ -29721,7 +29748,7 @@ to emulate an IEEE 754 binary format. @float Table,table-predefined-precision-strings @caption{Predefined precision strings for @code{PREC}} @multitable {@code{"double"}} {12345678901234567890123456789012345} -@headitem @code{PREC} @tab IEEE 754 Binary Format +@headitem @code{PREC} @tab IEEE 754 binary format @item @code{"half"} @tab 16-bit half-precision @item @code{"single"} @tab Basic 32-bit single precision @item @code{"double"} @tab Basic 64-bit double precision @@ -29753,7 +29780,6 @@ than the default and cannot use a command-line assignment to @code{PREC}, you should either specify the constant as a string, or as a rational number, whenever possible. The following example illustrates the differences among various ways to print a floating-point constant: -@end quotation @example $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 0.1) @}'} @@ -29765,22 +29791,23 @@ $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", "0.1") @}'} $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 1/10) @}'} @print{} 0.1000000000000000000000000 @end example +@end quotation @node Setting the rounding mode @subsection Setting the Rounding Mode The @code{ROUNDMODE} variable provides -program level control over the rounding mode. +program-level control over the rounding mode. The correspondence between @code{ROUNDMODE} and the IEEE rounding modes is shown in @ref{table-gawk-rounding-modes}. @float Table,table-gawk-rounding-modes @caption{@command{gawk} rounding modes} @multitable @columnfractions .45 .30 .25 -@headitem Rounding Mode @tab IEEE Name @tab @code{ROUNDMODE} +@headitem Rounding mode @tab IEEE name @tab @code{ROUNDMODE} @item Round to nearest, ties to even @tab @code{roundTiesToEven} @tab @code{"N"} or @code{"n"} -@item Round toward plus Infinity @tab @code{roundTowardPositive} @tab @code{"U"} or @code{"u"} -@item Round toward negative Infinity @tab @code{roundTowardNegative} @tab @code{"D"} or @code{"d"} +@item Round toward positive infinity @tab @code{roundTowardPositive} @tab @code{"U"} or @code{"u"} +@item Round toward negative infinity @tab @code{roundTowardNegative} @tab @code{"D"} or @code{"d"} @item Round toward zero @tab @code{roundTowardZero} @tab @code{"Z"} or @code{"z"} @item Round to nearest, ties away from zero @tab @code{roundTiesToAway} @tab @code{"A"} or @code{"a"} @end multitable @@ -29841,8 +29868,8 @@ distributes upward and downward rounds of exact halves, which might cause any accumulating round-off error to cancel itself out. This is the default rounding mode for IEEE 754 computing functions and operators. -The other rounding modes are rarely used. Round toward positive infinity -(@code{roundTowardPositive}) and round toward negative infinity +The other rounding modes are rarely used. Rounding toward positive infinity +(@code{roundTowardPositive}) and toward negative infinity (@code{roundTowardNegative}) are often used to implement interval arithmetic, where you adjust the rounding mode to calculate upper and lower bounds for the range of output. The @code{roundTowardZero} mode can @@ -29899,17 +29926,17 @@ If instead you were to compute the same value using arbitrary-precision floating-point values, the precision needed for correct output (using the formula @iftex -@math{prec = 3.322 @cdot dps}), +@math{prec = 3.322 @cdot dps}) would be @math{3.322 @cdot 183231}, @end iftex @ifnottex @ifnotdocbook -@samp{prec = 3.322 * dps}), +@samp{prec = 3.322 * dps}) would be 3.322 x 183231, @end ifnotdocbook @end ifnottex @docbook -prec = 3.322 ⋅ dps), +prec = 3.322 ⋅ dps) would be prec = 3.322 ⋅ 183231, @c @end docbook @@ -29947,7 +29974,7 @@ interface to process arbitrary-precision integers or mixed-mode numbers as needed by an operation or function. In such a case, the precision is set to the minimum value necessary for exact conversion, and the working precision is not used for this purpose. If this is not what you need or -want, you can employ a subterfuge, and convert the integer to floating +want, you can employ a subterfuge and convert the integer to floating point first, like this: @example @@ -29971,7 +29998,7 @@ gawk -M 'BEGIN @{ n = 13; print n % 2 @}' @node POSIX Floating Point Problems @section Standards Versus Existing Practice -Historically, @command{awk} has converted any non-numeric looking string +Historically, @command{awk} has converted any nonnumeric-looking string to the numeric value zero, when required. Furthermore, the original definition of the language and the original POSIX standards specified that @command{awk} only understands decimal numbers (base 10), and not octal @@ -29988,8 +30015,8 @@ notation (e.g., @code{0xDEADBEEF}). (Note: data values, @emph{not} source code constants.) @item -Support for the special IEEE 754 floating-point values ``Not A Number'' -(NaN), positive Infinity (``inf''), and negative Infinity (``@minus{}inf''). +Support for the special IEEE 754 floating-point values ``not a number'' +(NaN), positive infinity (``inf''), and negative infinity (``@minus{}inf''). In particular, the format for these values is as specified by the ISO 1999 C standard, which ignores case and can allow implementation-dependent additional characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}. @@ -30010,21 +30037,21 @@ values is also a very severe departure from historical practice. @end itemize The second problem is that the @command{gawk} maintainer feels that this -interpretation of the standard, which requires a certain amount of +interpretation of the standard, which required 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 +intended by the standard developers. In other words, ``We see how you got where you are, but we don't think that that's where you want to be.'' Recognizing these issues, but attempting to provide compatibility with the earlier versions of the standard, the 2008 POSIX standard added explicit wording to allow, but not require, that @command{awk} support hexadecimal floating-point values and -special values for ``Not A Number'' and infinity. +special values for ``not a number'' and infinity. Although the @command{gawk} maintainer continues to feel that providing those features is inadvisable, nevertheless, on systems that support IEEE floating point, it seems -reasonable to provide @emph{some} way to support NaN and Infinity values. +reasonable to provide @emph{some} way to support NaN and infinity values. The solution implemented in @command{gawk} is as follows: @itemize @value{BULLET} @@ -30044,7 +30071,7 @@ $ @kbd{echo 0xDeadBeef | gawk --posix '@{ print $1 + 0 @}'} @end example @item -Without @option{--posix}, @command{gawk} interprets the four strings +Without @option{--posix}, @command{gawk} interprets the four string values @samp{+inf}, @samp{-inf}, @samp{+nan}, @@ -30066,7 +30093,7 @@ $ @kbd{echo 0xDeadBeef | gawk '@{ print $1 + 0 @}'} @end example @command{gawk} ignores case in the four special values. -Thus @samp{+nan} and @samp{+NaN} are the same. +Thus, @samp{+nan} and @samp{+NaN} are the same. @end itemize @node Floating point summary @@ -30079,9 +30106,9 @@ values. Standard @command{awk} uses double-precision floating-point values. @item -In the early 1990s, Barbie mistakenly said ``Math class is tough!'' +In the early 1990s Barbie mistakenly said, ``Math class is tough!'' Although math isn't tough, floating-point arithmetic isn't the same -as pencil and paper math, and care must be taken: +as pencil-and-paper math, and care must be taken: @c nested list @itemize @value{MINUS} @@ -30114,7 +30141,7 @@ arithmetic. Use @code{PREC} to set the precision in bits, and @item With @option{-M}, @command{gawk} performs arbitrary-precision integer arithmetic using the GMP library. -This is faster and more space efficient than using MPFR for +This is faster and more space-efficient than using MPFR for the same calculations. @item @@ -30126,7 +30153,7 @@ It pays to be aware of them. Overall, there is no need to be unduly suspicious about the results from floating-point arithmetic. The lesson to remember is that floating-point arithmetic is always more complex than arithmetic using pencil and -paper. In order to take advantage of the power of computer floating point, +paper. In order to take advantage of the power of floating-point arithmetic, you need to know its limitations and work within them. For most casual use of floating-point arithmetic, you will often get the expected result if you simply round the display of your final results to the correct number -- cgit v1.2.3 From f2e05556f6962e41556c4abb0acc900c82acc672 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 9 Feb 2015 22:56:29 +0200 Subject: Continue O'Reilly edits. --- doc/ChangeLog | 4 + doc/gawk.info | 801 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 28 +- doc/gawktexi.in | 28 +- 4 files changed, 438 insertions(+), 423 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 319ecb2f..b6de5797 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-09 Arnold D. Robbins + + * gawktexi.in: Restore a lost sentence. O'Reilly fixes. + 2015-02-08 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index c56ac89c..bf573a8a 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -9071,9 +9071,10 @@ accepts any record with a first field that contains `li': -| 555-5553 -| 555-6699 - pattern. The expression `/li/' has the value one if `li' appears in -the current input record. Thus, as a pattern, `/li/' matches any record -containing `li'. + A regexp constant as a pattern is also a special case of an +expression pattern. The expression `/li/' has the value one if `li' +appears in the current input record. Thus, as a pattern, `/li/' matches +any record containing `li'. Boolean expressions are also commonly used as patterns. Whether the pattern matches an input record depends on whether its subexpressions @@ -22636,7 +22637,7 @@ the rest of this Info file. `gawk''s functionality. For example, they can provide access to system calls (such as `chdir()' to change directory) and to other C library routines that could be of use. As with most software, "the sky is the -limit;" if you can imagine something that you might want to do and can +limit"; if you can imagine something that you might want to do and can write in C or C++, you can write an extension to do it! Extensions are written in C or C++, using the "application @@ -22644,7 +22645,7 @@ programming interface" (API) defined for this purpose by the `gawk' developers. The rest of this major node explains the facilities that the API provides and how to use them, and presents a small example extension. In addition, it documents the sample extensions included in -the `gawk' distribution, and describes the `gawkextlib' project. *Note +the `gawk' distribution and describes the `gawkextlib' project. *Note Extension Design::, for a discussion of the extension mechanism goals and design. @@ -22762,7 +22763,7 @@ Example::) and also in the `testext.c' code for testing the APIs. Some other bits and pieces: * The API provides access to `gawk''s `do_XXX' values, reflecting - command-line options, like `do_lint', `do_profiling' and so on + command-line options, like `do_lint', `do_profiling', and so on (*note Extension API Variables::). These are informational: an extension cannot affect their values inside `gawk'. In addition, attempting to assign to them produces a compile-time error. @@ -22808,8 +22809,8 @@ File: gawk.info, Node: Extension API Functions Introduction, Next: General Dat 16.4.1 Introduction ------------------- -Access to facilities within `gawk' are made available by calling -through function pointers passed into your extension. +Access to facilities within `gawk' is achieved by calling through +function pointers passed into your extension. API function pointers are provided for the following kinds of operations: @@ -22830,7 +22831,7 @@ operations: - Two-way processors - All of these are discussed in detail, later in this major node. + All of these are discussed in detail later in this major node. * Printing fatal, warning, and "lint" warning messages. @@ -22856,7 +22857,7 @@ operations: - Clearing an array - - Flattening an array for easy C style looping over all its + - Flattening an array for easy C-style looping over all its indices and elements Some points about using the API: @@ -22865,7 +22866,7 @@ operations: `gawkapi.h'. For correct use, you must therefore include the corresponding standard header file _before_ including `gawkapi.h': - C Entity Header File + C entity Header file ------------------------------------------- `EOF' `' Values for `errno' `' @@ -22889,13 +22890,13 @@ operations: * Although the API only uses ISO C 90 features, there is an exception; the "constructor" functions use the `inline' keyword. If your compiler does not support this keyword, you should either - place `-Dinline=''' on your command line, or use the GNU Autotools + place `-Dinline=''' on your command line or use the GNU Autotools and include a `config.h' file in your extensions. * All pointers filled in by `gawk' point to memory managed by `gawk' and should be treated by the extension as read-only. Memory for _all_ strings passed into `gawk' from the extension _must_ come - from calling one of `gawk_malloc()', `gawk_calloc()' or + from calling one of `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()', and is managed by `gawk' from then on. * The API defines several simple `struct's that map values as seen @@ -22908,7 +22909,7 @@ operations: multibyte encoding (as defined by `LC_XXX' environment variables) and not using wide characters. This matches how `gawk' stores strings internally and also how characters are - likely to be input and output from files. + likely to be input into and output from files. * When retrieving a value (such as a parameter or that of a global variable or array element), the extension requests a specific type @@ -22945,6 +22946,8 @@ general-purpose use. Additional, more specialized, data structures are introduced in subsequent minor nodes, together with the functions that use them. + The general-purpose types and structures are as follows: + `typedef void *awk_ext_id_t;' A value of this type is received from `gawk' when an extension is loaded. That value must then be passed back to `gawk' as the @@ -22960,7 +22963,7 @@ use them. ` awk_false = 0,' ` awk_true' `} awk_bool_t;' - A simple boolean type. + A simple Boolean type. `typedef struct awk_string {' ` char *str; /* data */' @@ -23004,8 +23007,8 @@ use them. `#define array_cookie u.a' `#define scalar_cookie u.scl' `#define value_cookie u.vc' - These macros make accessing the fields of the `awk_value_t' more - readable. + Using these macros makes accessing the fields of the `awk_value_t' + more readable. `typedef void *awk_scalar_t;' Scalars can be represented as an opaque type. These values are @@ -31951,7 +31954,7 @@ Index * BEGIN pattern, and profiling: Profiling. (line 62) * BEGIN pattern, assert() user-defined function and: Assert Function. (line 83) -* BEGIN pattern, Boolean patterns and: Expression Patterns. (line 69) +* BEGIN pattern, Boolean patterns and: Expression Patterns. (line 70) * BEGIN pattern, exit statement and: Exit Statement. (line 12) * BEGIN pattern, getline and: Getline Notes. (line 19) * BEGIN pattern, headings, adding: Print Examples. (line 43) @@ -31968,7 +31971,7 @@ Index * BEGIN pattern, TEXTDOMAIN variable and: Programmer i18n. (line 60) * BEGINFILE pattern: BEGINFILE/ENDFILE. (line 6) * BEGINFILE pattern, Boolean patterns and: Expression Patterns. - (line 69) + (line 70) * beginfile() user-defined function: Filetrans Function. (line 62) * Bentley, Jon: Glossary. (line 207) * Benzinger, Michael: Contributors. (line 97) @@ -31994,7 +31997,7 @@ Index * body, in actions: Statements. (line 10) * body, in loops: While Statement. (line 14) * Boolean expressions: Boolean Ops. (line 6) -* Boolean expressions, as patterns: Expression Patterns. (line 38) +* Boolean expressions, as patterns: Expression Patterns. (line 39) * Boolean operators, See Boolean expressions: Boolean Ops. (line 6) * Bourne shell, quoting rules for: Quoting. (line 18) * braces ({}): Profiling. (line 142) @@ -32578,7 +32581,7 @@ Index * END pattern, and profiling: Profiling. (line 62) * END pattern, assert() user-defined function and: Assert Function. (line 75) -* END pattern, Boolean patterns and: Expression Patterns. (line 69) +* END pattern, Boolean patterns and: Expression Patterns. (line 70) * END pattern, exit statement and: Exit Statement. (line 12) * END pattern, next/nextfile statements and <1>: Next Statement. (line 44) @@ -32587,7 +32590,7 @@ Index * END pattern, operators and: Using BEGIN/END. (line 17) * END pattern, print statement and: I/O And BEGIN/END. (line 16) * ENDFILE pattern: BEGINFILE/ENDFILE. (line 6) -* ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 69) +* ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 70) * endfile() user-defined function: Filetrans Function. (line 62) * endgrent() function (C library): Group Functions. (line 212) * endgrent() user-defined function: Group Functions. (line 215) @@ -34649,382 +34652,382 @@ Node: Patterns and Actions384448 Node: Pattern Overview385568 Node: Regexp Patterns387247 Node: Expression Patterns387790 -Node: Ranges391499 -Node: BEGIN/END394606 -Node: Using BEGIN/END395367 -Ref: Using BEGIN/END-Footnote-1398103 -Node: I/O And BEGIN/END398209 -Node: BEGINFILE/ENDFILE400524 -Node: Empty403421 -Node: Using Shell Variables403738 -Node: Action Overview406011 -Node: Statements408337 -Node: If Statement410185 -Node: While Statement411680 -Node: Do Statement413708 -Node: For Statement414856 -Node: Switch Statement418014 -Node: Break Statement420396 -Node: Continue Statement422437 -Node: Next Statement424264 -Node: Nextfile Statement426645 -Node: Exit Statement429273 -Node: Built-in Variables431684 -Node: User-modified432817 -Ref: User-modified-Footnote-1440520 -Node: Auto-set440582 -Ref: Auto-set-Footnote-1453634 -Ref: Auto-set-Footnote-2453839 -Node: ARGC and ARGV453895 -Node: Pattern Action Summary458113 -Node: Arrays460546 -Node: Array Basics461875 -Node: Array Intro462719 -Ref: figure-array-elements464653 -Ref: Array Intro-Footnote-1467273 -Node: Reference to Elements467401 -Node: Assigning Elements469863 -Node: Array Example470354 -Node: Scanning an Array472113 -Node: Controlling Scanning475133 -Ref: Controlling Scanning-Footnote-1480527 -Node: Numeric Array Subscripts480843 -Node: Uninitialized Subscripts483028 -Node: Delete484645 -Ref: Delete-Footnote-1487394 -Node: Multidimensional487451 -Node: Multiscanning490548 -Node: Arrays of Arrays492137 -Node: Arrays Summary496891 -Node: Functions498982 -Node: Built-in500021 -Node: Calling Built-in501099 -Node: Numeric Functions503094 -Ref: Numeric Functions-Footnote-1507110 -Ref: Numeric Functions-Footnote-2507467 -Ref: Numeric Functions-Footnote-3507515 -Node: String Functions507787 -Ref: String Functions-Footnote-1531288 -Ref: String Functions-Footnote-2531417 -Ref: String Functions-Footnote-3531665 -Node: Gory Details531752 -Ref: table-sub-escapes533533 -Ref: table-sub-proposed535048 -Ref: table-posix-sub536410 -Ref: table-gensub-escapes537947 -Ref: Gory Details-Footnote-1538780 -Node: I/O Functions538931 -Ref: I/O Functions-Footnote-1546167 -Node: Time Functions546314 -Ref: Time Functions-Footnote-1556823 -Ref: Time Functions-Footnote-2556891 -Ref: Time Functions-Footnote-3557049 -Ref: Time Functions-Footnote-4557160 -Ref: Time Functions-Footnote-5557272 -Ref: Time Functions-Footnote-6557499 -Node: Bitwise Functions557765 -Ref: table-bitwise-ops558327 -Ref: Bitwise Functions-Footnote-1562655 -Node: Type Functions562827 -Node: I18N Functions563979 -Node: User-defined565626 -Node: Definition Syntax566431 -Ref: Definition Syntax-Footnote-1572090 -Node: Function Example572161 -Ref: Function Example-Footnote-1575082 -Node: Function Caveats575104 -Node: Calling A Function575622 -Node: Variable Scope576580 -Node: Pass By Value/Reference579573 -Node: Return Statement583070 -Node: Dynamic Typing586049 -Node: Indirect Calls586978 -Ref: Indirect Calls-Footnote-1598284 -Node: Functions Summary598412 -Node: Library Functions601114 -Ref: Library Functions-Footnote-1604722 -Ref: Library Functions-Footnote-2604865 -Node: Library Names605036 -Ref: Library Names-Footnote-1608494 -Ref: Library Names-Footnote-2608717 -Node: General Functions608803 -Node: Strtonum Function609906 -Node: Assert Function612928 -Node: Round Function616252 -Node: Cliff Random Function617793 -Node: Ordinal Functions618809 -Ref: Ordinal Functions-Footnote-1621872 -Ref: Ordinal Functions-Footnote-2622124 -Node: Join Function622335 -Ref: Join Function-Footnote-1624105 -Node: Getlocaltime Function624305 -Node: Readfile Function628049 -Node: Shell Quoting630021 -Node: Data File Management631422 -Node: Filetrans Function632054 -Node: Rewind Function636150 -Node: File Checking637536 -Ref: File Checking-Footnote-1638869 -Node: Empty Files639070 -Node: Ignoring Assigns641049 -Node: Getopt Function642599 -Ref: Getopt Function-Footnote-1654063 -Node: Passwd Functions654263 -Ref: Passwd Functions-Footnote-1663103 -Node: Group Functions663191 -Ref: Group Functions-Footnote-1671088 -Node: Walking Arrays671293 -Node: Library Functions Summary672893 -Node: Library Exercises674297 -Node: Sample Programs675577 -Node: Running Examples676347 -Node: Clones677075 -Node: Cut Program678299 -Node: Egrep Program688019 -Ref: Egrep Program-Footnote-1695522 -Node: Id Program695632 -Node: Split Program699308 -Ref: Split Program-Footnote-1702762 -Node: Tee Program702890 -Node: Uniq Program705679 -Node: Wc Program713098 -Ref: Wc Program-Footnote-1717348 -Node: Miscellaneous Programs717442 -Node: Dupword Program718655 -Node: Alarm Program720686 -Node: Translate Program725491 -Ref: Translate Program-Footnote-1730054 -Node: Labels Program730324 -Ref: Labels Program-Footnote-1733675 -Node: Word Sorting733759 -Node: History Sorting737829 -Node: Extract Program739664 -Node: Simple Sed747188 -Node: Igawk Program750258 -Ref: Igawk Program-Footnote-1764584 -Ref: Igawk Program-Footnote-2764785 -Ref: Igawk Program-Footnote-3764907 -Node: Anagram Program765022 -Node: Signature Program768083 -Node: Programs Summary769330 -Node: Programs Exercises770551 -Ref: Programs Exercises-Footnote-1774682 -Node: Advanced Features774773 -Node: Nondecimal Data776755 -Node: Array Sorting778345 -Node: Controlling Array Traversal779045 -Ref: Controlling Array Traversal-Footnote-1787411 -Node: Array Sorting Functions787529 -Ref: Array Sorting Functions-Footnote-1791415 -Node: Two-way I/O791611 -Ref: Two-way I/O-Footnote-1796556 -Ref: Two-way I/O-Footnote-2796742 -Node: TCP/IP Networking796824 -Node: Profiling799696 -Node: Advanced Features Summary807237 -Node: Internationalization809170 -Node: I18N and L10N810650 -Node: Explaining gettext811336 -Ref: Explaining gettext-Footnote-1816361 -Ref: Explaining gettext-Footnote-2816545 -Node: Programmer i18n816710 -Ref: Programmer i18n-Footnote-1821586 -Node: Translator i18n821635 -Node: String Extraction822429 -Ref: String Extraction-Footnote-1823560 -Node: Printf Ordering823646 -Ref: Printf Ordering-Footnote-1826432 -Node: I18N Portability826496 -Ref: I18N Portability-Footnote-1828952 -Node: I18N Example829015 -Ref: I18N Example-Footnote-1831818 -Node: Gawk I18N831890 -Node: I18N Summary832534 -Node: Debugger833874 -Node: Debugging834896 -Node: Debugging Concepts835337 -Node: Debugging Terms837147 -Node: Awk Debugging839719 -Node: Sample Debugging Session840625 -Node: Debugger Invocation841159 -Node: Finding The Bug842544 -Node: List of Debugger Commands849023 -Node: Breakpoint Control850355 -Node: Debugger Execution Control854032 -Node: Viewing And Changing Data857391 -Node: Execution Stack860767 -Node: Debugger Info862402 -Node: Miscellaneous Debugger Commands866447 -Node: Readline Support871448 -Node: Limitations872342 -Node: Debugging Summary874457 -Node: Arbitrary Precision Arithmetic875631 -Node: Computer Arithmetic877047 -Ref: table-numeric-ranges880646 -Ref: Computer Arithmetic-Footnote-1881170 -Node: Math Definitions881227 -Ref: table-ieee-formats884522 -Ref: Math Definitions-Footnote-1885126 -Node: MPFR features885231 -Node: FP Math Caution886902 -Ref: FP Math Caution-Footnote-1887952 -Node: Inexactness of computations888321 -Node: Inexact representation889280 -Node: Comparing FP Values890638 -Node: Errors accumulate891720 -Node: Getting Accuracy893152 -Node: Try To Round895856 -Node: Setting precision896755 -Ref: table-predefined-precision-strings897439 -Node: Setting the rounding mode899268 -Ref: table-gawk-rounding-modes899632 -Ref: Setting the rounding mode-Footnote-1903084 -Node: Arbitrary Precision Integers903263 -Ref: Arbitrary Precision Integers-Footnote-1906247 -Node: POSIX Floating Point Problems906396 -Ref: POSIX Floating Point Problems-Footnote-1910275 -Node: Floating point summary910313 -Node: Dynamic Extensions912509 -Node: Extension Intro914061 -Node: Plugin License915327 -Node: Extension Mechanism Outline916124 -Ref: figure-load-extension916552 -Ref: figure-register-new-function918032 -Ref: figure-call-new-function919036 -Node: Extension API Description921022 -Node: Extension API Functions Introduction922472 -Node: General Data Types927296 -Ref: General Data Types-Footnote-1933035 -Node: Memory Allocation Functions933334 -Ref: Memory Allocation Functions-Footnote-1936173 -Node: Constructor Functions936269 -Node: Registration Functions938003 -Node: Extension Functions938688 -Node: Exit Callback Functions940985 -Node: Extension Version String942233 -Node: Input Parsers942898 -Node: Output Wrappers952777 -Node: Two-way processors957292 -Node: Printing Messages959496 -Ref: Printing Messages-Footnote-1960572 -Node: Updating `ERRNO'960724 -Node: Requesting Values961464 -Ref: table-value-types-returned962192 -Node: Accessing Parameters963149 -Node: Symbol Table Access964380 -Node: Symbol table by name964894 -Node: Symbol table by cookie966875 -Ref: Symbol table by cookie-Footnote-1971019 -Node: Cached values971082 -Ref: Cached values-Footnote-1974581 -Node: Array Manipulation974672 -Ref: Array Manipulation-Footnote-1975770 -Node: Array Data Types975807 -Ref: Array Data Types-Footnote-1978462 -Node: Array Functions978554 -Node: Flattening Arrays982408 -Node: Creating Arrays989300 -Node: Extension API Variables994071 -Node: Extension Versioning994707 -Node: Extension API Informational Variables996608 -Node: Extension API Boilerplate997673 -Node: Finding Extensions1001482 -Node: Extension Example1002042 -Node: Internal File Description1002814 -Node: Internal File Ops1006881 -Ref: Internal File Ops-Footnote-11018551 -Node: Using Internal File Ops1018691 -Ref: Using Internal File Ops-Footnote-11021074 -Node: Extension Samples1021347 -Node: Extension Sample File Functions1022873 -Node: Extension Sample Fnmatch1030511 -Node: Extension Sample Fork1032002 -Node: Extension Sample Inplace1033217 -Node: Extension Sample Ord1034892 -Node: Extension Sample Readdir1035728 -Ref: table-readdir-file-types1036604 -Node: Extension Sample Revout1037415 -Node: Extension Sample Rev2way1038005 -Node: Extension Sample Read write array1038745 -Node: Extension Sample Readfile1040685 -Node: Extension Sample Time1041780 -Node: Extension Sample API Tests1043129 -Node: gawkextlib1043620 -Node: Extension summary1046278 -Node: Extension Exercises1049967 -Node: Language History1050689 -Node: V7/SVR3.11052345 -Node: SVR41054526 -Node: POSIX1055971 -Node: BTL1057360 -Node: POSIX/GNU1058094 -Node: Feature History1063658 -Node: Common Extensions1076756 -Node: Ranges and Locales1078080 -Ref: Ranges and Locales-Footnote-11082698 -Ref: Ranges and Locales-Footnote-21082725 -Ref: Ranges and Locales-Footnote-31082959 -Node: Contributors1083180 -Node: History summary1088721 -Node: Installation1090091 -Node: Gawk Distribution1091037 -Node: Getting1091521 -Node: Extracting1092344 -Node: Distribution contents1093979 -Node: Unix Installation1099696 -Node: Quick Installation1100313 -Node: Additional Configuration Options1102737 -Node: Configuration Philosophy1104475 -Node: Non-Unix Installation1106844 -Node: PC Installation1107302 -Node: PC Binary Installation1108621 -Node: PC Compiling1110469 -Ref: PC Compiling-Footnote-11113490 -Node: PC Testing1113599 -Node: PC Using1114775 -Node: Cygwin1118890 -Node: MSYS1119713 -Node: VMS Installation1120213 -Node: VMS Compilation1121005 -Ref: VMS Compilation-Footnote-11122227 -Node: VMS Dynamic Extensions1122285 -Node: VMS Installation Details1123969 -Node: VMS Running1126221 -Node: VMS GNV1129057 -Node: VMS Old Gawk1129791 -Node: Bugs1130261 -Node: Other Versions1134144 -Node: Installation summary1140568 -Node: Notes1141624 -Node: Compatibility Mode1142489 -Node: Additions1143271 -Node: Accessing The Source1144196 -Node: Adding Code1145631 -Node: New Ports1151788 -Node: Derived Files1156270 -Ref: Derived Files-Footnote-11161745 -Ref: Derived Files-Footnote-21161779 -Ref: Derived Files-Footnote-31162375 -Node: Future Extensions1162489 -Node: Implementation Limitations1163095 -Node: Extension Design1164343 -Node: Old Extension Problems1165497 -Ref: Old Extension Problems-Footnote-11167014 -Node: Extension New Mechanism Goals1167071 -Ref: Extension New Mechanism Goals-Footnote-11170431 -Node: Extension Other Design Decisions1170620 -Node: Extension Future Growth1172728 -Node: Old Extension Mechanism1173564 -Node: Notes summary1175326 -Node: Basic Concepts1176512 -Node: Basic High Level1177193 -Ref: figure-general-flow1177465 -Ref: figure-process-flow1178064 -Ref: Basic High Level-Footnote-11181293 -Node: Basic Data Typing1181478 -Node: Glossary1184806 -Node: Copying1216735 -Node: GNU Free Documentation License1254291 -Node: Index1279427 +Node: Ranges391570 +Node: BEGIN/END394677 +Node: Using BEGIN/END395438 +Ref: Using BEGIN/END-Footnote-1398174 +Node: I/O And BEGIN/END398280 +Node: BEGINFILE/ENDFILE400595 +Node: Empty403492 +Node: Using Shell Variables403809 +Node: Action Overview406082 +Node: Statements408408 +Node: If Statement410256 +Node: While Statement411751 +Node: Do Statement413779 +Node: For Statement414927 +Node: Switch Statement418085 +Node: Break Statement420467 +Node: Continue Statement422508 +Node: Next Statement424335 +Node: Nextfile Statement426716 +Node: Exit Statement429344 +Node: Built-in Variables431755 +Node: User-modified432888 +Ref: User-modified-Footnote-1440591 +Node: Auto-set440653 +Ref: Auto-set-Footnote-1453705 +Ref: Auto-set-Footnote-2453910 +Node: ARGC and ARGV453966 +Node: Pattern Action Summary458184 +Node: Arrays460617 +Node: Array Basics461946 +Node: Array Intro462790 +Ref: figure-array-elements464724 +Ref: Array Intro-Footnote-1467344 +Node: Reference to Elements467472 +Node: Assigning Elements469934 +Node: Array Example470425 +Node: Scanning an Array472184 +Node: Controlling Scanning475204 +Ref: Controlling Scanning-Footnote-1480598 +Node: Numeric Array Subscripts480914 +Node: Uninitialized Subscripts483099 +Node: Delete484716 +Ref: Delete-Footnote-1487465 +Node: Multidimensional487522 +Node: Multiscanning490619 +Node: Arrays of Arrays492208 +Node: Arrays Summary496962 +Node: Functions499053 +Node: Built-in500092 +Node: Calling Built-in501170 +Node: Numeric Functions503165 +Ref: Numeric Functions-Footnote-1507181 +Ref: Numeric Functions-Footnote-2507538 +Ref: Numeric Functions-Footnote-3507586 +Node: String Functions507858 +Ref: String Functions-Footnote-1531359 +Ref: String Functions-Footnote-2531488 +Ref: String Functions-Footnote-3531736 +Node: Gory Details531823 +Ref: table-sub-escapes533604 +Ref: table-sub-proposed535119 +Ref: table-posix-sub536481 +Ref: table-gensub-escapes538018 +Ref: Gory Details-Footnote-1538851 +Node: I/O Functions539002 +Ref: I/O Functions-Footnote-1546238 +Node: Time Functions546385 +Ref: Time Functions-Footnote-1556894 +Ref: Time Functions-Footnote-2556962 +Ref: Time Functions-Footnote-3557120 +Ref: Time Functions-Footnote-4557231 +Ref: Time Functions-Footnote-5557343 +Ref: Time Functions-Footnote-6557570 +Node: Bitwise Functions557836 +Ref: table-bitwise-ops558398 +Ref: Bitwise Functions-Footnote-1562726 +Node: Type Functions562898 +Node: I18N Functions564050 +Node: User-defined565697 +Node: Definition Syntax566502 +Ref: Definition Syntax-Footnote-1572161 +Node: Function Example572232 +Ref: Function Example-Footnote-1575153 +Node: Function Caveats575175 +Node: Calling A Function575693 +Node: Variable Scope576651 +Node: Pass By Value/Reference579644 +Node: Return Statement583141 +Node: Dynamic Typing586120 +Node: Indirect Calls587049 +Ref: Indirect Calls-Footnote-1598355 +Node: Functions Summary598483 +Node: Library Functions601185 +Ref: Library Functions-Footnote-1604793 +Ref: Library Functions-Footnote-2604936 +Node: Library Names605107 +Ref: Library Names-Footnote-1608565 +Ref: Library Names-Footnote-2608788 +Node: General Functions608874 +Node: Strtonum Function609977 +Node: Assert Function612999 +Node: Round Function616323 +Node: Cliff Random Function617864 +Node: Ordinal Functions618880 +Ref: Ordinal Functions-Footnote-1621943 +Ref: Ordinal Functions-Footnote-2622195 +Node: Join Function622406 +Ref: Join Function-Footnote-1624176 +Node: Getlocaltime Function624376 +Node: Readfile Function628120 +Node: Shell Quoting630092 +Node: Data File Management631493 +Node: Filetrans Function632125 +Node: Rewind Function636221 +Node: File Checking637607 +Ref: File Checking-Footnote-1638940 +Node: Empty Files639141 +Node: Ignoring Assigns641120 +Node: Getopt Function642670 +Ref: Getopt Function-Footnote-1654134 +Node: Passwd Functions654334 +Ref: Passwd Functions-Footnote-1663174 +Node: Group Functions663262 +Ref: Group Functions-Footnote-1671159 +Node: Walking Arrays671364 +Node: Library Functions Summary672964 +Node: Library Exercises674368 +Node: Sample Programs675648 +Node: Running Examples676418 +Node: Clones677146 +Node: Cut Program678370 +Node: Egrep Program688090 +Ref: Egrep Program-Footnote-1695593 +Node: Id Program695703 +Node: Split Program699379 +Ref: Split Program-Footnote-1702833 +Node: Tee Program702961 +Node: Uniq Program705750 +Node: Wc Program713169 +Ref: Wc Program-Footnote-1717419 +Node: Miscellaneous Programs717513 +Node: Dupword Program718726 +Node: Alarm Program720757 +Node: Translate Program725562 +Ref: Translate Program-Footnote-1730125 +Node: Labels Program730395 +Ref: Labels Program-Footnote-1733746 +Node: Word Sorting733830 +Node: History Sorting737900 +Node: Extract Program739735 +Node: Simple Sed747259 +Node: Igawk Program750329 +Ref: Igawk Program-Footnote-1764655 +Ref: Igawk Program-Footnote-2764856 +Ref: Igawk Program-Footnote-3764978 +Node: Anagram Program765093 +Node: Signature Program768154 +Node: Programs Summary769401 +Node: Programs Exercises770622 +Ref: Programs Exercises-Footnote-1774753 +Node: Advanced Features774844 +Node: Nondecimal Data776826 +Node: Array Sorting778416 +Node: Controlling Array Traversal779116 +Ref: Controlling Array Traversal-Footnote-1787482 +Node: Array Sorting Functions787600 +Ref: Array Sorting Functions-Footnote-1791486 +Node: Two-way I/O791682 +Ref: Two-way I/O-Footnote-1796627 +Ref: Two-way I/O-Footnote-2796813 +Node: TCP/IP Networking796895 +Node: Profiling799767 +Node: Advanced Features Summary807308 +Node: Internationalization809241 +Node: I18N and L10N810721 +Node: Explaining gettext811407 +Ref: Explaining gettext-Footnote-1816432 +Ref: Explaining gettext-Footnote-2816616 +Node: Programmer i18n816781 +Ref: Programmer i18n-Footnote-1821657 +Node: Translator i18n821706 +Node: String Extraction822500 +Ref: String Extraction-Footnote-1823631 +Node: Printf Ordering823717 +Ref: Printf Ordering-Footnote-1826503 +Node: I18N Portability826567 +Ref: I18N Portability-Footnote-1829023 +Node: I18N Example829086 +Ref: I18N Example-Footnote-1831889 +Node: Gawk I18N831961 +Node: I18N Summary832605 +Node: Debugger833945 +Node: Debugging834967 +Node: Debugging Concepts835408 +Node: Debugging Terms837218 +Node: Awk Debugging839790 +Node: Sample Debugging Session840696 +Node: Debugger Invocation841230 +Node: Finding The Bug842615 +Node: List of Debugger Commands849094 +Node: Breakpoint Control850426 +Node: Debugger Execution Control854103 +Node: Viewing And Changing Data857462 +Node: Execution Stack860838 +Node: Debugger Info862473 +Node: Miscellaneous Debugger Commands866518 +Node: Readline Support871519 +Node: Limitations872413 +Node: Debugging Summary874528 +Node: Arbitrary Precision Arithmetic875702 +Node: Computer Arithmetic877118 +Ref: table-numeric-ranges880717 +Ref: Computer Arithmetic-Footnote-1881241 +Node: Math Definitions881298 +Ref: table-ieee-formats884593 +Ref: Math Definitions-Footnote-1885197 +Node: MPFR features885302 +Node: FP Math Caution886973 +Ref: FP Math Caution-Footnote-1888023 +Node: Inexactness of computations888392 +Node: Inexact representation889351 +Node: Comparing FP Values890709 +Node: Errors accumulate891791 +Node: Getting Accuracy893223 +Node: Try To Round895927 +Node: Setting precision896826 +Ref: table-predefined-precision-strings897510 +Node: Setting the rounding mode899339 +Ref: table-gawk-rounding-modes899703 +Ref: Setting the rounding mode-Footnote-1903155 +Node: Arbitrary Precision Integers903334 +Ref: Arbitrary Precision Integers-Footnote-1906318 +Node: POSIX Floating Point Problems906467 +Ref: POSIX Floating Point Problems-Footnote-1910346 +Node: Floating point summary910384 +Node: Dynamic Extensions912580 +Node: Extension Intro914132 +Node: Plugin License915397 +Node: Extension Mechanism Outline916194 +Ref: figure-load-extension916622 +Ref: figure-register-new-function918102 +Ref: figure-call-new-function919106 +Node: Extension API Description921093 +Node: Extension API Functions Introduction922543 +Node: General Data Types927364 +Ref: General Data Types-Footnote-1933171 +Node: Memory Allocation Functions933470 +Ref: Memory Allocation Functions-Footnote-1936309 +Node: Constructor Functions936405 +Node: Registration Functions938139 +Node: Extension Functions938824 +Node: Exit Callback Functions941121 +Node: Extension Version String942369 +Node: Input Parsers943034 +Node: Output Wrappers952913 +Node: Two-way processors957428 +Node: Printing Messages959632 +Ref: Printing Messages-Footnote-1960708 +Node: Updating `ERRNO'960860 +Node: Requesting Values961600 +Ref: table-value-types-returned962328 +Node: Accessing Parameters963285 +Node: Symbol Table Access964516 +Node: Symbol table by name965030 +Node: Symbol table by cookie967011 +Ref: Symbol table by cookie-Footnote-1971155 +Node: Cached values971218 +Ref: Cached values-Footnote-1974717 +Node: Array Manipulation974808 +Ref: Array Manipulation-Footnote-1975906 +Node: Array Data Types975943 +Ref: Array Data Types-Footnote-1978598 +Node: Array Functions978690 +Node: Flattening Arrays982544 +Node: Creating Arrays989436 +Node: Extension API Variables994207 +Node: Extension Versioning994843 +Node: Extension API Informational Variables996744 +Node: Extension API Boilerplate997809 +Node: Finding Extensions1001618 +Node: Extension Example1002178 +Node: Internal File Description1002950 +Node: Internal File Ops1007017 +Ref: Internal File Ops-Footnote-11018687 +Node: Using Internal File Ops1018827 +Ref: Using Internal File Ops-Footnote-11021210 +Node: Extension Samples1021483 +Node: Extension Sample File Functions1023009 +Node: Extension Sample Fnmatch1030647 +Node: Extension Sample Fork1032138 +Node: Extension Sample Inplace1033353 +Node: Extension Sample Ord1035028 +Node: Extension Sample Readdir1035864 +Ref: table-readdir-file-types1036740 +Node: Extension Sample Revout1037551 +Node: Extension Sample Rev2way1038141 +Node: Extension Sample Read write array1038881 +Node: Extension Sample Readfile1040821 +Node: Extension Sample Time1041916 +Node: Extension Sample API Tests1043265 +Node: gawkextlib1043756 +Node: Extension summary1046414 +Node: Extension Exercises1050103 +Node: Language History1050825 +Node: V7/SVR3.11052481 +Node: SVR41054662 +Node: POSIX1056107 +Node: BTL1057496 +Node: POSIX/GNU1058230 +Node: Feature History1063794 +Node: Common Extensions1076892 +Node: Ranges and Locales1078216 +Ref: Ranges and Locales-Footnote-11082834 +Ref: Ranges and Locales-Footnote-21082861 +Ref: Ranges and Locales-Footnote-31083095 +Node: Contributors1083316 +Node: History summary1088857 +Node: Installation1090227 +Node: Gawk Distribution1091173 +Node: Getting1091657 +Node: Extracting1092480 +Node: Distribution contents1094115 +Node: Unix Installation1099832 +Node: Quick Installation1100449 +Node: Additional Configuration Options1102873 +Node: Configuration Philosophy1104611 +Node: Non-Unix Installation1106980 +Node: PC Installation1107438 +Node: PC Binary Installation1108757 +Node: PC Compiling1110605 +Ref: PC Compiling-Footnote-11113626 +Node: PC Testing1113735 +Node: PC Using1114911 +Node: Cygwin1119026 +Node: MSYS1119849 +Node: VMS Installation1120349 +Node: VMS Compilation1121141 +Ref: VMS Compilation-Footnote-11122363 +Node: VMS Dynamic Extensions1122421 +Node: VMS Installation Details1124105 +Node: VMS Running1126357 +Node: VMS GNV1129193 +Node: VMS Old Gawk1129927 +Node: Bugs1130397 +Node: Other Versions1134280 +Node: Installation summary1140704 +Node: Notes1141760 +Node: Compatibility Mode1142625 +Node: Additions1143407 +Node: Accessing The Source1144332 +Node: Adding Code1145767 +Node: New Ports1151924 +Node: Derived Files1156406 +Ref: Derived Files-Footnote-11161881 +Ref: Derived Files-Footnote-21161915 +Ref: Derived Files-Footnote-31162511 +Node: Future Extensions1162625 +Node: Implementation Limitations1163231 +Node: Extension Design1164479 +Node: Old Extension Problems1165633 +Ref: Old Extension Problems-Footnote-11167150 +Node: Extension New Mechanism Goals1167207 +Ref: Extension New Mechanism Goals-Footnote-11170567 +Node: Extension Other Design Decisions1170756 +Node: Extension Future Growth1172864 +Node: Old Extension Mechanism1173700 +Node: Notes summary1175462 +Node: Basic Concepts1176648 +Node: Basic High Level1177329 +Ref: figure-general-flow1177601 +Ref: figure-process-flow1178200 +Ref: Basic High Level-Footnote-11181429 +Node: Basic Data Typing1181614 +Node: Glossary1184942 +Node: Copying1216871 +Node: GNU Free Documentation License1254427 +Node: Index1279563  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 8cb24eaa..3f2afed3 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -13166,6 +13166,7 @@ $ @kbd{awk '$1 ~ /li/ @{ print $2 @}' mail-list} @cindex regexp constants, as patterns @cindex patterns, regexp constants as +A regexp constant as a pattern is also a special case of an expression pattern. The expression @code{/li/} has the value one if @samp{li} appears in the current input record. Thus, as a pattern, @code{/li/} matches any record containing @samp{li}. @@ -31123,7 +31124,7 @@ Extensions are useful because they allow you (of course) to extend @command{gawk}'s functionality. For example, they can provide access to system calls (such as @code{chdir()} to change directory) and to other C library routines that could be of use. As with most software, -``the sky is the limit;'' if you can imagine something that you might +``the sky is the limit''; if you can imagine something that you might want to do and can write in C or C++, you can write an extension to do it! Extensions are written in C or C++, using the @dfn{application programming @@ -31131,7 +31132,7 @@ interface} (API) defined for this purpose by the @command{gawk} developers. The rest of this @value{CHAPTER} explains the facilities that the API provides and how to use them, and presents a small example extension. In addition, it documents -the sample extensions included in the @command{gawk} distribution, +the sample extensions included in the @command{gawk} distribution and describes the @code{gawkextlib} project. @ifclear FOR_PRINT @xref{Extension Design}, for a discussion of the extension mechanism @@ -31284,7 +31285,7 @@ Some other bits and pieces: @itemize @value{BULLET} @item The API provides access to @command{gawk}'s @code{do_@var{xxx}} values, -reflecting command-line options, like @code{do_lint}, @code{do_profiling} +reflecting command-line options, like @code{do_lint}, @code{do_profiling}, and so on (@pxref{Extension API Variables}). These are informational: an extension cannot affect their values inside @command{gawk}. In addition, attempting to assign to them @@ -31328,7 +31329,7 @@ This (rather large) @value{SECTION} describes the API in detail. @node Extension API Functions Introduction @subsection Introduction -Access to facilities within @command{gawk} are made available +Access to facilities within @command{gawk} is achieved by calling through function pointers passed into your extension. API function pointers are provided for the following kinds of operations: @@ -31356,7 +31357,7 @@ Output wrappers Two-way processors @end itemize -All of these are discussed in detail, later in this @value{CHAPTER}. +All of these are discussed in detail later in this @value{CHAPTER}. @item Printing fatal, warning, and ``lint'' warning messages. @@ -31394,7 +31395,7 @@ Creating a new array Clearing an array @item -Flattening an array for easy C style looping over all its indices and elements +Flattening an array for easy C-style looping over all its indices and elements @end itemize @end itemize @@ -31406,8 +31407,9 @@ The following types, macros, and/or functions are referenced in @file{gawkapi.h}. For correct use, you must therefore include the corresponding standard header file @emph{before} including @file{gawkapi.h}: +@c FIXME: Make this is a float at some point. @multitable {@code{memset()}, @code{memcpy()}} {@code{}} -@headitem C Entity @tab Header File +@headitem C entity @tab Header file @item @code{EOF} @tab @code{} @item Values for @code{errno} @tab @code{} @item @code{FILE} @tab @code{} @@ -31433,7 +31435,7 @@ Doing so, however, is poor coding practice. Although the API only uses ISO C 90 features, there is an exception; the ``constructor'' functions use the @code{inline} keyword. If your compiler does not support this keyword, you should either place -@samp{-Dinline=''} on your command line, or use the GNU Autotools and include a +@samp{-Dinline=''} on your command line or use the GNU Autotools and include a @file{config.h} file in your extensions. @item @@ -31441,7 +31443,7 @@ All pointers filled in by @command{gawk} point to memory managed by @command{gawk} and should be treated by the extension as read-only. Memory for @emph{all} strings passed into @command{gawk} from the extension @emph{must} come from calling one of -@code{gawk_malloc()}, @code{gawk_calloc()} or @code{gawk_realloc()}, +@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}, and is managed by @command{gawk} from then on. @item @@ -31455,7 +31457,7 @@ characters are allowed. By intent, strings are maintained using the current multibyte encoding (as defined by @env{LC_@var{xxx}} environment variables) and not using wide characters. This matches how @command{gawk} stores strings internally -and also how characters are likely to be input and output from files. +and also how characters are likely to be input into and output from files. @end quotation @item @@ -31500,6 +31502,8 @@ general-purpose use. Additional, more specialized, data structures are introduced in subsequent @value{SECTION}s, together with the functions that use them. +The general-purpose types and structures are as follows: + @table @code @item typedef void *awk_ext_id_t; A value of this type is received from @command{gawk} when an extension is loaded. @@ -31516,7 +31520,7 @@ while allowing @command{gawk} to use them as it needs to. @itemx @ @ @ @ awk_false = 0, @itemx @ @ @ @ awk_true @itemx @} awk_bool_t; -A simple boolean type. +A simple Boolean type. @item typedef struct awk_string @{ @itemx @ @ @ @ char *str;@ @ @ @ @ @ /* data */ @@ -31562,7 +31566,7 @@ The @code{val_type} member indicates what kind of value the @itemx #define array_cookie@ @ @ u.a @itemx #define scalar_cookie@ @ u.scl @itemx #define value_cookie@ @ @ u.vc -These macros make accessing the fields of the @code{awk_value_t} more +Using these macros makes accessing the fields of the @code{awk_value_t} more readable. @item typedef void *awk_scalar_t; diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 7c229020..3e97423a 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -12494,6 +12494,7 @@ $ @kbd{awk '$1 ~ /li/ @{ print $2 @}' mail-list} @cindex regexp constants, as patterns @cindex patterns, regexp constants as +A regexp constant as a pattern is also a special case of an expression pattern. The expression @code{/li/} has the value one if @samp{li} appears in the current input record. Thus, as a pattern, @code{/li/} matches any record containing @samp{li}. @@ -30214,7 +30215,7 @@ Extensions are useful because they allow you (of course) to extend @command{gawk}'s functionality. For example, they can provide access to system calls (such as @code{chdir()} to change directory) and to other C library routines that could be of use. As with most software, -``the sky is the limit;'' if you can imagine something that you might +``the sky is the limit''; if you can imagine something that you might want to do and can write in C or C++, you can write an extension to do it! Extensions are written in C or C++, using the @dfn{application programming @@ -30222,7 +30223,7 @@ interface} (API) defined for this purpose by the @command{gawk} developers. The rest of this @value{CHAPTER} explains the facilities that the API provides and how to use them, and presents a small example extension. In addition, it documents -the sample extensions included in the @command{gawk} distribution, +the sample extensions included in the @command{gawk} distribution and describes the @code{gawkextlib} project. @ifclear FOR_PRINT @xref{Extension Design}, for a discussion of the extension mechanism @@ -30375,7 +30376,7 @@ Some other bits and pieces: @itemize @value{BULLET} @item The API provides access to @command{gawk}'s @code{do_@var{xxx}} values, -reflecting command-line options, like @code{do_lint}, @code{do_profiling} +reflecting command-line options, like @code{do_lint}, @code{do_profiling}, and so on (@pxref{Extension API Variables}). These are informational: an extension cannot affect their values inside @command{gawk}. In addition, attempting to assign to them @@ -30419,7 +30420,7 @@ This (rather large) @value{SECTION} describes the API in detail. @node Extension API Functions Introduction @subsection Introduction -Access to facilities within @command{gawk} are made available +Access to facilities within @command{gawk} is achieved by calling through function pointers passed into your extension. API function pointers are provided for the following kinds of operations: @@ -30447,7 +30448,7 @@ Output wrappers Two-way processors @end itemize -All of these are discussed in detail, later in this @value{CHAPTER}. +All of these are discussed in detail later in this @value{CHAPTER}. @item Printing fatal, warning, and ``lint'' warning messages. @@ -30485,7 +30486,7 @@ Creating a new array Clearing an array @item -Flattening an array for easy C style looping over all its indices and elements +Flattening an array for easy C-style looping over all its indices and elements @end itemize @end itemize @@ -30497,8 +30498,9 @@ The following types, macros, and/or functions are referenced in @file{gawkapi.h}. For correct use, you must therefore include the corresponding standard header file @emph{before} including @file{gawkapi.h}: +@c FIXME: Make this is a float at some point. @multitable {@code{memset()}, @code{memcpy()}} {@code{}} -@headitem C Entity @tab Header File +@headitem C entity @tab Header file @item @code{EOF} @tab @code{} @item Values for @code{errno} @tab @code{} @item @code{FILE} @tab @code{} @@ -30524,7 +30526,7 @@ Doing so, however, is poor coding practice. Although the API only uses ISO C 90 features, there is an exception; the ``constructor'' functions use the @code{inline} keyword. If your compiler does not support this keyword, you should either place -@samp{-Dinline=''} on your command line, or use the GNU Autotools and include a +@samp{-Dinline=''} on your command line or use the GNU Autotools and include a @file{config.h} file in your extensions. @item @@ -30532,7 +30534,7 @@ All pointers filled in by @command{gawk} point to memory managed by @command{gawk} and should be treated by the extension as read-only. Memory for @emph{all} strings passed into @command{gawk} from the extension @emph{must} come from calling one of -@code{gawk_malloc()}, @code{gawk_calloc()} or @code{gawk_realloc()}, +@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}, and is managed by @command{gawk} from then on. @item @@ -30546,7 +30548,7 @@ characters are allowed. By intent, strings are maintained using the current multibyte encoding (as defined by @env{LC_@var{xxx}} environment variables) and not using wide characters. This matches how @command{gawk} stores strings internally -and also how characters are likely to be input and output from files. +and also how characters are likely to be input into and output from files. @end quotation @item @@ -30591,6 +30593,8 @@ general-purpose use. Additional, more specialized, data structures are introduced in subsequent @value{SECTION}s, together with the functions that use them. +The general-purpose types and structures are as follows: + @table @code @item typedef void *awk_ext_id_t; A value of this type is received from @command{gawk} when an extension is loaded. @@ -30607,7 +30611,7 @@ while allowing @command{gawk} to use them as it needs to. @itemx @ @ @ @ awk_false = 0, @itemx @ @ @ @ awk_true @itemx @} awk_bool_t; -A simple boolean type. +A simple Boolean type. @item typedef struct awk_string @{ @itemx @ @ @ @ char *str;@ @ @ @ @ @ /* data */ @@ -30653,7 +30657,7 @@ The @code{val_type} member indicates what kind of value the @itemx #define array_cookie@ @ @ u.a @itemx #define scalar_cookie@ @ u.scl @itemx #define value_cookie@ @ @ u.vc -These macros make accessing the fields of the @code{awk_value_t} more +Using these macros makes accessing the fields of the @code{awk_value_t} more readable. @item typedef void *awk_scalar_t; -- cgit v1.2.3 From e59b2439f336e943a5eb7bd6a9926dc18dd974d8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 10 Feb 2015 19:52:18 +0200 Subject: Add new profile test. --- test/ChangeLog | 5 +++++ test/Makefile.am | 10 +++++++++- test/Makefile.in | 10 +++++++++- test/profile0.awk | 1 + test/profile0.in | 2 ++ test/profile0.ok | 6 ++++++ 6 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 test/profile0.awk create mode 100644 test/profile0.in create mode 100644 test/profile0.ok diff --git a/test/ChangeLog b/test/ChangeLog index 8672cb00..0d6934e9 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-02-10 Arnold D. Robbins + + * Makefile.am (profile0): New test. + * profile0.awk, profile0.in, profile0.ok: New files. + 2015-02-01 Arnold D. Robbins * Makefile.am (paramasfunc1, paramasfunc2): Now need --posix. diff --git a/test/Makefile.am b/test/Makefile.am index 3160494e..419265f9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -710,6 +710,8 @@ EXTRA_DIST = \ prmreuse.ok \ procinfs.awk \ procinfs.ok \ + profile0.awk \ + profile0.ok \ profile2.ok \ profile3.awk \ profile3.ok \ @@ -1039,7 +1041,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -1689,6 +1691,12 @@ dumpvars:: @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + profile1: @echo $@ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 diff --git a/test/Makefile.in b/test/Makefile.in index d1bbf4f8..598285ed 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -967,6 +967,8 @@ EXTRA_DIST = \ prmreuse.ok \ procinfs.awk \ procinfs.ok \ + profile0.awk \ + profile0.ok \ profile2.ok \ profile3.awk \ profile3.ok \ @@ -1295,7 +1297,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -2127,6 +2129,12 @@ dumpvars:: @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + profile1: @echo $@ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 diff --git a/test/profile0.awk b/test/profile0.awk new file mode 100644 index 00000000..a42e94df --- /dev/null +++ b/test/profile0.awk @@ -0,0 +1 @@ +NR == 1 diff --git a/test/profile0.in b/test/profile0.in new file mode 100644 index 00000000..7bba8c8e --- /dev/null +++ b/test/profile0.in @@ -0,0 +1,2 @@ +line 1 +line 2 diff --git a/test/profile0.ok b/test/profile0.ok new file mode 100644 index 00000000..2e3c5728 --- /dev/null +++ b/test/profile0.ok @@ -0,0 +1,6 @@ + # Rule(s) + + 2 NR == 1 { # 1 + 1 print $0 + } + -- cgit v1.2.3 From 9478ffc5b7ae6988bb109a7be9189ed02f3720e8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 10 Feb 2015 22:17:32 +0200 Subject: Doc fixes. --- doc/ChangeLog | 4 + doc/gawk.info | 1102 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 22 +- doc/gawktexi.in | 22 +- 4 files changed, 583 insertions(+), 567 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b6de5797..c62d3022 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-10 Arnold D. Robbins + + * gawktexi.in: Minor fixes, O'Reilly fixes. + 2015-02-09 Arnold D. Robbins * gawktexi.in: Restore a lost sentence. O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index bf573a8a..eb8d07b5 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -1374,6 +1374,12 @@ also must acknowledge my gratitude to G-d, for the many opportunities He has sent my way, as well as for the gifts He has given me with which to take advantage of those opportunities. + +Arnold Robbins +Nof Ayalon +Israel +February 2015 +  File: gawk.info, Node: Getting Started, Next: Invoking Gawk, Prev: Preface, Up: Top @@ -23028,8 +23034,8 @@ indicates what is in the `union'. Representing numbers is easy--the API uses a C `double'. Strings require more work. Because `gawk' allows embedded NUL bytes in string -values, a string must be represented as a pair containing a -data-pointer and length. This is the `awk_string_t' type. +values, a string must be represented as a pair containing a data +pointer and length. This is the `awk_string_t' type. Identifiers (i.e., the names of global variables) can be associated with either scalar values or with arrays. In addition, `gawk' provides @@ -23041,12 +23047,12 @@ Manipulation::. of the `union' as if they were fields in a `struct'; this is a common coding practice in C. Such code is easier to write and to read, but it remains _your_ responsibility to make sure that the `val_type' member -correctly reflects the type of the value in the `awk_value_t'. +correctly reflects the type of the value in the `awk_value_t' struct. Conceptually, the first three members of the `union' (number, string, and array) are all that is needed for working with `awk' values. However, because the API provides routines for accessing and changing -the value of global scalar variables only by using the variable's name, +the value of a global scalar variable only by using the variable's name, there is a performance penalty: `gawk' must find the variable each time it is accessed and changed. This turns out to be a real issue, not just a theoretical one. @@ -23055,17 +23061,19 @@ just a theoretical one. reading and/or changing the value of one or more scalar variables, you can obtain a "scalar cookie"(1) object for that variable, and then use the cookie for getting the variable's value or for changing the -variable's value. This is the `awk_scalar_t' type and `scalar_cookie' -macro. Given a scalar cookie, `gawk' can directly retrieve or modify -the value, as required, without having to find it first. +variable's value. The `awk_scalar_t' type holds a scalar cookie, and +the `scalar_cookie' macro provides access to the value of that type in +the `awk_value_t' struct. Given a scalar cookie, `gawk' can directly +retrieve or modify the value, as required, without having to find it +first. The `awk_value_cookie_t' type and `value_cookie' macro are similar. If you know that you wish to use the same numeric or string _value_ for one or more variables, you can create the value once, retaining a "value cookie" for it, and then pass in that value cookie whenever you -wish to set the value of a variable. This saves both storage space -within the running `gawk' process as well as the time needed to create -the value. +wish to set the value of a variable. This both storage space within +the running `gawk' process and reduces the time needed to create the +value. ---------- Footnotes ---------- @@ -34492,542 +34500,542 @@ Ref: Manual History-Footnote-167004 Ref: Manual History-Footnote-267045 Node: How To Contribute67119 Node: Acknowledgments68248 -Node: Getting Started73065 -Node: Running gawk75504 -Node: One-shot76694 -Node: Read Terminal77958 -Node: Long79989 -Node: Executable Scripts81502 -Ref: Executable Scripts-Footnote-184291 -Node: Comments84394 -Node: Quoting86876 -Node: DOS Quoting92394 -Node: Sample Data Files93069 -Node: Very Simple95664 -Node: Two Rules100563 -Node: More Complex102449 -Node: Statements/Lines105311 -Ref: Statements/Lines-Footnote-1109766 -Node: Other Features110031 -Node: When110967 -Ref: When-Footnote-1112721 -Node: Intro Summary112786 -Node: Invoking Gawk113670 -Node: Command Line115184 -Node: Options115982 -Ref: Options-Footnote-1131904 -Ref: Options-Footnote-2132133 -Node: Other Arguments132158 -Node: Naming Standard Input135106 -Node: Environment Variables136199 -Node: AWKPATH Variable136757 -Ref: AWKPATH Variable-Footnote-1140054 -Ref: AWKPATH Variable-Footnote-2140099 -Node: AWKLIBPATH Variable140359 -Node: Other Environment Variables141502 -Node: Exit Status145260 -Node: Include Files145936 -Node: Loading Shared Libraries149525 -Node: Obsolete150952 -Node: Undocumented151644 -Node: Invoking Summary151911 -Node: Regexp153574 -Node: Regexp Usage155028 -Node: Escape Sequences157065 -Node: Regexp Operators163075 -Ref: Regexp Operators-Footnote-1170485 -Ref: Regexp Operators-Footnote-2170632 -Node: Bracket Expressions170730 -Ref: table-char-classes172745 -Node: Leftmost Longest175687 -Node: Computed Regexps176989 -Node: GNU Regexp Operators180418 -Node: Case-sensitivity184090 -Ref: Case-sensitivity-Footnote-1186975 -Ref: Case-sensitivity-Footnote-2187210 -Node: Regexp Summary187318 -Node: Reading Files188785 -Node: Records190878 -Node: awk split records191611 -Node: gawk split records196540 -Ref: gawk split records-Footnote-1201079 -Node: Fields201116 -Ref: Fields-Footnote-1203894 -Node: Nonconstant Fields203980 -Ref: Nonconstant Fields-Footnote-1206218 -Node: Changing Fields206421 -Node: Field Separators212352 -Node: Default Field Splitting215056 -Node: Regexp Field Splitting216173 -Node: Single Character Fields219523 -Node: Command Line Field Separator220582 -Node: Full Line Fields223799 -Ref: Full Line Fields-Footnote-1225320 -Ref: Full Line Fields-Footnote-2225366 -Node: Field Splitting Summary225467 -Node: Constant Size227541 -Node: Splitting By Content232124 -Ref: Splitting By Content-Footnote-1236089 -Node: Multiple Line236252 -Ref: Multiple Line-Footnote-1242133 -Node: Getline242312 -Node: Plain Getline244519 -Node: Getline/Variable247159 -Node: Getline/File248308 -Node: Getline/Variable/File249693 -Ref: Getline/Variable/File-Footnote-1251296 -Node: Getline/Pipe251383 -Node: Getline/Variable/Pipe254061 -Node: Getline/Coprocess255192 -Node: Getline/Variable/Coprocess256456 -Node: Getline Notes257195 -Node: Getline Summary259989 -Ref: table-getline-variants260401 -Node: Read Timeout261230 -Ref: Read Timeout-Footnote-1265067 -Node: Command-line directories265125 -Node: Input Summary266030 -Node: Input Exercises269415 -Node: Printing270143 -Node: Print271920 -Node: Print Examples273377 -Node: Output Separators276156 -Node: OFMT278174 -Node: Printf279529 -Node: Basic Printf280314 -Node: Control Letters281886 -Node: Format Modifiers285871 -Node: Printf Examples291881 -Node: Redirection294367 -Node: Special FD301205 -Ref: Special FD-Footnote-1304371 -Node: Special Files304445 -Node: Other Inherited Files305062 -Node: Special Network306062 -Node: Special Caveats306924 -Node: Close Files And Pipes307873 -Ref: Close Files And Pipes-Footnote-1315064 -Ref: Close Files And Pipes-Footnote-2315212 -Node: Output Summary315362 -Node: Output Exercises316360 -Node: Expressions317040 -Node: Values318229 -Node: Constants318906 -Node: Scalar Constants319597 -Ref: Scalar Constants-Footnote-1320459 -Node: Nondecimal-numbers320709 -Node: Regexp Constants323719 -Node: Using Constant Regexps324245 -Node: Variables327408 -Node: Using Variables328065 -Node: Assignment Options329976 -Node: Conversion331851 -Node: Strings And Numbers332375 -Ref: Strings And Numbers-Footnote-1335440 -Node: Locale influences conversions335549 -Ref: table-locale-affects338295 -Node: All Operators338887 -Node: Arithmetic Ops339516 -Node: Concatenation342021 -Ref: Concatenation-Footnote-1344840 -Node: Assignment Ops344947 -Ref: table-assign-ops349926 -Node: Increment Ops351236 -Node: Truth Values and Conditions354667 -Node: Truth Values355750 -Node: Typing and Comparison356799 -Node: Variable Typing357615 -Node: Comparison Operators361282 -Ref: table-relational-ops361692 -Node: POSIX String Comparison365187 -Ref: POSIX String Comparison-Footnote-1366259 -Node: Boolean Ops366398 -Ref: Boolean Ops-Footnote-1370876 -Node: Conditional Exp370967 -Node: Function Calls372705 -Node: Precedence376585 -Node: Locales380245 -Node: Expressions Summary381877 -Node: Patterns and Actions384448 -Node: Pattern Overview385568 -Node: Regexp Patterns387247 -Node: Expression Patterns387790 -Node: Ranges391570 -Node: BEGIN/END394677 -Node: Using BEGIN/END395438 -Ref: Using BEGIN/END-Footnote-1398174 -Node: I/O And BEGIN/END398280 -Node: BEGINFILE/ENDFILE400595 -Node: Empty403492 -Node: Using Shell Variables403809 -Node: Action Overview406082 -Node: Statements408408 -Node: If Statement410256 -Node: While Statement411751 -Node: Do Statement413779 -Node: For Statement414927 -Node: Switch Statement418085 -Node: Break Statement420467 -Node: Continue Statement422508 -Node: Next Statement424335 -Node: Nextfile Statement426716 -Node: Exit Statement429344 -Node: Built-in Variables431755 -Node: User-modified432888 -Ref: User-modified-Footnote-1440591 -Node: Auto-set440653 -Ref: Auto-set-Footnote-1453705 -Ref: Auto-set-Footnote-2453910 -Node: ARGC and ARGV453966 -Node: Pattern Action Summary458184 -Node: Arrays460617 -Node: Array Basics461946 -Node: Array Intro462790 -Ref: figure-array-elements464724 -Ref: Array Intro-Footnote-1467344 -Node: Reference to Elements467472 -Node: Assigning Elements469934 -Node: Array Example470425 -Node: Scanning an Array472184 -Node: Controlling Scanning475204 -Ref: Controlling Scanning-Footnote-1480598 -Node: Numeric Array Subscripts480914 -Node: Uninitialized Subscripts483099 -Node: Delete484716 -Ref: Delete-Footnote-1487465 -Node: Multidimensional487522 -Node: Multiscanning490619 -Node: Arrays of Arrays492208 -Node: Arrays Summary496962 -Node: Functions499053 -Node: Built-in500092 -Node: Calling Built-in501170 -Node: Numeric Functions503165 -Ref: Numeric Functions-Footnote-1507181 -Ref: Numeric Functions-Footnote-2507538 -Ref: Numeric Functions-Footnote-3507586 -Node: String Functions507858 -Ref: String Functions-Footnote-1531359 -Ref: String Functions-Footnote-2531488 -Ref: String Functions-Footnote-3531736 -Node: Gory Details531823 -Ref: table-sub-escapes533604 -Ref: table-sub-proposed535119 -Ref: table-posix-sub536481 -Ref: table-gensub-escapes538018 -Ref: Gory Details-Footnote-1538851 -Node: I/O Functions539002 -Ref: I/O Functions-Footnote-1546238 -Node: Time Functions546385 -Ref: Time Functions-Footnote-1556894 -Ref: Time Functions-Footnote-2556962 -Ref: Time Functions-Footnote-3557120 -Ref: Time Functions-Footnote-4557231 -Ref: Time Functions-Footnote-5557343 -Ref: Time Functions-Footnote-6557570 -Node: Bitwise Functions557836 -Ref: table-bitwise-ops558398 -Ref: Bitwise Functions-Footnote-1562726 -Node: Type Functions562898 -Node: I18N Functions564050 -Node: User-defined565697 -Node: Definition Syntax566502 -Ref: Definition Syntax-Footnote-1572161 -Node: Function Example572232 -Ref: Function Example-Footnote-1575153 -Node: Function Caveats575175 -Node: Calling A Function575693 -Node: Variable Scope576651 -Node: Pass By Value/Reference579644 -Node: Return Statement583141 -Node: Dynamic Typing586120 -Node: Indirect Calls587049 -Ref: Indirect Calls-Footnote-1598355 -Node: Functions Summary598483 -Node: Library Functions601185 -Ref: Library Functions-Footnote-1604793 -Ref: Library Functions-Footnote-2604936 -Node: Library Names605107 -Ref: Library Names-Footnote-1608565 -Ref: Library Names-Footnote-2608788 -Node: General Functions608874 -Node: Strtonum Function609977 -Node: Assert Function612999 -Node: Round Function616323 -Node: Cliff Random Function617864 -Node: Ordinal Functions618880 -Ref: Ordinal Functions-Footnote-1621943 -Ref: Ordinal Functions-Footnote-2622195 -Node: Join Function622406 -Ref: Join Function-Footnote-1624176 -Node: Getlocaltime Function624376 -Node: Readfile Function628120 -Node: Shell Quoting630092 -Node: Data File Management631493 -Node: Filetrans Function632125 -Node: Rewind Function636221 -Node: File Checking637607 -Ref: File Checking-Footnote-1638940 -Node: Empty Files639141 -Node: Ignoring Assigns641120 -Node: Getopt Function642670 -Ref: Getopt Function-Footnote-1654134 -Node: Passwd Functions654334 -Ref: Passwd Functions-Footnote-1663174 -Node: Group Functions663262 -Ref: Group Functions-Footnote-1671159 -Node: Walking Arrays671364 -Node: Library Functions Summary672964 -Node: Library Exercises674368 -Node: Sample Programs675648 -Node: Running Examples676418 -Node: Clones677146 -Node: Cut Program678370 -Node: Egrep Program688090 -Ref: Egrep Program-Footnote-1695593 -Node: Id Program695703 -Node: Split Program699379 -Ref: Split Program-Footnote-1702833 -Node: Tee Program702961 -Node: Uniq Program705750 -Node: Wc Program713169 -Ref: Wc Program-Footnote-1717419 -Node: Miscellaneous Programs717513 -Node: Dupword Program718726 -Node: Alarm Program720757 -Node: Translate Program725562 -Ref: Translate Program-Footnote-1730125 -Node: Labels Program730395 -Ref: Labels Program-Footnote-1733746 -Node: Word Sorting733830 -Node: History Sorting737900 -Node: Extract Program739735 -Node: Simple Sed747259 -Node: Igawk Program750329 -Ref: Igawk Program-Footnote-1764655 -Ref: Igawk Program-Footnote-2764856 -Ref: Igawk Program-Footnote-3764978 -Node: Anagram Program765093 -Node: Signature Program768154 -Node: Programs Summary769401 -Node: Programs Exercises770622 -Ref: Programs Exercises-Footnote-1774753 -Node: Advanced Features774844 -Node: Nondecimal Data776826 -Node: Array Sorting778416 -Node: Controlling Array Traversal779116 -Ref: Controlling Array Traversal-Footnote-1787482 -Node: Array Sorting Functions787600 -Ref: Array Sorting Functions-Footnote-1791486 -Node: Two-way I/O791682 -Ref: Two-way I/O-Footnote-1796627 -Ref: Two-way I/O-Footnote-2796813 -Node: TCP/IP Networking796895 -Node: Profiling799767 -Node: Advanced Features Summary807308 -Node: Internationalization809241 -Node: I18N and L10N810721 -Node: Explaining gettext811407 -Ref: Explaining gettext-Footnote-1816432 -Ref: Explaining gettext-Footnote-2816616 -Node: Programmer i18n816781 -Ref: Programmer i18n-Footnote-1821657 -Node: Translator i18n821706 -Node: String Extraction822500 -Ref: String Extraction-Footnote-1823631 -Node: Printf Ordering823717 -Ref: Printf Ordering-Footnote-1826503 -Node: I18N Portability826567 -Ref: I18N Portability-Footnote-1829023 -Node: I18N Example829086 -Ref: I18N Example-Footnote-1831889 -Node: Gawk I18N831961 -Node: I18N Summary832605 -Node: Debugger833945 -Node: Debugging834967 -Node: Debugging Concepts835408 -Node: Debugging Terms837218 -Node: Awk Debugging839790 -Node: Sample Debugging Session840696 -Node: Debugger Invocation841230 -Node: Finding The Bug842615 -Node: List of Debugger Commands849094 -Node: Breakpoint Control850426 -Node: Debugger Execution Control854103 -Node: Viewing And Changing Data857462 -Node: Execution Stack860838 -Node: Debugger Info862473 -Node: Miscellaneous Debugger Commands866518 -Node: Readline Support871519 -Node: Limitations872413 -Node: Debugging Summary874528 -Node: Arbitrary Precision Arithmetic875702 -Node: Computer Arithmetic877118 -Ref: table-numeric-ranges880717 -Ref: Computer Arithmetic-Footnote-1881241 -Node: Math Definitions881298 -Ref: table-ieee-formats884593 -Ref: Math Definitions-Footnote-1885197 -Node: MPFR features885302 -Node: FP Math Caution886973 -Ref: FP Math Caution-Footnote-1888023 -Node: Inexactness of computations888392 -Node: Inexact representation889351 -Node: Comparing FP Values890709 -Node: Errors accumulate891791 -Node: Getting Accuracy893223 -Node: Try To Round895927 -Node: Setting precision896826 -Ref: table-predefined-precision-strings897510 -Node: Setting the rounding mode899339 -Ref: table-gawk-rounding-modes899703 -Ref: Setting the rounding mode-Footnote-1903155 -Node: Arbitrary Precision Integers903334 -Ref: Arbitrary Precision Integers-Footnote-1906318 -Node: POSIX Floating Point Problems906467 -Ref: POSIX Floating Point Problems-Footnote-1910346 -Node: Floating point summary910384 -Node: Dynamic Extensions912580 -Node: Extension Intro914132 -Node: Plugin License915397 -Node: Extension Mechanism Outline916194 -Ref: figure-load-extension916622 -Ref: figure-register-new-function918102 -Ref: figure-call-new-function919106 -Node: Extension API Description921093 -Node: Extension API Functions Introduction922543 -Node: General Data Types927364 -Ref: General Data Types-Footnote-1933171 -Node: Memory Allocation Functions933470 -Ref: Memory Allocation Functions-Footnote-1936309 -Node: Constructor Functions936405 -Node: Registration Functions938139 -Node: Extension Functions938824 -Node: Exit Callback Functions941121 -Node: Extension Version String942369 -Node: Input Parsers943034 -Node: Output Wrappers952913 -Node: Two-way processors957428 -Node: Printing Messages959632 -Ref: Printing Messages-Footnote-1960708 -Node: Updating `ERRNO'960860 -Node: Requesting Values961600 -Ref: table-value-types-returned962328 -Node: Accessing Parameters963285 -Node: Symbol Table Access964516 -Node: Symbol table by name965030 -Node: Symbol table by cookie967011 -Ref: Symbol table by cookie-Footnote-1971155 -Node: Cached values971218 -Ref: Cached values-Footnote-1974717 -Node: Array Manipulation974808 -Ref: Array Manipulation-Footnote-1975906 -Node: Array Data Types975943 -Ref: Array Data Types-Footnote-1978598 -Node: Array Functions978690 -Node: Flattening Arrays982544 -Node: Creating Arrays989436 -Node: Extension API Variables994207 -Node: Extension Versioning994843 -Node: Extension API Informational Variables996744 -Node: Extension API Boilerplate997809 -Node: Finding Extensions1001618 -Node: Extension Example1002178 -Node: Internal File Description1002950 -Node: Internal File Ops1007017 -Ref: Internal File Ops-Footnote-11018687 -Node: Using Internal File Ops1018827 -Ref: Using Internal File Ops-Footnote-11021210 -Node: Extension Samples1021483 -Node: Extension Sample File Functions1023009 -Node: Extension Sample Fnmatch1030647 -Node: Extension Sample Fork1032138 -Node: Extension Sample Inplace1033353 -Node: Extension Sample Ord1035028 -Node: Extension Sample Readdir1035864 -Ref: table-readdir-file-types1036740 -Node: Extension Sample Revout1037551 -Node: Extension Sample Rev2way1038141 -Node: Extension Sample Read write array1038881 -Node: Extension Sample Readfile1040821 -Node: Extension Sample Time1041916 -Node: Extension Sample API Tests1043265 -Node: gawkextlib1043756 -Node: Extension summary1046414 -Node: Extension Exercises1050103 -Node: Language History1050825 -Node: V7/SVR3.11052481 -Node: SVR41054662 -Node: POSIX1056107 -Node: BTL1057496 -Node: POSIX/GNU1058230 -Node: Feature History1063794 -Node: Common Extensions1076892 -Node: Ranges and Locales1078216 -Ref: Ranges and Locales-Footnote-11082834 -Ref: Ranges and Locales-Footnote-21082861 -Ref: Ranges and Locales-Footnote-31083095 -Node: Contributors1083316 -Node: History summary1088857 -Node: Installation1090227 -Node: Gawk Distribution1091173 -Node: Getting1091657 -Node: Extracting1092480 -Node: Distribution contents1094115 -Node: Unix Installation1099832 -Node: Quick Installation1100449 -Node: Additional Configuration Options1102873 -Node: Configuration Philosophy1104611 -Node: Non-Unix Installation1106980 -Node: PC Installation1107438 -Node: PC Binary Installation1108757 -Node: PC Compiling1110605 -Ref: PC Compiling-Footnote-11113626 -Node: PC Testing1113735 -Node: PC Using1114911 -Node: Cygwin1119026 -Node: MSYS1119849 -Node: VMS Installation1120349 -Node: VMS Compilation1121141 -Ref: VMS Compilation-Footnote-11122363 -Node: VMS Dynamic Extensions1122421 -Node: VMS Installation Details1124105 -Node: VMS Running1126357 -Node: VMS GNV1129193 -Node: VMS Old Gawk1129927 -Node: Bugs1130397 -Node: Other Versions1134280 -Node: Installation summary1140704 -Node: Notes1141760 -Node: Compatibility Mode1142625 -Node: Additions1143407 -Node: Accessing The Source1144332 -Node: Adding Code1145767 -Node: New Ports1151924 -Node: Derived Files1156406 -Ref: Derived Files-Footnote-11161881 -Ref: Derived Files-Footnote-21161915 -Ref: Derived Files-Footnote-31162511 -Node: Future Extensions1162625 -Node: Implementation Limitations1163231 -Node: Extension Design1164479 -Node: Old Extension Problems1165633 -Ref: Old Extension Problems-Footnote-11167150 -Node: Extension New Mechanism Goals1167207 -Ref: Extension New Mechanism Goals-Footnote-11170567 -Node: Extension Other Design Decisions1170756 -Node: Extension Future Growth1172864 -Node: Old Extension Mechanism1173700 -Node: Notes summary1175462 -Node: Basic Concepts1176648 -Node: Basic High Level1177329 -Ref: figure-general-flow1177601 -Ref: figure-process-flow1178200 -Ref: Basic High Level-Footnote-11181429 -Node: Basic Data Typing1181614 -Node: Glossary1184942 -Node: Copying1216871 -Node: GNU Free Documentation License1254427 -Node: Index1279563 +Node: Getting Started73114 +Node: Running gawk75553 +Node: One-shot76743 +Node: Read Terminal78007 +Node: Long80038 +Node: Executable Scripts81551 +Ref: Executable Scripts-Footnote-184340 +Node: Comments84443 +Node: Quoting86925 +Node: DOS Quoting92443 +Node: Sample Data Files93118 +Node: Very Simple95713 +Node: Two Rules100612 +Node: More Complex102498 +Node: Statements/Lines105360 +Ref: Statements/Lines-Footnote-1109815 +Node: Other Features110080 +Node: When111016 +Ref: When-Footnote-1112770 +Node: Intro Summary112835 +Node: Invoking Gawk113719 +Node: Command Line115233 +Node: Options116031 +Ref: Options-Footnote-1131953 +Ref: Options-Footnote-2132182 +Node: Other Arguments132207 +Node: Naming Standard Input135155 +Node: Environment Variables136248 +Node: AWKPATH Variable136806 +Ref: AWKPATH Variable-Footnote-1140103 +Ref: AWKPATH Variable-Footnote-2140148 +Node: AWKLIBPATH Variable140408 +Node: Other Environment Variables141551 +Node: Exit Status145309 +Node: Include Files145985 +Node: Loading Shared Libraries149574 +Node: Obsolete151001 +Node: Undocumented151693 +Node: Invoking Summary151960 +Node: Regexp153623 +Node: Regexp Usage155077 +Node: Escape Sequences157114 +Node: Regexp Operators163124 +Ref: Regexp Operators-Footnote-1170534 +Ref: Regexp Operators-Footnote-2170681 +Node: Bracket Expressions170779 +Ref: table-char-classes172794 +Node: Leftmost Longest175736 +Node: Computed Regexps177038 +Node: GNU Regexp Operators180467 +Node: Case-sensitivity184139 +Ref: Case-sensitivity-Footnote-1187024 +Ref: Case-sensitivity-Footnote-2187259 +Node: Regexp Summary187367 +Node: Reading Files188834 +Node: Records190927 +Node: awk split records191660 +Node: gawk split records196589 +Ref: gawk split records-Footnote-1201128 +Node: Fields201165 +Ref: Fields-Footnote-1203943 +Node: Nonconstant Fields204029 +Ref: Nonconstant Fields-Footnote-1206267 +Node: Changing Fields206470 +Node: Field Separators212401 +Node: Default Field Splitting215105 +Node: Regexp Field Splitting216222 +Node: Single Character Fields219572 +Node: Command Line Field Separator220631 +Node: Full Line Fields223848 +Ref: Full Line Fields-Footnote-1225369 +Ref: Full Line Fields-Footnote-2225415 +Node: Field Splitting Summary225516 +Node: Constant Size227590 +Node: Splitting By Content232173 +Ref: Splitting By Content-Footnote-1236138 +Node: Multiple Line236301 +Ref: Multiple Line-Footnote-1242182 +Node: Getline242361 +Node: Plain Getline244568 +Node: Getline/Variable247208 +Node: Getline/File248357 +Node: Getline/Variable/File249742 +Ref: Getline/Variable/File-Footnote-1251345 +Node: Getline/Pipe251432 +Node: Getline/Variable/Pipe254110 +Node: Getline/Coprocess255241 +Node: Getline/Variable/Coprocess256505 +Node: Getline Notes257244 +Node: Getline Summary260038 +Ref: table-getline-variants260450 +Node: Read Timeout261279 +Ref: Read Timeout-Footnote-1265116 +Node: Command-line directories265174 +Node: Input Summary266079 +Node: Input Exercises269464 +Node: Printing270192 +Node: Print271969 +Node: Print Examples273426 +Node: Output Separators276205 +Node: OFMT278223 +Node: Printf279578 +Node: Basic Printf280363 +Node: Control Letters281935 +Node: Format Modifiers285920 +Node: Printf Examples291930 +Node: Redirection294416 +Node: Special FD301254 +Ref: Special FD-Footnote-1304420 +Node: Special Files304494 +Node: Other Inherited Files305111 +Node: Special Network306111 +Node: Special Caveats306973 +Node: Close Files And Pipes307922 +Ref: Close Files And Pipes-Footnote-1315113 +Ref: Close Files And Pipes-Footnote-2315261 +Node: Output Summary315411 +Node: Output Exercises316409 +Node: Expressions317089 +Node: Values318278 +Node: Constants318955 +Node: Scalar Constants319646 +Ref: Scalar Constants-Footnote-1320508 +Node: Nondecimal-numbers320758 +Node: Regexp Constants323768 +Node: Using Constant Regexps324294 +Node: Variables327457 +Node: Using Variables328114 +Node: Assignment Options330025 +Node: Conversion331900 +Node: Strings And Numbers332424 +Ref: Strings And Numbers-Footnote-1335489 +Node: Locale influences conversions335598 +Ref: table-locale-affects338344 +Node: All Operators338936 +Node: Arithmetic Ops339565 +Node: Concatenation342070 +Ref: Concatenation-Footnote-1344889 +Node: Assignment Ops344996 +Ref: table-assign-ops349975 +Node: Increment Ops351285 +Node: Truth Values and Conditions354716 +Node: Truth Values355799 +Node: Typing and Comparison356848 +Node: Variable Typing357664 +Node: Comparison Operators361331 +Ref: table-relational-ops361741 +Node: POSIX String Comparison365236 +Ref: POSIX String Comparison-Footnote-1366308 +Node: Boolean Ops366447 +Ref: Boolean Ops-Footnote-1370925 +Node: Conditional Exp371016 +Node: Function Calls372754 +Node: Precedence376634 +Node: Locales380294 +Node: Expressions Summary381926 +Node: Patterns and Actions384497 +Node: Pattern Overview385617 +Node: Regexp Patterns387296 +Node: Expression Patterns387839 +Node: Ranges391619 +Node: BEGIN/END394726 +Node: Using BEGIN/END395487 +Ref: Using BEGIN/END-Footnote-1398223 +Node: I/O And BEGIN/END398329 +Node: BEGINFILE/ENDFILE400644 +Node: Empty403541 +Node: Using Shell Variables403858 +Node: Action Overview406131 +Node: Statements408457 +Node: If Statement410305 +Node: While Statement411800 +Node: Do Statement413828 +Node: For Statement414976 +Node: Switch Statement418134 +Node: Break Statement420516 +Node: Continue Statement422557 +Node: Next Statement424384 +Node: Nextfile Statement426765 +Node: Exit Statement429393 +Node: Built-in Variables431804 +Node: User-modified432937 +Ref: User-modified-Footnote-1440640 +Node: Auto-set440702 +Ref: Auto-set-Footnote-1453754 +Ref: Auto-set-Footnote-2453959 +Node: ARGC and ARGV454015 +Node: Pattern Action Summary458233 +Node: Arrays460666 +Node: Array Basics461995 +Node: Array Intro462839 +Ref: figure-array-elements464773 +Ref: Array Intro-Footnote-1467393 +Node: Reference to Elements467521 +Node: Assigning Elements469983 +Node: Array Example470474 +Node: Scanning an Array472233 +Node: Controlling Scanning475253 +Ref: Controlling Scanning-Footnote-1480647 +Node: Numeric Array Subscripts480963 +Node: Uninitialized Subscripts483148 +Node: Delete484765 +Ref: Delete-Footnote-1487514 +Node: Multidimensional487571 +Node: Multiscanning490668 +Node: Arrays of Arrays492257 +Node: Arrays Summary497011 +Node: Functions499102 +Node: Built-in500141 +Node: Calling Built-in501219 +Node: Numeric Functions503214 +Ref: Numeric Functions-Footnote-1507230 +Ref: Numeric Functions-Footnote-2507587 +Ref: Numeric Functions-Footnote-3507635 +Node: String Functions507907 +Ref: String Functions-Footnote-1531408 +Ref: String Functions-Footnote-2531537 +Ref: String Functions-Footnote-3531785 +Node: Gory Details531872 +Ref: table-sub-escapes533653 +Ref: table-sub-proposed535168 +Ref: table-posix-sub536530 +Ref: table-gensub-escapes538067 +Ref: Gory Details-Footnote-1538900 +Node: I/O Functions539051 +Ref: I/O Functions-Footnote-1546287 +Node: Time Functions546434 +Ref: Time Functions-Footnote-1556943 +Ref: Time Functions-Footnote-2557011 +Ref: Time Functions-Footnote-3557169 +Ref: Time Functions-Footnote-4557280 +Ref: Time Functions-Footnote-5557392 +Ref: Time Functions-Footnote-6557619 +Node: Bitwise Functions557885 +Ref: table-bitwise-ops558447 +Ref: Bitwise Functions-Footnote-1562775 +Node: Type Functions562947 +Node: I18N Functions564099 +Node: User-defined565746 +Node: Definition Syntax566551 +Ref: Definition Syntax-Footnote-1572210 +Node: Function Example572281 +Ref: Function Example-Footnote-1575202 +Node: Function Caveats575224 +Node: Calling A Function575742 +Node: Variable Scope576700 +Node: Pass By Value/Reference579693 +Node: Return Statement583190 +Node: Dynamic Typing586169 +Node: Indirect Calls587098 +Ref: Indirect Calls-Footnote-1598404 +Node: Functions Summary598532 +Node: Library Functions601234 +Ref: Library Functions-Footnote-1604842 +Ref: Library Functions-Footnote-2604985 +Node: Library Names605156 +Ref: Library Names-Footnote-1608614 +Ref: Library Names-Footnote-2608837 +Node: General Functions608923 +Node: Strtonum Function610026 +Node: Assert Function613048 +Node: Round Function616372 +Node: Cliff Random Function617913 +Node: Ordinal Functions618929 +Ref: Ordinal Functions-Footnote-1621992 +Ref: Ordinal Functions-Footnote-2622244 +Node: Join Function622455 +Ref: Join Function-Footnote-1624225 +Node: Getlocaltime Function624425 +Node: Readfile Function628169 +Node: Shell Quoting630141 +Node: Data File Management631542 +Node: Filetrans Function632174 +Node: Rewind Function636270 +Node: File Checking637656 +Ref: File Checking-Footnote-1638989 +Node: Empty Files639190 +Node: Ignoring Assigns641169 +Node: Getopt Function642719 +Ref: Getopt Function-Footnote-1654183 +Node: Passwd Functions654383 +Ref: Passwd Functions-Footnote-1663223 +Node: Group Functions663311 +Ref: Group Functions-Footnote-1671208 +Node: Walking Arrays671413 +Node: Library Functions Summary673013 +Node: Library Exercises674417 +Node: Sample Programs675697 +Node: Running Examples676467 +Node: Clones677195 +Node: Cut Program678419 +Node: Egrep Program688139 +Ref: Egrep Program-Footnote-1695642 +Node: Id Program695752 +Node: Split Program699428 +Ref: Split Program-Footnote-1702882 +Node: Tee Program703010 +Node: Uniq Program705799 +Node: Wc Program713218 +Ref: Wc Program-Footnote-1717468 +Node: Miscellaneous Programs717562 +Node: Dupword Program718775 +Node: Alarm Program720806 +Node: Translate Program725611 +Ref: Translate Program-Footnote-1730174 +Node: Labels Program730444 +Ref: Labels Program-Footnote-1733795 +Node: Word Sorting733879 +Node: History Sorting737949 +Node: Extract Program739784 +Node: Simple Sed747308 +Node: Igawk Program750378 +Ref: Igawk Program-Footnote-1764704 +Ref: Igawk Program-Footnote-2764905 +Ref: Igawk Program-Footnote-3765027 +Node: Anagram Program765142 +Node: Signature Program768203 +Node: Programs Summary769450 +Node: Programs Exercises770671 +Ref: Programs Exercises-Footnote-1774802 +Node: Advanced Features774893 +Node: Nondecimal Data776875 +Node: Array Sorting778465 +Node: Controlling Array Traversal779165 +Ref: Controlling Array Traversal-Footnote-1787531 +Node: Array Sorting Functions787649 +Ref: Array Sorting Functions-Footnote-1791535 +Node: Two-way I/O791731 +Ref: Two-way I/O-Footnote-1796676 +Ref: Two-way I/O-Footnote-2796862 +Node: TCP/IP Networking796944 +Node: Profiling799816 +Node: Advanced Features Summary807357 +Node: Internationalization809290 +Node: I18N and L10N810770 +Node: Explaining gettext811456 +Ref: Explaining gettext-Footnote-1816481 +Ref: Explaining gettext-Footnote-2816665 +Node: Programmer i18n816830 +Ref: Programmer i18n-Footnote-1821706 +Node: Translator i18n821755 +Node: String Extraction822549 +Ref: String Extraction-Footnote-1823680 +Node: Printf Ordering823766 +Ref: Printf Ordering-Footnote-1826552 +Node: I18N Portability826616 +Ref: I18N Portability-Footnote-1829072 +Node: I18N Example829135 +Ref: I18N Example-Footnote-1831938 +Node: Gawk I18N832010 +Node: I18N Summary832654 +Node: Debugger833994 +Node: Debugging835016 +Node: Debugging Concepts835457 +Node: Debugging Terms837267 +Node: Awk Debugging839839 +Node: Sample Debugging Session840745 +Node: Debugger Invocation841279 +Node: Finding The Bug842664 +Node: List of Debugger Commands849143 +Node: Breakpoint Control850475 +Node: Debugger Execution Control854152 +Node: Viewing And Changing Data857511 +Node: Execution Stack860887 +Node: Debugger Info862522 +Node: Miscellaneous Debugger Commands866567 +Node: Readline Support871568 +Node: Limitations872462 +Node: Debugging Summary874577 +Node: Arbitrary Precision Arithmetic875751 +Node: Computer Arithmetic877167 +Ref: table-numeric-ranges880766 +Ref: Computer Arithmetic-Footnote-1881290 +Node: Math Definitions881347 +Ref: table-ieee-formats884642 +Ref: Math Definitions-Footnote-1885246 +Node: MPFR features885351 +Node: FP Math Caution887022 +Ref: FP Math Caution-Footnote-1888072 +Node: Inexactness of computations888441 +Node: Inexact representation889400 +Node: Comparing FP Values890758 +Node: Errors accumulate891840 +Node: Getting Accuracy893272 +Node: Try To Round895976 +Node: Setting precision896875 +Ref: table-predefined-precision-strings897559 +Node: Setting the rounding mode899388 +Ref: table-gawk-rounding-modes899752 +Ref: Setting the rounding mode-Footnote-1903204 +Node: Arbitrary Precision Integers903383 +Ref: Arbitrary Precision Integers-Footnote-1906367 +Node: POSIX Floating Point Problems906516 +Ref: POSIX Floating Point Problems-Footnote-1910395 +Node: Floating point summary910433 +Node: Dynamic Extensions912629 +Node: Extension Intro914181 +Node: Plugin License915446 +Node: Extension Mechanism Outline916243 +Ref: figure-load-extension916671 +Ref: figure-register-new-function918151 +Ref: figure-call-new-function919155 +Node: Extension API Description921142 +Node: Extension API Functions Introduction922592 +Node: General Data Types927413 +Ref: General Data Types-Footnote-1933312 +Node: Memory Allocation Functions933611 +Ref: Memory Allocation Functions-Footnote-1936450 +Node: Constructor Functions936546 +Node: Registration Functions938280 +Node: Extension Functions938965 +Node: Exit Callback Functions941262 +Node: Extension Version String942510 +Node: Input Parsers943175 +Node: Output Wrappers953054 +Node: Two-way processors957569 +Node: Printing Messages959773 +Ref: Printing Messages-Footnote-1960849 +Node: Updating `ERRNO'961001 +Node: Requesting Values961741 +Ref: table-value-types-returned962469 +Node: Accessing Parameters963426 +Node: Symbol Table Access964657 +Node: Symbol table by name965171 +Node: Symbol table by cookie967152 +Ref: Symbol table by cookie-Footnote-1971296 +Node: Cached values971359 +Ref: Cached values-Footnote-1974858 +Node: Array Manipulation974949 +Ref: Array Manipulation-Footnote-1976047 +Node: Array Data Types976084 +Ref: Array Data Types-Footnote-1978739 +Node: Array Functions978831 +Node: Flattening Arrays982685 +Node: Creating Arrays989577 +Node: Extension API Variables994348 +Node: Extension Versioning994984 +Node: Extension API Informational Variables996885 +Node: Extension API Boilerplate997950 +Node: Finding Extensions1001759 +Node: Extension Example1002319 +Node: Internal File Description1003091 +Node: Internal File Ops1007158 +Ref: Internal File Ops-Footnote-11018828 +Node: Using Internal File Ops1018968 +Ref: Using Internal File Ops-Footnote-11021351 +Node: Extension Samples1021624 +Node: Extension Sample File Functions1023150 +Node: Extension Sample Fnmatch1030788 +Node: Extension Sample Fork1032279 +Node: Extension Sample Inplace1033494 +Node: Extension Sample Ord1035169 +Node: Extension Sample Readdir1036005 +Ref: table-readdir-file-types1036881 +Node: Extension Sample Revout1037692 +Node: Extension Sample Rev2way1038282 +Node: Extension Sample Read write array1039022 +Node: Extension Sample Readfile1040962 +Node: Extension Sample Time1042057 +Node: Extension Sample API Tests1043406 +Node: gawkextlib1043897 +Node: Extension summary1046555 +Node: Extension Exercises1050244 +Node: Language History1050966 +Node: V7/SVR3.11052622 +Node: SVR41054803 +Node: POSIX1056248 +Node: BTL1057637 +Node: POSIX/GNU1058371 +Node: Feature History1063935 +Node: Common Extensions1077033 +Node: Ranges and Locales1078357 +Ref: Ranges and Locales-Footnote-11082975 +Ref: Ranges and Locales-Footnote-21083002 +Ref: Ranges and Locales-Footnote-31083236 +Node: Contributors1083457 +Node: History summary1088998 +Node: Installation1090368 +Node: Gawk Distribution1091314 +Node: Getting1091798 +Node: Extracting1092621 +Node: Distribution contents1094256 +Node: Unix Installation1099973 +Node: Quick Installation1100590 +Node: Additional Configuration Options1103014 +Node: Configuration Philosophy1104752 +Node: Non-Unix Installation1107121 +Node: PC Installation1107579 +Node: PC Binary Installation1108898 +Node: PC Compiling1110746 +Ref: PC Compiling-Footnote-11113767 +Node: PC Testing1113876 +Node: PC Using1115052 +Node: Cygwin1119167 +Node: MSYS1119990 +Node: VMS Installation1120490 +Node: VMS Compilation1121282 +Ref: VMS Compilation-Footnote-11122504 +Node: VMS Dynamic Extensions1122562 +Node: VMS Installation Details1124246 +Node: VMS Running1126498 +Node: VMS GNV1129334 +Node: VMS Old Gawk1130068 +Node: Bugs1130538 +Node: Other Versions1134421 +Node: Installation summary1140845 +Node: Notes1141901 +Node: Compatibility Mode1142766 +Node: Additions1143548 +Node: Accessing The Source1144473 +Node: Adding Code1145908 +Node: New Ports1152065 +Node: Derived Files1156547 +Ref: Derived Files-Footnote-11162022 +Ref: Derived Files-Footnote-21162056 +Ref: Derived Files-Footnote-31162652 +Node: Future Extensions1162766 +Node: Implementation Limitations1163372 +Node: Extension Design1164620 +Node: Old Extension Problems1165774 +Ref: Old Extension Problems-Footnote-11167291 +Node: Extension New Mechanism Goals1167348 +Ref: Extension New Mechanism Goals-Footnote-11170708 +Node: Extension Other Design Decisions1170897 +Node: Extension Future Growth1173005 +Node: Old Extension Mechanism1173841 +Node: Notes summary1175603 +Node: Basic Concepts1176789 +Node: Basic High Level1177470 +Ref: figure-general-flow1177742 +Ref: figure-process-flow1178341 +Ref: Basic High Level-Footnote-11181570 +Node: Basic Data Typing1181755 +Node: Glossary1185083 +Node: Copying1217012 +Node: GNU Free Documentation License1254568 +Node: Index1279704  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 3f2afed3..e7d979d9 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -1300,7 +1300,7 @@ October 2014 Nof Ayalon Israel - December 2014 + February 2015 @end docbook @@ -2284,14 +2284,14 @@ which they raised and educated me. Finally, I also must acknowledge my gratitude to G-d, for the many opportunities He has sent my way, as well as for the gifts He has given me with which to take advantage of those opportunities. -@iftex +@ifnotdocbook @sp 2 @noindent Arnold Robbins @* Nof Ayalon @* Israel @* -December 2014 -@end iftex +February 2015 +@end ifnotdocbook @ifnotinfo @part @value{PART1}The @command{awk} Language @@ -31589,7 +31589,7 @@ indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings require more work. Because @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a -data-pointer and length. This is the @code{awk_string_t} type. +data pointer and length. This is the @code{awk_string_t} type. Identifiers (i.e., the names of global variables) can be associated with either scalar values or with arrays. In addition, @command{gawk} @@ -31602,12 +31602,12 @@ of the @code{union} as if they were fields in a @code{struct}; this is a common coding practice in C. Such code is easier to write and to read, but it remains @emph{your} responsibility to make sure that the @code{val_type} member correctly reflects the type of the value in -the @code{awk_value_t}. +the @code{awk_value_t} struct. Conceptually, the first three members of the @code{union} (number, string, and array) are all that is needed for working with @command{awk} values. However, because the API provides routines for accessing and changing -the value of global scalar variables only by using the variable's name, +the value of a global scalar variable only by using the variable's name, there is a performance penalty: @command{gawk} must find the variable each time it is accessed and changed. This turns out to be a real issue, not just a theoretical one. @@ -31625,7 +31625,9 @@ See also the entry for ``Cookie'' in the @ref{Glossary}. object for that variable, and then use the cookie for getting the variable's value or for changing the variable's value. -This is the @code{awk_scalar_t} type and @code{scalar_cookie} macro. +The @code{awk_scalar_t} type holds a scalar cookie, and the +@code{scalar_cookie} macro provides access to the value of that type +in the @code{awk_value_t} struct. Given a scalar cookie, @command{gawk} can directly retrieve or modify the value, as required, without having to find it first. @@ -31634,8 +31636,8 @@ If you know that you wish to use the same numeric or string @emph{value} for one or more variables, you can create the value once, retaining a @dfn{value cookie} for it, and then pass in that value cookie whenever you wish to set the value of a -variable. This saves both storage space within the running @command{gawk} -process as well as the time needed to create the value. +variable. This both storage space within the running @command{gawk} +process and reduces the time needed to create the value. @node Memory Allocation Functions @subsection Memory Allocation Functions and Convenience Macros diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 3e97423a..c41d5a68 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -1295,7 +1295,7 @@ October 2014 Nof Ayalon Israel - December 2014 + February 2015 @end docbook @@ -2251,14 +2251,14 @@ which they raised and educated me. Finally, I also must acknowledge my gratitude to G-d, for the many opportunities He has sent my way, as well as for the gifts He has given me with which to take advantage of those opportunities. -@iftex +@ifnotdocbook @sp 2 @noindent Arnold Robbins @* Nof Ayalon @* Israel @* -December 2014 -@end iftex +February 2015 +@end ifnotdocbook @ifnotinfo @part @value{PART1}The @command{awk} Language @@ -30680,7 +30680,7 @@ indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings require more work. Because @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a -data-pointer and length. This is the @code{awk_string_t} type. +data pointer and length. This is the @code{awk_string_t} type. Identifiers (i.e., the names of global variables) can be associated with either scalar values or with arrays. In addition, @command{gawk} @@ -30693,12 +30693,12 @@ of the @code{union} as if they were fields in a @code{struct}; this is a common coding practice in C. Such code is easier to write and to read, but it remains @emph{your} responsibility to make sure that the @code{val_type} member correctly reflects the type of the value in -the @code{awk_value_t}. +the @code{awk_value_t} struct. Conceptually, the first three members of the @code{union} (number, string, and array) are all that is needed for working with @command{awk} values. However, because the API provides routines for accessing and changing -the value of global scalar variables only by using the variable's name, +the value of a global scalar variable only by using the variable's name, there is a performance penalty: @command{gawk} must find the variable each time it is accessed and changed. This turns out to be a real issue, not just a theoretical one. @@ -30716,7 +30716,9 @@ See also the entry for ``Cookie'' in the @ref{Glossary}. object for that variable, and then use the cookie for getting the variable's value or for changing the variable's value. -This is the @code{awk_scalar_t} type and @code{scalar_cookie} macro. +The @code{awk_scalar_t} type holds a scalar cookie, and the +@code{scalar_cookie} macro provides access to the value of that type +in the @code{awk_value_t} struct. Given a scalar cookie, @command{gawk} can directly retrieve or modify the value, as required, without having to find it first. @@ -30725,8 +30727,8 @@ If you know that you wish to use the same numeric or string @emph{value} for one or more variables, you can create the value once, retaining a @dfn{value cookie} for it, and then pass in that value cookie whenever you wish to set the value of a -variable. This saves both storage space within the running @command{gawk} -process as well as the time needed to create the value. +variable. This both storage space within the running @command{gawk} +process and reduces the time needed to create the value. @node Memory Allocation Functions @subsection Memory Allocation Functions and Convenience Macros -- cgit v1.2.3 From b3dcca92ca8160c07dad32617339fc5d3c636425 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 10 Feb 2015 22:22:11 +0200 Subject: Bug fix in profile.c. --- ChangeLog | 5 +++++ profile.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index f116265a..026be5e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-02-10 Arnold D. Robbins + + * profile.c (pprint): Restore printing of count for rules. + Bug report by Hermann Peifer. + 2015-02-07 Arnold D. Robbins * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h, diff --git a/profile.c b/profile.c index 233bca0f..2cb9e159 100644 --- a/profile.c +++ b/profile.c @@ -226,6 +226,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header) if (do_profile && ! rule_count[rule]++) fprintf(prof_fp, _("\t# Rule(s)\n\n")); ip1 = pc->nexti; + indent(ip1->exec_count); if (ip1 != (pc + 1)->firsti) { /* non-empty pattern */ pprint(ip1->nexti, (pc + 1)->firsti, false); /* Allow for case where the "pattern" is just a comment */ -- cgit v1.2.3 From 2f49027b6d6b1f03ae07c5cd9625b072465079bd Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 11 Feb 2015 23:21:28 +0200 Subject: O'Reilly edits, through Chapter 16. --- ChangeLog | 4 + doc/ChangeLog | 4 + doc/gawk.info | 575 +++++++++++++++++++++++++------------------------- doc/gawk.texi | 272 ++++++++++++------------ doc/gawktexi.in | 272 ++++++++++++------------ extension/ChangeLog | 4 + extension/filefuncs.c | 2 +- gawkapi.h | 2 +- 8 files changed, 582 insertions(+), 553 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d175372..773afd3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-02-11 Arnold D. Robbins + + * gawkapi.h: Fix spelling error in comment. + 2015-02-07 Arnold D. Robbins * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h, diff --git a/doc/ChangeLog b/doc/ChangeLog index c62d3022..9af9ef06 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-11 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + 2015-02-10 Arnold D. Robbins * gawktexi.in: Minor fixes, O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index eb8d07b5..8061bbd2 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -23071,7 +23071,7 @@ first. If you know that you wish to use the same numeric or string _value_ for one or more variables, you can create the value once, retaining a "value cookie" for it, and then pass in that value cookie whenever you -wish to set the value of a variable. This both storage space within +wish to set the value of a variable. This saves storage space within the running `gawk' process and reduces the time needed to create the value. @@ -23108,7 +23108,7 @@ prototypes, in the way that extension code would use them: `void gawk_free(void *ptr);' Call the correct version of `free()' to release storage that was - allocated with `gawk_malloc()', `gawk_calloc()' or + allocated with `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()'. The API has to provide these functions because it is possible for an @@ -23120,7 +23120,7 @@ version of `malloc()', unexpected behavior would likely result. Two convenience macros may be used for allocating storage from `gawk_malloc()' and `gawk_realloc()'. If the allocation fails, they cause `gawk' to exit with a fatal error message. They should be used -as if they were procedure calls that do not return a value. +as if they were procedure calls that do not return a value: `#define emalloc(pointer, type, size, message) ...' The arguments to this macro are as follows: @@ -23150,13 +23150,13 @@ as if they were procedure calls that do not return a value. make_malloced_string(message, strlen(message), & result); `#define erealloc(pointer, type, size, message) ...' - This is like `emalloc()', but it calls `gawk_realloc()', instead - of `gawk_malloc()'. The arguments are the same as for the + This is like `emalloc()', but it calls `gawk_realloc()' instead of + `gawk_malloc()'. The arguments are the same as for the `emalloc()' macro. ---------- Footnotes ---------- - (1) This is more common on MS-Windows systems, but can happen on + (1) This is more common on MS-Windows systems, but it can happen on Unix-like systems as well.  @@ -23182,7 +23182,7 @@ extension code would use them: This function creates a string value in the `awk_value_t' variable pointed to by `result'. It expects `string' to be a `char *' value pointing to data previously obtained from `gawk_malloc()', - `gawk_calloc()' or `gawk_realloc()'. The idea here is that the + `gawk_calloc()', or `gawk_realloc()'. The idea here is that the data is passed directly to `gawk', which assumes responsibility for it. It returns `result'. @@ -23232,7 +23232,7 @@ Extension functions are described by the following record: The fields are: `const char *name;' - The name of the new function. `awk' level code calls the function + The name of the new function. `awk'-level code calls the function by this name. This is a regular C string. Function names must obey the rules for `awk' identifiers. That is, @@ -23244,7 +23244,7 @@ Extension functions are described by the following record: This is a pointer to the C function that provides the extension's functionality. The function must fill in `*result' with either a number or a string. `gawk' takes ownership of any string memory. - As mentioned earlier, string memory *must* come from one of + As mentioned earlier, string memory _must_ come from one of `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()'. The `num_actual_args' argument tells the C function how many @@ -23291,10 +23291,10 @@ function with `gawk' using the following function: `gawk' intends to pass to the `exit()' system call. `arg0' - A pointer to private data which `gawk' saves in order to pass + A pointer to private data that `gawk' saves in order to pass to the function pointed to by `funcp'. - Exit callback functions are called in last-in-first-out (LIFO) + Exit callback functions are called in last-in, first-out (LIFO) order--that is, in the reverse order in which they are registered with `gawk'. @@ -23304,8 +23304,8 @@ File: gawk.info, Node: Extension Version String, Next: Input Parsers, Prev: E 16.4.5.3 Registering An Extension Version String ................................................ -You can register a version string which indicates the name and version -of your extension, with `gawk', as follows: +You can register a version string that indicates the name and version +of your extension with `gawk', as follows: `void register_ext_version(const char *version);' Register the string pointed to by `version' with `gawk'. Note @@ -23328,7 +23328,7 @@ Files::). Additionally, it sets the value of `RT' (*note Built-in Variables::). If you want, you can provide your own custom input parser. An input -parser's job is to return a record to the `gawk' record processing +parser's job is to return a record to the `gawk' record-processing code, along with indicators for the value and length of the data to be used for `RT', if any. @@ -23345,10 +23345,10 @@ used for `RT', if any. `awk_bool_t XXX_take_control_of(awk_input_buf_t *iobuf);' When `gawk' decides to hand control of the file over to the input parser, it calls this function. This function in turn must fill - in certain fields in the `awk_input_buf_t' structure, and ensure + in certain fields in the `awk_input_buf_t' structure and ensure that certain conditions are true. It should then return true. If - an error of some kind occurs, it should not fill in any fields, - and should return false; then `gawk' will not use the input parser. + an error of some kind occurs, it should not fill in any fields and + should return false; then `gawk' will not use the input parser. The details are presented shortly. Your extension should package these functions inside an @@ -23425,10 +23425,10 @@ the `struct stat', or any combination of these factors. Once `XXX_can_take_file()' has returned true, and `gawk' has decided to use your input parser, it calls `XXX_take_control_of()'. That -function then fills one of either the `get_record' field or the -`read_func' field in the `awk_input_buf_t'. It must also ensure that -`fd' is _not_ set to `INVALID_HANDLE'. The following list describes -the fields that may be filled by `XXX_take_control_of()': +function then fills either the `get_record' field or the `read_func' +field in the `awk_input_buf_t'. It must also ensure that `fd' is _not_ +set to `INVALID_HANDLE'. The following list describes the fields that +may be filled by `XXX_take_control_of()': `void *opaque;' This is used to hold any state information needed by the input @@ -23445,22 +23445,22 @@ the fields that may be filled by `XXX_take_control_of()': Its behavior is described in the text following this list. `ssize_t (*read_func)();' - This function pointer should point to function that has the same + This function pointer should point to a function that has the same behavior as the standard POSIX `read()' system call. It is an alternative to the `get_record' pointer. Its behavior is also described in the text following this list. `void (*close_func)(struct awk_input *iobuf);' This function pointer should point to a function that does the - "tear down." It should release any resources allocated by + "teardown." It should release any resources allocated by `XXX_take_control_of()'. It may also close the file. If it does so, it should set the `fd' field to `INVALID_HANDLE'. If `fd' is still not `INVALID_HANDLE' after the call to this function, `gawk' calls the regular `close()' system call. - Having a "tear down" function is optional. If your input parser - does not need it, do not set this field. Then, `gawk' calls the + Having a "teardown" function is optional. If your input parser does + not need it, do not set this field. Then, `gawk' calls the regular `close()' system call on the file descriptor, so it should be valid. @@ -23468,7 +23468,7 @@ the fields that may be filled by `XXX_take_control_of()': records. The parameters are as follows: `char **out' - This is a pointer to a `char *' variable which is set to point to + This is a pointer to a `char *' variable that is set to point to the record. `gawk' makes its own copy of the data, so the extension must manage this storage. @@ -23517,16 +23517,16 @@ explicitly. NOTE: You must choose one method or the other: either a function that returns a record, or one that returns raw data. In particular, if you supply a function to get a record, `gawk' will - call it, and never call the raw read function. + call it, and will never call the raw read function. `gawk' ships with a sample extension that reads directories, -returning records for each entry in the directory (*note Extension -Sample Readdir::). You may wish to use that code as a guide for writing -your own input parser. +returning records for each entry in a directory (*note Extension Sample +Readdir::). You may wish to use that code as a guide for writing your +own input parser. When writing an input parser, you should think about (and document) how it is expected to interact with `awk' code. You may want it to -always be called, and take effect as appropriate (as the `readdir' +always be called, and to take effect as appropriate (as the `readdir' extension does). Or you may want it to take effect based upon the value of an `awk' variable, as the XML extension from the `gawkextlib' project does (*note gawkextlib::). In the latter case, code in a @@ -23626,17 +23626,17 @@ in the `awk_output_buf_t'. The data members are as follows: These pointers should be set to point to functions that perform the equivalent function as the `' functions do, if appropriate. `gawk' uses these function pointers for all output. - `gawk' initializes the pointers to point to internal, "pass - through" functions that just call the regular `' - functions, so an extension only needs to redefine those functions - that are appropriate for what it does. + `gawk' initializes the pointers to point to internal "pass-through" + functions that just call the regular `' functions, so an + extension only needs to redefine those functions that are + appropriate for what it does. The `XXX_can_take_file()' function should make a decision based upon the `name' and `mode' fields, and any additional state (such as `awk' variable values) that is appropriate. When `gawk' calls `XXX_take_control_of()', that function should fill -in the other fields, as appropriate, except for `fp', which it should +in the other fields as appropriate, except for `fp', which it should just use normally. You register your output wrapper with the following function: @@ -23673,16 +23673,17 @@ structures as described earlier. The name of the two-way processor. `awk_bool_t (*can_take_two_way)(const char *name);' - This function returns true if it wants to take over two-way I/O - for this file name. It should not change any state (variable - values, etc.) within `gawk'. + The function pointed to by this field should return true if it + wants to take over two-way I/O for this file name. It should not + change any state (variable values, etc.) within `gawk'. `awk_bool_t (*take_control_of)(const char *name,' ` awk_input_buf_t *inbuf,' ` awk_output_buf_t *outbuf);' - This function should fill in the `awk_input_buf_t' and - `awk_outut_buf_t' structures pointed to by `inbuf' and `outbuf', - respectively. These structures were described earlier. + The function pointed to by this field should fill in the + `awk_input_buf_t' and `awk_outut_buf_t' structures pointed to by + `inbuf' and `outbuf', respectively. These structures were + described earlier. `awk_const struct two_way_processor *awk_const next;' This is for use by `gawk'; therefore it is marked `awk_const' so @@ -23706,7 +23707,7 @@ File: gawk.info, Node: Printing Messages, Next: Updating `ERRNO', Prev: Regis You can print different kinds of warning messages from your extension, as described here. Note that for these functions, you must pass in the -extension id received from `gawk' when the extension was loaded:(1) +extension ID received from `gawk' when the extension was loaded:(1) `void fatal(awk_ext_id_t id, const char *format, ...);' Print a message and then cause `gawk' to exit immediately. @@ -23762,7 +23763,7 @@ value you expect. If the actual value matches what you requested, the function returns true and fills in the `awk_value_t' result. Otherwise, the function returns false, and the `val_type' member indicates the type of the actual value. You may then print an error -message, or reissue the request for the actual value type, as +message or reissue the request for the actual value type, as appropriate. This behavior is summarized in *note table-value-types-returned::. @@ -23771,15 +23772,15 @@ table-value-types-returned::. String Number Array Undefined ------------------------------------------------------------------------------ - String String String false false - Number Number if can Number false false + String String String False False + Number Number if can Number False False be converted, else false -Type Array false false Array false -Requested Scalar Scalar Scalar false false +Type Array False False Array False +Requested Scalar Scalar Scalar False False Undefined String Number Array Undefined - Value false false false false - Cookie + Value False False False False + cookie Table 16.1: API value types returned @@ -23796,16 +23797,16 @@ your extension function. They are: ` awk_valtype_t wanted,' ` awk_value_t *result);' Fill in the `awk_value_t' structure pointed to by `result' with - the `count''th argument. Return true if the actual type matches - `wanted', false otherwise. In the latter case, `result->val_type' - indicates the actual type (*note Table 16.1: - table-value-types-returned.). Counts are zero based--the first + the `count'th argument. Return true if the actual type matches + `wanted', and false otherwise. In the latter case, + `result->val_type' indicates the actual type (*note Table 16.1: + table-value-types-returned.). Counts are zero-based--the first argument is numbered zero, the second one, and so on. `wanted' indicates the type of value expected. `awk_bool_t set_argument(size_t count, awk_array_t array);' Convert a parameter that was undefined into an array; this provides - call-by-reference for arrays. Return false if `count' is too big, + call by reference for arrays. Return false if `count' is too big, or if the argument's type is not undefined. *Note Array Manipulation::, for more information on creating arrays. @@ -23833,8 +23834,8 @@ File: gawk.info, Node: Symbol table by name, Next: Symbol table by cookie, Up The following routines provide the ability to access and update global `awk'-level variables by name. In compiler terminology, identifiers of different kinds are termed "symbols", thus the "sym" in the routines' -names. The data structure which stores information about symbols is -termed a "symbol table". +names. The data structure that stores information about symbols is +termed a "symbol table". The functions are as follows: `awk_bool_t sym_lookup(const char *name,' ` awk_valtype_t wanted,' @@ -23842,14 +23843,14 @@ termed a "symbol table". Fill in the `awk_value_t' structure pointed to by `result' with the value of the variable named by the string `name', which is a regular C string. `wanted' indicates the type of value expected. - Return true if the actual type matches `wanted', false otherwise. - In the latter case, `result->val_type' indicates the actual type - (*note Table 16.1: table-value-types-returned.). + Return true if the actual type matches `wanted', and false + otherwise. In the latter case, `result->val_type' indicates the + actual type (*note Table 16.1: table-value-types-returned.). `awk_bool_t sym_update(const char *name, awk_value_t *value);' Update the variable named by the string `name', which is a regular C string. The variable is added to `gawk''s symbol table if it is - not there. Return true if everything worked, false otherwise. + not there. Return true if everything worked, and false otherwise. Changing types (scalar to array or vice versa) of an existing variable is _not_ allowed, nor may this routine be used to update @@ -23874,7 +23875,7 @@ File: gawk.info, Node: Symbol table by cookie, Next: Cached values, Prev: Sym A "scalar cookie" is an opaque handle that provides access to a global variable or array. It is an optimization that avoids looking up variables in `gawk''s symbol table every time access is needed. This -was discussed earlier in *note General Data Types::. +was discussed earlier, in *note General Data Types::. The following functions let you work with scalar cookies: @@ -23985,7 +23986,7 @@ File: gawk.info, Node: Cached values, Prev: Symbol table by cookie, Up: Symbo .......................................... The routines in this section allow you to create and release cached -values. As with scalar cookies, in theory, cached values are not +values. Like scalar cookies, in theory, cached values are not necessary. You can create numbers and strings using the functions in *note Constructor Functions::. You can then assign those values to variables using `sym_update()' or `sym_update_scalar()', as you like. @@ -24056,7 +24057,7 @@ Using value cookies in this way saves considerable storage, as all of `VAR1' through `VAR100' share the same value. You might be wondering, "Is this sharing problematic? What happens -if `awk' code assigns a new value to `VAR1', are all the others changed +if `awk' code assigns a new value to `VAR1'; are all the others changed too?" That's a great question. The answer is that no, it's not a problem. @@ -24175,7 +24176,7 @@ File: gawk.info, Node: Array Functions, Next: Flattening Arrays, Prev: Array 16.4.11.2 Array Functions ......................... -The following functions relate to individual array elements. +The following functions relate to individual array elements: `awk_bool_t get_element_count(awk_array_t a_cookie, size_t *count);' For the array represented by `a_cookie', place in `*count' the @@ -24193,13 +24194,14 @@ The following functions relate to individual array elements. (*note Table 16.1: table-value-types-returned.). The value for `index' can be numeric, in which case `gawk' - converts it to a string. Using non-integral values is possible, but + converts it to a string. Using nonintegral values is possible, but requires that you understand how such values are converted to - strings (*note Conversion::); thus using integral values is safest. + strings (*note Conversion::); thus, using integral values is + safest. As with _all_ strings passed into `gawk' from an extension, the string value of `index' must come from `gawk_malloc()', - `gawk_calloc()' or `gawk_realloc()', and `gawk' releases the + `gawk_calloc()', or `gawk_realloc()', and `gawk' releases the storage. `awk_bool_t set_array_element(awk_array_t a_cookie,' @@ -24243,9 +24245,9 @@ The following functions relate to individual array elements. `awk_bool_t release_flattened_array(awk_array_t a_cookie,' ` awk_flat_array_t *data);' When done with a flattened array, release the storage using this - function. You must pass in both the original array cookie, and - the address of the created `awk_flat_array_t' structure. The - function returns true upon success, false otherwise. + function. You must pass in both the original array cookie and the + address of the created `awk_flat_array_t' structure. The function + returns true upon success, false otherwise.  File: gawk.info, Node: Flattening Arrays, Next: Creating Arrays, Prev: Array Functions, Up: Array Manipulation @@ -24255,8 +24257,8 @@ File: gawk.info, Node: Flattening Arrays, Next: Creating Arrays, Prev: Array To "flatten" an array is to create a structure that represents the full array in a fashion that makes it easy for C code to traverse the entire -array. Test code in `extension/testext.c' does this, and also serves -as a nice example showing how to use the APIs. +array. Some of the code in `extension/testext.c' does this, and also +serves as a nice example showing how to use the APIs. We walk through that part of the code one step at a time. First, the `gawk' script that drives the test extension: @@ -24305,9 +24307,8 @@ number of arguments: } The function then proceeds in steps, as follows. First, retrieve the -name of the array, passed as the first argument. Then retrieve the -array itself. If either operation fails, print error messages and -return: +name of the array, passed as the first argument, followed by the array +itself. If either operation fails, print an error message and return: /* get argument named array as flat array and print it */ if (get_argument(0, AWK_STRING, & value)) { @@ -24337,9 +24338,9 @@ count of elements in the array and print it: printf("dump_array_and_delete: incoming size is %lu\n", (unsigned long) count); - The third step is to actually flatten the array, and then to double -check that the count in the `awk_flat_array_t' is the same as the count -just retrieved: + The third step is to actually flatten the array, and then to +double-check that the count in the `awk_flat_array_t' is the same as +the count just retrieved: if (! flatten_array(value2.array_cookie, & flat_array)) { printf("dump_array_and_delete: could not flatten array\n"); @@ -24356,7 +24357,7 @@ just retrieved: The fourth step is to retrieve the index of the element to be deleted, which was passed as the second argument. Remember that -argument counts passed to `get_argument()' are zero-based, thus the +argument counts passed to `get_argument()' are zero-based, and thus the second argument is numbered one: if (! get_argument(1, AWK_STRING, & value3)) { @@ -24369,7 +24370,7 @@ over every element in the array, printing the index and element values. In addition, upon finding the element with the index that is supposed to be deleted, the function sets the `AWK_ELEMENT_DELETE' bit in the `flags' field of the element. When the array is released, `gawk' -traverses the flattened array, and deletes any elements which have this +traverses the flattened array, and deletes any elements that have this flag bit set: for (i = 0; i < flat_array->count; i++) { @@ -24587,10 +24588,10 @@ The API provides both a "major" and a "minor" version number. The API versions are available at compile time as constants: `GAWK_API_MAJOR_VERSION' - The major version of the API. + The major version of the API `GAWK_API_MINOR_VERSION' - The minor version of the API. + The minor version of the API The minor version increases when new functions are added to the API. Such new functions are always added to the end of the API `struct'. @@ -24605,13 +24606,13 @@ For this reason, the major and minor API versions of the running `gawk' are included in the API `struct' as read-only constant integers: `api->major_version' - The major version of the running `gawk'. + The major version of the running `gawk' `api->minor_version' - The minor version of the running `gawk'. + The minor version of the running `gawk' It is up to the extension to decide if there are API -incompatibilities. Typically a check like this is enough: +incompatibilities. Typically, a check like this is enough: if (api->major_version != GAWK_API_MAJOR_VERSION || api->minor_version < GAWK_API_MINOR_VERSION) { @@ -24623,7 +24624,7 @@ incompatibilities. Typically a check like this is enough: } Such code is included in the boilerplate `dl_load_func()' macro -provided in `gawkapi.h' (discussed later, in *note Extension API +provided in `gawkapi.h' (discussed in *note Extension API Boilerplate::).  @@ -24674,7 +24675,7 @@ functions) toward the top of your source file, using predefined names as described here. The boilerplate needed is also provided in comments in the `gawkapi.h' header file: - /* Boiler plate code: */ + /* Boilerplate code: */ int plugin_is_GPL_compatible; static gawk_api_t *const api; @@ -24724,7 +24725,7 @@ in the `gawkapi.h' header file: to point to a string giving the name and version of your extension. `static awk_ext_func_t func_table[] = { ... };' - This is an array of one or more `awk_ext_func_t' structures as + This is an array of one or more `awk_ext_func_t' structures, as described earlier (*note Extension Functions::). It can then be looped over for multiple calls to `add_ext_func()'. @@ -24837,7 +24838,7 @@ appropriate information: `stat()' fails. It fills in the following elements: `"name"' - The name of the file that was `stat()''ed. + The name of the file that was `stat()'ed. `"dev"' `"ino"' @@ -24885,7 +24886,7 @@ appropriate information: The file is a directory. `"fifo"' - The file is a named-pipe (also known as a FIFO). + The file is a named pipe (also known as a FIFO). `"file"' The file is just a regular file. @@ -24905,7 +24906,7 @@ appropriate information: systems, "a priori" knowledge is used to provide a value. Where no value can be determined, it defaults to 512. - Several additional elements may be present depending upon the + Several additional elements may be present, depending upon the operating system and the type of the file. You can test for them in your `awk' program by using the `in' operator (*note Reference to Elements::): @@ -24934,9 +24935,9 @@ File: gawk.info, Node: Internal File Ops, Next: Using Internal File Ops, Prev Here is the C code for these extensions.(1) The file includes a number of standard header files, and then -includes the `gawkapi.h' header file which provides the API definitions. -Those are followed by the necessary variable declarations to make use -of the API macros and boilerplate code (*note Extension API +includes the `gawkapi.h' header file, which provides the API +definitions. Those are followed by the necessary variable declarations +to make use of the API macros and boilerplate code (*note Extension API Boilerplate::): #ifdef HAVE_CONFIG_H @@ -24972,9 +24973,9 @@ Boilerplate::): By convention, for an `awk' function `foo()', the C function that implements it is called `do_foo()'. The function should have two -arguments: the first is an `int' usually called `nargs', that +arguments. The first is an `int', usually called `nargs', that represents the number of actual arguments for the function. The second -is a pointer to an `awk_value_t', usually named `result': +is a pointer to an `awk_value_t' structure, usually named `result': /* do_chdir --- provide dynamically loaded chdir() function for gawk */ @@ -25010,8 +25011,8 @@ is numbered zero. } The `stat()' extension is more involved. First comes a function -that turns a numeric mode into a printable representation (e.g., 644 -becomes `-rw-r--r--'). This is omitted here for brevity: +that turns a numeric mode into a printable representation (e.g., octal +`0644' becomes `-rw-r--r--'). This is omitted here for brevity: /* format_mode --- turn a stat mode field into something readable */ @@ -25061,8 +25062,8 @@ contain the result of the `stat()': The following function does most of the work to fill in the `awk_array_t' result array with values obtained from a valid `struct -stat'. It is done in a separate function to support the `stat()' -function for `gawk' and also to support the `fts()' extension which is +stat'. This work is done in a separate function to support the `stat()' +function for `gawk' and also to support the `fts()' extension, which is included in the same file but whose code is not shown here (*note Extension Sample File Functions::). @@ -25174,8 +25175,8 @@ argument is optional. If present, it causes `do_stat()' to use the `stat()' system call instead of the `lstat()' system call. This is done by using a function pointer: `statfunc'. `statfunc' is initialized to point to `lstat()' (instead of `stat()') to get the file -information, in case the file is a symbolic link. However, if there -were three arguments, `statfunc' is set point to `stat()', instead. +information, in case the file is a symbolic link. However, if the third +argument is included, `statfunc' is set to point to `stat()', instead. Here is the `do_stat()' function, which starts with variable declarations and argument checking: @@ -25224,7 +25225,7 @@ returns: /* always empty out the array */ clear_array(array); - /* stat the file, if error, set ERRNO and return */ + /* stat the file; if error, set ERRNO and return */ ret = statfunc(name, & sbuf); if (ret < 0) { update_ERRNO_int(errno); @@ -25243,7 +25244,8 @@ When done, the function returns the result from `fill_stat_array()': function(s) into `gawk'. The `filefuncs' extension also provides an `fts()' function, which -we omit here. For its sake there is an initialization function: +we omit here (*note Extension Sample File Functions::). For its sake, +there is an initialization function: /* init_filefuncs --- initialization routine */ @@ -25367,9 +25369,9 @@ File: gawk.info, Node: Extension Samples, Next: gawkextlib, Prev: Extension E 16.7 The Sample Extensions in the `gawk' Distribution ===================================================== -This minor node provides brief overviews of the sample extensions that +This minor node provides a brief overview of the sample extensions that come in the `gawk' distribution. Some of them are intended for -production use (e.g., the `filefuncs', `readdir' and `inplace' +production use (e.g., the `filefuncs', `readdir', and `inplace' extensions). Others mainly provide example code that shows how to use the extension API. @@ -25406,13 +25408,13 @@ follows. The usage is: `result = chdir("/some/directory")' The `chdir()' function is a direct hook to the `chdir()' system call to change the current directory. It returns zero upon - success or less than zero upon error. In the latter case, it - updates `ERRNO'. + success or a value less than zero upon error. In the latter case, + it updates `ERRNO'. `result = stat("/some/path", statdata' [`, follow']`)' The `stat()' function provides a hook into the `stat()' system - call. It returns zero upon success or less than zero upon error. - In the latter case, it updates `ERRNO'. + call. It returns zero upon success or a value less than zero upon + error. In the latter case, it updates `ERRNO'. By default, it uses the `lstat()' system call. However, if passed a third argument, it uses `stat()' instead. @@ -25439,23 +25441,23 @@ follows. The usage is: `"minor"' `st_minor' Device files `"blksize"'`st_blksize' All `"pmode"' A human-readable version of the All - mode value, such as printed by - `ls'. For example, - `"-rwxr-xr-x"' + mode value, like that printed by + `ls' (for example, + `"-rwxr-xr-x"') `"linkval"'The value of the symbolic link Symbolic links - `"type"' The type of the file as a string. All - One of `"file"', `"blockdev"', - `"chardev"', `"directory"', - `"socket"', `"fifo"', `"symlink"', - `"door"', or `"unknown"'. Not - all systems support all file - types. + `"type"' The type of the file as a All + string--one of `"file"', + `"blockdev"', `"chardev"', + `"directory"', `"socket"', + `"fifo"', `"symlink"', `"door"', + or `"unknown"' (not all systems + support all file types) `flags = or(FTS_PHYSICAL, ...)' `result = fts(pathlist, flags, filedata)' Walk the file trees provided in `pathlist' and fill in the - `filedata' array as described next. `flags' is the bitwise OR of + `filedata' array, as described next. `flags' is the bitwise OR of several predefined values, also described in a moment. Return zero if there were no errors, otherwise return -1. @@ -25508,10 +25510,11 @@ requested hierarchies. filesystem. `filedata' - The `filedata' array is first cleared. Then, `fts()' creates an - element in `filedata' for every element in `pathlist'. The index - is the name of the directory or file given in `pathlist'. The - element for this index is itself an array. There are two cases: + The `filedata' array holds the results. `fts()' first clears it. + Then it creates an element in `filedata' for every element in + `pathlist'. The index is the name of the directory or file given + in `pathlist'. The element for this index is itself an array. + There are two cases: _The path is a file_ In this case, the array contains two or three elements: @@ -25547,7 +25550,7 @@ requested hierarchies. elements as for a file: `"path"', `"stat"', and `"error"'. The `fts()' function returns zero if there were no errors. -Otherwise it returns -1. +Otherwise, it returns -1. NOTE: The `fts()' extension does not exactly mimic the interface of the C library `fts()' routines, choosing instead to provide an @@ -25586,14 +25589,14 @@ adds one constant (`FNM_NOMATCH'), and an array of flag values named The arguments to `fnmatch()' are: `pattern' - The file name wildcard to match. + The file name wildcard to match `string' - The file name string. + The file name string `flag' Either zero, or the bitwise OR of one or more of the flags in the - `FNM' array. + `FNM' array The flags are as follows: @@ -25627,13 +25630,13 @@ The `fork' extension adds three functions, as follows: `pid = fork()' This function creates a new process. The return value is zero in - the child and the process-ID number of the child in the parent, or + the child and the process ID number of the child in the parent, or -1 upon error. In the latter case, `ERRNO' indicates the problem. In the child, `PROCINFO["pid"]' and `PROCINFO["ppid"]' are updated to reflect the correct values. `ret = waitpid(pid)' - This function takes a numeric argument, which is the process-ID to + This function takes a numeric argument, which is the process ID to wait for. The return value is that of the `waitpid()' system call. `ret = wait()' @@ -25657,8 +25660,8 @@ File: gawk.info, Node: Extension Sample Inplace, Next: Extension Sample Ord, 16.7.4 Enabling In-Place File Editing ------------------------------------- -The `inplace' extension emulates GNU `sed''s `-i' option which performs -"in place" editing of each input file. It uses the bundled +The `inplace' extension emulates GNU `sed''s `-i' option, which +performs "in-place" editing of each input file. It uses the bundled `inplace.awk' include file to invoke the extension properly: # inplace --- load and invoke the inplace extension. @@ -25741,11 +25744,11 @@ returned as a record. The record consists of three fields. The first two are the inode number and the file name, separated by a forward slash character. On systems where the directory entry contains the file type, the record -has a third field (also separated by a slash) which is a single letter +has a third field (also separated by a slash), which is a single letter indicating the type of the file. The letters and their corresponding file types are shown in *note table-readdir-file-types::. -Letter File Type +Letter File type -------------------------------------------------------------------------- `b' Block device `c' Character device @@ -25792,7 +25795,7 @@ unwary. Here is an example: print "don't panic" > "/dev/stdout" } - The output from this program is: `cinap t'nod'. + The output from this program is `cinap t'nod'.  File: gawk.info, Node: Extension Sample Rev2way, Next: Extension Sample Read write array, Prev: Extension Sample Revout, Up: Extension Samples @@ -25840,7 +25843,7 @@ The `rwarray' extension adds two functions, named `writea()' and `reada()' is the inverse of `writea()'; it reads the file named as its first argument, filling in the array named as the second argument. It clears the array first. Here too, the return value - is one on success and zero upon failure. + is one on success, or zero upon failure. The array created by `reada()' is identical to that written by `writea()' in the sense that the contents are the same. However, due to @@ -25924,7 +25927,7 @@ The `time' extension adds two functions, named `gettimeofday()' and Attempt to sleep for SECONDS seconds. If SECONDS is negative, or the attempt to sleep fails, return -1 and set `ERRNO'. Otherwise, return zero after sleeping for the indicated amount of time. Note - that SECONDS may be a floating-point (non-integral) value. + that SECONDS may be a floating-point (nonintegral) value. Implementation details: depending on platform availability, this function tries to use `nanosleep()' or `select()' to implement the delay. @@ -25952,7 +25955,9 @@ provides a number of `gawk' extensions, including one for processing XML files. This is the evolution of the original `xgawk' (XML `gawk') project. - As of this writing, there are six extensions: + As of this writing, there are seven extensions: + + * `errno' extension * GD graphics library extension @@ -25961,7 +25966,7 @@ project. * PostgreSQL extension * MPFR library extension (this provides access to a number of MPFR - functions which `gawk''s native MPFR support does not) + functions that `gawk''s native MPFR support does not) * Redis extension @@ -26002,7 +26007,7 @@ follows. First, build and install `gawk': If you have installed `gawk' in the standard way, then you will likely not need the `--with-gawk' option when configuring `gawkextlib'. -You may also need to use the `sudo' utility to install both `gawk' and +You may need to use the `sudo' utility to install both `gawk' and `gawkextlib', depending upon how your system works. If you write an extension that you wish to share with other `gawk' @@ -26024,7 +26029,7 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga a variable named `plugin_is_GPL_compatible'. * Communication between `gawk' and an extension is two-way. `gawk' - passes a `struct' to the extension which contains various data + passes a `struct' to the extension that contains various data fields and function pointers. The extension can then call into `gawk' via the supplied function pointers to accomplish certain tasks. @@ -26035,7 +26040,7 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga convention, implementation functions are named `do_XXXX()' for some `awk'-level function `XXXX()'. - * The API is defined in a header file named `gawkpi.h'. You must + * The API is defined in a header file named `gawkapi.h'. You must include a number of standard header files _before_ including it in your source file. @@ -26065,16 +26070,16 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga * Manipulating arrays (retrieving, adding, deleting, and modifying elements; getting the count of elements in an array; creating a new array; clearing an array; and flattening an - array for easy C style looping over all its indices and + array for easy C-style looping over all its indices and elements) * The API defines a number of standard data types for representing `awk' values, array elements, and arrays. - * The API provide convenience functions for constructing values. It - also provides memory management functions to ensure compatibility - between memory allocated by `gawk' and memory allocated by an - extension. + * The API provides convenience functions for constructing values. + It also provides memory management functions to ensure + compatibility between memory allocated by `gawk' and memory + allocated by an extension. * _All_ memory passed from `gawk' to an extension must be treated as read-only by the extension. @@ -26092,8 +26097,8 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga header file make this easier to do. * The `gawk' distribution includes a number of small but useful - sample extensions. The `gawkextlib' project includes several more, - larger, extensions. If you wish to write an extension and + sample extensions. The `gawkextlib' project includes several more + (larger) extensions. If you wish to write an extension and contribute it to the community of `gawk' users, the `gawkextlib' project is the place to do so. @@ -32657,7 +32662,7 @@ Index (line 99) * exp: Numeric Functions. (line 18) * expand utility: Very Simple. (line 73) -* Expat XML parser library: gawkextlib. (line 33) +* Expat XML parser library: gawkextlib. (line 35) * exponent: Numeric Functions. (line 18) * expressions: Expressions. (line 6) * expressions, as patterns: Expression Patterns. (line 6) @@ -33071,7 +33076,7 @@ Index * git utility <2>: Accessing The Source. (line 10) * git utility <3>: Other Versions. (line 29) -* git utility: gawkextlib. (line 27) +* git utility: gawkextlib. (line 29) * Git, use of for gawk source code: Derived Files. (line 6) * GNITS mailing list: Acknowledgments. (line 52) * GNU awk, See gawk: Preface. (line 51) @@ -34905,137 +34910,137 @@ Ref: figure-call-new-function919155 Node: Extension API Description921142 Node: Extension API Functions Introduction922592 Node: General Data Types927413 -Ref: General Data Types-Footnote-1933312 -Node: Memory Allocation Functions933611 -Ref: Memory Allocation Functions-Footnote-1936450 -Node: Constructor Functions936546 -Node: Registration Functions938280 -Node: Extension Functions938965 -Node: Exit Callback Functions941262 -Node: Extension Version String942510 -Node: Input Parsers943175 -Node: Output Wrappers953054 -Node: Two-way processors957569 -Node: Printing Messages959773 -Ref: Printing Messages-Footnote-1960849 -Node: Updating `ERRNO'961001 -Node: Requesting Values961741 -Ref: table-value-types-returned962469 -Node: Accessing Parameters963426 -Node: Symbol Table Access964657 -Node: Symbol table by name965171 -Node: Symbol table by cookie967152 -Ref: Symbol table by cookie-Footnote-1971296 -Node: Cached values971359 -Ref: Cached values-Footnote-1974858 -Node: Array Manipulation974949 -Ref: Array Manipulation-Footnote-1976047 -Node: Array Data Types976084 -Ref: Array Data Types-Footnote-1978739 -Node: Array Functions978831 -Node: Flattening Arrays982685 -Node: Creating Arrays989577 -Node: Extension API Variables994348 -Node: Extension Versioning994984 -Node: Extension API Informational Variables996885 -Node: Extension API Boilerplate997950 -Node: Finding Extensions1001759 -Node: Extension Example1002319 -Node: Internal File Description1003091 -Node: Internal File Ops1007158 -Ref: Internal File Ops-Footnote-11018828 -Node: Using Internal File Ops1018968 -Ref: Using Internal File Ops-Footnote-11021351 -Node: Extension Samples1021624 -Node: Extension Sample File Functions1023150 -Node: Extension Sample Fnmatch1030788 -Node: Extension Sample Fork1032279 -Node: Extension Sample Inplace1033494 -Node: Extension Sample Ord1035169 -Node: Extension Sample Readdir1036005 -Ref: table-readdir-file-types1036881 -Node: Extension Sample Revout1037692 -Node: Extension Sample Rev2way1038282 -Node: Extension Sample Read write array1039022 -Node: Extension Sample Readfile1040962 -Node: Extension Sample Time1042057 -Node: Extension Sample API Tests1043406 -Node: gawkextlib1043897 -Node: Extension summary1046555 -Node: Extension Exercises1050244 -Node: Language History1050966 -Node: V7/SVR3.11052622 -Node: SVR41054803 -Node: POSIX1056248 -Node: BTL1057637 -Node: POSIX/GNU1058371 -Node: Feature History1063935 -Node: Common Extensions1077033 -Node: Ranges and Locales1078357 -Ref: Ranges and Locales-Footnote-11082975 -Ref: Ranges and Locales-Footnote-21083002 -Ref: Ranges and Locales-Footnote-31083236 -Node: Contributors1083457 -Node: History summary1088998 -Node: Installation1090368 -Node: Gawk Distribution1091314 -Node: Getting1091798 -Node: Extracting1092621 -Node: Distribution contents1094256 -Node: Unix Installation1099973 -Node: Quick Installation1100590 -Node: Additional Configuration Options1103014 -Node: Configuration Philosophy1104752 -Node: Non-Unix Installation1107121 -Node: PC Installation1107579 -Node: PC Binary Installation1108898 -Node: PC Compiling1110746 -Ref: PC Compiling-Footnote-11113767 -Node: PC Testing1113876 -Node: PC Using1115052 -Node: Cygwin1119167 -Node: MSYS1119990 -Node: VMS Installation1120490 -Node: VMS Compilation1121282 -Ref: VMS Compilation-Footnote-11122504 -Node: VMS Dynamic Extensions1122562 -Node: VMS Installation Details1124246 -Node: VMS Running1126498 -Node: VMS GNV1129334 -Node: VMS Old Gawk1130068 -Node: Bugs1130538 -Node: Other Versions1134421 -Node: Installation summary1140845 -Node: Notes1141901 -Node: Compatibility Mode1142766 -Node: Additions1143548 -Node: Accessing The Source1144473 -Node: Adding Code1145908 -Node: New Ports1152065 -Node: Derived Files1156547 -Ref: Derived Files-Footnote-11162022 -Ref: Derived Files-Footnote-21162056 -Ref: Derived Files-Footnote-31162652 -Node: Future Extensions1162766 -Node: Implementation Limitations1163372 -Node: Extension Design1164620 -Node: Old Extension Problems1165774 -Ref: Old Extension Problems-Footnote-11167291 -Node: Extension New Mechanism Goals1167348 -Ref: Extension New Mechanism Goals-Footnote-11170708 -Node: Extension Other Design Decisions1170897 -Node: Extension Future Growth1173005 -Node: Old Extension Mechanism1173841 -Node: Notes summary1175603 -Node: Basic Concepts1176789 -Node: Basic High Level1177470 -Ref: figure-general-flow1177742 -Ref: figure-process-flow1178341 -Ref: Basic High Level-Footnote-11181570 -Node: Basic Data Typing1181755 -Node: Glossary1185083 -Node: Copying1217012 -Node: GNU Free Documentation License1254568 -Node: Index1279704 +Ref: General Data Types-Footnote-1933313 +Node: Memory Allocation Functions933612 +Ref: Memory Allocation Functions-Footnote-1936451 +Node: Constructor Functions936550 +Node: Registration Functions938285 +Node: Extension Functions938970 +Node: Exit Callback Functions941267 +Node: Extension Version String942515 +Node: Input Parsers943178 +Node: Output Wrappers953053 +Node: Two-way processors957566 +Node: Printing Messages959829 +Ref: Printing Messages-Footnote-1960905 +Node: Updating `ERRNO'961057 +Node: Requesting Values961797 +Ref: table-value-types-returned962524 +Node: Accessing Parameters963481 +Node: Symbol Table Access964715 +Node: Symbol table by name965229 +Node: Symbol table by cookie967249 +Ref: Symbol table by cookie-Footnote-1971394 +Node: Cached values971457 +Ref: Cached values-Footnote-1974953 +Node: Array Manipulation975044 +Ref: Array Manipulation-Footnote-1976142 +Node: Array Data Types976179 +Ref: Array Data Types-Footnote-1978834 +Node: Array Functions978926 +Node: Flattening Arrays982785 +Node: Creating Arrays989687 +Node: Extension API Variables994458 +Node: Extension Versioning995094 +Node: Extension API Informational Variables996985 +Node: Extension API Boilerplate998050 +Node: Finding Extensions1001859 +Node: Extension Example1002419 +Node: Internal File Description1003191 +Node: Internal File Ops1007258 +Ref: Internal File Ops-Footnote-11019009 +Node: Using Internal File Ops1019149 +Ref: Using Internal File Ops-Footnote-11021532 +Node: Extension Samples1021805 +Node: Extension Sample File Functions1023333 +Node: Extension Sample Fnmatch1031014 +Node: Extension Sample Fork1032502 +Node: Extension Sample Inplace1033717 +Node: Extension Sample Ord1035393 +Node: Extension Sample Readdir1036229 +Ref: table-readdir-file-types1037106 +Node: Extension Sample Revout1037917 +Node: Extension Sample Rev2way1038506 +Node: Extension Sample Read write array1039246 +Node: Extension Sample Readfile1041186 +Node: Extension Sample Time1042281 +Node: Extension Sample API Tests1043629 +Node: gawkextlib1044120 +Node: Extension summary1046798 +Node: Extension Exercises1050487 +Node: Language History1051209 +Node: V7/SVR3.11052865 +Node: SVR41055046 +Node: POSIX1056491 +Node: BTL1057880 +Node: POSIX/GNU1058614 +Node: Feature History1064178 +Node: Common Extensions1077276 +Node: Ranges and Locales1078600 +Ref: Ranges and Locales-Footnote-11083218 +Ref: Ranges and Locales-Footnote-21083245 +Ref: Ranges and Locales-Footnote-31083479 +Node: Contributors1083700 +Node: History summary1089241 +Node: Installation1090611 +Node: Gawk Distribution1091557 +Node: Getting1092041 +Node: Extracting1092864 +Node: Distribution contents1094499 +Node: Unix Installation1100216 +Node: Quick Installation1100833 +Node: Additional Configuration Options1103257 +Node: Configuration Philosophy1104995 +Node: Non-Unix Installation1107364 +Node: PC Installation1107822 +Node: PC Binary Installation1109141 +Node: PC Compiling1110989 +Ref: PC Compiling-Footnote-11114010 +Node: PC Testing1114119 +Node: PC Using1115295 +Node: Cygwin1119410 +Node: MSYS1120233 +Node: VMS Installation1120733 +Node: VMS Compilation1121525 +Ref: VMS Compilation-Footnote-11122747 +Node: VMS Dynamic Extensions1122805 +Node: VMS Installation Details1124489 +Node: VMS Running1126741 +Node: VMS GNV1129577 +Node: VMS Old Gawk1130311 +Node: Bugs1130781 +Node: Other Versions1134664 +Node: Installation summary1141088 +Node: Notes1142144 +Node: Compatibility Mode1143009 +Node: Additions1143791 +Node: Accessing The Source1144716 +Node: Adding Code1146151 +Node: New Ports1152308 +Node: Derived Files1156790 +Ref: Derived Files-Footnote-11162265 +Ref: Derived Files-Footnote-21162299 +Ref: Derived Files-Footnote-31162895 +Node: Future Extensions1163009 +Node: Implementation Limitations1163615 +Node: Extension Design1164863 +Node: Old Extension Problems1166017 +Ref: Old Extension Problems-Footnote-11167534 +Node: Extension New Mechanism Goals1167591 +Ref: Extension New Mechanism Goals-Footnote-11170951 +Node: Extension Other Design Decisions1171140 +Node: Extension Future Growth1173248 +Node: Old Extension Mechanism1174084 +Node: Notes summary1175846 +Node: Basic Concepts1177032 +Node: Basic High Level1177713 +Ref: figure-general-flow1177985 +Ref: figure-process-flow1178584 +Ref: Basic High Level-Footnote-11181813 +Node: Basic Data Typing1181998 +Node: Glossary1185326 +Node: Copying1217255 +Node: GNU Free Documentation License1254811 +Node: Index1279947  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index e7d979d9..76d0c546 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -31636,7 +31636,7 @@ If you know that you wish to use the same numeric or string @emph{value} for one or more variables, you can create the value once, retaining a @dfn{value cookie} for it, and then pass in that value cookie whenever you wish to set the value of a -variable. This both storage space within the running @command{gawk} +variable. This saves storage space within the running @command{gawk} process and reduces the time needed to create the value. @node Memory Allocation Functions @@ -31665,13 +31665,13 @@ be passed to @command{gawk}. @item void gawk_free(void *ptr); Call the correct version of @code{free()} to release storage that was -allocated with @code{gawk_malloc()}, @code{gawk_calloc()} or @code{gawk_realloc()}. +allocated with @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. @end table The API has to provide these functions because it is possible for an extension to be compiled and linked against a different version of the C library than was used for the @command{gawk} -executable.@footnote{This is more common on MS-Windows systems, but +executable.@footnote{This is more common on MS-Windows systems, but it can happen on Unix-like systems as well.} If @command{gawk} were to use its version of @code{free()} when the memory came from an unrelated version of @code{malloc()}, unexpected behavior would @@ -31681,7 +31681,7 @@ Two convenience macros may be used for allocating storage from @code{gawk_malloc()} and @code{gawk_realloc()}. If the allocation fails, they cause @command{gawk} to exit with a fatal error message. They should be used as if they were -procedure calls that do not return a value. +procedure calls that do not return a value: @table @code @item #define emalloc(pointer, type, size, message) @dots{} @@ -31718,7 +31718,7 @@ make_malloced_string(message, strlen(message), & result); @end example @item #define erealloc(pointer, type, size, message) @dots{} -This is like @code{emalloc()}, but it calls @code{gawk_realloc()}, +This is like @code{emalloc()}, but it calls @code{gawk_realloc()} instead of @code{gawk_malloc()}. The arguments are the same as for the @code{emalloc()} macro. @end table @@ -31743,7 +31743,7 @@ for storage in @code{result}. It returns @code{result}. @itemx make_malloced_string(const char *string, size_t length, awk_value_t *result) This function creates a string value in the @code{awk_value_t} variable pointed to by @code{result}. It expects @code{string} to be a @samp{char *} -value pointing to data previously obtained from @code{gawk_malloc()}, @code{gawk_calloc()} or @code{gawk_realloc()}. The idea here +value pointing to data previously obtained from @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The idea here is that the data is passed directly to @command{gawk}, which assumes responsibility for it. It returns @code{result}. @@ -31794,7 +31794,7 @@ The fields are: @table @code @item const char *name; The name of the new function. -@command{awk} level code calls the function by this name. +@command{awk}-level code calls the function by this name. This is a regular C string. Function names must obey the rules for @command{awk} @@ -31808,7 +31808,7 @@ This is a pointer to the C function that provides the extension's functionality. The function must fill in @code{*result} with either a number or a string. @command{gawk} takes ownership of any string memory. -As mentioned earlier, string memory @strong{must} come from one of +As mentioned earlier, string memory @emph{must} come from one of @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The @code{num_actual_args} argument tells the C function how many @@ -31860,20 +31860,20 @@ The @code{exit_status} parameter is the exit status value that @command{gawk} intends to pass to the @code{exit()} system call. @item arg0 -A pointer to private data which @command{gawk} saves in order to pass to +A pointer to private data that @command{gawk} saves in order to pass to the function pointed to by @code{funcp}. @end table @end table -Exit callback functions are called in last-in-first-out (LIFO) +Exit callback functions are called in last-in, first-out (LIFO) order---that is, in the reverse order in which they are registered with @command{gawk}. @node Extension Version String @subsubsection Registering An Extension Version String -You can register a version string which indicates the name and -version of your extension, with @command{gawk}, as follows: +You can register a version string that indicates the name and +version of your extension with @command{gawk}, as follows: @table @code @item void register_ext_version(const char *version); @@ -31895,7 +31895,7 @@ of @code{RS} to find the end of the record, and then uses @code{FS} Additionally, it sets the value of @code{RT} (@pxref{Built-in Variables}). If you want, you can provide your own custom input parser. An input -parser's job is to return a record to the @command{gawk} record processing +parser's job is to return a record to the @command{gawk} record-processing code, along with indicators for the value and length of the data to be used for @code{RT}, if any. @@ -31913,9 +31913,9 @@ It should not change any state (variable values, etc.) within @command{gawk}. @item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf); When @command{gawk} decides to hand control of the file over to the input parser, it calls this function. This function in turn must fill -in certain fields in the @code{awk_input_buf_t} structure, and ensure +in certain fields in the @code{awk_input_buf_t} structure and ensure that certain conditions are true. It should then return true. If an -error of some kind occurs, it should not fill in any fields, and should +error of some kind occurs, it should not fill in any fields and should return false; then @command{gawk} will not use the input parser. The details are presented shortly. @end table @@ -32008,7 +32008,7 @@ in the @code{struct stat}, or any combination of these factors. Once @code{@var{XXX}_can_take_file()} has returned true, and @command{gawk} has decided to use your input parser, it calls -@code{@var{XXX}_take_control_of()}. That function then fills one of +@code{@var{XXX}_take_control_of()}. That function then fills either the @code{get_record} field or the @code{read_func} field in the @code{awk_input_buf_t}. It must also ensure that @code{fd} is @emph{not} set to @code{INVALID_HANDLE}. The following list describes the fields that @@ -32030,21 +32030,21 @@ records. Said function is the core of the input parser. Its behavior is described in the text following this list. @item ssize_t (*read_func)(); -This function pointer should point to function that has the +This function pointer should point to a function that has the same behavior as the standard POSIX @code{read()} system call. It is an alternative to the @code{get_record} pointer. Its behavior is also described in the text following this list. @item void (*close_func)(struct awk_input *iobuf); This function pointer should point to a function that does -the ``tear down.'' It should release any resources allocated by +the ``teardown.'' It should release any resources allocated by @code{@var{XXX}_take_control_of()}. It may also close the file. If it does so, it should set the @code{fd} field to @code{INVALID_HANDLE}. If @code{fd} is still not @code{INVALID_HANDLE} after the call to this function, @command{gawk} calls the regular @code{close()} system call. -Having a ``tear down'' function is optional. If your input parser does +Having a ``teardown'' function is optional. If your input parser does not need it, do not set this field. Then, @command{gawk} calls the regular @code{close()} system call on the file descriptor, so it should be valid. @@ -32055,7 +32055,7 @@ input records. The parameters are as follows: @table @code @item char **out -This is a pointer to a @code{char *} variable which is set to point +This is a pointer to a @code{char *} variable that is set to point to the record. @command{gawk} makes its own copy of the data, so the extension must manage this storage. @@ -32108,17 +32108,17 @@ set this field explicitly. You must choose one method or the other: either a function that returns a record, or one that returns raw data. In particular, if you supply a function to get a record, @command{gawk} will -call it, and never call the raw read function. +call it, and will never call the raw read function. @end quotation @command{gawk} ships with a sample extension that reads directories, -returning records for each entry in the directory (@pxref{Extension +returning records for each entry in a directory (@pxref{Extension Sample Readdir}). You may wish to use that code as a guide for writing your own input parser. 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 +it to always be called, and to take effect as appropriate (as the @code{readdir} extension does). Or you may want it to take effect based upon the value of an @command{awk} variable, as the XML extension from the @code{gawkextlib} project does (@pxref{gawkextlib}). @@ -32228,7 +32228,7 @@ a pointer to any private data associated with the file. These pointers should be set to point to functions that perform the equivalent function as the @code{} functions do, if appropriate. @command{gawk} uses these function pointers for all output. -@command{gawk} initializes the pointers to point to internal, ``pass through'' +@command{gawk} initializes the pointers to point to internal ``pass-through'' functions that just call the regular @code{} functions, so an extension only needs to redefine those functions that are appropriate for what it does. @@ -32239,7 +32239,7 @@ upon the @code{name} and @code{mode} fields, and any additional state (such as @command{awk} variable values) that is appropriate. When @command{gawk} calls @code{@var{XXX}_take_control_of()}, that function should fill -in the other fields, as appropriate, except for @code{fp}, which it should just +in the other fields as appropriate, except for @code{fp}, which it should just use normally. You register your output wrapper with the following function: @@ -32279,14 +32279,14 @@ The fields are as follows: The name of the two-way processor. @item awk_bool_t (*can_take_two_way)(const char *name); -This function returns true if it wants to take over two-way I/O for this @value{FN}. +The function pointed to by this field should return true if it wants to take over two-way I/O for this @value{FN}. It should not change any state (variable values, etc.) within @command{gawk}. @item awk_bool_t (*take_control_of)(const char *name, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_input_buf_t *inbuf, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_output_buf_t *outbuf); -This function should fill in the @code{awk_input_buf_t} and +The function pointed to by this field should fill in the @code{awk_input_buf_t} and @code{awk_outut_buf_t} structures pointed to by @code{inbuf} and @code{outbuf}, respectively. These structures were described earlier. @@ -32315,7 +32315,7 @@ Register the two-way processor pointed to by @code{two_way_processor} with You can print different kinds of warning messages from your extension, as described here. Note that for these functions, -you must pass in the extension id received from @command{gawk} +you must pass in the extension ID received from @command{gawk} when the extension was loaded:@footnote{Because the API uses only ISO C 90 features, it cannot make use of the ISO C 99 variadic macro feature to hide that parameter. More's the pity.} @@ -32368,7 +32368,7 @@ matches what you requested, the function returns true and fills in the @code{awk_value_t} result. Otherwise, the function returns false, and the @code{val_type} member indicates the type of the actual value. You may then -print an error message, or reissue the request for the actual +print an error message or reissue the request for the actual value type, as appropriate. This behavior is summarized in @ref{table-value-types-returned}. @@ -32401,32 +32401,32 @@ value type, as appropriate. This behavior is summarized in String String String - false - false + False + False Number Number if can be converted, else false Number - false - false + False + False Type Array - false - false + False + False Array - false + False Requested Scalar Scalar Scalar - false - false + False + False @@ -32438,11 +32438,11 @@ value type, as appropriate. This behavior is summarized in - Value Cookie - false - false - false - false + Value cookie + False + False + False + False @@ -32460,12 +32460,12 @@ value type, as appropriate. This behavior is summarized in @end tex @multitable @columnfractions .166 .166 .198 .15 .15 .166 @headitem @tab @tab String @tab Number @tab Array @tab Undefined -@item @tab @b{String} @tab String @tab String @tab false @tab false -@item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab false @tab false -@item @b{Type} @tab @b{Array} @tab false @tab false @tab Array @tab false -@item @b{Requested} @tab @b{Scalar} @tab Scalar @tab Scalar @tab false @tab false +@item @tab @b{String} @tab String @tab String @tab False @tab False +@item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab False @tab False +@item @b{Type} @tab @b{Array} @tab False @tab False @tab Array @tab False +@item @b{Requested} @tab @b{Scalar} @tab Scalar @tab Scalar @tab False @tab False @item @tab @b{Undefined} @tab String @tab Number @tab Array @tab Undefined -@item @tab @b{Value Cookie} @tab false @tab false @tab false @tab false +@item @tab @b{Value cookie} @tab False @tab False @tab False @tab False @end multitable @end ifnotdocbook @end ifnotplaintext @@ -32476,21 +32476,21 @@ value type, as appropriate. This behavior is summarized in +------------+------------+-----------+-----------+ | String | Number | Array | Undefined | +-----------+-----------+------------+------------+-----------+-----------+ -| | String | String | String | false | false | +| | String | String | String | False | False | | |-----------+------------+------------+-----------+-----------+ -| | Number | Number if | Number | false | false | +| | Number | Number if | Number | False | False | | | | can be | | | | | | | converted, | | | | | | | else false | | | | | |-----------+------------+------------+-----------+-----------+ -| Type | Array | false | false | Array | false | +| Type | Array | False | False | Array | False | | Requested |-----------+------------+------------+-----------+-----------+ -| | Scalar | Scalar | Scalar | false | false | +| | Scalar | Scalar | Scalar | False | False | | |-----------+------------+------------+-----------+-----------+ | | Undefined | String | Number | Array | Undefined | | |-----------+------------+------------+-----------+-----------+ -| | Value | false | false | false | false | -| | Cookie | | | | | +| | Value | False | False | False | False | +| | cookie | | | | | +-----------+-----------+------------+------------+-----------+-----------+ @end example @end ifplaintext @@ -32507,16 +32507,16 @@ passed to your extension function. They are: @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_valtype_t wanted, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_value_t *result); Fill in the @code{awk_value_t} structure pointed to by @code{result} -with the @code{count}'th argument. Return true if the actual -type matches @code{wanted}, false otherwise. In the latter +with the @code{count}th argument. Return true if the actual +type matches @code{wanted}, and false otherwise. In the latter case, @code{result@w{->}val_type} indicates the actual type -(@pxref{table-value-types-returned}). Counts are zero based---the first +(@pxref{table-value-types-returned}). Counts are zero-based---the first argument is numbered zero, the second one, and so on. @code{wanted} indicates the type of value expected. @item awk_bool_t set_argument(size_t count, awk_array_t array); Convert a parameter that was undefined into an array; this provides -call-by-reference for arrays. Return false if @code{count} is too big, +call by reference for arrays. Return false if @code{count} is too big, or if the argument's type is not undefined. @DBXREF{Array Manipulation} for more information on creating arrays. @end table @@ -32540,8 +32540,9 @@ allows you to create and release cached values. The following routines provide the ability to access and update global @command{awk}-level variables by name. In compiler terminology, identifiers of different kinds are termed @dfn{symbols}, thus the ``sym'' -in the routines' names. The data structure which stores information +in the routines' names. The data structure that stores information about symbols is termed a @dfn{symbol table}. +The functions are as follows: @table @code @item awk_bool_t sym_lookup(const char *name, @@ -32550,14 +32551,14 @@ about symbols is termed a @dfn{symbol table}. Fill in the @code{awk_value_t} structure pointed to by @code{result} with the value of the variable named by the string @code{name}, which is a regular C string. @code{wanted} indicates the type of value expected. -Return true if the actual type matches @code{wanted}, false otherwise. +Return true if the actual type matches @code{wanted}, and false otherwise. In the latter case, @code{result->val_type} indicates the actual type (@pxref{table-value-types-returned}). @item awk_bool_t sym_update(const char *name, awk_value_t *value); Update the variable named by the string @code{name}, which is a regular C string. The variable is added to @command{gawk}'s symbol table -if it is not there. Return true if everything worked, false otherwise. +if it is not there. Return true if everything worked, and false otherwise. Changing types (scalar to array or vice versa) of an existing variable is @emph{not} allowed, nor may this routine be used to update an array. @@ -32582,7 +32583,7 @@ populate it. A @dfn{scalar cookie} is an opaque handle that provides access to a global variable or array. It is an optimization that avoids looking up variables in @command{gawk}'s symbol table every time -access is needed. This was discussed earlier in @ref{General Data Types}. +access is needed. This was discussed earlier, in @ref{General Data Types}. The following functions let you work with scalar cookies: @@ -32698,7 +32699,7 @@ and carefully check the return values from the API functions. @subsubsection Creating and Using Cached Values The routines in this section allow you to create and release -cached values. As with scalar cookies, in theory, cached values +cached values. Like scalar cookies, in theory, cached values are not necessary. You can create numbers and strings using the functions in @ref{Constructor Functions}. You can then assign those values to variables using @code{sym_update()} @@ -32776,7 +32777,7 @@ Using value cookies in this way saves considerable storage, as all of @code{VAR1} through @code{VAR100} share the same value. You might be wondering, ``Is this sharing problematic? -What happens if @command{awk} code assigns a new value to @code{VAR1}, +What happens if @command{awk} code assigns a new value to @code{VAR1}; are all the others changed too?'' That's a great question. The answer is that no, it's not a problem. @@ -32880,7 +32881,7 @@ modify them. @node Array Functions @subsubsection Array Functions -The following functions relate to individual array elements. +The following functions relate to individual array elements: @table @code @item awk_bool_t get_element_count(awk_array_t a_cookie, size_t *count); @@ -32899,13 +32900,13 @@ Return false if @code{wanted} does not match the actual type or if @code{index} is not in the array (@pxref{table-value-types-returned}). The value for @code{index} can be numeric, in which case @command{gawk} -converts it to a string. Using non-integral values is possible, but +converts it to a string. Using nonintegral values is possible, but requires that you understand how such values are converted to strings -(@pxref{Conversion}); thus using integral values is safest. +(@pxref{Conversion}); thus, using integral values is safest. 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 +@code{gawk_calloc()}, or @code{gawk_realloc()}, and @command{gawk} releases the storage. @item awk_bool_t set_array_element(awk_array_t a_cookie, @@ -32961,7 +32962,7 @@ flatten an array and work with it. @item awk_bool_t release_flattened_array(awk_array_t a_cookie, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_flat_array_t *data); When done with a flattened array, release the storage using this function. -You must pass in both the original array cookie, and the address of +You must pass in both the original array cookie and the address of the created @code{awk_flat_array_t} structure. The function returns true upon success, false otherwise. @end table @@ -32971,7 +32972,7 @@ The function returns true upon success, false otherwise. To @dfn{flatten} an array is to create a structure that represents the full array in a fashion that makes it easy -for C code to traverse the entire array. Test code +for C code to traverse the entire array. Some of the code in @file{extension/testext.c} does this, and also serves as a nice example showing how to use the APIs. @@ -33028,9 +33029,9 @@ dump_array_and_delete(int nargs, awk_value_t *result) @end example The function then proceeds in steps, as follows. First, retrieve -the name of the array, passed as the first argument. Then -retrieve the array itself. If either operation fails, print -error messages and return: +the name of the array, passed as the first argument, followed by +the array itself. If either operation fails, print an +error message and return: @example /* get argument named array as flat array and print it */ @@ -33066,7 +33067,7 @@ and print it: @end example The third step is to actually flatten the array, and then -to double check that the count in the @code{awk_flat_array_t} +to double-check that the count in the @code{awk_flat_array_t} is the same as the count just retrieved: @example @@ -33087,7 +33088,7 @@ is the same as the count just retrieved: The fourth step is to retrieve the index of the element to be deleted, which was passed as the second argument. Remember that argument counts passed to @code{get_argument()} -are zero-based, thus the second argument is numbered one: +are zero-based, and thus the second argument is numbered one: @example if (! get_argument(1, AWK_STRING, & value3)) @{ @@ -33102,7 +33103,7 @@ element values. In addition, upon finding the element with the index that is supposed to be deleted, the function sets the @code{AWK_ELEMENT_DELETE} bit in the @code{flags} field of the element. When the array is released, @command{gawk} -traverses the flattened array, and deletes any elements which +traverses the flattened array, and deletes any elements that have this flag bit set: @example @@ -33390,10 +33391,10 @@ The API versions are available at compile time as constants: @table @code @item GAWK_API_MAJOR_VERSION -The major version of the API. +The major version of the API @item GAWK_API_MINOR_VERSION -The minor version of the API. +The minor version of the API @end table The minor version increases when new functions are added to the API. Such @@ -33411,14 +33412,14 @@ constant integers: @table @code @item api->major_version -The major version of the running @command{gawk}. +The major version of the running @command{gawk} @item api->minor_version -The minor version of the running @command{gawk}. +The minor version of the running @command{gawk} @end table It is up to the extension to decide if there are API incompatibilities. -Typically a check like this is enough: +Typically, a check like this is enough: @example if (api->major_version != GAWK_API_MAJOR_VERSION @@ -33432,7 +33433,7 @@ if (api->major_version != GAWK_API_MAJOR_VERSION @end example Such code is included in the boilerplate @code{dl_load_func()} macro -provided in @file{gawkapi.h} (discussed later, in +provided in @file{gawkapi.h} (discussed in @ref{Extension API Boilerplate}). @node Extension API Informational Variables @@ -33479,7 +33480,7 @@ as described here. The boilerplate needed is also provided in comments in the @file{gawkapi.h} header file: @example -/* Boiler plate code: */ +/* Boilerplate code: */ int plugin_is_GPL_compatible; static gawk_api_t *const api; @@ -33538,7 +33539,7 @@ to @code{NULL}, or to point to a string giving the name and version of your extension. @item static awk_ext_func_t func_table[] = @{ @dots{} @}; -This is an array of one or more @code{awk_ext_func_t} structures +This is an array of one or more @code{awk_ext_func_t} structures, as described earlier (@pxref{Extension Functions}). It can then be looped over for multiple calls to @code{add_ext_func()}. @@ -33669,7 +33670,7 @@ the @code{stat()} fails. It fills in the following elements: @table @code @item "name" -The name of the file that was @code{stat()}'ed. +The name of the file that was @code{stat()}ed. @item "dev" @itemx "ino" @@ -33725,7 +33726,7 @@ interprocess communications). The file is a directory. @item "fifo" -The file is a named-pipe (also known as a FIFO). +The file is a named pipe (also known as a FIFO). @item "file" The file is just a regular file. @@ -33748,7 +33749,7 @@ For some other systems, @dfn{a priori} knowledge is used to provide a value. Where no value can be determined, it defaults to 512. @end table -Several additional elements may be present depending upon the operating +Several additional elements may be present, depending upon the operating system and the type of the file. You can test for them in your @command{awk} program by using the @code{in} operator (@pxref{Reference to Elements}): @@ -33778,7 +33779,7 @@ edited slightly for presentation. See @file{extension/filefuncs.c} in the @command{gawk} distribution for the complete version.} The file includes a number of standard header files, and then includes -the @file{gawkapi.h} header file which provides the API definitions. +the @file{gawkapi.h} header file, which provides the API definitions. Those are followed by the necessary variable declarations to make use of the API macros and boilerplate code (@pxref{Extension API Boilerplate}): @@ -33819,9 +33820,9 @@ int plugin_is_GPL_compatible; @cindex programming conventions, @command{gawk} extensions By convention, for an @command{awk} function @code{foo()}, the C function that implements it is called @code{do_foo()}. The function should have -two arguments: the first is an @code{int} usually called @code{nargs}, +two arguments. The first is an @code{int}, usually called @code{nargs}, that represents the number of actual arguments for the function. -The second is a pointer to an @code{awk_value_t}, usually named +The second is a pointer to an @code{awk_value_t} structure, usually named @code{result}: @example @@ -33867,7 +33868,7 @@ Finally, the function returns the return value to the @command{awk} level: The @code{stat()} extension is more involved. First comes a function that turns a numeric mode into a printable representation -(e.g., 644 becomes @samp{-rw-r--r--}). This is omitted here for brevity: +(e.g., octal @code{0644} becomes @samp{-rw-r--r--}). This is omitted here for brevity: @example /* format_mode --- turn a stat mode field into something readable */ @@ -33923,9 +33924,9 @@ array_set_numeric(awk_array_t array, const char *sub, double num) The following function does most of the work to fill in the @code{awk_array_t} result array with values obtained -from a valid @code{struct stat}. It is done in a separate function +from a valid @code{struct stat}. This work is done in a separate function to support the @code{stat()} function for @command{gawk} and also -to support the @code{fts()} extension which is included in +to support the @code{fts()} extension, which is included in the same file but whose code is not shown here (@pxref{Extension Sample File Functions}). @@ -34046,8 +34047,8 @@ the @code{stat()} system call instead of the @code{lstat()} system call. This is done by using a function pointer: @code{statfunc}. @code{statfunc} is initialized to point to @code{lstat()} (instead of @code{stat()}) to get the file information, in case the file is a -symbolic link. However, if there were three arguments, @code{statfunc} -is set point to @code{stat()}, instead. +symbolic link. However, if the third argument is included, @code{statfunc} +is set to point to @code{stat()}, instead. Here is the @code{do_stat()} function, which starts with variable declarations and argument checking: @@ -34103,7 +34104,7 @@ Next, it gets the information for the file. If the called function /* always empty out the array */ clear_array(array); - /* stat the file, if error, set ERRNO and return */ + /* stat the file; if error, set ERRNO and return */ ret = statfunc(name, & sbuf); if (ret < 0) @{ update_ERRNO_int(errno); @@ -34125,7 +34126,9 @@ Finally, it's necessary to provide the ``glue'' that loads the new function(s) into @command{gawk}. The @code{filefuncs} extension also provides an @code{fts()} -function, which we omit here. For its sake there is an initialization +function, which we omit here +(@pxref{Extension Sample File Functions}). +For its sake, there is an initialization function: @example @@ -34250,9 +34253,9 @@ $ @kbd{AWKLIBPATH=$PWD gawk -f testff.awk} @section The Sample Extensions in the @command{gawk} Distribution @cindex extensions distributed with @command{gawk} -This @value{SECTION} provides brief overviews of the sample extensions +This @value{SECTION} provides a brief overview of the sample extensions that come in the @command{gawk} distribution. Some of them are intended -for production use (e.g., the @code{filefuncs}, @code{readdir} and +for production use (e.g., the @code{filefuncs}, @code{readdir}, and @code{inplace} extensions). Others mainly provide example code that shows how to use the extension API. @@ -34288,14 +34291,14 @@ This is how you load the extension. @item @code{result = chdir("/some/directory")} The @code{chdir()} function is a direct hook to the @code{chdir()} system call to change the current directory. It returns zero -upon success or less than zero upon error. In the latter case, it updates -@code{ERRNO}. +upon success or a value less than zero upon error. +In the latter case, it updates @code{ERRNO}. @cindex @code{stat()} extension function @item @code{result = stat("/some/path", statdata} [@code{, follow}]@code{)} The @code{stat()} function provides a hook into the @code{stat()} system call. -It returns zero upon success or less than zero upon error. +It returns zero upon success or a value less than zero upon error. In the latter case, it updates @code{ERRNO}. By default, it uses the @code{lstat()} system call. However, if passed @@ -34322,10 +34325,10 @@ array with information retrieved from the filesystem, as follows: @item @code{"major"} @tab @code{st_major} @tab Device files @item @code{"minor"} @tab @code{st_minor} @tab Device files @item @code{"blksize"} @tab @code{st_blksize} @tab All -@item @code{"pmode"} @tab A human-readable version of the mode value, such as printed by -@command{ls}. For example, @code{"-rwxr-xr-x"} @tab All +@item @code{"pmode"} @tab A human-readable version of the mode value, like that printed by +@command{ls} (for example, @code{"-rwxr-xr-x"}) @tab All @item @code{"linkval"} @tab The value of the symbolic link @tab Symbolic links -@item @code{"type"} @tab The type of the file as a string. One of +@item @code{"type"} @tab The type of the file as a string---one of @code{"file"}, @code{"blockdev"}, @code{"chardev"}, @@ -34335,15 +34338,15 @@ array with information retrieved from the filesystem, as follows: @code{"symlink"}, @code{"door"}, or -@code{"unknown"}. -Not all systems support all file types. @tab All +@code{"unknown"} +(not all systems support all file types) @tab All @end multitable @cindex @code{fts()} extension function @item @code{flags = or(FTS_PHYSICAL, ...)} @itemx @code{result = fts(pathlist, flags, filedata)} Walk the file trees provided in @code{pathlist} and fill in the -@code{filedata} array as described next. @code{flags} is the bitwise +@code{filedata} array, as described next. @code{flags} is the bitwise OR of several predefined values, also described in a moment. Return zero if there were no errors, otherwise return @minus{}1. @end table @@ -34399,7 +34402,8 @@ During a traversal, do not cross onto a different mounted filesystem. @end table @item filedata -The @code{filedata} array is first cleared. Then, @code{fts()} creates +The @code{filedata} array holds the results. +@code{fts()} first clears it. Then it creates an element in @code{filedata} for every element in @code{pathlist}. The index is the name of the directory or file given in @code{pathlist}. The element for this index is itself an array. There are two cases: @@ -34441,7 +34445,7 @@ for a file: @code{"path"}, @code{"stat"}, and @code{"error"}. @end table The @code{fts()} function returns zero if there were no errors. -Otherwise it returns @minus{}1. +Otherwise, it returns @minus{}1. @quotation NOTE The @code{fts()} extension does not exactly mimic the @@ -34483,14 +34487,14 @@ The arguments to @code{fnmatch()} are: @table @code @item pattern -The @value{FN} wildcard to match. +The @value{FN} wildcard to match @item string -The @value{FN} string. +The @value{FN} string @item flag Either zero, or the bitwise OR of one or more of the -flags in the @code{FNM} array. +flags in the @code{FNM} array @end table The flags are as follows: @@ -34527,14 +34531,14 @@ This is how you load the extension. @cindex @code{fork()} extension function @item pid = fork() This function creates a new process. The return value is zero in the -child and the process-ID number of the child in the parent, or @minus{}1 +child and the process ID number of the child in the parent, or @minus{}1 upon error. In the latter case, @code{ERRNO} indicates the problem. In the child, @code{PROCINFO["pid"]} and @code{PROCINFO["ppid"]} are updated to reflect the correct values. @cindex @code{waitpid()} extension function @item ret = waitpid(pid) -This function takes a numeric argument, which is the process-ID to +This function takes a numeric argument, which is the process ID to wait for. The return value is that of the @code{waitpid()} system call. @@ -34562,8 +34566,8 @@ else @subsection Enabling In-Place File Editing @cindex @code{inplace} extension -The @code{inplace} extension emulates GNU @command{sed}'s @option{-i} option -which performs ``in place'' editing of each input file. +The @code{inplace} extension emulates GNU @command{sed}'s @option{-i} option, +which performs ``in-place'' editing of each input file. It uses the bundled @file{inplace.awk} include file to invoke the extension properly: @@ -34659,14 +34663,14 @@ they are read, with each entry returned as a record. The record consists of three fields. The first two are the inode number and the @value{FN}, separated by a forward slash character. On systems where the directory entry contains the file type, the record -has a third field (also separated by a slash) which is a single letter +has a third field (also separated by a slash), which is a single letter indicating the type of the file. The letters and their corresponding file types are shown in @ref{table-readdir-file-types}. @float Table,table-readdir-file-types @caption{File types returned by the @code{readdir} extension} @multitable @columnfractions .1 .9 -@headitem Letter @tab File Type +@headitem Letter @tab File type @item @code{b} @tab Block device @item @code{c} @tab Character device @item @code{d} @tab Directory @@ -34694,7 +34698,7 @@ Here is an example: @@load "readdir" @dots{} BEGIN @{ FS = "/" @} -@{ print "file name is", $2 @} +@{ print "@value{FN} is", $2 @} @end example @node Extension Sample Revout @@ -34715,8 +34719,7 @@ BEGIN @{ @} @end example -The output from this program is: -@samp{cinap t'nod}. +The output from this program is @samp{cinap t'nod}. @node Extension Sample Rev2way @subsection Two-Way I/O Example @@ -34771,7 +34774,7 @@ success, or zero upon failure. @code{reada()} is the inverse of @code{writea()}; it reads the file named as its first argument, filling in the array named as the second argument. It clears the array first. -Here too, the return value is one on success and zero upon failure. +Here too, the return value is one on success, or zero upon failure. @end table The array created by @code{reada()} is identical to that written by @@ -34859,7 +34862,7 @@ it tries to use @code{GetSystemTimeAsFileTime()}. Attempt to sleep for @var{seconds} seconds. If @var{seconds} is negative, or the attempt to sleep fails, return @minus{}1 and set @code{ERRNO}. Otherwise, return zero after sleeping for the indicated amount of time. -Note that @var{seconds} may be a floating-point (non-integral) value. +Note that @var{seconds} may be a floating-point (nonintegral) value. Implementation details: depending on platform availability, this function tries to use @code{nanosleep()} or @code{select()} to implement the delay. @end table @@ -34886,9 +34889,12 @@ project provides a number of @command{gawk} extensions, including one for processing XML files. This is the evolution of the original @command{xgawk} (XML @command{gawk}) project. -As of this writing, there are six extensions: +As of this writing, there are seven extensions: @itemize @value{BULLET} +@item +@code{errno} extension + @item GD graphics library extension @@ -34900,7 +34906,7 @@ PostgreSQL extension @item MPFR library extension -(this provides access to a number of MPFR functions which @command{gawk}'s +(this provides access to a number of MPFR functions that @command{gawk}'s native MPFR support does not) @item @@ -34954,7 +34960,7 @@ make install @ii{Install the extensions} If you have installed @command{gawk} in the standard way, then you will likely not need the @option{--with-gawk} option when configuring -@code{gawkextlib}. You may also need to use the @command{sudo} utility +@code{gawkextlib}. You may need to use the @command{sudo} utility to install both @command{gawk} and @code{gawkextlib}, depending upon how your system works. @@ -34979,7 +34985,7 @@ named @code{plugin_is_GPL_compatible}. @item Communication between @command{gawk} and an extension is two-way. -@command{gawk} passes a @code{struct} to the extension which contains +@command{gawk} passes a @code{struct} to the extension that contains various data fields and function pointers. The extension can then call into @command{gawk} via the supplied function pointers to accomplish certain tasks. @@ -34992,7 +34998,7 @@ By convention, implementation functions are named @code{do_@var{XXXX}()} for some @command{awk}-level function @code{@var{XXXX}()}. @item -The API is defined in a header file named @file{gawkpi.h}. You must include +The API is defined in a header file named @file{gawkapi.h}. You must include a number of standard header files @emph{before} including it in your source file. @item @@ -35037,7 +35043,7 @@ getting the count of elements in an array; creating a new array; clearing an array; and -flattening an array for easy C style looping over all its indices and elements) +flattening an array for easy C-style looping over all its indices and elements) @end itemize @item @@ -35045,7 +35051,7 @@ The API defines a number of standard data types for representing @command{awk} values, array elements, and arrays. @item -The API provide convenience functions for constructing values. +The API provides convenience functions for constructing values. It also provides memory management functions to ensure compatibility between memory allocated by @command{gawk} and memory allocated by an extension. @@ -35071,8 +35077,8 @@ file make this easier to do. @item The @command{gawk} distribution includes a number of small but useful -sample extensions. The @code{gawkextlib} project includes several more, -larger, extensions. If you wish to write an extension and contribute it +sample extensions. The @code{gawkextlib} project includes several more +(larger) extensions. If you wish to write an extension and contribute it to the community of @command{gawk} users, the @code{gawkextlib} project is the place to do so. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index c41d5a68..16847eb2 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -30727,7 +30727,7 @@ If you know that you wish to use the same numeric or string @emph{value} for one or more variables, you can create the value once, retaining a @dfn{value cookie} for it, and then pass in that value cookie whenever you wish to set the value of a -variable. This both storage space within the running @command{gawk} +variable. This saves storage space within the running @command{gawk} process and reduces the time needed to create the value. @node Memory Allocation Functions @@ -30756,13 +30756,13 @@ be passed to @command{gawk}. @item void gawk_free(void *ptr); Call the correct version of @code{free()} to release storage that was -allocated with @code{gawk_malloc()}, @code{gawk_calloc()} or @code{gawk_realloc()}. +allocated with @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. @end table The API has to provide these functions because it is possible for an extension to be compiled and linked against a different version of the C library than was used for the @command{gawk} -executable.@footnote{This is more common on MS-Windows systems, but +executable.@footnote{This is more common on MS-Windows systems, but it can happen on Unix-like systems as well.} If @command{gawk} were to use its version of @code{free()} when the memory came from an unrelated version of @code{malloc()}, unexpected behavior would @@ -30772,7 +30772,7 @@ Two convenience macros may be used for allocating storage from @code{gawk_malloc()} and @code{gawk_realloc()}. If the allocation fails, they cause @command{gawk} to exit with a fatal error message. They should be used as if they were -procedure calls that do not return a value. +procedure calls that do not return a value: @table @code @item #define emalloc(pointer, type, size, message) @dots{} @@ -30809,7 +30809,7 @@ make_malloced_string(message, strlen(message), & result); @end example @item #define erealloc(pointer, type, size, message) @dots{} -This is like @code{emalloc()}, but it calls @code{gawk_realloc()}, +This is like @code{emalloc()}, but it calls @code{gawk_realloc()} instead of @code{gawk_malloc()}. The arguments are the same as for the @code{emalloc()} macro. @end table @@ -30834,7 +30834,7 @@ for storage in @code{result}. It returns @code{result}. @itemx make_malloced_string(const char *string, size_t length, awk_value_t *result) This function creates a string value in the @code{awk_value_t} variable pointed to by @code{result}. It expects @code{string} to be a @samp{char *} -value pointing to data previously obtained from @code{gawk_malloc()}, @code{gawk_calloc()} or @code{gawk_realloc()}. The idea here +value pointing to data previously obtained from @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The idea here is that the data is passed directly to @command{gawk}, which assumes responsibility for it. It returns @code{result}. @@ -30885,7 +30885,7 @@ The fields are: @table @code @item const char *name; The name of the new function. -@command{awk} level code calls the function by this name. +@command{awk}-level code calls the function by this name. This is a regular C string. Function names must obey the rules for @command{awk} @@ -30899,7 +30899,7 @@ This is a pointer to the C function that provides the extension's functionality. The function must fill in @code{*result} with either a number or a string. @command{gawk} takes ownership of any string memory. -As mentioned earlier, string memory @strong{must} come from one of +As mentioned earlier, string memory @emph{must} come from one of @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The @code{num_actual_args} argument tells the C function how many @@ -30951,20 +30951,20 @@ The @code{exit_status} parameter is the exit status value that @command{gawk} intends to pass to the @code{exit()} system call. @item arg0 -A pointer to private data which @command{gawk} saves in order to pass to +A pointer to private data that @command{gawk} saves in order to pass to the function pointed to by @code{funcp}. @end table @end table -Exit callback functions are called in last-in-first-out (LIFO) +Exit callback functions are called in last-in, first-out (LIFO) order---that is, in the reverse order in which they are registered with @command{gawk}. @node Extension Version String @subsubsection Registering An Extension Version String -You can register a version string which indicates the name and -version of your extension, with @command{gawk}, as follows: +You can register a version string that indicates the name and +version of your extension with @command{gawk}, as follows: @table @code @item void register_ext_version(const char *version); @@ -30986,7 +30986,7 @@ of @code{RS} to find the end of the record, and then uses @code{FS} Additionally, it sets the value of @code{RT} (@pxref{Built-in Variables}). If you want, you can provide your own custom input parser. An input -parser's job is to return a record to the @command{gawk} record processing +parser's job is to return a record to the @command{gawk} record-processing code, along with indicators for the value and length of the data to be used for @code{RT}, if any. @@ -31004,9 +31004,9 @@ It should not change any state (variable values, etc.) within @command{gawk}. @item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf); When @command{gawk} decides to hand control of the file over to the input parser, it calls this function. This function in turn must fill -in certain fields in the @code{awk_input_buf_t} structure, and ensure +in certain fields in the @code{awk_input_buf_t} structure and ensure that certain conditions are true. It should then return true. If an -error of some kind occurs, it should not fill in any fields, and should +error of some kind occurs, it should not fill in any fields and should return false; then @command{gawk} will not use the input parser. The details are presented shortly. @end table @@ -31099,7 +31099,7 @@ in the @code{struct stat}, or any combination of these factors. Once @code{@var{XXX}_can_take_file()} has returned true, and @command{gawk} has decided to use your input parser, it calls -@code{@var{XXX}_take_control_of()}. That function then fills one of +@code{@var{XXX}_take_control_of()}. That function then fills either the @code{get_record} field or the @code{read_func} field in the @code{awk_input_buf_t}. It must also ensure that @code{fd} is @emph{not} set to @code{INVALID_HANDLE}. The following list describes the fields that @@ -31121,21 +31121,21 @@ records. Said function is the core of the input parser. Its behavior is described in the text following this list. @item ssize_t (*read_func)(); -This function pointer should point to function that has the +This function pointer should point to a function that has the same behavior as the standard POSIX @code{read()} system call. It is an alternative to the @code{get_record} pointer. Its behavior is also described in the text following this list. @item void (*close_func)(struct awk_input *iobuf); This function pointer should point to a function that does -the ``tear down.'' It should release any resources allocated by +the ``teardown.'' It should release any resources allocated by @code{@var{XXX}_take_control_of()}. It may also close the file. If it does so, it should set the @code{fd} field to @code{INVALID_HANDLE}. If @code{fd} is still not @code{INVALID_HANDLE} after the call to this function, @command{gawk} calls the regular @code{close()} system call. -Having a ``tear down'' function is optional. If your input parser does +Having a ``teardown'' function is optional. If your input parser does not need it, do not set this field. Then, @command{gawk} calls the regular @code{close()} system call on the file descriptor, so it should be valid. @@ -31146,7 +31146,7 @@ input records. The parameters are as follows: @table @code @item char **out -This is a pointer to a @code{char *} variable which is set to point +This is a pointer to a @code{char *} variable that is set to point to the record. @command{gawk} makes its own copy of the data, so the extension must manage this storage. @@ -31199,17 +31199,17 @@ set this field explicitly. You must choose one method or the other: either a function that returns a record, or one that returns raw data. In particular, if you supply a function to get a record, @command{gawk} will -call it, and never call the raw read function. +call it, and will never call the raw read function. @end quotation @command{gawk} ships with a sample extension that reads directories, -returning records for each entry in the directory (@pxref{Extension +returning records for each entry in a directory (@pxref{Extension Sample Readdir}). You may wish to use that code as a guide for writing your own input parser. 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 +it to always be called, and to take effect as appropriate (as the @code{readdir} extension does). Or you may want it to take effect based upon the value of an @command{awk} variable, as the XML extension from the @code{gawkextlib} project does (@pxref{gawkextlib}). @@ -31319,7 +31319,7 @@ a pointer to any private data associated with the file. These pointers should be set to point to functions that perform the equivalent function as the @code{} functions do, if appropriate. @command{gawk} uses these function pointers for all output. -@command{gawk} initializes the pointers to point to internal, ``pass through'' +@command{gawk} initializes the pointers to point to internal ``pass-through'' functions that just call the regular @code{} functions, so an extension only needs to redefine those functions that are appropriate for what it does. @@ -31330,7 +31330,7 @@ upon the @code{name} and @code{mode} fields, and any additional state (such as @command{awk} variable values) that is appropriate. When @command{gawk} calls @code{@var{XXX}_take_control_of()}, that function should fill -in the other fields, as appropriate, except for @code{fp}, which it should just +in the other fields as appropriate, except for @code{fp}, which it should just use normally. You register your output wrapper with the following function: @@ -31370,14 +31370,14 @@ The fields are as follows: The name of the two-way processor. @item awk_bool_t (*can_take_two_way)(const char *name); -This function returns true if it wants to take over two-way I/O for this @value{FN}. +The function pointed to by this field should return true if it wants to take over two-way I/O for this @value{FN}. It should not change any state (variable values, etc.) within @command{gawk}. @item awk_bool_t (*take_control_of)(const char *name, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_input_buf_t *inbuf, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_output_buf_t *outbuf); -This function should fill in the @code{awk_input_buf_t} and +The function pointed to by this field should fill in the @code{awk_input_buf_t} and @code{awk_outut_buf_t} structures pointed to by @code{inbuf} and @code{outbuf}, respectively. These structures were described earlier. @@ -31406,7 +31406,7 @@ Register the two-way processor pointed to by @code{two_way_processor} with You can print different kinds of warning messages from your extension, as described here. Note that for these functions, -you must pass in the extension id received from @command{gawk} +you must pass in the extension ID received from @command{gawk} when the extension was loaded:@footnote{Because the API uses only ISO C 90 features, it cannot make use of the ISO C 99 variadic macro feature to hide that parameter. More's the pity.} @@ -31459,7 +31459,7 @@ matches what you requested, the function returns true and fills in the @code{awk_value_t} result. Otherwise, the function returns false, and the @code{val_type} member indicates the type of the actual value. You may then -print an error message, or reissue the request for the actual +print an error message or reissue the request for the actual value type, as appropriate. This behavior is summarized in @ref{table-value-types-returned}. @@ -31492,32 +31492,32 @@ value type, as appropriate. This behavior is summarized in String String String - false - false + False + False Number Number if can be converted, else false Number - false - false + False + False Type Array - false - false + False + False Array - false + False Requested Scalar Scalar Scalar - false - false + False + False @@ -31529,11 +31529,11 @@ value type, as appropriate. This behavior is summarized in - Value Cookie - false - false - false - false + Value cookie + False + False + False + False @@ -31551,12 +31551,12 @@ value type, as appropriate. This behavior is summarized in @end tex @multitable @columnfractions .166 .166 .198 .15 .15 .166 @headitem @tab @tab String @tab Number @tab Array @tab Undefined -@item @tab @b{String} @tab String @tab String @tab false @tab false -@item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab false @tab false -@item @b{Type} @tab @b{Array} @tab false @tab false @tab Array @tab false -@item @b{Requested} @tab @b{Scalar} @tab Scalar @tab Scalar @tab false @tab false +@item @tab @b{String} @tab String @tab String @tab False @tab False +@item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab False @tab False +@item @b{Type} @tab @b{Array} @tab False @tab False @tab Array @tab False +@item @b{Requested} @tab @b{Scalar} @tab Scalar @tab Scalar @tab False @tab False @item @tab @b{Undefined} @tab String @tab Number @tab Array @tab Undefined -@item @tab @b{Value Cookie} @tab false @tab false @tab false @tab false +@item @tab @b{Value cookie} @tab False @tab False @tab False @tab False @end multitable @end ifnotdocbook @end ifnotplaintext @@ -31567,21 +31567,21 @@ value type, as appropriate. This behavior is summarized in +------------+------------+-----------+-----------+ | String | Number | Array | Undefined | +-----------+-----------+------------+------------+-----------+-----------+ -| | String | String | String | false | false | +| | String | String | String | False | False | | |-----------+------------+------------+-----------+-----------+ -| | Number | Number if | Number | false | false | +| | Number | Number if | Number | False | False | | | | can be | | | | | | | converted, | | | | | | | else false | | | | | |-----------+------------+------------+-----------+-----------+ -| Type | Array | false | false | Array | false | +| Type | Array | False | False | Array | False | | Requested |-----------+------------+------------+-----------+-----------+ -| | Scalar | Scalar | Scalar | false | false | +| | Scalar | Scalar | Scalar | False | False | | |-----------+------------+------------+-----------+-----------+ | | Undefined | String | Number | Array | Undefined | | |-----------+------------+------------+-----------+-----------+ -| | Value | false | false | false | false | -| | Cookie | | | | | +| | Value | False | False | False | False | +| | cookie | | | | | +-----------+-----------+------------+------------+-----------+-----------+ @end example @end ifplaintext @@ -31598,16 +31598,16 @@ passed to your extension function. They are: @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_valtype_t wanted, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_value_t *result); Fill in the @code{awk_value_t} structure pointed to by @code{result} -with the @code{count}'th argument. Return true if the actual -type matches @code{wanted}, false otherwise. In the latter +with the @code{count}th argument. Return true if the actual +type matches @code{wanted}, and false otherwise. In the latter case, @code{result@w{->}val_type} indicates the actual type -(@pxref{table-value-types-returned}). Counts are zero based---the first +(@pxref{table-value-types-returned}). Counts are zero-based---the first argument is numbered zero, the second one, and so on. @code{wanted} indicates the type of value expected. @item awk_bool_t set_argument(size_t count, awk_array_t array); Convert a parameter that was undefined into an array; this provides -call-by-reference for arrays. Return false if @code{count} is too big, +call by reference for arrays. Return false if @code{count} is too big, or if the argument's type is not undefined. @DBXREF{Array Manipulation} for more information on creating arrays. @end table @@ -31631,8 +31631,9 @@ allows you to create and release cached values. The following routines provide the ability to access and update global @command{awk}-level variables by name. In compiler terminology, identifiers of different kinds are termed @dfn{symbols}, thus the ``sym'' -in the routines' names. The data structure which stores information +in the routines' names. The data structure that stores information about symbols is termed a @dfn{symbol table}. +The functions are as follows: @table @code @item awk_bool_t sym_lookup(const char *name, @@ -31641,14 +31642,14 @@ about symbols is termed a @dfn{symbol table}. Fill in the @code{awk_value_t} structure pointed to by @code{result} with the value of the variable named by the string @code{name}, which is a regular C string. @code{wanted} indicates the type of value expected. -Return true if the actual type matches @code{wanted}, false otherwise. +Return true if the actual type matches @code{wanted}, and false otherwise. In the latter case, @code{result->val_type} indicates the actual type (@pxref{table-value-types-returned}). @item awk_bool_t sym_update(const char *name, awk_value_t *value); Update the variable named by the string @code{name}, which is a regular C string. The variable is added to @command{gawk}'s symbol table -if it is not there. Return true if everything worked, false otherwise. +if it is not there. Return true if everything worked, and false otherwise. Changing types (scalar to array or vice versa) of an existing variable is @emph{not} allowed, nor may this routine be used to update an array. @@ -31673,7 +31674,7 @@ populate it. A @dfn{scalar cookie} is an opaque handle that provides access to a global variable or array. It is an optimization that avoids looking up variables in @command{gawk}'s symbol table every time -access is needed. This was discussed earlier in @ref{General Data Types}. +access is needed. This was discussed earlier, in @ref{General Data Types}. The following functions let you work with scalar cookies: @@ -31789,7 +31790,7 @@ and carefully check the return values from the API functions. @subsubsection Creating and Using Cached Values The routines in this section allow you to create and release -cached values. As with scalar cookies, in theory, cached values +cached values. Like scalar cookies, in theory, cached values are not necessary. You can create numbers and strings using the functions in @ref{Constructor Functions}. You can then assign those values to variables using @code{sym_update()} @@ -31867,7 +31868,7 @@ Using value cookies in this way saves considerable storage, as all of @code{VAR1} through @code{VAR100} share the same value. You might be wondering, ``Is this sharing problematic? -What happens if @command{awk} code assigns a new value to @code{VAR1}, +What happens if @command{awk} code assigns a new value to @code{VAR1}; are all the others changed too?'' That's a great question. The answer is that no, it's not a problem. @@ -31971,7 +31972,7 @@ modify them. @node Array Functions @subsubsection Array Functions -The following functions relate to individual array elements. +The following functions relate to individual array elements: @table @code @item awk_bool_t get_element_count(awk_array_t a_cookie, size_t *count); @@ -31990,13 +31991,13 @@ Return false if @code{wanted} does not match the actual type or if @code{index} is not in the array (@pxref{table-value-types-returned}). The value for @code{index} can be numeric, in which case @command{gawk} -converts it to a string. Using non-integral values is possible, but +converts it to a string. Using nonintegral values is possible, but requires that you understand how such values are converted to strings -(@pxref{Conversion}); thus using integral values is safest. +(@pxref{Conversion}); thus, using integral values is safest. 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 +@code{gawk_calloc()}, or @code{gawk_realloc()}, and @command{gawk} releases the storage. @item awk_bool_t set_array_element(awk_array_t a_cookie, @@ -32052,7 +32053,7 @@ flatten an array and work with it. @item awk_bool_t release_flattened_array(awk_array_t a_cookie, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_flat_array_t *data); When done with a flattened array, release the storage using this function. -You must pass in both the original array cookie, and the address of +You must pass in both the original array cookie and the address of the created @code{awk_flat_array_t} structure. The function returns true upon success, false otherwise. @end table @@ -32062,7 +32063,7 @@ The function returns true upon success, false otherwise. To @dfn{flatten} an array is to create a structure that represents the full array in a fashion that makes it easy -for C code to traverse the entire array. Test code +for C code to traverse the entire array. Some of the code in @file{extension/testext.c} does this, and also serves as a nice example showing how to use the APIs. @@ -32119,9 +32120,9 @@ dump_array_and_delete(int nargs, awk_value_t *result) @end example The function then proceeds in steps, as follows. First, retrieve -the name of the array, passed as the first argument. Then -retrieve the array itself. If either operation fails, print -error messages and return: +the name of the array, passed as the first argument, followed by +the array itself. If either operation fails, print an +error message and return: @example /* get argument named array as flat array and print it */ @@ -32157,7 +32158,7 @@ and print it: @end example The third step is to actually flatten the array, and then -to double check that the count in the @code{awk_flat_array_t} +to double-check that the count in the @code{awk_flat_array_t} is the same as the count just retrieved: @example @@ -32178,7 +32179,7 @@ is the same as the count just retrieved: The fourth step is to retrieve the index of the element to be deleted, which was passed as the second argument. Remember that argument counts passed to @code{get_argument()} -are zero-based, thus the second argument is numbered one: +are zero-based, and thus the second argument is numbered one: @example if (! get_argument(1, AWK_STRING, & value3)) @{ @@ -32193,7 +32194,7 @@ element values. In addition, upon finding the element with the index that is supposed to be deleted, the function sets the @code{AWK_ELEMENT_DELETE} bit in the @code{flags} field of the element. When the array is released, @command{gawk} -traverses the flattened array, and deletes any elements which +traverses the flattened array, and deletes any elements that have this flag bit set: @example @@ -32481,10 +32482,10 @@ The API versions are available at compile time as constants: @table @code @item GAWK_API_MAJOR_VERSION -The major version of the API. +The major version of the API @item GAWK_API_MINOR_VERSION -The minor version of the API. +The minor version of the API @end table The minor version increases when new functions are added to the API. Such @@ -32502,14 +32503,14 @@ constant integers: @table @code @item api->major_version -The major version of the running @command{gawk}. +The major version of the running @command{gawk} @item api->minor_version -The minor version of the running @command{gawk}. +The minor version of the running @command{gawk} @end table It is up to the extension to decide if there are API incompatibilities. -Typically a check like this is enough: +Typically, a check like this is enough: @example if (api->major_version != GAWK_API_MAJOR_VERSION @@ -32523,7 +32524,7 @@ if (api->major_version != GAWK_API_MAJOR_VERSION @end example Such code is included in the boilerplate @code{dl_load_func()} macro -provided in @file{gawkapi.h} (discussed later, in +provided in @file{gawkapi.h} (discussed in @ref{Extension API Boilerplate}). @node Extension API Informational Variables @@ -32570,7 +32571,7 @@ as described here. The boilerplate needed is also provided in comments in the @file{gawkapi.h} header file: @example -/* Boiler plate code: */ +/* Boilerplate code: */ int plugin_is_GPL_compatible; static gawk_api_t *const api; @@ -32629,7 +32630,7 @@ to @code{NULL}, or to point to a string giving the name and version of your extension. @item static awk_ext_func_t func_table[] = @{ @dots{} @}; -This is an array of one or more @code{awk_ext_func_t} structures +This is an array of one or more @code{awk_ext_func_t} structures, as described earlier (@pxref{Extension Functions}). It can then be looped over for multiple calls to @code{add_ext_func()}. @@ -32760,7 +32761,7 @@ the @code{stat()} fails. It fills in the following elements: @table @code @item "name" -The name of the file that was @code{stat()}'ed. +The name of the file that was @code{stat()}ed. @item "dev" @itemx "ino" @@ -32816,7 +32817,7 @@ interprocess communications). The file is a directory. @item "fifo" -The file is a named-pipe (also known as a FIFO). +The file is a named pipe (also known as a FIFO). @item "file" The file is just a regular file. @@ -32839,7 +32840,7 @@ For some other systems, @dfn{a priori} knowledge is used to provide a value. Where no value can be determined, it defaults to 512. @end table -Several additional elements may be present depending upon the operating +Several additional elements may be present, depending upon the operating system and the type of the file. You can test for them in your @command{awk} program by using the @code{in} operator (@pxref{Reference to Elements}): @@ -32869,7 +32870,7 @@ edited slightly for presentation. See @file{extension/filefuncs.c} in the @command{gawk} distribution for the complete version.} The file includes a number of standard header files, and then includes -the @file{gawkapi.h} header file which provides the API definitions. +the @file{gawkapi.h} header file, which provides the API definitions. Those are followed by the necessary variable declarations to make use of the API macros and boilerplate code (@pxref{Extension API Boilerplate}): @@ -32910,9 +32911,9 @@ int plugin_is_GPL_compatible; @cindex programming conventions, @command{gawk} extensions By convention, for an @command{awk} function @code{foo()}, the C function that implements it is called @code{do_foo()}. The function should have -two arguments: the first is an @code{int} usually called @code{nargs}, +two arguments. The first is an @code{int}, usually called @code{nargs}, that represents the number of actual arguments for the function. -The second is a pointer to an @code{awk_value_t}, usually named +The second is a pointer to an @code{awk_value_t} structure, usually named @code{result}: @example @@ -32958,7 +32959,7 @@ Finally, the function returns the return value to the @command{awk} level: The @code{stat()} extension is more involved. First comes a function that turns a numeric mode into a printable representation -(e.g., 644 becomes @samp{-rw-r--r--}). This is omitted here for brevity: +(e.g., octal @code{0644} becomes @samp{-rw-r--r--}). This is omitted here for brevity: @example /* format_mode --- turn a stat mode field into something readable */ @@ -33014,9 +33015,9 @@ array_set_numeric(awk_array_t array, const char *sub, double num) The following function does most of the work to fill in the @code{awk_array_t} result array with values obtained -from a valid @code{struct stat}. It is done in a separate function +from a valid @code{struct stat}. This work is done in a separate function to support the @code{stat()} function for @command{gawk} and also -to support the @code{fts()} extension which is included in +to support the @code{fts()} extension, which is included in the same file but whose code is not shown here (@pxref{Extension Sample File Functions}). @@ -33137,8 +33138,8 @@ the @code{stat()} system call instead of the @code{lstat()} system call. This is done by using a function pointer: @code{statfunc}. @code{statfunc} is initialized to point to @code{lstat()} (instead of @code{stat()}) to get the file information, in case the file is a -symbolic link. However, if there were three arguments, @code{statfunc} -is set point to @code{stat()}, instead. +symbolic link. However, if the third argument is included, @code{statfunc} +is set to point to @code{stat()}, instead. Here is the @code{do_stat()} function, which starts with variable declarations and argument checking: @@ -33194,7 +33195,7 @@ Next, it gets the information for the file. If the called function /* always empty out the array */ clear_array(array); - /* stat the file, if error, set ERRNO and return */ + /* stat the file; if error, set ERRNO and return */ ret = statfunc(name, & sbuf); if (ret < 0) @{ update_ERRNO_int(errno); @@ -33216,7 +33217,9 @@ Finally, it's necessary to provide the ``glue'' that loads the new function(s) into @command{gawk}. The @code{filefuncs} extension also provides an @code{fts()} -function, which we omit here. For its sake there is an initialization +function, which we omit here +(@pxref{Extension Sample File Functions}). +For its sake, there is an initialization function: @example @@ -33341,9 +33344,9 @@ $ @kbd{AWKLIBPATH=$PWD gawk -f testff.awk} @section The Sample Extensions in the @command{gawk} Distribution @cindex extensions distributed with @command{gawk} -This @value{SECTION} provides brief overviews of the sample extensions +This @value{SECTION} provides a brief overview of the sample extensions that come in the @command{gawk} distribution. Some of them are intended -for production use (e.g., the @code{filefuncs}, @code{readdir} and +for production use (e.g., the @code{filefuncs}, @code{readdir}, and @code{inplace} extensions). Others mainly provide example code that shows how to use the extension API. @@ -33379,14 +33382,14 @@ This is how you load the extension. @item @code{result = chdir("/some/directory")} The @code{chdir()} function is a direct hook to the @code{chdir()} system call to change the current directory. It returns zero -upon success or less than zero upon error. In the latter case, it updates -@code{ERRNO}. +upon success or a value less than zero upon error. +In the latter case, it updates @code{ERRNO}. @cindex @code{stat()} extension function @item @code{result = stat("/some/path", statdata} [@code{, follow}]@code{)} The @code{stat()} function provides a hook into the @code{stat()} system call. -It returns zero upon success or less than zero upon error. +It returns zero upon success or a value less than zero upon error. In the latter case, it updates @code{ERRNO}. By default, it uses the @code{lstat()} system call. However, if passed @@ -33413,10 +33416,10 @@ array with information retrieved from the filesystem, as follows: @item @code{"major"} @tab @code{st_major} @tab Device files @item @code{"minor"} @tab @code{st_minor} @tab Device files @item @code{"blksize"} @tab @code{st_blksize} @tab All -@item @code{"pmode"} @tab A human-readable version of the mode value, such as printed by -@command{ls}. For example, @code{"-rwxr-xr-x"} @tab All +@item @code{"pmode"} @tab A human-readable version of the mode value, like that printed by +@command{ls} (for example, @code{"-rwxr-xr-x"}) @tab All @item @code{"linkval"} @tab The value of the symbolic link @tab Symbolic links -@item @code{"type"} @tab The type of the file as a string. One of +@item @code{"type"} @tab The type of the file as a string---one of @code{"file"}, @code{"blockdev"}, @code{"chardev"}, @@ -33426,15 +33429,15 @@ array with information retrieved from the filesystem, as follows: @code{"symlink"}, @code{"door"}, or -@code{"unknown"}. -Not all systems support all file types. @tab All +@code{"unknown"} +(not all systems support all file types) @tab All @end multitable @cindex @code{fts()} extension function @item @code{flags = or(FTS_PHYSICAL, ...)} @itemx @code{result = fts(pathlist, flags, filedata)} Walk the file trees provided in @code{pathlist} and fill in the -@code{filedata} array as described next. @code{flags} is the bitwise +@code{filedata} array, as described next. @code{flags} is the bitwise OR of several predefined values, also described in a moment. Return zero if there were no errors, otherwise return @minus{}1. @end table @@ -33490,7 +33493,8 @@ During a traversal, do not cross onto a different mounted filesystem. @end table @item filedata -The @code{filedata} array is first cleared. Then, @code{fts()} creates +The @code{filedata} array holds the results. +@code{fts()} first clears it. Then it creates an element in @code{filedata} for every element in @code{pathlist}. The index is the name of the directory or file given in @code{pathlist}. The element for this index is itself an array. There are two cases: @@ -33532,7 +33536,7 @@ for a file: @code{"path"}, @code{"stat"}, and @code{"error"}. @end table The @code{fts()} function returns zero if there were no errors. -Otherwise it returns @minus{}1. +Otherwise, it returns @minus{}1. @quotation NOTE The @code{fts()} extension does not exactly mimic the @@ -33574,14 +33578,14 @@ The arguments to @code{fnmatch()} are: @table @code @item pattern -The @value{FN} wildcard to match. +The @value{FN} wildcard to match @item string -The @value{FN} string. +The @value{FN} string @item flag Either zero, or the bitwise OR of one or more of the -flags in the @code{FNM} array. +flags in the @code{FNM} array @end table The flags are as follows: @@ -33618,14 +33622,14 @@ This is how you load the extension. @cindex @code{fork()} extension function @item pid = fork() This function creates a new process. The return value is zero in the -child and the process-ID number of the child in the parent, or @minus{}1 +child and the process ID number of the child in the parent, or @minus{}1 upon error. In the latter case, @code{ERRNO} indicates the problem. In the child, @code{PROCINFO["pid"]} and @code{PROCINFO["ppid"]} are updated to reflect the correct values. @cindex @code{waitpid()} extension function @item ret = waitpid(pid) -This function takes a numeric argument, which is the process-ID to +This function takes a numeric argument, which is the process ID to wait for. The return value is that of the @code{waitpid()} system call. @@ -33653,8 +33657,8 @@ else @subsection Enabling In-Place File Editing @cindex @code{inplace} extension -The @code{inplace} extension emulates GNU @command{sed}'s @option{-i} option -which performs ``in place'' editing of each input file. +The @code{inplace} extension emulates GNU @command{sed}'s @option{-i} option, +which performs ``in-place'' editing of each input file. It uses the bundled @file{inplace.awk} include file to invoke the extension properly: @@ -33750,14 +33754,14 @@ they are read, with each entry returned as a record. The record consists of three fields. The first two are the inode number and the @value{FN}, separated by a forward slash character. On systems where the directory entry contains the file type, the record -has a third field (also separated by a slash) which is a single letter +has a third field (also separated by a slash), which is a single letter indicating the type of the file. The letters and their corresponding file types are shown in @ref{table-readdir-file-types}. @float Table,table-readdir-file-types @caption{File types returned by the @code{readdir} extension} @multitable @columnfractions .1 .9 -@headitem Letter @tab File Type +@headitem Letter @tab File type @item @code{b} @tab Block device @item @code{c} @tab Character device @item @code{d} @tab Directory @@ -33785,7 +33789,7 @@ Here is an example: @@load "readdir" @dots{} BEGIN @{ FS = "/" @} -@{ print "file name is", $2 @} +@{ print "@value{FN} is", $2 @} @end example @node Extension Sample Revout @@ -33806,8 +33810,7 @@ BEGIN @{ @} @end example -The output from this program is: -@samp{cinap t'nod}. +The output from this program is @samp{cinap t'nod}. @node Extension Sample Rev2way @subsection Two-Way I/O Example @@ -33862,7 +33865,7 @@ success, or zero upon failure. @code{reada()} is the inverse of @code{writea()}; it reads the file named as its first argument, filling in the array named as the second argument. It clears the array first. -Here too, the return value is one on success and zero upon failure. +Here too, the return value is one on success, or zero upon failure. @end table The array created by @code{reada()} is identical to that written by @@ -33950,7 +33953,7 @@ it tries to use @code{GetSystemTimeAsFileTime()}. Attempt to sleep for @var{seconds} seconds. If @var{seconds} is negative, or the attempt to sleep fails, return @minus{}1 and set @code{ERRNO}. Otherwise, return zero after sleeping for the indicated amount of time. -Note that @var{seconds} may be a floating-point (non-integral) value. +Note that @var{seconds} may be a floating-point (nonintegral) value. Implementation details: depending on platform availability, this function tries to use @code{nanosleep()} or @code{select()} to implement the delay. @end table @@ -33977,9 +33980,12 @@ project provides a number of @command{gawk} extensions, including one for processing XML files. This is the evolution of the original @command{xgawk} (XML @command{gawk}) project. -As of this writing, there are six extensions: +As of this writing, there are seven extensions: @itemize @value{BULLET} +@item +@code{errno} extension + @item GD graphics library extension @@ -33991,7 +33997,7 @@ PostgreSQL extension @item MPFR library extension -(this provides access to a number of MPFR functions which @command{gawk}'s +(this provides access to a number of MPFR functions that @command{gawk}'s native MPFR support does not) @item @@ -34045,7 +34051,7 @@ make install @ii{Install the extensions} If you have installed @command{gawk} in the standard way, then you will likely not need the @option{--with-gawk} option when configuring -@code{gawkextlib}. You may also need to use the @command{sudo} utility +@code{gawkextlib}. You may need to use the @command{sudo} utility to install both @command{gawk} and @code{gawkextlib}, depending upon how your system works. @@ -34070,7 +34076,7 @@ named @code{plugin_is_GPL_compatible}. @item Communication between @command{gawk} and an extension is two-way. -@command{gawk} passes a @code{struct} to the extension which contains +@command{gawk} passes a @code{struct} to the extension that contains various data fields and function pointers. The extension can then call into @command{gawk} via the supplied function pointers to accomplish certain tasks. @@ -34083,7 +34089,7 @@ By convention, implementation functions are named @code{do_@var{XXXX}()} for some @command{awk}-level function @code{@var{XXXX}()}. @item -The API is defined in a header file named @file{gawkpi.h}. You must include +The API is defined in a header file named @file{gawkapi.h}. You must include a number of standard header files @emph{before} including it in your source file. @item @@ -34128,7 +34134,7 @@ getting the count of elements in an array; creating a new array; clearing an array; and -flattening an array for easy C style looping over all its indices and elements) +flattening an array for easy C-style looping over all its indices and elements) @end itemize @item @@ -34136,7 +34142,7 @@ The API defines a number of standard data types for representing @command{awk} values, array elements, and arrays. @item -The API provide convenience functions for constructing values. +The API provides convenience functions for constructing values. It also provides memory management functions to ensure compatibility between memory allocated by @command{gawk} and memory allocated by an extension. @@ -34162,8 +34168,8 @@ file make this easier to do. @item The @command{gawk} distribution includes a number of small but useful -sample extensions. The @code{gawkextlib} project includes several more, -larger, extensions. If you wish to write an extension and contribute it +sample extensions. The @code{gawkextlib} project includes several more +(larger) extensions. If you wish to write an extension and contribute it to the community of @command{gawk} users, the @code{gawkextlib} project is the place to do so. diff --git a/extension/ChangeLog b/extension/ChangeLog index e30ad593..22eee5e4 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,7 @@ +2015-02-11 Arnold D. Robbins + + * filefuncs.c: Punctuation fix. + 2015-01-24 Arnold D. Robbins Infrastructure updates. diff --git a/extension/filefuncs.c b/extension/filefuncs.c index a20e9ff7..ddb1ecda 100644 --- a/extension/filefuncs.c +++ b/extension/filefuncs.c @@ -490,7 +490,7 @@ do_stat(int nargs, awk_value_t *result) /* always empty out the array */ clear_array(array); - /* stat the file, if error, set ERRNO and return */ + /* stat the file; if error, set ERRNO and return */ ret = statfunc(name, & sbuf); if (ret < 0) { update_ERRNO_int(errno); diff --git a/gawkapi.h b/gawkapi.h index d8215450..7a58bd4a 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -846,7 +846,7 @@ make_number(double num, awk_value_t *result) extern int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id); #if 0 -/* Boiler plate code: */ +/* Boilerplate code: */ int plugin_is_GPL_compatible; static gawk_api_t *const api; -- cgit v1.2.3 From 7620bc316c7e5bfd18f19c8e2fb09637d9eb8dee Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 12 Feb 2015 23:24:04 +0200 Subject: Update POSIX.STD. --- ChangeLog | 4 ++++ POSIX.STD | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 773afd3b..aaee6219 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-02-12 Arnold D. Robbins + + * POSIX.STD: Update with info about function parameters. + 2015-02-11 Arnold D. Robbins * gawkapi.h: Fix spelling error in comment. diff --git a/POSIX.STD b/POSIX.STD index 1555d7be..c48dfb42 100644 --- a/POSIX.STD +++ b/POSIX.STD @@ -5,7 +5,7 @@ are permitted in any medium without royalty provided the copyright notice and this notice are preserved. -------------------------------------------------------------------------- -Thu Mar 31 22:31:57 IST 2011 +Thu Feb 12 08:51:22 IST 2015 ============================ This file documents several things related to the 2008 POSIX standard that I noted after reviewing it. @@ -30,6 +30,19 @@ that I noted after reviewing it. sequence into account. By default gawk doesn't do this. Rather, gawk will do this only if --posix is in effect. +4. According to POSIX, the function parameters of one function may not have + the same name as another function, making this invalid: + + function foo() { ... } + function bar(foo) { ...} + + Or even: + + function bar(foo) { ...} + function foo() { ... } + + Gawk enforces this only with --posix. + The following things aren't described by POSIX but ought to be: 1. The value of $0 in an END rule -- cgit v1.2.3 From dea37a9bcb88cf1ba65c7ad5c439425352a01f40 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 12 Feb 2015 23:24:48 +0200 Subject: Remove check for dbug library in configure.ac. --- ChangeLog | 1 + configure | 6 +----- configure.ac | 6 +----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index aaee6219..cf2a25f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2015-02-12 Arnold D. Robbins * POSIX.STD: Update with info about function parameters. + * configure.ac: Remove test for / use of dbug library. 2015-02-11 Arnold D. Robbins diff --git a/configure b/configure index dd62a431..f4597b70 100755 --- a/configure +++ b/configure @@ -5837,11 +5837,7 @@ if test -f $srcdir/.developing then # add other debug flags as appropriate, save GAWKDEBUG for emergencies CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG -DLOCALEDEBUG" - if grep dbug $srcdir/.developing - then - CFLAGS="$CFLAGS -DDBUG" - LIBS="$LIBS dbug/libdbug.a" - fi + # turn on compiler warnings if we're doing development # enable debugging using macros also if test "$GCC" = yes diff --git a/configure.ac b/configure.ac index 1df240c7..f6322bf2 100644 --- a/configure.ac +++ b/configure.ac @@ -88,11 +88,7 @@ if test -f $srcdir/.developing then # add other debug flags as appropriate, save GAWKDEBUG for emergencies CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG -DLOCALEDEBUG" - if grep dbug $srcdir/.developing - then - CFLAGS="$CFLAGS -DDBUG" - LIBS="$LIBS dbug/libdbug.a" - fi + # turn on compiler warnings if we're doing development # enable debugging using macros also if test "$GCC" = yes -- cgit v1.2.3 From 1d4fd43cb95fed18c9885ba5b30b28eb1f8f713b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 13 Feb 2015 09:40:28 +0200 Subject: Improve regexp collection on Solaris, maybe others. --- ChangeLog | 8 ++++++++ awkgram.c | 10 +++++----- awkgram.y | 10 +++++----- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf2a25f5..18e7e900 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-02-13 Arnold D. Robbins + + * awkgram.y (yylex): Be more careful about passing true to + nextc() when collecting a regexp. Some systems' iscntrl() + are not as forgiving as GLIBC's. E.g., Solaris. + Thanks to Dagobert Michelsen for + the bug report and access to systems to check the fix. + 2015-02-12 Arnold D. Robbins * POSIX.STD: Update with info about function parameters. diff --git a/awkgram.c b/awkgram.c index 20d3506a..b3283eb2 100644 --- a/awkgram.c +++ b/awkgram.c @@ -5337,7 +5337,7 @@ yylex(void) if (lasttok == LEX_EOF) /* error earlier in current source, must give up !! */ return 0; - c = nextc(true); + c = nextc(! want_regexp); if (c == END_SRC) return 0; if (c == END_FILE) @@ -5379,12 +5379,12 @@ yylex(void) want_regexp = false; tok = tokstart; for (;;) { - c = nextc(true); + c = nextc(false); if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) switch (c) { case '[': /* one day check for `.' and `=' too */ - if (nextc(true) == ':' || in_brack == 0) + if (nextc(false) == ':' || in_brack == 0) in_brack++; pushback(); break; @@ -5396,7 +5396,7 @@ yylex(void) in_brack--; break; case '\\': - if ((c = nextc(true)) == END_FILE) { + if ((c = nextc(false)) == END_FILE) { pushback(); yyerror(_("unterminated regexp ends with `\\' at end of file")); goto end_regexp; /* kludge */ @@ -5596,7 +5596,7 @@ retry: return lasttok = '*'; case '/': - if (nextc(true) == '=') { + if (nextc(false) == '=') { pushback(); return lasttok = SLASH_BEFORE_EQUAL; } diff --git a/awkgram.y b/awkgram.y index ef7c139a..0df72b42 100644 --- a/awkgram.y +++ b/awkgram.y @@ -2998,7 +2998,7 @@ yylex(void) if (lasttok == LEX_EOF) /* error earlier in current source, must give up !! */ return 0; - c = nextc(true); + c = nextc(! want_regexp); if (c == END_SRC) return 0; if (c == END_FILE) @@ -3040,12 +3040,12 @@ yylex(void) want_regexp = false; tok = tokstart; for (;;) { - c = nextc(true); + c = nextc(false); if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) switch (c) { case '[': /* one day check for `.' and `=' too */ - if (nextc(true) == ':' || in_brack == 0) + if (nextc(false) == ':' || in_brack == 0) in_brack++; pushback(); break; @@ -3057,7 +3057,7 @@ yylex(void) in_brack--; break; case '\\': - if ((c = nextc(true)) == END_FILE) { + if ((c = nextc(false)) == END_FILE) { pushback(); yyerror(_("unterminated regexp ends with `\\' at end of file")); goto end_regexp; /* kludge */ @@ -3257,7 +3257,7 @@ retry: return lasttok = '*'; case '/': - if (nextc(true) == '=') { + if (nextc(false) == '=') { pushback(); return lasttok = SLASH_BEFORE_EQUAL; } -- cgit v1.2.3 From cde238397af273f91deeaadf7e87713fbcb8ffbb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 13 Feb 2015 11:19:17 +0200 Subject: Through QC1 review of doc! --- doc/ChangeLog | 4 + doc/gawk.info | 528 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 306 ++++++++++++++++---------------- doc/gawktexi.in | 306 ++++++++++++++++---------------- 4 files changed, 578 insertions(+), 566 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9af9ef06..53dc566e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-13 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. Through QC1 review. + 2015-02-11 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index 8061bbd2..44fbd8db 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -26168,56 +26168,56 @@ available in System V Release 3.1 (1987). This minor node summarizes the changes, with cross-references to further details: * The requirement for `;' to separate rules on a line (*note - Statements/Lines::). + Statements/Lines::) * User-defined functions and the `return' statement (*note - User-defined::). + User-defined::) * The `delete' statement (*note Delete::). - * The `do'-`while' statement (*note Do Statement::). + * The `do'-`while' statement (*note Do Statement::) * The built-in functions `atan2()', `cos()', `sin()', `rand()', and - `srand()' (*note Numeric Functions::). + `srand()' (*note Numeric Functions::) * The built-in functions `gsub()', `sub()', and `match()' (*note - String Functions::). + String Functions::) * The built-in functions `close()' and `system()' (*note I/O - Functions::). + Functions::) * The `ARGC', `ARGV', `FNR', `RLENGTH', `RSTART', and `SUBSEP' - predefined variables (*note Built-in Variables::). + predefined variables (*note Built-in Variables::) - * Assignable `$0' (*note Changing Fields::). + * Assignable `$0' (*note Changing Fields::) * The conditional expression using the ternary operator `?:' (*note - Conditional Exp::). + Conditional Exp::) - * The expression `INDEX-VARIABLE in ARRAY' outside of `for' - statements (*note Reference to Elements::). + * The expression `INDX in ARRAY' outside of `for' statements (*note + Reference to Elements::) * The exponentiation operator `^' (*note Arithmetic Ops::) and its - assignment operator form `^=' (*note Assignment Ops::). + assignment operator form `^=' (*note Assignment Ops::) * C-compatible operator precedence, which breaks some old `awk' - programs (*note Precedence::). + programs (*note Precedence::) * Regexps as the value of `FS' (*note Field Separators::) and as the third argument to the `split()' function (*note String - Functions::), rather than using only the first character of `FS'. + Functions::), rather than using only the first character of `FS' * Dynamic regexps as operands of the `~' and `!~' operators (*note - Computed Regexps::). + Computed Regexps::) * The escape sequences `\b', `\f', and `\r' (*note Escape - Sequences::). + Sequences::) - * Redirection of input for the `getline' function (*note Getline::). + * Redirection of input for the `getline' function (*note Getline::) - * Multiple `BEGIN' and `END' rules (*note BEGIN/END::). + * Multiple `BEGIN' and `END' rules (*note BEGIN/END::) - * Multidimensional arrays (*note Multidimensional::). + * Multidimensional arrays (*note Multidimensional::)  File: gawk.info, Node: SVR4, Next: POSIX, Prev: V7/SVR3.1, Up: Language History @@ -26228,37 +26228,37 @@ A.2 Changes Between SVR3.1 and SVR4 The System V Release 4 (1989) version of Unix `awk' added these features (some of which originated in `gawk'): - * The `ENVIRON' array (*note Built-in Variables::). + * The `ENVIRON' array (*note Built-in Variables::) - * Multiple `-f' options on the command line (*note Options::). + * Multiple `-f' options on the command line (*note Options::) * The `-v' option for assigning variables before program execution - begins (*note Options::). + begins (*note Options::) - * The `--' signal for terminating command-line options. + * The `--' signal for terminating command-line options * The `\a', `\v', and `\x' escape sequences (*note Escape - Sequences::). + Sequences::) * A defined return value for the `srand()' built-in function (*note - Numeric Functions::). + Numeric Functions::) * The `toupper()' and `tolower()' built-in string functions for case - translation (*note String Functions::). + translation (*note String Functions::) * A cleaner specification for the `%c' format-control letter in the - `printf' function (*note Control Letters::). + `printf' function (*note Control Letters::) * The ability to dynamically pass the field width and precision (`"%*.*d"') in the argument list of `printf' and `sprintf()' - (*note Control Letters::). + (*note Control Letters::) * The use of regexp constants, such as `/foo/', as expressions, where they are equivalent to using the matching operator, as in `$0 ~ - /foo/' (*note Using Constant Regexps::). + /foo/' (*note Using Constant Regexps::) * Processing of escape sequences inside command-line variable - assignments (*note Assignment Options::). + assignments (*note Assignment Options::)  File: gawk.info, Node: POSIX, Next: BTL, Prev: SVR4, Up: Language History @@ -26270,30 +26270,30 @@ The POSIX Command Language and Utilities standard for `awk' (1992) introduced the following changes into the language: * The use of `-W' for implementation-specific options (*note - Options::). + Options::) * The use of `CONVFMT' for controlling the conversion of numbers to - strings (*note Conversion::). + strings (*note Conversion::) * The concept of a numeric string and tighter comparison rules to go - with it (*note Typing and Comparison::). + with it (*note Typing and Comparison::) * The use of predefined variables as function parameter names is - forbidden (*note Definition Syntax::). + forbidden (*note Definition Syntax::) * More complete documentation of many of the previously undocumented - features of the language. + features of the language In 2012, a number of extensions that had been commonly available for many years were finally added to POSIX. They are: * The `fflush()' built-in function for flushing buffered output - (*note I/O Functions::). + (*note I/O Functions::) - * The `nextfile' statement (*note Nextfile Statement::). + * The `nextfile' statement (*note Nextfile Statement::) * The ability to delete all of an array at once with `delete ARRAY' - (*note Delete::). + (*note Delete::) *Note Common Extensions::, for a list of common extensions not @@ -26315,13 +26315,13 @@ Other Versions::). in his version of `awk': * The `**' and `**=' operators (*note Arithmetic Ops:: and *note - Assignment Ops::). + Assignment Ops::) * The use of `func' as an abbreviation for `function' (*note - Definition Syntax::). + Definition Syntax::) * The `fflush()' built-in function for flushing buffered output - (*note I/O Functions::). + (*note I/O Functions::) *Note Common Extensions::, for a full list of the extensions @@ -26343,104 +26343,102 @@ the current version of `gawk'. * Additional predefined variables: - - The `ARGIND' `BINMODE', `ERRNO', `FIELDWIDTHS', `FPAT', + - The `ARGIND', `BINMODE', `ERRNO', `FIELDWIDTHS', `FPAT', `IGNORECASE', `LINT', `PROCINFO', `RT', and `TEXTDOMAIN' - variables (*note Built-in Variables::). + variables (*note Built-in Variables::) * Special files in I/O redirections: - - The `/dev/stdin', `/dev/stdout', `/dev/stderr' and - `/dev/fd/N' special file names (*note Special Files::). + - The `/dev/stdin', `/dev/stdout', `/dev/stderr', and + `/dev/fd/N' special file names (*note Special Files::) - The `/inet', `/inet4', and `/inet6' special files for TCP/IP networking using `|&' to specify which version of the IP - protocol to use (*note TCP/IP Networking::). + protocol to use (*note TCP/IP Networking::) * Changes and/or additions to the language: - - The `\x' escape sequence (*note Escape Sequences::). + - The `\x' escape sequence (*note Escape Sequences::) - - Full support for both POSIX and GNU regexps (*note Regexp::). + - Full support for both POSIX and GNU regexps (*note Regexp::) - The ability for `FS' and for the third argument to `split()' - to be null strings (*note Single Character Fields::). + to be null strings (*note Single Character Fields::) - - The ability for `RS' to be a regexp (*note Records::). + - The ability for `RS' to be a regexp (*note Records::) - The ability to use octal and hexadecimal constants in `awk' - program source code (*note Nondecimal-numbers::). + program source code (*note Nondecimal-numbers::) - The `|&' operator for two-way I/O to a coprocess (*note - Two-way I/O::). + Two-way I/O::) - - Indirect function calls (*note Indirect Calls::). + - Indirect function calls (*note Indirect Calls::) - Directories on the command line produce a warning and are - skipped (*note Command-line directories::). + skipped (*note Command-line directories::) * New keywords: - The `BEGINFILE' and `ENDFILE' special patterns (*note - BEGINFILE/ENDFILE::). + BEGINFILE/ENDFILE::) - - The `switch' statement (*note Switch Statement::). + - The `switch' statement (*note Switch Statement::) * Changes to standard `awk' functions: - The optional second argument to `close()' that allows closing - one end of a two-way pipe to a coprocess (*note Two-way - I/O::). + one end of a two-way pipe to a coprocess (*note Two-way I/O::) - - POSIX compliance for `gsub()' and `sub()' with `--posix'. + - POSIX compliance for `gsub()' and `sub()' with `--posix' - The `length()' function accepts an array argument and returns - the number of elements in the array (*note String - Functions::). + the number of elements in the array (*note String Functions::) - The optional third argument to the `match()' function for capturing text-matching subexpressions within a regexp (*note - String Functions::). + String Functions::) - Positional specifiers in `printf' formats for making - translations easier (*note Printf Ordering::). + translations easier (*note Printf Ordering::) - - The `split()' function's additional optional fourth argument + - The `split()' function's additional optional fourth argument, which is an array to hold the text of the field separators - (*note String Functions::). + (*note String Functions::) * Additional functions only in `gawk': - The `gensub()', `patsplit()', and `strtonum()' functions for - more powerful text manipulation (*note String Functions::). + more powerful text manipulation (*note String Functions::) - The `asort()' and `asorti()' functions for sorting arrays - (*note Array Sorting::). + (*note Array Sorting::) - The `mktime()', `systime()', and `strftime()' functions for - working with timestamps (*note Time Functions::). + working with timestamps (*note Time Functions::) - The `and()', `compl()', `lshift()', `or()', `rshift()', and `xor()' functions for bit manipulation (*note Bitwise - Functions::). + Functions::) - The `isarray()' function to check if a variable is an array - or not (*note Type Functions::). + or not (*note Type Functions::) - - The `bindtextdomain()', `dcgettext()' and `dcngettext()' - functions for internationalization (*note Programmer i18n::). + - The `bindtextdomain()', `dcgettext()', and `dcngettext()' + functions for internationalization (*note Programmer i18n::) * Changes and/or additions in the command-line options: - The `AWKPATH' environment variable for specifying a path - search for the `-f' command-line option (*note Options::). + search for the `-f' command-line option (*note Options::) - The `AWKLIBPATH' environment variable for specifying a path - search for the `-l' command-line option (*note Options::). + search for the `-l' command-line option (*note Options::) - The `-b', `-c', `-C', `-d', `-D', `-e', `-E', `-g', `-h', `-i', `-l', `-L', `-M', `-n', `-N', `-o', `-O', `-p', `-P', `-r', `-S', `-t', and `-V' short options. Also, the ability - to use GNU-style long-named options that start with `--' and + to use GNU-style long-named options that start with `--', and the `--assign', `--bignum', `--characters-as-bytes', `--copyright', `--debug', `--dump-variables', `--exec', `--field-separator', `--file', `--gen-pot', `--help', @@ -26478,8 +26476,8 @@ the current version of `gawk'. - GCC for VAX and Alpha has not been tested for a while. - * Support for the following obsolete systems was removed from the - code for `gawk' version 4.1: + * Support for the following obsolete system was removed from the code + for `gawk' version 4.1: - Ultrix @@ -26879,22 +26877,22 @@ The following table summarizes the common extensions supported by `gawk', Brian Kernighan's `awk', and `mawk', the three most widely used freely available versions of `awk' (*note Other Versions::). -Feature BWK Awk Mawk GNU Awk Now standard ------------------------------------------------------------------------ -`\x' Escape sequence X X X -`FS' as null string X X X -`/dev/stdin' special file X X X -`/dev/stdout' special file X X X -`/dev/stderr' special file X X X -`delete' without subscript X X X X -`fflush()' function X X X X -`length()' of an array X X X -`nextfile' statement X X X X -`**' and `**=' operators X X -`func' keyword X X -`BINMODE' variable X X -`RS' as regexp X X -Time-related functions X X +Feature BWK `awk' `mawk' `gawk' Now standard +-------------------------------------------------------------------------- +`\x' escape sequence X X X +`FS' as null string X X X +`/dev/stdin' special file X X X +`/dev/stdout' special file X X X +`/dev/stderr' special file X X X +`delete' without subscript X X X X +`fflush()' function X X X X +`length()' of an array X X X +`nextfile' statement X X X X +`**' and `**=' operators X X +`func' keyword X X +`BINMODE' variable X X +`RS' as regexp X X +Time-related functions X X  File: gawk.info, Node: Ranges and Locales, Next: Contributors, Prev: Common Extensions, Up: Language History @@ -26914,7 +26912,7 @@ in the machine's native character set. Thus, on ASCII-based systems, `[a-z]' matched all the lowercase letters, and only the lowercase letters, as the numeric values for the letters from `a' through `z' were contiguous. (On an EBCDIC system, the range `[a-z]' includes -additional, non-alphabetic characters as well.) +additional nonalphabetic characters as well.) Almost all introductory Unix literature explained range expressions as working in this fashion, and in particular, would teach that the @@ -26938,7 +26936,7 @@ outside those locales, the ordering was defined to be based on What does that mean? In many locales, `A' and `a' are both less than `B'. In other words, these locales sort characters in dictionary order, and `[a-dx-z]' is typically not equivalent to `[abcdxyz]'; -instead it might be equivalent to `[ABCXYabcdxyz]', for example. +instead, it might be equivalent to `[ABCXYabcdxyz]', for example. This point needs to be emphasized: much literature teaches that you should use `[a-z]' to match a lowercase character. But on systems with @@ -26962,17 +26960,17 @@ is perfectly valid in ASCII, but is not valid in many Unicode locales, such as `en_US.UTF-8'. Early versions of `gawk' used regexp matching code that was not -locale aware, so ranges had their traditional interpretation. +locale-aware, so ranges had their traditional interpretation. When `gawk' switched to using locale-aware regexp matchers, the problems began; especially as both GNU/Linux and commercial Unix vendors started implementing non-ASCII locales, _and making them the default_. Perhaps the most frequently asked question became something -like "why does `[A-Z]' match lowercase letters?!?" +like, "Why does `[A-Z]' match lowercase letters?!?" This situation existed for close to 10 years, if not more, and the `gawk' maintainer grew weary of trying to explain that `gawk' was being -nicely standards compliant, and that the issue was in the user's +nicely standards-compliant, and that the issue was in the user's locale. During the development of version 4.0, he modified `gawk' to always treat ranges in the original, pre-POSIX fashion, unless `--posix' was used (*note Options::).(2) @@ -26984,18 +26982,18 @@ of range expressions was _undefined_.(3) By using this lovely technical term, the standard gives license to implementors to implement ranges in whatever way they choose. The -`gawk' maintainer chose to apply the pre-POSIX meaning in all cases: -the default regexp matching; with `--traditional' and with `--posix'; -in all cases, `gawk' remains POSIX compliant. +`gawk' maintainer chose to apply the pre-POSIX meaning both with the +default regexp matching and when `--traditional' or `--posix' are used. +In all cases `gawk' remains POSIX-compliant. ---------- Footnotes ---------- (1) And Life was good. (2) And thus was born the Campaign for Rational Range Interpretation -(or RRI). A number of GNU tools have either implemented this change, or -will soon. Thanks to Karl Berry for coining the phrase "Rational Range -Interpretation." +(or RRI). A number of GNU tools have already implemented this change, +or will soon. Thanks to Karl Berry for coining the phrase "Rational +Range Interpretation." (3) See the standard (http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05) @@ -27027,7 +27025,7 @@ Info file, in approximate chronological order: * Richard Stallman helped finish the implementation and the initial draft of this Info file. He is also the founder of the FSF and - the GNU project. + the GNU Project. * John Woods contributed parts of the code (mostly fixes) in the initial version of `gawk'. @@ -27113,22 +27111,22 @@ Info file, in approximate chronological order: * John Haque made the following contributions: - The modifications to convert `gawk' into a byte-code - interpreter, including the debugger. + interpreter, including the debugger - - The addition of true arrays of arrays. + - The addition of true arrays of arrays - The additional modifications for support of - arbitrary-precision arithmetic. + arbitrary-precision arithmetic - - The initial text of *note Arbitrary Precision Arithmetic::. + - The initial text of *note Arbitrary Precision Arithmetic:: - The work to merge the three versions of `gawk' into one, for - the 4.1 release. + the 4.1 release - - Improved array internals for arrays indexed by integers. + - Improved array internals for arrays indexed by integers - - The improved array sorting features were driven by John - together with Pat Rankin. + - The improved array sorting features were also driven by John, + together with Pat Rankin * Panos Papadopoulos contributed the original text for *note Include Files::. @@ -27157,11 +27155,11 @@ A.10 Summary ============ * The `awk' language has evolved over time. The first release was - with V7 Unix circa 1978. In 1987, for System V Release 3.1, major - additions, including user-defined functions, were made to the - language. Additional changes were made for System V Release 4, in - 1989. Since then, further minor changes happen under the auspices - of the POSIX standard. + with V7 Unix, circa 1978. In 1987, for System V Release 3.1, + major additions, including user-defined functions, were made to + the language. Additional changes were made for System V Release + 4, in 1989. Since then, further minor changes have happened under + the auspices of the POSIX standard. * Brian Kernighan's `awk' provides a small number of extensions that are implemented in common with other versions of `awk'. @@ -27174,7 +27172,7 @@ A.10 Summary been confusing over the years. Today, `gawk' implements Rational Range Interpretation, where ranges of the form `[a-z]' match _only_ the characters numerically between `a' through `z' in the - machine's native character set. Usually this is ASCII but it can + machine's native character set. Usually this is ASCII, but it can be EBCDIC on IBM S/390 systems. * Many people have contributed to `gawk' development over the years. @@ -27252,7 +27250,7 @@ B.1.2 Extracting the Distribution `gawk' is distributed as several `tar' files compressed with different compression programs: `gzip', `bzip2', and `xz'. For simplicity, the rest of these instructions assume you are using the one compressed with -the GNU Zip program, `gzip'. +the GNU Gzip program (`gzip'). Once you have the distribution (e.g., `gawk-4.1.2.tar.gz'), use `gzip' to expand the file and then use `tar' to extract it. You can @@ -27292,10 +27290,10 @@ files, subdirectories, and files related to the configuration process to different non-Unix operating systems: Various `.c', `.y', and `.h' files - The actual `gawk' source code. + These files contain the actual `gawk' source code. `ABOUT-NLS' - Information about GNU `gettext' and translations. + A file containing information about GNU `gettext' and translations. `AUTHORS' A file with some information about the authorship of `gawk'. It @@ -27327,7 +27325,7 @@ Various `.c', `.y', and `.h' files The GNU General Public License. `POSIX.STD' - A description of behaviors in the POSIX standard for `awk' which + A description of behaviors in the POSIX standard for `awk' that are left undefined, or where `gawk' may not comply fully, as well as a list of things that the POSIX standard should describe but does not. @@ -27548,14 +27546,16 @@ command line when compiling `gawk' from scratch, including: do nothing. Similarly, setting the `LINT' variable (*note User-modified::) has no effect on the running `awk' program. - When used with GCC's automatic dead-code-elimination, this option - cuts almost 23K bytes off the size of the `gawk' executable on - GNU/Linux x86_64 systems. Results on other systems and with other - compilers are likely to vary. Using this option may bring you - some slight performance improvement. + When used with the GNU Compiler Collection's (GCC's) automatic + dead-code-elimination, this option cuts almost 23K bytes off the + size of the `gawk' executable on GNU/Linux x86_64 systems. + Results on other systems and with other compilers are likely to + vary. Using this option may bring you some slight performance + improvement. - Using this option will cause some of the tests in the test suite - to fail. This option may be removed at a later date. + CAUTION: Using this option will cause some of the tests in + the test suite to fail. This option may be removed at a + later date. `--disable-nls' Disable all message-translation facilities. This is usually not @@ -27639,10 +27639,10 @@ B.3.1 Installation on PC Operating Systems This minor node covers installation and usage of `gawk' on Intel architecture machines running MS-DOS, any version of MS-Windows, or OS/2. In this minor node, the term "Windows32" refers to any of -Microsoft Windows-95/98/ME/NT/2000/XP/Vista/7/8. +Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8. The limitations of MS-DOS (and MS-DOS shells under the other -operating systems) has meant that various "DOS extenders" are often +operating systems) have meant that various "DOS extenders" are often used with programs such as `gawk'. The varying capabilities of Microsoft Windows 3.1 and Windows32 can add to the confusion. For an overview of the considerations, refer to `README_d/README.pc' in the @@ -27837,7 +27837,7 @@ The DJGPP collection of tools includes an MS-DOS port of Bash, and several shells are available for OS/2, including `ksh'. Under MS-Windows, OS/2 and MS-DOS, `gawk' (and many other text -programs) silently translate end-of-line `\r\n' to `\n' on input and +programs) silently translates end-of-line `\r\n' to `\n' on input and `\n' to `\r\n' on output. A special `BINMODE' variable (c.e.) allows control over these translations and is interpreted as follows: @@ -27859,7 +27859,7 @@ The modes for standard input and standard output are set one time only program). Setting `BINMODE' for standard input or standard output is accomplished by using an appropriate `-v BINMODE=N' option on the command line. `BINMODE' is set at the time a file or pipe is opened -and cannot be changed mid-stream. +and cannot be changed midstream. The name `BINMODE' was chosen to match `mawk' (*note Other Versions::). `mawk' and `gawk' handle `BINMODE' similarly; however, @@ -27903,10 +27903,9 @@ B.3.1.5 Using `gawk' In The Cygwin Environment `gawk' can be built and used "out of the box" under MS-Windows if you are using the Cygwin environment (http://www.cygwin.com). This -environment provides an excellent simulation of GNU/Linux, using the -GNU tools, such as Bash, the GNU Compiler Collection (GCC), GNU Make, -and other GNU programs. Compilation and installation for Cygwin is the -same as for a Unix system: +environment provides an excellent simulation of GNU/Linux, using Bash, +GCC, GNU Make, and other GNU programs. Compilation and installation +for Cygwin is the same as for a Unix system: tar -xvpzf gawk-4.1.2.tar.gz cd gawk-4.1.2 @@ -27924,7 +27923,7 @@ B.3.1.6 Using `gawk' In The MSYS Environment ............................................ In the MSYS environment under MS-Windows, `gawk' automatically uses -binary mode for reading and writing files. Thus there is no need to +binary mode for reading and writing files. Thus, there is no need to use the `BINMODE' variable. This can cause problems with other Unix-like components that have @@ -27979,9 +27978,9 @@ available from `https://github.com/endlesssoftware/mmk'. target parameter may need to be exact. `gawk' has been tested under VAX/VMS 7.3 and Alpha/VMS 7.3-1 using -Compaq C V6.4, and Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS 8.3. -The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha -and IA64 VMS 8.4 used HP C 7.3.(1) +Compaq C V6.4, and under Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS +8.3. The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both +Alpha and IA64 VMS 8.4 used HP C 7.3.(1) *Note VMS GNV::, for information on building `gawk' as a PCSI kit that is compatible with the GNV product. @@ -28024,7 +28023,7 @@ than 32 bits. /name=(as_is,short) - Compile time macros need to be defined before the first VMS-supplied + Compile-time macros need to be defined before the first VMS-supplied header file is included, as follows: #if (__CRTL_VER >= 70200000) && !defined (__VAX) @@ -28068,14 +28067,14 @@ directory tree, the program will be known as `GNV$GNU:[vms_help]gawk.hlp'. The PCSI kit also installs a `GNV$GNU:[vms_bin]gawk_verb.cld' file -which can be used to add `gawk' and `awk' as DCL commands. +that can be used to add `gawk' and `awk' as DCL commands. For just the current process you can use: $ set command gnv$gnu:[vms_bin]gawk_verb.cld Or the system manager can use `GNV$GNU:[vms_bin]gawk_verb.cld' to -add the `gawk' and `awk' to the system wide `DCLTABLES'. +add the `gawk' and `awk' to the system-wide `DCLTABLES'. The DCL syntax is documented in the `gawk.hlp' file. @@ -28135,14 +28134,14 @@ process) are present, there is no ambiguity and `--' can be omitted. status value when the program exits. The VMS severity bits will be set based on the `exit' value. A -failure is indicated by 1 and VMS sets the `ERROR' status. A fatal -error is indicated by 2 and VMS sets the `FATAL' status. All other +failure is indicated by 1, and VMS sets the `ERROR' status. A fatal +error is indicated by 2, and VMS sets the `FATAL' status. All other values will have the `SUCCESS' status. The exit value is encoded to comply with VMS coding standards and will have the `C_FACILITY_NO' of `0x350000' with the constant `0xA000' added to the number shifted over by 3 bits to make room for the severity codes. - To extract the actual `gawk' exit code from the VMS status use: + To extract the actual `gawk' exit code from the VMS status, use: unix_status = (vms_status .and. &x7f8) / 8 @@ -28158,7 +28157,7 @@ Function::. VMS reports time values in GMT unless one of the `SYS$TIMEZONE_RULE' or `TZ' logical names is set. Older versions of VMS, such as VAX/VMS -7.3 do not set these logical names. +7.3, do not set these logical names. The default search path, when looking for `awk' program files specified by the `-f' option, is `"SYS$DISK:[],AWK_LIBRARY:"'. The @@ -28175,7 +28174,7 @@ B.3.2.5 The VMS GNV Project The VMS GNV package provides a build environment similar to POSIX with ports of a collection of open source tools. The `gawk' found in the GNV -base kit is an older port. Currently the GNV project is being +base kit is an older port. Currently, the GNV project is being reorganized to supply individual PCSI packages for each component. See `https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/'. @@ -28209,7 +28208,7 @@ B.4 Reporting Problems and Bugs Douglas Adams, `The Hitchhiker's Guide to the Galaxy' If you have problems with `gawk' or think that you have found a bug, -report it to the developers; we cannot promise to do anything but we +report it to the developers; we cannot promise to do anything, but we might well want to fix it. Before reporting a bug, make sure you have really found a genuine @@ -28220,7 +28219,7 @@ documentation! Before reporting a bug or trying to fix it yourself, try to isolate it to the smallest possible `awk' program and input data file that -reproduces the problem. Then send us the program and data file, some +reproduce the problem. Then send us the program and data file, some idea of what kind of Unix system you're using, the compiler you used to compile `gawk', and the exact results `gawk' gave you. Also say what you expected to occur; this helps us decide whether the problem is @@ -28232,7 +28231,7 @@ You can get this information with the command `gawk --version'. Once you have a precise problem description, send email to . - The `gawk' maintainers subscribe to this address and thus they will + The `gawk' maintainers subscribe to this address, and thus they will receive your bug report. Although you can send mail to the maintainers directly, the bug reporting address is preferred because the email list is archived at the GNU Project. _All email must be in English. This is @@ -28253,8 +28252,8 @@ the only language understood in common by all the maintainers._ forward bug reports "upstream" to the GNU mailing list, many don't, so there is a good chance that the `gawk' maintainers won't even see the bug report! Second, mail to the GNU list is - archived, and having everything at the GNU project keeps things - self-contained and not dependant on other organizations. + archived, and having everything at the GNU Project keeps things + self-contained and not dependent on other organizations. Non-bug suggestions are always welcome as well. If you have questions about things that are unclear in the documentation or are @@ -28263,18 +28262,19 @@ if we can. If you find bugs in one of the non-Unix ports of `gawk', send an email to the bug list, with a copy to the person who maintains that -port. They are named in the following list, as well as in the `README' -file in the `gawk' distribution. Information in the `README' file -should be considered authoritative if it conflicts with this Info file. +port. The maintainers are named in the following list, as well as in +the `README' file in the `gawk' distribution. Information in the +`README' file should be considered authoritative if it conflicts with +this Info file. The people maintaining the various `gawk' ports are: -Unix and POSIX systems Arnold Robbins, . -MS-DOS with DJGPP Scott Deifik, . -MS-Windows with MinGW Eli Zaretskii, . -OS/2 Andreas Buening, . -VMS John Malmberg, . -z/OS (OS/390) Dave Pitts, . +Unix and POSIX systems Arnold Robbins, +MS-DOS with DJGPP Scott Deifik, +MS-Windows with MinGW Eli Zaretskii, +OS/2 Andreas Buening, +VMS John Malmberg, +z/OS (OS/390) Dave Pitts, If your bug is also reproducible under Unix, send a copy of your report to the email list as well. @@ -28285,7 +28285,7 @@ File: gawk.info, Node: Other Versions, Next: Installation summary, Prev: Bugs B.5 Other Freely Available `awk' Implementations ================================================ - It's kind of fun to put comments like this in your awk code. + It's kind of fun to put comments like this in your awk code: `// Do C++ comments work? answer: yes! of course' -- Michael Brennan @@ -28308,7 +28308,7 @@ Unix `awk' Zip file `http://www.cs.princeton.edu/~bwk/btl.mirror/awk.zip' - You can also retrieve it from Git Hub: + You can also retrieve it from GitHub: git clone git://github.com/onetrueawk/awk bwkawk @@ -28350,7 +28350,7 @@ Unix `awk' `awka' Written by Andrew Sumner, `awka' translates `awk' programs into C, compiles them, and links them with a library of functions that - provides the core `awk' functionality. It also has a number of + provide the core `awk' functionality. It also has a number of extensions. The `awk' translator is released under the GPL, and the library is @@ -28364,14 +28364,14 @@ Unix `awk' `pawk' Nelson H.F. Beebe at the University of Utah has modified BWK `awk' to provide timing and profiling information. It is different from - `gawk' with the `--profile' option (*note Profiling::), in that it + `gawk' with the `--profile' option (*note Profiling::) in that it uses CPU-based profiling, not line-count profiling. You may find it at either `ftp://ftp.math.utah.edu/pub/pawk/pawk-20030606.tar.gz' or `http://www.math.utah.edu/pub/pawk/pawk-20030606.tar.gz'. -Busybox Awk - Busybox is a GPL-licensed program providing small versions of many +BusyBox `awk' + BusyBox is a GPL-licensed program providing small versions of many applications within a single executable. It is aimed at embedded systems. It includes a full implementation of POSIX `awk'. When building it, be careful not to do `make install' as it will @@ -28381,7 +28381,7 @@ Busybox Awk The OpenSolaris POSIX `awk' The versions of `awk' in `/usr/xpg4/bin' and `/usr/xpg6/bin' on - Solaris are more-or-less POSIX-compliant. They are based on the + Solaris are more or less POSIX-compliant. They are based on the `awk' from Mortice Kern Systems for PCs. We were able to make this code compile and work under GNU/Linux with 1-2 hours of work. Making it more generally portable (using GNU Autoconf and/or @@ -28413,7 +28413,7 @@ Libmawk information. (This is not related to Nelson Beebe's modified version of BWK `awk', described earlier.) -QSE Awk +QSE `awk' This is an embeddable `awk' interpreter. For more information, see `http://code.google.com/p/qse/' and `http://awk.info/?tools/qse'. @@ -28431,7 +28431,7 @@ Other versions See also the "Versions and implementations" section of the Wikipedia article (http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations) - for information on additional versions. + on `awk' for information on additional versions.  @@ -28440,7 +28440,7 @@ File: gawk.info, Node: Installation summary, Prev: Other Versions, Up: Instal B.6 Summary =========== - * The `gawk' distribution is available from GNU project's main + * The `gawk' distribution is available from the GNU Project's main distribution site, `ftp.gnu.org'. The canonical build recipe is: wget http://ftp.gnu.org/gnu/gawk/gawk-4.1.2.tar.gz @@ -28449,17 +28449,17 @@ B.6 Summary ./configure && make && make check * `gawk' may be built on non-POSIX systems as well. The currently - supported systems are MS-Windows using DJGPP, MSYS, MinGW and + supported systems are MS-Windows using DJGPP, MSYS, MinGW, and Cygwin, OS/2 using EMX, and both Vax/VMS and OpenVMS. Instructions for each system are included in this major node. * Bug reports should be sent via email to . Bug - reports should be in English, and should include the version of + reports should be in English and should include the version of `gawk', how it was compiled, and a short program and data file - which demonstrate the problem. + that demonstrate the problem. * There are a number of other freely available `awk' - implementations. Many are POSIX compliant; others are less so. + implementations. Many are POSIX-compliant; others are less so.  @@ -31511,7 +31511,7 @@ Index * --disable-lint configuration option: Additional Configuration Options. (line 15) * --disable-nls configuration option: Additional Configuration Options. - (line 30) + (line 32) * --dump-variables option: Options. (line 93) * --dump-variables option, using for library functions: Library Names. (line 45) @@ -31549,7 +31549,7 @@ Index * --use-lc-numeric option: Options. (line 220) * --version option: Options. (line 302) * --with-whiny-user-strftime configuration option: Additional Configuration Options. - (line 35) + (line 37) * -b option: Options. (line 68) * -C option: Options. (line 88) * -c option: Options. (line 81) @@ -32070,7 +32070,7 @@ Index * Brown, Martin: Contributors. (line 82) * 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 <1>: Bugs. (line 71) * Buening, Andreas <2>: Contributors. (line 92) * Buening, Andreas: Acknowledgments. (line 60) * buffering, input/output <1>: Two-way I/O. (line 52) @@ -32083,7 +32083,7 @@ Index * bug-gawk@gnu.org bug reporting address: Bugs. (line 30) * built-in functions: Functions. (line 6) * built-in functions, evaluation order: Calling Built-in. (line 30) -* Busybox Awk: Other Versions. (line 92) +* BusyBox Awk: Other Versions. (line 92) * c.e., See common extensions: Conventions. (line 51) * call by reference: Pass By Value/Reference. (line 44) @@ -32215,9 +32215,9 @@ Index * configuration option, --disable-lint: Additional Configuration Options. (line 15) * configuration option, --disable-nls: Additional Configuration Options. - (line 30) + (line 32) * configuration option, --with-whiny-user-strftime: Additional Configuration Options. - (line 35) + (line 37) * configuration options, gawk: Additional Configuration Options. (line 6) * constant regexps: Regexp Usage. (line 57) @@ -32443,7 +32443,7 @@ Index * decimal point character, locale specific: Options. (line 272) * decrement operators: Increment Ops. (line 35) * default keyword: Switch Statement. (line 6) -* Deifik, Scott <1>: Bugs. (line 70) +* Deifik, Scott <1>: Bugs. (line 71) * Deifik, Scott <2>: Contributors. (line 53) * Deifik, Scott: Acknowledgments. (line 60) * delete ARRAY: Delete. (line 39) @@ -33374,7 +33374,7 @@ Index * mail-list file: Sample Data Files. (line 6) * mailing labels, printing: Labels Program. (line 6) * mailing list, GNITS: Acknowledgments. (line 52) -* Malmberg, John <1>: Bugs. (line 70) +* Malmberg, John <1>: Bugs. (line 71) * Malmberg, John: Acknowledgments. (line 60) * Malmberg, John E.: Contributors. (line 137) * mark parity: Ordinal Functions. (line 45) @@ -33613,7 +33613,7 @@ Index (line 6) * pipe, input: Getline/Pipe. (line 9) * pipe, output: Redirection. (line 57) -* Pitts, Dave <1>: Bugs. (line 70) +* Pitts, Dave <1>: Bugs. (line 71) * Pitts, Dave: Acknowledgments. (line 60) * Plauger, P.J.: Library Functions. (line 12) * plug-in: Extension Intro. (line 6) @@ -33791,7 +33791,7 @@ Index * pwcat program: Passwd Functions. (line 23) * q debugger command (alias for quit): Miscellaneous Debugger Commands. (line 99) -* QSE Awk: Other Versions. (line 135) +* QSE awk: Other Versions. (line 135) * Quanstrom, Erik: Alarm Program. (line 8) * question mark (?), ?: operator: Precedence. (line 92) * question mark (?), regexp operator <1>: GNU Regexp Operators. @@ -33926,7 +33926,7 @@ Index * RLENGTH variable: Auto-set. (line 252) * RLENGTH variable, match() function and: String Functions. (line 228) * Robbins, Arnold <1>: Future Extensions. (line 6) -* Robbins, Arnold <2>: Bugs. (line 70) +* Robbins, Arnold <2>: Bugs. (line 71) * Robbins, Arnold <3>: Contributors. (line 144) * Robbins, Arnold <4>: General Data Types. (line 6) * Robbins, Arnold <5>: Alarm Program. (line 6) @@ -34117,7 +34117,7 @@ Index (line 94) * source code, awka: Other Versions. (line 68) * source code, Brian Kernighan's awk: Other Versions. (line 13) -* source code, Busybox Awk: Other Versions. (line 92) +* source code, BusyBox Awk: Other Versions. (line 92) * source code, gawk: Gawk Distribution. (line 6) * source code, Illumos awk: Other Versions. (line 109) * source code, jawk: Other Versions. (line 117) @@ -34126,7 +34126,7 @@ Index * source code, mixing: Options. (line 117) * source code, pawk: Other Versions. (line 82) * source code, pawk (Python version): Other Versions. (line 129) -* source code, QSE Awk: Other Versions. (line 135) +* source code, QSE awk: Other Versions. (line 135) * 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) @@ -34455,7 +34455,7 @@ Index * xor: Bitwise Functions. (line 56) * XOR bitwise operation: Bitwise Functions. (line 6) * Yawitz, Efraim: Contributors. (line 131) -* Zaretskii, Eli <1>: Bugs. (line 70) +* Zaretskii, Eli <1>: Bugs. (line 71) * Zaretskii, Eli <2>: Contributors. (line 55) * Zaretskii, Eli: Acknowledgments. (line 60) * zerofile.awk program: Empty Files. (line 21) @@ -34970,77 +34970,77 @@ Node: Extension summary1046798 Node: Extension Exercises1050487 Node: Language History1051209 Node: V7/SVR3.11052865 -Node: SVR41055046 -Node: POSIX1056491 -Node: BTL1057880 -Node: POSIX/GNU1058614 -Node: Feature History1064178 -Node: Common Extensions1077276 -Node: Ranges and Locales1078600 -Ref: Ranges and Locales-Footnote-11083218 -Ref: Ranges and Locales-Footnote-21083245 -Ref: Ranges and Locales-Footnote-31083479 -Node: Contributors1083700 -Node: History summary1089241 -Node: Installation1090611 -Node: Gawk Distribution1091557 -Node: Getting1092041 -Node: Extracting1092864 -Node: Distribution contents1094499 -Node: Unix Installation1100216 -Node: Quick Installation1100833 -Node: Additional Configuration Options1103257 -Node: Configuration Philosophy1104995 -Node: Non-Unix Installation1107364 -Node: PC Installation1107822 -Node: PC Binary Installation1109141 -Node: PC Compiling1110989 -Ref: PC Compiling-Footnote-11114010 -Node: PC Testing1114119 -Node: PC Using1115295 -Node: Cygwin1119410 -Node: MSYS1120233 -Node: VMS Installation1120733 -Node: VMS Compilation1121525 -Ref: VMS Compilation-Footnote-11122747 -Node: VMS Dynamic Extensions1122805 -Node: VMS Installation Details1124489 -Node: VMS Running1126741 -Node: VMS GNV1129577 -Node: VMS Old Gawk1130311 -Node: Bugs1130781 -Node: Other Versions1134664 -Node: Installation summary1141088 -Node: Notes1142144 -Node: Compatibility Mode1143009 -Node: Additions1143791 -Node: Accessing The Source1144716 -Node: Adding Code1146151 -Node: New Ports1152308 -Node: Derived Files1156790 -Ref: Derived Files-Footnote-11162265 -Ref: Derived Files-Footnote-21162299 -Ref: Derived Files-Footnote-31162895 -Node: Future Extensions1163009 -Node: Implementation Limitations1163615 -Node: Extension Design1164863 -Node: Old Extension Problems1166017 -Ref: Old Extension Problems-Footnote-11167534 -Node: Extension New Mechanism Goals1167591 -Ref: Extension New Mechanism Goals-Footnote-11170951 -Node: Extension Other Design Decisions1171140 -Node: Extension Future Growth1173248 -Node: Old Extension Mechanism1174084 -Node: Notes summary1175846 -Node: Basic Concepts1177032 -Node: Basic High Level1177713 -Ref: figure-general-flow1177985 -Ref: figure-process-flow1178584 -Ref: Basic High Level-Footnote-11181813 -Node: Basic Data Typing1181998 -Node: Glossary1185326 -Node: Copying1217255 -Node: GNU Free Documentation License1254811 -Node: Index1279947 +Node: SVR41055018 +Node: POSIX1056452 +Node: BTL1057833 +Node: POSIX/GNU1058564 +Node: Feature History1064085 +Node: Common Extensions1077183 +Node: Ranges and Locales1078555 +Ref: Ranges and Locales-Footnote-11083174 +Ref: Ranges and Locales-Footnote-21083201 +Ref: Ranges and Locales-Footnote-31083436 +Node: Contributors1083657 +Node: History summary1089197 +Node: Installation1090576 +Node: Gawk Distribution1091522 +Node: Getting1092006 +Node: Extracting1092829 +Node: Distribution contents1094466 +Node: Unix Installation1100220 +Node: Quick Installation1100837 +Node: Additional Configuration Options1103261 +Node: Configuration Philosophy1105064 +Node: Non-Unix Installation1107433 +Node: PC Installation1107891 +Node: PC Binary Installation1109211 +Node: PC Compiling1111059 +Ref: PC Compiling-Footnote-11114080 +Node: PC Testing1114189 +Node: PC Using1115365 +Node: Cygwin1119480 +Node: MSYS1120250 +Node: VMS Installation1120751 +Node: VMS Compilation1121543 +Ref: VMS Compilation-Footnote-11122772 +Node: VMS Dynamic Extensions1122830 +Node: VMS Installation Details1124514 +Node: VMS Running1126765 +Node: VMS GNV1129605 +Node: VMS Old Gawk1130340 +Node: Bugs1130810 +Node: Other Versions1134699 +Node: Installation summary1141133 +Node: Notes1142192 +Node: Compatibility Mode1143057 +Node: Additions1143839 +Node: Accessing The Source1144764 +Node: Adding Code1146199 +Node: New Ports1152356 +Node: Derived Files1156838 +Ref: Derived Files-Footnote-11162313 +Ref: Derived Files-Footnote-21162347 +Ref: Derived Files-Footnote-31162943 +Node: Future Extensions1163057 +Node: Implementation Limitations1163663 +Node: Extension Design1164911 +Node: Old Extension Problems1166065 +Ref: Old Extension Problems-Footnote-11167582 +Node: Extension New Mechanism Goals1167639 +Ref: Extension New Mechanism Goals-Footnote-11170999 +Node: Extension Other Design Decisions1171188 +Node: Extension Future Growth1173296 +Node: Old Extension Mechanism1174132 +Node: Notes summary1175894 +Node: Basic Concepts1177080 +Node: Basic High Level1177761 +Ref: figure-general-flow1178033 +Ref: figure-process-flow1178632 +Ref: Basic High Level-Footnote-11181861 +Node: Basic Data Typing1182046 +Node: Glossary1185374 +Node: Copying1217303 +Node: GNU Free Documentation License1254859 +Node: Index1279995  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 76d0c546..1ca68804 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -35206,81 +35206,81 @@ cross-references to further details: @itemize @value{BULLET} @item The requirement for @samp{;} to separate rules on a line -(@pxref{Statements/Lines}). +(@pxref{Statements/Lines}) @item User-defined functions and the @code{return} statement -(@pxref{User-defined}). +(@pxref{User-defined}) @item The @code{delete} statement (@pxref{Delete}). @item The @code{do}-@code{while} statement -(@pxref{Do Statement}). +(@pxref{Do Statement}) @item The built-in functions @code{atan2()}, @code{cos()}, @code{sin()}, @code{rand()}, and -@code{srand()} (@pxref{Numeric Functions}). +@code{srand()} (@pxref{Numeric Functions}) @item The built-in functions @code{gsub()}, @code{sub()}, and @code{match()} -(@pxref{String Functions}). +(@pxref{String Functions}) @item The built-in functions @code{close()} and @code{system()} -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @item The @code{ARGC}, @code{ARGV}, @code{FNR}, @code{RLENGTH}, @code{RSTART}, -and @code{SUBSEP} predefined variables (@pxref{Built-in Variables}). +and @code{SUBSEP} predefined variables (@pxref{Built-in Variables}) @item -Assignable @code{$0} (@pxref{Changing Fields}). +Assignable @code{$0} (@pxref{Changing Fields}) @item The conditional expression using the ternary operator @samp{?:} -(@pxref{Conditional Exp}). +(@pxref{Conditional Exp}) @item -The expression @samp{@var{index-variable} in @var{array}} outside of @code{for} -statements (@pxref{Reference to Elements}). +The expression @samp{@var{indx} in @var{array}} outside of @code{for} +statements (@pxref{Reference to Elements}) @item The exponentiation operator @samp{^} (@pxref{Arithmetic Ops}) and its assignment operator -form @samp{^=} (@pxref{Assignment Ops}). +form @samp{^=} (@pxref{Assignment Ops}) @item C-compatible operator precedence, which breaks some old @command{awk} -programs (@pxref{Precedence}). +programs (@pxref{Precedence}) @item Regexps as the value of @code{FS} (@pxref{Field Separators}) and as the third argument to the @code{split()} function (@pxref{String Functions}), rather than using only the first character -of @code{FS}. +of @code{FS} @item Dynamic regexps as operands of the @samp{~} and @samp{!~} operators -(@pxref{Computed Regexps}). +(@pxref{Computed Regexps}) @item The escape sequences @samp{\b}, @samp{\f}, and @samp{\r} -(@pxref{Escape Sequences}). +(@pxref{Escape Sequences}) @item Redirection of input for the @code{getline} function -(@pxref{Getline}). +(@pxref{Getline}) @item Multiple @code{BEGIN} and @code{END} rules -(@pxref{BEGIN/END}). +(@pxref{BEGIN/END}) @item Multidimensional arrays -(@pxref{Multidimensional}). +(@pxref{Multidimensional}) @end itemize @node SVR4 @@ -35292,54 +35292,54 @@ The System V Release 4 (1989) version of Unix @command{awk} added these features @itemize @value{BULLET} @item -The @code{ENVIRON} array (@pxref{Built-in Variables}). +The @code{ENVIRON} array (@pxref{Built-in Variables}) @c gawk and MKS awk @item Multiple @option{-f} options on the command line -(@pxref{Options}). +(@pxref{Options}) @c MKS awk @item The @option{-v} option for assigning variables before program execution begins -(@pxref{Options}). +(@pxref{Options}) @c GNU, Bell Laboratories & MKS together @item -The @option{--} signal for terminating command-line options. +The @option{--} signal for terminating command-line options @item The @samp{\a}, @samp{\v}, and @samp{\x} escape sequences -(@pxref{Escape Sequences}). +(@pxref{Escape Sequences}) @c GNU, for ANSI C compat @item A defined return value for the @code{srand()} built-in function -(@pxref{Numeric Functions}). +(@pxref{Numeric Functions}) @item The @code{toupper()} and @code{tolower()} built-in string functions for case translation -(@pxref{String Functions}). +(@pxref{String Functions}) @item A cleaner specification for the @samp{%c} format-control letter in the @code{printf} function -(@pxref{Control Letters}). +(@pxref{Control Letters}) @item The ability to dynamically pass the field width and precision (@code{"%*.*d"}) in the argument list of @code{printf} and @code{sprintf()} -(@pxref{Control Letters}). +(@pxref{Control Letters}) @item The use of regexp constants, such as @code{/foo/}, as expressions, where they are equivalent to using the matching operator, as in @samp{$0 ~ /foo/} -(@pxref{Using Constant Regexps}). +(@pxref{Using Constant Regexps}) @item Processing of escape sequences inside command-line variable assignments -(@pxref{Assignment Options}). +(@pxref{Assignment Options}) @end itemize @node POSIX @@ -35353,23 +35353,23 @@ introduced the following changes into the language: @itemize @value{BULLET} @item The use of @option{-W} for implementation-specific options -(@pxref{Options}). +(@pxref{Options}) @item The use of @code{CONVFMT} for controlling the conversion of numbers -to strings (@pxref{Conversion}). +to strings (@pxref{Conversion}) @item The concept of a numeric string and tighter comparison rules to go -with it (@pxref{Typing and Comparison}). +with it (@pxref{Typing and Comparison}) @item The use of predefined variables as function parameter names is forbidden -(@pxref{Definition Syntax}). +(@pxref{Definition Syntax}) @item More complete documentation of many of the previously undocumented -features of the language. +features of the language @end itemize In 2012, a number of extensions that had been commonly available for @@ -35378,15 +35378,15 @@ many years were finally added to POSIX. They are: @itemize @value{BULLET} @item The @code{fflush()} built-in function for flushing buffered output -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @item The @code{nextfile} statement -(@pxref{Nextfile Statement}). +(@pxref{Nextfile Statement}) @item The ability to delete all of an array at once with @samp{delete @var{array}} -(@pxref{Delete}). +(@pxref{Delete}) @end itemize @@ -35416,22 +35416,22 @@ originally appeared in his version of @command{awk}: The @samp{**} and @samp{**=} operators (@pxref{Arithmetic Ops} and -@ref{Assignment Ops}). +@ref{Assignment Ops}) @item The use of @code{func} as an abbreviation for @code{function} -(@pxref{Definition Syntax}). +(@pxref{Definition Syntax}) @item The @code{fflush()} built-in function for flushing buffered output -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @ignore @item The @code{SYMTAB} array, that allows access to @command{awk}'s internal symbol table. This feature was never documented for his @command{awk}, largely because it is somewhat shakily implemented. For instance, you cannot access arrays -or array elements through it. +or array elements through it @end ignore @end itemize @@ -35461,7 +35461,7 @@ Additional predefined variables: @itemize @value{MINUS} @item The -@code{ARGIND} +@code{ARGIND}, @code{BINMODE}, @code{ERRNO}, @code{FIELDWIDTHS}, @@ -35473,7 +35473,7 @@ The and @code{TEXTDOMAIN} variables -(@pxref{Built-in Variables}). +(@pxref{Built-in Variables}) @end itemize @item @@ -35481,15 +35481,15 @@ Special files in I/O redirections: @itemize @value{MINUS} @item -The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr} and +The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr}, and @file{/dev/fd/@var{N}} special @value{FN}s -(@pxref{Special Files}). +(@pxref{Special Files}) @item The @file{/inet}, @file{/inet4}, and @samp{/inet6} special files for TCP/IP networking using @samp{|&} to specify which version of the IP protocol to use -(@pxref{TCP/IP Networking}). +(@pxref{TCP/IP Networking}) @end itemize @item @@ -35498,37 +35498,37 @@ Changes and/or additions to the language: @itemize @value{MINUS} @item The @samp{\x} escape sequence -(@pxref{Escape Sequences}). +(@pxref{Escape Sequences}) @item Full support for both POSIX and GNU regexps -(@pxref{Regexp}). +(@pxref{Regexp}) @item The ability for @code{FS} and for the third argument to @code{split()} to be null strings -(@pxref{Single Character Fields}). +(@pxref{Single Character Fields}) @item The ability for @code{RS} to be a regexp -(@pxref{Records}). +(@pxref{Records}) @item The ability to use octal and hexadecimal constants in @command{awk} program source code -(@pxref{Nondecimal-numbers}). +(@pxref{Nondecimal-numbers}) @item The @samp{|&} operator for two-way I/O to a coprocess -(@pxref{Two-way I/O}). +(@pxref{Two-way I/O}) @item Indirect function calls -(@pxref{Indirect Calls}). +(@pxref{Indirect Calls}) @item Directories on the command line produce a warning and are skipped -(@pxref{Command-line directories}). +(@pxref{Command-line directories}) @end itemize @item @@ -35537,11 +35537,11 @@ New keywords: @itemize @value{MINUS} @item The @code{BEGINFILE} and @code{ENDFILE} special patterns -(@pxref{BEGINFILE/ENDFILE}). +(@pxref{BEGINFILE/ENDFILE}) @item The @code{switch} statement -(@pxref{Switch Statement}). +(@pxref{Switch Statement}) @end itemize @item @@ -35551,30 +35551,30 @@ Changes to standard @command{awk} functions: @item The optional second argument to @code{close()} that allows closing one end of a two-way pipe to a coprocess -(@pxref{Two-way I/O}). +(@pxref{Two-way I/O}) @item -POSIX compliance for @code{gsub()} and @code{sub()} with @option{--posix}. +POSIX compliance for @code{gsub()} and @code{sub()} with @option{--posix} @item The @code{length()} function accepts an array argument and returns the number of elements in the array -(@pxref{String Functions}). +(@pxref{String Functions}) @item The optional third argument to the @code{match()} function for capturing text-matching subexpressions within a regexp -(@pxref{String Functions}). +(@pxref{String Functions}) @item Positional specifiers in @code{printf} formats for making translations easier -(@pxref{Printf Ordering}). +(@pxref{Printf Ordering}) @item The @code{split()} function's additional optional fourth -argument which is an array to hold the text of the field separators -(@pxref{String Functions}). +argument, which is an array to hold the text of the field separators +(@pxref{String Functions}) @end itemize @item @@ -35584,16 +35584,16 @@ Additional functions only in @command{gawk}: @item The @code{gensub()}, @code{patsplit()}, and @code{strtonum()} functions for more powerful text manipulation -(@pxref{String Functions}). +(@pxref{String Functions}) @item The @code{asort()} and @code{asorti()} functions for sorting arrays -(@pxref{Array Sorting}). +(@pxref{Array Sorting}) @item The @code{mktime()}, @code{systime()}, and @code{strftime()} functions for working with timestamps -(@pxref{Time Functions}). +(@pxref{Time Functions}) @item The @@ -35605,17 +35605,17 @@ The and @code{xor()} functions for bit manipulation -(@pxref{Bitwise Functions}). +(@pxref{Bitwise Functions}) @c In 4.1, and(), or() and xor() grew the ability to take > 2 arguments @item The @code{isarray()} function to check if a variable is an array or not -(@pxref{Type Functions}). +(@pxref{Type Functions}) @item -The @code{bindtextdomain()}, @code{dcgettext()} and @code{dcngettext()} +The @code{bindtextdomain()}, @code{dcgettext()}, and @code{dcngettext()} functions for internationalization -(@pxref{Programmer i18n}). +(@pxref{Programmer i18n}) @end itemize @item @@ -35625,12 +35625,12 @@ Changes and/or additions in the command-line options: @item The @env{AWKPATH} environment variable for specifying a path search for the @option{-f} command-line option -(@pxref{Options}). +(@pxref{Options}) @item The @env{AWKLIBPATH} environment variable for specifying a path search for the @option{-l} command-line option -(@pxref{Options}). +(@pxref{Options}) @item The @@ -35659,7 +35659,7 @@ The and @option{-V} short options. Also, the -ability to use GNU-style long-named options that start with @option{--} +ability to use GNU-style long-named options that start with @option{--}, and the @option{--assign}, @option{--bignum}, @@ -35739,7 +35739,7 @@ GCC for VAX and Alpha has not been tested for a while. @end itemize @item -Support for the following obsolete systems was removed from the code +Support for the following obsolete system was removed from the code for @command{gawk} @value{PVERSION} 4.1: @c nested table @@ -36375,9 +36375,9 @@ by @command{gawk}, Brian Kernighan's @command{awk}, and @command{mawk}, the three most widely used freely available versions of @command{awk} (@pxref{Other Versions}). -@multitable {@file{/dev/stderr} special file} {BWK Awk} {Mawk} {GNU Awk} {Now standard} -@headitem Feature @tab BWK Awk @tab Mawk @tab GNU Awk @tab Now standard -@item @samp{\x} Escape sequence @tab X @tab X @tab X @tab +@multitable {@file{/dev/stderr} special file} {BWK @command{awk}} {@command{mawk}} {@command{gawk}} {Now standard} +@headitem Feature @tab BWK @command{awk} @tab @command{mawk} @tab @command{gawk} @tab Now standard +@item @samp{\x} escape sequence @tab X @tab X @tab X @tab @item @code{FS} as null string @tab X @tab X @tab X @tab @item @file{/dev/stdin} special file @tab X @tab X @tab X @tab @item @file{/dev/stdout} special file @tab X @tab X @tab X @tab @@ -36408,7 +36408,7 @@ in the machine's native character set. Thus, on ASCII-based systems, @samp{[a-z]} matched all the lowercase letters, and only the lowercase letters, as the numeric values for the letters from @samp{a} through @samp{z} were contiguous. (On an EBCDIC system, the range @samp{[a-z]} -includes additional, non-alphabetic characters as well.) +includes additional nonalphabetic characters as well.) Almost all introductory Unix literature explained range expressions as working in this fashion, and in particular, would teach that the @@ -36433,7 +36433,7 @@ What does that mean? In many locales, @samp{A} and @samp{a} are both less than @samp{B}. In other words, these locales sort characters in dictionary order, and @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]}; -instead it might be equivalent to @samp{[ABCXYabcdxyz]}, for example. +instead, it might be equivalent to @samp{[ABCXYabcdxyz]}, for example. This point needs to be emphasized: much literature teaches that you should use @samp{[a-z]} to match a lowercase character. But on systems with @@ -36462,23 +36462,23 @@ is perfectly valid in ASCII, but is not valid in many Unicode locales, such as @code{en_US.UTF-8}. Early versions of @command{gawk} used regexp matching code that was not -locale aware, so ranges had their traditional interpretation. +locale-aware, so ranges had their traditional interpretation. When @command{gawk} switched to using locale-aware regexp matchers, the problems began; especially as both GNU/Linux and commercial Unix vendors started implementing non-ASCII locales, @emph{and making them the default}. Perhaps the most frequently asked question became something -like ``why does @samp{[A-Z]} match lowercase letters?!?'' +like, ``Why does @samp{[A-Z]} match lowercase letters?!?'' @cindex Berry, Karl This situation existed for close to 10 years, if not more, and the @command{gawk} maintainer grew weary of trying to explain that -@command{gawk} was being nicely standards compliant, and that the issue +@command{gawk} was being nicely standards-compliant, and that the issue was in the user's locale. During the development of @value{PVERSION} 4.0, he modified @command{gawk} to always treat ranges in the original, pre-POSIX fashion, unless @option{--posix} was used (@pxref{Options}).@footnote{And thus was born the Campaign for Rational Range Interpretation (or -RRI). A number of GNU tools have either implemented this change, +RRI). A number of GNU tools have already implemented this change, or will soon. Thanks to Karl Berry for coining the phrase ``Rational Range Interpretation.''} @@ -36492,9 +36492,10 @@ and By using this lovely technical term, the standard gives license to implementors to implement ranges in whatever way they choose. -The @command{gawk} maintainer chose to apply the pre-POSIX meaning in all -cases: the default regexp matching; with @option{--traditional} and with -@option{--posix}; in all cases, @command{gawk} remains POSIX compliant. +The @command{gawk} maintainer chose to apply the pre-POSIX meaning +both with the default regexp matching and when @option{--traditional} or +@option{--posix} are used. +In all cases @command{gawk} remains POSIX-compliant. @node Contributors @appendixsec Major Contributors to @command{gawk} @@ -36540,7 +36541,7 @@ to around 90 pages. Richard Stallman helped finish the implementation and the initial draft of this @value{DOCUMENT}. -He is also the founder of the FSF and the GNU project. +He is also the founder of the FSF and the GNU Project. @item @cindex Woods, John @@ -36704,28 +36705,28 @@ John Haque made the following contributions: @itemize @value{MINUS} @item The modifications to convert @command{gawk} -into a byte-code interpreter, including the debugger. +into a byte-code interpreter, including the debugger @item -The addition of true arrays of arrays. +The addition of true arrays of arrays @item -The additional modifications for support of arbitrary-precision arithmetic. +The additional modifications for support of arbitrary-precision arithmetic @item The initial text of -@ref{Arbitrary Precision Arithmetic}. +@ref{Arbitrary Precision Arithmetic} @item The work to merge the three versions of @command{gawk} -into one, for the 4.1 release. +into one, for the 4.1 release @item -Improved array internals for arrays indexed by integers. +Improved array internals for arrays indexed by integers @item -The improved array sorting features were driven by John together -with Pat Rankin. +The improved array sorting features were also driven by John, together +with Pat Rankin @end itemize @cindex Papadopoulos, Panos @@ -36766,10 +36767,10 @@ helping David Trueman, and as the primary maintainer since around 1994. @itemize @value{BULLET} @item The @command{awk} language has evolved over time. The first release -was with V7 Unix circa 1978. In 1987, for System V Release 3.1, +was with V7 Unix, circa 1978. In 1987, for System V Release 3.1, major additions, including user-defined functions, were made to the language. Additional changes were made for System V Release 4, in 1989. -Since then, further minor changes happen under the auspices of the +Since then, further minor changes have happened under the auspices of the POSIX standard. @item @@ -36785,7 +36786,7 @@ options. The interaction of POSIX locales and regexp matching in @command{gawk} has been confusing over the years. Today, @command{gawk} implements Rational Range Interpretation, where ranges of the form @samp{[a-z]} match @emph{only} the characters numerically between -@samp{a} through @samp{z} in the machine's native character set. Usually this is ASCII +@samp{a} through @samp{z} in the machine's native character set. Usually this is ASCII, but it can be EBCDIC on IBM S/390 systems. @item @@ -36870,7 +36871,7 @@ will be less busy, and you can usually find one closer to your site. @command{gawk} is distributed as several @code{tar} files compressed with different compression programs: @command{gzip}, @command{bzip2}, and @command{xz}. For simplicity, the rest of these instructions assume -you are using the one compressed with the GNU Zip program, @code{gzip}. +you are using the one compressed with the GNU Gzip program (@command{gzip}). Once you have the distribution (e.g., @file{gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz}), @@ -36921,12 +36922,12 @@ operating systems: @table @asis @item Various @samp{.c}, @samp{.y}, and @samp{.h} files -The actual @command{gawk} source code. +These files contain the actual @command{gawk} source code. @end table @table @file @item ABOUT-NLS -Information about GNU @command{gettext} and translations. +A file containing information about GNU @command{gettext} and translations. @item AUTHORS A file with some information about the authorship of @command{gawk}. @@ -36956,7 +36957,7 @@ An older list of changes to @command{gawk}. The GNU General Public License. @item POSIX.STD -A description of behaviors in the POSIX standard for @command{awk} which +A description of behaviors in the POSIX standard for @command{awk} that are left undefined, or where @command{gawk} may not comply fully, as well as a list of things that the POSIX standard should describe but does not. @@ -37221,14 +37222,17 @@ Similarly, setting the @code{LINT} variable (@pxref{User-modified}) has no effect on the running @command{awk} program. -When used with GCC's automatic dead-code-elimination, this option +When used with the GNU Compiler Collection's (GCC's) +automatic dead-code-elimination, this option cuts almost 23K bytes off the size of the @command{gawk} executable on GNU/Linux x86_64 systems. Results on other systems and with other compilers are likely to vary. Using this option may bring you some slight performance improvement. +@quotation CAUTION Using this option will cause some of the tests in the test suite to fail. This option may be removed at a later date. +@end quotation @cindex @option{--disable-nls} configuration option @cindex configuration option, @code{--disable-nls} @@ -37325,10 +37329,10 @@ running MS-DOS, any version of MS-Windows, or OS/2. running MS-DOS and any version of MS-Windows. @end ifset In this @value{SECTION}, the term ``Windows32'' -refers to any of Microsoft Windows-95/98/ME/NT/2000/XP/Vista/7/8. +refers to any of Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8. The limitations of MS-DOS (and MS-DOS shells under the other operating -systems) has meant that various ``DOS extenders'' are often used with +systems) have meant that various ``DOS extenders'' are often used with programs such as @command{gawk}. The varying capabilities of Microsoft Windows 3.1 and Windows32 can add to the confusion. For an overview of the considerations, refer to @file{README_d/README.pc} in @@ -37587,7 +37591,7 @@ Under MS-Windows, OS/2 and MS-DOS, Under MS-Windows and MS-DOS, @end ifset @command{gawk} (and many other text programs) silently -translate end-of-line @samp{\r\n} to @samp{\n} on input and @samp{\n} +translates end-of-line @samp{\r\n} to @samp{\n} on input and @samp{\n} to @samp{\r\n} on output. A special @code{BINMODE} variable @value{COMMONEXT} allows control over these translations and is interpreted as follows: @@ -37621,7 +37625,7 @@ Setting @code{BINMODE} for standard input or standard output is accomplished by using an appropriate @samp{-v BINMODE=@var{N}} option on the command line. @code{BINMODE} is set at the time a file or pipe is opened and cannot be -changed mid-stream. +changed midstream. The name @code{BINMODE} was chosen to match @command{mawk} (@pxref{Other Versions}). @@ -37677,8 +37681,8 @@ moved into the @code{BEGIN} rule. @command{gawk} can be built and used ``out of the box'' under MS-Windows if you are using the @uref{http://www.cygwin.com, Cygwin environment}. -This environment provides an excellent simulation of GNU/Linux, using the -GNU tools, such as Bash, the GNU Compiler Collection (GCC), GNU Make, +This environment provides an excellent simulation of GNU/Linux, using +Bash, GCC, GNU Make, and other GNU programs. Compilation and installation for Cygwin is the same as for a Unix system: @@ -37697,7 +37701,7 @@ and then the @samp{make} proceeds as usual. @appendixsubsubsec Using @command{gawk} In The MSYS Environment In the MSYS environment under MS-Windows, @command{gawk} automatically -uses binary mode for reading and writing files. Thus there is no +uses binary mode for reading and writing files. Thus, there is no need to use the @code{BINMODE} variable. This can cause problems with other Unix-like components that have @@ -37761,7 +37765,7 @@ With ODS-5 volumes and extended parsing enabled, the case of the target parameter may need to be exact. @command{gawk} has been tested under VAX/VMS 7.3 and Alpha/VMS 7.3-1 -using Compaq C V6.4, and Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS 8.3. +using Compaq C V6.4, and under Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS 8.3. The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha and IA64 VMS 8.4 used HP C 7.3.@footnote{The IA64 architecture is also known as ``Itanium.''} @@ -37809,7 +37813,7 @@ For VAX: /name=(as_is,short) @end example -Compile time macros need to be defined before the first VMS-supplied +Compile-time macros need to be defined before the first VMS-supplied header file is included, as follows: @example @@ -37856,7 +37860,7 @@ If your @command{gawk} was installed by a PCSI kit into the @file{GNV$GNU:[vms_help]gawk.hlp}. The PCSI kit also installs a @file{GNV$GNU:[vms_bin]gawk_verb.cld} file -which can be used to add @command{gawk} and @command{awk} as DCL commands. +that can be used to add @command{gawk} and @command{awk} as DCL commands. For just the current process you can use: @@ -37865,7 +37869,7 @@ $ @kbd{set command gnv$gnu:[vms_bin]gawk_verb.cld} @end example Or the system manager can use @file{GNV$GNU:[vms_bin]gawk_verb.cld} to -add the @command{gawk} and @command{awk} to the system wide @samp{DCLTABLES}. +add the @command{gawk} and @command{awk} to the system-wide @samp{DCLTABLES}. The DCL syntax is documented in the @file{gawk.hlp} file. @@ -37931,14 +37935,14 @@ The @code{exit} value is a Unix-style value and is encoded into a VMS exit status value when the program exits. The VMS severity bits will be set based on the @code{exit} value. -A failure is indicated by 1 and VMS sets the @code{ERROR} status. -A fatal error is indicated by 2 and VMS sets the @code{FATAL} status. +A failure is indicated by 1, and VMS sets the @code{ERROR} status. +A fatal error is indicated by 2, and VMS sets the @code{FATAL} status. All other values will have the @code{SUCCESS} status. The exit value is encoded to comply with VMS coding standards and will have the @code{C_FACILITY_NO} of @code{0x350000} with the constant @code{0xA000} added to the number shifted over by 3 bits to make room for the severity codes. -To extract the actual @command{gawk} exit code from the VMS status use: +To extract the actual @command{gawk} exit code from the VMS status, use: @example unix_status = (vms_status .and. &x7f8) / 8 @@ -37957,7 +37961,7 @@ VAX/VMS floating point uses unbiased rounding. @xref{Round Function}. VMS reports time values in GMT unless one of the @code{SYS$TIMEZONE_RULE} or @code{TZ} logical names is set. Older versions of VMS, such as VAX/VMS -7.3 do not set these logical names. +7.3, do not set these logical names. @c @cindex directory search @c @cindex path, search @@ -37975,7 +37979,7 @@ translation and not a multitranslation @code{RMS} searchlist. The VMS GNV package provides a build environment similar to POSIX with ports of a collection of open source tools. The @command{gawk} found in the GNV -base kit is an older port. Currently the GNV project is being reorganized +base kit is an older port. Currently, the GNV project is being reorganized to supply individual PCSI packages for each component. See @w{@uref{https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/}.} @@ -38048,7 +38052,7 @@ recommend compiling and using the current version. @cindex debugging @command{gawk}, bug reports @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 +report it to the developers; we cannot promise to do anything, but we might well want to fix it. Before reporting a bug, make sure you have really found a genuine bug. @@ -38058,7 +38062,7 @@ to do something or not, report that too; it's a bug in the documentation! Before reporting a bug or trying to fix it yourself, try to isolate it to the smallest possible @command{awk} program and input @value{DF} that -reproduces the problem. Then send us the program and @value{DF}, +reproduce the problem. Then send us the program and @value{DF}, some idea of what kind of Unix system you're using, the compiler you used to compile @command{gawk}, and the exact results @command{gawk} gave you. Also say what you expected to occur; this helps @@ -38073,7 +38077,7 @@ You can get this information with the command @samp{gawk --version}. Once you have a precise problem description, send email to @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org}. -The @command{gawk} maintainers subscribe to this address and +The @command{gawk} maintainers subscribe to this address, and thus they will receive your bug report. Although you can send mail to the maintainers directly, the bug reporting address is preferred because the @@ -38100,8 +38104,8 @@ bug reporting system, you should also send a copy to This is for two reasons. First, although some distributions forward bug reports ``upstream'' to the GNU mailing list, many don't, so there is a good chance that the @command{gawk} maintainers won't even see the bug report! Second, -mail to the GNU list is archived, and having everything at the GNU project -keeps things self-contained and not dependant on other organizations. +mail to the GNU list is archived, and having everything at the GNU Project +keeps things self-contained and not dependent on other organizations. @end quotation Non-bug suggestions are always welcome as well. If you have questions @@ -38110,7 +38114,7 @@ features, ask on the bug list; we will try to help you out if we can. If you find bugs in one of the non-Unix ports of @command{gawk}, send an email to the bug list, with a copy to the -person who maintains that port. They are named in the following list, +person who maintains that port. The maintainers are named in the following list, as well as in the @file{README} file in the @command{gawk} distribution. Information in the @file{README} file should be considered authoritative if it conflicts with this @value{DOCUMENT}. @@ -38125,19 +38129,19 @@ The people maintaining the various @command{gawk} ports are: @cindex Robbins, Arnold @cindex Zaretskii, Eli @multitable {MS-Windows with MinGW} {123456789012345678901234567890123456789001234567890} -@item Unix and POSIX systems @tab Arnold Robbins, @EMAIL{arnold@@skeeve.com,arnold at skeeve dot com}. +@item Unix and POSIX systems @tab Arnold Robbins, @EMAIL{arnold@@skeeve.com,arnold at skeeve dot com} -@item MS-DOS with DJGPP @tab Scott Deifik, @EMAIL{scottd.mail@@sbcglobal.net,scottd dot mail at sbcglobal dot net}. +@item MS-DOS with DJGPP @tab Scott Deifik, @EMAIL{scottd.mail@@sbcglobal.net,scottd dot mail at sbcglobal dot net} -@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org}. +@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org} @c Leave this in the print version on purpose. @c OS/2 is not mentioned anywhere else in the print version though. -@item OS/2 @tab Andreas Buening, @EMAIL{andreas.buening@@nexgo.de,andreas dot buening at nexgo dot de}. +@item OS/2 @tab Andreas Buening, @EMAIL{andreas.buening@@nexgo.de,andreas dot buening at nexgo dot de} -@item VMS @tab John Malmberg, @EMAIL{wb8tyw@@qsl.net,wb8tyw at qsl.net}. +@item VMS @tab John Malmberg, @EMAIL{wb8tyw@@qsl.net,wb8tyw at qsl.net} -@item z/OS (OS/390) @tab Dave Pitts, @EMAIL{dpitts@@cozx.com,dpitts at cozx dot com}. +@item z/OS (OS/390) @tab Dave Pitts, @EMAIL{dpitts@@cozx.com,dpitts at cozx dot com} @end multitable If your bug is also reproducible under Unix, send a copy of your @@ -38156,7 +38160,7 @@ Date: Wed, 4 Sep 1996 08:11:48 -0700 (PDT) @cindex Brennan, Michael @ifnotdocbook @quotation -@i{It's kind of fun to put comments like this in your awk code.}@* +@i{It's kind of fun to put comments like this in your awk code:}@* @ @ @ @ @ @ @code{// Do C++ comments work? answer: yes! of course} @author Michael Brennan @end quotation @@ -38197,7 +38201,7 @@ It is available in several archive formats: @end table @cindex @command{git} utility -You can also retrieve it from Git Hub: +You can also retrieve it from GitHub: @example git clone git://github.com/onetrueawk/awk bwkawk @@ -38257,7 +38261,7 @@ for a list of extensions in @command{mawk} that are not in POSIX @command{awk}. @item @command{awka} Written by Andrew Sumner, @command{awka} translates @command{awk} programs into C, compiles them, -and links them with a library of functions that provides the core +and links them with a library of functions that provide the core @command{awk} functionality. It also has a number of extensions. @@ -38278,17 +38282,17 @@ since approximately 2001. Nelson H.F.@: Beebe at the University of Utah has modified BWK @command{awk} to provide timing and profiling information. It is different from @command{gawk} with the @option{--profile} option -(@pxref{Profiling}), +(@pxref{Profiling}) in that it uses CPU-based profiling, not line-count profiling. You may find it at either @uref{ftp://ftp.math.utah.edu/pub/pawk/pawk-20030606.tar.gz} or @uref{http://www.math.utah.edu/pub/pawk/pawk-20030606.tar.gz}. -@item Busybox Awk -@cindex Busybox Awk -@cindex source code, Busybox Awk -Busybox is a GPL-licensed program providing small versions of many +@item BusyBox @command{awk} +@cindex BusyBox Awk +@cindex source code, BusyBox Awk +BusyBox is a GPL-licensed program providing small versions of many applications within a single executable. It is aimed at embedded systems. It includes a full implementation of POSIX @command{awk}. When building it, be careful not to do @samp{make install} as it will overwrite @@ -38300,7 +38304,7 @@ information, see the @uref{http://busybox.net, project's home page}. @cindex source code, Solaris @command{awk} @item The OpenSolaris POSIX @command{awk} The versions of @command{awk} in @file{/usr/xpg4/bin} and -@file{/usr/xpg6/bin} on Solaris are more-or-less POSIX-compliant. +@file{/usr/xpg6/bin} on Solaris are more or less POSIX-compliant. They are based on the @command{awk} from Mortice Kern Systems for PCs. We were able to make this code compile and work under GNU/Linux with 1--2 hours of work. Making it more generally portable (using @@ -38341,9 +38345,9 @@ features to Python. See @uref{https://github.com/alecthomas/pawk} for more information. (This is not related to Nelson Beebe's modified version of BWK @command{awk}, described earlier.) -@item @w{QSE Awk} -@cindex QSE Awk -@cindex source code, QSE Awk +@item @w{QSE @command{awk}} +@cindex QSE @command{awk} +@cindex source code, QSE @command{awk} This is an embeddable @command{awk} interpreter. For more information, see @uref{http://code.google.com/p/qse/} and @uref{http://awk.info/?tools/qse}. @@ -38362,7 +38366,7 @@ since approximately 2008. @item Other versions See also the ``Versions and implementations'' section of the @uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, -Wikipedia article} for information on additional versions. +Wikipedia article} on @command{awk} for information on additional versions. @end table @@ -38371,7 +38375,7 @@ Wikipedia article} for information on additional versions. @itemize @value{BULLET} @item -The @command{gawk} distribution is available from GNU project's main +The @command{gawk} distribution is available from the GNU Project's main distribution site, @code{ftp.gnu.org}. The canonical build recipe is: @example @@ -38383,22 +38387,22 @@ cd gawk-@value{VERSION}.@value{PATCHLEVEL} @item @command{gawk} may be built on non-POSIX systems as well. The currently -supported systems are MS-Windows using DJGPP, MSYS, MinGW and Cygwin, +supported systems are MS-Windows using DJGPP, MSYS, MinGW, and Cygwin, @ifclear FOR_PRINT OS/2 using EMX, @end ifclear and both Vax/VMS and OpenVMS. -Instructions for each system are included in this @value{CHAPTER}. +Instructions for each system are included in this @value{APPENDIX}. @item Bug reports should be sent via email to @email{bug-gawk@@gnu.org}. -Bug reports should be in English, and should include the version of @command{gawk}, -how it was compiled, and a short program and @value{DF} which demonstrate +Bug reports should be in English and should include the version of @command{gawk}, +how it was compiled, and a short program and @value{DF} that demonstrate the problem. @item There are a number of other freely available @command{awk} -implementations. Many are POSIX compliant; others are less so. +implementations. Many are POSIX-compliant; others are less so. @end itemize diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 16847eb2..724a559a 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -34297,81 +34297,81 @@ cross-references to further details: @itemize @value{BULLET} @item The requirement for @samp{;} to separate rules on a line -(@pxref{Statements/Lines}). +(@pxref{Statements/Lines}) @item User-defined functions and the @code{return} statement -(@pxref{User-defined}). +(@pxref{User-defined}) @item The @code{delete} statement (@pxref{Delete}). @item The @code{do}-@code{while} statement -(@pxref{Do Statement}). +(@pxref{Do Statement}) @item The built-in functions @code{atan2()}, @code{cos()}, @code{sin()}, @code{rand()}, and -@code{srand()} (@pxref{Numeric Functions}). +@code{srand()} (@pxref{Numeric Functions}) @item The built-in functions @code{gsub()}, @code{sub()}, and @code{match()} -(@pxref{String Functions}). +(@pxref{String Functions}) @item The built-in functions @code{close()} and @code{system()} -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @item The @code{ARGC}, @code{ARGV}, @code{FNR}, @code{RLENGTH}, @code{RSTART}, -and @code{SUBSEP} predefined variables (@pxref{Built-in Variables}). +and @code{SUBSEP} predefined variables (@pxref{Built-in Variables}) @item -Assignable @code{$0} (@pxref{Changing Fields}). +Assignable @code{$0} (@pxref{Changing Fields}) @item The conditional expression using the ternary operator @samp{?:} -(@pxref{Conditional Exp}). +(@pxref{Conditional Exp}) @item -The expression @samp{@var{index-variable} in @var{array}} outside of @code{for} -statements (@pxref{Reference to Elements}). +The expression @samp{@var{indx} in @var{array}} outside of @code{for} +statements (@pxref{Reference to Elements}) @item The exponentiation operator @samp{^} (@pxref{Arithmetic Ops}) and its assignment operator -form @samp{^=} (@pxref{Assignment Ops}). +form @samp{^=} (@pxref{Assignment Ops}) @item C-compatible operator precedence, which breaks some old @command{awk} -programs (@pxref{Precedence}). +programs (@pxref{Precedence}) @item Regexps as the value of @code{FS} (@pxref{Field Separators}) and as the third argument to the @code{split()} function (@pxref{String Functions}), rather than using only the first character -of @code{FS}. +of @code{FS} @item Dynamic regexps as operands of the @samp{~} and @samp{!~} operators -(@pxref{Computed Regexps}). +(@pxref{Computed Regexps}) @item The escape sequences @samp{\b}, @samp{\f}, and @samp{\r} -(@pxref{Escape Sequences}). +(@pxref{Escape Sequences}) @item Redirection of input for the @code{getline} function -(@pxref{Getline}). +(@pxref{Getline}) @item Multiple @code{BEGIN} and @code{END} rules -(@pxref{BEGIN/END}). +(@pxref{BEGIN/END}) @item Multidimensional arrays -(@pxref{Multidimensional}). +(@pxref{Multidimensional}) @end itemize @node SVR4 @@ -34383,54 +34383,54 @@ The System V Release 4 (1989) version of Unix @command{awk} added these features @itemize @value{BULLET} @item -The @code{ENVIRON} array (@pxref{Built-in Variables}). +The @code{ENVIRON} array (@pxref{Built-in Variables}) @c gawk and MKS awk @item Multiple @option{-f} options on the command line -(@pxref{Options}). +(@pxref{Options}) @c MKS awk @item The @option{-v} option for assigning variables before program execution begins -(@pxref{Options}). +(@pxref{Options}) @c GNU, Bell Laboratories & MKS together @item -The @option{--} signal for terminating command-line options. +The @option{--} signal for terminating command-line options @item The @samp{\a}, @samp{\v}, and @samp{\x} escape sequences -(@pxref{Escape Sequences}). +(@pxref{Escape Sequences}) @c GNU, for ANSI C compat @item A defined return value for the @code{srand()} built-in function -(@pxref{Numeric Functions}). +(@pxref{Numeric Functions}) @item The @code{toupper()} and @code{tolower()} built-in string functions for case translation -(@pxref{String Functions}). +(@pxref{String Functions}) @item A cleaner specification for the @samp{%c} format-control letter in the @code{printf} function -(@pxref{Control Letters}). +(@pxref{Control Letters}) @item The ability to dynamically pass the field width and precision (@code{"%*.*d"}) in the argument list of @code{printf} and @code{sprintf()} -(@pxref{Control Letters}). +(@pxref{Control Letters}) @item The use of regexp constants, such as @code{/foo/}, as expressions, where they are equivalent to using the matching operator, as in @samp{$0 ~ /foo/} -(@pxref{Using Constant Regexps}). +(@pxref{Using Constant Regexps}) @item Processing of escape sequences inside command-line variable assignments -(@pxref{Assignment Options}). +(@pxref{Assignment Options}) @end itemize @node POSIX @@ -34444,23 +34444,23 @@ introduced the following changes into the language: @itemize @value{BULLET} @item The use of @option{-W} for implementation-specific options -(@pxref{Options}). +(@pxref{Options}) @item The use of @code{CONVFMT} for controlling the conversion of numbers -to strings (@pxref{Conversion}). +to strings (@pxref{Conversion}) @item The concept of a numeric string and tighter comparison rules to go -with it (@pxref{Typing and Comparison}). +with it (@pxref{Typing and Comparison}) @item The use of predefined variables as function parameter names is forbidden -(@pxref{Definition Syntax}). +(@pxref{Definition Syntax}) @item More complete documentation of many of the previously undocumented -features of the language. +features of the language @end itemize In 2012, a number of extensions that had been commonly available for @@ -34469,15 +34469,15 @@ many years were finally added to POSIX. They are: @itemize @value{BULLET} @item The @code{fflush()} built-in function for flushing buffered output -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @item The @code{nextfile} statement -(@pxref{Nextfile Statement}). +(@pxref{Nextfile Statement}) @item The ability to delete all of an array at once with @samp{delete @var{array}} -(@pxref{Delete}). +(@pxref{Delete}) @end itemize @@ -34507,22 +34507,22 @@ originally appeared in his version of @command{awk}: The @samp{**} and @samp{**=} operators (@pxref{Arithmetic Ops} and -@ref{Assignment Ops}). +@ref{Assignment Ops}) @item The use of @code{func} as an abbreviation for @code{function} -(@pxref{Definition Syntax}). +(@pxref{Definition Syntax}) @item The @code{fflush()} built-in function for flushing buffered output -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @ignore @item The @code{SYMTAB} array, that allows access to @command{awk}'s internal symbol table. This feature was never documented for his @command{awk}, largely because it is somewhat shakily implemented. For instance, you cannot access arrays -or array elements through it. +or array elements through it @end ignore @end itemize @@ -34552,7 +34552,7 @@ Additional predefined variables: @itemize @value{MINUS} @item The -@code{ARGIND} +@code{ARGIND}, @code{BINMODE}, @code{ERRNO}, @code{FIELDWIDTHS}, @@ -34564,7 +34564,7 @@ The and @code{TEXTDOMAIN} variables -(@pxref{Built-in Variables}). +(@pxref{Built-in Variables}) @end itemize @item @@ -34572,15 +34572,15 @@ Special files in I/O redirections: @itemize @value{MINUS} @item -The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr} and +The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr}, and @file{/dev/fd/@var{N}} special @value{FN}s -(@pxref{Special Files}). +(@pxref{Special Files}) @item The @file{/inet}, @file{/inet4}, and @samp{/inet6} special files for TCP/IP networking using @samp{|&} to specify which version of the IP protocol to use -(@pxref{TCP/IP Networking}). +(@pxref{TCP/IP Networking}) @end itemize @item @@ -34589,37 +34589,37 @@ Changes and/or additions to the language: @itemize @value{MINUS} @item The @samp{\x} escape sequence -(@pxref{Escape Sequences}). +(@pxref{Escape Sequences}) @item Full support for both POSIX and GNU regexps -(@pxref{Regexp}). +(@pxref{Regexp}) @item The ability for @code{FS} and for the third argument to @code{split()} to be null strings -(@pxref{Single Character Fields}). +(@pxref{Single Character Fields}) @item The ability for @code{RS} to be a regexp -(@pxref{Records}). +(@pxref{Records}) @item The ability to use octal and hexadecimal constants in @command{awk} program source code -(@pxref{Nondecimal-numbers}). +(@pxref{Nondecimal-numbers}) @item The @samp{|&} operator for two-way I/O to a coprocess -(@pxref{Two-way I/O}). +(@pxref{Two-way I/O}) @item Indirect function calls -(@pxref{Indirect Calls}). +(@pxref{Indirect Calls}) @item Directories on the command line produce a warning and are skipped -(@pxref{Command-line directories}). +(@pxref{Command-line directories}) @end itemize @item @@ -34628,11 +34628,11 @@ New keywords: @itemize @value{MINUS} @item The @code{BEGINFILE} and @code{ENDFILE} special patterns -(@pxref{BEGINFILE/ENDFILE}). +(@pxref{BEGINFILE/ENDFILE}) @item The @code{switch} statement -(@pxref{Switch Statement}). +(@pxref{Switch Statement}) @end itemize @item @@ -34642,30 +34642,30 @@ Changes to standard @command{awk} functions: @item The optional second argument to @code{close()} that allows closing one end of a two-way pipe to a coprocess -(@pxref{Two-way I/O}). +(@pxref{Two-way I/O}) @item -POSIX compliance for @code{gsub()} and @code{sub()} with @option{--posix}. +POSIX compliance for @code{gsub()} and @code{sub()} with @option{--posix} @item The @code{length()} function accepts an array argument and returns the number of elements in the array -(@pxref{String Functions}). +(@pxref{String Functions}) @item The optional third argument to the @code{match()} function for capturing text-matching subexpressions within a regexp -(@pxref{String Functions}). +(@pxref{String Functions}) @item Positional specifiers in @code{printf} formats for making translations easier -(@pxref{Printf Ordering}). +(@pxref{Printf Ordering}) @item The @code{split()} function's additional optional fourth -argument which is an array to hold the text of the field separators -(@pxref{String Functions}). +argument, which is an array to hold the text of the field separators +(@pxref{String Functions}) @end itemize @item @@ -34675,16 +34675,16 @@ Additional functions only in @command{gawk}: @item The @code{gensub()}, @code{patsplit()}, and @code{strtonum()} functions for more powerful text manipulation -(@pxref{String Functions}). +(@pxref{String Functions}) @item The @code{asort()} and @code{asorti()} functions for sorting arrays -(@pxref{Array Sorting}). +(@pxref{Array Sorting}) @item The @code{mktime()}, @code{systime()}, and @code{strftime()} functions for working with timestamps -(@pxref{Time Functions}). +(@pxref{Time Functions}) @item The @@ -34696,17 +34696,17 @@ The and @code{xor()} functions for bit manipulation -(@pxref{Bitwise Functions}). +(@pxref{Bitwise Functions}) @c In 4.1, and(), or() and xor() grew the ability to take > 2 arguments @item The @code{isarray()} function to check if a variable is an array or not -(@pxref{Type Functions}). +(@pxref{Type Functions}) @item -The @code{bindtextdomain()}, @code{dcgettext()} and @code{dcngettext()} +The @code{bindtextdomain()}, @code{dcgettext()}, and @code{dcngettext()} functions for internationalization -(@pxref{Programmer i18n}). +(@pxref{Programmer i18n}) @end itemize @item @@ -34716,12 +34716,12 @@ Changes and/or additions in the command-line options: @item The @env{AWKPATH} environment variable for specifying a path search for the @option{-f} command-line option -(@pxref{Options}). +(@pxref{Options}) @item The @env{AWKLIBPATH} environment variable for specifying a path search for the @option{-l} command-line option -(@pxref{Options}). +(@pxref{Options}) @item The @@ -34750,7 +34750,7 @@ The and @option{-V} short options. Also, the -ability to use GNU-style long-named options that start with @option{--} +ability to use GNU-style long-named options that start with @option{--}, and the @option{--assign}, @option{--bignum}, @@ -34830,7 +34830,7 @@ GCC for VAX and Alpha has not been tested for a while. @end itemize @item -Support for the following obsolete systems was removed from the code +Support for the following obsolete system was removed from the code for @command{gawk} @value{PVERSION} 4.1: @c nested table @@ -35466,9 +35466,9 @@ by @command{gawk}, Brian Kernighan's @command{awk}, and @command{mawk}, the three most widely used freely available versions of @command{awk} (@pxref{Other Versions}). -@multitable {@file{/dev/stderr} special file} {BWK Awk} {Mawk} {GNU Awk} {Now standard} -@headitem Feature @tab BWK Awk @tab Mawk @tab GNU Awk @tab Now standard -@item @samp{\x} Escape sequence @tab X @tab X @tab X @tab +@multitable {@file{/dev/stderr} special file} {BWK @command{awk}} {@command{mawk}} {@command{gawk}} {Now standard} +@headitem Feature @tab BWK @command{awk} @tab @command{mawk} @tab @command{gawk} @tab Now standard +@item @samp{\x} escape sequence @tab X @tab X @tab X @tab @item @code{FS} as null string @tab X @tab X @tab X @tab @item @file{/dev/stdin} special file @tab X @tab X @tab X @tab @item @file{/dev/stdout} special file @tab X @tab X @tab X @tab @@ -35499,7 +35499,7 @@ in the machine's native character set. Thus, on ASCII-based systems, @samp{[a-z]} matched all the lowercase letters, and only the lowercase letters, as the numeric values for the letters from @samp{a} through @samp{z} were contiguous. (On an EBCDIC system, the range @samp{[a-z]} -includes additional, non-alphabetic characters as well.) +includes additional nonalphabetic characters as well.) Almost all introductory Unix literature explained range expressions as working in this fashion, and in particular, would teach that the @@ -35524,7 +35524,7 @@ What does that mean? In many locales, @samp{A} and @samp{a} are both less than @samp{B}. In other words, these locales sort characters in dictionary order, and @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]}; -instead it might be equivalent to @samp{[ABCXYabcdxyz]}, for example. +instead, it might be equivalent to @samp{[ABCXYabcdxyz]}, for example. This point needs to be emphasized: much literature teaches that you should use @samp{[a-z]} to match a lowercase character. But on systems with @@ -35553,23 +35553,23 @@ is perfectly valid in ASCII, but is not valid in many Unicode locales, such as @code{en_US.UTF-8}. Early versions of @command{gawk} used regexp matching code that was not -locale aware, so ranges had their traditional interpretation. +locale-aware, so ranges had their traditional interpretation. When @command{gawk} switched to using locale-aware regexp matchers, the problems began; especially as both GNU/Linux and commercial Unix vendors started implementing non-ASCII locales, @emph{and making them the default}. Perhaps the most frequently asked question became something -like ``why does @samp{[A-Z]} match lowercase letters?!?'' +like, ``Why does @samp{[A-Z]} match lowercase letters?!?'' @cindex Berry, Karl This situation existed for close to 10 years, if not more, and the @command{gawk} maintainer grew weary of trying to explain that -@command{gawk} was being nicely standards compliant, and that the issue +@command{gawk} was being nicely standards-compliant, and that the issue was in the user's locale. During the development of @value{PVERSION} 4.0, he modified @command{gawk} to always treat ranges in the original, pre-POSIX fashion, unless @option{--posix} was used (@pxref{Options}).@footnote{And thus was born the Campaign for Rational Range Interpretation (or -RRI). A number of GNU tools have either implemented this change, +RRI). A number of GNU tools have already implemented this change, or will soon. Thanks to Karl Berry for coining the phrase ``Rational Range Interpretation.''} @@ -35583,9 +35583,10 @@ and By using this lovely technical term, the standard gives license to implementors to implement ranges in whatever way they choose. -The @command{gawk} maintainer chose to apply the pre-POSIX meaning in all -cases: the default regexp matching; with @option{--traditional} and with -@option{--posix}; in all cases, @command{gawk} remains POSIX compliant. +The @command{gawk} maintainer chose to apply the pre-POSIX meaning +both with the default regexp matching and when @option{--traditional} or +@option{--posix} are used. +In all cases @command{gawk} remains POSIX-compliant. @node Contributors @appendixsec Major Contributors to @command{gawk} @@ -35631,7 +35632,7 @@ to around 90 pages. Richard Stallman helped finish the implementation and the initial draft of this @value{DOCUMENT}. -He is also the founder of the FSF and the GNU project. +He is also the founder of the FSF and the GNU Project. @item @cindex Woods, John @@ -35795,28 +35796,28 @@ John Haque made the following contributions: @itemize @value{MINUS} @item The modifications to convert @command{gawk} -into a byte-code interpreter, including the debugger. +into a byte-code interpreter, including the debugger @item -The addition of true arrays of arrays. +The addition of true arrays of arrays @item -The additional modifications for support of arbitrary-precision arithmetic. +The additional modifications for support of arbitrary-precision arithmetic @item The initial text of -@ref{Arbitrary Precision Arithmetic}. +@ref{Arbitrary Precision Arithmetic} @item The work to merge the three versions of @command{gawk} -into one, for the 4.1 release. +into one, for the 4.1 release @item -Improved array internals for arrays indexed by integers. +Improved array internals for arrays indexed by integers @item -The improved array sorting features were driven by John together -with Pat Rankin. +The improved array sorting features were also driven by John, together +with Pat Rankin @end itemize @cindex Papadopoulos, Panos @@ -35857,10 +35858,10 @@ helping David Trueman, and as the primary maintainer since around 1994. @itemize @value{BULLET} @item The @command{awk} language has evolved over time. The first release -was with V7 Unix circa 1978. In 1987, for System V Release 3.1, +was with V7 Unix, circa 1978. In 1987, for System V Release 3.1, major additions, including user-defined functions, were made to the language. Additional changes were made for System V Release 4, in 1989. -Since then, further minor changes happen under the auspices of the +Since then, further minor changes have happened under the auspices of the POSIX standard. @item @@ -35876,7 +35877,7 @@ options. The interaction of POSIX locales and regexp matching in @command{gawk} has been confusing over the years. Today, @command{gawk} implements Rational Range Interpretation, where ranges of the form @samp{[a-z]} match @emph{only} the characters numerically between -@samp{a} through @samp{z} in the machine's native character set. Usually this is ASCII +@samp{a} through @samp{z} in the machine's native character set. Usually this is ASCII, but it can be EBCDIC on IBM S/390 systems. @item @@ -35961,7 +35962,7 @@ will be less busy, and you can usually find one closer to your site. @command{gawk} is distributed as several @code{tar} files compressed with different compression programs: @command{gzip}, @command{bzip2}, and @command{xz}. For simplicity, the rest of these instructions assume -you are using the one compressed with the GNU Zip program, @code{gzip}. +you are using the one compressed with the GNU Gzip program (@command{gzip}). Once you have the distribution (e.g., @file{gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz}), @@ -36012,12 +36013,12 @@ operating systems: @table @asis @item Various @samp{.c}, @samp{.y}, and @samp{.h} files -The actual @command{gawk} source code. +These files contain the actual @command{gawk} source code. @end table @table @file @item ABOUT-NLS -Information about GNU @command{gettext} and translations. +A file containing information about GNU @command{gettext} and translations. @item AUTHORS A file with some information about the authorship of @command{gawk}. @@ -36047,7 +36048,7 @@ An older list of changes to @command{gawk}. The GNU General Public License. @item POSIX.STD -A description of behaviors in the POSIX standard for @command{awk} which +A description of behaviors in the POSIX standard for @command{awk} that are left undefined, or where @command{gawk} may not comply fully, as well as a list of things that the POSIX standard should describe but does not. @@ -36312,14 +36313,17 @@ Similarly, setting the @code{LINT} variable (@pxref{User-modified}) has no effect on the running @command{awk} program. -When used with GCC's automatic dead-code-elimination, this option +When used with the GNU Compiler Collection's (GCC's) +automatic dead-code-elimination, this option cuts almost 23K bytes off the size of the @command{gawk} executable on GNU/Linux x86_64 systems. Results on other systems and with other compilers are likely to vary. Using this option may bring you some slight performance improvement. +@quotation CAUTION Using this option will cause some of the tests in the test suite to fail. This option may be removed at a later date. +@end quotation @cindex @option{--disable-nls} configuration option @cindex configuration option, @code{--disable-nls} @@ -36416,10 +36420,10 @@ running MS-DOS, any version of MS-Windows, or OS/2. running MS-DOS and any version of MS-Windows. @end ifset In this @value{SECTION}, the term ``Windows32'' -refers to any of Microsoft Windows-95/98/ME/NT/2000/XP/Vista/7/8. +refers to any of Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8. The limitations of MS-DOS (and MS-DOS shells under the other operating -systems) has meant that various ``DOS extenders'' are often used with +systems) have meant that various ``DOS extenders'' are often used with programs such as @command{gawk}. The varying capabilities of Microsoft Windows 3.1 and Windows32 can add to the confusion. For an overview of the considerations, refer to @file{README_d/README.pc} in @@ -36678,7 +36682,7 @@ Under MS-Windows, OS/2 and MS-DOS, Under MS-Windows and MS-DOS, @end ifset @command{gawk} (and many other text programs) silently -translate end-of-line @samp{\r\n} to @samp{\n} on input and @samp{\n} +translates end-of-line @samp{\r\n} to @samp{\n} on input and @samp{\n} to @samp{\r\n} on output. A special @code{BINMODE} variable @value{COMMONEXT} allows control over these translations and is interpreted as follows: @@ -36712,7 +36716,7 @@ Setting @code{BINMODE} for standard input or standard output is accomplished by using an appropriate @samp{-v BINMODE=@var{N}} option on the command line. @code{BINMODE} is set at the time a file or pipe is opened and cannot be -changed mid-stream. +changed midstream. The name @code{BINMODE} was chosen to match @command{mawk} (@pxref{Other Versions}). @@ -36768,8 +36772,8 @@ moved into the @code{BEGIN} rule. @command{gawk} can be built and used ``out of the box'' under MS-Windows if you are using the @uref{http://www.cygwin.com, Cygwin environment}. -This environment provides an excellent simulation of GNU/Linux, using the -GNU tools, such as Bash, the GNU Compiler Collection (GCC), GNU Make, +This environment provides an excellent simulation of GNU/Linux, using +Bash, GCC, GNU Make, and other GNU programs. Compilation and installation for Cygwin is the same as for a Unix system: @@ -36788,7 +36792,7 @@ and then the @samp{make} proceeds as usual. @appendixsubsubsec Using @command{gawk} In The MSYS Environment In the MSYS environment under MS-Windows, @command{gawk} automatically -uses binary mode for reading and writing files. Thus there is no +uses binary mode for reading and writing files. Thus, there is no need to use the @code{BINMODE} variable. This can cause problems with other Unix-like components that have @@ -36852,7 +36856,7 @@ With ODS-5 volumes and extended parsing enabled, the case of the target parameter may need to be exact. @command{gawk} has been tested under VAX/VMS 7.3 and Alpha/VMS 7.3-1 -using Compaq C V6.4, and Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS 8.3. +using Compaq C V6.4, and under Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS 8.3. The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha and IA64 VMS 8.4 used HP C 7.3.@footnote{The IA64 architecture is also known as ``Itanium.''} @@ -36900,7 +36904,7 @@ For VAX: /name=(as_is,short) @end example -Compile time macros need to be defined before the first VMS-supplied +Compile-time macros need to be defined before the first VMS-supplied header file is included, as follows: @example @@ -36947,7 +36951,7 @@ If your @command{gawk} was installed by a PCSI kit into the @file{GNV$GNU:[vms_help]gawk.hlp}. The PCSI kit also installs a @file{GNV$GNU:[vms_bin]gawk_verb.cld} file -which can be used to add @command{gawk} and @command{awk} as DCL commands. +that can be used to add @command{gawk} and @command{awk} as DCL commands. For just the current process you can use: @@ -36956,7 +36960,7 @@ $ @kbd{set command gnv$gnu:[vms_bin]gawk_verb.cld} @end example Or the system manager can use @file{GNV$GNU:[vms_bin]gawk_verb.cld} to -add the @command{gawk} and @command{awk} to the system wide @samp{DCLTABLES}. +add the @command{gawk} and @command{awk} to the system-wide @samp{DCLTABLES}. The DCL syntax is documented in the @file{gawk.hlp} file. @@ -37022,14 +37026,14 @@ The @code{exit} value is a Unix-style value and is encoded into a VMS exit status value when the program exits. The VMS severity bits will be set based on the @code{exit} value. -A failure is indicated by 1 and VMS sets the @code{ERROR} status. -A fatal error is indicated by 2 and VMS sets the @code{FATAL} status. +A failure is indicated by 1, and VMS sets the @code{ERROR} status. +A fatal error is indicated by 2, and VMS sets the @code{FATAL} status. All other values will have the @code{SUCCESS} status. The exit value is encoded to comply with VMS coding standards and will have the @code{C_FACILITY_NO} of @code{0x350000} with the constant @code{0xA000} added to the number shifted over by 3 bits to make room for the severity codes. -To extract the actual @command{gawk} exit code from the VMS status use: +To extract the actual @command{gawk} exit code from the VMS status, use: @example unix_status = (vms_status .and. &x7f8) / 8 @@ -37048,7 +37052,7 @@ VAX/VMS floating point uses unbiased rounding. @xref{Round Function}. VMS reports time values in GMT unless one of the @code{SYS$TIMEZONE_RULE} or @code{TZ} logical names is set. Older versions of VMS, such as VAX/VMS -7.3 do not set these logical names. +7.3, do not set these logical names. @c @cindex directory search @c @cindex path, search @@ -37066,7 +37070,7 @@ translation and not a multitranslation @code{RMS} searchlist. The VMS GNV package provides a build environment similar to POSIX with ports of a collection of open source tools. The @command{gawk} found in the GNV -base kit is an older port. Currently the GNV project is being reorganized +base kit is an older port. Currently, the GNV project is being reorganized to supply individual PCSI packages for each component. See @w{@uref{https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/}.} @@ -37139,7 +37143,7 @@ recommend compiling and using the current version. @cindex debugging @command{gawk}, bug reports @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 +report it to the developers; we cannot promise to do anything, but we might well want to fix it. Before reporting a bug, make sure you have really found a genuine bug. @@ -37149,7 +37153,7 @@ to do something or not, report that too; it's a bug in the documentation! Before reporting a bug or trying to fix it yourself, try to isolate it to the smallest possible @command{awk} program and input @value{DF} that -reproduces the problem. Then send us the program and @value{DF}, +reproduce the problem. Then send us the program and @value{DF}, some idea of what kind of Unix system you're using, the compiler you used to compile @command{gawk}, and the exact results @command{gawk} gave you. Also say what you expected to occur; this helps @@ -37164,7 +37168,7 @@ You can get this information with the command @samp{gawk --version}. Once you have a precise problem description, send email to @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org}. -The @command{gawk} maintainers subscribe to this address and +The @command{gawk} maintainers subscribe to this address, and thus they will receive your bug report. Although you can send mail to the maintainers directly, the bug reporting address is preferred because the @@ -37191,8 +37195,8 @@ bug reporting system, you should also send a copy to This is for two reasons. First, although some distributions forward bug reports ``upstream'' to the GNU mailing list, many don't, so there is a good chance that the @command{gawk} maintainers won't even see the bug report! Second, -mail to the GNU list is archived, and having everything at the GNU project -keeps things self-contained and not dependant on other organizations. +mail to the GNU list is archived, and having everything at the GNU Project +keeps things self-contained and not dependent on other organizations. @end quotation Non-bug suggestions are always welcome as well. If you have questions @@ -37201,7 +37205,7 @@ features, ask on the bug list; we will try to help you out if we can. If you find bugs in one of the non-Unix ports of @command{gawk}, send an email to the bug list, with a copy to the -person who maintains that port. They are named in the following list, +person who maintains that port. The maintainers are named in the following list, as well as in the @file{README} file in the @command{gawk} distribution. Information in the @file{README} file should be considered authoritative if it conflicts with this @value{DOCUMENT}. @@ -37216,19 +37220,19 @@ The people maintaining the various @command{gawk} ports are: @cindex Robbins, Arnold @cindex Zaretskii, Eli @multitable {MS-Windows with MinGW} {123456789012345678901234567890123456789001234567890} -@item Unix and POSIX systems @tab Arnold Robbins, @EMAIL{arnold@@skeeve.com,arnold at skeeve dot com}. +@item Unix and POSIX systems @tab Arnold Robbins, @EMAIL{arnold@@skeeve.com,arnold at skeeve dot com} -@item MS-DOS with DJGPP @tab Scott Deifik, @EMAIL{scottd.mail@@sbcglobal.net,scottd dot mail at sbcglobal dot net}. +@item MS-DOS with DJGPP @tab Scott Deifik, @EMAIL{scottd.mail@@sbcglobal.net,scottd dot mail at sbcglobal dot net} -@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org}. +@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org} @c Leave this in the print version on purpose. @c OS/2 is not mentioned anywhere else in the print version though. -@item OS/2 @tab Andreas Buening, @EMAIL{andreas.buening@@nexgo.de,andreas dot buening at nexgo dot de}. +@item OS/2 @tab Andreas Buening, @EMAIL{andreas.buening@@nexgo.de,andreas dot buening at nexgo dot de} -@item VMS @tab John Malmberg, @EMAIL{wb8tyw@@qsl.net,wb8tyw at qsl.net}. +@item VMS @tab John Malmberg, @EMAIL{wb8tyw@@qsl.net,wb8tyw at qsl.net} -@item z/OS (OS/390) @tab Dave Pitts, @EMAIL{dpitts@@cozx.com,dpitts at cozx dot com}. +@item z/OS (OS/390) @tab Dave Pitts, @EMAIL{dpitts@@cozx.com,dpitts at cozx dot com} @end multitable If your bug is also reproducible under Unix, send a copy of your @@ -37247,7 +37251,7 @@ Date: Wed, 4 Sep 1996 08:11:48 -0700 (PDT) @cindex Brennan, Michael @ifnotdocbook @quotation -@i{It's kind of fun to put comments like this in your awk code.}@* +@i{It's kind of fun to put comments like this in your awk code:}@* @ @ @ @ @ @ @code{// Do C++ comments work? answer: yes! of course} @author Michael Brennan @end quotation @@ -37288,7 +37292,7 @@ It is available in several archive formats: @end table @cindex @command{git} utility -You can also retrieve it from Git Hub: +You can also retrieve it from GitHub: @example git clone git://github.com/onetrueawk/awk bwkawk @@ -37348,7 +37352,7 @@ for a list of extensions in @command{mawk} that are not in POSIX @command{awk}. @item @command{awka} Written by Andrew Sumner, @command{awka} translates @command{awk} programs into C, compiles them, -and links them with a library of functions that provides the core +and links them with a library of functions that provide the core @command{awk} functionality. It also has a number of extensions. @@ -37369,17 +37373,17 @@ since approximately 2001. Nelson H.F.@: Beebe at the University of Utah has modified BWK @command{awk} to provide timing and profiling information. It is different from @command{gawk} with the @option{--profile} option -(@pxref{Profiling}), +(@pxref{Profiling}) in that it uses CPU-based profiling, not line-count profiling. You may find it at either @uref{ftp://ftp.math.utah.edu/pub/pawk/pawk-20030606.tar.gz} or @uref{http://www.math.utah.edu/pub/pawk/pawk-20030606.tar.gz}. -@item Busybox Awk -@cindex Busybox Awk -@cindex source code, Busybox Awk -Busybox is a GPL-licensed program providing small versions of many +@item BusyBox @command{awk} +@cindex BusyBox Awk +@cindex source code, BusyBox Awk +BusyBox is a GPL-licensed program providing small versions of many applications within a single executable. It is aimed at embedded systems. It includes a full implementation of POSIX @command{awk}. When building it, be careful not to do @samp{make install} as it will overwrite @@ -37391,7 +37395,7 @@ information, see the @uref{http://busybox.net, project's home page}. @cindex source code, Solaris @command{awk} @item The OpenSolaris POSIX @command{awk} The versions of @command{awk} in @file{/usr/xpg4/bin} and -@file{/usr/xpg6/bin} on Solaris are more-or-less POSIX-compliant. +@file{/usr/xpg6/bin} on Solaris are more or less POSIX-compliant. They are based on the @command{awk} from Mortice Kern Systems for PCs. We were able to make this code compile and work under GNU/Linux with 1--2 hours of work. Making it more generally portable (using @@ -37432,9 +37436,9 @@ features to Python. See @uref{https://github.com/alecthomas/pawk} for more information. (This is not related to Nelson Beebe's modified version of BWK @command{awk}, described earlier.) -@item @w{QSE Awk} -@cindex QSE Awk -@cindex source code, QSE Awk +@item @w{QSE @command{awk}} +@cindex QSE @command{awk} +@cindex source code, QSE @command{awk} This is an embeddable @command{awk} interpreter. For more information, see @uref{http://code.google.com/p/qse/} and @uref{http://awk.info/?tools/qse}. @@ -37453,7 +37457,7 @@ since approximately 2008. @item Other versions See also the ``Versions and implementations'' section of the @uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, -Wikipedia article} for information on additional versions. +Wikipedia article} on @command{awk} for information on additional versions. @end table @@ -37462,7 +37466,7 @@ Wikipedia article} for information on additional versions. @itemize @value{BULLET} @item -The @command{gawk} distribution is available from GNU project's main +The @command{gawk} distribution is available from the GNU Project's main distribution site, @code{ftp.gnu.org}. The canonical build recipe is: @example @@ -37474,22 +37478,22 @@ cd gawk-@value{VERSION}.@value{PATCHLEVEL} @item @command{gawk} may be built on non-POSIX systems as well. The currently -supported systems are MS-Windows using DJGPP, MSYS, MinGW and Cygwin, +supported systems are MS-Windows using DJGPP, MSYS, MinGW, and Cygwin, @ifclear FOR_PRINT OS/2 using EMX, @end ifclear and both Vax/VMS and OpenVMS. -Instructions for each system are included in this @value{CHAPTER}. +Instructions for each system are included in this @value{APPENDIX}. @item Bug reports should be sent via email to @email{bug-gawk@@gnu.org}. -Bug reports should be in English, and should include the version of @command{gawk}, -how it was compiled, and a short program and @value{DF} which demonstrate +Bug reports should be in English and should include the version of @command{gawk}, +how it was compiled, and a short program and @value{DF} that demonstrate the problem. @item There are a number of other freely available @command{awk} -implementations. Many are POSIX compliant; others are less so. +implementations. Many are POSIX-compliant; others are less so. @end itemize -- cgit v1.2.3 From 1e593610891a14187d0f44bec56520dfa118a95b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 17 Feb 2015 23:07:25 +0200 Subject: More minor doc fixes. --- doc/ChangeLog | 5 + doc/gawk.info | 622 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 24 +-- doc/gawktexi.in | 24 +-- 4 files changed, 340 insertions(+), 335 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 53dc566e..8f2c1b7b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-02-17 Arnold D. Robbins + + * gawktexi.in: A few minor formatting fixes to sync with O'Reilly + version. + 2015-02-13 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. Through QC1 review. diff --git a/doc/gawk.info b/doc/gawk.info index 44fbd8db..a6eecfdd 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -6524,7 +6524,7 @@ which they may appear: messages at runtime. *Note Printf Ordering::, which describes how and why to use positional specifiers. For now, we ignore them. -`- (Minus)' +`-' (Minus) The minus sign, used before the width modifier (see later on in this list), says to left-justify the argument within its specified width. Normally, the argument is printed right-justified in the @@ -6534,7 +6534,7 @@ which they may appear: prints `foo*'. -`SPACE' +SPACE For numeric conversions, prefix positive values with a space and negative values with a minus sign. @@ -6579,7 +6579,7 @@ which they may appear: programs. For information on appropriate quoting tricks, see *note Quoting::. -`WIDTH' +WIDTH This is a number specifying the desired minimum width of a field. Inserting any number between the `%' sign and the format-control character forces the field to expand to this width. The default @@ -23171,14 +23171,14 @@ This node presents them all as function prototypes, in the way that extension code would use them: `static inline awk_value_t *' -`make_const_string(const char *string, size_t length, awk_value_t *result)' +`make_const_string(const char *string, size_t length, awk_value_t *result);' This function creates a string value in the `awk_value_t' variable pointed to by `result'. It expects `string' to be a C string constant (or other string data), and automatically creates a _copy_ of the data for storage in `result'. It returns `result'. `static inline awk_value_t *' -`make_malloced_string(const char *string, size_t length, awk_value_t *result)' +`make_malloced_string(const char *string, size_t length, awk_value_t *result);' This function creates a string value in the `awk_value_t' variable pointed to by `result'. It expects `string' to be a `char *' value pointing to data previously obtained from `gawk_malloc()', @@ -23187,13 +23187,13 @@ extension code would use them: for it. It returns `result'. `static inline awk_value_t *' -`make_null_string(awk_value_t *result)' +`make_null_string(awk_value_t *result);' This specialized function creates a null string (the "undefined" value) in the `awk_value_t' variable pointed to by `result'. It returns `result'. `static inline awk_value_t *' -`make_number(double num, awk_value_t *result)' +`make_number(double num, awk_value_t *result);' This function simply creates a numeric value in the `awk_value_t' variable pointed to by `result'. @@ -34610,310 +34610,310 @@ Node: Printf279578 Node: Basic Printf280363 Node: Control Letters281935 Node: Format Modifiers285920 -Node: Printf Examples291930 -Node: Redirection294416 -Node: Special FD301254 -Ref: Special FD-Footnote-1304420 -Node: Special Files304494 -Node: Other Inherited Files305111 -Node: Special Network306111 -Node: Special Caveats306973 -Node: Close Files And Pipes307922 -Ref: Close Files And Pipes-Footnote-1315113 -Ref: Close Files And Pipes-Footnote-2315261 -Node: Output Summary315411 -Node: Output Exercises316409 -Node: Expressions317089 -Node: Values318278 -Node: Constants318955 -Node: Scalar Constants319646 -Ref: Scalar Constants-Footnote-1320508 -Node: Nondecimal-numbers320758 -Node: Regexp Constants323768 -Node: Using Constant Regexps324294 -Node: Variables327457 -Node: Using Variables328114 -Node: Assignment Options330025 -Node: Conversion331900 -Node: Strings And Numbers332424 -Ref: Strings And Numbers-Footnote-1335489 -Node: Locale influences conversions335598 -Ref: table-locale-affects338344 -Node: All Operators338936 -Node: Arithmetic Ops339565 -Node: Concatenation342070 -Ref: Concatenation-Footnote-1344889 -Node: Assignment Ops344996 -Ref: table-assign-ops349975 -Node: Increment Ops351285 -Node: Truth Values and Conditions354716 -Node: Truth Values355799 -Node: Typing and Comparison356848 -Node: Variable Typing357664 -Node: Comparison Operators361331 -Ref: table-relational-ops361741 -Node: POSIX String Comparison365236 -Ref: POSIX String Comparison-Footnote-1366308 -Node: Boolean Ops366447 -Ref: Boolean Ops-Footnote-1370925 -Node: Conditional Exp371016 -Node: Function Calls372754 -Node: Precedence376634 -Node: Locales380294 -Node: Expressions Summary381926 -Node: Patterns and Actions384497 -Node: Pattern Overview385617 -Node: Regexp Patterns387296 -Node: Expression Patterns387839 -Node: Ranges391619 -Node: BEGIN/END394726 -Node: Using BEGIN/END395487 -Ref: Using BEGIN/END-Footnote-1398223 -Node: I/O And BEGIN/END398329 -Node: BEGINFILE/ENDFILE400644 -Node: Empty403541 -Node: Using Shell Variables403858 -Node: Action Overview406131 -Node: Statements408457 -Node: If Statement410305 -Node: While Statement411800 -Node: Do Statement413828 -Node: For Statement414976 -Node: Switch Statement418134 -Node: Break Statement420516 -Node: Continue Statement422557 -Node: Next Statement424384 -Node: Nextfile Statement426765 -Node: Exit Statement429393 -Node: Built-in Variables431804 -Node: User-modified432937 -Ref: User-modified-Footnote-1440640 -Node: Auto-set440702 -Ref: Auto-set-Footnote-1453754 -Ref: Auto-set-Footnote-2453959 -Node: ARGC and ARGV454015 -Node: Pattern Action Summary458233 -Node: Arrays460666 -Node: Array Basics461995 -Node: Array Intro462839 -Ref: figure-array-elements464773 -Ref: Array Intro-Footnote-1467393 -Node: Reference to Elements467521 -Node: Assigning Elements469983 -Node: Array Example470474 -Node: Scanning an Array472233 -Node: Controlling Scanning475253 -Ref: Controlling Scanning-Footnote-1480647 -Node: Numeric Array Subscripts480963 -Node: Uninitialized Subscripts483148 -Node: Delete484765 -Ref: Delete-Footnote-1487514 -Node: Multidimensional487571 -Node: Multiscanning490668 -Node: Arrays of Arrays492257 -Node: Arrays Summary497011 -Node: Functions499102 -Node: Built-in500141 -Node: Calling Built-in501219 -Node: Numeric Functions503214 -Ref: Numeric Functions-Footnote-1507230 -Ref: Numeric Functions-Footnote-2507587 -Ref: Numeric Functions-Footnote-3507635 -Node: String Functions507907 -Ref: String Functions-Footnote-1531408 -Ref: String Functions-Footnote-2531537 -Ref: String Functions-Footnote-3531785 -Node: Gory Details531872 -Ref: table-sub-escapes533653 -Ref: table-sub-proposed535168 -Ref: table-posix-sub536530 -Ref: table-gensub-escapes538067 -Ref: Gory Details-Footnote-1538900 -Node: I/O Functions539051 -Ref: I/O Functions-Footnote-1546287 -Node: Time Functions546434 -Ref: Time Functions-Footnote-1556943 -Ref: Time Functions-Footnote-2557011 -Ref: Time Functions-Footnote-3557169 -Ref: Time Functions-Footnote-4557280 -Ref: Time Functions-Footnote-5557392 -Ref: Time Functions-Footnote-6557619 -Node: Bitwise Functions557885 -Ref: table-bitwise-ops558447 -Ref: Bitwise Functions-Footnote-1562775 -Node: Type Functions562947 -Node: I18N Functions564099 -Node: User-defined565746 -Node: Definition Syntax566551 -Ref: Definition Syntax-Footnote-1572210 -Node: Function Example572281 -Ref: Function Example-Footnote-1575202 -Node: Function Caveats575224 -Node: Calling A Function575742 -Node: Variable Scope576700 -Node: Pass By Value/Reference579693 -Node: Return Statement583190 -Node: Dynamic Typing586169 -Node: Indirect Calls587098 -Ref: Indirect Calls-Footnote-1598404 -Node: Functions Summary598532 -Node: Library Functions601234 -Ref: Library Functions-Footnote-1604842 -Ref: Library Functions-Footnote-2604985 -Node: Library Names605156 -Ref: Library Names-Footnote-1608614 -Ref: Library Names-Footnote-2608837 -Node: General Functions608923 -Node: Strtonum Function610026 -Node: Assert Function613048 -Node: Round Function616372 -Node: Cliff Random Function617913 -Node: Ordinal Functions618929 -Ref: Ordinal Functions-Footnote-1621992 -Ref: Ordinal Functions-Footnote-2622244 -Node: Join Function622455 -Ref: Join Function-Footnote-1624225 -Node: Getlocaltime Function624425 -Node: Readfile Function628169 -Node: Shell Quoting630141 -Node: Data File Management631542 -Node: Filetrans Function632174 -Node: Rewind Function636270 -Node: File Checking637656 -Ref: File Checking-Footnote-1638989 -Node: Empty Files639190 -Node: Ignoring Assigns641169 -Node: Getopt Function642719 -Ref: Getopt Function-Footnote-1654183 -Node: Passwd Functions654383 -Ref: Passwd Functions-Footnote-1663223 -Node: Group Functions663311 -Ref: Group Functions-Footnote-1671208 -Node: Walking Arrays671413 -Node: Library Functions Summary673013 -Node: Library Exercises674417 -Node: Sample Programs675697 -Node: Running Examples676467 -Node: Clones677195 -Node: Cut Program678419 -Node: Egrep Program688139 -Ref: Egrep Program-Footnote-1695642 -Node: Id Program695752 -Node: Split Program699428 -Ref: Split Program-Footnote-1702882 -Node: Tee Program703010 -Node: Uniq Program705799 -Node: Wc Program713218 -Ref: Wc Program-Footnote-1717468 -Node: Miscellaneous Programs717562 -Node: Dupword Program718775 -Node: Alarm Program720806 -Node: Translate Program725611 -Ref: Translate Program-Footnote-1730174 -Node: Labels Program730444 -Ref: Labels Program-Footnote-1733795 -Node: Word Sorting733879 -Node: History Sorting737949 -Node: Extract Program739784 -Node: Simple Sed747308 -Node: Igawk Program750378 -Ref: Igawk Program-Footnote-1764704 -Ref: Igawk Program-Footnote-2764905 -Ref: Igawk Program-Footnote-3765027 -Node: Anagram Program765142 -Node: Signature Program768203 -Node: Programs Summary769450 -Node: Programs Exercises770671 -Ref: Programs Exercises-Footnote-1774802 -Node: Advanced Features774893 -Node: Nondecimal Data776875 -Node: Array Sorting778465 -Node: Controlling Array Traversal779165 -Ref: Controlling Array Traversal-Footnote-1787531 -Node: Array Sorting Functions787649 -Ref: Array Sorting Functions-Footnote-1791535 -Node: Two-way I/O791731 -Ref: Two-way I/O-Footnote-1796676 -Ref: Two-way I/O-Footnote-2796862 -Node: TCP/IP Networking796944 -Node: Profiling799816 -Node: Advanced Features Summary807357 -Node: Internationalization809290 -Node: I18N and L10N810770 -Node: Explaining gettext811456 -Ref: Explaining gettext-Footnote-1816481 -Ref: Explaining gettext-Footnote-2816665 -Node: Programmer i18n816830 -Ref: Programmer i18n-Footnote-1821706 -Node: Translator i18n821755 -Node: String Extraction822549 -Ref: String Extraction-Footnote-1823680 -Node: Printf Ordering823766 -Ref: Printf Ordering-Footnote-1826552 -Node: I18N Portability826616 -Ref: I18N Portability-Footnote-1829072 -Node: I18N Example829135 -Ref: I18N Example-Footnote-1831938 -Node: Gawk I18N832010 -Node: I18N Summary832654 -Node: Debugger833994 -Node: Debugging835016 -Node: Debugging Concepts835457 -Node: Debugging Terms837267 -Node: Awk Debugging839839 -Node: Sample Debugging Session840745 -Node: Debugger Invocation841279 -Node: Finding The Bug842664 -Node: List of Debugger Commands849143 -Node: Breakpoint Control850475 -Node: Debugger Execution Control854152 -Node: Viewing And Changing Data857511 -Node: Execution Stack860887 -Node: Debugger Info862522 -Node: Miscellaneous Debugger Commands866567 -Node: Readline Support871568 -Node: Limitations872462 -Node: Debugging Summary874577 -Node: Arbitrary Precision Arithmetic875751 -Node: Computer Arithmetic877167 -Ref: table-numeric-ranges880766 -Ref: Computer Arithmetic-Footnote-1881290 -Node: Math Definitions881347 -Ref: table-ieee-formats884642 -Ref: Math Definitions-Footnote-1885246 -Node: MPFR features885351 -Node: FP Math Caution887022 -Ref: FP Math Caution-Footnote-1888072 -Node: Inexactness of computations888441 -Node: Inexact representation889400 -Node: Comparing FP Values890758 -Node: Errors accumulate891840 -Node: Getting Accuracy893272 -Node: Try To Round895976 -Node: Setting precision896875 -Ref: table-predefined-precision-strings897559 -Node: Setting the rounding mode899388 -Ref: table-gawk-rounding-modes899752 -Ref: Setting the rounding mode-Footnote-1903204 -Node: Arbitrary Precision Integers903383 -Ref: Arbitrary Precision Integers-Footnote-1906367 -Node: POSIX Floating Point Problems906516 -Ref: POSIX Floating Point Problems-Footnote-1910395 -Node: Floating point summary910433 -Node: Dynamic Extensions912629 -Node: Extension Intro914181 -Node: Plugin License915446 -Node: Extension Mechanism Outline916243 -Ref: figure-load-extension916671 -Ref: figure-register-new-function918151 -Ref: figure-call-new-function919155 -Node: Extension API Description921142 -Node: Extension API Functions Introduction922592 -Node: General Data Types927413 -Ref: General Data Types-Footnote-1933313 -Node: Memory Allocation Functions933612 -Ref: Memory Allocation Functions-Footnote-1936451 -Node: Constructor Functions936550 +Node: Printf Examples291926 +Node: Redirection294412 +Node: Special FD301250 +Ref: Special FD-Footnote-1304416 +Node: Special Files304490 +Node: Other Inherited Files305107 +Node: Special Network306107 +Node: Special Caveats306969 +Node: Close Files And Pipes307918 +Ref: Close Files And Pipes-Footnote-1315109 +Ref: Close Files And Pipes-Footnote-2315257 +Node: Output Summary315407 +Node: Output Exercises316405 +Node: Expressions317085 +Node: Values318274 +Node: Constants318951 +Node: Scalar Constants319642 +Ref: Scalar Constants-Footnote-1320504 +Node: Nondecimal-numbers320754 +Node: Regexp Constants323764 +Node: Using Constant Regexps324290 +Node: Variables327453 +Node: Using Variables328110 +Node: Assignment Options330021 +Node: Conversion331896 +Node: Strings And Numbers332420 +Ref: Strings And Numbers-Footnote-1335485 +Node: Locale influences conversions335594 +Ref: table-locale-affects338340 +Node: All Operators338932 +Node: Arithmetic Ops339561 +Node: Concatenation342066 +Ref: Concatenation-Footnote-1344885 +Node: Assignment Ops344992 +Ref: table-assign-ops349971 +Node: Increment Ops351281 +Node: Truth Values and Conditions354712 +Node: Truth Values355795 +Node: Typing and Comparison356844 +Node: Variable Typing357660 +Node: Comparison Operators361327 +Ref: table-relational-ops361737 +Node: POSIX String Comparison365232 +Ref: POSIX String Comparison-Footnote-1366304 +Node: Boolean Ops366443 +Ref: Boolean Ops-Footnote-1370921 +Node: Conditional Exp371012 +Node: Function Calls372750 +Node: Precedence376630 +Node: Locales380290 +Node: Expressions Summary381922 +Node: Patterns and Actions384493 +Node: Pattern Overview385613 +Node: Regexp Patterns387292 +Node: Expression Patterns387835 +Node: Ranges391615 +Node: BEGIN/END394722 +Node: Using BEGIN/END395483 +Ref: Using BEGIN/END-Footnote-1398219 +Node: I/O And BEGIN/END398325 +Node: BEGINFILE/ENDFILE400640 +Node: Empty403537 +Node: Using Shell Variables403854 +Node: Action Overview406127 +Node: Statements408453 +Node: If Statement410301 +Node: While Statement411796 +Node: Do Statement413824 +Node: For Statement414972 +Node: Switch Statement418130 +Node: Break Statement420512 +Node: Continue Statement422553 +Node: Next Statement424380 +Node: Nextfile Statement426761 +Node: Exit Statement429389 +Node: Built-in Variables431800 +Node: User-modified432933 +Ref: User-modified-Footnote-1440636 +Node: Auto-set440698 +Ref: Auto-set-Footnote-1453750 +Ref: Auto-set-Footnote-2453955 +Node: ARGC and ARGV454011 +Node: Pattern Action Summary458229 +Node: Arrays460662 +Node: Array Basics461991 +Node: Array Intro462835 +Ref: figure-array-elements464769 +Ref: Array Intro-Footnote-1467389 +Node: Reference to Elements467517 +Node: Assigning Elements469979 +Node: Array Example470470 +Node: Scanning an Array472229 +Node: Controlling Scanning475249 +Ref: Controlling Scanning-Footnote-1480643 +Node: Numeric Array Subscripts480959 +Node: Uninitialized Subscripts483144 +Node: Delete484761 +Ref: Delete-Footnote-1487510 +Node: Multidimensional487567 +Node: Multiscanning490664 +Node: Arrays of Arrays492253 +Node: Arrays Summary497007 +Node: Functions499098 +Node: Built-in500137 +Node: Calling Built-in501215 +Node: Numeric Functions503210 +Ref: Numeric Functions-Footnote-1507226 +Ref: Numeric Functions-Footnote-2507583 +Ref: Numeric Functions-Footnote-3507631 +Node: String Functions507903 +Ref: String Functions-Footnote-1531404 +Ref: String Functions-Footnote-2531533 +Ref: String Functions-Footnote-3531781 +Node: Gory Details531868 +Ref: table-sub-escapes533649 +Ref: table-sub-proposed535164 +Ref: table-posix-sub536526 +Ref: table-gensub-escapes538063 +Ref: Gory Details-Footnote-1538896 +Node: I/O Functions539047 +Ref: I/O Functions-Footnote-1546283 +Node: Time Functions546430 +Ref: Time Functions-Footnote-1556939 +Ref: Time Functions-Footnote-2557007 +Ref: Time Functions-Footnote-3557165 +Ref: Time Functions-Footnote-4557276 +Ref: Time Functions-Footnote-5557388 +Ref: Time Functions-Footnote-6557615 +Node: Bitwise Functions557881 +Ref: table-bitwise-ops558443 +Ref: Bitwise Functions-Footnote-1562771 +Node: Type Functions562943 +Node: I18N Functions564095 +Node: User-defined565742 +Node: Definition Syntax566547 +Ref: Definition Syntax-Footnote-1572206 +Node: Function Example572277 +Ref: Function Example-Footnote-1575198 +Node: Function Caveats575220 +Node: Calling A Function575738 +Node: Variable Scope576696 +Node: Pass By Value/Reference579689 +Node: Return Statement583186 +Node: Dynamic Typing586165 +Node: Indirect Calls587094 +Ref: Indirect Calls-Footnote-1598400 +Node: Functions Summary598528 +Node: Library Functions601230 +Ref: Library Functions-Footnote-1604838 +Ref: Library Functions-Footnote-2604981 +Node: Library Names605152 +Ref: Library Names-Footnote-1608610 +Ref: Library Names-Footnote-2608833 +Node: General Functions608919 +Node: Strtonum Function610022 +Node: Assert Function613044 +Node: Round Function616368 +Node: Cliff Random Function617909 +Node: Ordinal Functions618925 +Ref: Ordinal Functions-Footnote-1621988 +Ref: Ordinal Functions-Footnote-2622240 +Node: Join Function622451 +Ref: Join Function-Footnote-1624221 +Node: Getlocaltime Function624421 +Node: Readfile Function628165 +Node: Shell Quoting630137 +Node: Data File Management631538 +Node: Filetrans Function632170 +Node: Rewind Function636266 +Node: File Checking637652 +Ref: File Checking-Footnote-1638985 +Node: Empty Files639186 +Node: Ignoring Assigns641165 +Node: Getopt Function642715 +Ref: Getopt Function-Footnote-1654179 +Node: Passwd Functions654379 +Ref: Passwd Functions-Footnote-1663219 +Node: Group Functions663307 +Ref: Group Functions-Footnote-1671204 +Node: Walking Arrays671409 +Node: Library Functions Summary673009 +Node: Library Exercises674413 +Node: Sample Programs675693 +Node: Running Examples676463 +Node: Clones677191 +Node: Cut Program678415 +Node: Egrep Program688135 +Ref: Egrep Program-Footnote-1695638 +Node: Id Program695748 +Node: Split Program699424 +Ref: Split Program-Footnote-1702878 +Node: Tee Program703006 +Node: Uniq Program705795 +Node: Wc Program713214 +Ref: Wc Program-Footnote-1717464 +Node: Miscellaneous Programs717558 +Node: Dupword Program718771 +Node: Alarm Program720802 +Node: Translate Program725607 +Ref: Translate Program-Footnote-1730170 +Node: Labels Program730440 +Ref: Labels Program-Footnote-1733791 +Node: Word Sorting733875 +Node: History Sorting737945 +Node: Extract Program739780 +Node: Simple Sed747304 +Node: Igawk Program750374 +Ref: Igawk Program-Footnote-1764700 +Ref: Igawk Program-Footnote-2764901 +Ref: Igawk Program-Footnote-3765023 +Node: Anagram Program765138 +Node: Signature Program768199 +Node: Programs Summary769446 +Node: Programs Exercises770667 +Ref: Programs Exercises-Footnote-1774798 +Node: Advanced Features774889 +Node: Nondecimal Data776871 +Node: Array Sorting778461 +Node: Controlling Array Traversal779161 +Ref: Controlling Array Traversal-Footnote-1787527 +Node: Array Sorting Functions787645 +Ref: Array Sorting Functions-Footnote-1791531 +Node: Two-way I/O791727 +Ref: Two-way I/O-Footnote-1796672 +Ref: Two-way I/O-Footnote-2796858 +Node: TCP/IP Networking796940 +Node: Profiling799812 +Node: Advanced Features Summary807353 +Node: Internationalization809286 +Node: I18N and L10N810766 +Node: Explaining gettext811452 +Ref: Explaining gettext-Footnote-1816477 +Ref: Explaining gettext-Footnote-2816661 +Node: Programmer i18n816826 +Ref: Programmer i18n-Footnote-1821702 +Node: Translator i18n821751 +Node: String Extraction822545 +Ref: String Extraction-Footnote-1823676 +Node: Printf Ordering823762 +Ref: Printf Ordering-Footnote-1826548 +Node: I18N Portability826612 +Ref: I18N Portability-Footnote-1829068 +Node: I18N Example829131 +Ref: I18N Example-Footnote-1831934 +Node: Gawk I18N832006 +Node: I18N Summary832650 +Node: Debugger833990 +Node: Debugging835012 +Node: Debugging Concepts835453 +Node: Debugging Terms837263 +Node: Awk Debugging839835 +Node: Sample Debugging Session840741 +Node: Debugger Invocation841275 +Node: Finding The Bug842660 +Node: List of Debugger Commands849139 +Node: Breakpoint Control850471 +Node: Debugger Execution Control854148 +Node: Viewing And Changing Data857507 +Node: Execution Stack860883 +Node: Debugger Info862518 +Node: Miscellaneous Debugger Commands866563 +Node: Readline Support871564 +Node: Limitations872458 +Node: Debugging Summary874573 +Node: Arbitrary Precision Arithmetic875747 +Node: Computer Arithmetic877163 +Ref: table-numeric-ranges880762 +Ref: Computer Arithmetic-Footnote-1881286 +Node: Math Definitions881343 +Ref: table-ieee-formats884638 +Ref: Math Definitions-Footnote-1885242 +Node: MPFR features885347 +Node: FP Math Caution887018 +Ref: FP Math Caution-Footnote-1888068 +Node: Inexactness of computations888437 +Node: Inexact representation889396 +Node: Comparing FP Values890754 +Node: Errors accumulate891836 +Node: Getting Accuracy893268 +Node: Try To Round895972 +Node: Setting precision896871 +Ref: table-predefined-precision-strings897555 +Node: Setting the rounding mode899384 +Ref: table-gawk-rounding-modes899748 +Ref: Setting the rounding mode-Footnote-1903200 +Node: Arbitrary Precision Integers903379 +Ref: Arbitrary Precision Integers-Footnote-1906363 +Node: POSIX Floating Point Problems906512 +Ref: POSIX Floating Point Problems-Footnote-1910391 +Node: Floating point summary910429 +Node: Dynamic Extensions912625 +Node: Extension Intro914177 +Node: Plugin License915442 +Node: Extension Mechanism Outline916239 +Ref: figure-load-extension916667 +Ref: figure-register-new-function918147 +Ref: figure-call-new-function919151 +Node: Extension API Description921138 +Node: Extension API Functions Introduction922588 +Node: General Data Types927409 +Ref: General Data Types-Footnote-1933309 +Node: Memory Allocation Functions933608 +Ref: Memory Allocation Functions-Footnote-1936447 +Node: Constructor Functions936546 Node: Registration Functions938285 Node: Extension Functions938970 Node: Exit Callback Functions941267 diff --git a/doc/gawk.texi b/doc/gawk.texi index 1ca68804..a04cef48 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -9406,12 +9406,12 @@ represent spaces in the output. Here are the possible modifiers, in the order in which they may appear: -@table @code +@table @asis @cindex differences in @command{awk} and @command{gawk}, @code{print}/@code{printf} statements @cindex @code{printf} statement, positional specifiers @c the code{} does NOT start a secondary @cindex positional specifiers, @code{printf} statement -@item @var{N}$ +@item @code{@var{N}$} An integer constant followed by a @samp{$} is a @dfn{positional specifier}. Normally, format specifications are applied to arguments in the order given in the format string. With a positional specifier, the format @@ -9434,7 +9434,7 @@ messages at runtime. which describes how and why to use positional specifiers. For now, we ignore them. -@item - @r{(Minus)} +@item @code{-} (Minus) The minus sign, used before the width modifier (see later on in this list), says to left-justify @@ -9452,13 +9452,13 @@ prints @samp{foo@bullet{}}. For numeric conversions, prefix positive values with a space and negative values with a minus sign. -@item + +@item @code{+} The plus sign, used before the width modifier (see later on in this list), says to always supply a sign for numeric conversions, even if the data to format is positive. The @samp{+} overrides the space modifier. -@item # +@item @code{#} Use an ``alternative form'' for certain control letters. For @samp{%o}, supply a leading zero. For @samp{%x} and @samp{%X}, supply a leading @samp{0x} or @samp{0X} for @@ -9467,14 +9467,14 @@ For @samp{%e}, @samp{%E}, @samp{%f}, and @samp{%F}, the result always contains a decimal point. For @samp{%g} and @samp{%G}, trailing zeros are not removed from the result. -@item 0 +@item @code{0} A leading @samp{0} (zero) acts as a flag indicating that output should be padded with zeros instead of spaces. This applies only to the numeric output formats. This flag only has an effect when the field width is wider than the value to print. -@item ' +@item @code{'} A single quote or apostrophe character is a POSIX extension to ISO C. It indicates that the integer part of a floating-point value, or the entire part of an integer decimal value, should have a thousands-separator @@ -9527,7 +9527,7 @@ prints @samp{foobar}. Preceding the @var{width} with a minus sign causes the output to be padded with spaces on the right, instead of on the left. -@item .@var{prec} +@item @code{.@var{prec}} A period followed by an integer constant specifies the precision to use when printing. The meaning of the precision varies by control letter: @@ -31733,14 +31733,14 @@ the way that extension code would use them: @table @code @item static inline awk_value_t * -@itemx make_const_string(const char *string, size_t length, awk_value_t *result) +@itemx make_const_string(const char *string, size_t length, awk_value_t *result); This function creates a string value in the @code{awk_value_t} variable pointed to by @code{result}. It expects @code{string} to be a C string constant (or other string data), and automatically creates a @emph{copy} of the data for storage in @code{result}. It returns @code{result}. @item static inline awk_value_t * -@itemx make_malloced_string(const char *string, size_t length, awk_value_t *result) +@itemx make_malloced_string(const char *string, size_t length, awk_value_t *result); This function creates a string value in the @code{awk_value_t} variable pointed to by @code{result}. It expects @code{string} to be a @samp{char *} value pointing to data previously obtained from @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The idea here @@ -31748,13 +31748,13 @@ is that the data is passed directly to @command{gawk}, which assumes responsibility for it. It returns @code{result}. @item static inline awk_value_t * -@itemx make_null_string(awk_value_t *result) +@itemx make_null_string(awk_value_t *result); This specialized function creates a null string (the ``undefined'' value) in the @code{awk_value_t} variable pointed to by @code{result}. It returns @code{result}. @item static inline awk_value_t * -@itemx make_number(double num, awk_value_t *result) +@itemx make_number(double num, awk_value_t *result); This function simply creates a numeric value in the @code{awk_value_t} variable pointed to by @code{result}. @end table diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 724a559a..1a5be1b8 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -9006,12 +9006,12 @@ represent spaces in the output. Here are the possible modifiers, in the order in which they may appear: -@table @code +@table @asis @cindex differences in @command{awk} and @command{gawk}, @code{print}/@code{printf} statements @cindex @code{printf} statement, positional specifiers @c the code{} does NOT start a secondary @cindex positional specifiers, @code{printf} statement -@item @var{N}$ +@item @code{@var{N}$} An integer constant followed by a @samp{$} is a @dfn{positional specifier}. Normally, format specifications are applied to arguments in the order given in the format string. With a positional specifier, the format @@ -9034,7 +9034,7 @@ messages at runtime. which describes how and why to use positional specifiers. For now, we ignore them. -@item - @r{(Minus)} +@item @code{-} (Minus) The minus sign, used before the width modifier (see later on in this list), says to left-justify @@ -9052,13 +9052,13 @@ prints @samp{foo@bullet{}}. For numeric conversions, prefix positive values with a space and negative values with a minus sign. -@item + +@item @code{+} The plus sign, used before the width modifier (see later on in this list), says to always supply a sign for numeric conversions, even if the data to format is positive. The @samp{+} overrides the space modifier. -@item # +@item @code{#} Use an ``alternative form'' for certain control letters. For @samp{%o}, supply a leading zero. For @samp{%x} and @samp{%X}, supply a leading @samp{0x} or @samp{0X} for @@ -9067,14 +9067,14 @@ For @samp{%e}, @samp{%E}, @samp{%f}, and @samp{%F}, the result always contains a decimal point. For @samp{%g} and @samp{%G}, trailing zeros are not removed from the result. -@item 0 +@item @code{0} A leading @samp{0} (zero) acts as a flag indicating that output should be padded with zeros instead of spaces. This applies only to the numeric output formats. This flag only has an effect when the field width is wider than the value to print. -@item ' +@item @code{'} A single quote or apostrophe character is a POSIX extension to ISO C. It indicates that the integer part of a floating-point value, or the entire part of an integer decimal value, should have a thousands-separator @@ -9127,7 +9127,7 @@ prints @samp{foobar}. Preceding the @var{width} with a minus sign causes the output to be padded with spaces on the right, instead of on the left. -@item .@var{prec} +@item @code{.@var{prec}} A period followed by an integer constant specifies the precision to use when printing. The meaning of the precision varies by control letter: @@ -30824,14 +30824,14 @@ the way that extension code would use them: @table @code @item static inline awk_value_t * -@itemx make_const_string(const char *string, size_t length, awk_value_t *result) +@itemx make_const_string(const char *string, size_t length, awk_value_t *result); This function creates a string value in the @code{awk_value_t} variable pointed to by @code{result}. It expects @code{string} to be a C string constant (or other string data), and automatically creates a @emph{copy} of the data for storage in @code{result}. It returns @code{result}. @item static inline awk_value_t * -@itemx make_malloced_string(const char *string, size_t length, awk_value_t *result) +@itemx make_malloced_string(const char *string, size_t length, awk_value_t *result); This function creates a string value in the @code{awk_value_t} variable pointed to by @code{result}. It expects @code{string} to be a @samp{char *} value pointing to data previously obtained from @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The idea here @@ -30839,13 +30839,13 @@ is that the data is passed directly to @command{gawk}, which assumes responsibility for it. It returns @code{result}. @item static inline awk_value_t * -@itemx make_null_string(awk_value_t *result) +@itemx make_null_string(awk_value_t *result); This specialized function creates a null string (the ``undefined'' value) in the @code{awk_value_t} variable pointed to by @code{result}. It returns @code{result}. @item static inline awk_value_t * -@itemx make_number(double num, awk_value_t *result) +@itemx make_number(double num, awk_value_t *result); This function simply creates a numeric value in the @code{awk_value_t} variable pointed to by @code{result}. @end table -- cgit v1.2.3 From c116a3b0b2b2731fe44372b1c3aa6535717b4dc1 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 19 Feb 2015 07:58:34 +0200 Subject: More edits. --- doc/ChangeLog | 4 + doc/gawk.info | 878 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 137 ++++----- doc/gawktexi.in | 137 ++++----- 4 files changed, 581 insertions(+), 575 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8f2c1b7b..42508ab1 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-19 Arnold D. Robbins + + * gawktexi.in: More O'Reilly fixes. + 2015-02-17 Arnold D. Robbins * gawktexi.in: A few minor formatting fixes to sync with O'Reilly diff --git a/doc/gawk.info b/doc/gawk.info index a6eecfdd..717e6659 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -10183,15 +10183,14 @@ 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, - regexp matching with `~' and `!~', as well as the `gensub()', + and all regular expression matching are case-independent. This + applies to regexp matching with `~' and `!~', the `gensub()', `gsub()', `index()', `match()', `patsplit()', `split()', and `sub()' functions, record termination with `RS', and field - splitting with `FS' and `FPAT', all ignore case when doing their - particular regexp operations. However, the value of `IGNORECASE' - does _not_ affect array subscripting and it does not affect field - splitting when using a single-character field separator. *Note - Case-sensitivity::. + splitting with `FS' and `FPAT'. However, the value of + `IGNORECASE' does _not_ affect array subscripting and it does not + affect field splitting when using a single-character field + separator. *Note Case-sensitivity::. `LINT #' When this variable is true (nonzero or non-null), `gawk' behaves @@ -14288,61 +14287,7 @@ names of the two comparison functions: -| rsort: <100.0 95.6 93.4 87.1> Another example where indirect functions calls are useful can be -found in processing arrays. *note Walking Arrays::, presented a simple -function for "walking" an array of arrays. That function simply -printed the name and value of each scalar array element. However, it is -easy to generalize that function, by passing in the name of a function -to call when walking an array. The modified function looks like this: - - function process_array(arr, name, process, do_arrays, i, new_name) - { - for (i in arr) { - new_name = (name "[" i "]") - if (isarray(arr[i])) { - if (do_arrays) - @process(new_name, arr[i]) - process_array(arr[i], new_name, process, do_arrays) - } else - @process(new_name, arr[i]) - } - } - - The arguments are as follows: - -`arr' - The array. - -`name' - The name of the array (a string). - -`process' - The name of the function to call. - -`do_arrays' - If this is true, the function can handle elements that are - subarrays. - - If subarrays are to be processed, that is done before walking them -further. - - When run with the following scaffolding, the function produces the -same results as does the earlier `walk_array()' function: - - BEGIN { - a[1] = 1 - a[2][1] = 21 - a[2][2] = 22 - a[3] = 3 - a[4][1][1] = 411 - a[4][2] = 42 - - process_array(a, "a", "do_print", 0) - } - - function do_print(name, element) - { - printf "%s = %s\n", name, element - } +found in processing arrays. This is described in *note Walking Arrays::. Remember that you must supply a leading `@' in front of an indirect function call. @@ -16319,6 +16264,61 @@ value. Here is a main program to demonstrate: -| a[4][1][1] = 411 -| a[4][2] = 42 + The function just presented simply prints the name and value of each +scalar array element. However, it is easy to generalize it, by passing +in the name of a function to call when walking an array. The modified +function looks like this: + + function process_array(arr, name, process, do_arrays, i, new_name) + { + for (i in arr) { + new_name = (name "[" i "]") + if (isarray(arr[i])) { + if (do_arrays) + @process(new_name, arr[i]) + process_array(arr[i], new_name, process, do_arrays) + } else + @process(new_name, arr[i]) + } + } + + The arguments are as follows: + +`arr' + The array. + +`name' + The name of the array (a string). + +`process' + The name of the function to call. + +`do_arrays' + If this is true, the function can handle elements that are + subarrays. + + If subarrays are to be processed, that is done before walking them +further. + + When run with the following scaffolding, the function produces the +same results as does the earlier version of `walk_array()': + + BEGIN { + a[1] = 1 + a[2][1] = 21 + a[2][2] = 22 + a[3] = 3 + a[4][1][1] = 411 + a[4][2] = 42 + + process_array(a, "a", "do_print", 0) + } + + function do_print(name, element) + { + printf "%s = %s\n", name, element + } +  File: gawk.info, Node: Library Functions Summary, Next: Library Exercises, Prev: Walking Arrays, Up: Library Functions @@ -16353,7 +16353,7 @@ File: gawk.info, Node: Library Functions Summary, Next: Library Exercises, Pr Two sets of routines that parallel the C library versions Traversing arrays of arrays - A simple function to traverse an array of arrays to any depth + Two functions that traverse an array of arrays to any depth  @@ -32502,7 +32502,7 @@ Index (line 6) * differences in awk and gawk, line continuations: Conditional Exp. (line 34) -* differences in awk and gawk, LINT variable: User-modified. (line 88) +* differences in awk and gawk, LINT variable: User-modified. (line 87) * differences in awk and gawk, match() function: String Functions. (line 263) * differences in awk and gawk, print/printf statements: Format Modifiers. @@ -32527,7 +32527,7 @@ Index (line 77) * differences in awk and gawk, SYMTAB variable: Auto-set. (line 269) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. - (line 152) + (line 151) * differences in awk and gawk, trunc-mod operation: Arithmetic Ops. (line 66) * directories, command-line: Command-line directories. @@ -32989,7 +32989,7 @@ Index (line 6) * gawk, interval expressions and: Regexp Operators. (line 139) * gawk, line continuation in: Conditional Exp. (line 34) -* gawk, LINT variable in: User-modified. (line 88) +* gawk, LINT variable in: User-modified. (line 87) * gawk, list of contributors to: Contributors. (line 6) * gawk, MS-DOS version of: PC Using. (line 10) * gawk, MS-Windows version of: PC Using. (line 10) @@ -33015,7 +33015,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 269) -* gawk, TEXTDOMAIN variable in: User-modified. (line 152) +* gawk, TEXTDOMAIN variable in: User-modified. (line 151) * gawk, timestamps: Time Functions. (line 6) * gawk, uses for: Preface. (line 34) * gawk, versions of, information about, printing: Options. (line 302) @@ -33213,7 +33213,7 @@ Index * internationalization: I18N Functions. (line 6) * internationalization, localization <1>: Internationalization. (line 13) -* internationalization, localization: User-modified. (line 152) +* internationalization, localization: User-modified. (line 151) * internationalization, localization, character classes: Bracket Expressions. (line 101) * internationalization, localization, gawk and: Internationalization. @@ -33323,7 +33323,7 @@ Index * lines, duplicate, removing: History Sorting. (line 6) * lines, matching ranges of: Ranges. (line 6) * lines, skipping between markers: Ranges. (line 43) -* lint checking: User-modified. (line 88) +* lint checking: User-modified. (line 87) * lint checking, array elements: Delete. (line 34) * lint checking, array subscripts: Uninitialized Subscripts. (line 43) @@ -33333,7 +33333,7 @@ Index (line 341) * lint checking, undefined functions: Pass By Value/Reference. (line 85) -* LINT variable: User-modified. (line 88) +* LINT variable: User-modified. (line 87) * Linux <1>: Glossary. (line 753) * Linux <2>: I18N Example. (line 55) * Linux: Manual History. (line 28) @@ -33505,11 +33505,11 @@ Index * obsolete features: Obsolete. (line 6) * octal numbers: Nondecimal-numbers. (line 6) * octal values, enabling interpretation of: Options. (line 211) -* OFMT variable <1>: User-modified. (line 105) +* OFMT variable <1>: User-modified. (line 104) * 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 114) +* OFS variable <1>: User-modified. (line 113) * OFS variable <2>: Output Separators. (line 6) * OFS variable: Changing Fields. (line 64) * OpenBSD: Glossary. (line 753) @@ -33562,7 +33562,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 119) +* ORS variable <1>: User-modified. (line 118) * ORS variable: Output Separators. (line 21) * output field separator, See OFS variable: Changing Fields. (line 64) * output record separator, See ORS variable: Output Separators. @@ -33702,7 +33702,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 341) -* PREC variable: User-modified. (line 124) +* PREC variable: User-modified. (line 123) * precedence <1>: Precedence. (line 6) * precedence: Increment Ops. (line 60) * precedence, regexp operators: Regexp Operators. (line 156) @@ -33717,7 +33717,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 114) +* print statement, OFMT variable and: User-modified. (line 113) * print statement, See Also redirection, of output: Redirection. (line 17) * print statement, sprintf() function and: Round Function. (line 6) @@ -33832,7 +33832,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 133) +* record separators <1>: User-modified. (line 132) * record separators: awk split records. (line 6) * record separators, changing: awk split records. (line 85) * record separators, regular expressions as: awk split records. @@ -33944,8 +33944,8 @@ Index * round to nearest integer: Numeric Functions. (line 23) * round() user-defined function: Round Function. (line 16) * rounding numbers: Round Function. (line 6) -* ROUNDMODE variable: User-modified. (line 128) -* RS variable <1>: User-modified. (line 133) +* ROUNDMODE variable: User-modified. (line 127) +* RS variable <1>: User-modified. (line 132) * RS variable: awk split records. (line 12) * RS variable, multiline records and: Multiple Line. (line 17) * rshift: Bitwise Functions. (line 53) @@ -34002,12 +34002,12 @@ 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 133) +* separators, for records <1>: User-modified. (line 132) * 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 146) +* separators, subscript: User-modified. (line 145) * set breakpoint: Breakpoint Control. (line 11) * set debugger command: Viewing And Changing Data. (line 59) @@ -34139,7 +34139,7 @@ Index * split.awk program: Split Program. (line 30) * sprintf <1>: String Functions. (line 384) * sprintf: OFMT. (line 15) -* sprintf() function, OFMT variable and: User-modified. (line 114) +* sprintf() function, OFMT variable and: User-modified. (line 113) * sprintf() function, print/printf statements and: Round Function. (line 6) * sqrt: Numeric Functions. (line 77) @@ -34201,7 +34201,7 @@ Index (line 43) * sub() function, arguments of: String Functions. (line 463) * sub() function, escape processing: Gory Details. (line 6) -* subscript separators: User-modified. (line 146) +* subscript separators: User-modified. (line 145) * subscripts in arrays, multidimensional: Multidimensional. (line 10) * subscripts in arrays, multidimensional, scanning: Multiscanning. (line 11) @@ -34209,7 +34209,7 @@ Index (line 6) * subscripts in arrays, uninitialized variables as: Uninitialized Subscripts. (line 6) -* SUBSEP variable: User-modified. (line 146) +* SUBSEP variable: User-modified. (line 145) * SUBSEP variable, and multidimensional arrays: Multidimensional. (line 16) * substitute in string: String Functions. (line 90) @@ -34248,7 +34248,7 @@ Index * text, printing: Print. (line 22) * text, printing, unduplicated lines of: Uniq Program. (line 6) * TEXTDOMAIN variable <1>: Programmer i18n. (line 8) -* TEXTDOMAIN variable: User-modified. (line 152) +* TEXTDOMAIN variable: User-modified. (line 151) * 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) @@ -34687,360 +34687,360 @@ Node: Nextfile Statement426761 Node: Exit Statement429389 Node: Built-in Variables431800 Node: User-modified432933 -Ref: User-modified-Footnote-1440636 -Node: Auto-set440698 -Ref: Auto-set-Footnote-1453750 -Ref: Auto-set-Footnote-2453955 -Node: ARGC and ARGV454011 -Node: Pattern Action Summary458229 -Node: Arrays460662 -Node: Array Basics461991 -Node: Array Intro462835 -Ref: figure-array-elements464769 -Ref: Array Intro-Footnote-1467389 -Node: Reference to Elements467517 -Node: Assigning Elements469979 -Node: Array Example470470 -Node: Scanning an Array472229 -Node: Controlling Scanning475249 -Ref: Controlling Scanning-Footnote-1480643 -Node: Numeric Array Subscripts480959 -Node: Uninitialized Subscripts483144 -Node: Delete484761 -Ref: Delete-Footnote-1487510 -Node: Multidimensional487567 -Node: Multiscanning490664 -Node: Arrays of Arrays492253 -Node: Arrays Summary497007 -Node: Functions499098 -Node: Built-in500137 -Node: Calling Built-in501215 -Node: Numeric Functions503210 -Ref: Numeric Functions-Footnote-1507226 -Ref: Numeric Functions-Footnote-2507583 -Ref: Numeric Functions-Footnote-3507631 -Node: String Functions507903 -Ref: String Functions-Footnote-1531404 -Ref: String Functions-Footnote-2531533 -Ref: String Functions-Footnote-3531781 -Node: Gory Details531868 -Ref: table-sub-escapes533649 -Ref: table-sub-proposed535164 -Ref: table-posix-sub536526 -Ref: table-gensub-escapes538063 -Ref: Gory Details-Footnote-1538896 -Node: I/O Functions539047 -Ref: I/O Functions-Footnote-1546283 -Node: Time Functions546430 -Ref: Time Functions-Footnote-1556939 -Ref: Time Functions-Footnote-2557007 -Ref: Time Functions-Footnote-3557165 -Ref: Time Functions-Footnote-4557276 -Ref: Time Functions-Footnote-5557388 -Ref: Time Functions-Footnote-6557615 -Node: Bitwise Functions557881 -Ref: table-bitwise-ops558443 -Ref: Bitwise Functions-Footnote-1562771 -Node: Type Functions562943 -Node: I18N Functions564095 -Node: User-defined565742 -Node: Definition Syntax566547 -Ref: Definition Syntax-Footnote-1572206 -Node: Function Example572277 -Ref: Function Example-Footnote-1575198 -Node: Function Caveats575220 -Node: Calling A Function575738 -Node: Variable Scope576696 -Node: Pass By Value/Reference579689 -Node: Return Statement583186 -Node: Dynamic Typing586165 -Node: Indirect Calls587094 -Ref: Indirect Calls-Footnote-1598400 -Node: Functions Summary598528 -Node: Library Functions601230 -Ref: Library Functions-Footnote-1604838 -Ref: Library Functions-Footnote-2604981 -Node: Library Names605152 -Ref: Library Names-Footnote-1608610 -Ref: Library Names-Footnote-2608833 -Node: General Functions608919 -Node: Strtonum Function610022 -Node: Assert Function613044 -Node: Round Function616368 -Node: Cliff Random Function617909 -Node: Ordinal Functions618925 -Ref: Ordinal Functions-Footnote-1621988 -Ref: Ordinal Functions-Footnote-2622240 -Node: Join Function622451 -Ref: Join Function-Footnote-1624221 -Node: Getlocaltime Function624421 -Node: Readfile Function628165 -Node: Shell Quoting630137 -Node: Data File Management631538 -Node: Filetrans Function632170 -Node: Rewind Function636266 -Node: File Checking637652 -Ref: File Checking-Footnote-1638985 -Node: Empty Files639186 -Node: Ignoring Assigns641165 -Node: Getopt Function642715 -Ref: Getopt Function-Footnote-1654179 -Node: Passwd Functions654379 -Ref: Passwd Functions-Footnote-1663219 -Node: Group Functions663307 -Ref: Group Functions-Footnote-1671204 -Node: Walking Arrays671409 -Node: Library Functions Summary673009 -Node: Library Exercises674413 -Node: Sample Programs675693 -Node: Running Examples676463 -Node: Clones677191 -Node: Cut Program678415 -Node: Egrep Program688135 -Ref: Egrep Program-Footnote-1695638 -Node: Id Program695748 -Node: Split Program699424 -Ref: Split Program-Footnote-1702878 -Node: Tee Program703006 -Node: Uniq Program705795 -Node: Wc Program713214 -Ref: Wc Program-Footnote-1717464 -Node: Miscellaneous Programs717558 -Node: Dupword Program718771 -Node: Alarm Program720802 -Node: Translate Program725607 -Ref: Translate Program-Footnote-1730170 -Node: Labels Program730440 -Ref: Labels Program-Footnote-1733791 -Node: Word Sorting733875 -Node: History Sorting737945 -Node: Extract Program739780 -Node: Simple Sed747304 -Node: Igawk Program750374 -Ref: Igawk Program-Footnote-1764700 -Ref: Igawk Program-Footnote-2764901 -Ref: Igawk Program-Footnote-3765023 -Node: Anagram Program765138 -Node: Signature Program768199 -Node: Programs Summary769446 -Node: Programs Exercises770667 -Ref: Programs Exercises-Footnote-1774798 -Node: Advanced Features774889 -Node: Nondecimal Data776871 -Node: Array Sorting778461 -Node: Controlling Array Traversal779161 -Ref: Controlling Array Traversal-Footnote-1787527 -Node: Array Sorting Functions787645 -Ref: Array Sorting Functions-Footnote-1791531 -Node: Two-way I/O791727 -Ref: Two-way I/O-Footnote-1796672 -Ref: Two-way I/O-Footnote-2796858 -Node: TCP/IP Networking796940 -Node: Profiling799812 -Node: Advanced Features Summary807353 -Node: Internationalization809286 -Node: I18N and L10N810766 -Node: Explaining gettext811452 -Ref: Explaining gettext-Footnote-1816477 -Ref: Explaining gettext-Footnote-2816661 -Node: Programmer i18n816826 -Ref: Programmer i18n-Footnote-1821702 -Node: Translator i18n821751 -Node: String Extraction822545 -Ref: String Extraction-Footnote-1823676 -Node: Printf Ordering823762 -Ref: Printf Ordering-Footnote-1826548 -Node: I18N Portability826612 -Ref: I18N Portability-Footnote-1829068 -Node: I18N Example829131 -Ref: I18N Example-Footnote-1831934 -Node: Gawk I18N832006 -Node: I18N Summary832650 -Node: Debugger833990 -Node: Debugging835012 -Node: Debugging Concepts835453 -Node: Debugging Terms837263 -Node: Awk Debugging839835 -Node: Sample Debugging Session840741 -Node: Debugger Invocation841275 -Node: Finding The Bug842660 -Node: List of Debugger Commands849139 -Node: Breakpoint Control850471 -Node: Debugger Execution Control854148 -Node: Viewing And Changing Data857507 -Node: Execution Stack860883 -Node: Debugger Info862518 -Node: Miscellaneous Debugger Commands866563 -Node: Readline Support871564 -Node: Limitations872458 -Node: Debugging Summary874573 -Node: Arbitrary Precision Arithmetic875747 -Node: Computer Arithmetic877163 -Ref: table-numeric-ranges880762 -Ref: Computer Arithmetic-Footnote-1881286 -Node: Math Definitions881343 -Ref: table-ieee-formats884638 -Ref: Math Definitions-Footnote-1885242 -Node: MPFR features885347 -Node: FP Math Caution887018 -Ref: FP Math Caution-Footnote-1888068 -Node: Inexactness of computations888437 -Node: Inexact representation889396 -Node: Comparing FP Values890754 -Node: Errors accumulate891836 -Node: Getting Accuracy893268 -Node: Try To Round895972 -Node: Setting precision896871 -Ref: table-predefined-precision-strings897555 -Node: Setting the rounding mode899384 -Ref: table-gawk-rounding-modes899748 -Ref: Setting the rounding mode-Footnote-1903200 -Node: Arbitrary Precision Integers903379 -Ref: Arbitrary Precision Integers-Footnote-1906363 -Node: POSIX Floating Point Problems906512 -Ref: POSIX Floating Point Problems-Footnote-1910391 -Node: Floating point summary910429 -Node: Dynamic Extensions912625 -Node: Extension Intro914177 -Node: Plugin License915442 -Node: Extension Mechanism Outline916239 -Ref: figure-load-extension916667 -Ref: figure-register-new-function918147 -Ref: figure-call-new-function919151 -Node: Extension API Description921138 -Node: Extension API Functions Introduction922588 -Node: General Data Types927409 -Ref: General Data Types-Footnote-1933309 -Node: Memory Allocation Functions933608 -Ref: Memory Allocation Functions-Footnote-1936447 -Node: Constructor Functions936546 -Node: Registration Functions938285 -Node: Extension Functions938970 -Node: Exit Callback Functions941267 -Node: Extension Version String942515 -Node: Input Parsers943178 -Node: Output Wrappers953053 -Node: Two-way processors957566 -Node: Printing Messages959829 -Ref: Printing Messages-Footnote-1960905 -Node: Updating `ERRNO'961057 -Node: Requesting Values961797 -Ref: table-value-types-returned962524 -Node: Accessing Parameters963481 -Node: Symbol Table Access964715 -Node: Symbol table by name965229 -Node: Symbol table by cookie967249 -Ref: Symbol table by cookie-Footnote-1971394 -Node: Cached values971457 -Ref: Cached values-Footnote-1974953 -Node: Array Manipulation975044 -Ref: Array Manipulation-Footnote-1976142 -Node: Array Data Types976179 -Ref: Array Data Types-Footnote-1978834 -Node: Array Functions978926 -Node: Flattening Arrays982785 -Node: Creating Arrays989687 -Node: Extension API Variables994458 -Node: Extension Versioning995094 -Node: Extension API Informational Variables996985 -Node: Extension API Boilerplate998050 -Node: Finding Extensions1001859 -Node: Extension Example1002419 -Node: Internal File Description1003191 -Node: Internal File Ops1007258 -Ref: Internal File Ops-Footnote-11019009 -Node: Using Internal File Ops1019149 -Ref: Using Internal File Ops-Footnote-11021532 -Node: Extension Samples1021805 -Node: Extension Sample File Functions1023333 -Node: Extension Sample Fnmatch1031014 -Node: Extension Sample Fork1032502 -Node: Extension Sample Inplace1033717 -Node: Extension Sample Ord1035393 -Node: Extension Sample Readdir1036229 -Ref: table-readdir-file-types1037106 -Node: Extension Sample Revout1037917 -Node: Extension Sample Rev2way1038506 -Node: Extension Sample Read write array1039246 -Node: Extension Sample Readfile1041186 -Node: Extension Sample Time1042281 -Node: Extension Sample API Tests1043629 -Node: gawkextlib1044120 -Node: Extension summary1046798 -Node: Extension Exercises1050487 -Node: Language History1051209 -Node: V7/SVR3.11052865 -Node: SVR41055018 -Node: POSIX1056452 -Node: BTL1057833 -Node: POSIX/GNU1058564 -Node: Feature History1064085 -Node: Common Extensions1077183 -Node: Ranges and Locales1078555 -Ref: Ranges and Locales-Footnote-11083174 -Ref: Ranges and Locales-Footnote-21083201 -Ref: Ranges and Locales-Footnote-31083436 -Node: Contributors1083657 -Node: History summary1089197 -Node: Installation1090576 -Node: Gawk Distribution1091522 -Node: Getting1092006 -Node: Extracting1092829 -Node: Distribution contents1094466 -Node: Unix Installation1100220 -Node: Quick Installation1100837 -Node: Additional Configuration Options1103261 -Node: Configuration Philosophy1105064 -Node: Non-Unix Installation1107433 -Node: PC Installation1107891 -Node: PC Binary Installation1109211 -Node: PC Compiling1111059 -Ref: PC Compiling-Footnote-11114080 -Node: PC Testing1114189 -Node: PC Using1115365 -Node: Cygwin1119480 -Node: MSYS1120250 -Node: VMS Installation1120751 -Node: VMS Compilation1121543 -Ref: VMS Compilation-Footnote-11122772 -Node: VMS Dynamic Extensions1122830 -Node: VMS Installation Details1124514 -Node: VMS Running1126765 -Node: VMS GNV1129605 -Node: VMS Old Gawk1130340 -Node: Bugs1130810 -Node: Other Versions1134699 -Node: Installation summary1141133 -Node: Notes1142192 -Node: Compatibility Mode1143057 -Node: Additions1143839 -Node: Accessing The Source1144764 -Node: Adding Code1146199 -Node: New Ports1152356 -Node: Derived Files1156838 -Ref: Derived Files-Footnote-11162313 -Ref: Derived Files-Footnote-21162347 -Ref: Derived Files-Footnote-31162943 -Node: Future Extensions1163057 -Node: Implementation Limitations1163663 -Node: Extension Design1164911 -Node: Old Extension Problems1166065 -Ref: Old Extension Problems-Footnote-11167582 -Node: Extension New Mechanism Goals1167639 -Ref: Extension New Mechanism Goals-Footnote-11170999 -Node: Extension Other Design Decisions1171188 -Node: Extension Future Growth1173296 -Node: Old Extension Mechanism1174132 -Node: Notes summary1175894 -Node: Basic Concepts1177080 -Node: Basic High Level1177761 -Ref: figure-general-flow1178033 -Ref: figure-process-flow1178632 -Ref: Basic High Level-Footnote-11181861 -Node: Basic Data Typing1182046 -Node: Glossary1185374 -Node: Copying1217303 -Node: GNU Free Documentation License1254859 -Node: Index1279995 +Ref: User-modified-Footnote-1440567 +Node: Auto-set440629 +Ref: Auto-set-Footnote-1453681 +Ref: Auto-set-Footnote-2453886 +Node: ARGC and ARGV453942 +Node: Pattern Action Summary458160 +Node: Arrays460593 +Node: Array Basics461922 +Node: Array Intro462766 +Ref: figure-array-elements464700 +Ref: Array Intro-Footnote-1467320 +Node: Reference to Elements467448 +Node: Assigning Elements469910 +Node: Array Example470401 +Node: Scanning an Array472160 +Node: Controlling Scanning475180 +Ref: Controlling Scanning-Footnote-1480574 +Node: Numeric Array Subscripts480890 +Node: Uninitialized Subscripts483075 +Node: Delete484692 +Ref: Delete-Footnote-1487441 +Node: Multidimensional487498 +Node: Multiscanning490595 +Node: Arrays of Arrays492184 +Node: Arrays Summary496938 +Node: Functions499029 +Node: Built-in500068 +Node: Calling Built-in501146 +Node: Numeric Functions503141 +Ref: Numeric Functions-Footnote-1507157 +Ref: Numeric Functions-Footnote-2507514 +Ref: Numeric Functions-Footnote-3507562 +Node: String Functions507834 +Ref: String Functions-Footnote-1531335 +Ref: String Functions-Footnote-2531464 +Ref: String Functions-Footnote-3531712 +Node: Gory Details531799 +Ref: table-sub-escapes533580 +Ref: table-sub-proposed535095 +Ref: table-posix-sub536457 +Ref: table-gensub-escapes537994 +Ref: Gory Details-Footnote-1538827 +Node: I/O Functions538978 +Ref: I/O Functions-Footnote-1546214 +Node: Time Functions546361 +Ref: Time Functions-Footnote-1556870 +Ref: Time Functions-Footnote-2556938 +Ref: Time Functions-Footnote-3557096 +Ref: Time Functions-Footnote-4557207 +Ref: Time Functions-Footnote-5557319 +Ref: Time Functions-Footnote-6557546 +Node: Bitwise Functions557812 +Ref: table-bitwise-ops558374 +Ref: Bitwise Functions-Footnote-1562702 +Node: Type Functions562874 +Node: I18N Functions564026 +Node: User-defined565673 +Node: Definition Syntax566478 +Ref: Definition Syntax-Footnote-1572137 +Node: Function Example572208 +Ref: Function Example-Footnote-1575129 +Node: Function Caveats575151 +Node: Calling A Function575669 +Node: Variable Scope576627 +Node: Pass By Value/Reference579620 +Node: Return Statement583117 +Node: Dynamic Typing586096 +Node: Indirect Calls587025 +Ref: Indirect Calls-Footnote-1596890 +Node: Functions Summary597018 +Node: Library Functions599720 +Ref: Library Functions-Footnote-1603328 +Ref: Library Functions-Footnote-2603471 +Node: Library Names603642 +Ref: Library Names-Footnote-1607100 +Ref: Library Names-Footnote-2607323 +Node: General Functions607409 +Node: Strtonum Function608512 +Node: Assert Function611534 +Node: Round Function614858 +Node: Cliff Random Function616399 +Node: Ordinal Functions617415 +Ref: Ordinal Functions-Footnote-1620478 +Ref: Ordinal Functions-Footnote-2620730 +Node: Join Function620941 +Ref: Join Function-Footnote-1622711 +Node: Getlocaltime Function622911 +Node: Readfile Function626655 +Node: Shell Quoting628627 +Node: Data File Management630028 +Node: Filetrans Function630660 +Node: Rewind Function634756 +Node: File Checking636142 +Ref: File Checking-Footnote-1637475 +Node: Empty Files637676 +Node: Ignoring Assigns639655 +Node: Getopt Function641205 +Ref: Getopt Function-Footnote-1652669 +Node: Passwd Functions652869 +Ref: Passwd Functions-Footnote-1661709 +Node: Group Functions661797 +Ref: Group Functions-Footnote-1669694 +Node: Walking Arrays669899 +Node: Library Functions Summary672905 +Node: Library Exercises674307 +Node: Sample Programs675587 +Node: Running Examples676357 +Node: Clones677085 +Node: Cut Program678309 +Node: Egrep Program688029 +Ref: Egrep Program-Footnote-1695532 +Node: Id Program695642 +Node: Split Program699318 +Ref: Split Program-Footnote-1702772 +Node: Tee Program702900 +Node: Uniq Program705689 +Node: Wc Program713108 +Ref: Wc Program-Footnote-1717358 +Node: Miscellaneous Programs717452 +Node: Dupword Program718665 +Node: Alarm Program720696 +Node: Translate Program725501 +Ref: Translate Program-Footnote-1730064 +Node: Labels Program730334 +Ref: Labels Program-Footnote-1733685 +Node: Word Sorting733769 +Node: History Sorting737839 +Node: Extract Program739674 +Node: Simple Sed747198 +Node: Igawk Program750268 +Ref: Igawk Program-Footnote-1764594 +Ref: Igawk Program-Footnote-2764795 +Ref: Igawk Program-Footnote-3764917 +Node: Anagram Program765032 +Node: Signature Program768093 +Node: Programs Summary769340 +Node: Programs Exercises770561 +Ref: Programs Exercises-Footnote-1774692 +Node: Advanced Features774783 +Node: Nondecimal Data776765 +Node: Array Sorting778355 +Node: Controlling Array Traversal779055 +Ref: Controlling Array Traversal-Footnote-1787421 +Node: Array Sorting Functions787539 +Ref: Array Sorting Functions-Footnote-1791425 +Node: Two-way I/O791621 +Ref: Two-way I/O-Footnote-1796566 +Ref: Two-way I/O-Footnote-2796752 +Node: TCP/IP Networking796834 +Node: Profiling799706 +Node: Advanced Features Summary807247 +Node: Internationalization809180 +Node: I18N and L10N810660 +Node: Explaining gettext811346 +Ref: Explaining gettext-Footnote-1816371 +Ref: Explaining gettext-Footnote-2816555 +Node: Programmer i18n816720 +Ref: Programmer i18n-Footnote-1821596 +Node: Translator i18n821645 +Node: String Extraction822439 +Ref: String Extraction-Footnote-1823570 +Node: Printf Ordering823656 +Ref: Printf Ordering-Footnote-1826442 +Node: I18N Portability826506 +Ref: I18N Portability-Footnote-1828962 +Node: I18N Example829025 +Ref: I18N Example-Footnote-1831828 +Node: Gawk I18N831900 +Node: I18N Summary832544 +Node: Debugger833884 +Node: Debugging834906 +Node: Debugging Concepts835347 +Node: Debugging Terms837157 +Node: Awk Debugging839729 +Node: Sample Debugging Session840635 +Node: Debugger Invocation841169 +Node: Finding The Bug842554 +Node: List of Debugger Commands849033 +Node: Breakpoint Control850365 +Node: Debugger Execution Control854042 +Node: Viewing And Changing Data857401 +Node: Execution Stack860777 +Node: Debugger Info862412 +Node: Miscellaneous Debugger Commands866457 +Node: Readline Support871458 +Node: Limitations872352 +Node: Debugging Summary874467 +Node: Arbitrary Precision Arithmetic875641 +Node: Computer Arithmetic877057 +Ref: table-numeric-ranges880656 +Ref: Computer Arithmetic-Footnote-1881180 +Node: Math Definitions881237 +Ref: table-ieee-formats884532 +Ref: Math Definitions-Footnote-1885136 +Node: MPFR features885241 +Node: FP Math Caution886912 +Ref: FP Math Caution-Footnote-1887962 +Node: Inexactness of computations888331 +Node: Inexact representation889290 +Node: Comparing FP Values890648 +Node: Errors accumulate891730 +Node: Getting Accuracy893162 +Node: Try To Round895866 +Node: Setting precision896765 +Ref: table-predefined-precision-strings897449 +Node: Setting the rounding mode899278 +Ref: table-gawk-rounding-modes899642 +Ref: Setting the rounding mode-Footnote-1903094 +Node: Arbitrary Precision Integers903273 +Ref: Arbitrary Precision Integers-Footnote-1906257 +Node: POSIX Floating Point Problems906406 +Ref: POSIX Floating Point Problems-Footnote-1910285 +Node: Floating point summary910323 +Node: Dynamic Extensions912519 +Node: Extension Intro914071 +Node: Plugin License915336 +Node: Extension Mechanism Outline916133 +Ref: figure-load-extension916561 +Ref: figure-register-new-function918041 +Ref: figure-call-new-function919045 +Node: Extension API Description921032 +Node: Extension API Functions Introduction922482 +Node: General Data Types927303 +Ref: General Data Types-Footnote-1933203 +Node: Memory Allocation Functions933502 +Ref: Memory Allocation Functions-Footnote-1936341 +Node: Constructor Functions936440 +Node: Registration Functions938179 +Node: Extension Functions938864 +Node: Exit Callback Functions941161 +Node: Extension Version String942409 +Node: Input Parsers943072 +Node: Output Wrappers952947 +Node: Two-way processors957460 +Node: Printing Messages959723 +Ref: Printing Messages-Footnote-1960799 +Node: Updating `ERRNO'960951 +Node: Requesting Values961691 +Ref: table-value-types-returned962418 +Node: Accessing Parameters963375 +Node: Symbol Table Access964609 +Node: Symbol table by name965123 +Node: Symbol table by cookie967143 +Ref: Symbol table by cookie-Footnote-1971288 +Node: Cached values971351 +Ref: Cached values-Footnote-1974847 +Node: Array Manipulation974938 +Ref: Array Manipulation-Footnote-1976036 +Node: Array Data Types976073 +Ref: Array Data Types-Footnote-1978728 +Node: Array Functions978820 +Node: Flattening Arrays982679 +Node: Creating Arrays989581 +Node: Extension API Variables994352 +Node: Extension Versioning994988 +Node: Extension API Informational Variables996879 +Node: Extension API Boilerplate997944 +Node: Finding Extensions1001753 +Node: Extension Example1002313 +Node: Internal File Description1003085 +Node: Internal File Ops1007152 +Ref: Internal File Ops-Footnote-11018903 +Node: Using Internal File Ops1019043 +Ref: Using Internal File Ops-Footnote-11021426 +Node: Extension Samples1021699 +Node: Extension Sample File Functions1023227 +Node: Extension Sample Fnmatch1030908 +Node: Extension Sample Fork1032396 +Node: Extension Sample Inplace1033611 +Node: Extension Sample Ord1035287 +Node: Extension Sample Readdir1036123 +Ref: table-readdir-file-types1037000 +Node: Extension Sample Revout1037811 +Node: Extension Sample Rev2way1038400 +Node: Extension Sample Read write array1039140 +Node: Extension Sample Readfile1041080 +Node: Extension Sample Time1042175 +Node: Extension Sample API Tests1043523 +Node: gawkextlib1044014 +Node: Extension summary1046692 +Node: Extension Exercises1050381 +Node: Language History1051103 +Node: V7/SVR3.11052759 +Node: SVR41054912 +Node: POSIX1056346 +Node: BTL1057727 +Node: POSIX/GNU1058458 +Node: Feature History1063979 +Node: Common Extensions1077077 +Node: Ranges and Locales1078449 +Ref: Ranges and Locales-Footnote-11083068 +Ref: Ranges and Locales-Footnote-21083095 +Ref: Ranges and Locales-Footnote-31083330 +Node: Contributors1083551 +Node: History summary1089091 +Node: Installation1090470 +Node: Gawk Distribution1091416 +Node: Getting1091900 +Node: Extracting1092723 +Node: Distribution contents1094360 +Node: Unix Installation1100114 +Node: Quick Installation1100731 +Node: Additional Configuration Options1103155 +Node: Configuration Philosophy1104958 +Node: Non-Unix Installation1107327 +Node: PC Installation1107785 +Node: PC Binary Installation1109105 +Node: PC Compiling1110953 +Ref: PC Compiling-Footnote-11113974 +Node: PC Testing1114083 +Node: PC Using1115259 +Node: Cygwin1119374 +Node: MSYS1120144 +Node: VMS Installation1120645 +Node: VMS Compilation1121437 +Ref: VMS Compilation-Footnote-11122666 +Node: VMS Dynamic Extensions1122724 +Node: VMS Installation Details1124408 +Node: VMS Running1126659 +Node: VMS GNV1129499 +Node: VMS Old Gawk1130234 +Node: Bugs1130704 +Node: Other Versions1134593 +Node: Installation summary1141027 +Node: Notes1142086 +Node: Compatibility Mode1142951 +Node: Additions1143733 +Node: Accessing The Source1144658 +Node: Adding Code1146093 +Node: New Ports1152250 +Node: Derived Files1156732 +Ref: Derived Files-Footnote-11162207 +Ref: Derived Files-Footnote-21162241 +Ref: Derived Files-Footnote-31162837 +Node: Future Extensions1162951 +Node: Implementation Limitations1163557 +Node: Extension Design1164805 +Node: Old Extension Problems1165959 +Ref: Old Extension Problems-Footnote-11167476 +Node: Extension New Mechanism Goals1167533 +Ref: Extension New Mechanism Goals-Footnote-11170893 +Node: Extension Other Design Decisions1171082 +Node: Extension Future Growth1173190 +Node: Old Extension Mechanism1174026 +Node: Notes summary1175788 +Node: Basic Concepts1176974 +Node: Basic High Level1177655 +Ref: figure-general-flow1177927 +Ref: figure-process-flow1178526 +Ref: Basic High Level-Footnote-11181755 +Node: Basic Data Typing1181940 +Node: Glossary1185268 +Node: Copying1217197 +Node: GNU Free Documentation License1254753 +Node: Index1279889  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index a04cef48..2c0bf958 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -14591,12 +14591,13 @@ 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 -matching with @samp{~} and @samp{!~}, as well as the @code{gensub()}, -@code{gsub()}, @code{index()}, @code{match()}, @code{patsplit()}, -@code{split()}, and @code{sub()} -functions, record termination with @code{RS}, and field splitting with -@code{FS} and @code{FPAT}, all ignore case when doing their particular regexp operations. +and all regular expression matching are case-independent. +This applies to +regexp matching with @samp{~} and @samp{!~}, +the @code{gensub()}, @code{gsub()}, @code{index()}, @code{match()}, +@code{patsplit()}, @code{split()}, and @code{sub()} functions, +record termination with @code{RS}, and field splitting with +@code{FS} and @code{FPAT}. However, the value of @code{IGNORECASE} does @emph{not} affect array subscripting and it does not affect field splitting when using a single-character field separator. @@ -20326,67 +20327,7 @@ $ @kbd{gawk -f quicksort.awk -f indirectcall.awk class_data2} @end example Another example where indirect functions calls are useful can be found in -processing arrays. @DBREF{Walking Arrays} presented a simple function -for ``walking'' an array of arrays. That function simply printed the -name and value of each scalar array element. However, it is easy to -generalize that function, by passing in the name of a function to call -when walking an array. The modified function looks like this: - -@example -@c file eg/lib/processarray.awk -function process_array(arr, name, process, do_arrays, i, new_name) -@{ - for (i in arr) @{ - new_name = (name "[" i "]") - if (isarray(arr[i])) @{ - if (do_arrays) - @@process(new_name, arr[i]) - process_array(arr[i], new_name, process, do_arrays) - @} else - @@process(new_name, arr[i]) - @} -@} -@c endfile -@end example - -The arguments are as follows: - -@table @code -@item arr -The array. - -@item name -The name of the array (a string). - -@item process -The name of the function to call. - -@item do_arrays -If this is true, the function can handle elements that are subarrays. -@end table - -If subarrays are to be processed, that is done before walking them further. - -When run with the following scaffolding, the function produces the same -results as does the earlier @code{walk_array()} function: - -@example -BEGIN @{ - a[1] = 1 - a[2][1] = 21 - a[2][2] = 22 - a[3] = 3 - a[4][1][1] = 411 - a[4][2] = 42 - - process_array(a, "a", "do_print", 0) -@} - -function do_print(name, element) -@{ - printf "%s = %s\n", name, element -@} -@end example +processing arrays. This is described in @ref{Walking Arrays}. Remember that you must supply a leading @samp{@@} in front of an indirect function call. @@ -23017,6 +22958,66 @@ $ @kbd{gawk -f walk_array.awk} @print{} a[4][2] = 42 @end example +The function just presented simply prints the +name and value of each scalar array element. However, it is easy to +generalize it, by passing in the name of a function to call +when walking an array. The modified function looks like this: + +@example +@c file eg/lib/processarray.awk +function process_array(arr, name, process, do_arrays, i, new_name) +@{ + for (i in arr) @{ + new_name = (name "[" i "]") + if (isarray(arr[i])) @{ + if (do_arrays) + @@process(new_name, arr[i]) + process_array(arr[i], new_name, process, do_arrays) + @} else + @@process(new_name, arr[i]) + @} +@} +@c endfile +@end example + +The arguments are as follows: + +@table @code +@item arr +The array. + +@item name +The name of the array (a string). + +@item process +The name of the function to call. + +@item do_arrays +If this is true, the function can handle elements that are subarrays. +@end table + +If subarrays are to be processed, that is done before walking them further. + +When run with the following scaffolding, the function produces the same +results as does the earlier version of @code{walk_array()}: + +@example +BEGIN @{ + a[1] = 1 + a[2][1] = 21 + a[2][2] = 22 + a[3] = 3 + a[4][1][1] = 411 + a[4][2] = 42 + + process_array(a, "a", "do_print", 0) +@} + +function do_print(name, element) +@{ + printf "%s = %s\n", name, element +@} +@end example @node Library Functions Summary @section Summary @@ -23055,7 +23056,7 @@ An @command{awk} version of the standard C @code{getopt()} function Two sets of routines that parallel the C library versions @item Traversing arrays of arrays -A simple function to traverse an array of arrays to any depth +Two functions that traverse an array of arrays to any depth @end table @c end nested list diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 1a5be1b8..7c13dcb1 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -13919,12 +13919,13 @@ 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 -matching with @samp{~} and @samp{!~}, as well as the @code{gensub()}, -@code{gsub()}, @code{index()}, @code{match()}, @code{patsplit()}, -@code{split()}, and @code{sub()} -functions, record termination with @code{RS}, and field splitting with -@code{FS} and @code{FPAT}, all ignore case when doing their particular regexp operations. +and all regular expression matching are case-independent. +This applies to +regexp matching with @samp{~} and @samp{!~}, +the @code{gensub()}, @code{gsub()}, @code{index()}, @code{match()}, +@code{patsplit()}, @code{split()}, and @code{sub()} functions, +record termination with @code{RS}, and field splitting with +@code{FS} and @code{FPAT}. However, the value of @code{IGNORECASE} does @emph{not} affect array subscripting and it does not affect field splitting when using a single-character field separator. @@ -19447,67 +19448,7 @@ $ @kbd{gawk -f quicksort.awk -f indirectcall.awk class_data2} @end example Another example where indirect functions calls are useful can be found in -processing arrays. @DBREF{Walking Arrays} presented a simple function -for ``walking'' an array of arrays. That function simply printed the -name and value of each scalar array element. However, it is easy to -generalize that function, by passing in the name of a function to call -when walking an array. The modified function looks like this: - -@example -@c file eg/lib/processarray.awk -function process_array(arr, name, process, do_arrays, i, new_name) -@{ - for (i in arr) @{ - new_name = (name "[" i "]") - if (isarray(arr[i])) @{ - if (do_arrays) - @@process(new_name, arr[i]) - process_array(arr[i], new_name, process, do_arrays) - @} else - @@process(new_name, arr[i]) - @} -@} -@c endfile -@end example - -The arguments are as follows: - -@table @code -@item arr -The array. - -@item name -The name of the array (a string). - -@item process -The name of the function to call. - -@item do_arrays -If this is true, the function can handle elements that are subarrays. -@end table - -If subarrays are to be processed, that is done before walking them further. - -When run with the following scaffolding, the function produces the same -results as does the earlier @code{walk_array()} function: - -@example -BEGIN @{ - a[1] = 1 - a[2][1] = 21 - a[2][2] = 22 - a[3] = 3 - a[4][1][1] = 411 - a[4][2] = 42 - - process_array(a, "a", "do_print", 0) -@} - -function do_print(name, element) -@{ - printf "%s = %s\n", name, element -@} -@end example +processing arrays. This is described in @ref{Walking Arrays}. Remember that you must supply a leading @samp{@@} in front of an indirect function call. @@ -22108,6 +22049,66 @@ $ @kbd{gawk -f walk_array.awk} @print{} a[4][2] = 42 @end example +The function just presented simply prints the +name and value of each scalar array element. However, it is easy to +generalize it, by passing in the name of a function to call +when walking an array. The modified function looks like this: + +@example +@c file eg/lib/processarray.awk +function process_array(arr, name, process, do_arrays, i, new_name) +@{ + for (i in arr) @{ + new_name = (name "[" i "]") + if (isarray(arr[i])) @{ + if (do_arrays) + @@process(new_name, arr[i]) + process_array(arr[i], new_name, process, do_arrays) + @} else + @@process(new_name, arr[i]) + @} +@} +@c endfile +@end example + +The arguments are as follows: + +@table @code +@item arr +The array. + +@item name +The name of the array (a string). + +@item process +The name of the function to call. + +@item do_arrays +If this is true, the function can handle elements that are subarrays. +@end table + +If subarrays are to be processed, that is done before walking them further. + +When run with the following scaffolding, the function produces the same +results as does the earlier version of @code{walk_array()}: + +@example +BEGIN @{ + a[1] = 1 + a[2][1] = 21 + a[2][2] = 22 + a[3] = 3 + a[4][1][1] = 411 + a[4][2] = 42 + + process_array(a, "a", "do_print", 0) +@} + +function do_print(name, element) +@{ + printf "%s = %s\n", name, element +@} +@end example @node Library Functions Summary @section Summary @@ -22146,7 +22147,7 @@ An @command{awk} version of the standard C @code{getopt()} function Two sets of routines that parallel the C library versions @item Traversing arrays of arrays -A simple function to traverse an array of arrays to any depth +Two functions that traverse an array of arrays to any depth @end table @c end nested list -- cgit v1.2.3 From 4c4c0d3820bfc6ac3dce47a51e26ee2a9b593466 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 20 Feb 2015 14:10:36 +0200 Subject: Last review items! --- doc/ChangeLog | 4 + doc/gawk.info | 304 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 74 +++++++------- doc/gawktexi.in | 74 +++++++------- 4 files changed, 236 insertions(+), 220 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 42508ab1..619ceb06 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-20 Arnold D. Robbins + + * gawktexi.in: More O'Reilly fixes. I think it's done! + 2015-02-19 Arnold D. Robbins * gawktexi.in: More O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index 717e6659..50627888 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -1873,7 +1873,7 @@ file surrounded by double quotes:  File: gawk.info, Node: Sample Data Files, Next: Very Simple, Prev: Running gawk, Up: Getting Started -1.2 Data Files for the Examples +1.2 Data files for the Examples =============================== Many of the examples in this Info file take their input from two sample @@ -6957,7 +6957,7 @@ option (*note Options::).  File: gawk.info, Node: Special Files, Next: Close Files And Pipes, Prev: Special FD, Up: Printing -5.8 Special File Names in `gawk' +5.8 Special File names in `gawk' ================================ Besides access to standard input, standard output, and standard error, @@ -7018,7 +7018,7 @@ mentioned here only for completeness. Full discussion is delayed until  File: gawk.info, Node: Special Caveats, Prev: Special Network, Up: Special Files -5.8.3 Special File Name Caveats +5.8.3 Special File name Caveats ------------------------------- Here are some things to bear in mind when using the special file names @@ -15155,7 +15155,7 @@ three-character string `"\"'\""':  File: gawk.info, Node: Data File Management, Next: Getopt Function, Prev: General Functions, Up: Library Functions -10.3 Data File Management +10.3 Data file Management ========================= This minor node presents functions that are useful for managing @@ -15172,7 +15172,7 @@ command-line data files.  File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Up: Data File Management -10.3.1 Noting Data File Boundaries +10.3.1 Noting Data file Boundaries ---------------------------------- The `BEGIN' and `END' rules are each executed exactly once, at the @@ -15310,7 +15310,7 @@ rule finishes!)  File: gawk.info, Node: File Checking, Next: Empty Files, Prev: Rewind Function, Up: Data File Management -10.3.3 Checking for Readable Data Files +10.3.3 Checking for Readable Data files --------------------------------------- Normally, if you give `awk' a data file that isn't readable, it stops @@ -15400,7 +15400,7 @@ of the `for' loop uses the `<=' operator, not `<'.  File: gawk.info, Node: Ignoring Assigns, Prev: Empty Files, Up: Data File Management -10.3.5 Treating Assignments as File Names +10.3.5 Treating Assignments as File names ----------------------------------------- Occasionally, you might not want `awk' to process command-line variable @@ -22576,9 +22576,9 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob using the GMP library. This is faster and more space-efficient than using MPFR for the same calculations. - * There are several "dark corners" with respect to floating-point - numbers where `gawk' disagrees with the POSIX standard. It pays - to be aware of them. + * There are several areas with respect to floating-point numbers + where `gawk' disagrees with the POSIX standard. It pays to be + aware of them. * Overall, there is no need to be unduly suspicious about the results from floating-point arithmetic. The lesson to remember is @@ -34900,147 +34900,147 @@ Ref: Arbitrary Precision Integers-Footnote-1906257 Node: POSIX Floating Point Problems906406 Ref: POSIX Floating Point Problems-Footnote-1910285 Node: Floating point summary910323 -Node: Dynamic Extensions912519 -Node: Extension Intro914071 -Node: Plugin License915336 -Node: Extension Mechanism Outline916133 -Ref: figure-load-extension916561 -Ref: figure-register-new-function918041 -Ref: figure-call-new-function919045 -Node: Extension API Description921032 -Node: Extension API Functions Introduction922482 -Node: General Data Types927303 -Ref: General Data Types-Footnote-1933203 -Node: Memory Allocation Functions933502 -Ref: Memory Allocation Functions-Footnote-1936341 -Node: Constructor Functions936440 -Node: Registration Functions938179 -Node: Extension Functions938864 -Node: Exit Callback Functions941161 -Node: Extension Version String942409 -Node: Input Parsers943072 -Node: Output Wrappers952947 -Node: Two-way processors957460 -Node: Printing Messages959723 -Ref: Printing Messages-Footnote-1960799 -Node: Updating `ERRNO'960951 -Node: Requesting Values961691 -Ref: table-value-types-returned962418 -Node: Accessing Parameters963375 -Node: Symbol Table Access964609 -Node: Symbol table by name965123 -Node: Symbol table by cookie967143 -Ref: Symbol table by cookie-Footnote-1971288 -Node: Cached values971351 -Ref: Cached values-Footnote-1974847 -Node: Array Manipulation974938 -Ref: Array Manipulation-Footnote-1976036 -Node: Array Data Types976073 -Ref: Array Data Types-Footnote-1978728 -Node: Array Functions978820 -Node: Flattening Arrays982679 -Node: Creating Arrays989581 -Node: Extension API Variables994352 -Node: Extension Versioning994988 -Node: Extension API Informational Variables996879 -Node: Extension API Boilerplate997944 -Node: Finding Extensions1001753 -Node: Extension Example1002313 -Node: Internal File Description1003085 -Node: Internal File Ops1007152 -Ref: Internal File Ops-Footnote-11018903 -Node: Using Internal File Ops1019043 -Ref: Using Internal File Ops-Footnote-11021426 -Node: Extension Samples1021699 -Node: Extension Sample File Functions1023227 -Node: Extension Sample Fnmatch1030908 -Node: Extension Sample Fork1032396 -Node: Extension Sample Inplace1033611 -Node: Extension Sample Ord1035287 -Node: Extension Sample Readdir1036123 -Ref: table-readdir-file-types1037000 -Node: Extension Sample Revout1037811 -Node: Extension Sample Rev2way1038400 -Node: Extension Sample Read write array1039140 -Node: Extension Sample Readfile1041080 -Node: Extension Sample Time1042175 -Node: Extension Sample API Tests1043523 -Node: gawkextlib1044014 -Node: Extension summary1046692 -Node: Extension Exercises1050381 -Node: Language History1051103 -Node: V7/SVR3.11052759 -Node: SVR41054912 -Node: POSIX1056346 -Node: BTL1057727 -Node: POSIX/GNU1058458 -Node: Feature History1063979 -Node: Common Extensions1077077 -Node: Ranges and Locales1078449 -Ref: Ranges and Locales-Footnote-11083068 -Ref: Ranges and Locales-Footnote-21083095 -Ref: Ranges and Locales-Footnote-31083330 -Node: Contributors1083551 -Node: History summary1089091 -Node: Installation1090470 -Node: Gawk Distribution1091416 -Node: Getting1091900 -Node: Extracting1092723 -Node: Distribution contents1094360 -Node: Unix Installation1100114 -Node: Quick Installation1100731 -Node: Additional Configuration Options1103155 -Node: Configuration Philosophy1104958 -Node: Non-Unix Installation1107327 -Node: PC Installation1107785 -Node: PC Binary Installation1109105 -Node: PC Compiling1110953 -Ref: PC Compiling-Footnote-11113974 -Node: PC Testing1114083 -Node: PC Using1115259 -Node: Cygwin1119374 -Node: MSYS1120144 -Node: VMS Installation1120645 -Node: VMS Compilation1121437 -Ref: VMS Compilation-Footnote-11122666 -Node: VMS Dynamic Extensions1122724 -Node: VMS Installation Details1124408 -Node: VMS Running1126659 -Node: VMS GNV1129499 -Node: VMS Old Gawk1130234 -Node: Bugs1130704 -Node: Other Versions1134593 -Node: Installation summary1141027 -Node: Notes1142086 -Node: Compatibility Mode1142951 -Node: Additions1143733 -Node: Accessing The Source1144658 -Node: Adding Code1146093 -Node: New Ports1152250 -Node: Derived Files1156732 -Ref: Derived Files-Footnote-11162207 -Ref: Derived Files-Footnote-21162241 -Ref: Derived Files-Footnote-31162837 -Node: Future Extensions1162951 -Node: Implementation Limitations1163557 -Node: Extension Design1164805 -Node: Old Extension Problems1165959 -Ref: Old Extension Problems-Footnote-11167476 -Node: Extension New Mechanism Goals1167533 -Ref: Extension New Mechanism Goals-Footnote-11170893 -Node: Extension Other Design Decisions1171082 -Node: Extension Future Growth1173190 -Node: Old Extension Mechanism1174026 -Node: Notes summary1175788 -Node: Basic Concepts1176974 -Node: Basic High Level1177655 -Ref: figure-general-flow1177927 -Ref: figure-process-flow1178526 -Ref: Basic High Level-Footnote-11181755 -Node: Basic Data Typing1181940 -Node: Glossary1185268 -Node: Copying1217197 -Node: GNU Free Documentation License1254753 -Node: Index1279889 +Node: Dynamic Extensions912510 +Node: Extension Intro914062 +Node: Plugin License915327 +Node: Extension Mechanism Outline916124 +Ref: figure-load-extension916552 +Ref: figure-register-new-function918032 +Ref: figure-call-new-function919036 +Node: Extension API Description921023 +Node: Extension API Functions Introduction922473 +Node: General Data Types927294 +Ref: General Data Types-Footnote-1933194 +Node: Memory Allocation Functions933493 +Ref: Memory Allocation Functions-Footnote-1936332 +Node: Constructor Functions936431 +Node: Registration Functions938170 +Node: Extension Functions938855 +Node: Exit Callback Functions941152 +Node: Extension Version String942400 +Node: Input Parsers943063 +Node: Output Wrappers952938 +Node: Two-way processors957451 +Node: Printing Messages959714 +Ref: Printing Messages-Footnote-1960790 +Node: Updating `ERRNO'960942 +Node: Requesting Values961682 +Ref: table-value-types-returned962409 +Node: Accessing Parameters963366 +Node: Symbol Table Access964600 +Node: Symbol table by name965114 +Node: Symbol table by cookie967134 +Ref: Symbol table by cookie-Footnote-1971279 +Node: Cached values971342 +Ref: Cached values-Footnote-1974838 +Node: Array Manipulation974929 +Ref: Array Manipulation-Footnote-1976027 +Node: Array Data Types976064 +Ref: Array Data Types-Footnote-1978719 +Node: Array Functions978811 +Node: Flattening Arrays982670 +Node: Creating Arrays989572 +Node: Extension API Variables994343 +Node: Extension Versioning994979 +Node: Extension API Informational Variables996870 +Node: Extension API Boilerplate997935 +Node: Finding Extensions1001744 +Node: Extension Example1002304 +Node: Internal File Description1003076 +Node: Internal File Ops1007143 +Ref: Internal File Ops-Footnote-11018894 +Node: Using Internal File Ops1019034 +Ref: Using Internal File Ops-Footnote-11021417 +Node: Extension Samples1021690 +Node: Extension Sample File Functions1023218 +Node: Extension Sample Fnmatch1030899 +Node: Extension Sample Fork1032387 +Node: Extension Sample Inplace1033602 +Node: Extension Sample Ord1035278 +Node: Extension Sample Readdir1036114 +Ref: table-readdir-file-types1036991 +Node: Extension Sample Revout1037802 +Node: Extension Sample Rev2way1038391 +Node: Extension Sample Read write array1039131 +Node: Extension Sample Readfile1041071 +Node: Extension Sample Time1042166 +Node: Extension Sample API Tests1043514 +Node: gawkextlib1044005 +Node: Extension summary1046683 +Node: Extension Exercises1050372 +Node: Language History1051094 +Node: V7/SVR3.11052750 +Node: SVR41054903 +Node: POSIX1056337 +Node: BTL1057718 +Node: POSIX/GNU1058449 +Node: Feature History1063970 +Node: Common Extensions1077068 +Node: Ranges and Locales1078440 +Ref: Ranges and Locales-Footnote-11083059 +Ref: Ranges and Locales-Footnote-21083086 +Ref: Ranges and Locales-Footnote-31083321 +Node: Contributors1083542 +Node: History summary1089082 +Node: Installation1090461 +Node: Gawk Distribution1091407 +Node: Getting1091891 +Node: Extracting1092714 +Node: Distribution contents1094351 +Node: Unix Installation1100105 +Node: Quick Installation1100722 +Node: Additional Configuration Options1103146 +Node: Configuration Philosophy1104949 +Node: Non-Unix Installation1107318 +Node: PC Installation1107776 +Node: PC Binary Installation1109096 +Node: PC Compiling1110944 +Ref: PC Compiling-Footnote-11113965 +Node: PC Testing1114074 +Node: PC Using1115250 +Node: Cygwin1119365 +Node: MSYS1120135 +Node: VMS Installation1120636 +Node: VMS Compilation1121428 +Ref: VMS Compilation-Footnote-11122657 +Node: VMS Dynamic Extensions1122715 +Node: VMS Installation Details1124399 +Node: VMS Running1126650 +Node: VMS GNV1129490 +Node: VMS Old Gawk1130225 +Node: Bugs1130695 +Node: Other Versions1134584 +Node: Installation summary1141018 +Node: Notes1142077 +Node: Compatibility Mode1142942 +Node: Additions1143724 +Node: Accessing The Source1144649 +Node: Adding Code1146084 +Node: New Ports1152241 +Node: Derived Files1156723 +Ref: Derived Files-Footnote-11162198 +Ref: Derived Files-Footnote-21162232 +Ref: Derived Files-Footnote-31162828 +Node: Future Extensions1162942 +Node: Implementation Limitations1163548 +Node: Extension Design1164796 +Node: Old Extension Problems1165950 +Ref: Old Extension Problems-Footnote-11167467 +Node: Extension New Mechanism Goals1167524 +Ref: Extension New Mechanism Goals-Footnote-11170884 +Node: Extension Other Design Decisions1171073 +Node: Extension Future Growth1173181 +Node: Old Extension Mechanism1174017 +Node: Notes summary1175779 +Node: Basic Concepts1176965 +Node: Basic High Level1177646 +Ref: figure-general-flow1177918 +Ref: figure-process-flow1178517 +Ref: Basic High Level-Footnote-11181746 +Node: Basic Data Typing1181931 +Node: Glossary1185259 +Node: Copying1217188 +Node: GNU Free Documentation License1254744 +Node: Index1279880  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 2c0bf958..b21324e9 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -198,9 +198,9 @@ @ifclear FOR_PRINT @set FN file name -@set FFN File Name +@set FFN File name @set DF data file -@set DDF Data File +@set DDF Data file @set PVERSION version @end ifclear @ifset FOR_PRINT @@ -1750,15 +1750,39 @@ and how to compile and use it on different non-POSIX systems. It also describes how to report bugs in @command{gawk} and where to get other freely available @command{awk} implementations. -@end itemize @ifset FOR_PRINT -@itemize @value{MINUS} @item @ref{Copying}, presents the license that covers the @command{gawk} source code. +@end ifset + +@ifclear FOR_PRINT +@item +@ref{Notes}, +describes how to disable @command{gawk}'s extensions, as +well as how to contribute new code to @command{gawk}, +and some possible future directions for @command{gawk} development. + +@item +@ref{Basic Concepts}, +provides some very cursory background material for those who +are completely unfamiliar with computer programming. + +The @ref{Glossary}, defines most, if not all, of the significant terms used +throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, +try looking them up here. + +@item +@ref{Copying}, and +@ref{GNU Free Documentation License}, +present the licenses that cover the @command{gawk} source code +and this @value{DOCUMENT}, respectively. +@end ifclear +@end itemize @end itemize +@ifset FOR_PRINT The version of this @value{DOCUMENT} distributed with @command{gawk} contains additional appendices and other end material. To save space, we have omitted them from the @@ -1796,32 +1820,6 @@ Some of the chapters have exercise sections; these have also been omitted from the print edition but are available online. @end ifset -@ifclear FOR_PRINT -@itemize @value{MINUS} -@item -@ref{Notes}, -describes how to disable @command{gawk}'s extensions, as -well as how to contribute new code to @command{gawk}, -and some possible future directions for @command{gawk} development. - -@item -@ref{Basic Concepts}, -provides some very cursory background material for those who -are completely unfamiliar with computer programming. - -The @ref{Glossary}, defines most, if not all, of the significant terms used -throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, -try looking them up here. - -@item -@ref{Copying}, and -@ref{GNU Free Documentation License}, -present the licenses that cover the @command{gawk} source code -and this @value{DOCUMENT}, respectively. -@end itemize -@end ifclear -@end itemize - @c FULLXREF OFF @node Conventions @@ -1863,15 +1861,23 @@ $ @kbd{echo hello on stderr 1>&2} @end example @ifnotinfo -In the text, command names appear in @code{this font}, while code segments +In the text, almost anything related to programming, such as +command names, +variable and function names, and string, numeric and regexp constants +appear in @code{this font}. Code fragments appear in the same font and quoted, @samp{like this}. +Things that are replaced by the user or programmer +appear in @var{this font}. Options look like this: @option{-f}. +@value{FFN}s are indicated like this: @file{/path/to/ourfile}. +@ifclear FOR_PRINT Some things are emphasized @emph{like this}, and if a point needs to be made -strongly, it is done @strong{like this}. The first occurrence of +strongly, it is done @strong{like this}. +@end ifclear +The first occurrence of a new term is usually its @dfn{definition} and appears in the same font as the previous occurrence of ``definition'' in this sentence. -Finally, @value{FN}s are indicated like this: @file{/path/to/ourfile}. @end ifnotinfo Characters that you type at the keyboard look @kbd{like this}. In particular, @@ -31056,7 +31062,7 @@ This is faster and more space-efficient than using MPFR for the same calculations. @item -There are several ``dark corners'' with respect to floating-point +There are several areas with respect to floating-point numbers where @command{gawk} disagrees with the POSIX standard. It pays to be aware of them. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 7c13dcb1..383b5aff 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -193,9 +193,9 @@ @ifclear FOR_PRINT @set FN file name -@set FFN File Name +@set FFN File name @set DF data file -@set DDF Data File +@set DDF Data file @set PVERSION version @end ifclear @ifset FOR_PRINT @@ -1717,15 +1717,39 @@ and how to compile and use it on different non-POSIX systems. It also describes how to report bugs in @command{gawk} and where to get other freely available @command{awk} implementations. -@end itemize @ifset FOR_PRINT -@itemize @value{MINUS} @item @ref{Copying}, presents the license that covers the @command{gawk} source code. +@end ifset + +@ifclear FOR_PRINT +@item +@ref{Notes}, +describes how to disable @command{gawk}'s extensions, as +well as how to contribute new code to @command{gawk}, +and some possible future directions for @command{gawk} development. + +@item +@ref{Basic Concepts}, +provides some very cursory background material for those who +are completely unfamiliar with computer programming. + +The @ref{Glossary}, defines most, if not all, of the significant terms used +throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, +try looking them up here. + +@item +@ref{Copying}, and +@ref{GNU Free Documentation License}, +present the licenses that cover the @command{gawk} source code +and this @value{DOCUMENT}, respectively. +@end ifclear +@end itemize @end itemize +@ifset FOR_PRINT The version of this @value{DOCUMENT} distributed with @command{gawk} contains additional appendices and other end material. To save space, we have omitted them from the @@ -1763,32 +1787,6 @@ Some of the chapters have exercise sections; these have also been omitted from the print edition but are available online. @end ifset -@ifclear FOR_PRINT -@itemize @value{MINUS} -@item -@ref{Notes}, -describes how to disable @command{gawk}'s extensions, as -well as how to contribute new code to @command{gawk}, -and some possible future directions for @command{gawk} development. - -@item -@ref{Basic Concepts}, -provides some very cursory background material for those who -are completely unfamiliar with computer programming. - -The @ref{Glossary}, defines most, if not all, of the significant terms used -throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, -try looking them up here. - -@item -@ref{Copying}, and -@ref{GNU Free Documentation License}, -present the licenses that cover the @command{gawk} source code -and this @value{DOCUMENT}, respectively. -@end itemize -@end ifclear -@end itemize - @c FULLXREF OFF @node Conventions @@ -1830,15 +1828,23 @@ $ @kbd{echo hello on stderr 1>&2} @end example @ifnotinfo -In the text, command names appear in @code{this font}, while code segments +In the text, almost anything related to programming, such as +command names, +variable and function names, and string, numeric and regexp constants +appear in @code{this font}. Code fragments appear in the same font and quoted, @samp{like this}. +Things that are replaced by the user or programmer +appear in @var{this font}. Options look like this: @option{-f}. +@value{FFN}s are indicated like this: @file{/path/to/ourfile}. +@ifclear FOR_PRINT Some things are emphasized @emph{like this}, and if a point needs to be made -strongly, it is done @strong{like this}. The first occurrence of +strongly, it is done @strong{like this}. +@end ifclear +The first occurrence of a new term is usually its @dfn{definition} and appears in the same font as the previous occurrence of ``definition'' in this sentence. -Finally, @value{FN}s are indicated like this: @file{/path/to/ourfile}. @end ifnotinfo Characters that you type at the keyboard look @kbd{like this}. In particular, @@ -30147,7 +30153,7 @@ This is faster and more space-efficient than using MPFR for the same calculations. @item -There are several ``dark corners'' with respect to floating-point +There are several areas with respect to floating-point numbers where @command{gawk} disagrees with the POSIX standard. It pays to be aware of them. -- cgit v1.2.3 From 8d95c378d502d561a6be416a67b19b247a53f48a Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 22 Feb 2015 20:49:40 +0200 Subject: Doc: change div to divisor in some examples. --- doc/ChangeLog | 12 +- doc/gawk.info | 738 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 16 +- doc/gawktexi.in | 16 +- 4 files changed, 394 insertions(+), 388 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 619ceb06..9e1da9ae 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-22 Arnold D. Robbins + + * gawktexi.in: Change 'div' to 'divisor' in some examples. + This future-proofs against a new function in master. + Thanks to Antonio Giovanni Colombo for the report. + 2015-02-20 Arnold D. Robbins * gawktexi.in: More O'Reilly fixes. I think it's done! @@ -73,7 +79,7 @@ 2015-01-23 Arnold D. Robbins * gawktexi.in: O'Reilly fixes. - (Glossary): Many new entries from Antonio Giovanni Columbo. + (Glossary): Many new entries from Antonio Giovanni Colombo. 2015-01-21 Arnold D. Robbins @@ -97,7 +103,7 @@ * gawktexi.in: Add one more paragraph to new foreword. * gawktexi.in: Fix exponentiation in TeX mode. Thanks to - Marco Curreli by way of Antonio Giovanni Columbo. + Marco Curreli by way of Antonio Giovanni Colombo. * texinfo.tex: Updated. @@ -156,7 +162,7 @@ 2014-10-17 Arnold D. Robbins * gawktexi.in: Fix date in docbook attribution for new Foreword; - thanks to Antonio Columbo for the catch. Update latest version + thanks to Antonio Colombo for the catch. Update latest version of gettext. 2014-10-15 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index 50627888..bf85081c 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -9820,12 +9820,12 @@ divisor of any integer, and also identifies prime numbers: # find smallest divisor of num { num = $1 - for (div = 2; div * div <= num; div++) { - if (num % div == 0) + for (divisor = 2; divisor * divisor <= num; divisor++) { + if (num % divisor == 0) break } - if (num % div == 0) - printf "Smallest divisor of %d is %d\n", num, div + if (num % divisor == 0) + printf "Smallest divisor of %d is %d\n", num, divisor else printf "%d is prime\n", num } @@ -9843,12 +9843,12 @@ Statement::.) # find smallest divisor of num { num = $1 - for (div = 2; ; div++) { - if (num % div == 0) { - printf "Smallest divisor of %d is %d\n", num, div + for (divisor = 2; ; divisor++) { + if (num % divisor == 0) { + printf "Smallest divisor of %d is %d\n", num, divisor break } - if (div * div > num) { + if (divisor * divisor > num) { printf "%d is prime\n", num break } @@ -34681,366 +34681,366 @@ Node: Do Statement413824 Node: For Statement414972 Node: Switch Statement418130 Node: Break Statement420512 -Node: Continue Statement422553 -Node: Next Statement424380 -Node: Nextfile Statement426761 -Node: Exit Statement429389 -Node: Built-in Variables431800 -Node: User-modified432933 -Ref: User-modified-Footnote-1440567 -Node: Auto-set440629 -Ref: Auto-set-Footnote-1453681 -Ref: Auto-set-Footnote-2453886 -Node: ARGC and ARGV453942 -Node: Pattern Action Summary458160 -Node: Arrays460593 -Node: Array Basics461922 -Node: Array Intro462766 -Ref: figure-array-elements464700 -Ref: Array Intro-Footnote-1467320 -Node: Reference to Elements467448 -Node: Assigning Elements469910 -Node: Array Example470401 -Node: Scanning an Array472160 -Node: Controlling Scanning475180 -Ref: Controlling Scanning-Footnote-1480574 -Node: Numeric Array Subscripts480890 -Node: Uninitialized Subscripts483075 -Node: Delete484692 -Ref: Delete-Footnote-1487441 -Node: Multidimensional487498 -Node: Multiscanning490595 -Node: Arrays of Arrays492184 -Node: Arrays Summary496938 -Node: Functions499029 -Node: Built-in500068 -Node: Calling Built-in501146 -Node: Numeric Functions503141 -Ref: Numeric Functions-Footnote-1507157 -Ref: Numeric Functions-Footnote-2507514 -Ref: Numeric Functions-Footnote-3507562 -Node: String Functions507834 -Ref: String Functions-Footnote-1531335 -Ref: String Functions-Footnote-2531464 -Ref: String Functions-Footnote-3531712 -Node: Gory Details531799 -Ref: table-sub-escapes533580 -Ref: table-sub-proposed535095 -Ref: table-posix-sub536457 -Ref: table-gensub-escapes537994 -Ref: Gory Details-Footnote-1538827 -Node: I/O Functions538978 -Ref: I/O Functions-Footnote-1546214 -Node: Time Functions546361 -Ref: Time Functions-Footnote-1556870 -Ref: Time Functions-Footnote-2556938 -Ref: Time Functions-Footnote-3557096 -Ref: Time Functions-Footnote-4557207 -Ref: Time Functions-Footnote-5557319 -Ref: Time Functions-Footnote-6557546 -Node: Bitwise Functions557812 -Ref: table-bitwise-ops558374 -Ref: Bitwise Functions-Footnote-1562702 -Node: Type Functions562874 -Node: I18N Functions564026 -Node: User-defined565673 -Node: Definition Syntax566478 -Ref: Definition Syntax-Footnote-1572137 -Node: Function Example572208 -Ref: Function Example-Footnote-1575129 -Node: Function Caveats575151 -Node: Calling A Function575669 -Node: Variable Scope576627 -Node: Pass By Value/Reference579620 -Node: Return Statement583117 -Node: Dynamic Typing586096 -Node: Indirect Calls587025 -Ref: Indirect Calls-Footnote-1596890 -Node: Functions Summary597018 -Node: Library Functions599720 -Ref: Library Functions-Footnote-1603328 -Ref: Library Functions-Footnote-2603471 -Node: Library Names603642 -Ref: Library Names-Footnote-1607100 -Ref: Library Names-Footnote-2607323 -Node: General Functions607409 -Node: Strtonum Function608512 -Node: Assert Function611534 -Node: Round Function614858 -Node: Cliff Random Function616399 -Node: Ordinal Functions617415 -Ref: Ordinal Functions-Footnote-1620478 -Ref: Ordinal Functions-Footnote-2620730 -Node: Join Function620941 -Ref: Join Function-Footnote-1622711 -Node: Getlocaltime Function622911 -Node: Readfile Function626655 -Node: Shell Quoting628627 -Node: Data File Management630028 -Node: Filetrans Function630660 -Node: Rewind Function634756 -Node: File Checking636142 -Ref: File Checking-Footnote-1637475 -Node: Empty Files637676 -Node: Ignoring Assigns639655 -Node: Getopt Function641205 -Ref: Getopt Function-Footnote-1652669 -Node: Passwd Functions652869 -Ref: Passwd Functions-Footnote-1661709 -Node: Group Functions661797 -Ref: Group Functions-Footnote-1669694 -Node: Walking Arrays669899 -Node: Library Functions Summary672905 -Node: Library Exercises674307 -Node: Sample Programs675587 -Node: Running Examples676357 -Node: Clones677085 -Node: Cut Program678309 -Node: Egrep Program688029 -Ref: Egrep Program-Footnote-1695532 -Node: Id Program695642 -Node: Split Program699318 -Ref: Split Program-Footnote-1702772 -Node: Tee Program702900 -Node: Uniq Program705689 -Node: Wc Program713108 -Ref: Wc Program-Footnote-1717358 -Node: Miscellaneous Programs717452 -Node: Dupword Program718665 -Node: Alarm Program720696 -Node: Translate Program725501 -Ref: Translate Program-Footnote-1730064 -Node: Labels Program730334 -Ref: Labels Program-Footnote-1733685 -Node: Word Sorting733769 -Node: History Sorting737839 -Node: Extract Program739674 -Node: Simple Sed747198 -Node: Igawk Program750268 -Ref: Igawk Program-Footnote-1764594 -Ref: Igawk Program-Footnote-2764795 -Ref: Igawk Program-Footnote-3764917 -Node: Anagram Program765032 -Node: Signature Program768093 -Node: Programs Summary769340 -Node: Programs Exercises770561 -Ref: Programs Exercises-Footnote-1774692 -Node: Advanced Features774783 -Node: Nondecimal Data776765 -Node: Array Sorting778355 -Node: Controlling Array Traversal779055 -Ref: Controlling Array Traversal-Footnote-1787421 -Node: Array Sorting Functions787539 -Ref: Array Sorting Functions-Footnote-1791425 -Node: Two-way I/O791621 -Ref: Two-way I/O-Footnote-1796566 -Ref: Two-way I/O-Footnote-2796752 -Node: TCP/IP Networking796834 -Node: Profiling799706 -Node: Advanced Features Summary807247 -Node: Internationalization809180 -Node: I18N and L10N810660 -Node: Explaining gettext811346 -Ref: Explaining gettext-Footnote-1816371 -Ref: Explaining gettext-Footnote-2816555 -Node: Programmer i18n816720 -Ref: Programmer i18n-Footnote-1821596 -Node: Translator i18n821645 -Node: String Extraction822439 -Ref: String Extraction-Footnote-1823570 -Node: Printf Ordering823656 -Ref: Printf Ordering-Footnote-1826442 -Node: I18N Portability826506 -Ref: I18N Portability-Footnote-1828962 -Node: I18N Example829025 -Ref: I18N Example-Footnote-1831828 -Node: Gawk I18N831900 -Node: I18N Summary832544 -Node: Debugger833884 -Node: Debugging834906 -Node: Debugging Concepts835347 -Node: Debugging Terms837157 -Node: Awk Debugging839729 -Node: Sample Debugging Session840635 -Node: Debugger Invocation841169 -Node: Finding The Bug842554 -Node: List of Debugger Commands849033 -Node: Breakpoint Control850365 -Node: Debugger Execution Control854042 -Node: Viewing And Changing Data857401 -Node: Execution Stack860777 -Node: Debugger Info862412 -Node: Miscellaneous Debugger Commands866457 -Node: Readline Support871458 -Node: Limitations872352 -Node: Debugging Summary874467 -Node: Arbitrary Precision Arithmetic875641 -Node: Computer Arithmetic877057 -Ref: table-numeric-ranges880656 -Ref: Computer Arithmetic-Footnote-1881180 -Node: Math Definitions881237 -Ref: table-ieee-formats884532 -Ref: Math Definitions-Footnote-1885136 -Node: MPFR features885241 -Node: FP Math Caution886912 -Ref: FP Math Caution-Footnote-1887962 -Node: Inexactness of computations888331 -Node: Inexact representation889290 -Node: Comparing FP Values890648 -Node: Errors accumulate891730 -Node: Getting Accuracy893162 -Node: Try To Round895866 -Node: Setting precision896765 -Ref: table-predefined-precision-strings897449 -Node: Setting the rounding mode899278 -Ref: table-gawk-rounding-modes899642 -Ref: Setting the rounding mode-Footnote-1903094 -Node: Arbitrary Precision Integers903273 -Ref: Arbitrary Precision Integers-Footnote-1906257 -Node: POSIX Floating Point Problems906406 -Ref: POSIX Floating Point Problems-Footnote-1910285 -Node: Floating point summary910323 -Node: Dynamic Extensions912510 -Node: Extension Intro914062 -Node: Plugin License915327 -Node: Extension Mechanism Outline916124 -Ref: figure-load-extension916552 -Ref: figure-register-new-function918032 -Ref: figure-call-new-function919036 -Node: Extension API Description921023 -Node: Extension API Functions Introduction922473 -Node: General Data Types927294 -Ref: General Data Types-Footnote-1933194 -Node: Memory Allocation Functions933493 -Ref: Memory Allocation Functions-Footnote-1936332 -Node: Constructor Functions936431 -Node: Registration Functions938170 -Node: Extension Functions938855 -Node: Exit Callback Functions941152 -Node: Extension Version String942400 -Node: Input Parsers943063 -Node: Output Wrappers952938 -Node: Two-way processors957451 -Node: Printing Messages959714 -Ref: Printing Messages-Footnote-1960790 -Node: Updating `ERRNO'960942 -Node: Requesting Values961682 -Ref: table-value-types-returned962409 -Node: Accessing Parameters963366 -Node: Symbol Table Access964600 -Node: Symbol table by name965114 -Node: Symbol table by cookie967134 -Ref: Symbol table by cookie-Footnote-1971279 -Node: Cached values971342 -Ref: Cached values-Footnote-1974838 -Node: Array Manipulation974929 -Ref: Array Manipulation-Footnote-1976027 -Node: Array Data Types976064 -Ref: Array Data Types-Footnote-1978719 -Node: Array Functions978811 -Node: Flattening Arrays982670 -Node: Creating Arrays989572 -Node: Extension API Variables994343 -Node: Extension Versioning994979 -Node: Extension API Informational Variables996870 -Node: Extension API Boilerplate997935 -Node: Finding Extensions1001744 -Node: Extension Example1002304 -Node: Internal File Description1003076 -Node: Internal File Ops1007143 -Ref: Internal File Ops-Footnote-11018894 -Node: Using Internal File Ops1019034 -Ref: Using Internal File Ops-Footnote-11021417 -Node: Extension Samples1021690 -Node: Extension Sample File Functions1023218 -Node: Extension Sample Fnmatch1030899 -Node: Extension Sample Fork1032387 -Node: Extension Sample Inplace1033602 -Node: Extension Sample Ord1035278 -Node: Extension Sample Readdir1036114 -Ref: table-readdir-file-types1036991 -Node: Extension Sample Revout1037802 -Node: Extension Sample Rev2way1038391 -Node: Extension Sample Read write array1039131 -Node: Extension Sample Readfile1041071 -Node: Extension Sample Time1042166 -Node: Extension Sample API Tests1043514 -Node: gawkextlib1044005 -Node: Extension summary1046683 -Node: Extension Exercises1050372 -Node: Language History1051094 -Node: V7/SVR3.11052750 -Node: SVR41054903 -Node: POSIX1056337 -Node: BTL1057718 -Node: POSIX/GNU1058449 -Node: Feature History1063970 -Node: Common Extensions1077068 -Node: Ranges and Locales1078440 -Ref: Ranges and Locales-Footnote-11083059 -Ref: Ranges and Locales-Footnote-21083086 -Ref: Ranges and Locales-Footnote-31083321 -Node: Contributors1083542 -Node: History summary1089082 -Node: Installation1090461 -Node: Gawk Distribution1091407 -Node: Getting1091891 -Node: Extracting1092714 -Node: Distribution contents1094351 -Node: Unix Installation1100105 -Node: Quick Installation1100722 -Node: Additional Configuration Options1103146 -Node: Configuration Philosophy1104949 -Node: Non-Unix Installation1107318 -Node: PC Installation1107776 -Node: PC Binary Installation1109096 -Node: PC Compiling1110944 -Ref: PC Compiling-Footnote-11113965 -Node: PC Testing1114074 -Node: PC Using1115250 -Node: Cygwin1119365 -Node: MSYS1120135 -Node: VMS Installation1120636 -Node: VMS Compilation1121428 -Ref: VMS Compilation-Footnote-11122657 -Node: VMS Dynamic Extensions1122715 -Node: VMS Installation Details1124399 -Node: VMS Running1126650 -Node: VMS GNV1129490 -Node: VMS Old Gawk1130225 -Node: Bugs1130695 -Node: Other Versions1134584 -Node: Installation summary1141018 -Node: Notes1142077 -Node: Compatibility Mode1142942 -Node: Additions1143724 -Node: Accessing The Source1144649 -Node: Adding Code1146084 -Node: New Ports1152241 -Node: Derived Files1156723 -Ref: Derived Files-Footnote-11162198 -Ref: Derived Files-Footnote-21162232 -Ref: Derived Files-Footnote-31162828 -Node: Future Extensions1162942 -Node: Implementation Limitations1163548 -Node: Extension Design1164796 -Node: Old Extension Problems1165950 -Ref: Old Extension Problems-Footnote-11167467 -Node: Extension New Mechanism Goals1167524 -Ref: Extension New Mechanism Goals-Footnote-11170884 -Node: Extension Other Design Decisions1171073 -Node: Extension Future Growth1173181 -Node: Old Extension Mechanism1174017 -Node: Notes summary1175779 -Node: Basic Concepts1176965 -Node: Basic High Level1177646 -Ref: figure-general-flow1177918 -Ref: figure-process-flow1178517 -Ref: Basic High Level-Footnote-11181746 -Node: Basic Data Typing1181931 -Node: Glossary1185259 -Node: Copying1217188 -Node: GNU Free Documentation License1254744 -Node: Index1279880 +Node: Continue Statement422605 +Node: Next Statement424432 +Node: Nextfile Statement426813 +Node: Exit Statement429441 +Node: Built-in Variables431852 +Node: User-modified432985 +Ref: User-modified-Footnote-1440619 +Node: Auto-set440681 +Ref: Auto-set-Footnote-1453733 +Ref: Auto-set-Footnote-2453938 +Node: ARGC and ARGV453994 +Node: Pattern Action Summary458212 +Node: Arrays460645 +Node: Array Basics461974 +Node: Array Intro462818 +Ref: figure-array-elements464752 +Ref: Array Intro-Footnote-1467372 +Node: Reference to Elements467500 +Node: Assigning Elements469962 +Node: Array Example470453 +Node: Scanning an Array472212 +Node: Controlling Scanning475232 +Ref: Controlling Scanning-Footnote-1480626 +Node: Numeric Array Subscripts480942 +Node: Uninitialized Subscripts483127 +Node: Delete484744 +Ref: Delete-Footnote-1487493 +Node: Multidimensional487550 +Node: Multiscanning490647 +Node: Arrays of Arrays492236 +Node: Arrays Summary496990 +Node: Functions499081 +Node: Built-in500120 +Node: Calling Built-in501198 +Node: Numeric Functions503193 +Ref: Numeric Functions-Footnote-1507209 +Ref: Numeric Functions-Footnote-2507566 +Ref: Numeric Functions-Footnote-3507614 +Node: String Functions507886 +Ref: String Functions-Footnote-1531387 +Ref: String Functions-Footnote-2531516 +Ref: String Functions-Footnote-3531764 +Node: Gory Details531851 +Ref: table-sub-escapes533632 +Ref: table-sub-proposed535147 +Ref: table-posix-sub536509 +Ref: table-gensub-escapes538046 +Ref: Gory Details-Footnote-1538879 +Node: I/O Functions539030 +Ref: I/O Functions-Footnote-1546266 +Node: Time Functions546413 +Ref: Time Functions-Footnote-1556922 +Ref: Time Functions-Footnote-2556990 +Ref: Time Functions-Footnote-3557148 +Ref: Time Functions-Footnote-4557259 +Ref: Time Functions-Footnote-5557371 +Ref: Time Functions-Footnote-6557598 +Node: Bitwise Functions557864 +Ref: table-bitwise-ops558426 +Ref: Bitwise Functions-Footnote-1562754 +Node: Type Functions562926 +Node: I18N Functions564078 +Node: User-defined565725 +Node: Definition Syntax566530 +Ref: Definition Syntax-Footnote-1572189 +Node: Function Example572260 +Ref: Function Example-Footnote-1575181 +Node: Function Caveats575203 +Node: Calling A Function575721 +Node: Variable Scope576679 +Node: Pass By Value/Reference579672 +Node: Return Statement583169 +Node: Dynamic Typing586148 +Node: Indirect Calls587077 +Ref: Indirect Calls-Footnote-1596942 +Node: Functions Summary597070 +Node: Library Functions599772 +Ref: Library Functions-Footnote-1603380 +Ref: Library Functions-Footnote-2603523 +Node: Library Names603694 +Ref: Library Names-Footnote-1607152 +Ref: Library Names-Footnote-2607375 +Node: General Functions607461 +Node: Strtonum Function608564 +Node: Assert Function611586 +Node: Round Function614910 +Node: Cliff Random Function616451 +Node: Ordinal Functions617467 +Ref: Ordinal Functions-Footnote-1620530 +Ref: Ordinal Functions-Footnote-2620782 +Node: Join Function620993 +Ref: Join Function-Footnote-1622763 +Node: Getlocaltime Function622963 +Node: Readfile Function626707 +Node: Shell Quoting628679 +Node: Data File Management630080 +Node: Filetrans Function630712 +Node: Rewind Function634808 +Node: File Checking636194 +Ref: File Checking-Footnote-1637527 +Node: Empty Files637728 +Node: Ignoring Assigns639707 +Node: Getopt Function641257 +Ref: Getopt Function-Footnote-1652721 +Node: Passwd Functions652921 +Ref: Passwd Functions-Footnote-1661761 +Node: Group Functions661849 +Ref: Group Functions-Footnote-1669746 +Node: Walking Arrays669951 +Node: Library Functions Summary672957 +Node: Library Exercises674359 +Node: Sample Programs675639 +Node: Running Examples676409 +Node: Clones677137 +Node: Cut Program678361 +Node: Egrep Program688081 +Ref: Egrep Program-Footnote-1695584 +Node: Id Program695694 +Node: Split Program699370 +Ref: Split Program-Footnote-1702824 +Node: Tee Program702952 +Node: Uniq Program705741 +Node: Wc Program713160 +Ref: Wc Program-Footnote-1717410 +Node: Miscellaneous Programs717504 +Node: Dupword Program718717 +Node: Alarm Program720748 +Node: Translate Program725553 +Ref: Translate Program-Footnote-1730116 +Node: Labels Program730386 +Ref: Labels Program-Footnote-1733737 +Node: Word Sorting733821 +Node: History Sorting737891 +Node: Extract Program739726 +Node: Simple Sed747250 +Node: Igawk Program750320 +Ref: Igawk Program-Footnote-1764646 +Ref: Igawk Program-Footnote-2764847 +Ref: Igawk Program-Footnote-3764969 +Node: Anagram Program765084 +Node: Signature Program768145 +Node: Programs Summary769392 +Node: Programs Exercises770613 +Ref: Programs Exercises-Footnote-1774744 +Node: Advanced Features774835 +Node: Nondecimal Data776817 +Node: Array Sorting778407 +Node: Controlling Array Traversal779107 +Ref: Controlling Array Traversal-Footnote-1787473 +Node: Array Sorting Functions787591 +Ref: Array Sorting Functions-Footnote-1791477 +Node: Two-way I/O791673 +Ref: Two-way I/O-Footnote-1796618 +Ref: Two-way I/O-Footnote-2796804 +Node: TCP/IP Networking796886 +Node: Profiling799758 +Node: Advanced Features Summary807299 +Node: Internationalization809232 +Node: I18N and L10N810712 +Node: Explaining gettext811398 +Ref: Explaining gettext-Footnote-1816423 +Ref: Explaining gettext-Footnote-2816607 +Node: Programmer i18n816772 +Ref: Programmer i18n-Footnote-1821648 +Node: Translator i18n821697 +Node: String Extraction822491 +Ref: String Extraction-Footnote-1823622 +Node: Printf Ordering823708 +Ref: Printf Ordering-Footnote-1826494 +Node: I18N Portability826558 +Ref: I18N Portability-Footnote-1829014 +Node: I18N Example829077 +Ref: I18N Example-Footnote-1831880 +Node: Gawk I18N831952 +Node: I18N Summary832596 +Node: Debugger833936 +Node: Debugging834958 +Node: Debugging Concepts835399 +Node: Debugging Terms837209 +Node: Awk Debugging839781 +Node: Sample Debugging Session840687 +Node: Debugger Invocation841221 +Node: Finding The Bug842606 +Node: List of Debugger Commands849085 +Node: Breakpoint Control850417 +Node: Debugger Execution Control854094 +Node: Viewing And Changing Data857453 +Node: Execution Stack860829 +Node: Debugger Info862464 +Node: Miscellaneous Debugger Commands866509 +Node: Readline Support871510 +Node: Limitations872404 +Node: Debugging Summary874519 +Node: Arbitrary Precision Arithmetic875693 +Node: Computer Arithmetic877109 +Ref: table-numeric-ranges880708 +Ref: Computer Arithmetic-Footnote-1881232 +Node: Math Definitions881289 +Ref: table-ieee-formats884584 +Ref: Math Definitions-Footnote-1885188 +Node: MPFR features885293 +Node: FP Math Caution886964 +Ref: FP Math Caution-Footnote-1888014 +Node: Inexactness of computations888383 +Node: Inexact representation889342 +Node: Comparing FP Values890700 +Node: Errors accumulate891782 +Node: Getting Accuracy893214 +Node: Try To Round895918 +Node: Setting precision896817 +Ref: table-predefined-precision-strings897501 +Node: Setting the rounding mode899330 +Ref: table-gawk-rounding-modes899694 +Ref: Setting the rounding mode-Footnote-1903146 +Node: Arbitrary Precision Integers903325 +Ref: Arbitrary Precision Integers-Footnote-1906309 +Node: POSIX Floating Point Problems906458 +Ref: POSIX Floating Point Problems-Footnote-1910337 +Node: Floating point summary910375 +Node: Dynamic Extensions912562 +Node: Extension Intro914114 +Node: Plugin License915379 +Node: Extension Mechanism Outline916176 +Ref: figure-load-extension916604 +Ref: figure-register-new-function918084 +Ref: figure-call-new-function919088 +Node: Extension API Description921075 +Node: Extension API Functions Introduction922525 +Node: General Data Types927346 +Ref: General Data Types-Footnote-1933246 +Node: Memory Allocation Functions933545 +Ref: Memory Allocation Functions-Footnote-1936384 +Node: Constructor Functions936483 +Node: Registration Functions938222 +Node: Extension Functions938907 +Node: Exit Callback Functions941204 +Node: Extension Version String942452 +Node: Input Parsers943115 +Node: Output Wrappers952990 +Node: Two-way processors957503 +Node: Printing Messages959766 +Ref: Printing Messages-Footnote-1960842 +Node: Updating `ERRNO'960994 +Node: Requesting Values961734 +Ref: table-value-types-returned962461 +Node: Accessing Parameters963418 +Node: Symbol Table Access964652 +Node: Symbol table by name965166 +Node: Symbol table by cookie967186 +Ref: Symbol table by cookie-Footnote-1971331 +Node: Cached values971394 +Ref: Cached values-Footnote-1974890 +Node: Array Manipulation974981 +Ref: Array Manipulation-Footnote-1976079 +Node: Array Data Types976116 +Ref: Array Data Types-Footnote-1978771 +Node: Array Functions978863 +Node: Flattening Arrays982722 +Node: Creating Arrays989624 +Node: Extension API Variables994395 +Node: Extension Versioning995031 +Node: Extension API Informational Variables996922 +Node: Extension API Boilerplate997987 +Node: Finding Extensions1001796 +Node: Extension Example1002356 +Node: Internal File Description1003128 +Node: Internal File Ops1007195 +Ref: Internal File Ops-Footnote-11018946 +Node: Using Internal File Ops1019086 +Ref: Using Internal File Ops-Footnote-11021469 +Node: Extension Samples1021742 +Node: Extension Sample File Functions1023270 +Node: Extension Sample Fnmatch1030951 +Node: Extension Sample Fork1032439 +Node: Extension Sample Inplace1033654 +Node: Extension Sample Ord1035330 +Node: Extension Sample Readdir1036166 +Ref: table-readdir-file-types1037043 +Node: Extension Sample Revout1037854 +Node: Extension Sample Rev2way1038443 +Node: Extension Sample Read write array1039183 +Node: Extension Sample Readfile1041123 +Node: Extension Sample Time1042218 +Node: Extension Sample API Tests1043566 +Node: gawkextlib1044057 +Node: Extension summary1046735 +Node: Extension Exercises1050424 +Node: Language History1051146 +Node: V7/SVR3.11052802 +Node: SVR41054955 +Node: POSIX1056389 +Node: BTL1057770 +Node: POSIX/GNU1058501 +Node: Feature History1064022 +Node: Common Extensions1077120 +Node: Ranges and Locales1078492 +Ref: Ranges and Locales-Footnote-11083111 +Ref: Ranges and Locales-Footnote-21083138 +Ref: Ranges and Locales-Footnote-31083373 +Node: Contributors1083594 +Node: History summary1089134 +Node: Installation1090513 +Node: Gawk Distribution1091459 +Node: Getting1091943 +Node: Extracting1092766 +Node: Distribution contents1094403 +Node: Unix Installation1100157 +Node: Quick Installation1100774 +Node: Additional Configuration Options1103198 +Node: Configuration Philosophy1105001 +Node: Non-Unix Installation1107370 +Node: PC Installation1107828 +Node: PC Binary Installation1109148 +Node: PC Compiling1110996 +Ref: PC Compiling-Footnote-11114017 +Node: PC Testing1114126 +Node: PC Using1115302 +Node: Cygwin1119417 +Node: MSYS1120187 +Node: VMS Installation1120688 +Node: VMS Compilation1121480 +Ref: VMS Compilation-Footnote-11122709 +Node: VMS Dynamic Extensions1122767 +Node: VMS Installation Details1124451 +Node: VMS Running1126702 +Node: VMS GNV1129542 +Node: VMS Old Gawk1130277 +Node: Bugs1130747 +Node: Other Versions1134636 +Node: Installation summary1141070 +Node: Notes1142129 +Node: Compatibility Mode1142994 +Node: Additions1143776 +Node: Accessing The Source1144701 +Node: Adding Code1146136 +Node: New Ports1152293 +Node: Derived Files1156775 +Ref: Derived Files-Footnote-11162250 +Ref: Derived Files-Footnote-21162284 +Ref: Derived Files-Footnote-31162880 +Node: Future Extensions1162994 +Node: Implementation Limitations1163600 +Node: Extension Design1164848 +Node: Old Extension Problems1166002 +Ref: Old Extension Problems-Footnote-11167519 +Node: Extension New Mechanism Goals1167576 +Ref: Extension New Mechanism Goals-Footnote-11170936 +Node: Extension Other Design Decisions1171125 +Node: Extension Future Growth1173233 +Node: Old Extension Mechanism1174069 +Node: Notes summary1175831 +Node: Basic Concepts1177017 +Node: Basic High Level1177698 +Ref: figure-general-flow1177970 +Ref: figure-process-flow1178569 +Ref: Basic High Level-Footnote-11181798 +Node: Basic Data Typing1181983 +Node: Glossary1185311 +Node: Copying1217240 +Node: GNU Free Documentation License1254796 +Node: Index1279932  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index b21324e9..e951db1a 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -14124,12 +14124,12 @@ numbers: # find smallest divisor of num @{ num = $1 - for (div = 2; div * div <= num; div++) @{ - if (num % div == 0) + for (divisor = 2; divisor * divisor <= num; divisor++) @{ + if (num % divisor == 0) break @} - if (num % div == 0) - printf "Smallest divisor of %d is %d\n", num, div + if (num % divisor == 0) + printf "Smallest divisor of %d is %d\n", num, divisor else printf "%d is prime\n", num @} @@ -14150,12 +14150,12 @@ an @code{if}: # find smallest divisor of num @{ num = $1 - for (div = 2; ; div++) @{ - if (num % div == 0) @{ - printf "Smallest divisor of %d is %d\n", num, div + for (divisor = 2; ; divisor++) @{ + if (num % divisor == 0) @{ + printf "Smallest divisor of %d is %d\n", num, divisor break @} - if (div * div > num) @{ + if (divisor * divisor > num) @{ printf "%d is prime\n", num break @} diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 383b5aff..3319bf35 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -13452,12 +13452,12 @@ numbers: # find smallest divisor of num @{ num = $1 - for (div = 2; div * div <= num; div++) @{ - if (num % div == 0) + for (divisor = 2; divisor * divisor <= num; divisor++) @{ + if (num % divisor == 0) break @} - if (num % div == 0) - printf "Smallest divisor of %d is %d\n", num, div + if (num % divisor == 0) + printf "Smallest divisor of %d is %d\n", num, divisor else printf "%d is prime\n", num @} @@ -13478,12 +13478,12 @@ an @code{if}: # find smallest divisor of num @{ num = $1 - for (div = 2; ; div++) @{ - if (num % div == 0) @{ - printf "Smallest divisor of %d is %d\n", num, div + for (divisor = 2; ; divisor++) @{ + if (num % divisor == 0) @{ + printf "Smallest divisor of %d is %d\n", num, divisor break @} - if (div * div > num) @{ + if (divisor * divisor > num) @{ printf "%d is prime\n", num break @} -- cgit v1.2.3 From 14b63db90cddd8b437bdf4e7a4547a4c0e75768f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Feb 2015 21:48:01 +0200 Subject: Update texinfo.tex. --- doc/ChangeLog | 4 ++ doc/texinfo.tex | 150 +++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 130 insertions(+), 24 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9e1da9ae..83f724c2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-24 Arnold D. Robbins + + * texinfo.tex: Update to most current version. + 2015-02-22 Arnold D. Robbins * gawktexi.in: Change 'div' to 'divisor' in some examples. diff --git a/doc/texinfo.tex b/doc/texinfo.tex index 370d4505..8236d7d2 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -3,11 +3,12 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2014-12-03.16} +\def\texinfoversion{2015-02-05.16} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 +% Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -4488,7 +4489,6 @@ end % Called from \indexdummies and \atdummies. % \def\commondummies{% - % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for @@ -4565,6 +4565,7 @@ end \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq + \definedummyword\mathopsup \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds @@ -4578,6 +4579,8 @@ end \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result + \definedummyword\sub + \definedummyword\sup \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. @@ -4652,6 +4655,7 @@ end \definedummyword\samp \definedummyword\strong \definedummyword\tie + \definedummyword\U \definedummyword\uref \definedummyword\url \definedummyword\var @@ -8334,14 +8338,7 @@ end \catcode`\\=\other % % Make the characters 128-255 be printing characters. - {% - \count1=128 - \def\loop{% - \catcode\count1=\other - \advance\count1 by 1 - \ifnum \count1<256 \loop \fi - }% - }% + {\setnonasciicharscatcodenonglobal\other}% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 @@ -8952,6 +8949,7 @@ directory should work if nowhere else does.} \catcode\count255=#1\relax \advance\count255 by 1 \repeat + } % @documentencoding sets the definition of non-ASCII characters @@ -8986,10 +8984,12 @@ directory should work if nowhere else does.} % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active - \utfeightchardefs + % since we already invoked \utfeightchardefs at the top level + % (below), do not re-invoke it, then our check for duplicated + % definitions triggers. Making non-ascii chars active is enough. % \else - \message{Unknown document encoding #1, ignoring.}% + \message{Ignoring unknown document encoding: #1.}% % \fi % utfeight \fi % latnine @@ -8998,10 +8998,11 @@ directory should work if nowhere else does.} \fi % ascii } +% emacs-page % A message to be logged when using a character that isn't available % the default font encoding (OT1). % -\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} +\def\missingcharmsg#1{\message{Character missing, sorry: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} @@ -9037,12 +9038,10 @@ directory should work if nowhere else does.} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} - % - \gdef^^b7{$^.$} + \gdef^^b7{\ifmmode\cdot\else $\cdot$\fi} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} - % \gdef^^bb{\guillemetright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} @@ -9331,6 +9330,11 @@ directory should work if nowhere else does.} \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% + % + \expandafter\ifx\csname uni:#1\endcsname \relax \else + \errmessage{Internal error, already defined: #1}% + \fi + % % define an additional control sequence for this code point. \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp \endgroup} @@ -9370,23 +9374,49 @@ directory should work if nowhere else does.} \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup +% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M +% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) +% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) +% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A +% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B +% +% Many of our renditions are less than wonderful, and all the missing +% characters are available somewhere. Loading the necessary fonts +% awaits user request. We can't truly support Unicode without +% reimplementing everything that's been done in LaTeX for many years, +% plus probably using luatex or xetex, and who knows what else. +% We won't be doing that here in this simple file. But we can try to at +% least make most of the characters not bomb out. +% \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A7}{\S} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AC}{\ifmmode\lnot\else $\lnot$\fi} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B1}{\ifmmode\pm\else $\pm$\fi} + \DeclareUnicodeCharacter{00B2}{$^2$} + \DeclareUnicodeCharacter{00B3}{$^3$} \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B5}{$\mu$} + \DeclareUnicodeCharacter{00B6}{\P} + \DeclareUnicodeCharacter{00B7}{\ifmmode\cdot\else $\cdot$\fi} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00B9}{$^1$} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BC}{$1\over4$} + \DeclareUnicodeCharacter{00BD}{$1\over2$} + \DeclareUnicodeCharacter{00BE}{$3\over4$} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} @@ -9413,6 +9443,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D7}{\ifmmode\times\else $\times$\fi} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} @@ -9446,6 +9477,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F7}{\ifmmode\div\else $\div$\fi} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} @@ -9465,20 +9497,23 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} - \DeclareUnicodeCharacter{0118}{\ogonek{E}} - \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} + \DeclareUnicodeCharacter{010F}{d'} + \DeclareUnicodeCharacter{0110}{\DH} + \DeclareUnicodeCharacter{0111}{\dh} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} @@ -9488,14 +9523,20 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0122}{\cedilla{G}} + \DeclareUnicodeCharacter{0123}{\cedilla{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}} + \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + \DeclareUnicodeCharacter{012E}{\ogonek{I}} + \DeclareUnicodeCharacter{012F}{\ogonek{i}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} @@ -9503,15 +9544,29 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0136}{\cedilla{K}} + \DeclareUnicodeCharacter{0137}{\cedilla{k}} + \DeclareUnicodeCharacter{0138}{\ifmmode\kappa\else $\kappa$\fi} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} + \DeclareUnicodeCharacter{013B}{\cedilla{L}} + \DeclareUnicodeCharacter{013C}{\cedilla{l}} + \DeclareUnicodeCharacter{013D}{L'}% should kern + \DeclareUnicodeCharacter{013E}{l'}% should kern + \DeclareUnicodeCharacter{013F}{L\U{00B7}} + \DeclareUnicodeCharacter{0140}{l\U{00B7}} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0145}{\cedilla{N}} + \DeclareUnicodeCharacter{0146}{\cedilla{n}} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{0149}{'n} + \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}} + \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} @@ -9523,6 +9578,8 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0156}{\cedilla{R}} + \DeclareUnicodeCharacter{0157}{\cedilla{r}} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} @@ -9534,10 +9591,12 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} - \DeclareUnicodeCharacter{0162}{\cedilla{t}} - \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0162}{\cedilla{T}} + \DeclareUnicodeCharacter{0163}{\cedilla{t}} \DeclareUnicodeCharacter{0164}{\v{T}} - + \DeclareUnicodeCharacter{0165}{\v{t}} + \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}} + \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} @@ -9549,6 +9608,8 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0172}{\ogonek{U}} + \DeclareUnicodeCharacter{0173}{\ogonek{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} @@ -9560,6 +9621,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} + \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} @@ -9765,12 +9827,51 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs - % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } +% Latin1 (ISO-8859-1) character definitions. +\def\nonasciistringdefs{% + \setnonasciicharscatcode\active + \def\defstringchar##1{\def##1{\string##1}}% + \defstringchar^^a0\defstringchar^^a1\defstringchar^^a2\defstringchar^^a3% + \defstringchar^^a4\defstringchar^^a5\defstringchar^^a6\defstringchar^^a7% + \defstringchar^^a8\defstringchar^^a9\defstringchar^^aa\defstringchar^^ab% + \defstringchar^^ac\defstringchar^^ad\defstringchar^^ae\defstringchar^^af% + % + \defstringchar^^b0\defstringchar^^b1\defstringchar^^b2\defstringchar^^b3% + \defstringchar^^b4\defstringchar^^b5\defstringchar^^b6\defstringchar^^b7% + \defstringchar^^b8\defstringchar^^b9\defstringchar^^ba\defstringchar^^bb% + \defstringchar^^bc\defstringchar^^bd\defstringchar^^be\defstringchar^^bf% + % + \defstringchar^^c0\defstringchar^^c1\defstringchar^^c2\defstringchar^^c3% + \defstringchar^^c4\defstringchar^^c5\defstringchar^^c6\defstringchar^^c7% + \defstringchar^^c8\defstringchar^^c9\defstringchar^^ca\defstringchar^^cb% + \defstringchar^^cc\defstringchar^^cd\defstringchar^^ce\defstringchar^^cf% + % + \defstringchar^^d0\defstringchar^^d1\defstringchar^^d2\defstringchar^^d3% + \defstringchar^^d4\defstringchar^^d5\defstringchar^^d6\defstringchar^^d7% + \defstringchar^^d8\defstringchar^^d9\defstringchar^^da\defstringchar^^db% + \defstringchar^^dc\defstringchar^^dd\defstringchar^^de\defstringchar^^df% + % + \defstringchar^^e0\defstringchar^^e1\defstringchar^^e2\defstringchar^^e3% + \defstringchar^^e4\defstringchar^^e5\defstringchar^^e6\defstringchar^^e7% + \defstringchar^^e8\defstringchar^^e9\defstringchar^^ea\defstringchar^^eb% + \defstringchar^^ec\defstringchar^^ed\defstringchar^^ee\defstringchar^^ef% + % + \defstringchar^^f0\defstringchar^^f1\defstringchar^^f2\defstringchar^^f3% + \defstringchar^^f4\defstringchar^^f5\defstringchar^^f6\defstringchar^^f7% + \defstringchar^^f8\defstringchar^^f9\defstringchar^^fa\defstringchar^^fb% + \defstringchar^^fc\defstringchar^^fd\defstringchar^^fe\defstringchar^^ff% +} + + +% define all the unicode characters we know about, for the sake of @U. +\utfeightchardefs + + % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. @@ -10124,6 +10225,7 @@ directory should work if nowhere else does.} % {@catcode`- = @active @gdef@normalturnoffactive{% + @nonasciistringdefs @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @@ -10192,7 +10294,7 @@ directory should work if nowhere else does.} @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) -@c page-delimiter: "^\\\\message" +@c page-delimiter: "^\\\\message\\|emacs-page" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" -- cgit v1.2.3 From 54445bc1d185792d6731849310a9d3c7f5c56eb5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Feb 2015 21:49:17 +0200 Subject: Update copyright in POSIX.STD. --- ChangeLog | 4 ++++ POSIX.STD | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 18e7e900..ac0e13bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-02-24 Arnold D. Robbins + + * POSIX.STD: Update copyright year. + 2015-02-13 Arnold D. Robbins * awkgram.y (yylex): Be more careful about passing true to diff --git a/POSIX.STD b/POSIX.STD index c48dfb42..a2368949 100644 --- a/POSIX.STD +++ b/POSIX.STD @@ -1,4 +1,4 @@ - Copyright (C) 1992, 1995, 1998, 2001, 2006, 2007, 2010, 2011 + Copyright (C) 1992, 1995, 1998, 2001, 2006, 2007, 2010, 2011, 2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, -- cgit v1.2.3 From 764317bf85e5e63651486933b880a4627529d967 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Feb 2015 21:50:42 +0200 Subject: Minor doc edit. --- doc/ChangeLog | 1 + doc/gawk.info | 1094 +++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 4 files changed, 550 insertions(+), 549 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 83f724c2..46e57c1b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2015-02-24 Arnold D. Robbins * texinfo.tex: Update to most current version. + * gawktexi.in: Minor edit to match an O'Reilly fix. 2015-02-22 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index bf85081c..1b6a0a99 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -953,7 +953,7 @@ provided in *note Language History::. The language described in this Info file is often referred to as "new `awk'." By analogy, the original version of `awk' is referred to as "old `awk'." - Today, on most systems, when you run the `awk' utility you get some + On most current systems, when you run the `awk' utility you get some version of new `awk'.(1) If your system's standard `awk' is the old one, you will see something like this if you try the test program: @@ -34496,551 +34496,551 @@ Ref: Preface-Footnote-251109 Ref: Preface-Footnote-351342 Node: History51484 Node: Names53835 -Ref: Names-Footnote-154928 -Node: This Manual55074 -Ref: This Manual-Footnote-161574 -Node: Conventions61674 -Node: Manual History64011 -Ref: Manual History-Footnote-167004 -Ref: Manual History-Footnote-267045 -Node: How To Contribute67119 -Node: Acknowledgments68248 -Node: Getting Started73114 -Node: Running gawk75553 -Node: One-shot76743 -Node: Read Terminal78007 -Node: Long80038 -Node: Executable Scripts81551 -Ref: Executable Scripts-Footnote-184340 -Node: Comments84443 -Node: Quoting86925 -Node: DOS Quoting92443 -Node: Sample Data Files93118 -Node: Very Simple95713 -Node: Two Rules100612 -Node: More Complex102498 -Node: Statements/Lines105360 -Ref: Statements/Lines-Footnote-1109815 -Node: Other Features110080 -Node: When111016 -Ref: When-Footnote-1112770 -Node: Intro Summary112835 -Node: Invoking Gawk113719 -Node: Command Line115233 -Node: Options116031 -Ref: Options-Footnote-1131953 -Ref: Options-Footnote-2132182 -Node: Other Arguments132207 -Node: Naming Standard Input135155 -Node: Environment Variables136248 -Node: AWKPATH Variable136806 -Ref: AWKPATH Variable-Footnote-1140103 -Ref: AWKPATH Variable-Footnote-2140148 -Node: AWKLIBPATH Variable140408 -Node: Other Environment Variables141551 -Node: Exit Status145309 -Node: Include Files145985 -Node: Loading Shared Libraries149574 -Node: Obsolete151001 -Node: Undocumented151693 -Node: Invoking Summary151960 -Node: Regexp153623 -Node: Regexp Usage155077 -Node: Escape Sequences157114 -Node: Regexp Operators163124 -Ref: Regexp Operators-Footnote-1170534 -Ref: Regexp Operators-Footnote-2170681 -Node: Bracket Expressions170779 -Ref: table-char-classes172794 -Node: Leftmost Longest175736 -Node: Computed Regexps177038 -Node: GNU Regexp Operators180467 -Node: Case-sensitivity184139 -Ref: Case-sensitivity-Footnote-1187024 -Ref: Case-sensitivity-Footnote-2187259 -Node: Regexp Summary187367 -Node: Reading Files188834 -Node: Records190927 -Node: awk split records191660 -Node: gawk split records196589 -Ref: gawk split records-Footnote-1201128 -Node: Fields201165 -Ref: Fields-Footnote-1203943 -Node: Nonconstant Fields204029 -Ref: Nonconstant Fields-Footnote-1206267 -Node: Changing Fields206470 -Node: Field Separators212401 -Node: Default Field Splitting215105 -Node: Regexp Field Splitting216222 -Node: Single Character Fields219572 -Node: Command Line Field Separator220631 -Node: Full Line Fields223848 -Ref: Full Line Fields-Footnote-1225369 -Ref: Full Line Fields-Footnote-2225415 -Node: Field Splitting Summary225516 -Node: Constant Size227590 -Node: Splitting By Content232173 -Ref: Splitting By Content-Footnote-1236138 -Node: Multiple Line236301 -Ref: Multiple Line-Footnote-1242182 -Node: Getline242361 -Node: Plain Getline244568 -Node: Getline/Variable247208 -Node: Getline/File248357 -Node: Getline/Variable/File249742 -Ref: Getline/Variable/File-Footnote-1251345 -Node: Getline/Pipe251432 -Node: Getline/Variable/Pipe254110 -Node: Getline/Coprocess255241 -Node: Getline/Variable/Coprocess256505 -Node: Getline Notes257244 -Node: Getline Summary260038 -Ref: table-getline-variants260450 -Node: Read Timeout261279 -Ref: Read Timeout-Footnote-1265116 -Node: Command-line directories265174 -Node: Input Summary266079 -Node: Input Exercises269464 -Node: Printing270192 -Node: Print271969 -Node: Print Examples273426 -Node: Output Separators276205 -Node: OFMT278223 -Node: Printf279578 -Node: Basic Printf280363 -Node: Control Letters281935 -Node: Format Modifiers285920 -Node: Printf Examples291926 -Node: Redirection294412 -Node: Special FD301250 -Ref: Special FD-Footnote-1304416 -Node: Special Files304490 -Node: Other Inherited Files305107 -Node: Special Network306107 -Node: Special Caveats306969 -Node: Close Files And Pipes307918 -Ref: Close Files And Pipes-Footnote-1315109 -Ref: Close Files And Pipes-Footnote-2315257 -Node: Output Summary315407 -Node: Output Exercises316405 -Node: Expressions317085 -Node: Values318274 -Node: Constants318951 -Node: Scalar Constants319642 -Ref: Scalar Constants-Footnote-1320504 -Node: Nondecimal-numbers320754 -Node: Regexp Constants323764 -Node: Using Constant Regexps324290 -Node: Variables327453 -Node: Using Variables328110 -Node: Assignment Options330021 -Node: Conversion331896 -Node: Strings And Numbers332420 -Ref: Strings And Numbers-Footnote-1335485 -Node: Locale influences conversions335594 -Ref: table-locale-affects338340 -Node: All Operators338932 -Node: Arithmetic Ops339561 -Node: Concatenation342066 -Ref: Concatenation-Footnote-1344885 -Node: Assignment Ops344992 -Ref: table-assign-ops349971 -Node: Increment Ops351281 -Node: Truth Values and Conditions354712 -Node: Truth Values355795 -Node: Typing and Comparison356844 -Node: Variable Typing357660 -Node: Comparison Operators361327 -Ref: table-relational-ops361737 -Node: POSIX String Comparison365232 -Ref: POSIX String Comparison-Footnote-1366304 -Node: Boolean Ops366443 -Ref: Boolean Ops-Footnote-1370921 -Node: Conditional Exp371012 -Node: Function Calls372750 -Node: Precedence376630 -Node: Locales380290 -Node: Expressions Summary381922 -Node: Patterns and Actions384493 -Node: Pattern Overview385613 -Node: Regexp Patterns387292 -Node: Expression Patterns387835 -Node: Ranges391615 -Node: BEGIN/END394722 -Node: Using BEGIN/END395483 -Ref: Using BEGIN/END-Footnote-1398219 -Node: I/O And BEGIN/END398325 -Node: BEGINFILE/ENDFILE400640 -Node: Empty403537 -Node: Using Shell Variables403854 -Node: Action Overview406127 -Node: Statements408453 -Node: If Statement410301 -Node: While Statement411796 -Node: Do Statement413824 -Node: For Statement414972 -Node: Switch Statement418130 -Node: Break Statement420512 -Node: Continue Statement422605 -Node: Next Statement424432 -Node: Nextfile Statement426813 -Node: Exit Statement429441 -Node: Built-in Variables431852 -Node: User-modified432985 -Ref: User-modified-Footnote-1440619 -Node: Auto-set440681 -Ref: Auto-set-Footnote-1453733 -Ref: Auto-set-Footnote-2453938 -Node: ARGC and ARGV453994 -Node: Pattern Action Summary458212 -Node: Arrays460645 -Node: Array Basics461974 -Node: Array Intro462818 -Ref: figure-array-elements464752 -Ref: Array Intro-Footnote-1467372 -Node: Reference to Elements467500 -Node: Assigning Elements469962 -Node: Array Example470453 -Node: Scanning an Array472212 -Node: Controlling Scanning475232 -Ref: Controlling Scanning-Footnote-1480626 -Node: Numeric Array Subscripts480942 -Node: Uninitialized Subscripts483127 -Node: Delete484744 -Ref: Delete-Footnote-1487493 -Node: Multidimensional487550 -Node: Multiscanning490647 -Node: Arrays of Arrays492236 -Node: Arrays Summary496990 -Node: Functions499081 -Node: Built-in500120 -Node: Calling Built-in501198 -Node: Numeric Functions503193 -Ref: Numeric Functions-Footnote-1507209 -Ref: Numeric Functions-Footnote-2507566 -Ref: Numeric Functions-Footnote-3507614 -Node: String Functions507886 -Ref: String Functions-Footnote-1531387 -Ref: String Functions-Footnote-2531516 -Ref: String Functions-Footnote-3531764 -Node: Gory Details531851 -Ref: table-sub-escapes533632 -Ref: table-sub-proposed535147 -Ref: table-posix-sub536509 -Ref: table-gensub-escapes538046 -Ref: Gory Details-Footnote-1538879 -Node: I/O Functions539030 -Ref: I/O Functions-Footnote-1546266 -Node: Time Functions546413 -Ref: Time Functions-Footnote-1556922 -Ref: Time Functions-Footnote-2556990 -Ref: Time Functions-Footnote-3557148 -Ref: Time Functions-Footnote-4557259 -Ref: Time Functions-Footnote-5557371 -Ref: Time Functions-Footnote-6557598 -Node: Bitwise Functions557864 -Ref: table-bitwise-ops558426 -Ref: Bitwise Functions-Footnote-1562754 -Node: Type Functions562926 -Node: I18N Functions564078 -Node: User-defined565725 -Node: Definition Syntax566530 -Ref: Definition Syntax-Footnote-1572189 -Node: Function Example572260 -Ref: Function Example-Footnote-1575181 -Node: Function Caveats575203 -Node: Calling A Function575721 -Node: Variable Scope576679 -Node: Pass By Value/Reference579672 -Node: Return Statement583169 -Node: Dynamic Typing586148 -Node: Indirect Calls587077 -Ref: Indirect Calls-Footnote-1596942 -Node: Functions Summary597070 -Node: Library Functions599772 -Ref: Library Functions-Footnote-1603380 -Ref: Library Functions-Footnote-2603523 -Node: Library Names603694 -Ref: Library Names-Footnote-1607152 -Ref: Library Names-Footnote-2607375 -Node: General Functions607461 -Node: Strtonum Function608564 -Node: Assert Function611586 -Node: Round Function614910 -Node: Cliff Random Function616451 -Node: Ordinal Functions617467 -Ref: Ordinal Functions-Footnote-1620530 -Ref: Ordinal Functions-Footnote-2620782 -Node: Join Function620993 -Ref: Join Function-Footnote-1622763 -Node: Getlocaltime Function622963 -Node: Readfile Function626707 -Node: Shell Quoting628679 -Node: Data File Management630080 -Node: Filetrans Function630712 -Node: Rewind Function634808 -Node: File Checking636194 -Ref: File Checking-Footnote-1637527 -Node: Empty Files637728 -Node: Ignoring Assigns639707 -Node: Getopt Function641257 -Ref: Getopt Function-Footnote-1652721 -Node: Passwd Functions652921 -Ref: Passwd Functions-Footnote-1661761 -Node: Group Functions661849 -Ref: Group Functions-Footnote-1669746 -Node: Walking Arrays669951 -Node: Library Functions Summary672957 -Node: Library Exercises674359 -Node: Sample Programs675639 -Node: Running Examples676409 -Node: Clones677137 -Node: Cut Program678361 -Node: Egrep Program688081 -Ref: Egrep Program-Footnote-1695584 -Node: Id Program695694 -Node: Split Program699370 -Ref: Split Program-Footnote-1702824 -Node: Tee Program702952 -Node: Uniq Program705741 -Node: Wc Program713160 -Ref: Wc Program-Footnote-1717410 -Node: Miscellaneous Programs717504 -Node: Dupword Program718717 -Node: Alarm Program720748 -Node: Translate Program725553 -Ref: Translate Program-Footnote-1730116 -Node: Labels Program730386 -Ref: Labels Program-Footnote-1733737 -Node: Word Sorting733821 -Node: History Sorting737891 -Node: Extract Program739726 -Node: Simple Sed747250 -Node: Igawk Program750320 -Ref: Igawk Program-Footnote-1764646 -Ref: Igawk Program-Footnote-2764847 -Ref: Igawk Program-Footnote-3764969 -Node: Anagram Program765084 -Node: Signature Program768145 -Node: Programs Summary769392 -Node: Programs Exercises770613 -Ref: Programs Exercises-Footnote-1774744 -Node: Advanced Features774835 -Node: Nondecimal Data776817 -Node: Array Sorting778407 -Node: Controlling Array Traversal779107 -Ref: Controlling Array Traversal-Footnote-1787473 -Node: Array Sorting Functions787591 -Ref: Array Sorting Functions-Footnote-1791477 -Node: Two-way I/O791673 -Ref: Two-way I/O-Footnote-1796618 -Ref: Two-way I/O-Footnote-2796804 -Node: TCP/IP Networking796886 -Node: Profiling799758 -Node: Advanced Features Summary807299 -Node: Internationalization809232 -Node: I18N and L10N810712 -Node: Explaining gettext811398 -Ref: Explaining gettext-Footnote-1816423 -Ref: Explaining gettext-Footnote-2816607 -Node: Programmer i18n816772 -Ref: Programmer i18n-Footnote-1821648 -Node: Translator i18n821697 -Node: String Extraction822491 -Ref: String Extraction-Footnote-1823622 -Node: Printf Ordering823708 -Ref: Printf Ordering-Footnote-1826494 -Node: I18N Portability826558 -Ref: I18N Portability-Footnote-1829014 -Node: I18N Example829077 -Ref: I18N Example-Footnote-1831880 -Node: Gawk I18N831952 -Node: I18N Summary832596 -Node: Debugger833936 -Node: Debugging834958 -Node: Debugging Concepts835399 -Node: Debugging Terms837209 -Node: Awk Debugging839781 -Node: Sample Debugging Session840687 -Node: Debugger Invocation841221 -Node: Finding The Bug842606 -Node: List of Debugger Commands849085 -Node: Breakpoint Control850417 -Node: Debugger Execution Control854094 -Node: Viewing And Changing Data857453 -Node: Execution Stack860829 -Node: Debugger Info862464 -Node: Miscellaneous Debugger Commands866509 -Node: Readline Support871510 -Node: Limitations872404 -Node: Debugging Summary874519 -Node: Arbitrary Precision Arithmetic875693 -Node: Computer Arithmetic877109 -Ref: table-numeric-ranges880708 -Ref: Computer Arithmetic-Footnote-1881232 -Node: Math Definitions881289 -Ref: table-ieee-formats884584 -Ref: Math Definitions-Footnote-1885188 -Node: MPFR features885293 -Node: FP Math Caution886964 -Ref: FP Math Caution-Footnote-1888014 -Node: Inexactness of computations888383 -Node: Inexact representation889342 -Node: Comparing FP Values890700 -Node: Errors accumulate891782 -Node: Getting Accuracy893214 -Node: Try To Round895918 -Node: Setting precision896817 -Ref: table-predefined-precision-strings897501 -Node: Setting the rounding mode899330 -Ref: table-gawk-rounding-modes899694 -Ref: Setting the rounding mode-Footnote-1903146 -Node: Arbitrary Precision Integers903325 -Ref: Arbitrary Precision Integers-Footnote-1906309 -Node: POSIX Floating Point Problems906458 -Ref: POSIX Floating Point Problems-Footnote-1910337 -Node: Floating point summary910375 -Node: Dynamic Extensions912562 -Node: Extension Intro914114 -Node: Plugin License915379 -Node: Extension Mechanism Outline916176 -Ref: figure-load-extension916604 -Ref: figure-register-new-function918084 -Ref: figure-call-new-function919088 -Node: Extension API Description921075 -Node: Extension API Functions Introduction922525 -Node: General Data Types927346 -Ref: General Data Types-Footnote-1933246 -Node: Memory Allocation Functions933545 -Ref: Memory Allocation Functions-Footnote-1936384 -Node: Constructor Functions936483 -Node: Registration Functions938222 -Node: Extension Functions938907 -Node: Exit Callback Functions941204 -Node: Extension Version String942452 -Node: Input Parsers943115 -Node: Output Wrappers952990 -Node: Two-way processors957503 -Node: Printing Messages959766 -Ref: Printing Messages-Footnote-1960842 -Node: Updating `ERRNO'960994 -Node: Requesting Values961734 -Ref: table-value-types-returned962461 -Node: Accessing Parameters963418 -Node: Symbol Table Access964652 -Node: Symbol table by name965166 -Node: Symbol table by cookie967186 -Ref: Symbol table by cookie-Footnote-1971331 -Node: Cached values971394 -Ref: Cached values-Footnote-1974890 -Node: Array Manipulation974981 -Ref: Array Manipulation-Footnote-1976079 -Node: Array Data Types976116 -Ref: Array Data Types-Footnote-1978771 -Node: Array Functions978863 -Node: Flattening Arrays982722 -Node: Creating Arrays989624 -Node: Extension API Variables994395 -Node: Extension Versioning995031 -Node: Extension API Informational Variables996922 -Node: Extension API Boilerplate997987 -Node: Finding Extensions1001796 -Node: Extension Example1002356 -Node: Internal File Description1003128 -Node: Internal File Ops1007195 -Ref: Internal File Ops-Footnote-11018946 -Node: Using Internal File Ops1019086 -Ref: Using Internal File Ops-Footnote-11021469 -Node: Extension Samples1021742 -Node: Extension Sample File Functions1023270 -Node: Extension Sample Fnmatch1030951 -Node: Extension Sample Fork1032439 -Node: Extension Sample Inplace1033654 -Node: Extension Sample Ord1035330 -Node: Extension Sample Readdir1036166 -Ref: table-readdir-file-types1037043 -Node: Extension Sample Revout1037854 -Node: Extension Sample Rev2way1038443 -Node: Extension Sample Read write array1039183 -Node: Extension Sample Readfile1041123 -Node: Extension Sample Time1042218 -Node: Extension Sample API Tests1043566 -Node: gawkextlib1044057 -Node: Extension summary1046735 -Node: Extension Exercises1050424 -Node: Language History1051146 -Node: V7/SVR3.11052802 -Node: SVR41054955 -Node: POSIX1056389 -Node: BTL1057770 -Node: POSIX/GNU1058501 -Node: Feature History1064022 -Node: Common Extensions1077120 -Node: Ranges and Locales1078492 -Ref: Ranges and Locales-Footnote-11083111 -Ref: Ranges and Locales-Footnote-21083138 -Ref: Ranges and Locales-Footnote-31083373 -Node: Contributors1083594 -Node: History summary1089134 -Node: Installation1090513 -Node: Gawk Distribution1091459 -Node: Getting1091943 -Node: Extracting1092766 -Node: Distribution contents1094403 -Node: Unix Installation1100157 -Node: Quick Installation1100774 -Node: Additional Configuration Options1103198 -Node: Configuration Philosophy1105001 -Node: Non-Unix Installation1107370 -Node: PC Installation1107828 -Node: PC Binary Installation1109148 -Node: PC Compiling1110996 -Ref: PC Compiling-Footnote-11114017 -Node: PC Testing1114126 -Node: PC Using1115302 -Node: Cygwin1119417 -Node: MSYS1120187 -Node: VMS Installation1120688 -Node: VMS Compilation1121480 -Ref: VMS Compilation-Footnote-11122709 -Node: VMS Dynamic Extensions1122767 -Node: VMS Installation Details1124451 -Node: VMS Running1126702 -Node: VMS GNV1129542 -Node: VMS Old Gawk1130277 -Node: Bugs1130747 -Node: Other Versions1134636 -Node: Installation summary1141070 -Node: Notes1142129 -Node: Compatibility Mode1142994 -Node: Additions1143776 -Node: Accessing The Source1144701 -Node: Adding Code1146136 -Node: New Ports1152293 -Node: Derived Files1156775 -Ref: Derived Files-Footnote-11162250 -Ref: Derived Files-Footnote-21162284 -Ref: Derived Files-Footnote-31162880 -Node: Future Extensions1162994 -Node: Implementation Limitations1163600 -Node: Extension Design1164848 -Node: Old Extension Problems1166002 -Ref: Old Extension Problems-Footnote-11167519 -Node: Extension New Mechanism Goals1167576 -Ref: Extension New Mechanism Goals-Footnote-11170936 -Node: Extension Other Design Decisions1171125 -Node: Extension Future Growth1173233 -Node: Old Extension Mechanism1174069 -Node: Notes summary1175831 -Node: Basic Concepts1177017 -Node: Basic High Level1177698 -Ref: figure-general-flow1177970 -Ref: figure-process-flow1178569 -Ref: Basic High Level-Footnote-11181798 -Node: Basic Data Typing1181983 -Node: Glossary1185311 -Node: Copying1217240 -Node: GNU Free Documentation License1254796 -Node: Index1279932 +Ref: Names-Footnote-154929 +Node: This Manual55075 +Ref: This Manual-Footnote-161575 +Node: Conventions61675 +Node: Manual History64012 +Ref: Manual History-Footnote-167005 +Ref: Manual History-Footnote-267046 +Node: How To Contribute67120 +Node: Acknowledgments68249 +Node: Getting Started73115 +Node: Running gawk75554 +Node: One-shot76744 +Node: Read Terminal78008 +Node: Long80039 +Node: Executable Scripts81552 +Ref: Executable Scripts-Footnote-184341 +Node: Comments84444 +Node: Quoting86926 +Node: DOS Quoting92444 +Node: Sample Data Files93119 +Node: Very Simple95714 +Node: Two Rules100613 +Node: More Complex102499 +Node: Statements/Lines105361 +Ref: Statements/Lines-Footnote-1109816 +Node: Other Features110081 +Node: When111017 +Ref: When-Footnote-1112771 +Node: Intro Summary112836 +Node: Invoking Gawk113720 +Node: Command Line115234 +Node: Options116032 +Ref: Options-Footnote-1131954 +Ref: Options-Footnote-2132183 +Node: Other Arguments132208 +Node: Naming Standard Input135156 +Node: Environment Variables136249 +Node: AWKPATH Variable136807 +Ref: AWKPATH Variable-Footnote-1140104 +Ref: AWKPATH Variable-Footnote-2140149 +Node: AWKLIBPATH Variable140409 +Node: Other Environment Variables141552 +Node: Exit Status145310 +Node: Include Files145986 +Node: Loading Shared Libraries149575 +Node: Obsolete151002 +Node: Undocumented151694 +Node: Invoking Summary151961 +Node: Regexp153624 +Node: Regexp Usage155078 +Node: Escape Sequences157115 +Node: Regexp Operators163125 +Ref: Regexp Operators-Footnote-1170535 +Ref: Regexp Operators-Footnote-2170682 +Node: Bracket Expressions170780 +Ref: table-char-classes172795 +Node: Leftmost Longest175737 +Node: Computed Regexps177039 +Node: GNU Regexp Operators180468 +Node: Case-sensitivity184140 +Ref: Case-sensitivity-Footnote-1187025 +Ref: Case-sensitivity-Footnote-2187260 +Node: Regexp Summary187368 +Node: Reading Files188835 +Node: Records190928 +Node: awk split records191661 +Node: gawk split records196590 +Ref: gawk split records-Footnote-1201129 +Node: Fields201166 +Ref: Fields-Footnote-1203944 +Node: Nonconstant Fields204030 +Ref: Nonconstant Fields-Footnote-1206268 +Node: Changing Fields206471 +Node: Field Separators212402 +Node: Default Field Splitting215106 +Node: Regexp Field Splitting216223 +Node: Single Character Fields219573 +Node: Command Line Field Separator220632 +Node: Full Line Fields223849 +Ref: Full Line Fields-Footnote-1225370 +Ref: Full Line Fields-Footnote-2225416 +Node: Field Splitting Summary225517 +Node: Constant Size227591 +Node: Splitting By Content232174 +Ref: Splitting By Content-Footnote-1236139 +Node: Multiple Line236302 +Ref: Multiple Line-Footnote-1242183 +Node: Getline242362 +Node: Plain Getline244569 +Node: Getline/Variable247209 +Node: Getline/File248358 +Node: Getline/Variable/File249743 +Ref: Getline/Variable/File-Footnote-1251346 +Node: Getline/Pipe251433 +Node: Getline/Variable/Pipe254111 +Node: Getline/Coprocess255242 +Node: Getline/Variable/Coprocess256506 +Node: Getline Notes257245 +Node: Getline Summary260039 +Ref: table-getline-variants260451 +Node: Read Timeout261280 +Ref: Read Timeout-Footnote-1265117 +Node: Command-line directories265175 +Node: Input Summary266080 +Node: Input Exercises269465 +Node: Printing270193 +Node: Print271970 +Node: Print Examples273427 +Node: Output Separators276206 +Node: OFMT278224 +Node: Printf279579 +Node: Basic Printf280364 +Node: Control Letters281936 +Node: Format Modifiers285921 +Node: Printf Examples291927 +Node: Redirection294413 +Node: Special FD301251 +Ref: Special FD-Footnote-1304417 +Node: Special Files304491 +Node: Other Inherited Files305108 +Node: Special Network306108 +Node: Special Caveats306970 +Node: Close Files And Pipes307919 +Ref: Close Files And Pipes-Footnote-1315110 +Ref: Close Files And Pipes-Footnote-2315258 +Node: Output Summary315408 +Node: Output Exercises316406 +Node: Expressions317086 +Node: Values318275 +Node: Constants318952 +Node: Scalar Constants319643 +Ref: Scalar Constants-Footnote-1320505 +Node: Nondecimal-numbers320755 +Node: Regexp Constants323765 +Node: Using Constant Regexps324291 +Node: Variables327454 +Node: Using Variables328111 +Node: Assignment Options330022 +Node: Conversion331897 +Node: Strings And Numbers332421 +Ref: Strings And Numbers-Footnote-1335486 +Node: Locale influences conversions335595 +Ref: table-locale-affects338341 +Node: All Operators338933 +Node: Arithmetic Ops339562 +Node: Concatenation342067 +Ref: Concatenation-Footnote-1344886 +Node: Assignment Ops344993 +Ref: table-assign-ops349972 +Node: Increment Ops351282 +Node: Truth Values and Conditions354713 +Node: Truth Values355796 +Node: Typing and Comparison356845 +Node: Variable Typing357661 +Node: Comparison Operators361328 +Ref: table-relational-ops361738 +Node: POSIX String Comparison365233 +Ref: POSIX String Comparison-Footnote-1366305 +Node: Boolean Ops366444 +Ref: Boolean Ops-Footnote-1370922 +Node: Conditional Exp371013 +Node: Function Calls372751 +Node: Precedence376631 +Node: Locales380291 +Node: Expressions Summary381923 +Node: Patterns and Actions384494 +Node: Pattern Overview385614 +Node: Regexp Patterns387293 +Node: Expression Patterns387836 +Node: Ranges391616 +Node: BEGIN/END394723 +Node: Using BEGIN/END395484 +Ref: Using BEGIN/END-Footnote-1398220 +Node: I/O And BEGIN/END398326 +Node: BEGINFILE/ENDFILE400641 +Node: Empty403538 +Node: Using Shell Variables403855 +Node: Action Overview406128 +Node: Statements408454 +Node: If Statement410302 +Node: While Statement411797 +Node: Do Statement413825 +Node: For Statement414973 +Node: Switch Statement418131 +Node: Break Statement420513 +Node: Continue Statement422606 +Node: Next Statement424433 +Node: Nextfile Statement426814 +Node: Exit Statement429442 +Node: Built-in Variables431853 +Node: User-modified432986 +Ref: User-modified-Footnote-1440620 +Node: Auto-set440682 +Ref: Auto-set-Footnote-1453734 +Ref: Auto-set-Footnote-2453939 +Node: ARGC and ARGV453995 +Node: Pattern Action Summary458213 +Node: Arrays460646 +Node: Array Basics461975 +Node: Array Intro462819 +Ref: figure-array-elements464753 +Ref: Array Intro-Footnote-1467373 +Node: Reference to Elements467501 +Node: Assigning Elements469963 +Node: Array Example470454 +Node: Scanning an Array472213 +Node: Controlling Scanning475233 +Ref: Controlling Scanning-Footnote-1480627 +Node: Numeric Array Subscripts480943 +Node: Uninitialized Subscripts483128 +Node: Delete484745 +Ref: Delete-Footnote-1487494 +Node: Multidimensional487551 +Node: Multiscanning490648 +Node: Arrays of Arrays492237 +Node: Arrays Summary496991 +Node: Functions499082 +Node: Built-in500121 +Node: Calling Built-in501199 +Node: Numeric Functions503194 +Ref: Numeric Functions-Footnote-1507210 +Ref: Numeric Functions-Footnote-2507567 +Ref: Numeric Functions-Footnote-3507615 +Node: String Functions507887 +Ref: String Functions-Footnote-1531388 +Ref: String Functions-Footnote-2531517 +Ref: String Functions-Footnote-3531765 +Node: Gory Details531852 +Ref: table-sub-escapes533633 +Ref: table-sub-proposed535148 +Ref: table-posix-sub536510 +Ref: table-gensub-escapes538047 +Ref: Gory Details-Footnote-1538880 +Node: I/O Functions539031 +Ref: I/O Functions-Footnote-1546267 +Node: Time Functions546414 +Ref: Time Functions-Footnote-1556923 +Ref: Time Functions-Footnote-2556991 +Ref: Time Functions-Footnote-3557149 +Ref: Time Functions-Footnote-4557260 +Ref: Time Functions-Footnote-5557372 +Ref: Time Functions-Footnote-6557599 +Node: Bitwise Functions557865 +Ref: table-bitwise-ops558427 +Ref: Bitwise Functions-Footnote-1562755 +Node: Type Functions562927 +Node: I18N Functions564079 +Node: User-defined565726 +Node: Definition Syntax566531 +Ref: Definition Syntax-Footnote-1572190 +Node: Function Example572261 +Ref: Function Example-Footnote-1575182 +Node: Function Caveats575204 +Node: Calling A Function575722 +Node: Variable Scope576680 +Node: Pass By Value/Reference579673 +Node: Return Statement583170 +Node: Dynamic Typing586149 +Node: Indirect Calls587078 +Ref: Indirect Calls-Footnote-1596943 +Node: Functions Summary597071 +Node: Library Functions599773 +Ref: Library Functions-Footnote-1603381 +Ref: Library Functions-Footnote-2603524 +Node: Library Names603695 +Ref: Library Names-Footnote-1607153 +Ref: Library Names-Footnote-2607376 +Node: General Functions607462 +Node: Strtonum Function608565 +Node: Assert Function611587 +Node: Round Function614911 +Node: Cliff Random Function616452 +Node: Ordinal Functions617468 +Ref: Ordinal Functions-Footnote-1620531 +Ref: Ordinal Functions-Footnote-2620783 +Node: Join Function620994 +Ref: Join Function-Footnote-1622764 +Node: Getlocaltime Function622964 +Node: Readfile Function626708 +Node: Shell Quoting628680 +Node: Data File Management630081 +Node: Filetrans Function630713 +Node: Rewind Function634809 +Node: File Checking636195 +Ref: File Checking-Footnote-1637528 +Node: Empty Files637729 +Node: Ignoring Assigns639708 +Node: Getopt Function641258 +Ref: Getopt Function-Footnote-1652722 +Node: Passwd Functions652922 +Ref: Passwd Functions-Footnote-1661762 +Node: Group Functions661850 +Ref: Group Functions-Footnote-1669747 +Node: Walking Arrays669952 +Node: Library Functions Summary672958 +Node: Library Exercises674360 +Node: Sample Programs675640 +Node: Running Examples676410 +Node: Clones677138 +Node: Cut Program678362 +Node: Egrep Program688082 +Ref: Egrep Program-Footnote-1695585 +Node: Id Program695695 +Node: Split Program699371 +Ref: Split Program-Footnote-1702825 +Node: Tee Program702953 +Node: Uniq Program705742 +Node: Wc Program713161 +Ref: Wc Program-Footnote-1717411 +Node: Miscellaneous Programs717505 +Node: Dupword Program718718 +Node: Alarm Program720749 +Node: Translate Program725554 +Ref: Translate Program-Footnote-1730117 +Node: Labels Program730387 +Ref: Labels Program-Footnote-1733738 +Node: Word Sorting733822 +Node: History Sorting737892 +Node: Extract Program739727 +Node: Simple Sed747251 +Node: Igawk Program750321 +Ref: Igawk Program-Footnote-1764647 +Ref: Igawk Program-Footnote-2764848 +Ref: Igawk Program-Footnote-3764970 +Node: Anagram Program765085 +Node: Signature Program768146 +Node: Programs Summary769393 +Node: Programs Exercises770614 +Ref: Programs Exercises-Footnote-1774745 +Node: Advanced Features774836 +Node: Nondecimal Data776818 +Node: Array Sorting778408 +Node: Controlling Array Traversal779108 +Ref: Controlling Array Traversal-Footnote-1787474 +Node: Array Sorting Functions787592 +Ref: Array Sorting Functions-Footnote-1791478 +Node: Two-way I/O791674 +Ref: Two-way I/O-Footnote-1796619 +Ref: Two-way I/O-Footnote-2796805 +Node: TCP/IP Networking796887 +Node: Profiling799759 +Node: Advanced Features Summary807300 +Node: Internationalization809233 +Node: I18N and L10N810713 +Node: Explaining gettext811399 +Ref: Explaining gettext-Footnote-1816424 +Ref: Explaining gettext-Footnote-2816608 +Node: Programmer i18n816773 +Ref: Programmer i18n-Footnote-1821649 +Node: Translator i18n821698 +Node: String Extraction822492 +Ref: String Extraction-Footnote-1823623 +Node: Printf Ordering823709 +Ref: Printf Ordering-Footnote-1826495 +Node: I18N Portability826559 +Ref: I18N Portability-Footnote-1829015 +Node: I18N Example829078 +Ref: I18N Example-Footnote-1831881 +Node: Gawk I18N831953 +Node: I18N Summary832597 +Node: Debugger833937 +Node: Debugging834959 +Node: Debugging Concepts835400 +Node: Debugging Terms837210 +Node: Awk Debugging839782 +Node: Sample Debugging Session840688 +Node: Debugger Invocation841222 +Node: Finding The Bug842607 +Node: List of Debugger Commands849086 +Node: Breakpoint Control850418 +Node: Debugger Execution Control854095 +Node: Viewing And Changing Data857454 +Node: Execution Stack860830 +Node: Debugger Info862465 +Node: Miscellaneous Debugger Commands866510 +Node: Readline Support871511 +Node: Limitations872405 +Node: Debugging Summary874520 +Node: Arbitrary Precision Arithmetic875694 +Node: Computer Arithmetic877110 +Ref: table-numeric-ranges880709 +Ref: Computer Arithmetic-Footnote-1881233 +Node: Math Definitions881290 +Ref: table-ieee-formats884585 +Ref: Math Definitions-Footnote-1885189 +Node: MPFR features885294 +Node: FP Math Caution886965 +Ref: FP Math Caution-Footnote-1888015 +Node: Inexactness of computations888384 +Node: Inexact representation889343 +Node: Comparing FP Values890701 +Node: Errors accumulate891783 +Node: Getting Accuracy893215 +Node: Try To Round895919 +Node: Setting precision896818 +Ref: table-predefined-precision-strings897502 +Node: Setting the rounding mode899331 +Ref: table-gawk-rounding-modes899695 +Ref: Setting the rounding mode-Footnote-1903147 +Node: Arbitrary Precision Integers903326 +Ref: Arbitrary Precision Integers-Footnote-1906310 +Node: POSIX Floating Point Problems906459 +Ref: POSIX Floating Point Problems-Footnote-1910338 +Node: Floating point summary910376 +Node: Dynamic Extensions912563 +Node: Extension Intro914115 +Node: Plugin License915380 +Node: Extension Mechanism Outline916177 +Ref: figure-load-extension916605 +Ref: figure-register-new-function918085 +Ref: figure-call-new-function919089 +Node: Extension API Description921076 +Node: Extension API Functions Introduction922526 +Node: General Data Types927347 +Ref: General Data Types-Footnote-1933247 +Node: Memory Allocation Functions933546 +Ref: Memory Allocation Functions-Footnote-1936385 +Node: Constructor Functions936484 +Node: Registration Functions938223 +Node: Extension Functions938908 +Node: Exit Callback Functions941205 +Node: Extension Version String942453 +Node: Input Parsers943116 +Node: Output Wrappers952991 +Node: Two-way processors957504 +Node: Printing Messages959767 +Ref: Printing Messages-Footnote-1960843 +Node: Updating `ERRNO'960995 +Node: Requesting Values961735 +Ref: table-value-types-returned962462 +Node: Accessing Parameters963419 +Node: Symbol Table Access964653 +Node: Symbol table by name965167 +Node: Symbol table by cookie967187 +Ref: Symbol table by cookie-Footnote-1971332 +Node: Cached values971395 +Ref: Cached values-Footnote-1974891 +Node: Array Manipulation974982 +Ref: Array Manipulation-Footnote-1976080 +Node: Array Data Types976117 +Ref: Array Data Types-Footnote-1978772 +Node: Array Functions978864 +Node: Flattening Arrays982723 +Node: Creating Arrays989625 +Node: Extension API Variables994396 +Node: Extension Versioning995032 +Node: Extension API Informational Variables996923 +Node: Extension API Boilerplate997988 +Node: Finding Extensions1001797 +Node: Extension Example1002357 +Node: Internal File Description1003129 +Node: Internal File Ops1007196 +Ref: Internal File Ops-Footnote-11018947 +Node: Using Internal File Ops1019087 +Ref: Using Internal File Ops-Footnote-11021470 +Node: Extension Samples1021743 +Node: Extension Sample File Functions1023271 +Node: Extension Sample Fnmatch1030952 +Node: Extension Sample Fork1032440 +Node: Extension Sample Inplace1033655 +Node: Extension Sample Ord1035331 +Node: Extension Sample Readdir1036167 +Ref: table-readdir-file-types1037044 +Node: Extension Sample Revout1037855 +Node: Extension Sample Rev2way1038444 +Node: Extension Sample Read write array1039184 +Node: Extension Sample Readfile1041124 +Node: Extension Sample Time1042219 +Node: Extension Sample API Tests1043567 +Node: gawkextlib1044058 +Node: Extension summary1046736 +Node: Extension Exercises1050425 +Node: Language History1051147 +Node: V7/SVR3.11052803 +Node: SVR41054956 +Node: POSIX1056390 +Node: BTL1057771 +Node: POSIX/GNU1058502 +Node: Feature History1064023 +Node: Common Extensions1077121 +Node: Ranges and Locales1078493 +Ref: Ranges and Locales-Footnote-11083112 +Ref: Ranges and Locales-Footnote-21083139 +Ref: Ranges and Locales-Footnote-31083374 +Node: Contributors1083595 +Node: History summary1089135 +Node: Installation1090514 +Node: Gawk Distribution1091460 +Node: Getting1091944 +Node: Extracting1092767 +Node: Distribution contents1094404 +Node: Unix Installation1100158 +Node: Quick Installation1100775 +Node: Additional Configuration Options1103199 +Node: Configuration Philosophy1105002 +Node: Non-Unix Installation1107371 +Node: PC Installation1107829 +Node: PC Binary Installation1109149 +Node: PC Compiling1110997 +Ref: PC Compiling-Footnote-11114018 +Node: PC Testing1114127 +Node: PC Using1115303 +Node: Cygwin1119418 +Node: MSYS1120188 +Node: VMS Installation1120689 +Node: VMS Compilation1121481 +Ref: VMS Compilation-Footnote-11122710 +Node: VMS Dynamic Extensions1122768 +Node: VMS Installation Details1124452 +Node: VMS Running1126703 +Node: VMS GNV1129543 +Node: VMS Old Gawk1130278 +Node: Bugs1130748 +Node: Other Versions1134637 +Node: Installation summary1141071 +Node: Notes1142130 +Node: Compatibility Mode1142995 +Node: Additions1143777 +Node: Accessing The Source1144702 +Node: Adding Code1146137 +Node: New Ports1152294 +Node: Derived Files1156776 +Ref: Derived Files-Footnote-11162251 +Ref: Derived Files-Footnote-21162285 +Ref: Derived Files-Footnote-31162881 +Node: Future Extensions1162995 +Node: Implementation Limitations1163601 +Node: Extension Design1164849 +Node: Old Extension Problems1166003 +Ref: Old Extension Problems-Footnote-11167520 +Node: Extension New Mechanism Goals1167577 +Ref: Extension New Mechanism Goals-Footnote-11170937 +Node: Extension Other Design Decisions1171126 +Node: Extension Future Growth1173234 +Node: Old Extension Mechanism1174070 +Node: Notes summary1175832 +Node: Basic Concepts1177018 +Node: Basic High Level1177699 +Ref: figure-general-flow1177971 +Ref: figure-process-flow1178570 +Ref: Basic High Level-Footnote-11181799 +Node: Basic Data Typing1181984 +Node: Glossary1185312 +Node: Copying1217241 +Node: GNU Free Documentation License1254797 +Node: Index1279933  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index e951db1a..e5b39dd0 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -1519,7 +1519,7 @@ is often referred to as ``new @command{awk}.'' By analogy, the original version of @command{awk} is referred to as ``old @command{awk}.'' -Today, on most systems, when you run the @command{awk} utility +On most current systems, when you run the @command{awk} utility you get some version of new @command{awk}.@footnote{Only Solaris systems still use an old @command{awk} for the default @command{awk} utility. A more modern @command{awk} lives in diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 3319bf35..723de561 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -1486,7 +1486,7 @@ is often referred to as ``new @command{awk}.'' By analogy, the original version of @command{awk} is referred to as ``old @command{awk}.'' -Today, on most systems, when you run the @command{awk} utility +On most current systems, when you run the @command{awk} utility you get some version of new @command{awk}.@footnote{Only Solaris systems still use an old @command{awk} for the default @command{awk} utility. A more modern @command{awk} lives in -- cgit v1.2.3 From efefbfe40342975cc0ddbd69a9b0f2635d905d3c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Feb 2015 22:08:45 +0200 Subject: Fix line continuation with CR-LF. --- ChangeLog | 2 ++ awkgram.c | 7 ++++++- awkgram.y | 7 ++++++- test/ChangeLog | 5 +++++ test/Makefile.am | 4 +++- test/Makefile.in | 9 ++++++++- test/Maketests | 5 +++++ test/crlf.awk | 11 +++++++++++ test/crlf.ok | 3 +++ 9 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 test/crlf.awk create mode 100644 test/crlf.ok diff --git a/ChangeLog b/ChangeLog index ac0e13bf..610cc4fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2015-02-24 Arnold D. Robbins * POSIX.STD: Update copyright year. + * awkgram.y (yylex): Allow \r after \\ line continuation everywhere. + Thanks to Scott Rush for the report. 2015-02-13 Arnold D. Robbins diff --git a/awkgram.c b/awkgram.c index b3283eb2..5376d010 100644 --- a/awkgram.c +++ b/awkgram.c @@ -5400,7 +5400,10 @@ yylex(void) pushback(); yyerror(_("unterminated regexp ends with `\\' at end of file")); goto end_regexp; /* kludge */ - } else if (c == '\n') { + } + if (c == '\r') /* allow MS-DOS files. bleah */ + c = nextc(true); + if (c == '\n') { sourceline++; continue; } else { @@ -5731,6 +5734,8 @@ retry: if ((gawk_mb_cur_max == 1 || nextc_is_1stbyte) && c == '\\') { c = nextc(true); + if (c == '\r') /* allow MS-DOS files. bleah */ + c = nextc(true); if (c == '\n') { sourceline++; continue; diff --git a/awkgram.y b/awkgram.y index 0df72b42..2307c362 100644 --- a/awkgram.y +++ b/awkgram.y @@ -3061,7 +3061,10 @@ yylex(void) pushback(); yyerror(_("unterminated regexp ends with `\\' at end of file")); goto end_regexp; /* kludge */ - } else if (c == '\n') { + } + if (c == '\r') /* allow MS-DOS files. bleah */ + c = nextc(true); + if (c == '\n') { sourceline++; continue; } else { @@ -3392,6 +3395,8 @@ retry: if ((gawk_mb_cur_max == 1 || nextc_is_1stbyte) && c == '\\') { c = nextc(true); + if (c == '\r') /* allow MS-DOS files. bleah */ + c = nextc(true); if (c == '\n') { sourceline++; continue; diff --git a/test/ChangeLog b/test/ChangeLog index 0d6934e9..84e416b3 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-02-24 Arnold D. Robbins + + * Makefile.am (crlf): New test. + * crlf.awk, crlf.ok: New files. + 2015-02-10 Arnold D. Robbins * Makefile.am (profile0): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 419265f9..499c004a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -169,6 +169,8 @@ EXTRA_DIST = \ concat4.ok \ convfmt.awk \ convfmt.ok \ + crlf.awk \ + crlf.ok \ datanonl.awk \ datanonl.in \ datanonl.ok \ @@ -1030,7 +1032,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ diff --git a/test/Makefile.in b/test/Makefile.in index 598285ed..cc1ab711 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -426,6 +426,8 @@ EXTRA_DIST = \ concat4.ok \ convfmt.awk \ convfmt.ok \ + crlf.awk \ + crlf.ok \ datanonl.awk \ datanonl.in \ datanonl.ok \ @@ -1286,7 +1288,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ @@ -3429,6 +3431,11 @@ backw: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +crlf: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + delsub: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index f3639b0f..adf95cc5 100644 --- a/test/Maketests +++ b/test/Maketests @@ -962,6 +962,11 @@ backw: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +crlf: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + delsub: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/crlf.awk b/test/crlf.awk new file mode 100644 index 00000000..79be9eb6 --- /dev/null +++ b/test/crlf.awk @@ -0,0 +1,11 @@ +BEGIN { + print \ + "hi there" + print "hello \ +world" + if ("foo" ~ /fo\ +o/) + print "matches" + else + print "does not match!" +} diff --git a/test/crlf.ok b/test/crlf.ok new file mode 100644 index 00000000..0ba071b5 --- /dev/null +++ b/test/crlf.ok @@ -0,0 +1,3 @@ +hi there +hello world +matches -- cgit v1.2.3 From dba3b902a0b7a4761829541c06466fd6d76c468b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Feb 2015 22:15:15 +0200 Subject: Add a FIXME in the doc for @sup. One day... --- doc/ChangeLog | 1 + doc/gawk.texi | 4 ++++ doc/gawktexi.in | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 46e57c1b..bee6e3e0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,6 +2,7 @@ * texinfo.tex: Update to most current version. * gawktexi.in: Minor edit to match an O'Reilly fix. + Add some FIXMEs to one day use @sup. 2015-02-22 Arnold D. Robbins diff --git a/doc/gawk.texi b/doc/gawk.texi index e5b39dd0..27aaa74f 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -11782,6 +11782,7 @@ has the value four, but it changes the value of @code{foo} to five. In other words, the operator returns the old value of the variable, but with the side effect of incrementing it. +@c FIXME: Use @sup here for superscript The post-increment @samp{foo++} is nearly the same as writing @samp{(foo += 1) - 1}. It is not perfectly equivalent because all numbers in @command{awk} are floating point---in floating point, @samp{foo + 1 - 1} does @@ -18558,6 +18559,7 @@ 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. +@c FIXME: Use @sup here for superscript @cindex @command{date} utility, GNU @cindex time, retrieving @@ -30210,6 +30212,7 @@ signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. @end ifnottex @ifdocbook @item Single-precision floating point (approximate) @tab +@c FIXME: Use @sup here for superscript @docbook 1.175494-38 @end docbook @@ -30828,6 +30831,7 @@ the following computes @end docbook the result of which is beyond the limits of ordinary hardware double-precision floating-point values: +@c FIXME: Use @sup here for superscript @example $ @kbd{gawk -M 'BEGIN @{} diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 723de561..450d1e5d 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -11168,6 +11168,7 @@ has the value four, but it changes the value of @code{foo} to five. In other words, the operator returns the old value of the variable, but with the side effect of incrementing it. +@c FIXME: Use @sup here for superscript The post-increment @samp{foo++} is nearly the same as writing @samp{(foo += 1) - 1}. It is not perfectly equivalent because all numbers in @command{awk} are floating point---in floating point, @samp{foo + 1 - 1} does @@ -17679,6 +17680,7 @@ 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. +@c FIXME: Use @sup here for superscript @cindex @command{date} utility, GNU @cindex time, retrieving @@ -29301,6 +29303,7 @@ signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. @end ifnottex @ifdocbook @item Single-precision floating point (approximate) @tab +@c FIXME: Use @sup here for superscript @docbook 1.175494-38 @end docbook @@ -29919,6 +29922,7 @@ the following computes @end docbook the result of which is beyond the limits of ordinary hardware double-precision floating-point values: +@c FIXME: Use @sup here for superscript @example $ @kbd{gawk -M 'BEGIN @{} -- cgit v1.2.3 From f2e925905fe241c1723a6597a923dc5f3ebe56bf Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 26 Feb 2015 20:20:01 +0200 Subject: Fixes for building a tarball. --- extension/ChangeLog | 4 ++++ extension/Makefile.am | 3 ++- extension/Makefile.in | 3 ++- test/ChangeLog | 5 +++++ test/Makefile.am | 1 + test/Makefile.in | 1 + 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 22eee5e4..749871dc 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,7 @@ +2015-02-26 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): Add rwarray0.c to the list. + 2015-02-11 Arnold D. Robbins * filefuncs.c: Punctuation fix. diff --git a/extension/Makefile.am b/extension/Makefile.am index b9dabfe2..3e64bc9b 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -119,7 +119,8 @@ EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ fts.3 \ - README.fts + README.fts \ + rwarray0.c dist_man_MANS = \ filefuncs.3am fnmatch.3am fork.3am inplace.3am \ diff --git a/extension/Makefile.in b/extension/Makefile.in index 2a6ef5e0..cda5020b 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -564,7 +564,8 @@ EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ fts.3 \ - README.fts + README.fts \ + rwarray0.c dist_man_MANS = \ filefuncs.3am fnmatch.3am fork.3am inplace.3am \ diff --git a/test/ChangeLog b/test/ChangeLog index 84e416b3..6fa24a49 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-02-26 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): Add profile0.in which got forgotten + earlier. Ooops. + 2015-02-24 Arnold D. Robbins * Makefile.am (crlf): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 499c004a..71cfa513 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -713,6 +713,7 @@ EXTRA_DIST = \ procinfs.awk \ procinfs.ok \ profile0.awk \ + profile0.in \ profile0.ok \ profile2.ok \ profile3.awk \ diff --git a/test/Makefile.in b/test/Makefile.in index cc1ab711..7ac2ad7d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -970,6 +970,7 @@ EXTRA_DIST = \ procinfs.awk \ procinfs.ok \ profile0.awk \ + profile0.in \ profile0.ok \ profile2.ok \ profile3.awk \ -- cgit v1.2.3 From 78dc6b1d4a6215144a76abc3d384c202a7949c5b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 26 Feb 2015 20:20:35 +0200 Subject: Bump test version. --- configure | 20 ++++++++++---------- configure.ac | 2 +- pc/config.h | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/configure b/configure index f4597b70..b51250ae 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU Awk 4.1.1b. +# Generated by GNU Autoconf 2.69 for GNU Awk 4.1.1c. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GNU Awk' PACKAGE_TARNAME='gawk' -PACKAGE_VERSION='4.1.1b' -PACKAGE_STRING='GNU Awk 4.1.1b' +PACKAGE_VERSION='4.1.1c' +PACKAGE_STRING='GNU Awk 4.1.1c' PACKAGE_BUGREPORT='bug-gawk@gnu.org' PACKAGE_URL='http://www.gnu.org/software/gawk/' @@ -1326,7 +1326,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Awk 4.1.1b to adapt to many kinds of systems. +\`configure' configures GNU Awk 4.1.1c to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1396,7 +1396,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Awk 4.1.1b:";; + short | recursive ) echo "Configuration of GNU Awk 4.1.1c:";; esac cat <<\_ACEOF @@ -1515,7 +1515,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU Awk configure 4.1.1b +GNU Awk configure 4.1.1c generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2224,7 +2224,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Awk $as_me 4.1.1b, which was +It was created by GNU Awk $as_me 4.1.1c, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3107,7 +3107,7 @@ fi # Define the identity of the package. PACKAGE='gawk' - VERSION='4.1.1b' + VERSION='4.1.1c' cat >>confdefs.h <<_ACEOF @@ -11830,7 +11830,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU Awk $as_me 4.1.1b, which was +This file was extended by GNU Awk $as_me 4.1.1c, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11898,7 +11898,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU Awk config.status 4.1.1b +GNU Awk config.status 4.1.1c configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index f6322bf2..8dd79aae 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ dnl dnl Process this file with autoconf to produce a configure script. -AC_INIT([GNU Awk], 4.1.1b, bug-gawk@gnu.org, gawk) +AC_INIT([GNU Awk], 4.1.1c, bug-gawk@gnu.org, gawk) # This is a hack. Different versions of install on different systems # are just too different. Chuck it and use install-sh. diff --git a/pc/config.h b/pc/config.h index ffd67112..95811f06 100644 --- a/pc/config.h +++ b/pc/config.h @@ -429,7 +429,7 @@ #define PACKAGE_NAME "GNU Awk" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "GNU Awk 4.1.1b" +#define PACKAGE_STRING "GNU Awk 4.1.1c" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gawk" @@ -438,7 +438,7 @@ #define PACKAGE_URL "http://www.gnu.org/software/gawk/" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.1.1b" +#define PACKAGE_VERSION "4.1.1c" /* Define to 1 if *printf supports %F format */ #undef PRINTF_HAS_F_FORMAT @@ -500,7 +500,7 @@ /* Version number of package */ -#define VERSION "4.1.1b" +#define VERSION "4.1.1c" /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE -- cgit v1.2.3 From dde4cb3f47a675095230fa849995b74e4a38b966 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 26 Feb 2015 20:20:59 +0200 Subject: Update po/* for tarball. --- po/ca.gmo | Bin 83005 -> 82049 bytes po/ca.po | 1077 ++++++++++++++++++++++------------------- po/da.gmo | Bin 42160 -> 41373 bytes po/da.po | 1079 +++++++++++++++++++++-------------------- po/de.gmo | Bin 45199 -> 83971 bytes po/de.po | 1561 ++++++++++++++++++++++++++++++++++------------------------- po/es.gmo | Bin 44600 -> 43722 bytes po/es.po | 1084 +++++++++++++++++++++-------------------- po/fi.gmo | Bin 84555 -> 83703 bytes po/fi.po | 1082 +++++++++++++++++++++-------------------- po/fr.gmo | Bin 85628 -> 84606 bytes po/fr.po | 1077 ++++++++++++++++++++++------------------- po/gawk.pot | 1040 ++++++++++++++++++++------------------- po/it.gmo | Bin 81018 -> 81863 bytes po/it.po | 707 ++++++++++++++------------- po/ja.gmo | Bin 52559 -> 51602 bytes po/ja.po | 1079 +++++++++++++++++++++-------------------- po/ms.gmo | Bin 1184 -> 1183 bytes po/ms.po | 1038 ++++++++++++++++++++------------------- po/nl.gmo | Bin 80863 -> 80070 bytes po/nl.po | 1082 +++++++++++++++++++++-------------------- po/pl.gmo | Bin 71101 -> 70252 bytes po/pl.po | 1082 +++++++++++++++++++++-------------------- po/sv.gmo | Bin 80917 -> 79966 bytes po/sv.po | 1075 +++++++++++++++++++++------------------- po/vi.gmo | Bin 93025 -> 91989 bytes po/vi.po | 1077 ++++++++++++++++++++++------------------- 27 files changed, 8019 insertions(+), 7121 deletions(-) diff --git a/po/ca.gmo b/po/ca.gmo index 465f05a5..290d2016 100644 Binary files a/po/ca.gmo and b/po/ca.gmo differ diff --git a/po/ca.po b/po/ca.po index 444f09c4..31742b9c 100644 --- a/po/ca.po +++ b/po/ca.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-02-26 20:18+0100\n" "Last-Translator: Walter Garcia-Fontes \n" "Language-Team: Catalan \n" @@ -36,9 +36,9 @@ msgstr "s'ha intentat usar un par msgid "attempt to use scalar `%s' as an array" msgstr "s'ha intentat usar la dada escalar `%s' com a una matriu" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "s'ha intentat usar la matriu `%s' en un context escalar" @@ -97,415 +97,420 @@ msgstr "" "asorti: no es pot usar una submatriu com a segon argument per al primer " "argument" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "`%s' no és vàlid com a nom de funció" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "la funció de comparació d'ordenació `%s' no està definida" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "%s blocs han de tenir una part d'acció" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "cada regla ha de tenir un patró o una part d'acció" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "l'antic awk no suporta múltiples regles `BEGIN' i `END'" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' és una funció interna, no pot ser redefinida" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "la constant d'expressió regular `//' sembla un comentari en C++, però no ho " "és" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "la constant d'expressió regular `/%s/' sembla un comentari en C, però no ho " "és" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "valors duplicats de casos al cos de l'expressió switch: %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "" "s'ha detectat el cas predeterminat `default' duplicat a l'expressió switch " -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "no es permet `break' a fora d'un bucle o bifurcació" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "no es permet `continue' a fora d'un bucle" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "`next' usat a l'acció %s" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' usat a l'acció %s" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "`return' és usat fora del context d'una funció" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "el `print'» simple en la regla BEGIN o END probablement ha de ser `print " "\"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "no es permet `delete' amb SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "no es permet `delete' a FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' és una extensió tawk no portable" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "les canonades bidireccionals multi-etapes no funcionen" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "expressió regular a la dreta d'una assignació" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "expressió regular a l'esquerra de l'operador `~' o `!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" "l'antic awk no dóna suport a la paraula clau `in' excepte després de `for'" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "expressió regular a la dreta de la comparació" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "`getline var' no és vàlid a dins de la regla `%s'" - -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" +#: awkgram.y:1411 +#, fuzzy, c-format +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "`getline' no és vàlid a dins de la regla `%s'" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "`getline' no redirigit sense definir dintre de l'acció FINAL" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "l'antic awk no suporta matrius multidimensionals" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "la crida de `length' sense parèntesis no és portable" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "les crides a funcions indirectes són una extensió gawk" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "no es pot usar la variable especial `%s' per a una crida indirecta de funció" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "s'ha intentat usar la funció «%s» com a una matriu" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "expressió de subíndex no vàlida" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "advertiment: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatal: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "nova línia inesperada o final d'una cadena de caràcters" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "no es pot obrir el fitxer font `%s' per a lectura (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "no es pot obrir la llibreria compartida `%s' per a lectura (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "motiu desconegut" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "no es pot incloure `%s' i usar-lo com un fitxer de programa" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "ja s'ha inclòs el fitxer font `%s'" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "ja s'ha carregat la biblioteca compartida `%s'" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include és una extensió de gawk" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "nom de fitxer buit després de @include" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "@load és una extensió de gawk" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "fitxer buit després de @load" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "el text del programa en la línia de comandaments està buit" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "no es pot llegir el fitxer font `%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "el fitxer font `%s' està buit" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "el fitxer font no finalitza amb un retorn de carro" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "expressió regular sense finalitzar acaba amb `\\' al final del fitxer" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: el modificador regex tawk `/.../%c' no funciona a gawk" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "el modificador regex tawk `/.../%c' no funciona a gawk" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "expressió regular sense finalitzar" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "expressió regular sense finalitzar al final del fitxer" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "l'ús de `\\ #...' com a continuació de línia no és portable" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "la barra invertida no és l'últim caràcter en la línia" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX no permet l'operador `**='" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "l'antic awk no suporta l'operador `**='" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX no permet l'operador `**'" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "l'antic awk no suporta l'operador `**='" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "l'operador `^=' no està suportat en l'antic awk" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "l'operador `^' no està suportat en l'antic awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "cadena sense finalitzar" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "caràcter `%c' no vàlid en l'expressió" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' és una extensió de gawk" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX no permet «%s»" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' no està suportat en l'antic awk" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "`goto' es considera perjudicial!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d no és vàlid com a nombre d'arguments per a %s" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: la cadena literal com a últim argument de substitució no té efecte" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s el tercer paràmetre no és un objecte intercanviable" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: el tercer argument és una extensió de gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: el segon argument és una extensió de gawk" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "l'ús de dcgettext(_\"...\") no és correcte: elimineu el guió baix inicial" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "l'ús de dcgettext(_\"...\") no és correcte: elimineu el guió baix inicial" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "índex: no es permet una constant regexp com a segon argument" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funció `%s': paràmetre `%s' ofusca la variable global" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "no es pot obrir `%s' per a escriptura (%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "s'està enviant la llista de variables a l'eixida d'error estàndard" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: tancament erroni (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() s'ha cridat dues vegades!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "hi ha hagut variables a l'ombra" -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "nom de la funció `%s' definida prèviament" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funció `%s»: no pot usar el nom de la funció com a paràmetre" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funció `%s': no es pot usar la variable especial `%s' com a un paràmetre de " "funció" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funció `%s': paràmetre #%d, `%s', duplica al paràmetre #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "es crida a la funció `%s' però no s'ha definit" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "la funció `%s' està definida però no s'ha cridat mai directament" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "l'expressió regular constant per al paràmetre #%d condueix a un valor booleà" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -514,23 +519,23 @@ msgstr "" "s'ha cridat a la funció `%s' amb espai entre el nom i el '(',\n" "o s'ha usat com a variable o matriu" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "s'ha intentat una divisió per zero" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "s'ha intentat una divisió per zero en `%%'" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "no es pot assignar un valor al resultat d'una expressió post-increment de " "camp" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "destí no vàlid d'assignació (opcode %s)" @@ -572,193 +577,203 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' no és un fitxer obert, canonada o co-procés" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "índex: el primer argument rebut no és una cadena" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "índex: el segon argument rebut no és una cadena" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: s'ha rebut un argument no numèric" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: s'ha rebut un argument de matriu" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(array)' és una extensió de gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: s'ha rebut un argument que no és una cadena" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: s'ha rebut un argument no numèric" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: s'ha rebut l'argument negatiu %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatal: s'ha d'usar `count$' a tots els format o a cap" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "l'amplada de camp s'ignorarà per a l'especificador `%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "la precisió s'ignorarà per a l'especificador `%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "l'amplada de camp i la precisió s'ignoraran per a l'especificador `%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal: no es permeten `$' en els formats awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal: el recompte d'arguments amb `$' ha de ser > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "fatal: el recompte d'arguments %ld és major que el nombre total d'arguments " "proporcionats" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal: no es permet `$' després d'un punt en el format" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "fatal: no es proporciona `$' per a l'ample o precisió del camp de posició" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' manca de significat en els formats awk; serà ignorat" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal: `l' no està permès en els formats POSIX de awk" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' manca de significat en els formats awk; serà ignorat" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal: `L' no està permès en els formats POSIX de awk" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' manca de significat en els formats awk; serà ignorat" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal: `h' no està permès en els formats POSIX de awk" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: el valor %g està fora de rang per al format `%%%c'" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: el valor %g està fora de rang per al format `%%%c'" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: el valor %g està fora de rang per al format `%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "s'ignorarà el caràcter especificador de format `%c': no s'ha convertit cap " "argument" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "fatal: no hi ha prou arguments per a satisfer el format d'una cadena" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ desbordament per a aquest" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: l'especificador de format no conté lletra de control" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "s'han proporcionat masses arguments per a la cadena de format" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: sense arguments" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: sense arguments" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: s'ha rebut un argument no numèric" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: cridat amb l'argument negatiu %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: la longitud %g no és >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: la longitud %g no és >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: la longitud sobre un nombre no enter %g serà truncada" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: la llargada %g és massa gran per a la indexació de cadenes de " "caràcters, es truncarà a %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: l'índex d'inici %g no és vàlid, usant 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: l'índex d'inici no enter %g serà truncat" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: la cadena font és de longitud zero" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: l'índex d'inici %g sobrepassa l'acabament de la cadena" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -766,189 +781,195 @@ msgstr "" "substr: la longitud %g a l'índex d'inici %g excedeix la longitud del primer " "argument (%lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: el valor de format a PROCINFO[\"strftime\"] té tipus numèric" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: s'ha rebut un segon argument no numèric" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" "strftime: el segon argument és més petit que 0 o massa gran per a time_t" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: el primer argument rebut no és una cadena" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: s'ha rebut una cadena de format buida" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: s'ha rebut un argument que no és una cadena" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: almenys un dels valors està forra del rang predeterminat" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "la funció 'system' no es permet fora del mode entorn de proves" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: s'ha rebut un argument que no és una cadena" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "referència a una variable sense inicialitzar `$%d'" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: s'ha rebut un argument que no és una cadena" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: s'ha rebut un argument que no és una cadena" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: el primer argument rebut no és numèric" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: el segon argument rebut no és numèric" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: s'ha rebut un argument que no és numèric" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: s'ha rebut un argument que no és numèric" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: s'ha rebut un argument que no és numèric" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: el tercer argument no és una matriu" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: el tercer argument de 0 és tractat com a 1" -#: builtin.c:3030 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: el tercer argument de 0 és tractat com a 1" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: el primer argument rebut no és numèric" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: el segon argument rebut no és numèric" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): els valors negatius donaran resultats estranys" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): els valors fraccionaris sernn truncats" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" "lshift(%f, %f): un valor de desplaçament massa gran donarà resultats estranys" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: el primer argument rebut no és numèric" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: el segon argument rebut no és numèric" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): els valors negatius donaran resultats estranys" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): els valors fraccionaris seran truncats" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%f, %f): un valor de desplaçament massa gran donarà resultats estranys" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: cridat amb menys de dos arguments" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "exp: l'argument %d no és numèric" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: l'argument %d amb valor negatiu %g donarà resultats estranys" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: cridat amb menys de dos arguments" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: l'argument %d no és numèric" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: l'argument %d amb valor negatiu %g donarà resultats estranys" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xort: cridat amb menys de dos arguments" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: l'argument %d no és numèric" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: l'argument %d del valor negatiu %g donarà resultats estranys" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: s'ha rebut un argument que no és numèric" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): el valor negatiu donarà resultats estranys" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): el valor fraccionari serà truncat" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' no és una categoria local vàlida" @@ -1272,40 +1293,49 @@ msgstr "up [N] - mou-te N marcs cap a dalt de la pila." msgid "watch var - set a watchpoint for a variable." msgstr "watch var - estableix un punt d'inspecció per a una variable." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +#, fuzzy +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"backtrace [N] - imprimeix la traça de tot els N marcs interiors (exteriors " +"si N < 0)." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "error: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "no es pot llegir l'ordre (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "no es pot llegir l'ordre (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "caràcter no vàlida en la instucció" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "ordre desconeguda - \"%.*s\", prova l'ajuda" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "caràcter no vàlid" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "ordre no definida: %s\n" @@ -1846,68 +1876,70 @@ msgstr "`%s' no est msgid "`return' not allowed in current context; statement ignored" msgstr "`return' no està permès al context actual; s'ignorarà la declaració" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "No hi ha un símbol `%s' al context actual" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "[ sense aparellar" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "classe no vàlida de caràcters" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "la sintaxi de la classe de caràcters és [[:espai:]], no [:espai:]" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "seqüència d'escapada \\ sense finalitzar" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Contingut no vàlid de \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "L'expressió regular és massa gran" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "( sense aparellar" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "no s'ha especificat una sintaxi" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr ") sense aparellar" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "tipus de node %d desconegut" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "opcode %d desconegut" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "l'opcode %s no és un operador o una paraula clau" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "desbordament del cau temporal en genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1918,217 +1950,217 @@ msgstr "" "\t# Pila de crida a les funcions:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' és una extensió de gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' és una extensió de gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "El valor BINMODE `%s' no és vàlid, es tractarà com 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "`%sFMT' especificació errònia `%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "desactivant `--lint' degut a una assignació a `LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referència a un argument sense inicialitzar `%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "referència a una variable sense inicialitzar `%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "s'ha intentat una referència de camp a partir d'un valor no numèric" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "s'ha intentat entrar una referència a partir d'una cadena nul·la" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "s'ha intentat accedir al camp %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "referència a una variable sense inicialitzar `$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "s'ha cridat a la funció `%s' amb més arguments dels declarats" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: tipus no esperat `%s'" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "s'ha intentat una divisió per zero en `/='" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "s'ha intentat una divisió per zero en `%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "les extensions no estan permeses en mode de proves" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load són extensions gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: s'ha rebut lib_name nul" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: no es pot obrir la llibreria `%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: biblioteca `%s': no defineix `plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: biblioteca `%s': no es pot cridar a la funció `%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext: la biblioteca `%s' amb rutina d'inicialització `%s' ha fallat\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' és una extensió gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension: s'ha rebut lib_name nul" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: no es pot obrir la biblioteca `%s' (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: biblioteca `%s': no defineix `plugin_is_GPL_compatible' (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: biblioteca `%s': no es pot cridar a la funció `%s' (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: nom absent de funció" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: no es pot redefinir la funció `%s'" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: la funció `%s' ja està definida" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: nom de la funció `%s' definida prèviament" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "make_builtin: no es pot usar el nom intern `%s' com a nom de funció" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: recompte negatiu d'arguments per a la funció `%s'" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: nom absent de funció" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: caràcter `%c' il·legal al nom de funció `%s'" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: no es pot redefinir la funció `%s'" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: la funció `%s' ja està definida" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: nom de la funció `%s' definida prèviament" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: no es pot usar el nom intern `%s' com a nom de funció" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "la funció `%s' està definida per agafar no més de %d argument(s)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funció `%s': falta l'argument #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "funció `%s': argument #%d: s'ha intentat usar una dada escalar com a una " "matriu" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "funció `%s': argument #%d: s'ha intentat usar una matriu com a un escalar" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "no està suportada la càrrega dinàmica de la biblioteca" @@ -2272,7 +2304,7 @@ msgstr "wait: s'ha cridat amb massa arguments" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: l'edició in situ ja està activa" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: s'esperaven 2 arguments però s'ha cridat amb %d" @@ -2305,57 +2337,57 @@ msgstr "inplace_begin: `%s' no msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(`%s') ha fallat (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: ha fallat chmod (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) ha fallat(%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) ha fallat (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace begin: close(%d) ha fallat (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end: no es pot obtenir el primer argument com un nom de fitxer " "cadena de caràcters" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: no està activa l'edició in situ" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) ha fallat (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) ha fallat (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) ha fallat (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(`%s', `%s') ha fallat (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(`%s', `%s') ha fallat (%s)" @@ -2397,50 +2429,54 @@ msgstr "readfile: s'ha cridat amb massa arguments" msgid "readfile: called with no arguments" msgstr "readfile: s'ha cridat amb cap argument" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: s'ha cridat amb massa arguments" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: l'argument 0 no és una cadena de caràcters\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: l'argument 1 no és una matriu\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: no s'ha pogut aplanar la matriu\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: no s'ha pogut alliberar la matriu aplanada\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: s'ha cridat amb massa arguments" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: l'argument 0 no és una cadena de caràcters\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: l'argument 1 no és una matriu\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array ha fallat\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element ha fallat\n" @@ -2469,86 +2505,86 @@ msgstr "sleep: l'argument msgid "sleep: not supported on this platform" msgstr "sleep: no està suportat en aquesta plataforma" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF s'inicialitza sobre un valor negatiu" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: el quart argument és una extensió gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: el quart argument no és una matriu" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: el segon argument no és una matriu" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: no es pot usar una submatriu de segon argument per a quart argument" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: no es pot usar una submatriu de segon argument per a quart argument" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: no est pot usar una submatriu de quart argument per a segon argument" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: la cadena nul·la per al tercer argument és una extensió de gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: el quart argument no és una matriu" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: el tercer argument no és una matriu" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: el segon argument no és una matriu" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: no es pot usar la mateixa matriu per a segon i quart argument" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: no es pot usar una submatriu de segon argument per a quart argument" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: no es pot usar una submatriu de quart argument per a segon argument" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' és una extensió de gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "valor FIELDWIDTHS no vàlid, a prop de `%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "la cadena nul·la per a `FS' és una extensió de gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "l'antic awk no suporta expressions regulars com a valor de `FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' és una extensió gawk" @@ -2564,20 +2600,20 @@ msgstr "node_to_awk_value: s'ha rebut un node nul" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: s'ha rebut un valor nul" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: s'ha rebut una matriu nul·la" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: s'ha rebut un subíndex nul" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: no s'ha pogut convertir l'índex %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: no s'ha pogut convertir el valor %d\n" @@ -2637,299 +2673,281 @@ msgstr "%s: l'opci msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: l'opció `-W %s' requereix un argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "l'argument `%s' de línia d'ordres és un directori: s'ignorarà" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "no es pot obrir el fitxer `%s' per a lectura (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "la finalització del descriptor fd %d (`%s') ha fallat (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "no est permeten redireccions en mode de proves" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "l'expressió en la redirecció `%s' solt té un valor numèric" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "l'expressió per a la redirecció `%s' té un valor de cadena nul·la" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "el fitxer `%s' per a la redirecció `%s' pot ser resultat d'una expressió " "lògica" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mescla innecessària de `>' i `>>' per al fitxer `%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "no es pot obrir la canonada `%s' per a l'eixida (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "no es pot obrir la canonada `%s' per a l'entrada (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "no es pot obrir una canonada bidireccional `%s' per a les entrades/eixides " "(%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "no es pot redirigir des de `%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "no es pot redirigir cap a `%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "s'ha arribat al límit del sistema per a fitxers oberts: es començarà a " "multiplexar els descriptors de fitxer" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "la finalització de `%s' ha fallat (%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "masses canonades o fitxers d'entrada oberts" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: el segon argument hauria de ser `to' o `from'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' no és un fitxer obert, canonada o co-procés" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "finalització d'una redirecció que no s'ha obert" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: la redirecció `%s' no s'obre amb `|&', s'ignora el segon argument" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "estat de fallada (%d) en la finalització de la canonada `%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "estat de falla (%d) en la finalització del fitxer `%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "no s'aporta la finalització explícita del socket `%s'" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "no s'aporta la finalització explícita del co-procés `%s'" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "no s'aporta la finalització explícita de la canonada `%s'" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "no s'aporta la finalització explícita del fitxer `%s'" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "error en escriure a la sortida estàndard (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "error en escriure a la sortida d'error estàndard (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "la neteja de la canonada de `%sx' ha fallat (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "la neteja de la canonada per al co-procés de `%sx' ha fallat (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "la neteja del fitxer `%s' ha fallat (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "port local %s no vàlid a `/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "amfitrió remot i informació de port (%s, %s) no vàlids" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "no s'aporta cap protocol (conegut) en el nom del fitxer especial `%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "el nom del fitxer especial `%s' està incomplet" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "s'ha de subministrar un nom de sistema remot a `/inet'" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "s'ha de subministrar un port remot a `/inet'" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "les comunicacions TCP/IP no estan suportades" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "no es pot obrir `%s', mode `%s'" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "ha fallat el tancament del pty mestre (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" "ha fallat la finalització de la sortida estàndard en els processos fills (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "ha fallat el trasllat del pty esclau cap a l'eixida estàndard dels processos " "fills (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" "ha fallat la finalització de l'entrada estàndard en els processos fills (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "ha fallat el trasllat del pty esclau cap a l'entrada estàndard dels " "processos fills (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "ha fallat el tancament del pty esclau (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "ha fallat la redirecció cap a l'eixida estàndard dels processos fills (dup: " "%s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "ha fallat la redirecció cap a l'entrada estàndard dels processos fills (dup: " "%s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "ha fallat la restauració de l'eixida estàndard en el procés pare\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "ha fallat la restauració de l'entrada estàndard en el procés pare\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "ha fallat la finalització de la canonada (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "`|&' no està suportat" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "no es pot obrir la canonada `%s' (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "no es pot crear el procés fill per a `%s' (fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: s'ha rebut un punter nul" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "l'analitzador d'entrades `%s' està en conflicte amb analitzador d'entrades `" "%s' instal·lat prèviament" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "l'analitzador d'entrada `%s' no ha pogut obrir `%s'" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: s'ha rebut un punter nul" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" @@ -2937,16 +2955,16 @@ msgstr "" "l'embolcall de sortida `%s' està en conflicte amb l'embolcall de sortida `" "%s' instal·lat prèviament" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "l'embolcall de sortida `%s' no ha pogut obrir `%s'" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: s'ha rebut un punter nul" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2955,210 +2973,197 @@ msgstr "" "el processsador de dues vies `%s' està en conflicte amb el processador de " "dues vies `%s' instal·lat prèviament" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "el processador de dues vies `%s' no ha pogut obrir `%s'" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "el fitxer de dades `%s' està buit" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "no s'ha pogut assignar més memòria d'entrada" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "el valor multicaràcter de `RS' és una extensió de gawk" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "la comunicació IPv6 no està suportada" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "s'ignonarà l'argument buit de `-e/--source'" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: no es reconeix l'opció `-W %s', serà ignorada\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: l'opció requereix un argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "la variable d'entorn `POSIXLY_CORRECT' està establerta: usant `--posix'" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' solapa a `--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix' i `--traditional' solapen a `--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "executar %s com a setuid root pot ser un problema de seguretat" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' anul·la a `--characters-as-bytes'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "no es pot establir el mode binari en l'entrada estàndard (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "no es pot establir el mode en l'eixida estàndard (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "no es pot establir el mode en l'eixida d'error estàndard (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "no hi ha cap text per al programa!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Ús: %s [opcions d'estil POSIX o GNU] -f fitx_prog [--] fitxer ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Ús: %s [opcions d'estil POSIX o GNU] [--] %cprograma%c fitxer ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opcions POSIX:\t\tOpcions llargues GNU: (estàndard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fitx_prog\t\t--file=fitx_prog\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs (fs=sep_camp)\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valor\t\t--assign=var=valor\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Opcions curtes:\t\tOpcions llargues GNU: (extensions)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[file]\t\t--dump-variables[=file]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[file]\t\t--debug[=file]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'program-text'\t--source='program-text'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=file\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i includefile\t\t--include=fitxer a incloure\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l library\t\t--load=biblioteca\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[file]\t\t--pretty-print[=file]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3167,7 +3172,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3179,7 +3184,7 @@ msgstr "" "és la secció `Informant sobre problemes i errors' a la versió impresa.\n" "Informeu dels errors de traducció a \n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3189,7 +3194,7 @@ msgstr "" "De forma predeterminada llegeix l'entrada estàndard i escriu a la sortida " "estàndar.\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3199,7 +3204,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' fitxer\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3218,7 +3223,7 @@ msgstr "" "Llicència, o (a la vostra elecció) qualsevol versió posterior.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3232,7 +3237,7 @@ msgstr "" "Per a més detalls consulteu la Llicència Pública General de GNU.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3240,16 +3245,16 @@ msgstr "" "Junt amb aquest programa hauríeu d'haver rebut una còpia de la Llicència\n" "Pública General de GNU; si no és així, vegeu http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft no permet inicialitzar FS a un tabulador en la versió POSIX de awk" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valor desconegut per a l'especificació de camp: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3258,99 +3263,117 @@ msgstr "" "%s: `%s' l'argument per a `-v' no està en forma `var=valor'\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' no és nom legal de variable" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' no és un valor de variable, s'esperava fitxer `%s=%s'" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" "no es pot usar el nom de la funció integrada `%s' com a nom de variable" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "no es pot usar el nom de la funció interna `%s' com nom de variable" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "excepció de coma flotant" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "error fatal: error intern" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "error fatal: error intern: segfault" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "error fatal: error intern: sobreeiximent de pila" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "no s'ha pre-obert el descriptor fd per a %d" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "no es pot pre-obrir /dev/null per al descriptor fd %d" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "s'ignonarà l'argument buit de `-e/--source'" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: no es reconeix l'opció `-W %s', serà ignorada\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'opció requereix un argument -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "Valor PREC `%.*s' no és vàlid" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "Valor RNDMODE `%.*s' no és vàlid" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: s'ha rebut un argument que no és numèric" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): el valor negatiu donarà resultats estranys" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): el valor fraccionari serà truncat" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): els valors negatius donaran resultats estranys" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: s'ha rebut un argument no numèric #%d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: l'argument #%d té valor no vàlid %Rg, s'usarà 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: l'argument #%d amb valor negatiu %Rg donarà resultats estranys" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: l'argument #%d amb valor fraccional %Rg serà truncat" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: l'argument #%d amb valor negatiu %Zd donarà resultats estranys" @@ -3360,24 +3383,24 @@ msgstr "%s: l'argument #%d amb valor negatiu %Zd donar msgid "cmd. line:" msgstr "línia cmd.:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "barra invertida al final de la cadena" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "l'antic awk no dóna suport a la seqüencia d'escapada `\\%c'" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX no permet seqüències d'escapada `\\x'" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "no hi ha dígits hexadecimals en la seqüència d'escapada `\\x'" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3386,12 +3409,12 @@ msgstr "" "probablement no s'han interpretat els caràcters hex escape \\x%.*s of %d de " "la manera que esperàveu" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "la seqüència d'escapada `\\%c' és tractada com a una simple `%c'" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3420,12 +3443,12 @@ msgid "sending profile to standard error" msgstr "enviant el perfil a l'eixida d'error estàndard" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s bloc(s)\n" +"\t# Regla(es)\n" "\n" #: profile.c:198 @@ -3442,11 +3465,11 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "error intern: %s amb vname nul" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "error intern: funció integrada amb fname nul" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3455,12 +3478,12 @@ msgstr "" "\t# Extensions carregades (-l i/o @load)\n" "\n" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# perfil gawk, creat %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3469,7 +3492,7 @@ msgstr "" "\n" "\t# Funcions, llistades alfabèticament\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: tipus desconegut de redireccionament %d" @@ -3479,74 +3502,111 @@ msgstr "redir2str: tipus desconegut de redireccionament %d" msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "el component regexp `%.*s' probablement hauria de ser `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Èxit" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "No hi ha concordança" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Expressió regular no vàlida" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Caràcter de comparació no vàlid" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nom de classe de caràcters no vàlid" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Barra invertida extra al final" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Referència cap endarrere no vàlida" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "[ o [^ desemparellats" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( o \\( desemparellats" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ desemparellat" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Contingut no vàlid de \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Final de rang no vàlid" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Memòria exhaurida" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Expressió regular precedent no vàlida" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Fí prematura de l'expressió regular" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "L'expressió regular és massa gran" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") o \\) desemparellats" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "No hi ha una expressió regular prèvia" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funció `%s»: no pot usar el nom de la funció com a paràmetre" + +#: symbol.c:809 msgid "can not pop main context" msgstr "no es pot mostrar el context principal" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "`getline var' no és vàlid a dins de la regla `%s'" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "no s'aporta cap protocol (conegut) en el nom del fitxer especial `%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "el nom del fitxer especial `%s' està incomplet" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "s'ha de subministrar un nom de sistema remot a `/inet'" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "s'ha de subministrar un port remot a `/inet'" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s bloc(s)\n" +#~ "\n" + #~ msgid "reference to uninitialized element `%s[\"%s\"]'" #~ msgstr "referència a un element sense valor inicial `%s[\"%s\"]'" @@ -3633,9 +3693,6 @@ msgstr "no es pot mostrar el context principal" #~ msgid "illegal type (%s) in tree_eval" #~ msgstr "tipus il·legal (%s) en tree_eval" -#~ msgid "attempt to use function `%s' as array" -#~ msgstr "s'ha intentat usar la funció «%s» com a una matriu" - #~ msgid "`%s' is a function, assignment is not allowed" #~ msgstr "«%s» és una funció, l'assignació no és permesa" diff --git a/po/da.gmo b/po/da.gmo index 0ba7ffc0..83958f48 100644 Binary files a/po/da.gmo and b/po/da.gmo differ diff --git a/po/da.po b/po/da.po index f3840840..8dfedbea 100644 --- a/po/da.po +++ b/po/da.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.0.0h\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2012-02-06 10:37+0100\n" "Last-Translator: Keld Simonsen \n" "Language-Team: Danish \n" @@ -40,9 +40,9 @@ msgstr "fors msgid "attempt to use scalar `%s' as an array" msgstr "forsøg på at bruge skalar '%s' som et array" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "forsøg på at bruge array '%s' i skalarsammenhæng" @@ -98,415 +98,420 @@ msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "" "asorti: kan ikke bruge et underarray af andet argument for første argument" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "'%s' er ugyldigt som funktionsnavn" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "funktionen for sorteringssammenligning '%s' er ikke defineret" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "%s-blokke skal have en handlingsdel" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "hver regel skal have et mønster eller en handlingsdel" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "" "gamle versioner af awk understøtter ikke flere 'BEGIN'- eller 'END'-regler" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "'%s' er en indbygget funktion, den kan ikke omdefineres" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "regexp-konstanten '//' ser ud som en C++-kommentar, men er det ikke" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "regexp-konstanten '/%s/' ser ud som en C-kommentar, men er det ikke" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "dublet case-værdier i switch-krop %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "dublet 'default' opdaget i switch-krop" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "'break' uden for en løkke eller switch er ikke tilladt" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "'continue' uden for en løkke er ikke tilladt" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "'next' brugt i %s-handling" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "'nextfile' brugt i %s-handling" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "'return' brugt uden for funktion" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "alenestående 'print' i BEGIN eller END-regel skulle muligvis være 'print " "\"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "'delete array' er en ikke-portabel udvidelse fra tawk" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "flertrins dobbeltrettede datakanaler fungerer ikke" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "regulært udtryk i højreleddet af en tildeling" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "regulært udtryk på venstre side af en '~'- eller '!~'-operator" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" "gamle versioner af awk understøtter ikke nøgleordet 'in' undtagen efter 'for'" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "regulært udtryk i højreleddet af en sammenligning" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "'getline var' ugyldig inden i '%s' regel" - -#: awkgram.y:1420 +#: awkgram.y:1411 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "'getline' ugyldig inden i '%s' regel" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "ikke-omdirigeret 'getline' ugyldig inden i '%s'-regel" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "ikke-omdirigeret 'getline' udefineret inden i END-handling" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "gamle versioner af awk understøtter ikke flerdimensionale array" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "kald af 'length' uden parenteser er ikke portabelt" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "indirekte funktionskald er en gawk-udvidelse" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "kan ikke bruge specialvariabel '%s' til indirekte funktionskald" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "forsøg på at bruge funktionen '%s' som et array" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "ugyldigt indeksudtryk" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "advarsel: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatal: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "uventet nylinjetegn eller strengafslutning" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kan ikke åbne kildefilen '%s' for læsning (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, fuzzy, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "kan ikke åbne kildefilen '%s' for læsning (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "ukendt årsag" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "allerede inkluderet kildefil '%s'" -#: awkgram.y:2409 +#: awkgram.y:2418 #, fuzzy, c-format msgid "already loaded shared library `%s'" msgstr "allerede inkluderet kildefil '%s'" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include er en gawk-udvidelse" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "tomt filnavn efter @include" -#: awkgram.y:2494 +#: awkgram.y:2503 #, fuzzy msgid "@load is a gawk extension" msgstr "@include er en gawk-udvidelse" -#: awkgram.y:2500 +#: awkgram.y:2509 #, fuzzy msgid "empty filename after @load" msgstr "tomt filnavn efter @include" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "tom programtekst på kommandolinjen" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kan ikke læse kildefilen '%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "kildefilen '%s' er tom" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "kildefilen slutter ikke med en ny linje" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "uafsluttet regulært udtryk slutter med '\\' i slutningen af filen" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: regex-ændringstegn '/.../%c' fra tawk virker ikke i gawk" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "regex-ændringstegn '/.../%c' fra tawk virker ikke i gawk" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "uafsluttet regulært udtryk" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "uafsluttet regulært udtryk i slutningen af filen" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "brug af '\\ #...' for linjefortsættelse er ikke portabelt" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "sidste tegn på linjen er ikke en omvendt skråstreg" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX tillader ikke operatoren '**='" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "gamle versioner af awk understøtter ikke operatoren '**='" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX tillader ikke operatoren '**'" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "gamle versioner af awk understøtter ikke operatoren '**'" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "operatoren '^=' understøttes ikke i gamle versioner af awk" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "operatoren '^' understøttes ikke i gamle versioner af awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "uafsluttet streng" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "ugyldigt tegn '%c' i udtryk" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "'%s' er en gawk-udvidelse" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX tillader ikke '%s'" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "'%s' understøttes ikke i gamle versioner af awk" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "'goto' anses for skadelig!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d er et ugyldigt antal argumenter for %s" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: bogstavelig streng som sidste argument til erstatning har ingen effekt" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s: tredje argument er ikke et ændringsbart objekt" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: tredje argument er en gawk-udvidelse" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: andet argument er en gawk-udvidelse" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "brug af dcgettext(_\"...\") er forkert: fjern det indledende " "understregningstegn" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "brug af dcgettext(_\"...\") er forkert: fjern det indledende " "understregningstegn" -#: awkgram.y:4016 +#: awkgram.y:4044 #, fuzzy msgid "index: regexp constant as second argument is not allowed" msgstr "indeks: andet argument er ikke en streng" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funktionen '%s': parameteren '%s' overskygger en global variabel" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "kunne ikke åbne '%s' for skrivning (%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "sender variabelliste til standard fejl" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: lukning mislykkedes (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() kaldt to gange!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "der var skyggede variable." -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "funktionsnavnet '%s' er allerede defineret" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funktionen '%s': kan ikke bruge funktionsnavn som parameternavn" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funktionen '%s': kan ikke bruge specialvariabel '%s' som en " "funktionsparameter" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funktionen '%s': parameter %d, '%s', er samme som parameter %d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "funktionen '%s' kaldt, men aldrig defineret" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "funktionen '%s' defineret, men aldrig kaldt direkte" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "konstant regulært udtryk for parameter %d giver en boolesk værdi" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -515,21 +520,21 @@ msgstr "" "funktionen '%s' kaldt med blanktegn mellem navnet og '(',\n" "eller brugt som en variabel eller et array" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "forsøgte at dividere med nul" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "forsøgte at dividere med nul i '%%'" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5006 #, fuzzy, c-format msgid "invalid target of assignment (opcode %s)" msgstr "%d er et ugyldigt antal argumenter for %s" @@ -568,189 +573,199 @@ msgstr "fflush: kan ikke rense: filen '%s' msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: '%s' er ikke en åben fil, datakanal eller ko-proces" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "indeks: første argument er ikke en streng" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "indeks: andet argument er ikke en streng" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: fik et ikke-numerisk argument" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: fik et array-argument" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "'length(array)' er en gawk-udvidelse" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: fik et argument som ikke er en streng" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: fik et ikke-numerisk argument" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: fik et negativt argument %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatal: skal bruge 'count$' på alle formater eller ikke nogen" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "feltbredde ignoreret for '%%'-angivelse" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "præcision ignoreret for '%%'-angivelse" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "feltbredde og præcision ignoreret for '%%'-angivelse" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal: '$' tillades ikke i awk-formater" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal: argumentantallet med '$' skal være > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "fatal: argumentantallet %ld er større end antal givne argumenter" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal: '$' tillades ikke efter et punktum i formatet" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "fatal: intet '$' angivet for bredde eller præcision af positionsangivet felt" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "'l' er meningsløst i awk-formater, ignoreret" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal: 'l' tillades ikke i POSIX awk-formater" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "'L' er meningsløst i awk-formater, ignoreret" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal: 'L' tillades ikke i POSIX awk-formater" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "'h' er meningsløst i awk-formater, ignoreret" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal: 'h' tillades ikke i POSIX awk-formater" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: værdi %g er uden for område for '%%%c'-format" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: værdi %g er uden for område for '%%%c'-format" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: værdi %g er uden for område for '%%%c'-format" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "ignorerer ukendt formatspecificeringstegn '%c': intet argument konverteret" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "fatal: for få argumenter til formatstrengen" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ sluttede her" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: formatspecifikation har intet kommandobogstav" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "for mange argumenter til formatstrengen" -#: builtin.c:1634 +#: builtin.c:1625 #, fuzzy msgid "sprintf: no arguments" msgstr "printf: ingen argumenter" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: ingen argumenter" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: fik ikke-numerisk argument" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: kaldt med negativt argument %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: længden %g er ikke >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: længden %g er ikke >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: længden %g som ikke er et heltal vil blive trunkeret" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: længden %g for stor til strengindeksering, trunkerer til %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: startindeks %g er ugyldigt, bruger 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: startindeks %g som ikke er et heltal vil blive trunkeret" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: kildestrengen er tom" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: startindeks %g er forbi slutningen på strengen" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -758,191 +773,197 @@ msgstr "" "substr: længden %g ved startindeks %g overskrider længden af første argument " "(%lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: formatværdi i PROCINFO[\"strftime\"] har numerisk type" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: fik et ikke-numerisk andet argument" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: andet argument mindre end 0 eller for stort til time_t" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: fik et første argument som ikke er en streng" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: fik en tom formatstreng" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: fik et argument som ikke er en streng" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: mindst én af værdierne er udenfor standardområdet" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "'system'-funktion ikke tilladt i sandkasse-tilstand" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: fik et argument som ikke er en streng" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "reference til ikke-initieret felt '$%d'" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: fik et argument som ikke er en streng" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: fik et argument som ikke er en streng" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: fik et ikke-numerisk første argument" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: fik et ikke-numerisk andet argument" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: fik et ikke-numerisk argument" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: fik et ikke-numerisk argument" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: fik et ikke-numerisk argument" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: tredje argument er ikke et array" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: 0 i tredje argument behandlet som 1" + +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" msgstr "gensub: 0 i tredje argument behandlet som 1" -#: builtin.c:3030 +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: fik et ikke-numerisk første argument" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: fik et ikke-numerisk andet argument" -#: builtin.c:3038 +#: builtin.c:3028 #, fuzzy, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:3040 +#: builtin.c:3030 #, fuzzy, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%lf, %lf): kommatalsværdier vil blive trunkeret" -#: builtin.c:3042 +#: builtin.c:3032 #, fuzzy, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" "lshift(%lf, %lf): for store skifteværdier vil give mærkelige resultater" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: fik et ikke-numerisk første argument" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: fik et ikke-numerisk andet argument" -#: builtin.c:3075 +#: builtin.c:3065 #, fuzzy, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:3077 +#: builtin.c:3067 #, fuzzy, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%lf, %lf): kommatalsværdier vil blive trunkeret" -#: builtin.c:3079 +#: builtin.c:3069 #, fuzzy, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%lf, %lf): for store skifteværdier vil give mærkelige resultater" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 #, fuzzy msgid "and: called with less than two arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: builtin.c:3109 +#: builtin.c:3099 #, fuzzy, c-format msgid "and: argument %d is non-numeric" msgstr "exp: argumentet %g er uden for det tilladte område" -#: builtin.c:3113 +#: builtin.c:3103 #, fuzzy, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 #, fuzzy msgid "or: called with less than two arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: builtin.c:3141 +#: builtin.c:3131 #, fuzzy, c-format msgid "or: argument %d is non-numeric" msgstr "exp: argumentet %g er uden for det tilladte område" -#: builtin.c:3145 +#: builtin.c:3135 #, fuzzy, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "compl(%lf): negative værdier vil give mærkelige resultater" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 #, fuzzy msgid "xor: called with less than two arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: builtin.c:3173 +#: builtin.c:3163 #, fuzzy, c-format msgid "xor: argument %d is non-numeric" msgstr "exp: argumentet %g er uden for det tilladte område" -#: builtin.c:3177 +#: builtin.c:3167 #, fuzzy, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: fik et ikke-numerisk argument" -#: builtin.c:3208 +#: builtin.c:3198 #, fuzzy, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%lf): negative værdier vil give mærkelige resultater" -#: builtin.c:3210 +#: builtin.c:3200 #, fuzzy, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%lf): kommatalsværdier vil blive trunkeret" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: '%s' er ikke en gyldig lokalitetskategori" @@ -1224,42 +1245,48 @@ msgstr "" msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "fejl: " -#: command.y:1051 +#: command.y:1053 #, fuzzy, c-format msgid "can't read command (%s)\n" msgstr "kan ikke omdirigere fra '%s' (%s)" -#: command.y:1065 +#: command.y:1067 #, fuzzy, c-format msgid "can't read command (%s)" msgstr "kan ikke omdirigere fra '%s' (%s)" -#: command.y:1116 +#: command.y:1118 #, fuzzy msgid "invalid character in command" msgstr "Ugyldigt tegnklassenavn" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 #, fuzzy msgid "invalid character" msgstr "Ugyldigt sorteringstegn" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1775,69 +1802,71 @@ msgstr "'exit' kan ikke kaldes i den aktuelle kontekst" msgid "`return' not allowed in current context; statement ignored" msgstr "'exit' kan ikke kaldes i den aktuelle kontekst" -#: debug.c:5590 +#: debug.c:5604 #, fuzzy, c-format msgid "No symbol `%s' in current context" msgstr "forsøg på at bruge array '%s' i skalarsammenhæng" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "" -#: dfa.c:1174 +#: dfa.c:1119 #, fuzzy msgid "invalid character class" msgstr "Ugyldigt tegnklassenavn" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Ugyldigt indhold i \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "Regulært udtryk for stort" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr "" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "ukendt nodetype %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "ukendt opkode %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "opkode %s er ikke en operator eller et nøgleord" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "bufferoverløb i genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1848,94 +1877,94 @@ msgstr "" "\t# Funktionskaldsstak:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "'IGNORECASE' er en gawk-udvidelse" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "'BINMODE' er en gawk-udvidelse" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE værdi '%s' er ugyldig, behandles som 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "forkert '%sFMT'-specifikation '%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "deaktiverer '--lint' på grund af en tildeling til 'LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "reference til ikke-initieret argument '%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "reference til ikke-initieret variabel '%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "forsøg på at referere til et felt fra ikke-numerisk værdi" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "forsøg på at referere til et felt fra tom streng" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "forsøg på at få adgang til felt %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "reference til ikke-initieret felt '$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funktionen '%s' kaldt med flere argumenter end deklareret" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: uventet type `%s'" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "forsøgte at dividere med nul i '/='" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "forsøgte at dividere med nul i '%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "udvidelser er ikke tilladt i sandkasse-tilstand" -#: ext.c:92 +#: ext.c:68 #, fuzzy msgid "-l / @load are gawk extensions" msgstr "@include er en gawk-udvidelse" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, fuzzy, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "atalt: extension: kan ikke åbne '%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, fuzzy, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" @@ -1943,31 +1972,31 @@ msgstr "" "fatalt: extension: bibliotek '%s': definer ikke " "'plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, fuzzy, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" "fatalt: extension: bibliotek '%s': kan ikke kalde funktionen '%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "'extension' er en gawk-udvidelse" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, fuzzy, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "atalt: extension: kan ikke åbne '%s' (%s)\n" -#: ext.c:186 +#: ext.c:162 #, fuzzy, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" @@ -1975,95 +2004,95 @@ msgstr "" "fatalt: extension: bibliotek '%s': definer ikke " "'plugin_is_GPL_compatible' (%s)\n" -#: ext.c:190 +#: ext.c:166 #, fuzzy, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" "fatalt: extension: bibliotek '%s': kan ikke kalde funktionen '%s' (%s)\n" -#: ext.c:221 +#: ext.c:197 #, fuzzy msgid "make_builtin: missing function name" msgstr "extension: mangler funktionsnavn" -#: ext.c:236 +#: ext.c:212 #, fuzzy, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "extension: kan ikke omdefinere funktion '%s'" -#: ext.c:240 +#: ext.c:216 #, fuzzy, c-format msgid "make_builtin: function `%s' already defined" msgstr "extension: funktionen '%s' er allerede defineret" -#: ext.c:244 +#: ext.c:220 #, fuzzy, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "extension: funktionsnavnet '%s' er defineret tidligere" -#: ext.c:246 +#: ext.c:222 #, fuzzy, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "extension: kan ikke bruge gawk's indbyggede '%s' som funktionsnavn" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negativt argumentantal for funktion '%s'" -#: ext.c:276 +#: ext.c:252 #, fuzzy msgid "extension: missing function name" msgstr "extension: mangler funktionsnavn" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, fuzzy, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: ugyldigt tegn '%c' i funktionsnavn '%s'" -#: ext.c:291 +#: ext.c:267 #, fuzzy, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: kan ikke omdefinere funktion '%s'" -#: ext.c:295 +#: ext.c:271 #, fuzzy, c-format msgid "extension: function `%s' already defined" msgstr "extension: funktionen '%s' er allerede defineret" -#: ext.c:299 +#: ext.c:275 #, fuzzy, c-format msgid "extension: function name `%s' previously defined" msgstr "funktionsnavnet '%s' er allerede defineret" -#: ext.c:301 +#: ext.c:277 #, fuzzy, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: kan ikke bruge gawk's indbyggede '%s' som funktionsnavn" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funktionen '%s' defineret til at tage ikke mere end %d argumenter" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funktion '%s': mangler argument nummer %d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "funktion '%s': argument nummer %d: forsøg på at bruge skalar som et array" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "funktion '%s': argument nummer %d: forsøg på at bruge array som en skalar" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2226,7 +2255,7 @@ msgstr "sqrt: kaldt med negativt argument %g" msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2255,55 +2284,55 @@ msgstr "'%s' er ikke et gyldigt variabelnavn" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, fuzzy, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "%s: lukning mislykkedes (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, fuzzy, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "%s: lukning mislykkedes (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, fuzzy, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "%s: lukning mislykkedes (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, fuzzy, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "datakanalsrensning af '%s' mislykkedes (%s)." -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, fuzzy, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "lukning af fd %d ('%s') mislykkedes (%s)" @@ -2353,52 +2382,56 @@ msgstr "sqrt: kaldt med negativt argument %g" msgid "readfile: called with no arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 #, fuzzy msgid "writea: called with too many arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, fuzzy, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "exp: argumentet %g er uden for det tilladte område\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, fuzzy, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "split: fjerde argument er ikke et array\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 #, fuzzy msgid "reada: called with too many arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, fuzzy, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "exp: argumentet %g er uden for det tilladte område" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, fuzzy, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "match: tredje argument er ikke et array" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2431,84 +2464,84 @@ msgstr "exp: argumentet %g er uden for det tilladte omr msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF sat til en negativ værdi" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: fjerde argument er en gawk-udvidelse" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: fjerde argument er ikke et array" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: andet argument er ikke et array" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "split: kan ikke bruge det samme array som andet og fjerde argument" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: kan ikke bruge et underarray af andet argument som fjerde argument" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: kan ikke bruge et underarray af fjerde argument som andet argument" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: tom streng som tredje argument er en gawk-udvidelse" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: fjerde argument er ikke et array" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: andet argument er ikke et array" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patmatch: tredje argument er ikke et array" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "patsplit: kan ikke bruge det samme array som andet og fjerde argument" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: kan ikke bruge et underarray af andet argument som fjerde argument" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: kan ikke bruge et underarray af fjerde argument som andet argument" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "'FIELDWIDTHS' er en gawk-udvidelse" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "ugyldig FIELDWIDTHS værdi, nær '%s" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "tom streng som 'FS' er en gawk-udvidelse" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "gamle versioner af awk understøtter ikke regexp'er som værdi for 'FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "'FPAT' er en gawk-udvidelse" @@ -2524,21 +2557,21 @@ msgstr "" msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 #, fuzzy msgid "remove_element: received null array" msgstr "length: fik et array-argument" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2598,516 +2631,485 @@ msgstr "%s: flaget '-W %s' tillader ikke noget argument\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: flaget '-W %s' kræver et argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "kommandolinjeargument '%s' er et katalog, oversprunget" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "kan ikke åbne filen '%s' for læsning (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "lukning af fd %d ('%s') mislykkedes (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "omdirigering ikke tilladt i sandkasse-tilstand" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "udtrykket i '%s'-omdirigering har kun numerisk værdi" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "udtrykket for '%s'-omdirigering har en tom streng som værdi" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "filnavnet '%s' for '%s'-omdirigering kan være resultatet af et logisk udtryk" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "unødig blanding af '>' og '>>' for filen '%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "kan ikke åbne datakanalen '%s' for udskrivning (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "kan ikke åbne datakanalen '%s' for indtastning (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "kan ikke åbne tovejsdatakanalen '%s' for ind-/uddata (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "kan ikke omdirigere fra '%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "kan ikke omdirigere til '%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "nåede systembegrænsningen for åbne filer: begynder at multiplekse " "fildeskriptorer" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "lukning af '%s' mislykkedes (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "for mange datakanaler eller inddatafiler åbne" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: andet argument skal være 'to' eller 'from'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: '%.*s' er ikke en åben fil, datakanal eller ko-proces" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "lukning af omdirigering som aldrig blev åbnet" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: omdirigeringen '%s' blev ikke åbnet med '|&', andet argument ignoreret" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "fejlstatus (%d) fra lukning af datakanalen '%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "fejlstatus (%d) fra fillukning af '%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ingen eksplicit lukning af soklen '%s' angivet" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "ingen eksplicit lukning af ko-processen '%s' angivet" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "ingen eksplicit lukning af datakanalen '%s' angivet" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ingen eksplicit lukning af filen '%s' angivet" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "fejl ved skrivning til standard ud (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "fejl ved skrivning til standard fejl (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "datakanalsrensning af '%s' mislykkedes (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "ko-procesrensning af datakanalen til '%s' mislykkedes (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "filrensning af '%s' mislykkedes (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "lokal port %s ugyldig i '/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "fjernvært og portinformation (%s, %s) ugyldige" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "ingen (kendt) protokol opgivet i special-filnavn '%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "special-filnavn '%s' er ufuldstændigt" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "fjernmaskinenavn til '/inet' skal angives" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "fjernport til '/inet' skal angives" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-kommunikation understøttes ikke" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "kunne ikke åbne '%s', tilstand '%s'" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "lukning af master-pty mislykkedes (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "lukning af standard ud i underproces mislykkedes (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "flytning af slave-pty til standard ud i underproces mislykkedes (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "lukning af standard ind i underproces mislykkedes (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "flytning af slave-pty til standard ind i underproces mislykkedes (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "lukning af slave-pty mislykkedes (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "flytning af datakanal til standard ud i underproces mislykkedes (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "flytning af datakanalen til standard ind i underproces mislykkedes (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "genskabelse af standard ud i forælderprocessen mislykkedes\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "genskabelse af standard ind i forælderprocessen mislykkedes\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "lukning af datakanalen mislykkedes (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "'|&' understøttes ikke" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "kan ikke åbne datakanalen '%s' (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "kan ikke oprette barneproces for '%s' (fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "datafilen '%s' er tom" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "kunne ikke allokere mere hukommelse til inddata" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "'RS' som flertegnsværdi er en gawk-udvidelse" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "IPv6-kommunikation understøttes ikke" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "tomt argument til '-e/--source' ignoreret" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: flaget '-W %s' ukendt, ignoreret\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: flaget kræver et argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "miljøvariablen 'POSIXLY_CORRECT' sat: aktiverer '--posix'" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "'--posix' tilsidesætter '--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "'--posix'/'--traditional' tilsidesætter '--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "at køre %s setuid root kan være et sikkerhedsproblem" -#: main.c:588 +#: main.c:346 #, fuzzy msgid "`--posix' overrides `--characters-as-bytes'" msgstr "'--posix' tilsidesætter '--binary'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "kan ikke sætte binær tilstand på standard ind (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "kan ikke sætte binær tilstand på standard ud (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "kan ikke sætte binær tilstand på standard fejl (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "ingen programtekst overhovedet!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Brug: %s [flag i POSIX- eller GNU-stil] -f progfil [--] fil ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Brug: %s [flag i POSIX- eller GNU-stil] %cprogram%c fil ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX-flag:\t\tlange GNU-flag: (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f progfil\t\t--file=progfil\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=værdi\t\t--assign=var=værdi\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "POSIX-flag:\t\tlange GNU-flag: (udvidelser)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[fil]\t\t--dump-variables[=fil]\n" -#: main.c:815 +#: main.c:579 #, fuzzy msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-p[fil]\t\t--profile[=fil]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'programtekst'\t--source='programtekst'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E fil\t\t\t--exec=fil\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 #, fuzzy msgid "\t-M\t\t\t--bignum\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 #, fuzzy msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-p[fil]\t\t--profile[=fil]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[fil]\t\t--profile[=fil]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3116,7 +3118,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3129,7 +3131,7 @@ msgstr "" "\n" "Rapportér kommentarer til oversættelsen til .\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3139,7 +3141,7 @@ msgstr "" "Almindeligvis læser gawk fra standard ind og skriver til standard ud.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3149,7 +3151,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' fil\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3169,7 +3171,7 @@ msgstr "" "enhver senere version.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3183,7 +3185,7 @@ msgstr "" "General Public License for yderligere information.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3191,16 +3193,16 @@ msgstr "" "Du bør have fået en kopi af GNU General Public License sammen\n" "med dette program. Hvis ikke, så se http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft sætter ikke FS til tab i POSIX-awk" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "ukendt værdi for felt-spec: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3209,102 +3211,120 @@ msgstr "" "%s: '%s' argument til '-v' ikke på formen 'var=værdi'\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "'%s' er ikke et gyldigt variabelnavn" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "'%s' er ikke et variabelnavn, leder efter fil '%s=%s'" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "kan ikke bruge gawk's indbyggede '%s' som variabelnavn" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "kan ikke bruge funktion '%s' som variabelnavn" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "flydendetalsundtagelse" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "fatal fejl: intern fejl" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "fatal fejl: intern fejl: segmentfejl" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "fatal fejl: intern fejl: stakoverløb" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "ingen fd %d åbnet i forvejen" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "kunne ikke i forvejen åbne /dev/null for fd %d" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "tomt argument til '-e/--source' ignoreret" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: flaget '-W %s' ukendt, ignoreret\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flaget kræver et argument -- %c\n" + +#: mpfr.c:557 #, fuzzy, c-format msgid "PREC value `%.*s' is invalid" msgstr "BINMODE værdi '%s' er ugyldig, behandles som 3" -#: mpfr.c:608 +#: mpfr.c:615 #, fuzzy, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "BINMODE værdi '%s' er ugyldig, behandles som 3" -#: mpfr.c:698 +#: mpfr.c:711 #, fuzzy, c-format msgid "%s: received non-numeric argument" msgstr "cos: fik et ikke-numerisk argument" -#: mpfr.c:800 +#: mpfr.c:820 #, fuzzy msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%lf): negative værdier vil give mærkelige resultater" -#: mpfr.c:804 +#: mpfr.c:824 #, fuzzy msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%lf): kommatalsværdier vil blive trunkeret" -#: mpfr.c:816 +#: mpfr.c:836 #, fuzzy, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%lf): negative værdier vil give mærkelige resultater" -#: mpfr.c:835 +#: mpfr.c:855 #, fuzzy, c-format msgid "%s: received non-numeric argument #%d" msgstr "cos: fik et ikke-numerisk argument" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 #, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "compl(%lf): negative værdier vil give mærkelige resultater" -#: mpfr.c:863 +#: mpfr.c:883 #, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "or(%lf, %lf): kommatalsværdier vil blive trunkeret" -#: mpfr.c:878 +#: mpfr.c:898 #, fuzzy, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "compl(%lf): negative værdier vil give mærkelige resultater" @@ -3314,24 +3334,24 @@ msgstr "compl(%lf): negative v msgid "cmd. line:" msgstr "kommandolinje:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "omvendt skråstreg i slutningen af strengen" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "gamle versioner af awk understøtter ikke '\\%c' undvigesekvens" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX tillader ikke '\\x'-kontrolsekvenser" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "ingen heksadecimale cifre i '\\x'-kontrolsekvenser" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3340,12 +3360,12 @@ msgstr "" "den heksadecimale sekvens \\x%.*s på %d tegn nok ikke forstået som du " "forventer det" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "kontrolsekvensen '\\%c' behandlet som kun '%c'" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3373,12 +3393,12 @@ msgid "sending profile to standard error" msgstr "sender profilen til standard fejl" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s blokke\n" +"\t# Regler\n" "\n" #: profile.c:198 @@ -3395,24 +3415,24 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "intern fejl: %s med null vname" -#: profile.c:537 +#: profile.c:538 #, fuzzy msgid "internal error: builtin with null fname" msgstr "intern fejl: %s med null vname" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profil til gawk oprettet %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3421,7 +3441,7 @@ msgstr "" "\n" "\t# Funktioner, listede alfabetisk\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: uykendt omdirigeringstype %d" @@ -3431,74 +3451,113 @@ msgstr "redir2str: uykendt omdirigeringstype %d" msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "regexp-komponent `%.*s' skulle nok være `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Lykkedes" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Mislykkedes" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Ugyldigt regulært udtryk" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ugyldigt sorteringstegn" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Ugyldigt tegnklassenavn" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Efterfølgende omvendt skråstreg" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Ugyldig bagudreference" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "Ubalanceret [ eller [^" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Ubalanceret ( eller \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Ubalanceret \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ugyldigt indhold i \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Ugyldig intervalslutning" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Hukommelsen opbrugt" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Ugyldigt foregående regulært udtryk" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "For tidligt slut på regulært udtryk" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Regulært udtryk for stort" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Ubalanceret ) eller \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Intet foregående regulært udtryk" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funktionen '%s': kan ikke bruge funktionsnavn som parameternavn" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "'getline var' ugyldig inden i '%s' regel" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "'getline' ugyldig inden i '%s' regel" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "ingen (kendt) protokol opgivet i special-filnavn '%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "special-filnavn '%s' er ufuldstændigt" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "fjernmaskinenavn til '/inet' skal angives" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "fjernport til '/inet' skal angives" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s blokke\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "område på formen `[%c-%c]' er locale-afhængig" @@ -3570,9 +3629,6 @@ msgstr "" #~ msgid "Operation Not Supported" #~ msgstr "Operationen understøttes ikke" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "forsøg på at bruge funktionen '%s' som et array" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "reference til ikke-initieret element '%s[\"%.*s\"]'" @@ -3615,9 +3671,6 @@ msgstr "" #~ msgid "function `%s' not defined" #~ msgstr "funktionen '%s' er ikke defineret" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "ikke-omdirigeret 'getline' ugyldig inden i '%s'-regel" - #~ msgid "`nextfile' cannot be called from a `%s' rule" #~ msgstr "'nextfile' kan ikke kaldes fra en '%s'-regel" diff --git a/po/de.gmo b/po/de.gmo index e46946bb..7aa9e12b 100644 Binary files a/po/de.gmo and b/po/de.gmo differ diff --git a/po/de.po b/po/de.po index ca6d5475..fcb31d2a 100644 --- a/po/de.po +++ b/po/de.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-01-14 22:23+0200\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-10-23 17:31+0200\n" "Last-Translator: Philipp Thomas \n" "Language-Team: German \n" @@ -36,9 +36,9 @@ msgstr "Es wird versucht, den skalaren Parameter »%s« als Feld zu verwenden" msgid "attempt to use scalar `%s' as an array" msgstr "Es wird versucht, den Skalar »%s« als Array zu verwenden" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1599 builtin.c:1645 -#: builtin.c:1658 builtin.c:2086 builtin.c:2100 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "Es wird versucht, das Feld »%s« in einem Skalarkontext zu verwenden" @@ -75,421 +75,452 @@ msgstr "asorti: Das erste Argument ist kein Feld" #: array.c:831 msgid "asort: cannot use a subarray of first arg for second arg" -msgstr "asort: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites Argument verwendet werden" +msgstr "" +"asort: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites " +"Argument verwendet werden" #: array.c:832 msgid "asorti: cannot use a subarray of first arg for second arg" -msgstr "asorti: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites Argument verwendet werden" +msgstr "" +"asorti: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites " +"Argument verwendet werden" #: array.c:837 msgid "asort: cannot use a subarray of second arg for first arg" -msgstr "asort: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes Argument verwendet werden" +msgstr "" +"asort: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes " +"Argument verwendet werden" #: array.c:838 msgid "asorti: cannot use a subarray of second arg for first arg" -msgstr "asorti: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes Argument verwendet werden" +msgstr "" +"asorti: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes " +"Argument verwendet werden" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "»%s« ist ein unzulässiger Funktionsname" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "Die Vergleichsfunktion »%s« für das Sortieren ist nicht definiert" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "%s-Blöcke müssen einen Aktionsteil haben" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "Jede Regel muss entweder ein Muster oder einen Aktionsteil haben" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "Das alte awk erlaubt keine mehrfachen »BEGIN«- oder »END«-Regeln" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "»%s« ist eine eingebaute Funktion und kann nicht umdefiniert werden" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" -msgstr "Die Regulärer-Ausdruck-Konstante »//« sieht wie ein C-Kommentar aus, ist aber keiner" +msgstr "" +"Die Regulärer-Ausdruck-Konstante »//« sieht wie ein C-Kommentar aus, ist " +"aber keiner" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" -msgstr "Die Regulärer-Ausdruck-Konstante »/%s/« sieht wie ein C-Kommentar aus, ist aber keiner" +msgstr "" +"Die Regulärer-Ausdruck-Konstante »/%s/« sieht wie ein C-Kommentar aus, ist " +"aber keiner" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "doppelte Case-Werte im Switch-Block: %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "doppeltes »default« im Switch-Block gefunden" -#: awkgram.y:796 awkgram.y:3699 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" -msgstr "»break« ist außerhalb einer Schleife oder eines Switch-Blocks nicht zulässig" +msgstr "" +"»break« ist außerhalb einer Schleife oder eines Switch-Blocks nicht zulässig" -#: awkgram.y:805 awkgram.y:3691 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "»continue« ist außerhalb einer Schleife nicht zulässig" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "»next« wird in %s-Aktion verwendet" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "»nextfile« wird in %s-Aktion verwendet" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "»return« wird außerhalb einer Funktion verwendet" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" -msgstr "Einfaches »print« in BEGIN- oder END-Regel soll vermutlich »print \"\"« sein" +msgstr "" +"Einfaches »print« in BEGIN- oder END-Regel soll vermutlich »print \"\"« sein" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "»delete« ist in Zusammenhang mit SYMTAB nicht zulässig" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "»delete« ist in Zusammenhang mit FUNCTAB nicht zulässig" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "»delete(array)« ist eine gawk-Erweiterung" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "mehrstufige Zweiwege-Pipes funktionieren nicht" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "Regulärer Ausdruck auf der rechten Seite einer Zuweisung" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "Regulärer Ausdruck links vom »~«- oder »!~«-Operator" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "Das alte awk unterstützt das Schlüsselwort »in« nur nach »for«" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "Regulärer Ausdruck rechts von einem Vergleich" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "»getline var« ist ungültig innerhalb der »%s«-Regel" - -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" +#: awkgram.y:1411 +#, fuzzy, c-format +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "»getline« ist ungültig innerhalb der »%s«-Regel" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" -msgstr "Nicht-umgelenktes »getline« ist innerhalb der END-Aktion nicht definiert" +msgstr "" +"Nicht-umgelenktes »getline« ist innerhalb der END-Aktion nicht definiert" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "Das alte awk unterstützt keine mehrdimensionalen Felder" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "Aufruf von »length« ohne Klammern ist nicht portabel" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "indirekte Funktionsaufrufe sind eine gawk-Erweiterung" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" -msgstr "die besondere Variable »%s« kann nicht für den indirekten Funktionsaufruf verwendet werden" +msgstr "" +"die besondere Variable »%s« kann nicht für den indirekten Funktionsaufruf " +"verwendet werden" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "Ungültiger Index-Ausdruck" -#: awkgram.y:2024 awkgram.y:2044 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "Warnung: " -#: awkgram.y:2042 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "Fatal: " -#: awkgram.y:2092 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "Unerwarteter Zeilenumbruch oder Ende der Zeichenkette" -#: awkgram.y:2359 awkgram.y:2435 awkgram.y:2658 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "Quelldatei »%s« kann nicht zum Lesen geöffnet werden (%s)" -#: awkgram.y:2360 awkgram.y:2485 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" -msgstr "Die dynamische Bibliothek »%s« kann nicht zum Lesen geöffnet werden (%s)" +msgstr "" +"Die dynamische Bibliothek »%s« kann nicht zum Lesen geöffnet werden (%s)" -#: awkgram.y:2362 awkgram.y:2436 awkgram.y:2486 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "Unbekannte Ursache" -#: awkgram.y:2371 awkgram.y:2395 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "»%s« kann nicht eingebunden und als Programmdatei verwendet werden" -#: awkgram.y:2384 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "Quelldatei »%s« wurde bereits eingebunden" -#: awkgram.y:2385 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "Die dynamische Bibliothek »%s« wurde bereits eingebunden" -#: awkgram.y:2420 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "»@include« ist eine gawk-Erweiterung" -#: awkgram.y:2426 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "leerer Dateiname nach @include" -#: awkgram.y:2470 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "»@load« ist eine Gawk-Erweiterung" -#: awkgram.y:2476 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "leerer Dateiname nach @load" -#: awkgram.y:2610 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "Kein Programmtext auf der Kommandozeile" -#: awkgram.y:2725 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)" -#: awkgram.y:2736 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "Die Quelldatei »%s« ist leer" -#: awkgram.y:2913 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "Die Quelldatei hört nicht mit einem Zeilenende auf" -#: awkgram.y:3018 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" -msgstr "Nicht beendeter regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei" +msgstr "" +"Nicht beendeter regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei" -#: awkgram.y:3042 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" -msgstr "%s: %d: der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert nicht in gawk" +msgstr "" +"%s: %d: der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert " +"nicht in gawk" -#: awkgram.y:3046 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" -msgstr "Der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert nicht in gawk" +msgstr "" +"Der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert nicht in " +"gawk" -#: awkgram.y:3053 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "Nicht beendeter regulärer Ausdruck" -#: awkgram.y:3057 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "Nicht beendeter regulärer Ausdruck am Dateiende" -#: awkgram.y:3116 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" -msgstr "Die Verwendung von »\\#...« zur Fortsetzung von Zeilen ist nicht portabel" +msgstr "" +"Die Verwendung von »\\#...« zur Fortsetzung von Zeilen ist nicht portabel" -#: awkgram.y:3132 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "das letzte Zeichen auf der Zeile ist kein Backslash (»\\«)" -#: awkgram.y:3193 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX erlaubt den Operator »**=« nicht" -#: awkgram.y:3195 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "Das alte awk unterstützt den Operator »**=« nicht" -#: awkgram.y:3204 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX erlaubt den Operator »**« nicht" -#: awkgram.y:3206 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "Das alte awk unterstützt den Operator »**« nicht" -#: awkgram.y:3241 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "Das alte awk unterstützt den Operator »^=« nicht" -#: awkgram.y:3249 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "Das alte awk unterstützt den Operator »^« nicht" -#: awkgram.y:3342 awkgram.y:3358 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "Nicht beendete Zeichenkette" -#: awkgram.y:3579 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "Ungültiges Zeichen »%c« in einem Ausdruck" -#: awkgram.y:3626 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "»%s« ist eine gawk-Erweiterung" -#: awkgram.y:3631 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX erlaubt »%s« nicht" -#: awkgram.y:3639 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "»%s« wird im alten awk nicht unterstützt" -#: awkgram.y:3729 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "»goto« gilt als schlechter Stil!\n" -#: awkgram.y:3763 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "Unzulässige Argumentzahl %d für %s" -#: awkgram.y:3798 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: Ein String als letztes Argument von substitute hat keinen Effekt" -#: awkgram.y:3803 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "Der dritte Parameter von %s ist ein unveränderliches Objekt" -#: awkgram.y:3886 awkgram.y:3889 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: Das dritte Argument ist eine gawk-Erweiterung" -#: awkgram.y:3943 awkgram.y:3946 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: Das zweite Argument ist eine gawk-Erweiterung" -#: awkgram.y:3958 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "Fehlerhafte Verwendung von dcgettext(_\"...\"): \n" "Entfernen Sie den führenden Unterstrich" -#: awkgram.y:3973 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "Fehlerhafte Verwendung von dcngettext(_\"...\"): \n" "Entfernen Sie den führenden Unterstrich" -#: awkgram.y:3992 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "index: eine Regexp-Konstante als zweites Argument ist unzulässig" -#: awkgram.y:4045 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "Funktion »%s«: Parameter »%s« verdeckt eine globale Variable" -#: awkgram.y:4102 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "»%s« kann nicht zum Schreiben geöffne werden(%s)" -#: awkgram.y:4103 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "Die Liste der Variablen wird auf der Standardfehlerausgabe ausgegeben" -#: awkgram.y:4111 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: close ist gescheitert (%s)" -#: awkgram.y:4136 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() zweimal aufgerufen!" -#: awkgram.y:4144 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "es sind verdeckte Variablen vorhanden" -#: awkgram.y:4215 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "Funktion »%s« wurde bereits definiert" -#: awkgram.y:4261 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "Funktion »%s«: Funktionsnamen können nicht als Parameternamen benutzen" -#: awkgram.y:4264 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" -msgstr "Funktion »%s«: die spezielle Variable »%s« kann nicht als Parameter verwendet werden" +msgstr "" +"Funktion »%s«: die spezielle Variable »%s« kann nicht als Parameter " +"verwendet werden" -#: awkgram.y:4272 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "Funktion »%s«: Parameter #%d, »%s« wiederholt Parameter #%d" -#: awkgram.y:4359 awkgram.y:4365 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "Aufgerufene Funktion »%s« ist nirgends definiert" -#: awkgram.y:4369 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "Funktion »%s« wurde definiert aber nirgends aufgerufen" -#: awkgram.y:4401 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "Regulärer-Ausdruck-Konstante für Parameter #%d ergibt einen \n" "logischen Wert" -#: awkgram.y:4460 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -498,20 +529,23 @@ msgstr "" "Funktion »%s« wird mit Leerzeichen zwischen Name und »(« aufgerufen, \n" "oder als Variable oder Feld verwendet" -#: awkgram.y:4696 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "Division durch Null wurde versucht" -#: awkgram.y:4705 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "Division durch Null versucht in »%%«" -#: awkgram.y:5025 -msgid "cannot assign a value to the result of a field post-increment expression" -msgstr "dem Ergebnis eines Feld-Postinkrementausdruck kann kein Wert zugewiesen werden" +#: awkgram.y:5003 +msgid "" +"cannot assign a value to the result of a field post-increment expression" +msgstr "" +"dem Ergebnis eines Feld-Postinkrementausdruck kann kein Wert zugewiesen " +"werden" -#: awkgram.y:5028 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "Unzulässiges Ziel für eine Zuweisung (Opcode %s)" @@ -537,383 +571,423 @@ msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" #: builtin.c:229 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" -msgstr "fflush: Leeren der Puffer nicht möglich, Pipe »%s« ist nur zum Lesen geöffnet" +msgstr "" +"fflush: Leeren der Puffer nicht möglich, Pipe »%s« ist nur zum Lesen geöffnet" #: builtin.c:232 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" -msgstr "fflush: Leeren der Puffer nicht möglich, Datei »%s« ist nur zum Lesen geöffnet" +msgstr "" +"fflush: Leeren der Puffer nicht möglich, Datei »%s« ist nur zum Lesen " +"geöffnet" #: builtin.c:244 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: »%s« ist keine geöffnete Datei, Pipe oder Prozess" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: Erstes Argument ist kein String" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: Zweites Argument ist kein string" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "Argument ist keine Zahl" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: Argument ist ein Feld" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "»length(array)« ist eine gawk-Erweiterung" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: Argument ist kein String" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: Argument ist keine Zahl" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: Negatives Argument %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "Fatal: »count$« muss auf alle Formate angewandt werden oder auf keines" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "Feldbreite wird für die »%%«-Angabe ignoriert" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "Genauigkeit wird für die »%%«-Angabe ignoriert" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "Feldbreite und Genauigkeit werden für die »%%«-Angabe ignoriert" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "Fatal: »$« ist in awk-Formaten nicht zulässig" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "Fatal: die Anzahl der Argumen bei »$« muss > 0 sein" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" -msgstr "Fatal: Argumentenanzahl %ld ist größer als die Gesamtzahl angegebener Argumente" +msgstr "" +"Fatal: Argumentenanzahl %ld ist größer als die Gesamtzahl angegebener " +"Argumente" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "Fatal: »$« nach Punkt in Formatangabe nicht zulässig" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "Fatal: »$« fehlt in positionsabhängiger Feldbreite oder Genauigkeit" # -#: builtin.c:1011 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "»l« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1015 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "Fatal: »l« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1028 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "»L« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1032 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "Fatal: »L« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1045 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "»h« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1049 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "Fatal: »h« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1447 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: Wert %g ist außerhalb des Bereichs für Format »%%%c«" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: Wert %g ist außerhalb des Bereichs für Format »%%%c«" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: Wert %g ist außerhalb des Bereichs für Format »%%%c«" -#: builtin.c:1545 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" -msgstr "das unbekannte Zeichen »%c« in der Formatspezifikation wird ignoriert: keine Argumente umgewandelt" +msgstr "" +"das unbekannte Zeichen »%c« in der Formatspezifikation wird ignoriert: keine " +"Argumente umgewandelt" -#: builtin.c:1550 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "Fatal: Nicht genügend Argumente für die Formatangabe" -#: builtin.c:1552 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ hierfür fehlte es" -#: builtin.c:1559 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: Format-Spezifikation hat keinen Controlcode" -#: builtin.c:1562 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "Zu viele Argumente für den Formatstring" -#: builtin.c:1618 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: Keine Argumente" -#: builtin.c:1641 builtin.c:1652 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: Keine Argumente" -#: builtin.c:1695 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: das Argument ist keine Zahl" -#: builtin.c:1699 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: das Argument %g ist negativ" -#: builtin.c:1730 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: Länge %g ist nicht >= 1" -#: builtin.c:1732 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: Länge %g ist nicht >= 0" -#: builtin.c:1739 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: Nicht ganzzahlige Länge %g wird abgeschnitten" -#: builtin.c:1744 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" -msgstr "substr: Länge %g ist zu groß für Stringindizierung, wird auf %g gekürzt" +msgstr "" +"substr: Länge %g ist zu groß für Stringindizierung, wird auf %g gekürzt" -#: builtin.c:1756 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: Start-Index %g ist ungültig, 1 wird verwendet" -#: builtin.c:1761 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: Nicht ganzzahliger Start-Wert %g wird abgeschnitten" -#: builtin.c:1786 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: Quellstring ist leer" -#: builtin.c:1802 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: Start-Wert %g liegt hinter dem Ende des Strings" -#: builtin.c:1810 +#: builtin.c:1820 #, c-format -msgid "substr: length %g at start index %g exceeds length of first argument (%lu)" -msgstr "substr: Länge %g am Start-Wert %g überschreitet die Länge des ersten Arguments (%lu)" +msgid "" +"substr: length %g at start index %g exceeds length of first argument (%lu)" +msgstr "" +"substr: Länge %g am Start-Wert %g überschreitet die Länge des ersten " +"Arguments (%lu)" -#: builtin.c:1884 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: Formatwert in PROCINFO[\"strftime\"] ist numerischen Typs" -#: builtin.c:1907 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: Das zweite Argument ist keine Zahl" -#: builtin.c:1911 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" -msgstr "strftime: das zweite Argument ist kleiner als 0 oder zu groß für time_t" +msgstr "" +"strftime: das zweite Argument ist kleiner als 0 oder zu groß für time_t" -#: builtin.c:1918 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: Das erste Argument ist kein String" -#: builtin.c:1925 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: Der Format-String ist leer" -#: builtin.c:1991 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: Das Argument ist kein String" -#: builtin.c:2008 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: mindestens einer der Werte ist außerhalb des normalen Bereichs" -#: builtin.c:2043 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "Die Funktion »system« ist im Sandbox-Modus nicht erlaubt" -#: builtin.c:2048 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: Das Argument ist kein String" -#: builtin.c:2168 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "Referenz auf das nicht initialisierte Feld »$%d«" -#: builtin.c:2255 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: das Argument ist kein String" -#: builtin.c:2289 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: das Argument ist kein String" -#: builtin.c:2325 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: das erste Argument ist keine Zahl" -#: builtin.c:2327 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: das zweite Argument ist keine Zahl" -#: builtin.c:2346 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: das Argument ist keine Zahl" -#: builtin.c:2362 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: das Argument ist keine Zahl" -#: builtin.c:2415 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: das Argument ist keine Zahl" -#: builtin.c:2446 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: das dritte Argument ist kein Array" -#: builtin.c:2718 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: 0 als drittes Argument wird als 1 interpretiert" -#: builtin.c:3014 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: 0 als drittes Argument wird als 1 interpretiert" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: das erste Argument ist keine Zahl" -#: builtin.c:3016 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: das zweite Argument ist keine Zahl" -#: builtin.c:3022 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" -msgstr "lshift(%f, %f): Negative Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "" +"lshift(%f, %f): Negative Werte werden zu merkwürdigen Ergebnissen führen" -#: builtin.c:3024 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): Dezimalteil wird abgeschnitten" -#: builtin.c:3026 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" -msgstr "lshift(%f, %f): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "" +"lshift(%f, %f): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen " +"führen" -#: builtin.c:3051 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: das erste Argument ist keine Zahl" -#: builtin.c:3053 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: das zweite Argument ist keine Zahl" -#: builtin.c:3059 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" -msgstr "rshift (%f, %f): Negative Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "" +"rshift (%f, %f): Negative Werte werden zu merkwürdigen Ergebnissen führen" -#: builtin.c:3061 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): Dezimalteil wird abgeschnitten" -#: builtin.c:3063 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" -msgstr "rshift(%f, %f): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "" +"rshift(%f, %f): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen " +"führen" -#: builtin.c:3088 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3093 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: das Argument %d ist nicht numerisch" -#: builtin.c:3097 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" -msgstr "and: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen Ergebnissen führen" +msgstr "" +"and: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen " +"Ergebnissen führen" -#: builtin.c:3120 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3125 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: das Argument %d ist nicht numerisch" -#: builtin.c:3129 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" -msgstr "or: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen Ergebnissen führen" +msgstr "" +"or: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen " +"Ergebnissen führen" -#: builtin.c:3151 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3157 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: das Argument %d ist nicht numerisch" -#: builtin.c:3161 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" -msgstr "xor: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen Ergebnissen führen" +msgstr "" +"xor: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen " +"Ergebnissen führen" -#: builtin.c:3186 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: das erste Argument ist keine Zahl" -#: builtin.c:3192 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): Der negative Wert wird zu merkwürdigen Ergebnissen führen" -#: builtin.c:3194 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): der Dezimalteil wird abgeschnitten" -#: builtin.c:3363 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: »%s« ist keine gültige Locale-Kategorie" @@ -945,7 +1019,8 @@ msgstr "save »%s«: Der Befehl ist nicht zulässig." #: command.y:339 msgid "Can't use command `commands' for breakpoint/watchpoint commands" -msgstr "Der Befehl »commands« kann nicht für Break- bzw. Watchpoints verwendet werden" +msgstr "" +"Der Befehl »commands« kann nicht für Break- bzw. Watchpoints verwendet werden" #: command.y:341 msgid "no breakpoint/watchpoint has been set yet" @@ -958,7 +1033,9 @@ msgstr "ungültige Break-/Watchpoint/Nummer" #: command.y:348 #, c-format msgid "Type commands for when %s %d is hit, one per line.\n" -msgstr "Befehle eingeben, die bei Erreichen von %s %d ausgeführt werden sollen, einer pro Zeile.\n" +msgstr "" +"Befehle eingeben, die bei Erreichen von %s %d ausgeführt werden sollen, " +"einer pro Zeile.\n" #: command.y:350 #, c-format @@ -1019,24 +1096,36 @@ msgid "non-zero integer value" msgstr "ganyzahliger Wert ungleich Null" #: command.y:817 -msgid "backtrace [N] - print trace of all or N innermost (outermost if N < 0) frames." -msgstr "backtrace [N] - log von allen oder den N innersten (äußersten wenn N < 0) Rahmen." +msgid "" +"backtrace [N] - print trace of all or N innermost (outermost if N < 0) " +"frames." +msgstr "" +"backtrace [N] - log von allen oder den N innersten (äußersten wenn N < 0) " +"Rahmen." #: command.y:819 -msgid "break [[filename:]N|function] - set breakpoint at the specified location." -msgstr "break [[Dateiname:]N|funktion - Breakpoint an der angegebenen Stelle setzen.]" +msgid "" +"break [[filename:]N|function] - set breakpoint at the specified location." +msgstr "" +"break [[Dateiname:]N|funktion - Breakpoint an der angegebenen Stelle setzen.]" #: command.y:821 msgid "clear [[filename:]N|function] - delete breakpoints previously set." msgstr "clear [[Dateiname:]N|Funktion - zuvor gesetzte Breakpoints löschen." #: command.y:823 -msgid "commands [num] - starts a list of commands to be executed at a breakpoint(watchpoint) hit." -msgstr "commands [Nr] - startet eine Liste von Befehlen, die bei Erreichen eines Break- bzw. Watchpoints ausgeführt werden." +msgid "" +"commands [num] - starts a list of commands to be executed at a " +"breakpoint(watchpoint) hit." +msgstr "" +"commands [Nr] - startet eine Liste von Befehlen, die bei Erreichen eines " +"Break- bzw. Watchpoints ausgeführt werden." #: command.y:825 msgid "condition num [expr] - set or clear breakpoint or watchpoint condition." -msgstr "condition Nr [Ausdruck] - Bedingungen für einen Break-/Watchpoint setzen oder löschen." +msgstr "" +"condition Nr [Ausdruck] - Bedingungen für einen Break-/Watchpoint setzen " +"oder löschen." #: command.y:827 msgid "continue [COUNT] - continue program being debugged." @@ -1052,7 +1141,8 @@ msgstr "disable [Breakpoints] [Bereich] - angegebene Breakpoints deaktivieren." #: command.y:833 msgid "display [var] - print value of variable each time the program stops." -msgstr "display [Var] - den Wert der Variablen bei jedem Programmstop ausgeben." +msgstr "" +"display [Var] - den Wert der Variablen bei jedem Programmstop ausgeben." #: command.y:835 msgid "down [N] - move N frames down the stack." @@ -1060,11 +1150,15 @@ msgstr "down [N] - N Rahmen nach unten im Stack gehen." #: command.y:837 msgid "dump [filename] - dump instructions to file or stdout." -msgstr "dump [Dateiname] - Befehle in eine Datei oder auf der Standardausgabe ausgeben" +msgstr "" +"dump [Dateiname] - Befehle in eine Datei oder auf der Standardausgabe " +"ausgeben" #: command.y:839 msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints." -msgstr "enable [once|del] [Breakpoints] [Bereich] - die angegebenen Breakpoints aktivieren." +msgstr "" +"enable [once|del] [Breakpoints] [Bereich] - die angegebenen Breakpoints " +"aktivieren." #: command.y:841 msgid "end - end a list of commands or awk statements." @@ -1076,7 +1170,8 @@ msgstr "eval stmt[p1, p2, ...] - Awk-Ausdrücke auswerten." #: command.y:845 msgid "finish - execute until selected stack frame returns." -msgstr "finish - mit Ausführung fortfahren bis auisgewählter Rahmen verlassen wird." +msgstr "" +"finish - mit Ausführung fortfahren bis auisgewählter Rahmen verlassen wird." #: command.y:847 msgid "frame [N] - select and print stack frame number N." @@ -1084,27 +1179,41 @@ msgstr "frame [N] - den Stackrahmen Nummer N auswählen und ausgeben." #: command.y:849 msgid "help [command] - print list of commands or explanation of command." -msgstr "help [Befehl] - gibt eine Liste der Befehle oder die Beschreibung eines einzelnen Befehls aus." +msgstr "" +"help [Befehl] - gibt eine Liste der Befehle oder die Beschreibung eines " +"einzelnen Befehls aus." #: command.y:851 msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT." -msgstr "ignore N ZÄHLER - setzt den Ignorieren-Zähler von Breakpoint N auf ZÄHLER" +msgstr "" +"ignore N ZÄHLER - setzt den Ignorieren-Zähler von Breakpoint N auf ZÄHLER" #: command.y:853 -msgid "info topic - source|sources|variables|functions|break|frame|args|locals|display|watch." -msgstr "info Thema - source|sources|variables|functions|break|frame|args|locals|display|watch." +msgid "" +"info topic - source|sources|variables|functions|break|frame|args|locals|" +"display|watch." +msgstr "" +"info Thema - source|sources|variables|functions|break|frame|args|locals|" +"display|watch." #: command.y:855 msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)." -msgstr "list [-|+|[Dateiname:]Zeilennr|Funktion|Breich] - die angegebenen Zeilen ausgeben" +msgstr "" +"list [-|+|[Dateiname:]Zeilennr|Funktion|Breich] - die angegebenen Zeilen " +"ausgeben" #: command.y:857 msgid "next [COUNT] - step program, proceeding through subroutine calls." -msgstr "next [ZÄHLER] - Programm schrittweise ausführen aber Subroutinen in einem Rutsch ausführen" +msgstr "" +"next [ZÄHLER] - Programm schrittweise ausführen aber Subroutinen in einem " +"Rutsch ausführen" #: command.y:859 -msgid "nexti [COUNT] - step one instruction, but proceed through subroutine calls." -msgstr "nexti [ZÄHLER] - einen Befehl abarbeiten. aber Subroutinen in einem Rutsch ausführen" +msgid "" +"nexti [COUNT] - step one instruction, but proceed through subroutine calls." +msgstr "" +"nexti [ZÄHLER] - einen Befehl abarbeiten. aber Subroutinen in einem Rutsch " +"ausführen" #: command.y:861 msgid "option [name[=value]] - set or display debugger option(s)." @@ -1124,7 +1233,9 @@ msgstr "quit - Debugger verlassen" #: command.y:869 msgid "return [value] - make selected stack frame return to its caller." -msgstr "return [Wert] - den ausgewählten Stapelrahmen yu seinem Aufrufer zurück kehren lassen" +msgstr "" +"return [Wert] - den ausgewählten Stapelrahmen yu seinem Aufrufer zurück " +"kehren lassen" #: command.y:871 msgid "run - start or restart executing program." @@ -1139,8 +1250,11 @@ msgid "set var = value - assign value to a scalar variable." msgstr "set Var = Wert - einer skalaren Variablen einen Wert zuweisen" #: command.y:879 -msgid "silent - suspends usual message when stopped at a breakpoint/watchpoint." -msgstr "silent - unterdrückt die übliche Nachricht, wenn ein Break- bzw. Watchpoint erreicht wird." +msgid "" +"silent - suspends usual message when stopped at a breakpoint/watchpoint." +msgstr "" +"silent - unterdrückt die übliche Nachricht, wenn ein Break- bzw. Watchpoint " +"erreicht wird." #: command.y:881 msgid "source file - execute commands from file." @@ -1148,7 +1262,9 @@ msgstr "source Datei - die Befehle in Datei ausführen" #: command.y:883 msgid "step [COUNT] - step program until it reaches a different source line." -msgstr "step [ZÄHLER - Programm schrittweise ausführen bis es eine andere Quellzeile erricht." +msgstr "" +"step [ZÄHLER - Programm schrittweise ausführen bis es eine andere Quellzeile " +"erricht." #: command.y:885 msgid "stepi [COUNT] - step one instruction exactly." @@ -1164,11 +1280,17 @@ msgstr "trace on|off - Instruktionen vor der Ausführung ausgeben." #: command.y:891 msgid "undisplay [N] - remove variable(s) from automatic display list." -msgstr "undisplay [N] - Variablen von der Liste der automatisch Anzuzeigenden entfernen." +msgstr "" +"undisplay [N] - Variablen von der Liste der automatisch Anzuzeigenden " +"entfernen." #: command.y:893 -msgid "until [[filename:]N|function] - execute until program reaches a different line or line N within current frame." -msgstr "until [[Dateiname:]N|Funktion - Ausführen bis das Programm eine andere Zeile erreicht oder N Zeilen im aktuellen Rahmen." +msgid "" +"until [[filename:]N|function] - execute until program reaches a different " +"line or line N within current frame." +msgstr "" +"until [[Dateiname:]N|Funktion - Ausführen bis das Programm eine andere Zeile " +"erreicht oder N Zeilen im aktuellen Rahmen." #: command.y:895 msgid "unwatch [N] - remove variable(s) from watch list." @@ -1182,47 +1304,58 @@ msgstr "up [N] - N Rahmen im Kellerspeicher nach oben gehen." msgid "watch var - set a watchpoint for a variable." msgstr "watch Var - einen Watchpoint für eine Variable setzen." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +#, fuzzy +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"backtrace [N] - log von allen oder den N innersten (äußersten wenn N < 0) " +"Rahmen." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "Fehler: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "der Befehl kann nicht gelesen werden (»%s«)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "der Befehl kann nicht gelesen werden (»%s«)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "Ungültiges Zeichen im Befehl" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "unbekannter Befehl - »%.*s«, versuchen Sie es mit help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "Ungültiges Zeichen" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "undefinierter Befehl: %s\n" #: debug.c:252 msgid "set or show the number of lines to keep in history file." -msgstr "die Anzahl von Zeilen setzen oder anzeigen, die in der Historydatei gespeichert werden sollen." +msgstr "" +"die Anzahl von Zeilen setzen oder anzeigen, die in der Historydatei " +"gespeichert werden sollen." #: debug.c:254 msgid "set or show the list command window size." @@ -1274,12 +1407,14 @@ msgstr "Die Quelldatei »%s« kann nicht gefunden werden (%s)" #: debug.c:529 #, c-format msgid "WARNING: source file `%s' modified since program compilation.\n" -msgstr "WARNUNG: Quelldatei »%s« wurde seit der Programmübersetzung verändert.\n" +msgstr "" +"WARNUNG: Quelldatei »%s« wurde seit der Programmübersetzung verändert.\n" #: debug.c:551 #, c-format msgid "line number %d out of range; `%s' has %d lines" -msgstr "die Zeilennummer %d ist außerhalb des gültigen Bereichs: »%s« hat %d Zeilen" +msgstr "" +"die Zeilennummer %d ist außerhalb des gültigen Bereichs: »%s« hat %d Zeilen" #: debug.c:611 #, c-format @@ -1431,7 +1566,8 @@ msgstr "»%s« ist keine skalare Variable" #: debug.c:1258 debug.c:4994 #, c-format msgid "attempt to use array `%s[\"%s\"]' in a scalar context" -msgstr "Es wird versucht, das Feld »%s[\"%s\"]« in einem Skalarkontext zu verwenden" +msgstr "" +"Es wird versucht, das Feld »%s[\"%s\"]« in einem Skalarkontext zu verwenden" #: debug.c:1280 debug.c:5005 #, c-format @@ -1470,12 +1606,16 @@ msgstr "Es wird versucht, einen Skalar als Feld zu verwenden" #: debug.c:1856 #, c-format msgid "Watchpoint %d deleted because parameter is out of scope.\n" -msgstr "Watchpoint %d wurde gelöscht, weil der Parameter außerhalb des Gültigkeitsbereichs ist.\n" +msgstr "" +"Watchpoint %d wurde gelöscht, weil der Parameter außerhalb des " +"Gültigkeitsbereichs ist.\n" #: debug.c:1867 #, c-format msgid "Display %d deleted because parameter is out of scope.\n" -msgstr "Anzuzeigendes Element %d wurde gelöscht, weil der Parameter außerhalb des Gültigkeitsbereichs ist.\n" +msgstr "" +"Anzuzeigendes Element %d wurde gelöscht, weil der Parameter außerhalb des " +"Gültigkeitsbereichs ist.\n" #: debug.c:1900 #, c-format @@ -1504,7 +1644,9 @@ msgstr "Ungültige Rahmennummer" #: debug.c:2200 #, c-format msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d" -msgstr "Hinweis: Breakpont %d (aktiv, ignoriert für die nächsten %ld Treffer) wird auch an %s:%d gesetzt" +msgstr "" +"Hinweis: Breakpont %d (aktiv, ignoriert für die nächsten %ld Treffer) wird " +"auch an %s:%d gesetzt" #: debug.c:2207 #, c-format @@ -1514,7 +1656,9 @@ msgstr "Hinweis: Breakpont %d (aktiv) wird auch an %s:%d gesetzt" #: debug.c:2214 #, c-format msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d" -msgstr "Hinweis: Breakpont %d (inaktiv, ignoriert für die nächsten %ld Treffer) wird auch von %s:%d gesetzt" +msgstr "" +"Hinweis: Breakpont %d (inaktiv, ignoriert für die nächsten %ld Treffer) wird " +"auch von %s:%d gesetzt" #: debug.c:2221 #, c-format @@ -1586,7 +1730,8 @@ msgstr "j" #: debug.c:2662 #, c-format msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n" -msgstr "die nächsten %ld Überschreitungen von Breakpoint %d werden ignoriert.\n" +msgstr "" +"die nächsten %ld Überschreitungen von Breakpoint %d werden ignoriert.\n" #: debug.c:2666 #, c-format @@ -1596,7 +1741,9 @@ msgstr "wenn Breakpoint %d das nächste mal erreicht wird, wird angehalten\n" #: debug.c:2783 #, c-format msgid "Can only debug programs provided with the `-f' option.\n" -msgstr "Es können nur Programme untersucht werden, die mittels der Option »-f« übergeben wurden.\n" +msgstr "" +"Es können nur Programme untersucht werden, die mittels der Option »-f« " +"übergeben wurden.\n" #: debug.c:2908 #, c-format @@ -1620,7 +1767,8 @@ msgstr "Fehler: Neustart nicht möglich da die Operation verboten ist\n" #: debug.c:2942 #, c-format msgid "error (%s): cannot restart, ignoring rest of the commands\n" -msgstr "Fehler (%s): Neustart nicht möglich, der Rest der Befehle wird ignoriert\n" +msgstr "" +"Fehler (%s): Neustart nicht möglich, der Rest der Befehle wird ignoriert\n" #: debug.c:2950 #, c-format @@ -1649,7 +1797,8 @@ msgstr "ungültige Breakpointnummer %d." #: debug.c:3020 #, c-format msgid "Will ignore next %ld crossings of breakpoint %d.\n" -msgstr "Die nächsten %ld Überschreitungen von Breakpoint %d werden ignoriert.\n" +msgstr "" +"Die nächsten %ld Überschreitungen von Breakpoint %d werden ignoriert.\n" #: debug.c:3207 #, c-format @@ -1731,74 +1880,79 @@ msgstr "ungültige Zahl" #: debug.c:5381 #, c-format msgid "`%s' not allowed in current context; statement ignored" -msgstr "»%s« ist im aktuellen Kontext nicht zulässig; der Ausdruck wird ignoriert" +msgstr "" +"»%s« ist im aktuellen Kontext nicht zulässig; der Ausdruck wird ignoriert" #: debug.c:5389 msgid "`return' not allowed in current context; statement ignored" -msgstr "»reeturn« ist im aktuellen Kontext nicht zulässig; der Ausdruck wird ignoriert" +msgstr "" +"»reeturn« ist im aktuellen Kontext nicht zulässig; der Ausdruck wird " +"ignoriert" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Im aktuelln Kontext gibt es kein Symbol »%s«" -#: dfa.c:998 dfa.c:1001 dfa.c:1021 dfa.c:1031 dfa.c:1043 dfa.c:1094 dfa.c:1103 -#: dfa.c:1106 dfa.c:1111 dfa.c:1124 dfa.c:1191 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "nicht geschlossene [" -#: dfa.c:1052 +#: dfa.c:1119 msgid "invalid character class" msgstr "ungültige Zeichenklasse" -#: dfa.c:1228 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "Die Syntax für Zeichenklassen ist [[:space:]], nicht [:space:]" -#: dfa.c:1280 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "nicht beendetes \\ Escape" -#: dfa.c:1427 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Ungültiger Inhalt von \\{\\}" -#: dfa.c:1430 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "Regulärer Ausdruck ist zu groß" -#: dfa.c:1847 +#: dfa.c:1912 msgid "unbalanced (" msgstr "nicht geschlossene (" -#: dfa.c:1973 +#: dfa.c:2038 msgid "no syntax specified" msgstr "keine Syntax angegeben" -#: dfa.c:1981 +#: dfa.c:2046 msgid "unbalanced )" msgstr "nicht geöffnete )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "Unbekannter Knotentyp %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "Unbekannter Opcode %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "Opcode %s ist weder ein Operator noch ein Schlüsselwort" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "Pufferüberlauf in genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1809,215 +1963,234 @@ msgstr "" "\t# Funktions-Aufruf-Stack\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "»IGNORECASE« ist eine gawk-Erweiterung" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "»BINMODE« ist eine gawk-Erweiterung" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "Falsche »%sFMT«-Angabe »%s«" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "»--lint« wird abgeschaltet, da an »LINT« zugewiesen wird" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "Referenz auf nicht initialisiertes Argument »%s«" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "Referenz auf die nicht initialisierte Variable »%s«" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "Nicht numerischer Wert für Feldreferenz verwendet" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "Referenz auf ein Feld von einem Null-String" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "Versuch des Zugriffs auf Feld %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "Referenz auf das nicht initialisierte Feld »$%ld«" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "Funktion »%s« mit zu vielen Argumenten aufgerufen" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: unerwarteter Typ »%s«" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "Division durch Null versucht in »/=«" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "Division durch Null versucht in »%%=«" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "Erweiterungen sind im Sandbox-Modus nicht erlaubt" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load sind gawk-Erweiterungen" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: NULL lib_name erhalten" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: Bibliothek »%s« kann nicht geöffnet werden (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format -msgid "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" -msgstr "load_ext: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« nicht (%s)\n" +msgid "" +"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" +msgstr "" +"load_ext: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« nicht (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" -msgstr "load_ext: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen werden (%s)\n" +msgstr "" +"load_ext: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen werden (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" -msgstr "load_ext: die Initialisierungsroutine %2$s von Bibliothek »%1$s« ist gescheitert\n" +msgstr "" +"load_ext: die Initialisierungsroutine %2$s von Bibliothek »%1$s« ist " +"gescheitert\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "»extension« ist eine gawk-Erweiterung" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension: NULL lib_name erhalten" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: Bibliothek »%s« kann nicht geöffnet werden (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format -msgid "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" -msgstr "extension: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« nicht (%s)" +msgid "" +"extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" +msgstr "" +"extension: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« nicht (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" -msgstr "extension: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen werden (%s)" +msgstr "" +"extension: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen werden (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: Funktionsname fehlt" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: Funktion »%s« kann nicht neu definiert werden" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: Funktion »%s« wurde bereits definiert" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: Funktion »%s« wurde bereits vorher definiert" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" -msgstr "make_builtin: die in gawk eingebaute Funktion »%s« kann nicht als Funktionsname verwendet werden" +msgstr "" +"make_builtin: die in gawk eingebaute Funktion »%s« kann nicht als " +"Funktionsname verwendet werden" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negative Anzahl von Argumenten für Funktion »%s«" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "Erweiterung: Funktionsname fehlt" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: unzulässiges Zeichen »%c« in Funktionsname »%s«" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: Funktion »%s« kann nicht neu definiert werden" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: Funktion »%s« wurde bereits definiert" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: Funktion »%s« wurde bereits vorher definiert" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" -msgstr "extension: die eingebaute Funktion »%s« kann nicht als Funktionsname verwendet werden" +msgstr "" +"extension: die eingebaute Funktion »%s« kann nicht als Funktionsname " +"verwendet werden" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" -msgstr "Funktion »%s« wird als Funktion definiert, die nie mehr als %d Argument(e) akzeptiert" +msgstr "" +"Funktion »%s« wird als Funktion definiert, die nie mehr als %d Argument(e) " +"akzeptiert" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "Funktion »%s«: fehlendes Argument #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" -msgstr "Funktion »%s«: Argument #%d: Es wird versucht, einen Skalar als Feld zu verwenden" +msgstr "" +"Funktion »%s«: Argument #%d: Es wird versucht, einen Skalar als Feld zu " +"verwenden" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" -msgstr "Funktion »%s«: Argument #%d: Es wird versucht, ein Feld als Skalar zu verwenden" +msgstr "" +"Funktion »%s«: Argument #%d: Es wird versucht, ein Feld als Skalar zu " +"verwenden" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "das dynamische Laden von Bibliotheken wird nicht unterstützt" #: extension/filefuncs.c:159 msgid "chdir: called with incorrect number of arguments, expecting 1" -msgstr "chdir: Aufgruf mit einer ungültigen Anzahl von Argumenten, 1 wird erwartet" +msgstr "" +"chdir: Aufgruf mit einer ungültigen Anzahl von Argumenten, 1 wird erwartet" #: extension/filefuncs.c:439 #, c-format @@ -2088,7 +2261,8 @@ msgstr "fts: ungültiger dritter Parameter\n" #: extension/filefuncs.c:824 msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah." -msgstr "fts: die heimtückische Kennung FTS_NOSTAT wird ignoriert, ätsch bätsch." +msgstr "" +"fts: die heimtückische Kennung FTS_NOSTAT wird ignoriert, ätsch bätsch." #: extension/filefuncs.c:841 msgid "fts: clear_array() failed\n" @@ -2120,7 +2294,8 @@ msgstr "fnmatch ist auf diesem System nicht implementiert\n" #: extension/fnmatch.c:173 msgid "fnmatch init: could not add FNM_NOMATCH variable" -msgstr "fnmatch_init: eine FNM_NOMATCH-Variable konnte nicht hinzu gefügt werden" +msgstr "" +"fnmatch_init: eine FNM_NOMATCH-Variable konnte nicht hinzu gefügt werden" #: extension/fnmatch.c:183 #, c-format @@ -2155,7 +2330,7 @@ msgstr "wait: Aufruf mit zu vielen Argumenten" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: direktes Editieren ist bereits aktiv" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: erwartet 2 Argumente aber wurde aufgerufen mit %d" @@ -2167,7 +2342,9 @@ msgstr "inplace_begin: das erste Argument ist kein Dateiname" #: extension/inplace.c:144 #, c-format msgid "inplace_begin: disabling in-place editing for invalid FILENAME `%s'" -msgstr "inplace_begin: direktes Editieren wird deaktiviert wegen des ungültigen Dateinamens »%s«" +msgstr "" +"inplace_begin: direktes Editieren wird deaktiviert wegen des ungültigen " +"Dateinamens »%s«" #: extension/inplace.c:151 #, c-format @@ -2184,55 +2361,55 @@ msgstr "inplace_begin: »%s« ist keine reguläre Datei" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(»%s«) ist gescheitert (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin:: chmod ist gescheitert (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) ist gescheitert (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) ist gescheitert (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) ist gescheitert (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "inplace_end: das erste Argument ist kein Dateiname" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: direktes Editieren ist nicht aktiv" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) ist gescheitert (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) ist gescheitert (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) ist gescheitert (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(»%s«, »%s«) ist gescheitert (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(»%s«, »%s«) ist gescheitert (%s)" @@ -2261,165 +2438,181 @@ msgstr "chr: Aufruf ohne Argumente" msgid "chr: called with inappropriate argument(s)" msgstr "chr: Aufruf mit ungeeigneten Argumenten" -#: extension/readdir.c:277 +#: extension/readdir.c:281 #, c-format msgid "dir_take_control_of: opendir/fdopendir failed: %s" msgstr "dir_take_control_of: opendir/fdopendir ist gescheitert: %s" -#: extension/readfile.c:84 +#: extension/readfile.c:113 msgid "readfile: called with too many arguments" msgstr "readfile: Aufruf mit zu vielen Argumenten" -#: extension/readfile.c:118 +#: extension/readfile.c:137 msgid "readfile: called with no arguments" msgstr "readfile: Aufruf ohen Argumente" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: Aufruf mit zu vielen Argumenten" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: das Argument 0 ist keine Zeichenkette\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: das Argument 1 ist kein Feld\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: das Feld konnte nicht niveliert werden\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: das nivelierte Feld konnte nicht frei gegeben werden\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: Aufruf mit zu vielen Argumenten" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: Argument 0 ist keine Zeichenkette\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: Argument 1 ist kein Feld\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array ist gescheitert\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element ist gescheitert\n" -#: extension/time.c:106 +#: extension/time.c:113 msgid "gettimeofday: ignoring arguments" msgstr "gettimeofday: die Argumente werden ignoriert" -#: extension/time.c:137 +#: extension/time.c:144 msgid "gettimeofday: not supported on this platform" msgstr "gettimeofday: wird auf dieser Plattform nicht unterstützt" -#: extension/time.c:158 +#: extension/time.c:165 msgid "sleep: called with too many arguments" msgstr "sleep: Aufruf mit zu vielen Argumenten" -#: extension/time.c:161 +#: extension/time.c:168 msgid "sleep: missing required numeric argument" msgstr "sleep: das erforderliche numerische Argument fehlt" -#: extension/time.c:167 +#: extension/time.c:174 msgid "sleep: argument is negative" msgstr "sleep: das Argument ist negativ" -#: extension/time.c:201 +#: extension/time.c:208 msgid "sleep: not supported on this platform" msgstr "sleep: wird auf dieser Plattform nicht unterstützt" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF wird ein negativer Wert zugewiesen" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: das vierte Argument ist eine gawk-Erweiterung" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: das vierte Argument ist kein Feld" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: das zweite Argument ist kein Feld" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" -msgstr "split: als zweites und viertes Argument kann nicht das gleiche Feld verwendet werden" +msgstr "" +"split: als zweites und viertes Argument kann nicht das gleiche Feld " +"verwendet werden" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" -msgstr "split: Ein untergeordnetes Feld des zweiten Arguments kann nicht als viertes Argument verwendet werden" +msgstr "" +"split: Ein untergeordnetes Feld des zweiten Arguments kann nicht als viertes " +"Argument verwendet werden" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" -msgstr "split: Ein untergeordnetes Feld des vierten Arguments kann nicht als zweites Argument verwendet werden" +msgstr "" +"split: Ein untergeordnetes Feld des vierten Arguments kann nicht als zweites " +"Argument verwendet werden" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: Null-String als drittes Argument ist eine gawk-Erweiterung" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: Das vierte Argument ist kein Feld" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: Das zweite Argument ist kein Feld" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: Das dritte Argument darf nicht Null sein" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" -msgstr "patsplit: als zweites und viertes Argument kann nicht das gleiche Feld verwendet werden" +msgstr "" +"patsplit: als zweites und viertes Argument kann nicht das gleiche Feld " +"verwendet werden" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" -msgstr "patsplit: Ein untergeordnetes Feld des zweiten Arguments kann nicht als viertes Argument verwendet werden" +msgstr "" +"patsplit: Ein untergeordnetes Feld des zweiten Arguments kann nicht als " +"viertes Argument verwendet werden" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" -msgstr "patsplit: Ein untergeordnetes Feld des vierten Arguments kann nicht als zweites Argument verwendet werden" +msgstr "" +"patsplit: Ein untergeordnetes Feld des vierten Arguments kann nicht als " +"zweites Argument verwendet werden" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "»FIELDWIDTHS« ist eine gawk-Erweiterung" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "ungültiger FIELDWIDTHS-Wert nah bei »%s«" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "Null-String für »FS« ist eine gawk-Erweiterung" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "Das alte awk unterstützt keine regulären Ausdrücke als Wert von »FS«" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "»FPAT« ist eine gawk-Erweiterung" @@ -2435,20 +2628,20 @@ msgstr "node_to_awk_value: Null-Knoten erhalten" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: Null-Wert erhalten" -#: gawkapi.c:808 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: Null-Feld erhalten" -#: gawkapi.c:811 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: Null-Index erhalten" -#: gawkapi.c:948 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: Index %d konnte nicht umgewandelt werden\n" -#: gawkapi.c:953 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: Wert %d konnte nicht umgewandelt werden\n" @@ -2508,500 +2701,503 @@ msgstr "%s: Die Option »-W %s« hat keine Argumente\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: Die Option »-W %s« erfordert ein Argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" -msgstr "das Kommandozeilen-Argument »%s« ist ein Verzeichnis: wird übersprungen" +msgstr "" +"das Kommandozeilen-Argument »%s« ist ein Verzeichnis: wird übersprungen" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "Die Datei »%s« kann nicht zum Lesen geöffnet werden (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "Das Schließen des Dateideskriptors %d (»%s«) ist gescheitert (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "Umlenkungen sind im Sandbox-Modus nicht erlaubt" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" -msgstr "Der Ausdruck in einer Umlenkung mittels »%s« hat nur einen numerischen Wert" +msgstr "" +"Der Ausdruck in einer Umlenkung mittels »%s« hat nur einen numerischen Wert" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "Der Ausdruck für eine Umlenkung mittels »%s« ist ein leerer String" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" -msgstr "Der Dateiname »%s« für eine Umlenkung mittels »%s« kann das Ergebnis eines logischen Ausdrucks sein" +msgstr "" +"Der Dateiname »%s« für eine Umlenkung mittels »%s« kann das Ergebnis eines " +"logischen Ausdrucks sein" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "Unnötige Kombination von »>« und »>>« für Datei »%.*s«" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "Die Pipe »%s« kann nicht für die Ausgabe geöffnet werden (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "Die Pipe »%s« kann nicht für die Eingabe geöffnet werden (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" -msgstr "Die bidirektionale Pipe »%s« kann nicht für die Ein-/Ausgabe geöffnet werden (%s)" +msgstr "" +"Die bidirektionale Pipe »%s« kann nicht für die Ein-/Ausgabe geöffnet werden " +"(%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "Von »%s« kann nicht umgelenkt werden (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "Zu »%s« kann nicht umgelenkt werden (%s)" -#: io.c:1040 -msgid "reached system limit for open files: starting to multiplex file descriptors" -msgstr "Die Systemgrenze offener Dateien ist erreicht, daher werden nun Dateideskriptoren mehrfach verwendet" +#: io.c:1073 +msgid "" +"reached system limit for open files: starting to multiplex file descriptors" +msgstr "" +"Die Systemgrenze offener Dateien ist erreicht, daher werden nun " +"Dateideskriptoren mehrfach verwendet" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "Das Schließen von »%s« ist gescheitert (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "Zu viele Pipes oder Eingabedateien offen" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: Das zweite Argument muss »to« oder »from« sein" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: »%.*s« ist weder offene Datei, noch Pipe oder Ko-Prozess" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "»close« für eine Umlenkung, die nie geöffnet wurde" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" -msgstr "close: Umlenkung »%s« wurde nicht mit »[&« geöffnet, das zweite Argument wird ignoriert" +msgstr "" +"close: Umlenkung »%s« wurde nicht mit »[&« geöffnet, das zweite Argument " +"wird ignoriert" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "Fehlerstatus (%d) beim Schließen der Pipe »%s« (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "Fehlerstatus (%d) beim Schließen der Datei »%s« (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "Das explizite Schließen des Sockets »%s« fehlt" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "Das explizite Schließen des Ko-Prozesses »%s« fehlt" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "Das explizite Schließen der Pipe »%s« fehlt" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "Das explizite Schließen der Datei »%s« fehlt" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "Fehler beim Schreiben auf die Standardausgabe (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "Fehler beim Schreiben auf die Standardfehlerausgabe (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "Das Leeren der Pipe »%s« ist gescheitert (%s)" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "Ko-Prozess: Das Leeren der Pipe zu »%s« ist gescheitert (%s)" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "Das Leeren der Datei »%s« ist gescheitert (%s)" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "Der lokale Port »%s« ist ungültig in »/inet«" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "Die Angaben zu entferntem Host und Port (%s, %s) sind ungültig" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "Es wurde kein (bekanntes) Protokoll im Dateinamen »%s« angegeben" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "Der Dateiname »%s« ist unvollständig" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "Sie müssen in /inet einen Rechnernamen angeben" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "Sie müssen in »/inet« einen Port angeben" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-Verbindungen werden nicht unterstützt" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "»%s« konnte nicht geöffnet werden, Modus »%s«" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" -msgstr "Das Schließen der übergeordneten Terminal-Gerätedatei ist gescheitert (%s)" +msgstr "" +"Das Schließen der übergeordneten Terminal-Gerätedatei ist gescheitert (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "Das Schließen der Standardausgabe im Kindprozess ist gescheitert (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" -msgstr "Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardausgabe im Kindprozess ist gescheitert (dup: %s)" +msgstr "" +"Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardausgabe " +"im Kindprozess ist gescheitert (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "Schließen von stdin im Kindprozess gescheitert (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" -msgstr "Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardeingabe im Kindprozess ist gescheitert (dup: %s)" +msgstr "" +"Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardeingabe " +"im Kindprozess ist gescheitert (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" -msgstr "Das Schließen der untergeordneten Terminal-Gerätedatei ist gescheitert (%s)" +msgstr "" +"Das Schließen der untergeordneten Terminal-Gerätedatei ist gescheitert (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" -msgstr "Das Verschieben der Pipe zur Standardausgabe im Kindprozess ist gescheitert (dup: %s)" +msgstr "" +"Das Verschieben der Pipe zur Standardausgabe im Kindprozess ist gescheitert " +"(dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" -msgstr "Das Verschieben der Pipe zur Standardeingabe im Kindprozess ist gescheitert (dup: %s)" +msgstr "" +"Das Verschieben der Pipe zur Standardeingabe im Kindprozess ist gescheitert " +"(dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" -msgstr "Das Wiederherstellen der Standardausgabe im Elternprozess ist gescheitert\n" +msgstr "" +"Das Wiederherstellen der Standardausgabe im Elternprozess ist gescheitert\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" -msgstr "Das Wiederherstellen der Standardeingabe im Elternprozess ist gescheitert\n" +msgstr "" +"Das Wiederherstellen der Standardeingabe im Elternprozess ist gescheitert\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "Das Schließen der Pipe ist gescheitert (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "»|&« wird nicht unterstützt" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "Pipe »%s« kann nicht geöffnet werden (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "Kindprozess für »%s« kann nicht erzeugt werden (fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: NULL-Zeiger erhalten" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" -msgstr "Eingabeparser »%s« steht im Konflikt mit dem vorher installierten Eingabeparser »%s«" +msgstr "" +"Eingabeparser »%s« steht im Konflikt mit dem vorher installierten " +"Eingabeparser »%s«" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "Eingabeparser »%s« konnte »%s« nicht öffnen" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: NULL-Zeiger erhalten" -#: io.c:2873 +#: io.c:2817 #, c-format -msgid "output wrapper `%s' conflicts with previously installed output wrapper `%s'" +msgid "" +"output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "Ausgabeverpackung »%s« steht im Konflikt mit Ausgabeverpackung »%s«" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "Ausgabeverpackung »%s« konnte »%s« nicht öffnen" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: NULL-Zeiger erhalten" -#: io.c:2930 +#: io.c:2874 #, c-format -msgid "two-way processor `%s' conflicts with previously installed two-way processor `%s'" +msgid "" +"two-way processor `%s' conflicts with previously installed two-way processor " +"`%s'" msgstr "Zweiwegeprozessor »%s« steht im Konflikt mit Zweiwegeprozessor »%s«" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "Zweiwegeprozessor »%s« konnte »%s« nicht öffnen" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "Die Datei »%s« ist leer" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "Es konnte kein weiterer Speicher für die Eingabe beschafft werden" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "Multicharacter-Wert von »RS« ist eine gawk-Erweiterung" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "IPv6-Verbindungen werden nicht unterstützt" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "Das leere Argument für »--source« wird ignoriert" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: Die Option »-W %s« ist unbekannt und wird ignoriert\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: Die Option %c erfordert ein Argument\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" -msgstr "Die Umgebungsvariable »POSIXLY_CORRECT« ist gesetzt: »--posix« wird eingeschaltet" +msgstr "" +"Die Umgebungsvariable »POSIXLY_CORRECT« ist gesetzt: »--posix« wird " +"eingeschaltet" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "»--posix« hat Vorrang vor »--traditional«" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "»--posix« /»--traditional« hat Vorrang vor »--non-decimal-data«" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "%s als setuid root auszuführen kann zu Sicherheitsproblemen führen" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "»--posix« hat Vorrang vor »--characters-as-bytes«" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" -msgstr "Das Setzen des Binärermodus für die Standardeingabe ist nicht möglich (%s)" +msgstr "" +"Das Setzen des Binärermodus für die Standardeingabe ist nicht möglich (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" -msgstr "Das Setzen des Binärermodus für die Standardausgabe ist nicht möglich (%s)" +msgstr "" +"Das Setzen des Binärermodus für die Standardausgabe ist nicht möglich (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" -msgstr "Das Setzen des Binärermodus für die Standardfehlerausgabe ist nicht möglich (%s)" +msgstr "" +"Das Setzen des Binärermodus für die Standardfehlerausgabe ist nicht möglich " +"(%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "Es wurde überhaupt kein Programmtext angegeben!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Aufruf: %s [POSIX- oder GNU-Optionen] -f PROGRAMM [--] Datei ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Aufruf: %s [POSIX- oder GNU-Optionen] -- %cPROGRAMM%c Datei ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX-Optionen\t\tlange GNU-Optionen: (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f PROGRAMM\t\t--file=PROGRAMM\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F Feldtrenner\t\t\t--field-separator=Feldtrenner\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=Wert\t\t--assign=var=Wert\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "POSIX-Optionen\t\tGNU-Optionen (lang): (Erweiterungen)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d [Datei]\t\t--dump-variables[=Datei]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[Datei]\t\t--debug[=Datei]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'Programmtext'\t--source=Programmtext\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E Datei\t\t\t--exec=Datei\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i einzubindende_datei\t\t--include=einzubindende_datei\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l Bibliothek\t\t--load=Bibliothek\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[Datei]\t\t--pretty-print[=Datei]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p [Datei]\t\t--profile[=Datei]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3010,7 +3206,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3026,7 +3222,7 @@ msgstr "" "translation-team-de@lists.sourceforge.net\n" "\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3037,7 +3233,7 @@ msgstr "" "auf der Standardausgabe aus.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3047,7 +3243,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3067,7 +3263,7 @@ msgstr "" "spätere Version.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3080,7 +3276,7 @@ msgstr "" "leistung einer HANDELBARKEIT oder der EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n" "Sehen Sie bitte die GNU General Public License für weitere Details.\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3089,16 +3285,16 @@ msgstr "" "diesem Programm erhalten haben. Wenn nicht, lesen Sie bitte\n" "http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft setzt FS im POSIX-awk nicht auf Tab" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "unbekannter Wert für eine Feldangabe: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3107,148 +3303,184 @@ msgstr "" "%s: Argument »%s« von »-v« ist nicht in der Form »Variable=Wert«\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "»%s« ist kein gültiger Variablenname" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "»%s« ist kein Variablenname, es wird nach der Datei »%s=%s« gesucht" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" -msgstr "die eingebaute Funktion »%s« kann nicht als Variablenname verwendet werden" +msgstr "" +"die eingebaute Funktion »%s« kann nicht als Variablenname verwendet werden" # c-format -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "Funktion »%s« kann nicht als Name einer Variablen verwendet werden" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "Fließkomma-Ausnahme" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "Fataler Fehler: interner Fehler" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "Fataler Fehler: interner Fehler: Speicherbegrenzungsfehler" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "Fataler Fehler: interner Fehler: Stapelüberlauf" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "Kein bereits geöffneter Dateideskriptor %d" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "/dev/null konnte nicht für Dateideskriptor %d geöffnet werden" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "Das leere Argument für »--source« wird ignoriert" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: Die Option »-W %s« ist unbekannt und wird ignoriert\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: Die Option %c erfordert ein Argument\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "PREC Wert »%.*s« ist ungültig" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "BINMODE Wert »%.*s« ist ungültig" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: das Argument ist keine Zahl" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): ein negativer Wert wird zu merkwürdigen Ergebnissen führen" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): Dezimalteil wird abgeschnitten" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): Negative Werte führen zu merkwürdigen Ergebnissen" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: das Argument Nr. %d ist keine Zahl" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" -msgstr "%s: Argument Nr. %d hat den ungültigen Wert %Rg, es wird stattdessen 0 verwendet" +msgstr "" +"%s: Argument Nr. %d hat den ungültigen Wert %Rg, es wird stattdessen 0 " +"verwendet" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" -msgstr "%s: der negative Wert %2$Rg in Argument Nr. %1$d wird zu merkwürdigen Ergebnissen führen" +msgstr "" +"%s: der negative Wert %2$Rg in Argument Nr. %1$d wird zu merkwürdigen " +"Ergebnissen führen" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: der Nachkommateil %2$Rg in Argument Nr. %1$d wird abgeschnitten" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" -msgstr "%1$s: der negative Wert %3$Zd in Argument Nr. %2$d wird zu merkwürdigen Ergebnissen führen" +msgstr "" +"%1$s: der negative Wert %3$Zd in Argument Nr. %2$d wird zu merkwürdigen " +"Ergebnissen führen" #: msg.c:68 #, c-format msgid "cmd. line:" msgstr "Kommandozeile:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "Backslash am Ende der Zeichenkette" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "Das alte awk unterstützt die Escapesequenz »\\%c« nicht" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX erlaubt keine »\\x«-Escapes" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "In der »\\x«-Fluchtsequenz sind keine hexadezimalen Zahlen" -#: node.c:579 +#: node.c:567 #, c-format -msgid "hex escape \\x%.*s of %d characters probably not interpreted the way you expect" -msgstr "Die Hex-Sequenz \\x%.*s aus %d Zeichen wird wahrscheinlich nicht wie gewünscht interpretiert" +msgid "" +"hex escape \\x%.*s of %d characters probably not interpreted the way you " +"expect" +msgstr "" +"Die Hex-Sequenz \\x%.*s aus %d Zeichen wird wahrscheinlich nicht wie " +"gewünscht interpretiert" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "Fluchtsequenz »\\%c« wird wie ein normales »%c« behandelt" -#: node.c:739 -msgid "Invalid multibyte data detected. There may be a mismatch between your data and your locale." -msgstr "Es wurden unbekannte Multibyte-Daten gefunden. Ihre Daten entsprechen neventuell nicht der gesetzten Locale" +#: node.c:726 +msgid "" +"Invalid multibyte data detected. There may be a mismatch between your data " +"and your locale." +msgstr "" +"Es wurden unbekannte Multibyte-Daten gefunden. Ihre Daten entsprechen " +"neventuell nicht der gesetzten Locale" #: posix/gawkmisc.c:177 #, c-format msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)" -msgstr "%s %s »%s«: Die Kennungen des Dateideskriptors konnten nicht abgefragt werden: (fcntl F_GETFD: %s)" +msgstr "" +"%s %s »%s«: Die Kennungen des Dateideskriptors konnten nicht abgefragt " +"werden: (fcntl F_GETFD: %s)" #: posix/gawkmisc.c:189 #, c-format msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" -msgstr "%s %s »%s«: close-on-exec konnte nicht gesetzt werden: (fcntl F_SETFD: %s)" +msgstr "" +"%s %s »%s«: close-on-exec konnte nicht gesetzt werden: (fcntl F_SETFD: %s)" #: profile.c:71 #, c-format @@ -3260,12 +3492,12 @@ msgid "sending profile to standard error" msgstr "Das Profil wird auf der Standardfehlerausgabe ausgegeben" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s Blöcke\n" +"\t# Regeln(s)\n" "\n" #: profile.c:198 @@ -3282,11 +3514,11 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "Interner Fehler: %s mit null vname" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "Interner Fehler: eingebaute Fuktion mit leerem fname" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3295,12 +3527,12 @@ msgstr "" "\t# Erweiterungen geladen (-l und/oder @load)\n" "\n" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk-Profil, erzeugt %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3309,7 +3541,7 @@ msgstr "" "\n" "\t# Funktionen in alphabetischer Reihenfolge\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: unbekannter Umlenkungstyp %d" @@ -3317,72 +3549,109 @@ msgstr "redir2str: unbekannter Umlenkungstyp %d" #: re.c:607 #, c-format msgid "regexp component `%.*s' should probably be `[%.*s]'" -msgstr "Regulärer-Ausdruck-Komponente »%.*s« sollte wahrscheinlich »[%.*s]« sein" +msgstr "" +"Regulärer-Ausdruck-Komponente »%.*s« sollte wahrscheinlich »[%.*s]« sein" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Erfolg" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Kein Treffer" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Ungültiger Regulärer Ausdruck" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ungültiges Zeichen" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Ungültiger Name für eine Zeichenklasse" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Angehängter Backslash" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Ungültige Rück-Referenz" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "[ oder [^ werden nicht geschlossen" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( oder \\( werden nicht geschlossen" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ wird nicht geschlossen" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ungültiger Inhalt von \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Ungültiges Bereichsende" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Kein freier Speicher mehr vorhanden" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Vorangehender regulärer Ausdruck ist ungültig" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Vorzeitiges Ende des regulären Ausdrucks" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Regulärer Ausdruck ist zu groß" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") oder \\) werden nicht geöffnet" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Kein vorangehender regulärer Ausdruck" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "Funktion »%s«: Funktionsnamen können nicht als Parameternamen benutzen" + +#: symbol.c:809 msgid "can not pop main context" msgstr "der Hauptkontext kann nicht entfernt werden" + +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "»getline var« ist ungültig innerhalb der »%s«-Regel" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "Es wurde kein (bekanntes) Protokoll im Dateinamen »%s« angegeben" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "Der Dateiname »%s« ist unvollständig" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "Sie müssen in /inet einen Rechnernamen angeben" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "Sie müssen in »/inet« einen Port angeben" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s Blöcke\n" +#~ "\n" diff --git a/po/es.gmo b/po/es.gmo index 0bfebbae..09828034 100644 Binary files a/po/es.gmo and b/po/es.gmo differ diff --git a/po/es.po b/po/es.po index d16109a9..9c8c9064 100644 --- a/po/es.po +++ b/po/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.0.0h\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2012-01-30 07:42-0600\n" "Last-Translator: Cristian Othón Martínez Vera \n" "Language-Team: Spanish \n" @@ -35,9 +35,9 @@ msgstr "se intentó usar el parámetro escalar `%s como una matriz'" msgid "attempt to use scalar `%s' as an array" msgstr "se intentó usar el escalar `%s' como una matriz" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "se intentó usar la matriz `%s' en un contexto escalar" @@ -97,421 +97,426 @@ msgstr "" "asorti: no se puede usar una submatriz del segundo argumento para el primer " "argumento" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "`%s' es inválido como un nombre de función" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "la función de comparación de ordenamiento `%s' no está definida" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "los bloques %s deben tener una parte de acción" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "cada regla debe tener un patrón o una parte de acción" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "el awk antiguo no admite múltiples reglas `BEGIN' o `END'" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' es una función interna, no se puede redefinir" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "la constante de expresión regular `//' parece un comentario de C++, pero no " "lo es" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "la constante de expresión regular `/%s/' parece un comentario de C, pero no " "lo es" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "valores case duplicados en el cuerpo de un switch: %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "se detectó un `default' duplicado en el cuerpo de un switch" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "no se permite `break' fuera de un bucle o switch" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "no se permite `continue' fuera de un bucle" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "se usó `next' en la acción %s" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "se usó `nextfile' en la acción %s" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "se usó `return' fuera del contexto de la función" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "el `print' simple en la regla BEGIN o END probablemente debe ser `print \"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' es una extensión de tawk que no es transportable" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "las líneas de trabajo de dos vías multiestado no funcionan" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "expresión regular del lado derecho de una asignación" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "expresión regular a la izquierda del operador `~' o `!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" "el awk antiguo no admite la palabra clave `in' excepto después de `for'" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "expresión regular a la derecha de una comparación" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "`getline var' inválido dentro de la regla `%s'" - -#: awkgram.y:1420 +#: awkgram.y:1411 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "`getline' inválido dentro de la regla `%s'" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "`getline' no redirigido es inválido dentro de la regla `%s'" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "`getline' no redirigido indefinido dentro de la acción de END" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "el awk antiguo no admite matrices multidimensionales" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "la llamada de `length' sin paréntesis no es transportable" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "las llamadas indirectas a función son una extensión de gawk" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "no se puede usar la variable especial `%s' como llamada indirecta a función" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "se intentó usar la función `%s' como una matriz" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "expresión de subíndice inválida" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "aviso: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatal: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "nueva línea o fin de la cadena inesperados" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, fuzzy, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "razón desconocida" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "ya se incluyó el fichero fuente `%s'" -#: awkgram.y:2409 +#: awkgram.y:2418 #, fuzzy, c-format msgid "already loaded shared library `%s'" msgstr "ya se incluyó el fichero fuente `%s'" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include es una extensión de gawk" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "nombre de fichero vacío después de @include" -#: awkgram.y:2494 +#: awkgram.y:2503 #, fuzzy msgid "@load is a gawk extension" msgstr "@include es una extensión de gawk" -#: awkgram.y:2500 +#: awkgram.y:2509 #, fuzzy msgid "empty filename after @load" msgstr "nombre de fichero vacío después de @include" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "texto de programa vacío en la linea de órdenes" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "no se puede leer el fichero fuente `%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "el fichero fuente `%s' está vacío" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "el fichero fuente no termina con línea nueva" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "expresión regular sin terminar termina con `\\` al final del fichero" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: el modificador de expresión regular `/.../%c` de tawk no funciona en " "gawk" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "el modificador de expresión regular `/.../%c` de tawk no funciona en gawk" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "expresión regular sin terminar" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "expresión regular sin terminar al final del fichero" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "el uso de la continuación de línea `\\ #...' no es transportable" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "la barra invertida no es el último caracter en la línea" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX no permite el operador `**='" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "el awk antiguo no admite el operador `**='" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX no permite el operador `**'" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "el awk antiguo no admite el operador `**='" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "el operador `^=' no se admite en el awk antiguo" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "el operador `^' no se admite en el awk antiguo" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "cadena sin terminar" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "caracter '%c' inválido en la expresión" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' es una extensión de gawk" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX no permite `%s'" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' no se admite en el awk antiguo" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "¡`goto' se considera dañino!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d es inválido como número de argumentos para %s" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: la literal de cadena como último argumento de substitute no tiene efecto" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "el tercer argumento de %s no es un objecto modificable" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: el tercer argumento es una extensión de gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: el segundo argumento es una extensión de gawk" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "el uso de dcgettext(_\"...\") es incorrecto: quite el subrayado inicial" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "el uso de dcngettext(_\"...\") es incorrecto: quite el subrayado inicial" -#: awkgram.y:4016 +#: awkgram.y:4044 #, fuzzy msgid "index: regexp constant as second argument is not allowed" msgstr "index: el segundo argumento recibido no es una cadena" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "función `%s': parámetro `%s' oscurece la variable global" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "no se puede abrir `%s' para escritura (%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "se envía la lista de variables a la salida estándar de error" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: falló close (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "¡se llamó shadow_funcs() dos veces!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "hay variables opacadas." -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "el nombre de función `%s' se definió previamente" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" "función `%s': no se puede usar un nombre de función como nombre de parámetro" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "función `%s': no se puede usar la variable especial `%s' como un parámetro " "de función" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "función `%s': parámetro #%d, `%s', duplica el parámetro #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "se llamó a la función `%s' pero nunca se definió" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "se definió la función `%s' pero nunca se llamó directamente" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "la constante de expresión regular para el parámetro #%d da un valor booleano" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -520,21 +525,21 @@ msgstr "" "se llamó la función `%s' con espacio entre el nombre y el `(',\n" "o se usó como una variable o una matriz" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "se intentó una división por cero" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "se intentó una división por cero en `%%'" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5006 #, fuzzy, c-format msgid "invalid target of assignment (opcode %s)" msgstr "%d es inválido como número de argumentos para %s" @@ -576,197 +581,207 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' no es un fichero abierto, tubería o co-proceso" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: el primer argumento recibido no es una cadena" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: el segundo argumento recibido no es una cadena" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: se recibió un argumento que no es númerico" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: se recibió un argumento de matriz" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(array)' es una extensión de gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: se recibió un argumento que no es una cadena" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: se recibió un argumento que no es númerico" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: se recibió el argumento negativo %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatal: se debe utilizar `count$' en todos los formatos o en ninguno" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "se descarta la anchura del campo para el especificador `%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "se descarta la precisión para el especificador `%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "" "se descartan la anchura del campo y la precisión para el especificador `%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal: no se permite `$' en los formatos de awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal: la cuenta de argumentos con `$' debe ser > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "fatal: la cuenta de argumentos %ld es mayor que el número total de " "argumentos proporcionados" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal: no se permite `$' después de un punto en el formato" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "fatal: no se proporciona `$' para la anchura o la precisión del campo " "posicional" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' no tiene significado en los formatos de awk; se descarta" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal: no se permite `l' en los formatos POSIX de awk" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' no tiene significado en los formatos de awk; se descarta" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal: no se permite `L' en los formatos POSIX de awk" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' no tiene significado en los formatos de awk; se descarta" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal: no se permite `h' en los formatos POSIX de awk" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: el valor %g está fuera del rango para el formato `%%%c'" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: el valor %g está fuera del rango para el formato `%%%c'" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: el valor %g está fuera del rango para el formato `%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "se descarta el carácter especificador de formato `%c' desconocido: no se " "convirtió ningún argumento" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" "fatal: no hay suficientes argumentos para satisfacer a la cadena de formato" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "se acabó ^ para éste" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: el especificador de formato no tiene letras de control" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "se proporcionaron demasiados argumentos para la cadena de formato" -#: builtin.c:1634 +#: builtin.c:1625 #, fuzzy msgid "sprintf: no arguments" msgstr "printf: sin argumentos" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: sin argumentos" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: se recibió un argumento que no es un númerico" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: se llamó con el argumento negativo %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: la longitud %g no es >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: la longitud %g no es >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: se truncará la longitud no entera %g" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: la longitud %g es demasiado grande para ser índice de cadena, se " "trunca a %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: el índice de inicio %g es inválido, se usa 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: se truncará el índice de inicio no entero %g" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: la cadena de origen es de longitud cero" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: el índice de inicio %g está después del fin de la cadena" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -774,196 +789,202 @@ msgstr "" "substr: la cadena %g en el índice de inicio %g excede la longitud del primer " "argumento (%lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime: el valor de formato en PROCINFO[\"strftime\"] tiene tipo numérico" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: el segundo argumento recibido no es númerico" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" "strftime: el segundo argumento es menor que 0 o demasiado grande para time_t" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: el primer argumento recibido no es una cadena" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: se recibió una cadena de formato vacía" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: se recibió un argumento que no es una cadena" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "" "mktime: por lo menos uno de los valores está fuera del rango por defecto" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "no se permite la función 'system' en modo sandbox" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: se recibió un argumento que no es una cadena" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "referencia al campo sin inicializar `$%d'" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: se recibió un argumento que no es una cadena" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: se recibió un argumento que no es una cadena" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: el primer argumento recibido no es númerico" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: el segundo argumento recibido no es númerico" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: se recibió un argumento que no es númerico" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: se recibió un argumento que no es númerico" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: se recibió un argumento que no es númerico" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: el tercer argumento no es una matriz" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: el tercer argumento de 0 se trata como 1" + +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" msgstr "gensub: el tercer argumento de 0 se trata como 1" -#: builtin.c:3030 +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: el primer argumento recibido no es númerico" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: el segundo argumento recibido no es númerico" -#: builtin.c:3038 +#: builtin.c:3028 #, fuzzy, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:3040 +#: builtin.c:3030 #, fuzzy, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%lf, %lf): los valores fraccionarios se truncarán" -#: builtin.c:3042 +#: builtin.c:3032 #, fuzzy, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" "lshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados " "extraños" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: el primer argumento recibido no es númerico" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: el segundo argumento recibido no es númerico" -#: builtin.c:3075 +#: builtin.c:3065 #, fuzzy, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:3077 +#: builtin.c:3067 #, fuzzy, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%lf, %lf): los valores fraccionarios serán truncados" -#: builtin.c:3079 +#: builtin.c:3069 #, fuzzy, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados " "extraños" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 #, fuzzy msgid "and: called with less than two arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: builtin.c:3109 +#: builtin.c:3099 #, fuzzy, c-format msgid "and: argument %d is non-numeric" msgstr "exp: el argumento %g está fuera de rango" -#: builtin.c:3113 +#: builtin.c:3103 #, fuzzy, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 #, fuzzy msgid "or: called with less than two arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: builtin.c:3141 +#: builtin.c:3131 #, fuzzy, c-format msgid "or: argument %d is non-numeric" msgstr "exp: el argumento %g está fuera de rango" -#: builtin.c:3145 +#: builtin.c:3135 #, fuzzy, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 #, fuzzy msgid "xor: called with less than two arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: builtin.c:3173 +#: builtin.c:3163 #, fuzzy, c-format msgid "xor: argument %d is non-numeric" msgstr "exp: el argumento %g está fuera de rango" -#: builtin.c:3177 +#: builtin.c:3167 #, fuzzy, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: se recibió un argumento que no es númerico" -#: builtin.c:3208 +#: builtin.c:3198 #, fuzzy, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: builtin.c:3210 +#: builtin.c:3200 #, fuzzy, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%lf): el valor fraccionario se truncará" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' no es una categoría local válida" @@ -1245,42 +1266,48 @@ msgstr "" msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "error: " -#: command.y:1051 +#: command.y:1053 #, fuzzy, c-format msgid "can't read command (%s)\n" msgstr "no se puede redirigir desde `%s' (%s)" -#: command.y:1065 +#: command.y:1067 #, fuzzy, c-format msgid "can't read command (%s)" msgstr "no se puede redirigir desde `%s' (%s)" -#: command.y:1116 +#: command.y:1118 #, fuzzy msgid "invalid character in command" msgstr "Nombre de clase de caracter inválido" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 #, fuzzy msgid "invalid character" msgstr "Caracter de ordenación inválido" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1796,74 +1823,76 @@ msgstr "`exit' no se puede llamar en el contexto actual" msgid "`return' not allowed in current context; statement ignored" msgstr "`exit' no se puede llamar en el contexto actual" -#: debug.c:5590 +#: debug.c:5604 #, fuzzy, c-format msgid "No symbol `%s' in current context" msgstr "se intentó usar la matriz `%s' en un contexto escalar" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 #, fuzzy msgid "unbalanced [" msgstr "[ desbalanceado" -#: dfa.c:1174 +#: dfa.c:1119 #, fuzzy msgid "invalid character class" msgstr "Nombre de clase de caracter inválido" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1327 #, fuzzy msgid "unfinished \\ escape" msgstr "Escape \\ sin terminar" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Contenido inválido de \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "La expresión regular es demasiado grande" -#: dfa.c:1936 +#: dfa.c:1912 #, fuzzy msgid "unbalanced (" msgstr "( desbalanceado" -#: dfa.c:2062 +#: dfa.c:2038 #, fuzzy msgid "no syntax specified" msgstr "No se especifican los bits de sintaxis de la expresión regular" -#: dfa.c:2070 +#: dfa.c:2046 #, fuzzy msgid "unbalanced )" msgstr ") desbalanceado" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "tipo de nodo %d desconocido" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "código de operación %d desconocido" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "el código de operación %s no es un operador o una palabra clave" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "desbordamiento de almacenamiento temporal en genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1874,94 +1903,94 @@ msgstr "" "\t# Pila de Llamadas de Funciones:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' es una extensión de gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' es una extensión de gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "el valor BINMODE `%s' es inválido; se trata como 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "especificación `%sFMT' `%s' errónea" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "se desactiva `--lint' debido a una asignación a `LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referencia al argumento sin inicializar `%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "referencia a la variable sin inicializar `%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "se intentó una referencia de campo desde un valor que no es númerico" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "se intentó una referencia de campo desde una cadena nula" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "se intentó acceder al campo %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "referencia al campo sin inicializar `$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "se llamó a la función `%s' con más argumentos de los declarados" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: tipo `%s' inesperado" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "se intentó una división por cero en `/='" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "se intentó una división por cero en `%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "no se permiten las extensiones en modo sandbox" -#: ext.c:92 +#: ext.c:68 #, fuzzy msgid "-l / @load are gawk extensions" msgstr "@include es una extensión de gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, fuzzy, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "fatal: extension: no se puede abrir `%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, fuzzy, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" @@ -1969,32 +1998,32 @@ msgstr "" "fatal: extension: la biblioteca `%s': no define " "`plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, fuzzy, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" "fatal: extension: la biblioteca `%s': no puede llamar a la función `" "%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' es una extensión de gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, fuzzy, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "fatal: extension: no se puede abrir `%s' (%s)\n" -#: ext.c:186 +#: ext.c:162 #, fuzzy, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" @@ -2002,100 +2031,100 @@ msgstr "" "fatal: extension: la biblioteca `%s': no define " "`plugin_is_GPL_compatible' (%s)\n" -#: ext.c:190 +#: ext.c:166 #, fuzzy, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" "fatal: extension: la biblioteca `%s': no puede llamar a la función `" "%s' (%s)\n" -#: ext.c:221 +#: ext.c:197 #, fuzzy msgid "make_builtin: missing function name" msgstr "extension: falta el nombre de la función" -#: ext.c:236 +#: ext.c:212 #, fuzzy, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "extension: no se puede redefinir la función `%s'" -#: ext.c:240 +#: ext.c:216 #, fuzzy, c-format msgid "make_builtin: function `%s' already defined" msgstr "extension: la función `%s' ya está definida" -#: ext.c:244 +#: ext.c:220 #, fuzzy, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "extension: el nombre de función `%s' se definió previamente" -#: ext.c:246 +#: ext.c:222 #, fuzzy, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "extension: no se puede utilizar la orden interna de gawk `%s' como nombre de " "función" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: cuenta de argumento negativa para la función `%s'" -#: ext.c:276 +#: ext.c:252 #, fuzzy msgid "extension: missing function name" msgstr "extension: falta el nombre de la función" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, fuzzy, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: carácter ilegal `%c' en el nombre de la función `%s'" -#: ext.c:291 +#: ext.c:267 #, fuzzy, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: no se puede redefinir la función `%s'" -#: ext.c:295 +#: ext.c:271 #, fuzzy, c-format msgid "extension: function `%s' already defined" msgstr "extension: la función `%s' ya está definida" -#: ext.c:299 +#: ext.c:275 #, fuzzy, c-format msgid "extension: function name `%s' previously defined" msgstr "el nombre de función `%s' se definió previamente" -#: ext.c:301 +#: ext.c:277 #, fuzzy, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: no se puede utilizar la orden interna de gawk `%s' como nombre de " "función" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "la función `%s' se definió para tomar no más de %d argumento(s)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "función `%s': falta el argumento #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "función `%s': argumento #%d: se intentó usar un escalar como una matriz" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "función `%s': argumento #%d: se intentó usar una matriz como un escalar" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2258,7 +2287,7 @@ msgstr "sqrt: se llamó con el argumento negativo %g" msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2287,55 +2316,55 @@ msgstr "`%s' no es un nombre de variable legal" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, fuzzy, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "%s: falló close (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, fuzzy, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "%s: falló close (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, fuzzy, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "%s: falló close (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, fuzzy, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "falló la limpieza de la tubería de `%s' (%s)." -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, fuzzy, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "falló al cerrar el df %d (`%s') (%s)" @@ -2385,52 +2414,56 @@ msgstr "sqrt: se llamó con el argumento negativo %g" msgid "readfile: called with no arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 #, fuzzy msgid "writea: called with too many arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, fuzzy, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "exp: el argumento %g está fuera de rango" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, fuzzy, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "split: el cuarto argumento no es una matriz" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 #, fuzzy msgid "reada: called with too many arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, fuzzy, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "exp: el argumento %g está fuera de rango" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, fuzzy, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "match: el tercer argumento no es una matriz" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2463,92 +2496,92 @@ msgstr "exp: el argumento %g está fuera de rango" msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "se definió NF con un valor negativo" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: el cuarto argumento es una extensión de gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: el cuarto argumento no es una matriz" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: el segundo argumento no es una matriz" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: no se puede usar la misma matriz para el segundo y cuarto argumentos" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: no se puede usar una submatriz del segundo argumento para el cuarto " "argumento" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: no se puede usar una submatriz del cuarto argumento para el segundo " "argumento" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "" "split: la cadena nula para el tercer argumento es una extensión de gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: el cuarto argumento no es una matriz" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: el segundo argumento no es una matriz" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: el tercer argumento no debe ser nulo" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: no se puede usar la misma matriz para el segundo y cuarto " "argumentos" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: no se puede usar una submatriz del segundo argumento para el " "cuarto argumento" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: no se puede usar una submatriz del cuarto argumento para el " "segundo argumento" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' es una extensión gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "valor de FIELDWIDTHS inválido, cerca de `%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "la cadena nula para `FS' es una extensión de gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "el awk antiguo no admite expresiones regulares como valor de `FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' es una extensión de gawk" @@ -2564,21 +2597,21 @@ msgstr "" msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 #, fuzzy msgid "remove_element: received null array" msgstr "length: se recibió un argumento de matriz" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2638,528 +2671,495 @@ msgstr "%s: la opción '-W %s' no admite ningún argumento\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: la opción '-W %s' requiere un argumento\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "el argumento de la línea de órdenes `%s' es un directorio: se salta" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "no se puede abrir el fichero `%s' para lectura (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "falló al cerrar el df %d (`%s') (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "no se permite la redirección en modo sandbox" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "la expresión en la redirección `%s' sólo tiene valor numérico" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "la expresión para la redirección `%s' tiene un valor de cadena nula" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "el fichero `%s' para la redirección `%s' puede ser resultado de una " "expresión lógica" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mezcla innecesaria de `>' y `>>' para el fichero `%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "no se puede abrir la tubería `%s' para la salida (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "no se puede abrir la tubería `%s' para la entrada (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "no se puede abrir la tubería de dos vías `%s' para entrada/salida (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "no se puede redirigir desde `%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "no se puede redirigir a `%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "se alcanzó el límite del sistema para ficheros abiertos: comenzando a " "multiplexar los descriptores de fichero" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "falló al cerrar `%s' (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "demasiadas tuberías o ficheros de entrada abiertos" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: el segundo argumento debe ser `to' o `from'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' no es un fichero abierto, tubería o co-proceso" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "se cerró una redirección que nunca se abrió" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: la redirección `%s' no se abrió con `|&', se descarta el segundo " "argumento" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "estado de fallo (%d) al cerrar la tubería de `%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "estado de fallo (%d) al cerrar el fichero de `%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "no se provee el cerrado explícito del `socket' `%s'" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "no se provee el cerrado explícito del co-proceso `%s'" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "no se provee el cerrado explícito del la tubería `%s'" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "no se provee el cerrado explícito del fichero `%s'" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "error al escribir en la salida estándar (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "error al escribir en la salida estándar de error (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "falló la limpieza de la tubería de `%s' (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "falló la limpieza del co-proceso de la tubería a `%s' (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "falló la limpieza del fichero de `%s' (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "puerto local %s inválido en `/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "anfitrión remoto e información de puerto (%s, %s) inválidos" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" -"no se proporciona algún protocolo (conocido) en el nombre de fichero " -"especial `%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "el nombre de fichero especial `%s' está incompleto" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "se debe proporcionar a `/inet' un puerto remoto" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "no se admiten las comunicaciones TCP/IP" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "no se puede abrir `%s', modo `%s'" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "falló al cerrar el pty maestro (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "falló al cerrar la salida estándar en el hijo (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "falló el movimiento del pty esclavo a la salida estándar en el hijo (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "falló al cerrar la entrada estándar en el hijo (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "falló el movimiento del pty esclavo a la entrada estándar en el hijo (dup: " "%s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "falló al cerrar el pty esclavo (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "falló el movimiento a la salida estándar en el hijo (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "falló el movimiento de la tubería a la entrada estándar en el hijo (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "falló la restauración de la salida estándar en el proceso padre\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "falló la restauración de la entrada estándar en el proceso padre\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "falló al cerrar la tubería (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "no se admite `|&'" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "no se puede abrir la tubería `%s' (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "no se puede crear el proceso hijo para `%s' (fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "el fichero de datos `%s' está vacío" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "no se puede reservar más memoria de entrada" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "el valor multicaracter de `RS' es una extensión de gawk" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "no se admite la comunicación IPv6" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "se descarta el argumento vacío para `-e/--source'" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: no se reconoce la opción `-W %s', se descarta\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: la opción requiere un argumento -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "la variable de ambiente `POSIXLY_CORRECT' está definida: se activa `--posix'" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' se impone a `--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' se imponen a `--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "ejecutar %s como setuid root puede ser un problema de seguridad" -#: main.c:588 +#: main.c:346 #, fuzzy msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' se impone a `--binary'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "no se puede establecer el modo binario en la entrada estándar (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "no se puede establecer el modo binario en la salida estándar (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" "no se puede establecer el modo binario en la salida estándar de error (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "¡No hay ningún programa de texto!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Modo de empleo: %s [opciones estilo POSIX o GNU] -f fichprog [--] " "fichero ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Modo de empleo: %s [opciones estilo POSIX o GNU] [--] %cprograma%c " "fichero ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opciones POSIX:\t\tOpciones largas GNU: (estándar)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fichprog\t\t--file=fichprog\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F sc\t\t\t--field-separator=sc\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valor\t\t--assign=var=valor\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Opciones cortas:\t\tOpciones largas GNU: (extensiones)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[fichero]\t\t--dump-variables[=fichero]\n" -#: main.c:815 +#: main.c:579 #, fuzzy msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-p[fichero]\t\t--profile[=fichero]\n" # Esta es la línea más larga de la lista de argumentos. # Probar con gawk para revisar tabuladores. cfuga -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'texto-prog'\t--source='texto-prog'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E fichero\t\t--exec=fichero\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 #, fuzzy msgid "\t-M\t\t\t--bignum\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 #, fuzzy msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-p[fichero]\t\t--profile[=fichero]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[fichero]\t\t--profile[=fichero]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3168,7 +3168,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3182,7 +3182,7 @@ msgstr "" "Reporte los errores de los mensajes en español a .\n" "\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3192,7 +3192,7 @@ msgstr "" "Por defecto lee la entrada estándar y escribe en la salida estándar.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3202,7 +3202,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' fichero\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3222,7 +3222,7 @@ msgstr "" "(a su elección) cualquier versión posterior.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3236,7 +3236,7 @@ msgstr "" "Licencia Pública General de GNU para más detalles.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3245,16 +3245,16 @@ msgstr "" "junto con este programa. Si no es así, consulte\n" "http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft no establece FS a tabulador en el awk de POSIX" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valor desconocido para la especificación de campo: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3263,103 +3263,121 @@ msgstr "" "%s: el argumento `%s' para `-v' no es de la forma `var=valor'\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' no es un nombre de variable legal" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' no es un nombre de variable, se busca el fichero `%s=%s'" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" "no se puede utilizar la orden interna de gawk `%s' como nombre de variable" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "no se puede usar la función `%s' como nombre de variable" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "excepción de coma flotante" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "error fatal: error interno" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "error fatal: error interno: falla de segmentación" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "error fatal: error interno: desbordamiento de pila" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "no existe el df %d abierto previamente" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "no se puede abrir previamente /dev/null para el df %d" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "se descarta el argumento vacío para `-e/--source'" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: no se reconoce la opción `-W %s', se descarta\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: la opción requiere un argumento -- %c\n" + +#: mpfr.c:557 #, fuzzy, c-format msgid "PREC value `%.*s' is invalid" msgstr "el valor BINMODE `%s' es inválido; se trata como 3" -#: mpfr.c:608 +#: mpfr.c:615 #, fuzzy, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "el valor BINMODE `%s' es inválido; se trata como 3" -#: mpfr.c:698 +#: mpfr.c:711 #, fuzzy, c-format msgid "%s: received non-numeric argument" msgstr "cos: se recibió un argumento que no es númerico" -#: mpfr.c:800 +#: mpfr.c:820 #, fuzzy msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: mpfr.c:804 +#: mpfr.c:824 #, fuzzy msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%lf): el valor fraccionario se truncará" -#: mpfr.c:816 +#: mpfr.c:836 #, fuzzy, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: mpfr.c:835 +#: mpfr.c:855 #, fuzzy, c-format msgid "%s: received non-numeric argument #%d" msgstr "cos: se recibió un argumento que no es númerico" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 #, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: mpfr.c:863 +#: mpfr.c:883 #, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "or(%lf, %lf): los valores fraccionarios serán truncados" -#: mpfr.c:878 +#: mpfr.c:898 #, fuzzy, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" @@ -3369,24 +3387,24 @@ msgstr "compl(%lf): el valor negativo dará resultados extraños" msgid "cmd. line:" msgstr "línea ord.:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "barra invertida al final de la cadena" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "el awk antiguo no admite la secuencia de escape `\\%c'" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX no permite escapes `\\x'" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "no hay dígitos hexadecimales en la secuencia de escape `\\x'" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3395,12 +3413,12 @@ msgstr "" "el escape hexadecimal \\x%.*s de %d caracteres tal vez no se interprete de " "la forma esperada" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "la secuencia de escape `\\%c' se trata como una simple `%c'" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3429,12 +3447,12 @@ msgid "sending profile to standard error" msgstr "se envía el perfil a la salida estándar de error" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# bloque(s) %s\n" +"\t# Regla(s)\n" "\n" #: profile.c:198 @@ -3451,24 +3469,24 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "error interno: %s con vname nulo" -#: profile.c:537 +#: profile.c:538 #, fuzzy msgid "internal error: builtin with null fname" msgstr "error interno: %s con vname nulo" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# perfil de gawk, creado %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3477,7 +3495,7 @@ msgstr "" "\n" "\t# Funciones, enumeradas alfabéticamente\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: tipo de redirección %d desconocida" @@ -3488,74 +3506,116 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" "el componente de expresión regular `%.*s' probablemente debe ser `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Éxito" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "No hay coincidencia" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Expresión regular inválida" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Caracter de ordenación inválido" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nombre de clase de caracter inválido" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Barra invertida extra al final" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Referencia hacia atrás inválida" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "[ o [^ desemparejados" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( o \\( desemparejados" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ desemparejado" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Contenido inválido de \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Final de rango inválido" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Memoria agotada" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Expresión regular precedente inválida" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Fin prematuro de la expresión regular" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "La expresión regular es demasiado grande" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") o \\) desemparejados" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "No hay una expresión regular previa" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" +"función `%s': no se puede usar un nombre de función como nombre de parámetro" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "`getline var' inválido dentro de la regla `%s'" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "`getline' inválido dentro de la regla `%s'" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "no se proporciona algún protocolo (conocido) en el nombre de fichero " +#~ "especial `%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "el nombre de fichero especial `%s' está incompleto" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "se debe proporcionar a `/inet' un puerto remoto" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# bloque(s) %s\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "el rango de la forma `[%c-%c]' depende del local" @@ -3627,9 +3687,6 @@ msgstr "" #~ msgid "Operation Not Supported" #~ msgstr "No Se Admite La Operación" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "se intentó usar la función `%s' como una matriz" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "referencia al elemento sin inicializar `%s[\"%.*s\"]'" @@ -3673,9 +3730,6 @@ msgstr "" #~ msgid "function `%s' not defined" #~ msgstr "la función `%s' no está definida" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "`getline' no redirigido es inválido dentro de la regla `%s'" - #~ msgid "error reading input file `%s': %s" #~ msgstr "error al leer el fichero de entrada `%s': %s" diff --git a/po/fi.gmo b/po/fi.gmo index 478aa070..ccf63562 100644 Binary files a/po/fi.gmo and b/po/fi.gmo differ diff --git a/po/fi.po b/po/fi.po index 49014233..96d03c23 100644 --- a/po/fi.po +++ b/po/fi.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-01-16 13:32+0200\n" "Last-Translator: Jorma Karvonen \n" "Language-Team: Finnish \n" @@ -37,9 +37,9 @@ msgstr "yritettiin käyttää skalaariparametria â€%s†taulukkona" msgid "attempt to use scalar `%s' as an array" msgstr "yritettiin käyttää skalaaria â€%s†taulukkona" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "yritettiin käyttää taulukkoa â€%s†skalaarikontekstissa" @@ -98,408 +98,413 @@ msgstr "" "asorti: toisen argumentin alitaulukon käyttö ensimmäiselle argumentille " "epäonnistui" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "â€%s†on virheellinen funktionimenä" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "lajitteluvertailufunktiota â€%s†ei ole määritelty" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "%s lohkoilla on oltava toiminto-osa" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "jokaisella säännöllä on oltava malli tai toiminto-osa" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "vanha awk ei tue useita â€BEGINâ€- tai â€ENDâ€-sääntöjä" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "â€%s†on sisäänrakennettu funktio. Sitä ei voi määritellä uudelleen" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "säännöllisen lausekkeen vakio â€//†näyttää C++-kommentilta, mutta ei ole" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "säännöllisen lausekkeen vakio â€/%s/†näyttää C-kommentilta, mutta ei ole" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "kaksi samanlaista case-arvoa switch-rakenteen rungossa: %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "kaksoiskappale â€default†havaittu switch-rungossa" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "â€break†ei ole sallittu silmukan tai switch-lauseen ulkopuolella" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "â€continue†ei ole sallittu silmukan ulkopuolella" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "â€next†käytetty %s-toiminnossa" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "â€nextfile†käytetty %s-toiminnossa" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "â€return†käytetty funktiokontekstin ulkopuolella" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "pelkkä â€print†BEGIN- tai END-säännössä pitäisi luultavasti olla â€print \"\"â€" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "â€delete†ei ole sallittu kohteessa SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "â€delete†ei ole sallittu kohteessa FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "â€delete(array)†ei ole siirrettävä tawk-laajennus" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "monivaiheiset kaksisuuntaiset putket eivät toimi" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "säännöllinen lauseke sijoituksen oikealla puolella" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "säännöllinen lauseke â€~â€- tai â€!~â€-operaattorin vasemmalla puolella" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "vanha awk ei tue avainsanaa â€in†paitsi â€forâ€-sanan jälkeen" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "säännöllinen lauseke vertailun oikealla puolella" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "â€getline var†virheellinen säännön â€%s†sisällä" - -#: awkgram.y:1420 +#: awkgram.y:1411 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "â€getline†virheellinen säännön â€%s†sisällä" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "edelleenohjaamaton â€getline†virheellinen â€%sâ€-säännön sisällä" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "edelleenohjaamaton â€getline†määrittelemätön END-toiminnon sisällä" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "vanha awk ei tue moniulotteisia taulukkoja" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "â€lengthâ€-kutsu ilman sulkumerkkejä ei ole siirrettävä" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "epäsuorat funktiokutsut ovat gawk-laajennus" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "erikoismuuttujan â€%s†käyttö epäsuoralle funktiokutsulle epäonnistui" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "yritettiin käyttää funktiota â€%s†taulukkona" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "virheellinen indeksointilauseke" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "varoitus: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "tuhoisa: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "odottamaton rivinvaihto tai merkkijonon loppu" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "lähdetiedoston â€%s†avaaminen lukemista varten (%s) epäonnistui" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "jaetun kirjaston â€%s†avaaminen lukemista varten (%s) epäonnistui" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "syy tuntematon" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "kohteen â€%s†sisällyttäminen ja käyttö ohjelmatiedostona epäonnistui" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "on jo sisällytetty lähdetiedostoon â€%sâ€" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "jaettu kirjasto â€%s†on jo ladattu" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include on gawk-laajennus" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "tyhjä tiedostonimi @include:n jälkeen" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "@load on gawk-laajennus" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "tyhjä tiedostonimi @load:n jälkeen" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "tyhjä ohjelmateksti komentorivillä" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "lähdetiedoston â€%s†(%s) lukeminen epäonnistui" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "lähdetiedosto â€%s†on tyhjä" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "lähdetiedoston lopussa ei ole rivinvaihtoa" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "päättämätön säännöllinen lauseke loppuu â€\\â€-merkkeihin tiedoston lopussa" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: tawk:n regex-määre â€/.../%c†ei toimi gawk:ssa" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "tawkin regex-määre â€/.../%c†ei toimi gawkissa" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "päättämätön säännöllinen lauseke" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "päättämätön säännöllinen lauseke tiedoston lopussa" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "â€\\ #...â€-rivijatkamisen käyttö ei ole siirrettävä" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "kenoviiva ei ole rivin viimeinen merkki" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX ei salli operaattoria â€**=â€" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "vanha awk ei tue operaattoria â€**=â€" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX ei salli operaattoria â€**â€" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "vanha awk ei tue operaattoria â€**â€" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "operaattoria â€^=†ei tueta vanhassa awk:ssa" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "operaattoria â€^†ei tueta vanhassa awk:ssa" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "päättämätön merkkijono" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "virheellinen merkki ’%c’ lausekkeessa" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "â€%s†on gawk-laajennus" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX ei salli operaattoria â€%sâ€" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "â€%s†ei ole tuettu vanhassa awk-ohjelmassa" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "â€gotoâ€-käskyä pidetään haitallisena!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d on virheellinen argumenttilukumäärä operaattorille %s" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: merkkijonoliteraalilla ei ole vaikutusta korvauksen viimeisenä " "argumenttina" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s kolmas parametri ei ole vaihdettava objekti" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: kolmas argumentti on gawk-laajennus" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: toinen argumentti on gawk-laajennus" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcgettext(_\"...\")-käyttö on virheellinen: poista alaviiva alusta" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcngettext(_\"...\")-käyttö on virheellinen: poista alaviiva alusta" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "index: regexp-vakio toisena argumenttina ei ole sallittu" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funktio â€%sâ€: parametri â€%s†varjostaa yleismuuttujaa" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "tiedoston â€%s†avaaminen kirjoittamista varten (%s) epäonnistui" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "lähetetään muuttujaluettelo vakiovirheeseen" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: sulkeminen epäonnistui (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() kutsuttu kahdesti!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "siellä oli varjostettuja muuttujia." -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "funktionimi â€%s†on jo aikaisemmin määritelty" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funktio â€%sâ€: funktionimen käyttö parametrinimenä epäonnistui" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funktio â€%sâ€: erikoismuuttujan â€%s†käyttö funktioparametrina epäonnistui" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funktio â€%sâ€: parametri #%d, â€%sâ€, samanlainen parametri #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "funktiota â€%s†kutsuttiin, mutta sitä ei ole koskaan määritelty" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "funktio â€%s†määriteltiin, mutta sitä ei ole koskaan kutsuttu suoraan" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "säännöllisen lausekkeen vakio parametrille #%d antaa boolean-arvon" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -508,21 +513,21 @@ msgstr "" "funktio â€%s†kutsuttu välilyönnillä nimen ja â€(â€-merkin\n" "välillä, tai käytetty muuttujana tai taulukkona" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "nollalla jakoa yritettiin" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "jakoa nollalla yritettiin operaattorissa â€%%â€" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "arvon liittäminen kenttäjälkiaskelkasvatuslausekkeeseen epäonnistui" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "virheellinen liittämiskohde (käskykoodi %s)" @@ -565,192 +570,202 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: â€%s†ei ole avoin tiedosto, putki tai apuprosessi" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: ensimmäinen vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: toinen vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: vastaanotettu taulukkoargumentti" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "â€length(array)†on gawk-laajennus" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: vastaanotettu negatiivinen argumentti %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "kohtalokas: on käytettävä â€count$†kaikilla muodoilla tai ei missään" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "kenttäleveys ohitetaan â€%%%%â€-määritteelle" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "tarkkuus ohitetaan â€%%%%â€-määritteelle" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "kenttäleveys ja tarkkuus ohitetaan â€%%%%â€-määritteelle" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "kohtalokas: â€$â€-argumentti ei ole sallittu awk-muodoissa" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "kohtalokas: argumenttilukumäärän argumentilla â€$†on oltava > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "kohtalokas: argumenttilukumäärä %ld on suurempi kuin toimitettujen " "argumenttien lukumäärä" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "kohtalokas: â€$â€-argumentti ei ole sallittu pisteen jälkeen muodossa" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "kohtalokas: ei â€$â€-argumenttia tarjottu sijantikenttäleveydelle tai " "tarkkuudelle" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "â€l†on merkityksetön awk-muodoissa; ohitetaan" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "kohtalokas: â€l†ei ole sallittu POSIX awk -muodoissa" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "â€L†on merkityksetön awk-muodoissa; ohitetaan" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "kohtalokas: â€L†ei ole sallittu POSIX awk -muodoissa" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "â€h†on merkityksetön awk-muodoissa; ohitetaan" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "kohtalokas: â€h†ei ole sallittu POSIX awk -muodoissa" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: arvo %g on lukualueen ulkopuolella â€%%%câ€-muodolle" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: arvo %g on lukualueen ulkopuolella â€%%%câ€-muodolle" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: arvo %g on lukualueen ulkopuolella â€%%%câ€-muodolle" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "ohitetaan tuntematon muotoargumenttimerkki â€%câ€: ei muunnettu argumenttia" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "kohtalokas: ei kylliksi argumentteja muotomerkkijonon tyydyttämiseksi" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ tällainen loppui kesken" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: muotoargumentilla ei ole ohjauskirjainta" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "muotomerkkijonoon toimitettu liian monta argumenttia" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: ei argumentteja" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: ei argumentteja" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: kutsuttu negatiivisella argumentilla %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: pituus %g ei ole >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: pituus %g ei ole >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: typistetään pituus %g, joka ei ole kokonaisluku" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: pituus %g liian suuri merkkijononindeksointiin, typistetään arvoon %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: aloitusindeksi %g on virheellinen, käytetään 1:tä" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: typistetään aloitusindeksi %g, joka ei ole kokonaisluku" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: lähdemerkkijono on nollapituinen" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: aloitusindeksi %g on merkkijonon lopun jälkeen" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -758,189 +773,195 @@ msgstr "" "substr: pituus %g alkuindeksissä %g ylittää ensimmäisen argumentin pituuden " "(%lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime: muotoarvolla kohteessa PROCINFO[\"strftime\"] on numerotyyppi" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: toinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" "strftime: toinen argumentti on pienempi kuin 0 tai liian suuri time_t-" "rakenteeseen" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: ensimmäinen vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: vastaanotettu tyhjä muotomerkkijono" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: vähintään yksi arvoista on oletuslukualueen ulkopuolella" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "’system’-funktio ei ole sallittu hiekkalaatikkotilassa" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "viite alustamattomaan kenttään â€$%dâ€" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: ensimmäinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: toinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: kolmas argumentti ei ole taulukko" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: 0-arvoinen kolmas argumentti käsitellään kuin 1" -#: builtin.c:3030 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: 0-arvoinen kolmas argumentti käsitellään kuin 1" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: ensimmäinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: toinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): negatiiviset arvot antavat outoja tuloksia" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): jaosarvot typistetään" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): liian suuri siirrosarvo antaa outoja tuloksia" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: ensimmäinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: toinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): negatiiviset arvot antavat outoja tuloksia" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): jaosarvot typistetään" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): liian suuri siirrosarvo antaa outoja tuloksia" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: kutsuttu vähemmällä kuin kahdella argumentilla" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: argumentti %d ei ole numeeraaliargumentti" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argumentin %d negatiivinen arvo %g antaa outoja tuloksia" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: kutsuttu vähemmällä kuin kahdella argumentilla" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: argumentti %d ei ole numeraaliargumentti" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argumentin %d negatiivinen arvo %g antaa outoja tuloksia" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: kutsuttu vähemmällä kuin kahdella argumentilla" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: argumentti %d ei ole numeraaliargumentti" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argumentin %d negatiivinen arvo %g antaa outoja tuloksia" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): negatiivinen arvo antaa outoja tuloksia" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): jaosarvo typistetään" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: â€%s†ei ole kelvollinen paikallinen kategoria" @@ -1245,40 +1266,49 @@ msgstr "up [N] - siirrä N kehystä ylöspäin pinossa." msgid "watch var - set a watchpoint for a variable." msgstr "watch muuttuja - aseta vahtikohta muuttujalle." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +#, fuzzy +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"backtrace [N] - tulosta kaikkien tai N:n sisimmäisen (ulommaisin, jos N < 0) " +"kehyksen jäljet." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "virhe: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "komennon (%s) lukeminen epäonnistui\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "komennon (%s) lukeminen epäonnistui" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "virheellinen merkki komennossa" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "tuntematon komento - \"%.*s\", kokeile käskyä help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "virheellinen merkki" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "määrittelemätön komento: %s\n" @@ -1817,68 +1847,70 @@ msgstr "â€%s†ei ole sallittu nykyisessä asiayhteydessä; lause ohitetaan" msgid "`return' not allowed in current context; statement ignored" msgstr "â€return†ei ole sallittu nykyisessä asiayhteydessä; lause ohitetaan" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Symbolia â€%s†ei ole nykyisesssä asiayhteydessä" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "pariton [" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "virheellinen merkkiluokka" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "merkkiluokkasyntaksi on [[:space:]], ei [:space:]" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "päättymätön \\-koodinvaihtomerkki" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Virheellinen \\{\\}-sisältö" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "Säännöllinen lauseke on liian iso" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "pariton (" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "syntaksi ei ole määritelty" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr "pariton )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "tuntematon solmutyyppi %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "tuntematon käskykoodi %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "käskykoodi %s ei ole operaattori tai avainsana" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "puskurin ylivuoto funktiossa genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1889,217 +1921,217 @@ msgstr "" "\t# Funktiokutsupino:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "â€IGNORECASE†on gawk-laajennus" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "â€BINMODE†on gawk-laajennus" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE-arvo â€%s†on virheellinen, käsiteltiin arvona 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "väärä â€%sFMTâ€-määritys â€%sâ€" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "käännetään pois â€--lintâ€-valitsin â€LINTâ€-sijoituksen vuoksi" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "viite alustamattomaan argumenttiin â€%sâ€" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "viite alustamattomaan muuttujaan â€%sâ€" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "yritettiin kenttäviitettä arvosta, joka ei ole numeerinen" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "yritettiin kenttäviitettä null-merkkijonosta" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "yritettiin saantia kenttään %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "viite alustamattomaan kenttään â€$%ldâ€" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funktio â€%s†kutsuttiin useammalla argumentilla kuin esiteltiin" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: odottamaton tyyppi â€%sâ€" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "jakoa nollalla yritettiin operaatiossa â€/=â€" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "jakoa nollalla yritettiin operaatiossa â€%%=â€" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "laajennuksia ei sallita hiekkalaatikkotilassa" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load ovat gawk-laajennuksia" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: vastaanotettiin NULL lib_name" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: kirjaston â€%s†(%s) avaus epäonnistui\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: kirjasto â€%sâ€: ei määrittele â€plugin_is_GPL_compatible†(%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: kirjasto â€%sâ€: funktion â€%s†(%s) kutsu epäonnistui\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "load_ext: kirjaston â€%s†alustusrutiini â€%s†epäonnistui\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "â€extension†on gawk-laajennus" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension: vastaanotettiin NULL lib_name" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: kirjaston â€%s†(%s) avaus epäonnistui" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: kirjasto â€%sâ€: ei määrittele â€plugin_is_GPL_compatible†(%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: kirjasto â€%sâ€: funktion â€%s†(%s) kutsu epäonnistui" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: puuttuva funktionimi" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: funktion â€%s†uudelleenmäärittely epäonnistui" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: funktio â€%s†on jo määritelty" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: funktionimi â€%s†on määritelty jo aiemmin" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: gawk-ohjelman sisäisen muuttujanimen â€%s†käyttö funktionimenä " "epäonnistui" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negatiivinen argumenttilukumäärä funktiolle â€%sâ€" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: puuttuva funktionimi" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: virheellinen merkki â€%c†funktionimessä â€%sâ€" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: funktion â€%s†uudelleenmäärittely epäonnistui" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: funktio â€%s†on jo määritelty" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: funktionimi â€%s†on määritelty jo aiemmin" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: gawk-ohjelman sisäisen muuttujanimen käyttö â€%s†funktionimenä " "epäonnistui" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funktio â€%s†on määritelty ottamaan enemmän kuin %d argumenttia" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "function â€%sâ€: puuttuva argumentti #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "funktio â€%sâ€: argumentti #%d: yritettiin käyttää skalaaria taulukkona" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "funktio â€%sâ€: argumentti #%d: yritettiin käyttää taulukkoa skalaarina" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "kirjaston dynaamista latausta ei tueta" @@ -2243,7 +2275,7 @@ msgstr "wait: kutsuttu liian monella argumentilla" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: kohdallaanmuokkaus on jo aktivoitu" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2277,57 +2309,57 @@ msgstr "inplace_begin: â€%s†ei ole tavallinen tiedosto" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(â€%sâ€) epäonnistui (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: chmod epäonnistui (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) epäonnistui (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) epäonnistui (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) epäonnistui (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end: ensimmäisen argumentin noutaminen merkkijonotiedostonimenä " "epäonnistui" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: kohdallaanmuokkaus ei ole aktiivinen" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) epäonnistui (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) epäonnistui (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) epäonnistui (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(â€%sâ€, â€%sâ€) epäonnistui (%s)." -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(â€%sâ€, â€%sâ€) epäonnistui (%s)" @@ -2369,50 +2401,54 @@ msgstr "readfile: kutsuttu liian monella argumentilla" msgid "readfile: called with no arguments" msgstr "readfile: kutsuttu ilman argumentteja" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: kutsuttu liian monella argumentilla" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argumentti 0 ei ole merkkijono\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argumentti 1 ei ole taulukko\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: taulukon litistäminen epäonnistui\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: litistettyä taulukon vapauttaminen epäonnistui\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: kutsuttu liian monilla argumenteilla" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argumentti 0 ei ole merkkijono\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argumentti 1 ei ole taulukko\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array epäonnistui\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element epäonnistui\n" @@ -2441,91 +2477,91 @@ msgstr "sleep: argumentti on negatiivinen" msgid "sleep: not supported on this platform" msgstr "sleep: ei ole tuettu tällä alustalla" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF asetettu negatiiviseen arvoon" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: neljäs argumentti on gawk-laajennus" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: neljäs argumentti ei ole taulukko" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: toinen argumentti ei ole taulukko" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: saman taulukon käyttö toiselle ja neljännelle argumentille epäonnistui" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: toisen argumentin käyttö alitaulukkoa neljännelle argumentille " "epäonnistui" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: neljännen argumentin käyttö alitaulukkoa toiselle argumentille " "epäonnistui" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: null-merkkijono kolmantena argumenttina on gawk-laajennus" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: neljäs argumentti ei ole taulukko" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: toinen argumentti ei ole taulukko" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: kolmas argumentti ei ole taulukko" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: saman taulukon käyttö toiselle ja neljännelle argumentille " "epäonnistui" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: toisen argumentin käyttö alitaulukkkoa neljännelle argumentille " "epäonnistui" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: neljännen argumentin käyttö alitaulukkoa toiselle argumentille " "epäonnistui" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "â€FIELDWIDTHS†on gawk-laajennus" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "virheellinen FIELDWIDTHS-arvo, lähellä â€%sâ€" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "null-merkkijono â€FSâ€-kenttäerotinmuuttujalle on gawk-laajennus" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "vanha awk ei tue regexp-arvoja â€FSâ€-kenttäerotinmuuttujana" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "â€FPAT†on gawk-laajennus" @@ -2541,20 +2577,20 @@ msgstr "node_to_awk_value: vastaaotti null-solmun" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: vastaanotti null-arvon" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: vastaanotettu null-taulukko" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: vastaanotti null-alaindeksin" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: indeksin %d muuntaminen epäonnistui\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: arvon %d muuntaminen epäonnistui\n" @@ -2614,295 +2650,277 @@ msgstr "%s: valitsin ’-W %s’ ei salli argumenttia\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: valitsin ’-W %s’ vaatii argumentin\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "komentoriviargumentti â€%s†on hakemisto: ohitettiin" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "tiedoston â€%s†avaaminen lukemista varten (%s) epäonnistui" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "tiedostomäärittelijän %d (â€%sâ€) sulkeminen epäonnistui (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "edelleenohjaus ei ole sallittua hiekkalaatikkotilassa" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "lausekkeella â€%sâ€-uudellenohjauksessa on vain numeerinen arvo" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "lausekkeella â€%sâ€-uudelleenohjauksessa on null-merkkijonoarvo" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "tiedostonimi â€%s†â€%sâ€-uudelleenohjaukselle saattaa olla loogisen lausekkeen " "tulos" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "turha merkkien â€>†ja â€>>†sekoittaminen tiedostolle â€%.*sâ€" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "putken â€%s†avaaminen tulosteelle (%s) epäonnistui" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "putken â€%s†avaaminen syötteelle (%s) epäonnistui" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "kaksisuuntaisen putken â€%s†avaaminen syötteelle/tulosteelle (%s) epäonnistui" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "uudelleenohjaus putkesta â€%s†(%s) epäonnistui" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "uudelleenohjaus putkeen â€%s†(%s) epäonnistui" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "saavutettiin avoimien tiedostojen järjestelmäraja: aloitetaan " "tiedostomäärittelijöiden lomittaminen" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "uudelleenohjauksen â€%s†sulkeminen epäonnistui (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "avoinna liian monta putkea tai syötetiedostoa" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: toisen argumentin on oltava â€to†tai â€fromâ€" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: â€%.*s†ei ole avoin tiedosto, putki tai apuprosessi" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "suljettiin uudelleenohjaus, jota ei avattu koskaan" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: uudelleenohjaus â€%s†ei ole avattu operaattoreilla â€|&â€, toinen " "argumentti ohitettu" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "virhetila (%d) putken â€%s†sulkemisessa (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "virhetila (%d) tiedoston â€%s†sulkemisessa (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "pistokkeen â€%s†eksplisiittistä sulkemista ei tarjota" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "apuprosessin â€%s†eksplisiittistä sulkemista ei tarjota" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "putken â€%s†eksplisiittistä sulkemista ei tarjota" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "tiedoston â€%s†eksplisiittistä sulkemista ei tarjota" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "virhe kirjoitettaessa vakiotulosteeseen (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "virhe kirjoitettaessa vakiovirheeseen (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "uudelleenohjauksen â€%s†putken tyhjennys epäonnistui (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "putken apuprosessityhjennys uudelleenohjaukseen â€%s†epäonnistui (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "uudelleenohjauksen â€%s†tiedostontyhjennys epäonnistui (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "paikallinen portti %s virheellinen pistokkeessa â€/inetâ€" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "etäkone- ja porttitiedot (%s, %s) ovat virheellisiä" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "ei (tunnettua) yhteyskäytäntöä tarjottu erikoistiedostonimessä â€%sâ€" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "erikoistiedostonimi â€%s†on vaillinainen" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "on tarjottava etäkoneen nimi pistokkeeseen â€/inetâ€" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "on tarjottava etäportti pistokkeeseen â€/inetâ€" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-viestintää ei tueta" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "laitteen â€%s†avaus epäonnistui, tila â€%sâ€" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "â€master ptyâ€-sulkeminen epäonnistui (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "vakiotulosteen sulkeminen lapsiprosessissa epäonnistui (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "â€slave ptyâ€:n siirtäminen vakiotulosteeseen lapsiprosessissa epäonnistui " "(dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "vakiosyötteen sulkeminen lapsiprosessissa epäonnistui (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "â€slave ptyâ€:n siirtäminen vakiosyötteeseen lapsiprosessissa epäonnistui " "(dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "â€slave ptyâ€:n sulkeminen epäonnistui (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "putken siirtäminen vakiotulosteeseen lapsiprosessissa epäonnistui (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "putken siirtäminen vakiosyötteeseen lapsiprosessissa epäonnistui (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "vakiotulosteen palauttaminen äitiprosessissa epäonnistui\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "vakiosyötön palauttaminen äitiprosessissa epäonnistui\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "putken sulkeminen epäonnistui (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "â€|&†ei tueta" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "putken â€%s†(%s) avaaminen epäonnistui" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "lapsiprosessin luominen komennolle â€%s†(fork: %s) epäonnistui" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: vastaanotettiin NULL-osoitin" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "syötejäsennin â€%s†on ristiriidassa aiemmin asennetun syötejäsentimen â€%s†" "kanssa" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "syötejäsentäjä â€%s†epäonnistui kohteen â€%s†avaamisessa" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: vastaanotti NULL-osoittimen" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" @@ -2910,16 +2928,16 @@ msgstr "" "tulostekäärin â€%s†on ristiriidassa aiemmin asennetun tulostekäärimen â€%s†" "kanssa" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "tulostekäärin â€%s†epäonnistui avaamaan â€%sâ€" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: vastaanotti NULL-osoittimen" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2928,216 +2946,203 @@ msgstr "" "kaksisuuntainen prosessori â€%s†on ristiriidassa aiemmin asennetun " "kaksisuuntaisen prosessorin â€%s†kanssa" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "kaksisuuntainen prosessori â€%s†epäonnistui avaamaan â€%sâ€" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "data-tiedosto â€%s†on tyhjä" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "lisäsyötemuistin varaus epäonnistui" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "â€RSâ€-monimerkkiarvo on gawk-laajennus" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "IPv6-viestintää ei tueta" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "tyhjä argumentti valitsimelle â€-e/--source†ohitetaan" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: valitsin â€-W %s†on tunnistamaton, ohitetaan\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: valitsin vaatii argumentin -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "ympäristömuuttuja â€POSIXLY_CORRECT†asetettu: käännetään päälle valitsin â€--" "posixâ€" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "valitsin â€--posix†korvaa valitsimen â€--traditionalâ€" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "valitsin â€--posix†tai â€--traditional†korvaa valitsimen â€--non-decimal-dataâ€" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "suorittaminen â€%s setuid rootâ€-käyttäjänä saattaa olla turvapulma" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "valitsin â€--posix†korvaa valitsimen â€--characters-as-bytesâ€" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "binaaritilan asettaminen vakiosyötteessä (%s) epäonnistui" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "binaaritilan asettaminen vakiotulosteessa (%s) epäonnistui" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "binaaritilaa asettaminen vakiovirheessä (%s) epäonnistui" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "ei ohjelmatekstiä ollenkaan!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Käyttö: %s [POSIX- tai GNU-tyyliset valitsimet] -f ohjelmatiedosto [--] " "tiedosto ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Käyttö: %s [POSIX- tai GNU-tyyliset valitsimet] [--] %cohjelma%c " "tiedosto ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX-valitsimet:\t\tGNU-pitkät valitsimet: (vakio)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f ohjelmatiedosto\t\t--file=ohjelmatiedosto\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=arvo\t\t--assign=muuttuja=arvo\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Lyhyet valitsimet:\t\tGNU-pitkät valitsimet: (laajennukset)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[tiedosto]\t\t--dump-variables[=tiedosto]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[tiedosto]\t\t--debug[=tiedosto]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'program-text'\t--source='program-text'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=tiedosto\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-po\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i include-tiedosto\t\t--include=include-tiedosto\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l kirjasto\t\t--load=kirjasto\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[tiedosto]\t\t--pretty-print[=tiedosto]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[tiedosto]\t\t--profile[=tiedosto]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3146,7 +3151,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3159,7 +3164,7 @@ msgstr "" "joka on kappale â€Reporting Problems and Bugs†painetussa versiossa.\n" "\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3169,7 +3174,7 @@ msgstr "" "Oletuksena se lukee vakiosyötettä ja kirjoittaa vakiotulosteeseen.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3179,7 +3184,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' tiedosto\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3198,7 +3203,7 @@ msgstr "" "ehtojen mukaisesti.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3212,7 +3217,7 @@ msgstr "" "GNU General Public License-ehdoista.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3220,16 +3225,16 @@ msgstr "" "Sinun pitäisi vastaanottaa kopion GNU General Public Licence-lisenssistä\n" "tämän ohjelman mukana. Jos näin ei ole, katso http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft ei aseta FS välilehteen POSIX awk:ssa" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "tuntematon arvo kenttämääritteelle: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3238,100 +3243,118 @@ msgstr "" "%s: â€%s†argumentti valitsimelle â€-v†ei ole â€var=arvoâ€-muodossa\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "â€%s†ei ole laillinen muuttujanimi" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "â€%s†ei ole muuttujanimi, etsitään tiedostoa â€%s=%sâ€" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" "gawk-ohjelman sisäisen â€%sâ€-määrittelyn käyttö muuttujanimenä epäonnistui" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "funktionimen â€%s†käyttö muuttujanimenä epäonnistui" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "liukulukupoikkeus" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "tuhoisa virhe: sisäinen virhe" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "tuhoisa virhe: sisäinen virhe: segmenttivirhe" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "tuhoisa virhe: sisäinen virhe: pinoylivuoto" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "ei avattu uudelleen tiedostomäärittelijää %d" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" "laitteen /dev/null avaaminen uudelleen tiedostomäärittelijälle %d epäonnistui" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "tyhjä argumentti valitsimelle â€-e/--source†ohitetaan" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: valitsin â€-W %s†on tunnistamaton, ohitetaan\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: valitsin vaatii argumentin -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "PREC-arvo â€%.*s†on virheellinen" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "RNDMODE-arvo â€%.*s†on virheellinen" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: vastaanotettu argumentti ei ole numeerinen" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): negatiivinen arvo antaa outoja tuloksia" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): jaosarvo typistetään" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%Zd): negatiiviset arvot antavat outoja tuloksia" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: vastaanotettu argumentti #%d ei ole numeerinen" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argumentilla #%d on virheellinen arvo %Rg, käytetään 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: argumentin #%d negatiivinen arvo %Rg antaa outoja tuloksia" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: argumentin #%d jaosarvo %Rg typistetään" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: argumentin #%d negatiivinen arvo %Zd antaa outoja tuloksia" @@ -3341,24 +3364,24 @@ msgstr "%s: argumentin #%d negatiivinen arvo %Zd antaa outoja tuloksia" msgid "cmd. line:" msgstr "komentorivi:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "kenoviiva merkkijonon lopussa" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "vanha awk ei tue â€\\%câ€-koodinvaihtosekvenssiä" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX ei salli â€\\xâ€-koodinvaihtoja" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "ei heksadesimaalilukuja â€\\xâ€-koodinvaihtosekvenssissä" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3367,12 +3390,12 @@ msgstr "" "heksadesimaalikoodinvaihtomerkkejä \\x%.*s / %d ei ole luultavasti tulkittu " "sillä tavalla kuin odotat" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "koodinvaihtosekvenssi â€\\%c†käsitelty kuin pelkkä â€%câ€" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3401,12 +3424,12 @@ msgid "sending profile to standard error" msgstr "lähetetään profiili vakiovirheeseen" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s-lohko(t)\n" +"\t# Säännöt\n" "\n" #: profile.c:198 @@ -3423,11 +3446,11 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "sisäinen virhe: %s null vname-arvolla" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "sisäinen virhe: builtin null-funktionimellä" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3436,12 +3459,12 @@ msgstr "" "\t# Ladatut laajennukset (-l ja/tai @load)\n" "\n" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk-profiili, luotu %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3450,7 +3473,7 @@ msgstr "" "\n" "\t# Funktiot, luetteloitu aakkosjärjestyksessä\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: tuntematon edelleenohjaustyyppi %d" @@ -3461,80 +3484,116 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" "säännöllisen lausekkeen komponentin â€%.*s†pitäisi luultavasti olla â€[%.*s]â€" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Onnistui" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Ei täsmäystä" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Virheellinen säännöllinen lauseke" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Virheellinen vertailumerkki" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Virheellinen merkkiluokkanimi" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Jäljessä oleva kenoviiva" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Virheellinen paluuviite" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "Pariton [ tai [^" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Pariton ( tai \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Pariton \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Virheellinen \\{\\}-sisältö" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Virheellinen lukualueen loppu" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Muisti loppui" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Virheellinen edeltävä säännöllinen lauseke" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Ennenaikainen säännöllisen lausekkeen loppu" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Säännöllinen lauseke on liian iso" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Pariton ) tai \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Ei edellistä säännöllistä lauseketta" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funktio â€%sâ€: funktionimen käyttö parametrinimenä epäonnistui" + +#: symbol.c:809 msgid "can not pop main context" msgstr "pääsisällön pop-toiminto epäonnistui" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "â€getline var†virheellinen säännön â€%s†sisällä" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "â€getline†virheellinen säännön â€%s†sisällä" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "ei (tunnettua) yhteyskäytäntöä tarjottu erikoistiedostonimessä â€%sâ€" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "erikoistiedostonimi â€%s†on vaillinainen" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "on tarjottava etäkoneen nimi pistokkeeseen â€/inetâ€" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "on tarjottava etäportti pistokkeeseen â€/inetâ€" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s-lohko(t)\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "muodon â€[%c-%c]†lukualue on paikallisasetuksesta riippuvainen" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "yritettiin käyttää funktiota â€%s†taulukkona" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "viite alustamattomaan elementtiin â€%s[\"%.*s\"]â€" @@ -3613,9 +3672,6 @@ msgstr "pääsisällön pop-toiminto epäonnistui" #~ msgid "function `%s' not defined" #~ msgstr "funktio â€%s†ei ole määritelty" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "edelleenohjaamaton â€getline†virheellinen â€%sâ€-säännön sisällä" - #~ msgid "`nextfile' cannot be called from a `%s' rule" #~ msgstr "â€nextfile†ei voida kutsua â€%sâ€-säännöstä" diff --git a/po/fr.gmo b/po/fr.gmo index c962ab71..26378b48 100644 Binary files a/po/fr.gmo and b/po/fr.gmo differ diff --git a/po/fr.po b/po/fr.po index 2a951b29..8cfe5517 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-01-16 00:31+0100\n" "Last-Translator: Jean-Philippe Guérard \n" @@ -39,9 +39,9 @@ msgstr "tentative d'utiliser le paramètre scalaire « %s » comme tableau" msgid "attempt to use scalar `%s' as an array" msgstr "tentative d'utiliser le scalaire « %s » comme tableau" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "tentative d'utilisation du tableau « %s » dans un contexte scalaire" @@ -92,420 +92,425 @@ msgstr "asort : le 1er argument ne doit pas être un sous-tableau du 2e" msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "asorti : le 1er argument ne doit pas être un sous-tableau du 2e" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "« %s » n'est pas un nom de fonction valide" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "la fonction de comparaison « %s » du tri n'est pas définie" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "les blocs %s doivent avoir une partie action" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "chaque règle doit avoir au moins une partie motif ou action" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "l'ancien awk ne permet pas les « BEGIN » ou « END » multiples" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "« %s » est une fonction interne, elle ne peut être redéfinie" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "l'expression rationnelle constante « // » n'est pas un commentaire C++" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "l'expression rationnelle constante « /%s/ » n'est pas un commentaire C" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "le corps du switch comporte des cas répétés : %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "plusieurs « default » ont été détectés dans le corps du switch" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "« break » est interdit en dehors d'une boucle ou d'un switch" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "« continue » est interdit en dehors d'une boucle ou d'un switch" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "« next » est utilisé dans l'action %s" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "« nextfile » est utilisé dans l'action %s" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "« return » est utilisé hors du contexte d'une fonction" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "dans BEGIN ou END, un « print » seul devrait sans doute être un « print " "\"\" »" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "« delete » est interdit sur SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "« delete » est interdit sur FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "« delete(array) » est une extension non portable de tawk" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "impossible d'utiliser des tubes bidirectionnels en série" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "expression rationnelle à droite d'une affectation" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "expression rationnelle à gauche d'un opérateur « ~ » ou « !~ »" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "l'ancien awk n'autorise le mot-clef « in » qu'après « for »" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "expression rationnelle à droite d'une comparaison" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "« getline var » n'est pas valable dans une règle « %s »" - -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" +#: awkgram.y:1411 +#, fuzzy, c-format +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "« getline » n'est pas valable dans une règle « %s »" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "dans une action END, un « getline » non redirigé n'est pas défini" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "l'ancien awk ne dispose pas des tableaux multidimensionnels" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "l'appel de « length » sans parenthèses n'est pas portable" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "les appels indirects de fonctions sont une extension gawk" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "impossible d'utiliser la variable spéciale « %s » pour un appel indirect de " "fonction" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "expression indice incorrecte" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "avertissement : " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatal : " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "fin de chaîne ou passage à la ligne inattendu" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "impossible d'ouvrir le fichier source « %s » en lecture (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "impossible d'ouvrir la bibliothèque partagée « %s » en lecture (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "raison inconnue" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "impossible d'inclure « %s » et de l'utiliser comme extension" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "le fichier source « %s » a déjà été intégré" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "la bibliothèque partagée « %s » est déjà chargée" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include est une extension gawk" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "Le nom de fichier après @include est vide" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "@load est une extension gawk" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "Le nom de fichier après @load est vide" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "le programme indiqué en ligne de commande est vide" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "impossible de lire le fichier source « %s » (%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "le fichier source « %s » est vide" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "le fichier source ne se termine pas par un passage à la ligne" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "expression rationnelle non refermée terminée par un « \\ » en fin de fichier" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s : %d : le modificateur d'expressions rationnelles « /.../%c » de tawk ne " "marche pas dans gawk" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "le modificateur d'expressions rationnelles « /.../%c » de tawk ne marche pas " "dans gawk" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "expression rationnelle non refermée" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "expression rationnelle non refermée en fin de fichier" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "" "l'utilisation de « \\ #... » pour prolonger une ligne n'est pas portable" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "la barre oblique inverse n'est pas le dernier caractère de la ligne" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX n'autorise pas l'opérateur « **= »" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "l'ancien awk ne dispose pas de l'opérateur « **= »" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX n'autorise pas l'opérateur « ** »" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "l'ancien awk ne dispose pas de l'opérateur « ** »" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "l'ancien awk ne dispose pas de l'opérateur « ^= »" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "l'ancien awk ne dispose pas de l'opérateur « ^ »" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "chaîne non refermée" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "caractère incorrect « %c » dans l'expression" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "« %s » est une extension gawk" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX n'autorise pas « %s »" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "l'ancien awk ne dispose pas de « %s »" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "« goto est jugé dangereux ! » (Edsger W. Dijkstra)\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d n'est pas un nombre d'arguments valide de %s" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s : une chaîne littérale en dernier argument d'une substitution est sans " "effet" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "le 3e paramètre de %s n'est pas un objet modifiable" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match : le 3e argument est une extension gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close : le 2e argument est une extension gawk" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "utilisation incorrecte de dcgettext(_\"...\") : enlevez le souligné de tête" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "utilisation incorrecte de dcngettext(_\"...\") : enlevez le souligné de tête" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "" "index : le second argument ne peut être une expression rationnelle constante" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "fonction « %s » : le paramètre « %s » masque la variable globale" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "impossible d'ouvrir « %s » en écriture (%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "envoi de la liste des variables vers la sortie d'erreur standard" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s : échec de la fermeture (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadows_funcs() a été appelé deux fois !" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "il y avait des variables masquées." -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "nom de fonction « %s » déjà défini" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" "fonction « %s » : impossible d'utiliser un nom de fonction comme paramètre" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "fonction « %s » : impossible d'utiliser la variable spéciale « %s » comme " "paramètre d'une fonction" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" "fonction « %s » : paramètre #%d, « %s » est un doublon du paramètre #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "fonction « %s » appelée sans être définie" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "fonction « %s » définie mais jamais appelée directement" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "le paramètre #%d, une expr. rationnelle constante, fournit un booléen" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -514,24 +519,24 @@ msgstr "" "fonction « %s » appelée avec un espace entre son nom\n" "et « ( », ou utilisée comme variable ou tableau" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "tentative de division par zéro" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "tentative de division par zéro dans « %% »" # gawk 'BEGIN { $1++ = 1 }' -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "impossible d'assigner une valeur au résultat de la post-incrémentation d'un " "champ" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "cible de l'assignement incorrecte (opcode %s)" @@ -574,189 +579,199 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" "fflush : « %s » n'est ni un fichier ouvert, ni un tube, ni un co-processus" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index : le premier argument n'est pas une chaîne" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index : le second argument n'est pas une chaîne" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int : l'argument n'est pas numérique" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length : l'argument reçu est un tableau" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "« length(tableau) » est une extension gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length : l'argument n'est pas une chaîne" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log : l'argument n'est pas numérique" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log : l'argument est négatif %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "" "fatal : « numéro$ » doit être utilisé pour toutes les formats ou pour aucun" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "taille du champ de la spécification « %% » ignorée" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "précision de la spécification « %% » ignorée" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "taille du champ et précision de la spécification « %% » ignorées" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal : « $ » n'est pas autorisé dans les formats awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal : le numéro d'argument de « $ » doit être > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "fatal : le numéro d'argument %ld est > au nombre total d'arguments fournis" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal : dans un format, « $ » ne doit pas suivre un point" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "fatal : aucun « $ » fourni pour la taille ou la précision du champ positionné" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "« l » n'a aucun sens dans un format awk ; ignoré" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal : « l » est interdit dans un format awk POSIX" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "« L » n'a aucun sens dans un format awk ; ignoré" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal : « L » est interdit dans un format awk POSIX" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "« h » n'a aucun sens dans un format awk ; ignoré" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal : « h » est interdit dans un format awk POSIX" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf : valeur %g hors limite pour le format « %%%c »" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf : valeur %g hors limite pour le format « %%%c »" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf : valeur %g hors limite pour le format « %%%c »" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "caractère de format inconnu « %c » ignoré : aucun argument converti" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "fatal : pas assez d'arguments pour satisfaire la chaîne de formatage" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ à court pour celui-ci" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf : spécification de format sans lettre de contrôle" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "trop d'arguments pour la chaîne de formatage" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf : aucun argument" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf : aucun argument" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt : l'argument n'est pas numérique" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt : appelé avec un argument négatif %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr : la longueur %g n'est pas >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr : la longueur %g n'est pas >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr : la longueur %g n'est pas entière, elle sera tronquée" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr : la longueur %g est trop grande, tronquée à %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr : l'index de début %g n'est pas valide, utilisation de 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr : l'index de début %g n'est pas un entier, il sera tronqué" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr : la chaîne source est de longueur nulle" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr : l'index de début %g est au-delà de la fin de la chaîne" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -764,195 +779,201 @@ msgstr "" "substr : la longueur %g à partir de %g dépasse la fin du 1er argument (%lu)" # Exemple : gawk --lint 'BEGIN { PROCINFO["strftime"]=123 ; print strftime() }' -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime : la valeur de formatage PROCINFO[\"strftime\"] est de type " "numérique" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime : le second argument n'est pas numérique" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: second argument négatif ou trop grand pour time_t" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftim : le premier argument n'est pas une chaîne" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime : la chaîne de formatage est vide" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime : l'argument n'est pas une chaîne" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "" "mktime : au moins l'une des valeurs est en dehors de la plage par défaut" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "La fonction « system » est interdite en isolement (mode sandbox)" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system : l'argument n'est pas une chaîne" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "référence à un champ non initialisé « $%d »" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower : l'argument n'est pas une chaîne" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper : l'argument n'est pas une chaîne" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2 : le premier argument n'est pas numérique" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2 : le second argument n'est pas numérique" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin : l'argument n'est pas numérique" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos : l'argument n'est pas numérique" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand : l'argument n'est pas numérique" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match : le 3e argument n'est pas un tableau" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub : le 3e argument vaut 0, il sera traité comme un 1" -#: builtin.c:3030 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub : le 3e argument vaut 0, il sera traité comme un 1" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift : le premier argument n'est pas numérique" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift : le second argument reçu n'est pas numérique" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "" "lshift(%f, %f) : les valeurs négatives donnent des résultats inattendus" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f) : les valeurs non entières seront tronquées" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f) : un décalage trop grand donne des résultats inattendus" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift : le premier argument n'est pas numérique" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift : le second argument reçu n'est pas numérique" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "" "rshift(%f, %f) : les valeurs négatives donneront des résultats inattendus" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f) : les valeurs non entières seront tronquées" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%f, %f) : un décalage trop grand donnera des résultats inattendus" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and : appelé avec moins de 2 arguments" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and : l'argument %d n'est pas numérique" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" "and : l'argument %d est négatif (%g) ce qui aura des résultats inattendus" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or : appelé avec moins de 2 arguments" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or : l'argument %d n'est pas numérique" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "" "or : l'argument %d est négatif (%g) ce qui aura des résultats inattendus" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor : appelé avec moins de 2 arguments" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor : l'argument %d n'est pas numérique" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "" "xor : l'argument %d est négatif (%g) ce qui aura des résultats inattendus" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl : l'argument n'est pas numérique" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f) : les valeurs négatives donneront des résultats inattendus" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f) : les valeurs non entières seront tronquées" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext : « %s » n'est pas dans un catégorie valide de la locale" @@ -1256,40 +1277,49 @@ msgstr "up [N] - remonte de N trames dans la pile." msgid "watch var - set a watchpoint for a variable." msgstr "watch var - définit un point de surveillance pour une variable." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +#, fuzzy +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"backtrace [N] - affiche la trace de tout ou des N dernières trames (du début " +"si N < 0)." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "erreur : " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "impossible de lire la commande (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "impossible de lire la commande (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "la commande contient un caractère incorrect" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "commande inconnue - « %.*s », essayez « help »" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "Caractère incorrect" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "commande inconnue : %s\n" @@ -1821,68 +1851,70 @@ msgstr "« %s » interdit dans ce contexte ; instruction ignorée" msgid "`return' not allowed in current context; statement ignored" msgstr "« return » interdit dans ce contexte ; instruction ignorée" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Pas de symbole « %s » dans le contexte actuel" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "[ non apparié" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "classe de caractères incorrecte" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "la syntaxe des classes de caractères est [[:space:]], et non [:space:]" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "échappement \\ non terminé" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Contenu de \\{\\} incorrect" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "Expression rationnelle trop grande" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "( non apparié" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "aucune syntaxe indiquée" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr ") non apparié" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "type de nÅ“ud %d inconnu" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "code opération %d inconnu" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "le code opération %s n'est pas un opérateur ou un mot-clef" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "débordement de tampon dans genflag2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1893,93 +1925,93 @@ msgstr "" "\t# Pile des appels de fonctions :\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "« IGNORECASE » est une extension gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "« BINMODE » est une extension gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "la valeur « %s » de BINMODE n'est pas valide, 3 utilisé à la place" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "spécification de « %sFMT » erronée « %s »" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "désactivation de « --lint » en raison d'une affectation à « LINT »" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "référence à un argument non initialisé « %s »" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "référence à une variable non initialisée « %s »" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "tentative de référence à un champ via une valeur non numérique" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "tentative de référence à un champ via une chaîne nulle" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "tentative d'accès au champ %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "référence à un champ non initialisé « $%ld »" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "la fonction « %s » a été appelée avec trop d'arguments" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: type « %s » inattendu" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "tentative de division par zéro dans « /= »" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "tentative de division par zéro dans « %%= »" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "les extensions sont interdites en isolement (mode sandbox)" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load est une extension gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext : lib_name reçu NULL" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext : impossible d'ouvrir la bibliothèque « %s » (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" @@ -1987,34 +2019,34 @@ msgstr "" "load_ext : bibliothèque « %s » : ne définit pas " "« plugin_is_GPL_compatible » (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" "load_ext : bibliothèque « %s » : impossible d'appeler la fonction " "« %s » (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext : bibliothèque « %s » : échec de la routine d'initialisation « %s " "»\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "« extension » est une extension gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension : lib_name reçu NULL" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension : impossible d'ouvrir la bibliothèque « %s » (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" @@ -2022,100 +2054,100 @@ msgstr "" "extension : bibliothèque « %s » : ne définit pas " "« plugin_is_GPL_compatible » (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" "extension : bibliothèque « %s » : impossible d'appeler la fonction " "« %s » (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin : nom de fonction manquant" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin : impossible de redéfinir la fonction « %s »" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin : fonction « %s » déjà définie" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin : nom de la fonction « %s » déjà défini" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin : impossible d'utiliser la fonction gawk « %s » comme nom de " "fonction" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin : la fonction « %s » a un nombre négatif d'arguments" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension : nom de fonction manquant" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension : caractère illégal « %c » dans le nom de la fonction « %s »" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension : impossible de redéfinir la fonction « %s »" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension : fonction « %s » est déjà définie" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension : nom de la fonction « %s » déjà défini" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension : impossible d'utiliser la fonction interne gawk « %s » comme nom " "de fonction" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "fonction « %s » définie comme ayant au maximum« %d » argument(s)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "fonction « %s » : argument #%d manquant" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "fonction « %s » : argument #%d : tentative d'utilisation d'un scalaire comme " "tableau" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "fonction « %s » : argument #%d : tentative d'utiliser un tableau comme " "scalaire" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "chargement dynamique des bibliothèques impossible" @@ -2259,7 +2291,7 @@ msgstr "wait : appelé avec trop d'arguments" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin : modification sur place déjà active" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin : 2 arguments attendu, appelé avec %d" @@ -2291,56 +2323,56 @@ msgstr "inplace_begin : « %s » n'est pas un fichier ordinaire" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin : échec de mkstemp('%s') (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin : échec de la chmod (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin : échec de dup(stdout) (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin : échec de dup2(%d, stdout) (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin : échec de close(%d) (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end : impossible de récupérer le 1er argument comme nom de fichier" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end : modification sur place non active" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "ipnlace_end : échec de dup2(%d, stdout) (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end : échec de close(%d) (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end : échec de fsetpos(stdout) (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end : échec de link('%s', '%s') (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end : échec de rename('%s', '%s') (%s)" @@ -2382,50 +2414,54 @@ msgstr "readfile : appelé avec trop d'arguments" msgid "readfile: called with no arguments" msgstr "readfile : appelé sans argument" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea : appelé avec trop d'arguments" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea : l'argument 0 n'est pas une chaîne\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea : l'argument 1 n'est pas un tableau\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array : impossible d'aplatir le tableau\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array : impossible de libérer le tableau aplati\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada : appelé avec trop d'arguments" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada : l'argument 0 n'est pas une chaîne\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada : l'argument 1 n'est pas un tableau\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada : échec de clear_array\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array : échec de set_array_element\n" @@ -2454,88 +2490,88 @@ msgstr "sleep : l'argument est négatif" msgid "sleep: not supported on this platform" msgstr "sleep : n'est pas disponible sur cette plateforme" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "une valeur négative a été assignée à NF" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split : le 4e argument est une extension gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split : le 4e argument n'est pas un tableau" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split : le 2e argument n'est pas un tableau" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "split : impossible d'utiliser le même tableau comme 2e et 4e argument" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split : impossible d'utiliser un sous-tableau du 2e argument en 4e argument" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split : impossible d'utiliser un sous-tableau du 4e argument en 2e argument" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split : utiliser une chaîne vide en 3e argument est une extension gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit : le 4e argument n'est pas un tableau" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit : le 2e argument n'est pas un tableau" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit : le 3e argument n'est pas un tableau" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit : impossible d'utiliser le même tableau comme 2e et 4e argument" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit : impossible d'utiliser un sous-tableau du 2e argument en 4e " "argument" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit : impossible d'utiliser un sous-tableau du 4e argument en 2e " "argument" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "« FIELDWIDTHS » est une extension gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "valeur de FIELDWIDTHS incorrecte, près de « %s »" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "utiliser une chaîne vide pour « FS » est une extension gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "" "l'ancien awk n'accepte pas les expr. rationnelles comme valeur de « FS »" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "« FPAT » est une extension gawk" @@ -2551,20 +2587,20 @@ msgstr "node_to_awk_value : node nul reçu" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value : val nul reçu" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element : tableau nul reçu" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element : indice nul reçu" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array : impossible de convertir l'indice %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array : impossible de convertir la valeur %d\n" @@ -2624,312 +2660,293 @@ msgstr "%s : l'option « -W %s » n'accepte pas d'argument\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s : l'option « -W %s » nécessite un argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "L'argument « %s » de la ligne de commande est un répertoire : ignoré" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "impossible d'ouvrir le fichier « %s » en lecture (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "échec de la fermeture du fd %d (« %s ») : %s" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "les redirections sont interdites en isolement (mode sandbox)" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "l'expression dans la redirection « %s » n'a qu'une valeur numérique" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "l'expression dans la redirection « %s » donne une chaîne nulle" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "le fichier « %s » de la redirection « %s » pourrait être le résultat d'une " "expression booléenne" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mélange non nécessaire de « > » et « >> » pour le fichier « %.*s »" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "impossible d'ouvrir le tube « %s » en sortie (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "impossible d'ouvrir le tube « %s » en entrée (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "impossible d'ouvrir un tube bidirectionnel « %s » en entrées-sorties (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "impossible de rediriger depuis « %s » (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "impossible de rediriger vers « %s » (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "limite système du nombre de fichiers ouverts atteinte : début du " "multiplexage des descripteurs de fichiers" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "échec de la fermeture de « %s » (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "trop de fichiers d'entrées ou de tubes ouverts" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close : le second argument doit être « to » ou « from »" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" "close : « %.*s » n'est ni un fichier ouvert, ni un tube ou un co-processus" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "fermeture d'une redirection qui n'a jamais été ouverte" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close : la redirection « %s » n'a pas été ouverte avec « |& », second " "argument ignoré" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "résultat d'échec (%d) sur la fermeture du tube « %s » (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "résultat d'échec (%d) sur la fermeture du fichier « %s » (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "aucune fermeture explicite du connecteur « %s » fournie" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "aucune fermeture explicite du co-processus « %s » fournie" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "aucune fermeture explicite du tube « %s » fournie" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "aucune fermeture explicite du fichier « %s » fournie" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "erreur lors de l'écriture vers la sortie standard (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "erreur lors de l'écriture vers l'erreur standard (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "échec du vidage du tube « %s » (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "échec du vidage du tube vers « %s » par le co-processus (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "échec du vidage vers le fichier « %s » (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "le port local %s n'est pas valide dans « /inet »" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "" "les informations sur l'hôte et le port distants (%s, %s) ne sont pas valides" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" -"aucun protocole (connu) n'a été fourni dans le nom de fichier spécial « %s »" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "nom de fichier spécial « %s » incomplet" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "un nom d'hôte distant doit être fourni à « /inet »" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "un port distant doit être fourni à « /inet »" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "les communications TCP/IP ne sont pas disponibles" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "impossible d'ouvrir « %s », mode « %s »" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "échec de la fermeture du pty maître (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "échec de la fermeture de stdout du processus fils (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "échec du déplacement du pty esclave vers le stdout du processus fils (dup : " "%s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "échec de fermeture du stdin du processus fils (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "échec du déplacement du pty esclave vers le stdin du processus fils (dup : " "%s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "échec de la fermeture du pty esclave (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "échec du déplacement du tube vers stdout du processus fils (dup : %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "échec de déplacement du tube vers stdin du processus fils (dup : %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "échec de la restauration du stdout dans le processus parent\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "échec de la restauration du stdin dans le processus parent\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "échec de la fermeture du tube (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "« |& » non disponible" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "impossible d'ouvrir le tube « %s » (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "impossible de créer le processus fils pour « %s » (fork : %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser : pointeur NULL reçu" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "l'analyseur d'entrée « %s » est en conflit avec l'analyseur « %s » déjà " "installé" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "l'analyseur d'entrée « %s » n'a pu ouvrir « %s »" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper : pointeur NULL reçu" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" "le filtre de sortie « %s » est en conflit avec le filtre « %s » déjà installé" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "le filtre de sortie « %s » n'a pu ouvrir « %s »" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor : pointeur NULL reçu" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2938,216 +2955,203 @@ msgstr "" "le gestionnaire bidirectionnel « %s » est en conflit avec le gestionnaire " "« %s » déjà installé" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "le gestionnaire bidirectionnel « %s » n'a pu ouvrir « %s »" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "le fichier de données « %s » est vide" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "impossible d'allouer plus de mémoire d'entrée" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" "l'utilisation d'un « RS » de plusieurs caractères est une extension gawk" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "les communications IPv6 ne sont pas disponibles" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "argument vide de l'option « -e / --source » ignoré" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s : option « -W %s » non reconnue, ignorée\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s : l'option requiert un argument - %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "variable d'environnement « POSIXLY__CORRECT » définie : activation de « --" "posix »" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "« --posix » prend le pas sur « --traditional »" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "« --posix » et « --traditional » prennent le pas sur « --non-decimal-data »" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" "l'exécution de %s en mode setuid root peut être un problème de sécurité" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "« --posix » prend le pas sur « --characters-as-bytes »" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "impossible d'activer le mode binaire sur stdin (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "impossible d'activer le mode binaire sur stdout (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "impossible d'activer le mode binaire sur stderr (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "aucun programme !" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Utilisation : %s [options GNU ou POSIX] -f fichier_prog [--] fichier ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Utilisation : %s [options GNU ou POSIX] [--] %cprogramme%c fichier ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Options POSIX :\t\tOptions longues GNU : (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fichier_prog\t\t--file=fichier_prog\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valeur\t\t--assign=var=valeur\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Options POSIX :\t\tOptions longues GNU : (extensions)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[fichier]\t\t--dump-variables[=fichier]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[fichier]\t\t--debug[=fichier]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'programme'\t\t--source='programme'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E fichier\t\t--exec=fichier\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i fichier\t\t--include=fichier\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l bibliothèque\t\t--load=bibliothèque\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[fichier]\t\t--pretty-print[=fichier]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[fichier]\t\t--profile[=fichier]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3156,7 +3160,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3171,7 +3175,7 @@ msgstr "" ".\n" "\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3181,7 +3185,7 @@ msgstr "" "Par défaut, il lit l'entrée standard et écrit sur la sortie standard.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3191,7 +3195,7 @@ msgstr "" "\tgawk '{ somme += $1 }; END { print somme }' fichier\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3211,7 +3215,7 @@ msgstr "" "version ultérieure de votre choix.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3226,7 +3230,7 @@ msgstr "" "General Public License).\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3235,16 +3239,16 @@ msgstr "" "(GNU General Public License) avec ce programme. Sinon, consultez\n" "http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft ne définit pas le FS comme étant une tabulation en awk POSIX" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valeur inconnue pour la définition de champ : %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3253,99 +3257,117 @@ msgstr "" "%s : « %s » l'argument de « -v » ne respecte pas la forme « var=valeur »\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "« %s » n'est pas un nom de variable valide" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "« %s » n'est pas un nom de variable, recherche du fichier « %s=%s »" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "impossible d'utiliser le mot clef gawk « %s » comme variable" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "impossible d'utiliser la fonction « %s » comme variable" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "exception du traitement en virgule flottante" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "fatal : erreur interne" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "fatal : erreur interne : erreur de segmentation" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "fatal : erreur interne : débordement de la pile" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "aucun descripteur fd %d pré-ouvert" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "impossible de pré-ouvrir /dev/null pour le descripteur fd %d" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "argument vide de l'option « -e / --source » ignoré" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s : option « -W %s » non reconnue, ignorée\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s : l'option requiert un argument - %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "la valeur « %.*s » de PREC est incorrecte" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "la valeur « %.*s » de RNDMODE est incorrecte" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s : argument reçu non numérique" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg) : les valeurs négatives donneront des résultats inattendus" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg) : les valeurs non entières seront tronquées" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%Zd) : les valeurs négatives donneront des résultats inattendus" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s : argument reçu non numérique #%d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s : l'argument #%d a une valeur incorrecte %Rg, utilisation de 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "" "%s : argument #%d : la valeur négative %Rg donnera des résultats inattendus" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s : argument #%d : la valeur non entière %Rg sera tronquée" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "" @@ -3356,24 +3378,24 @@ msgstr "" msgid "cmd. line:" msgstr "ligne de commande:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "barre oblique inverse à la fin de la chaîne" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "l'ancien awk ne dispose pas de la séquence d'échappement « \\%c »" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX n'autorise pas les séquences d'échappement « \\x »" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "aucun chiffre hexadécimal dans la séquence d'échappement « \\x » " -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3382,12 +3404,12 @@ msgstr "" "la séquence d'échappement hexa. \\x%.*s de %d caractères ne sera " "probablement pas interprétée comme vous l'imaginez" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "séquence d'échappement « \\%c » traitée comme un simple « %c »" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3417,12 +3439,12 @@ msgid "sending profile to standard error" msgstr "envoi du profil vers la sortie d'erreur standard" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# Bloc(s) %s\n" +"\t# Règle(s)\n" "\n" #: profile.c:198 @@ -3439,11 +3461,11 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "erreur interne : %s avec un vname nul" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "erreur interne : fonction interne avec un fname nul" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3452,12 +3474,12 @@ msgstr "" "\t# Extensions chargées (-l ou @load)\n" "\n" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profile gawk, créé %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3466,7 +3488,7 @@ msgstr "" "\n" "\t# Fonctions, par ordre alphabétique\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str : type de redirection %d inconnu" @@ -3478,73 +3500,112 @@ msgstr "" "le composant d'expression rationnelle « %.*s » devrait probablement être " "« [%.*s] »" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Succès" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Aucune correspondance" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Expression rationnelle incorrecte" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Caractère d'interclassement incorrect" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nom de classe de caractères incorrect" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Barre oblique inverse finale" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Référence arrière incorrecte" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "[ ou [^ sans correspondance" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( ou \\( sans correspondance" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ sans correspondance" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Contenu de \\{\\} incorrect" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Borne finale non valable" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Mémoire épuisée" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Expression rationnelle précédente incorrecte" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Fin prématurée de l'expression rationnelle" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Expression rationnelle trop grande" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") ou \\) sans correspondance" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Aucune expression rationnelle précédente" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" +"fonction « %s » : impossible d'utiliser un nom de fonction comme paramètre" + +#: symbol.c:809 msgid "can not pop main context" msgstr "impossible de rétablir (pop) le contexte principal (main)" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "« getline var » n'est pas valable dans une règle « %s »" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "aucun protocole (connu) n'a été fourni dans le nom de fichier spécial " +#~ "« %s »" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "nom de fichier spécial « %s » incomplet" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "un nom d'hôte distant doit être fourni à « /inet »" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "un port distant doit être fourni à « /inet »" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# Bloc(s) %s\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "les plages « [%c-%c] » sont dépendantes des paramètres régionaux" diff --git a/po/gawk.pot b/po/gawk.pot index bb47fa9e..7f778872 100644 --- a/po/gawk.pot +++ b/po/gawk.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: gawk 4.1.1\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Project-Id-Version: gawk 4.1.1c\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -36,9 +36,9 @@ msgstr "" msgid "attempt to use scalar `%s' as an array" msgstr "" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "" @@ -89,422 +89,427 @@ msgstr "" msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "" -#: awkgram.y:1417 +#: awkgram.y:1411 #, c-format -msgid "`getline var' invalid inside `%s' rule" +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "" - -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "" -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "" -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "" -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" "or used as a variable or an array" msgstr "" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "" @@ -542,371 +547,387 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" msgstr "" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "" -#: builtin.c:3030 +#: builtin.c:2720 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "" @@ -1186,40 +1207,46 @@ msgstr "" msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "" -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1731,68 +1758,68 @@ msgstr "" msgid "`return' not allowed in current context; statement ignored" msgstr "" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +msgid "invalid content of \\{\\}" msgstr "" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +msgid "regular expression too big" msgstr "" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr "" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1800,211 +1827,211 @@ msgid "" "\n" msgstr "" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2148,7 +2175,7 @@ msgstr "" msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2177,55 +2204,55 @@ msgstr "" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "" @@ -2267,50 +2294,54 @@ msgstr "" msgid "readfile: called with no arguments" msgstr "" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2339,80 +2370,80 @@ msgstr "" msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "" @@ -2428,20 +2459,20 @@ msgstr "" msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2501,504 +2532,472 @@ msgstr "" msgid "%s: option '-W %s' requires an argument\n" msgstr "" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "" - -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" +#: main.c:586 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "" -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "" @@ -3007,7 +3006,7 @@ msgstr "" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3015,21 +3014,21 @@ msgid "" "\n" msgstr "" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" "\n" msgstr "" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" msgstr "" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3041,7 +3040,7 @@ msgid "" "\n" msgstr "" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3050,120 +3049,138 @@ msgid "" "\n" msgstr "" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" msgstr "" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "" @@ -3173,36 +3190,36 @@ msgstr "" msgid "cmd. line:" msgstr "" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " "expect" msgstr "" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3230,7 +3247,7 @@ msgstr "" #: profile.c:193 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" @@ -3246,30 +3263,30 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" "\t# Functions, listed alphabetically\n" msgstr "" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "" @@ -3279,70 +3296,83 @@ msgstr "" msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" msgstr "" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" diff --git a/po/it.gmo b/po/it.gmo index 73f46395..f7030fd7 100644 Binary files a/po/it.gmo and b/po/it.gmo differ diff --git a/po/it.po b/po/it.po index 12305a74..88e537f6 100644 --- a/po/it.po +++ b/po/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU Awk 4.0.73, API: 0.0\n" "Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" -"POT-Creation-Date: 2014-12-14 21:30+0100\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-12-14 22:10+0100\n" "Last-Translator: Antonio Colombo \n" "Language-Team: Italian \n" @@ -34,9 +34,9 @@ msgstr "tentativo di usare il parametro scalare `%s' come un vettore" msgid "attempt to use scalar `%s' as an array" msgstr "tentativo di usare scalare '%s' come vettore" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1600 builtin.c:1646 -#: builtin.c:1659 builtin.c:2086 builtin.c:2100 eval.c:1150 eval.c:1154 -#: eval.c:1559 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "tentativo di usare vettore `%s' in un contesto scalare" @@ -105,402 +105,407 @@ msgstr "`%s' non msgid "sort comparison function `%s' is not defined" msgstr "funzione di confronto del sort `%s' non definita" -#: awkgram.y:241 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "blocchi %s richiedono una `azione'" -#: awkgram.y:244 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "ogni regola deve avere una parte `espressione' o una parte `azione'" -#: awkgram.y:354 awkgram.y:368 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "il vecchio awk non supporta più di una regola `BEGIN' o `END'" -#: awkgram.y:412 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' è una funzione interna, non si può ridefinire" -#: awkgram.y:474 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "espressione regolare costante `//' sembra un commento C++, ma non lo è" -#: awkgram.y:478 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "espressione regolare costante `/%s/' sembra un commento C, ma non lo è" -#: awkgram.y:590 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "valori di `case' doppi all'interno di uno `switch': %s" -#: awkgram.y:611 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "valori di default doppi all'interno di uno `switch'" -#: awkgram.y:871 awkgram.y:3948 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "`break' non consentito fuori da un ciclo o da uno `switch'" -#: awkgram.y:880 awkgram.y:3940 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "`continue' non consentito fuori da un un ciclo" -#: awkgram.y:890 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "`next' usato in `azione' %s" -#: awkgram.y:899 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' usato in `azione' %s" -#: awkgram.y:923 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "`return' usato fuori da una funzione" -#: awkgram.y:997 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "`print' da solo in BEGIN o END dovrebbe forse essere `print \"\"'" -#: awkgram.y:1063 awkgram.y:1112 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "`delete' non consentito in SYMTAB" -#: awkgram.y:1065 awkgram.y:1114 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "`delete' non consentito in FUNCTAB" -#: awkgram.y:1099 awkgram.y:1103 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' è un'estensione tawk non-portabile" -#: awkgram.y:1224 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "`pipeline' multistadio bidirezionali non funzionano" -#: awkgram.y:1339 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "espressione regolare usata per assegnare un valore" -#: awkgram.y:1350 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "espressione regolare prima di operatore `~' o `!~'" -#: awkgram.y:1366 awkgram.y:1508 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "il vecchio awk non supporta la parola-chiave `in' se non dopo `for'" -#: awkgram.y:1376 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "espressione regolare a destra in un confronto" -#: awkgram.y:1488 +#: awkgram.y:1411 #, c-format msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "`getline' non ridiretta invalida all'interno della regola `%s'" -#: awkgram.y:1491 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "`getline' non ri-diretta indefinita dentro `azione' END" -#: awkgram.y:1510 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "il vecchio awk non supporta vettori multidimensionali" -#: awkgram.y:1607 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "chiamata a `length' senza parentesi non portabile" -#: awkgram.y:1673 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "chiamate a funzione indirette sono un'estensione gawk" -#: awkgram.y:1686 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "non riesco a usare la variabile speciale `%s' come parametro indiretto di " "funzione" -#: awkgram.y:1764 +#: awkgram.y:1635 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "espressione indice invalida" -#: awkgram.y:2111 awkgram.y:2131 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "attenzione: " -#: awkgram.y:2129 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatale: " -#: awkgram.y:2179 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "carattere 'a capo' o fine stringa non previsti" -#: awkgram.y:2470 awkgram.y:2546 awkgram.y:2769 debug.c:523 debug.c:539 -#: debug.c:2812 debug.c:5056 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 +#: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "non riesco ad aprire file sorgente `%s' in lettura (%s)" -#: awkgram.y:2471 awkgram.y:2596 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "non riesco ad aprire shared library `%s' in lettura (%s)" -#: awkgram.y:2473 awkgram.y:2547 awkgram.y:2597 builtin.c:135 debug.c:5207 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "ragione indeterminata" -#: awkgram.y:2482 awkgram.y:2506 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "non riesco a includere `%s' per usarlo come file di programma" -#: awkgram.y:2495 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "file sorgente `%s' già incluso" -#: awkgram.y:2496 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "shared library `%s' già inclusa" -#: awkgram.y:2531 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include è un'estensione gawk" -#: awkgram.y:2537 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "nome-file mancante dopo @include" -#: awkgram.y:2581 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "@load è un'estensione gawk" -#: awkgram.y:2587 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "nome-file mancante dopo @include" -#: awkgram.y:2721 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "programma nullo sulla riga comandi" -#: awkgram.y:2836 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "non riesco a leggere file sorgente `%s' (%s)" -#: awkgram.y:2847 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "file sorgente `%s' vuoto" -#: awkgram.y:2906 +#: awkgram.y:2828 #, c-format msgid "PEBKAC error: invalid character '\\%03o' in source code" msgstr "errore PEBKAC: carattere invalido '\\%03o' nel codice sorgente" -#: awkgram.y:3142 +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "file sorgente non termina con carattere 'a capo'" -#: awkgram.y:3247 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "espressione regolare non completata termina con `\\' a fine file" -#: awkgram.y:3271 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: modificatore di espressione regolare tawk `/.../%c' non valido in " "gawk" -#: awkgram.y:3275 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "modificatore di espressione regolare tawk `/.../%c' non valido in gawk" -#: awkgram.y:3282 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "espressione regolare non completata" -#: awkgram.y:3286 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "espressione regolare non completata a fine file" -#: awkgram.y:3357 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "uso di `\\ #...' continuazione riga non portabile" -#: awkgram.y:3377 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "'\\' non è l'ultimo carattere della riga" -#: awkgram.y:3438 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX non permette l'operatore `**='" -#: awkgram.y:3440 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "il vecchio awk non supporta l'operatore `**='" -#: awkgram.y:3449 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX non permette l'operatore `**'" -#: awkgram.y:3451 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "il vecchio awk non supporta l'operatore `**'" -#: awkgram.y:3486 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "l'operatore `^=' non è supportato nel vecchio awk" -#: awkgram.y:3494 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "l'operatore `^' non è supportato nel vecchio awk" -#: awkgram.y:3591 awkgram.y:3607 command.y:1180 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "stringa non terminata" -#: awkgram.y:3828 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "carattere '%c' non valido in un'espressione" -#: awkgram.y:3875 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' è un'estensione gawk" -#: awkgram.y:3880 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX non permette `%s'" -#: awkgram.y:3888 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' non è supportato nel vecchio awk" -#: awkgram.y:3978 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "`goto' considerato pericoloso!\n" -#: awkgram.y:4012 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d non valido come numero di argomenti per %s" -#: awkgram.y:4047 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: una stringa come ultimo argomento di `substitute' non ha effetto" -#: awkgram.y:4052 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "il terzo parametro di '%s' non è un oggetto modificabile" -#: awkgram.y:4144 awkgram.y:4147 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: il terzo argomento è un'estensione gawk" -#: awkgram.y:4201 awkgram.y:4204 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: il secondo argomento è un'estensione gawk" -#: awkgram.y:4216 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale" -#: awkgram.y:4231 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale" -#: awkgram.y:4250 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "index: espressione regolare come secondo argomento non consentita" -#: awkgram.y:4303 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funzione `%s': parametro `%s' nasconde variabile globale" -#: awkgram.y:4360 debug.c:4042 debug.c:4085 debug.c:5205 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "non riesco ad aprire `%s' in scrittura (%s)" -#: awkgram.y:4361 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "mando lista variabili a 'standard error'" -#: awkgram.y:4369 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: `close' non riuscita (%s)" -#: awkgram.y:4394 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() chiamata due volte!" -#: awkgram.y:4402 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "c'erano variabili nascoste." -#: awkgram.y:4481 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "funzione di nome `%s' definita in precedenza" -#: awkgram.y:4527 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" "funzione `%s': non è possibile usare nome della funzione come nome parametro" -#: awkgram.y:4530 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funzione `%s': non è possibile usare la variabile speciale `%s' come " "parametro di funzione" -#: awkgram.y:4538 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d" -#: awkgram.y:4625 awkgram.y:4631 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "funzione `%s' chiamata ma mai definita" -#: awkgram.y:4635 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "funzione `%s' definita ma mai chiamata direttamente" -#: awkgram.y:4667 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "espressione regolare di valore costante per parametro #%d genera valore " "booleano" -#: awkgram.y:4726 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -509,23 +514,23 @@ msgstr "" "funzione `%s' chiamata con spazio tra il nome e `(',\n" "o usata come variabile o vettore" -#: awkgram.y:4962 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "tentativo di dividere per zero" -#: awkgram.y:4971 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "tentativo di dividere per zero in `%%'" -#: awkgram.y:5294 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "impossibile assegnare un valore al risultato di un'espressione di post-" "incremento di un campo" -#: awkgram.y:5297 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "destinazione di assegnazione non valida (codice operativo %s)" @@ -586,178 +591,178 @@ msgstr "length: l'argomento ricevuto msgid "`length(array)' is a gawk extension" msgstr "`length(array)' è un'estensione gawk" -#: builtin.c:522 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: l'argomento ricevuto non è una stringa" -#: builtin.c:551 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: l'argomento ricevuto non è numerico" -#: builtin.c:554 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: argomento ricevuto negativo %g" -#: builtin.c:752 builtin.c:757 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatale: `count$' va usato per tutti i formati o per nessuno" -#: builtin.c:827 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "larghezza campo ignorata per la specifica `%%'" -#: builtin.c:829 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "precisione ignorata per la specifica `%%'" -#: builtin.c:831 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "larghezza campo e precisone ignorate per la specifica `%%'" -#: builtin.c:882 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatale: operatore `$' non consentito nei formati awk" -#: builtin.c:891 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatale: numero argomenti con `$' dev'essere > 0" -#: builtin.c:895 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "fatale: numero argomenti %ld > del numero totale argomenti specificati" -#: builtin.c:899 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatale: `$' non consentito dopo il punto in un formato" -#: builtin.c:915 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "fatale: manca `$' per i campi posizionali larghezza o precisione" -#: builtin.c:985 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' non ha senso nei formati awk; ignorato" -#: builtin.c:989 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatale: `l' non consentito nei formati POSIX awk" -#: builtin.c:1002 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' non ha senso nei formati awk; ignorato" -#: builtin.c:1006 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatale: `L' non consentito nei formati POSIX awk" -#: builtin.c:1019 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' non ha senso nei formati awk; ignorato" -#: builtin.c:1023 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatale: `h' non consentito nei formati POSIX awk" -#: builtin.c:1049 +#: builtin.c:1055 #, c-format msgid "[s]printf: value %g is too big for %%c format" msgstr "[s]printf: valore %g troppo elevato per il formato %%c" -#: builtin.c:1062 +#: builtin.c:1068 #, c-format msgid "[s]printf: value %g is not a valid wide character" msgstr "[s]printf: valore %g non è un carattere multibyte valido " -#: builtin.c:1448 +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: valore %g fuori intervallo per il formato `%%%c'" -#: builtin.c:1546 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "carattere di formato ignoto `%c' ignorato: nessun argomento convertito" -#: builtin.c:1551 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" "fatale: argomenti in numero minore di quelli richiesti dalla stringa di " "formato" -#: builtin.c:1553 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ esauriti a questo punto" -#: builtin.c:1560 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: specifica di formato senza un carattere di controllo" -#: builtin.c:1563 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "troppi argomenti specificati per questa stringa di formato" -#: builtin.c:1619 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: nessun argomento" -#: builtin.c:1642 builtin.c:1653 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: nessun argomento" -#: builtin.c:1696 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: l'argomento ricevuto non è numerico" -#: builtin.c:1700 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: chiamata con argomento negativo %g" -#: builtin.c:1731 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: lunghezza %g non >= 1" -#: builtin.c:1733 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: lunghezza %g non >= 0" -#: builtin.c:1747 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: lunghezza non intera %g: sarà troncata" -#: builtin.c:1752 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: lunghezza %g troppo elevata per indice stringa, tronco a %g" -#: builtin.c:1764 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: indice di partenza %g non valido, uso 1" -#: builtin.c:1769 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: indice di partenza non intero %g: sarà troncato" -#: builtin.c:1792 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: stringa di partenza lunga zero" -#: builtin.c:1806 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: indice di partenza %g oltre la fine della stringa" -#: builtin.c:1814 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -765,213 +770,197 @@ msgstr "" "substr: lunghezza %g all'indice di partenza %g supera la lunghezza del primo " "argomento (%lu)" -#: builtin.c:1884 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime: il valore del formato in PROCINFO[\"strftime\"] è di tipo numerico" -#: builtin.c:1907 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: il secondo argomento ricevuto non è numerico" -#: builtin.c:1911 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: il secondo argomento è < 0 o troppo elevato per time_t" -#: builtin.c:1918 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: il primo argomento ricevuto non è una stringa" -#: builtin.c:1925 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: il formato ricevuto è una stringa nulla" -#: builtin.c:1991 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: l'argomento ricevuto non è una stringa" -#: builtin.c:2008 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: almeno un valore è fuori dall'intervallo di default" -#: builtin.c:2043 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "funzione 'system' non consentita in modo `sandbox'" -#: builtin.c:2048 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: l'argomento ricevuto non è una stringa" -#: builtin.c:2168 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "riferimento a variabile non inizializzata `$%d'" -#: builtin.c:2253 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: l'argomento ricevuto non è una stringa" -#: builtin.c:2284 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: l'argomento ricevuto non è una stringa" -#: builtin.c:2317 mpfr.c:679 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: il primo argomento ricevuto non è numerico" -#: builtin.c:2319 mpfr.c:681 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: il secondo argomento ricevuto non è numerico" -#: builtin.c:2338 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: l'argomento ricevuto non è numerico" -#: builtin.c:2354 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: l'argomento ricevuto non è numerico" -#: builtin.c:2468 mpfr.c:1176 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: l'argomento ricevuto non è numerico" -#: builtin.c:2499 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: terzo argomento non-vettoriale" -#: builtin.c:2760 +#: builtin.c:2705 #, c-format msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: il terzo argomento `%.*s' trattato come 1" -#: builtin.c:2775 +#: builtin.c:2720 #, c-format msgid "gensub: third argument %g treated as 1" msgstr "gensub: il terzo argomento %g trattato come 1" -#: builtin.c:3075 +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: il primo argomento ricevuto non è numerico" -#: builtin.c:3077 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: il secondo argomento ricevuto non è numerico" -#: builtin.c:3083 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): valori negativi daranno risultati strani" -#: builtin.c:3085 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): valori decimali saranno troncati" -#: builtin.c:3087 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): valori troppo alti daranno risultati strani" -#: builtin.c:3112 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: il primo argomento ricevuto non è numerico" -#: builtin.c:3114 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: il secondo argomento ricevuto non è numerico" -#: builtin.c:3120 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): valori negativi daranno risultati strani" -#: builtin.c:3122 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): valori decimali saranno troncati" -#: builtin.c:3124 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): valori troppo alti daranno risultati strani" -#: builtin.c:3149 mpfr.c:988 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: chiamata con meno di due argomenti" -#: builtin.c:3154 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: l'argomento %d non è numerico" -#: builtin.c:3158 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argomento %d, valore negativo %g darà risultati strani" -#: builtin.c:3181 mpfr.c:1020 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: chiamata con meno di due argomenti" -#: builtin.c:3186 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: l'argomento %d non è numerico" -#: builtin.c:3190 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argomento %d, valore negativo %g darà risultati strani" -#: builtin.c:3212 mpfr.c:1051 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: chiamata con meno di due argomenti" -#: builtin.c:3218 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: l'argomento %d non è numerico" -#: builtin.c:3222 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argomento %d, valore negativo %g darà risultati strani" -#: builtin.c:3247 mpfr.c:807 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: l'argomento ricevuto non è numerico" -#: builtin.c:3253 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): valore negativo, darà risultati strani" -#: builtin.c:3255 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): valori decimali saranno troncati" -#: builtin.c:3424 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' non è una categoria `locale' valida" -#: builtin.c:3611 mpfr.c:1209 -msgid "div: third argument is not an array" -msgstr "div: terzo argomento non-vettoriale" - -#: builtin.c:3619 mpfr.c:1217 -msgid "div: received non-numeric first argument" -msgstr "div: il primo argomento ricevuto non è numerico" - -#: builtin.c:3621 mpfr.c:1219 -msgid "div: received non-numeric second argument" -msgstr "div: il secondo argomento ricevuto non è numerico" - -#: builtin.c:3630 mpfr.c:1253 -msgid "div: division by zero attempted" -msgstr "div: tentativo di dividere per zero" - #: command.y:225 #, c-format msgid "Type (g)awk statement(s). End with the command \"end\"\n" @@ -1527,17 +1516,17 @@ msgstr "[\"%s\"] non presente nel vettore `%s\n" msgid "`%s[\"%s\"]' is not an array\n" msgstr "`%s[\"%s\"]' non è un vettore\n" -#: debug.c:1236 debug.c:4965 +#: debug.c:1236 debug.c:4964 #, c-format msgid "`%s' is not a scalar variable" msgstr "`%s' non è una variabile scalare" -#: debug.c:1258 debug.c:4995 +#: debug.c:1258 debug.c:4994 #, c-format msgid "attempt to use array `%s[\"%s\"]' in a scalar context" msgstr "tentativo di usare vettore `%s[\"%s\"]' in un contesto scalare" -#: debug.c:1280 debug.c:5006 +#: debug.c:1280 debug.c:5005 #, c-format msgid "attempt to use scalar `%s[\"%s\"]' as array" msgstr "tentativo di usare scalare `%s[\"%s\"]' come vettore" @@ -1815,99 +1804,99 @@ msgstr "'finish' not significativo per salti non-locali '%s'\n" msgid "'until' not meaningful with non-local jump '%s'\n" msgstr "'until' not significativo per salti non-locali '%s'\n" -#: debug.c:4186 +#: debug.c:4185 msgid "\t------[Enter] to continue or q [Enter] to quit------" msgstr "\t------[Invio] per continuare o q [Invio] per uscire------" -#: debug.c:4187 +#: debug.c:4186 msgid "q" msgstr "q" -#: debug.c:5002 +#: debug.c:5001 #, c-format msgid "[\"%s\"] not in array `%s'" msgstr "[\"%s\"] non presente nel vettore `%s'" -#: debug.c:5208 +#: debug.c:5207 #, c-format msgid "sending output to stdout\n" msgstr "output inviato a stdout\n" -#: debug.c:5248 +#: debug.c:5247 msgid "invalid number" msgstr "numero non valido" -#: debug.c:5382 +#: debug.c:5381 #, c-format msgid "`%s' not allowed in current context; statement ignored" msgstr "`%s' non consentito nel contesto corrente; istruzione ignorata" -#: debug.c:5390 +#: debug.c:5389 msgid "`return' not allowed in current context; statement ignored" msgstr "`return' non consentito nel contesto corrente; istruzione ignorata" -#: debug.c:5605 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Simbolo `%s' non esiste nel contesto corrente" -#: dfa.c:1051 dfa.c:1054 dfa.c:1073 dfa.c:1083 dfa.c:1095 dfa.c:1131 -#: dfa.c:1140 dfa.c:1143 dfa.c:1148 dfa.c:1162 dfa.c:1210 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "[ non chiusa" -#: dfa.c:1107 +#: dfa.c:1119 msgid "invalid character class" msgstr "character class non valida" -#: dfa.c:1253 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "sintassi character class è [[:spazio:]], non [:spazio:]" -#: dfa.c:1315 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "sequenza escape \\ non completa" -#: dfa.c:1462 +#: dfa.c:1474 msgid "invalid content of \\{\\}" msgstr "contenuto di \\{\\} non valido" -#: dfa.c:1465 +#: dfa.c:1477 msgid "regular expression too big" msgstr "espressione regolare troppo complessa" -#: dfa.c:1900 +#: dfa.c:1912 msgid "unbalanced (" msgstr "( non chiusa" -#: dfa.c:2026 +#: dfa.c:2038 msgid "no syntax specified" msgstr "nessuna sintassi specificata" -#: dfa.c:2034 +#: dfa.c:2046 msgid "unbalanced )" msgstr ") non aperta" -#: eval.c:397 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "tipo nodo sconosciuto %d" -#: eval.c:408 eval.c:422 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "codice operativo sconosciuto %d" -#: eval.c:419 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "codice operativo %s non è un operatore o una parola chiave" -#: eval.c:475 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "superamento limiti buffer in 'genflags2str'" -#: eval.c:677 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1918,71 +1907,71 @@ msgstr "" "\t# `Stack' (Pila) Chiamate Funzione:\n" "\n" -#: eval.c:706 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' è un'estensione gawk" -#: eval.c:738 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' è un'estensione gawk" -#: eval.c:796 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "valore di BINMODE `%s' non valido, considerato come 3" -#: eval.c:913 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "specificazione invalida `%sFMT' `%s'" -#: eval.c:997 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "disabilito `--lint' a causa di assegnamento a `LINT'" -#: eval.c:1175 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "riferimento ad argomento non inizializzato `%s'" -#: eval.c:1176 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "riferimento a variabile non inizializzata `%s'" -#: eval.c:1194 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "tentativo di riferimento a un campo da valore non-numerico" -#: eval.c:1196 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "tentativo di riferimento a un campo da una stringa nulla" -#: eval.c:1204 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "tentativo di accedere al campo %ld" -#: eval.c:1213 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "riferimento a campo non inizializzato `$%ld'" -#: eval.c:1300 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funzione `%s' chiamata con più argomenti di quelli previsti" -#: eval.c:1501 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: tipo non previsto `%s'" -#: eval.c:1597 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "divisione per zero tentata in `/='" -#: eval.c:1604 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "divisione per zero tentata in `%%='" @@ -2393,50 +2382,54 @@ msgstr "readfile: chiamata con troppi argomenti" msgid "readfile: called with no arguments" msgstr "readfile: chiamata senza argomenti" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: chiamata con troppi argomenti" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argomento 0 non è una stringa\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argomento 1 non-vettoriale\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: non sono riuscito a appiattire un vettore\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: non sono riuscito a rilasciare un vettore appiattito\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: chiamata con troppi argomenti" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argomento 0 non è una stringa\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argomento 1 non-vettoriale\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array non riuscita\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element non riuscita\n" @@ -2564,20 +2557,20 @@ msgstr "node_to_awk_value: ricevuto nodo nullo" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: ricevuto valore nullo" -#: gawkapi.c:810 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: ricevuto vettore nullo" -#: gawkapi.c:813 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: ricevuto indice nullo" -#: gawkapi.c:950 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: non sono riuscito a convertire l'indice %d\n" -#: gawkapi.c:955 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: non sono riuscito a convertire il valore %d\n" @@ -2768,12 +2761,12 @@ msgstr "nessuna chiusura esplicita richiesta per `pipe' `%s'" msgid "no explicit close of file `%s' provided" msgstr "nessuna chiusura esplicita richiesta per file `%s'" -#: io.c:1317 io.c:1375 main.c:615 main.c:657 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "errore scrivendo 'standard output' (%s)" -#: io.c:1322 io.c:1381 main.c:617 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "errore scrivendo 'standard error' (%s)" @@ -2953,173 +2946,173 @@ msgstr "valore multicarattere per `RS' msgid "IPv6 communication is not supported" msgstr "comunicazioni IPv6 non supportate" -#: main.c:309 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "variable d'ambiente `POSIXLY_CORRECT' impostata: attivo `--posix'" -#: main.c:315 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' annulla `--traditional'" -#: main.c:326 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' annulla `--non-decimal-data'" -#: main.c:330 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "eseguire %s con `setuid' root può essere un rischio per la sicurezza" -#: main.c:334 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' annulla `--characters-as-bytes'" -#: main.c:392 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "non è possibile impostare modalità binaria su `stdin'(%s)" -#: main.c:395 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "non è possibile impostare modalità binaria su `stdout'(%s)" -#: main.c:397 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "non è possibile impostare modalità binaria su `stderr'(%s)" -#: main.c:457 +#: main.c:469 msgid "no program text at all!" msgstr "manca del tutto il testo del programma!" -#: main.c:550 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Uso: %s [opzioni in stile POSIX o GNU] -f file-prog. [--] file ...\n" -#: main.c:552 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Usage: %s [opzioni in stile POSIX o GNU] [--] %cprogramma%c file ...\n" -#: main.c:557 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opzioni POSIX:\t\topzioni lunghe GNU: (standard)\n" -#: main.c:558 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fileprog\t\t--file=file-prog.\n" -#: main.c:559 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:560 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valore\t\t--assign=var=valore\n" -#: main.c:561 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Opzioni brevi:\t\topzioni lunghe GNU: (estensioni)\n" -#: main.c:562 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:563 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:564 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:565 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[file]\t\t--dump-variables[=file]\n" -#: main.c:566 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[file]\t\t--debug[=file]\n" -#: main.c:567 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'testo-del-programma'\t--source='testo-del-programma'\n" -#: main.c:568 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=file\n" -#: main.c:569 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:570 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:571 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i include_file\t\t--include=include_file\n" -#: main.c:572 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l libreria\t\t--load=libreria\n" -#: main.c:573 +#: main.c:586 msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" -#: main.c:574 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:575 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:576 +#: main.c:589 msgid "\t-n\t\t\t--non-decimal-data\n" msgstr "\t-n\t\t\t--non-decimal-data\n" -#: main.c:577 +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[file]\t\t--pretty-print[=file]\n" -#: main.c:578 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:579 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:580 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:581 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:582 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:583 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:584 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:586 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:589 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3128,7 +3121,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:598 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3141,7 +3134,7 @@ msgstr "" "Problemi di traduzione, segnalare ad: azc100@gmail.com.\n" "\n" -#: main.c:602 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3151,7 +3144,7 @@ msgstr "" "Senza parametri, legge da 'standard input' e scrive su 'standard output'.\n" "\n" -#: main.c:606 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3161,7 +3154,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:631 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3180,7 +3173,7 @@ msgstr "" "Licenza, o (a tua scelta) a una qualsiasi versione successiva.\n" "\n" -#: main.c:639 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3194,7 +3187,7 @@ msgstr "" "Vedi la 'GNU General Public License' per ulteriori dettagli.\n" "\n" -#: main.c:645 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3203,16 +3196,16 @@ msgstr "" "assieme a questo programma; se non è così, vedi http://www.gnu.org/" "licenses/.\n" -#: main.c:682 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft non imposta FS a `tab' nell'awk POSIX" -#: main.c:973 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valore non noto per specifica campo: %d\n" -#: main.c:1071 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3221,66 +3214,66 @@ msgstr "" "%s: `%s' argomento di `-v' non in forma `var=valore'\n" "\n" -#: main.c:1097 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' non è un nome di variabile ammesso" -#: main.c:1100 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' non è un nome di variabile, cerco il file `%s=%s'" -#: main.c:1104 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "nome funzione interna gawk `%s' non ammesso come nome variabile" -#: main.c:1109 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "non è possibile usare nome di funzione `%s' come nome di variabile" -#: main.c:1162 +#: main.c:1171 msgid "floating point exception" msgstr "eccezione floating point" -#: main.c:1169 +#: main.c:1178 msgid "fatal error: internal error" msgstr "errore fatale: errore interno" -#: main.c:1184 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "errore fatale: errore interno: segfault" -#: main.c:1196 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "errore fatale: errore interno: stack overflow" -#: main.c:1255 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "manca `fd' pre-aperta %d" -#: main.c:1262 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "non riesco a pre-aprire /dev/null per `fd' %d" -#: main.c:1476 +#: main.c:1485 msgid "empty argument to `-e/--source' ignored" msgstr "argomento di `-e/--source' nullo, ignorato" -#: main.c:1547 +#: main.c:1556 msgid "-M ignored: MPFR/GMP support not compiled in" msgstr "-M ignorato: supporto per MPFR/GMP non generato" -#: main.c:1568 +#: main.c:1577 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n" -#: main.c:1621 +#: main.c:1630 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: l'opzione richiede un argomento -- %c\n" @@ -3357,7 +3350,7 @@ msgstr "POSIX non permette escape `\\x'" msgid "no hex digits in `\\x' escape sequence" msgstr "niente cifre esadecimali nella sequenza di escape `\\x'" -#: node.c:566 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3366,12 +3359,12 @@ msgstr "" "sequenza di escape esadec.\\x%.*s di %d caratteri probabilmente non " "interpretata nel modo previsto" -#: node.c:581 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "sequenza di escape `\\%c' considerata come semplice `%c'" -#: node.c:725 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3390,16 +3383,16 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "" "%s %s `%s': non riesco a impostare 'close-on-exec': (fcntl F_SETFD: %s)" -#: profile.c:73 +#: profile.c:71 #, c-format msgid "could not open `%s' for writing: %s" msgstr "non riesco ad aprire `%s' in scrittura: %s" -#: profile.c:75 +#: profile.c:73 msgid "sending profile to standard error" msgstr "mando profilo a 'standard error'" -#: profile.c:220 +#: profile.c:193 #, c-format msgid "" "\t# %s rule(s)\n" @@ -3408,7 +3401,7 @@ msgstr "" "\t# %s regola(e)\n" "\n" -#: profile.c:227 +#: profile.c:198 #, c-format msgid "" "\t# Rule(s)\n" @@ -3417,16 +3410,16 @@ msgstr "" "\t# Regola(e)\n" "\n" -#: profile.c:308 +#: profile.c:272 #, c-format msgid "internal error: %s with null vname" msgstr "errore interno: %s con `vname' nullo" -#: profile.c:574 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "errore interno: funzione interna con `fname' nullo" -#: profile.c:1016 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3435,12 +3428,12 @@ msgstr "" "\t# Estensioni caricate (-l e/o @load)\n" "\n" -#: profile.c:1065 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profilo gawk, creato %s\n" -#: profile.c:1607 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3449,7 +3442,7 @@ msgstr "" "\n" "\t# Funzioni, in ordine alfabetico\n" -#: profile.c:1658 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: tipo di ri-direzione non noto %d" @@ -3460,78 +3453,96 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" "componente di espressione `%.*s' dovrebbe probabilmente essere `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Successo" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Nessuna corrispondenza" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Espressione regolare invalida" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Carattere di ordinamento non valido" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nome di 'classe di caratteri' non valido" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "'\\' finale" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Riferimento indietro non valido" -#: regcomp.c:152 +#: regcomp.c:160 msgid "Unmatched [, [^, [:, [., or [=" msgstr "[, [^, [:, [. o [= non chiusa" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( o \\( non chiusa" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ non chiusa" -#: regcomp.c:161 +#: regcomp.c:169 msgid "Invalid content of \\{\\}" msgstr "Contenuto di \\{\\} non valido" -#: regcomp.c:164 +#: regcomp.c:172 msgid "Invalid range end" msgstr "Fine di intervallo non valido" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Memoria esaurita" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Espressione regolare precedente invalida" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Fine di espressione regolare inaspettata" -#: regcomp.c:176 +#: regcomp.c:184 msgid "Regular expression too big" msgstr "Espressione regolare troppo complessa" -#: regcomp.c:179 +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") o \\) non aperta" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Nessuna espressione regolare precedente" -#: symbol.c:749 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" +"funzione `%s': non è possibile usare nome della funzione come nome parametro" + +#: symbol.c:809 msgid "can not pop main context" msgstr "non posso salire più in alto nello stack" + +#~ msgid "div: third argument is not an array" +#~ msgstr "div: terzo argomento non-vettoriale" + +#~ msgid "div: received non-numeric first argument" +#~ msgstr "div: il primo argomento ricevuto non è numerico" + +#~ msgid "div: received non-numeric second argument" +#~ msgstr "div: il secondo argomento ricevuto non è numerico" + +#~ msgid "div: division by zero attempted" +#~ msgstr "div: tentativo di dividere per zero" diff --git a/po/ja.gmo b/po/ja.gmo index 64b16819..732821c7 100644 Binary files a/po/ja.gmo and b/po/ja.gmo differ diff --git a/po/ja.po b/po/ja.po index 19321711..4a19b5b8 100644 --- a/po/ja.po +++ b/po/ja.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-11-07 12:26+0000\n" "Last-Translator: Yasuaki Taniguchi \n" "Language-Team: Japanese \n" @@ -37,9 +37,9 @@ msgstr "スカラー仮引数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" msgid "attempt to use scalar `%s' as an array" msgstr "スカラー `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "スカラーコンテキストã§é…列 `%s' を使用ã™ã‚‹è©¦ã¿ã§ã™" @@ -90,407 +90,412 @@ msgstr "asort: 第二引数ã®éƒ¨åˆ†é…列を第一引数用ã«ä½¿ç”¨ã™ã‚‹ã“ msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "asorti: 第二引数ã®éƒ¨åˆ†é…列を第一引数用ã«ä½¿ç”¨ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "`%s' ã¯é–¢æ•°åã¨ã—ã¦ã¯ç„¡åйã§ã™" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "ソート比較関数 `%s' ãŒå®šç¾©ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "%s ブロックã«ã¯ã‚¢ã‚¯ã‚·ãƒ§ãƒ³éƒ¨ãŒå¿…é ˆã§ã™" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "å„ルールã«ã¯ãƒ‘ターンã¾ãŸã¯ã‚¢ã‚¯ã‚·ãƒ§ãƒ³éƒ¨ãŒå¿…é ˆã§ã™ã€‚" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "å¤ã„ awk ã¯è¤‡æ•°ã® `BEGIN' ã¾ãŸã¯ `END' ルールをサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' ã¯çµ„è¾¼ã¿é–¢æ•°ã§ã™ã€‚å†å®šç¾©ã§ãã¾ã›ã‚“" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "æ­£è¦è¡¨ç¾å®šæ•° `//' 㯠C++コメントã«ä¼¼ã¦ã„ã¾ã™ãŒã€é•ã„ã¾ã™ã€‚" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "æ­£è¦è¡¨ç¾å®šæ•° `/%s/' 㯠C コメントã«ä¼¼ã¦ã„ã¾ã™ãŒã€ç•°ãªã‚Šã¾ã™" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "switch æ–‡ã®ä¸­ã§é‡è¤‡ã—㟠case 値ãŒä½¿ç”¨ã•れã¦ã„ã¾ã™: %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "switch æ–‡ã®ä¸­ã§é‡è¤‡ã—㟠`default' ãŒæ¤œå‡ºã•れã¾ã—ãŸ" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "`break' ã¯ãƒ«ãƒ¼ãƒ—ã¾ãŸã¯ switch ã®å¤–ã§ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "`continue' ã¯ãƒ«ãƒ¼ãƒ—ã®å¤–ã§ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "%s アクション内㧠`next' ãŒä½¿ç”¨ã•れã¾ã—ãŸ" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' ㌠%s アクション内ã§ä½¿ç”¨ã•れã¾ã—ãŸ" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "`return' ãŒé–¢æ•°å®šç¾©æ–‡ã®å¤–ã§ä½¿ã‚れã¾ã—ãŸ" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "BEGIN ã¾ãŸã¯ END ルール内ã®å¼•æ•°ã®ç„¡ã„ `print' 㯠`print \"\"' ã ã¨æ€ã‚れã¾ã™" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' ã¯ç§»æ¤æ€§ã®ç„¡ã„ tawk æ‹¡å¼µã§ã™" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "多段階ã§åŒæ–¹å‘パイプを利用ã—ãŸå¼ã¯ä½¿ç”¨ã§ãã¾ã›ã‚“" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "æ­£è¦è¡¨ç¾ãŒä»£å…¥å¼ã®å³è¾ºã«ä½¿ç”¨ã•れã¦ã„ã¾ã™" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "`~' ã‚„ `!~' 演算å­ã®å·¦è¾ºã«æ­£è¦è¡¨ç¾ãŒä½¿ç”¨ã•れã¦ã„ã¾ã™" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "å¤ã„ awk ã§ã¯ `in' 予約語㯠`for' ã®å¾Œã‚’除ãサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "比較å¼ã®å³è¾ºã«æ­£è¦è¡¨ç¾ãŒä½¿ç”¨ã•れã¦ã„ã¾ã™ã€‚" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "`%s' ルールã®å†…部ã§ã¯ `getline var' ã¯ç„¡åйã§ã™" - -#: awkgram.y:1420 +#: awkgram.y:1411 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "`%s' ルールã®å†…部ã§ã¯ `getline' ã¯ç„¡åйã§ã™" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "`%s' ルールã®å†…å´ã§ã¯ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã•れã¦ã„ãªã„ `getline' ã¯ç„¡åйã§ã™" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "リダイレクトã•れã¦ã„ãªã„ `getline' 㯠END アクションã§ã¯æœªå®šç¾©ã§ã™ã€‚" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "å¤ã„ awk ã¯å¤šæ¬¡å…ƒé…列をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "å°æ‹¬å¼§ãŒç„¡ã„ `length' ã¯ç§»æ¤æ€§ãŒã‚りã¾ã›ã‚“" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "間接関数呼ã³å‡ºã—㯠gawk æ‹¡å¼µã§ã™" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "特別ãªå¤‰æ•° `%s' ã¯é–“接関数呼ã³å‡ºã—用ã«ã¯ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "関数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "添字ã®å¼ãŒç„¡åйã§ã™" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "警告: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "致命的: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "予期ã—ãªã„改行ã¾ãŸã¯æ–‡å­—列終端ã§ã™" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "ソースファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "共有ライブラリ `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "åŽŸå› ä¸æ˜Ž" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "共有ライブラリ `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include 㯠gawk æ‹¡å¼µã§ã™" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "@include ã®å¾Œã«ç©ºã®ãƒ•ァイルåãŒã‚りã¾ã™" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "@load 㯠gawk æ‹¡å¼µã§ã™" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "@load ã®å¾Œã«ç©ºã®ãƒ•ァイルåãŒã‚りã¾ã™" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "コマンド行ã®ãƒ—ログラム表記ãŒç©ºã§ã™" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "ソースファイル `%s' を読ã¿è¾¼ã‚ã¾ã›ã‚“ (%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "ソースファイル `%s' ã¯ç©ºã§ã™" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "ã‚½ãƒ¼ã‚¹ãƒ•ã‚¡ã‚¤ãƒ«ãŒæ”¹è¡Œã§çµ‚ã£ã¦ã„ã¾ã›ã‚“" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "終端ã•れã¦ã„ãªã„æ­£è¦è¡¨ç¾ãŒãƒ•ァイル最後㮠`\\' ã§çµ‚ã£ã¦ã„ã¾ã™ã€‚" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: tawk ã®æ­£è¦è¡¨ç¾ä¿®é£¾å­ `/.../%c' 㯠gawk ã§ä½¿ç”¨ã§ãã¾ã›ã‚“" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "tawk ã®æ­£è¦è¡¨ç¾ä¿®é£¾å­ `/.../%c' 㯠gawk ã§ä½¿ç”¨ã§ãã¾ã›ã‚“" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "æ­£è¦è¡¨ç¾ãŒçµ‚端ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "ファイルã®ä¸­ã§æ­£è¦è¡¨ç¾ãŒçµ‚端ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "`\\ #...' å½¢å¼ã®è¡Œç¶™ç¶šã¯ç§»æ¤æ€§ãŒã‚りã¾ã›ã‚“" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥ãŒè¡Œæœ€å¾Œã®æ–‡å­—ã«ãªã£ã¦ã„ã¾ã›ã‚“。" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX ã§ã¯æ¼”ç®—å­ `**=' ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "å¤ã„ awk ã¯æ¼”ç®—å­ `**=' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX ã§ã¯æ¼”ç®—å­ `**' ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "å¤ã„ awk ã¯æ¼”ç®—å­ `**' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "å¤ã„ awk ã¯æ¼”ç®—å­ `^=' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "å¤ã„ awk ã¯æ¼”ç®—å­ `^' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "文字列ãŒçµ‚端ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "å¼å†…ã«ç„¡åŠ¹ãªæ–‡å­— '%c' ãŒã‚りã¾ã™" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' 㯠gawk æ‹¡å¼µã§ã™" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX ã§ã¯ `%s' ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "å¤ã„ awk 㯠`%s' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "`goto' ã¯æœ‰å®³ã ã¨è¦‹ãªã•れã¦ã„ã¾ã™!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d 㯠%s 用ã®å¼•æ•°ã®æ•°ã¨ã—ã¦ã¯ç„¡åйã§ã™" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: æ–‡å­—åˆ—ãƒªãƒ†ãƒ©ãƒ«ã‚’ç½®ãæ›ãˆæœ€å¾Œã®å¼•æ•°ã«ä½¿ç”¨ã™ã‚‹ã¨åŠ¹æžœãŒã‚りã¾ã›ã‚“" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s 第三仮引数ã¯å¯å¤‰ã‚ªãƒ–ジェクトã§ã¯ã‚りã¾ã›ã‚“" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: 第三引数㯠gawk æ‹¡å¼µã§ã™" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: 第二引数㯠gawk æ‹¡å¼µã§ã™" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "dcgettext(_\"...\")ã®ä½¿ç”¨æ³•ãŒé–“é•ã£ã¦ã„ã¾ã™: 先頭ã®ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢(_)を削除ã—" "ã¦ãã ã•ã„" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "dcngettext(_\"...\")ã®ä½¿ç”¨æ³•ãŒé–“é•ã£ã¦ã„ã¾ã™: 先頭ã®ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢(_)を削除ã—" "ã¦ãã ã•ã„" -#: awkgram.y:4016 +#: awkgram.y:4044 #, fuzzy msgid "index: regexp constant as second argument is not allowed" msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–りã¾ã—ãŸ" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "関数 `%s': 仮引数 `%s' ãŒå¤§åŸŸå¤‰æ•°ã‚’覆ã„éš ã—ã¦ã„ã¾ã™" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "`%s' を書込ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ã§ã—㟠(%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "変数リストを標準エラーã«é€ã£ã¦ã„ã¾ã™" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() を二回呼ã³å‡ºã—ã¦ã„ã¾ã™!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "覆ã„éš ã•れãŸå¤‰æ•°ãŒã‚りã¾ã—ãŸ" -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "関数å `%s' ã¯å‰ã«å®šç¾©ã•れã¦ã„ã¾ã™" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "関数 `%s': 関数åを仮引数åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "関数 `%s': 特別ãªå¤‰æ•° `%s' ã¯é–¢æ•°ã®ä»®å¼•æ•°ã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "関数 `%s': 仮引数 #%d, `%s' ãŒä»®å¼•æ•° #%d ã¨é‡è¤‡ã—ã¦ã„ã¾ã™" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "未定義ã®é–¢æ•° `%s' を呼ã³å‡ºã—ã¾ã—ãŸ" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "関数 `%s' ã¯å®šç¾©ã•れã¦ã„ã¾ã™ãŒã€ä¸€åº¦ã‚‚直接呼ã³å‡ºã•れã¦ã„ã¾ã›ã‚“" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "仮引数 #%d ç”¨ã®æ­£è¦è¡¨ç¾å®šæ•°ã¯çœŸå½å€¤ã‚’出力ã—ã¾ã™" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -499,21 +504,21 @@ msgstr "" "関数å㨠`(' ã®é–“ã«ã‚¹ãƒšãƒ¼ã‚¹ã‚’入れã¦é–¢æ•° `%s' を呼ã³å‡ºã—ã¦ã„ã¾ã™ã€‚\n" "ã¾ãŸã¯ã€å¤‰æ•°ã‹é…列ã¨ã—ã¦ä½¿ã‚れã¦ã„ã¾ã™ã€‚" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "ゼロã«ã‚ˆã‚‹é™¤ç®—ãŒè©¦ã¿ã‚‰ã‚Œã¾ã—ãŸ" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "`%%' 内ã§ã‚¼ãƒ­ã«ã‚ˆã‚‹é™¤ç®—ãŒè©¦ã¿ã‚‰ã‚Œã¾ã—ãŸ" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5006 #, fuzzy, c-format msgid "invalid target of assignment (opcode %s)" msgstr "%d 㯠%s 用ã®å¼•æ•°ã®æ•°ã¨ã—ã¦ã¯ç„¡åйã§ã™" @@ -555,188 +560,198 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' ãŒé–‹ã‹ã‚ŒãŸãƒ•ァイルã€ãƒ‘イプã€ãƒ—ロセス共有ã§ã¯ã‚りã¾ã›ã‚“" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: 文字列ã§ã¯ç„¡ã„第一引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: 数値ã§ã¯ç„¡ã„引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: é…列引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(array)' 㯠gawk æ‹¡å¼µã§ã™" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: 文字列ã§ã¯ç„¡ã„引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: 数値ã§ã¯ç„¡ã„引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: è² ã®å¼•æ•° %g ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "" "致命的: `count$’ ã¯å…¨ã¦ã®æ›¸å¼ä½¿ç”¨ã™ã‚‹ã€ã¾ãŸã¯å…¨ã¦ã«ä½¿ç”¨ã—ãªã„ã®ã„ãšã‚Œã‹ã§ãªã‘" "れã°ã„ã‘ã¾ã›ã‚“" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "`%%' 指定用ã®ãƒ•ィールド幅ã¯ç„¡è¦–ã•れã¾ã™" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "`%%' 指定用ã®ãƒ•ィールド幅ã¯ç„¡è¦–ã•れã¾ã™" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "`%%' 指定用ã®ãƒ•ィールド幅ãŠã‚ˆã³ç²¾åº¦ã¯ç„¡è¦–ã•れã¾ã™" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "致命的: `$' 㯠awk å½¢å¼å†…ã§ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "致命的: `$' ã§æŒ‡å®šã™ã‚‹å¼•æ•°ã®ç•ªå·ã¯æ­£ã§ãªã‘れã°ã„ã‘ã¾ã›ã‚“" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "致命的: 引数ã®ç•ªå· %ld ã¯å¼•æ•°ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸæ•°ã‚ˆã‚Šå¤§ãã„ã§ã™" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "致命的: `$' ã¯æ›¸å¼æŒ‡å®šå†…ã®ãƒ”リオド `.' ã®å¾Œã«ä½¿ç”¨ã§ãã¾ã›ã‚“" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "致命的: フィールド幅ã€ã¾ãŸã¯ç²¾åº¦ã®æŒ‡å®šå­ã« `$' ãŒä¸Žãˆã‚‰ã‚Œã¦ã„ã¾ã›ã‚“" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "awk ã®æ›¸å¼æŒ‡å®šã§ã¯ `l' ã¯ç„¡æ„味ã§ã™ã€‚無視ã—ã¾ã™" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "致命的: POSIX awk 書å¼å†…ã§ã¯ `l' ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "awk ã®æ›¸å¼æŒ‡å®šã§ã¯ `L' ã¯ç„¡æ„味ã§ã™ã€‚無視ã—ã¾ã™ã€‚" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "致命的: POSIX awk 書å¼å†…ã§ã¯ `L' ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "awk ã®æ›¸å¼æŒ‡å®šã§ã¯ `h' ã¯ç„¡æ„味ã§ã™ã€‚無視ã—ã¾ã™ã€‚" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "致命的: POSIX awk 書å¼å†…ã§ã¯ `h' ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: 値 %g ã¯æ›¸å¼ `%%%c' ã®ç¯„囲外ã§ã™" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: 値 %g ã¯æ›¸å¼ `%%%c' ã®ç¯„囲外ã§ã™" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: 値 %g ã¯æ›¸å¼ `%%%c' ã®ç¯„囲外ã§ã™" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "䏿˜Žãªæ›¸å¼æŒ‡å®šæ–‡å­— `%c' を無視ã—ã¦ã„ã¾ã™: 変æ›ã•れる引数ã¯ã‚りã¾ã›ã‚“" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "致命的: æ›¸å¼æ–‡å­—列を満ãŸã™ååˆ†ãªæ•°ã®å¼•æ•°ãŒã‚りã¾ã›ã‚“" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ ã“ã“ã‹ã‚‰è¶³ã‚Šã¾ã›ã‚“" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: æ›¸å¼æŒ‡å®šå­ã«åˆ¶å¾¡æ–‡å­—ãŒã‚りã¾ã›ã‚“" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "æ›¸å¼æ–‡å­—列ã«ä¸Žãˆã‚‰ã‚Œã¦ã„る引数ãŒå¤šã™ãŽã¾ã™" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: 引数ãŒã‚りã¾ã›ã‚“" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: 引数ãŒã‚りã¾ã›ã‚“" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: 数値ã§ã¯ç„¡ã„引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: é•·ã• %g ㌠1 以上ã§ã¯ã‚りã¾ã›ã‚“" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: é•·ã• %g ㌠0 以上ã§ã¯ã‚りã¾ã›ã‚“" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: 文字数 %g ã®å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã¾ã™ã€‚" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: 文字数 %g ã¯æœ€å¤§å€¤ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚%g を使ã„ã¾ã™ã€‚" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: 開始インデックス %g ãŒç„¡åйã§ã™ã€‚1を使用ã—ã¾ã™" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: 開始インデックス %g ãŒéžæ•´æ•°ã®ãŸã‚ã€å€¤ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: 文字列ã®é•·ã•ãŒã‚¼ãƒ­ã§ã™ã€‚" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: 開始インデックス %g ãŒæ–‡å­—列終端ã®å¾Œã«ã‚りã¾ã™" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -744,187 +759,193 @@ msgstr "" "substr: 開始インデックス %2$g ã‹ã‚‰ã®é•·ã• %1$g ã¯ç¬¬ä¸€å¼•æ•°ã®é•·ã•ã‚’è¶…ãˆã¦ã„ã¾ã™ " "(%3$lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: PROCINFO[\"strftime\"] ã®æ›¸å¼ã®å€¤ã¯æ•°å€¤åž‹ã§ã™" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: éžæ–‡å­—列ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: ç©ºã®æ›¸å¼æ–‡å­—列をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: éžæ–‡å­—列引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: 一ã¤ä»¥ä¸Šã®å€¤ãŒãƒ‡ãƒ•ォルトã®ç¯„囲を超ãˆã¦ã„ã¾ã™" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "サンドボックスモードã§ã¯ 'system' 関数ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: 文字列ã§ã¯ç„¡ã„引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„フィールド `$%d' ã¸ã®å‚ç…§ã§ã™" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: éžæ–‡å­—列引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: éžæ–‡å­—列引数をå—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: 第三引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: 第三引数㌠0 ã§ã™ã€‚1 を代ã‚りã«ä½¿ç”¨ã—ã¾ã™" -#: builtin.c:3030 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: 第三引数㌠0 ã§ã™ã€‚1 を代ã‚りã«ä½¿ç”¨ã—ã¾ã™" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: 引数 %d ãŒéžæ•°å€¤ã§ã™" -#: builtin.c:3113 +#: builtin.c:3103 #, fuzzy, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: 引数 %d ãŒéžæ•°å€¤ã§ã™" -#: builtin.c:3145 +#: builtin.c:3135 #, fuzzy, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 #, fuzzy msgid "xor: called with less than two arguments" msgstr "xor: 2個未満ã®å¼•æ•°ã§å‘¼ã³å‡ºã•れã¾ã—ãŸ" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: 引数 %d ãŒéžæ•°å€¤ã§ã™" -#: builtin.c:3177 +#: builtin.c:3167 #, fuzzy, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' ã¯ç„¡åйãªãƒ­ã‚±ãƒ¼ãƒ«åŒºåˆ†ã§ã™" @@ -1204,41 +1225,47 @@ msgstr "" msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "エラー: " -#: command.y:1051 +#: command.y:1053 #, fuzzy, c-format msgid "can't read command (%s)\n" msgstr "`%s' ã‹ã‚‰ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§ãã¾ã›ã‚“ (%s)" -#: command.y:1065 +#: command.y:1067 #, fuzzy, c-format msgid "can't read command (%s)" msgstr "`%s' ã‹ã‚‰ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§ãã¾ã›ã‚“ (%s)" -#: command.y:1116 +#: command.y:1118 #, fuzzy msgid "invalid character in command" msgstr "ç„¡åŠ¹ãªæ–‡å­—クラスåã§ã™" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "ç„¡åŠ¹ãªæ–‡å­—ã§ã™" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1753,69 +1780,71 @@ msgstr "" msgid "`return' not allowed in current context; statement ignored" msgstr "" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "" -#: dfa.c:1174 +#: dfa.c:1119 #, fuzzy msgid "invalid character class" msgstr "ç„¡åŠ¹ãªæ–‡å­—クラスåã§ã™" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "\\{\\} ã®ä¸­èº«ãŒç„¡åйã§ã™" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "æ­£è¦è¡¨ç¾ãŒå¤§ãã™ãŽã¾ã™" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr "" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "䏿˜ŽãªãƒŽãƒ¼ãƒ‰åž‹ %d ã§ã™" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "䏿˜Žãªã‚ªãƒšã‚³ãƒ¼ãƒ‰ %d ã§ã™" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "オペコード %s ã¯æ¼”ç®—å­ã¾ãŸã¯äºˆç´„語ã§ã¯ã‚りã¾ã›ã‚“" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "genflags2str 内ã§ãƒãƒƒãƒ•ァオーãƒãƒ¼ãƒ•ローãŒç™ºç”Ÿã—ã¾ã—ãŸ" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1826,94 +1855,94 @@ msgstr "" "\t# 呼出関数スタック:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' 㯠gawk æ‹¡å¼µã§ã™" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' 㯠gawk æ‹¡å¼µã§ã™" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE 値 `%s' ã¯ç„¡åйã§ã™ã€‚代ã‚り㫠3 を使用ã—ã¾ã™" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "誤ã£ãŸ `%sFMT' 指定 `%s' ã§ã™" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "`LINT' ã¸ã®ä»£å…¥ã«å¾“ã„ `--lint' を無効ã«ã—ã¾ã™" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„引数 `%s' ã¸ã®å‚ç…§ã§ã™" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„変数 `%s' ã¸ã®å‚ç…§ã§ã™" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "éžæ•°å€¤ã‚’使用ã—ãŸãƒ•イールドå‚ç…§ã®è©¦ã¿ã§ã™" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "NULL 文字列を使用ã—ã¦ãƒ•ィールドã®å‚照を試ã¿ã¦ã„ã¾ã™" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "フィールド %ld ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã®è©¦ã¿ã§ã™" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„フィールド `$%ld' ã¸ã®å‚ç…§ã§ã™" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "宣言ã•れã¦ã„る数より多ã„引数を使ã£ã¦é–¢æ•° `%s' を呼ã³å‡ºã—ã¾ã—ãŸ" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: 予期ã—ãªã„åž‹ `%s' ã§ã™" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "`/=' 内ã§ã‚¼ãƒ­ã«ã‚ˆã‚‹é™¤ç®—ãŒè¡Œã‚れã¾ã—ãŸ" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "`%%=' 内ã§ã‚¼ãƒ­ã«ã‚ˆã‚‹é™¤ç®—ãŒè¡Œã‚れã¾ã—ãŸ" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "サンドボックスモード内ã§ã¯æ‹¡å¼µã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: ext.c:92 +#: ext.c:68 #, fuzzy msgid "-l / @load are gawk extensions" msgstr "@include 㯠gawk æ‹¡å¼µã§ã™" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, fuzzy, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "致命的: extension: `%s' ã‚’é–‹ãã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ (%s)\n" -#: ext.c:104 +#: ext.c:80 #, fuzzy, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" @@ -1921,32 +1950,32 @@ msgstr "" "致命的: extension: ライブラリ `%s': `plugin_is_GPL_compatible' ãŒå®šç¾©ã•れã¦ã„" "ã¾ã›ã‚“ (%s)\n" -#: ext.c:110 +#: ext.c:86 #, fuzzy, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" "致命的: extension: ライブラリ `%s': 関数 `%s' を呼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ " "(%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' 㯠gawk æ‹¡å¼µã§ã™" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, fuzzy, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "致命的: extension: `%s' ã‚’é–‹ãã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ (%s)\n" -#: ext.c:186 +#: ext.c:162 #, fuzzy, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" @@ -1954,93 +1983,93 @@ msgstr "" "致命的: extension: ライブラリ `%s': `plugin_is_GPL_compatible' ãŒå®šç¾©ã•れã¦ã„" "ã¾ã›ã‚“ (%s)\n" -#: ext.c:190 +#: ext.c:166 #, fuzzy, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" "致命的: extension: ライブラリ `%s': 関数 `%s' を呼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ " "(%s)\n" -#: ext.c:221 +#: ext.c:197 #, fuzzy msgid "make_builtin: missing function name" msgstr "extension: 関数åãŒã‚りã¾ã›ã‚“" -#: ext.c:236 +#: ext.c:212 #, fuzzy, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "extension: 関数 `%s' ã‚’å†å®šç¾©ã§ãã¾ã›ã‚“" -#: ext.c:240 +#: ext.c:216 #, fuzzy, c-format msgid "make_builtin: function `%s' already defined" msgstr "extension: 関数 `%s' ã¯æ—¢ã«å®šç¾©ã•れã¦ã„ã¾ã™" -#: ext.c:244 +#: ext.c:220 #, fuzzy, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "extension: 関数å `%s' ã¯å‰ã«å®šç¾©ã•れã¦ã„ã¾ã™" -#: ext.c:246 +#: ext.c:222 #, fuzzy, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "extension: gawk ã«çµ„ã¿è¾¼ã¾ã‚Œã¦ã„ã‚‹ `%s' ã¯é–¢æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: 関数 `%s' ã®å¼•æ•°ã®æ•°ãŒè² ã§ã™" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: 関数åãŒã‚りã¾ã›ã‚“" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: 関数å `%2$s' ã®ä¸­ã§ä¸æ­£ãªæ–‡å­— `%1$c' ãŒä½¿ç”¨ã•れã¦ã„ã¾ã™" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: 関数 `%s' ã‚’å†å®šç¾©ã§ãã¾ã›ã‚“" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: 関数 `%s' ã¯æ—¢ã«å®šç¾©ã•れã¦ã„ã¾ã™" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: 関数å `%s' ã¯å‰ã«å®šç¾©ã•れã¦ã„ã¾ã™" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: gawk ã«çµ„ã¿è¾¼ã¾ã‚Œã¦ã„ã‚‹ `%s' ã¯é–¢æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "関数 `%s' ã«ä½¿ãˆã‚‹å¼•æ•°ã®æ•°ã¯ `%d' 以下ã¨å®šç¾©ã•れã¦ã„ã¾ã™" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "関数 `%s': 引数 #%d ãŒã‚りã¾ã›ã‚“" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "関数 `%s': 引数 #%d: スカラーをé…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "関数 `%s': 引数 #%d: é…列をスカラーã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2200,7 +2229,7 @@ msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2229,55 +2258,55 @@ msgstr "" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, fuzzy, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "%s: é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, fuzzy, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "%s: é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, fuzzy, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "%s: é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, fuzzy, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "パイプ `%s' をフラッシュã§ãã¾ã›ã‚“ (%s)。" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, fuzzy, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "fd %d (`%s') ã‚’é–‰ã˜ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ (%s)" @@ -2327,52 +2356,56 @@ msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" msgid "readfile: called with no arguments" msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 #, fuzzy msgid "writea: called with too many arguments" msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, fuzzy, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, fuzzy, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "split: 第四引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 #, fuzzy msgid "reada: called with too many arguments" msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•れã¾ã—ãŸ" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, fuzzy, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, fuzzy, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "adump: 引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2405,80 +2438,80 @@ msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™" msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF ãŒè² ã®å€¤ã«è¨­å®šã•れã¦ã„ã¾ã™" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: 第四引数㯠gawk æ‹¡å¼µã§ã™" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: 第四引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: 第二引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "split: 第二引数ã¨ç¬¬å››å¼•æ•°ã«åŒã˜é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "split: 第四引数ã«ç¬¬äºŒå¼•æ•°ã®éƒ¨åˆ†é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "split: 第二引数ã«ç¬¬å››å¼•æ•°ã®éƒ¨åˆ†é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: 第三引数㫠NULL 文字列を使用ã™ã‚‹ã“ã¨ã¯ gawk æ‹¡å¼µã§ã™" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: 第四引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: 第二引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: 第三引数ã¯éž NULL ã§ãªã‘れã°ã„ã‘ã¾ã›ã‚“" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "patsplit: 第二引数ã¨ç¬¬å››å¼•æ•°ã«åŒã˜é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "patsplit: 第四引数ã«ç¬¬äºŒå¼•æ•°ã®éƒ¨åˆ†é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "patsplit: 第二引数ã«ç¬¬å››å¼•æ•°ã®éƒ¨åˆ†é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' 㯠gawk æ‹¡å¼µã§ã™" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "`%s' 付近㮠FIELDWIDTHS 値ãŒç„¡åйã§ã™" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "`FS' ã« NULL 文字列を使用ã™ã‚‹ã®ã¯ gawk æ‹¡å¼µã§ã™" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "å¤ã„ awk 㯠`FS' ã®å€¤ã¨ã—ã¦æ­£è¦è¡¨ç¾ã‚’サãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' 㯠gawk æ‹¡å¼µã§ã™" @@ -2494,21 +2527,21 @@ msgstr "" msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 #, fuzzy msgid "remove_element: received null array" msgstr "length: é…列引数をå—ã‘å–りã¾ã—ãŸ" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2568,522 +2601,490 @@ msgstr "%s: オプション '-W %s' ã¯å¼•æ•°ã‚’å–ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“\n msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: オプション '-W %s' ã«ã¯å¼•æ•°ãŒå¿…è¦ã§ã™\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "コマンドライン引数 `%s' ã¯ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§ã™: スキップã•れã¾ã—ãŸ" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "ファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "fd %d (`%s') ã‚’é–‰ã˜ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "サンドボックスモード内ã§ã¯ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "`%s' リダイレクトã®å‘½ä»¤å¼ã«æ•°å€¤ã—ã‹è¨˜è¿°ã•れã¦ã„ã¾ã›ã‚“。" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "`%s' リダイレクトã®å‘½ä»¤å¼ãŒç©ºåˆ—ã§ã™ã€‚" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "`%2$s' リダイレクトã«è«–ç†æ¼”ç®—ã®çµæžœã¨æ€ã‚れるファイルå `%1$s' ãŒä½¿ã‚れã¦ã„ã¾" "ã™ã€‚" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "ファイル `%.*s' ã§å¿…è¦ä»¥ä¸Šã« `>' 㨠`>>' を組åˆã›ã¦ã„ã¾ã™ã€‚" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "出力用ã«ãƒ‘イプ `%s' ã‚’é–‹ã‘ã¾ã›ã‚“ (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "入力用ã«ãƒ‘イプ `%s' ã‚’é–‹ã‘ã¾ã›ã‚“ (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "入出力用ã®åŒæ–¹å‘パイプ `%s' ãŒé–‹ã‘ã¾ã›ã‚“ (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "`%s' ã‹ã‚‰ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§ãã¾ã›ã‚“ (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "`%s' ã«ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§ãã¾ã›ã‚“ (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "é–‹ã„ã¦ã„ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ã®æ•°ãŒã‚·ã‚¹ãƒ†ãƒ åˆ¶é™ã«é”ã—ã¾ã—ãŸã€‚ファイル記述å­ã‚’多é‡åŒ–ã—ã¾" "ã™ã€‚" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "`%s' ã‚’é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "é–‹ã„ã¦ã„るパイプã¾ãŸã¯å…¥åŠ›ãƒ•ã‚¡ã‚¤ãƒ«ã®æ•°ãŒå¤šéŽãŽã¾ã™ã€‚" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: 第二引数㯠`to' ã¾ãŸã¯ `from' ã§ãªã‘れã°ã„ã‘ã¾ã›ã‚“" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' ã¯é–‹ã„ã¦ã„るファイルã€ãƒ‘イプã€ãƒ—ロセス共有ã§ã¯ã‚りã¾ã›ã‚“" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "é–‹ã„ã¦ãªã„リダイレクトを閉ã˜ã‚ˆã†ã¨ã—ã¦ã„ã¾ã™" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: リダイレクト `%s' 㯠`|&' を使用ã—ã¦é–‹ã‹ã‚Œã¦ã„ã¾ã›ã‚“。第二引数ã¯ç„¡è¦–ã•" "れã¾ã—ãŸ" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "パイプ `%2$s' ã‚’é–‰ã˜ãŸã¨ãã®çŠ¶æ…‹ã‚³ãƒ¼ãƒ‰ãŒå¤±æ•— (%1$d) ã§ã—㟠(%3$s)。" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "ファイル `%2$s' ã‚’é–‰ã˜ãŸã¨ãã®çŠ¶æ…‹ã‚³ãƒ¼ãƒ‰ãŒå¤±æ•— (%1$d) ã§ã—㟠(%3$s)。" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ソケット `%s' を明示ã—ã¦é–‰ã˜ã¦ã„ã¾ã›ã‚“。" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "並行プロセス `%s' を明示ã—ã¦é–‰ã˜ã¦ã„ã¾ã›ã‚“。" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "パイプ `%s' を明示ã—ã¦é–‰ã˜ã¦ã„ã¾ã›ã‚“。" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ファイル `%s' を明示ã—ã¦é–‰ã˜ã¦ã„ã¾ã›ã‚“。" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "標準出力ã¸ã®æ›¸è¾¼ã¿ã‚¨ãƒ©ãƒ¼ (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "標準エラーã¸ã®æ›¸è¾¼ã¿ã‚¨ãƒ©ãƒ¼ (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "パイプ `%s' をフラッシュã§ãã¾ã›ã‚“ (%s)。" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "`%s' ã¸æŽ¥ç¶šã™ã‚‹ãƒ‘イプを並行プロセスã‹ã‚‰ãƒ•ラッシュã§ãã¾ã›ã‚“ (%s)。" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "ファイル `%s' をフラッシュã§ãã¾ã›ã‚“ (%s)。" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "`/inet' 内ã®ãƒ­ãƒ¼ã‚«ãƒ«ãƒãƒ¼ãƒˆ %s ãŒç„¡åйã§ã™" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "リモートã®ãƒ›ã‚¹ãƒˆãŠã‚ˆã³ãƒãƒ¼ãƒˆæƒ…å ± (%s, %s) ãŒç„¡åйã§ã™" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" -"スペシャルファイルå `%s' ã«ï¼ˆèªè­˜ã§ãã‚‹ï¼‰ãƒ—ãƒ­ãƒˆã‚³ãƒ«ãŒæŒ‡å®šã•れã¦ã„ã¾ã›ã‚“" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "スペシャルファイルå `%s' ã¯ä¸å®Œå…¨ã§ã™" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "`/inet' ã«ã¯ãƒªãƒ¢ãƒ¼ãƒˆãƒ›ã‚¹ãƒˆåを与ãˆãªã‘れã°ã„ã‘ã¾ã›ã‚“" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "`/inet' ã«ã¯ãƒªãƒ¢ãƒ¼ãƒˆãƒãƒ¼ãƒˆç•ªå·ã‚’与ãˆãªã‘れã°ã„ã‘ã¾ã›ã‚“" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "TCP/IP 通信ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "`%s' をモード `%s' ã§é–‹ã‘ã¾ã›ã‚“" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "マスター pty ã‚’é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "å­ãƒ—ãƒ­ã‚»ã‚¹ãŒæ¨™æº–出力を閉ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "å­ãƒ—ロセスãŒã‚¹ãƒ¬ãƒ¼ãƒ– pty を標準出力ã«ç§»å‹•ã§ãã¾ã›ã‚“ (dup: %s)。" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "å­ãƒ—ãƒ­ã‚»ã‚¹ãŒæ¨™æº–入力を閉ã˜ã‚‰ã‚Œã¾ã›ã‚“ (%s)。" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "å­ãƒ—ロセスãŒã‚¹ãƒ¬ãƒ¼ãƒ– pty を標準入力ã«ç§»å‹•ã§ãã¾ã›ã‚“ (dup: %s)。" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "スレーブ pty ã‚’é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "å­ãƒ—ロセスãŒãƒ‘イプを標準出力ã«ç§»å‹•ã§ãã¾ã›ã‚“ (dup: %s)。" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "å­ãƒ—ロセスãŒãƒ‘イプを標準入力ã«ç§»å‹•ã§ãã¾ã›ã‚“ (dup: %s)。" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "è¦ªãƒ—ãƒ­ã‚»ã‚¹ãŒæ¨™æº–出力を復旧ã§ãã¾ã›ã‚“。\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "è¦ªãƒ—ãƒ­ã‚»ã‚¹ãŒæ¨™æº–入力を復旧ã§ãã¾ã›ã‚“。\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "パイプを閉ã˜ã‚‰ã‚Œã¾ã›ã‚“ (%s)。" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "`|&' ã¯ä½¿ç”¨ã§ãã¾ã›ã‚“。" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "パイプ `%s' ãŒé–‹ã‘ã¾ã›ã‚“ (%s)。" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "`%s' 用ã®å­ãƒ—ロセスを実行ã§ãã¾ã›ã‚“ (fork: %s)。" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "データファイル `%s' ã¯ç©ºã§ã™ã€‚" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "入力用メモリーをã“れ以上確ä¿ã§ãã¾ã›ã‚“。" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "è¤‡æ•°ã®æ–‡å­—ã‚’ `RS' ã«ä½¿ç”¨ã™ã‚‹ã®ã¯ gawk ç‰¹æœ‰ã®æ‹¡å¼µã§ã™ã€‚" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "IPv6 通信ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "`-e/--source' ã¸ã®ç©ºã®å¼•æ•°ã¯ç„¡è¦–ã•れã¾ã—ãŸ" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: オプション `-W %s' ã¯èªè­˜ã§ãã¾ã›ã‚“。無視ã•れã¾ã—ãŸ\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: 引数ãŒå¿…è¦ãªã‚ªãƒ—ション -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "環境変数 `POSIXLY_CORRECT' ãŒæŒ‡å®šã•れã¦ã„ã¾ã™ã€‚オプション `--posix' を有効ã«" "ã—ã¾ã™" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "オプション `--posix' 㯠`--traditional' を無効ã«ã—ã¾ã™ã€‚" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "オプション `--posix'/`--traditional' 㯠`--non-decimal-data' を無効ã«ã—ã¾ã™ã€‚" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" "setuid root ã§ %s を実行ã™ã‚‹ã¨ã€ã‚»ã‚­ãƒ¥ãƒªãƒ†ã‚£ä¸Šã®å•題ãŒç™ºç”Ÿã™ã‚‹å ´åˆãŒã‚りã¾" "ã™ã€‚" -#: main.c:588 +#: main.c:346 #, fuzzy msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' 㯠`--binary' を上書ãã—ã¾ã™" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "標準入力をãƒã‚¤ãƒŠãƒªãƒ¢ãƒ¼ãƒ‰ã«è¨­å®šã§ãã¾ã›ã‚“ (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "標準出力をãƒã‚¤ãƒŠãƒªãƒ¢ãƒ¼ãƒ‰ã«è¨­å®šã§ãã¾ã›ã‚“ (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "標準エラーをãƒã‚¤ãƒŠãƒªãƒ¢ãƒ¼ãƒ‰ã«è¨­å®šã§ãã¾ã›ã‚“ (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "プログラム文ãŒå…¨ãã‚りã¾ã›ã‚“!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "使用法: %s [POSIX ã¾ãŸã¯ GNU å½¢å¼ã®ã‚ªãƒ—ション] -f progfile [--] file ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "使用法: %s [POSIX ã¾ãŸã¯ GNU å½¢å¼ã®ã‚ªãƒ—ション] [--] %cprogram%c file ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX オプション:\t\tGNU é•·ã„å½¢å¼ã®ã‚ªãƒ—ション: (標準)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f progfile\t\t--file=progfile\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=val\t\t--assign=var=val\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "短ã„オプション:\t\tGNU é•·ã„å½¢å¼ã®ã‚ªãƒ—ション: (æ‹¡å¼µ)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[file]\t\t--dump-variables[=file]\n" -#: main.c:815 +#: main.c:579 #, fuzzy msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'program-text'\t--source='program-text'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=file\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 #, fuzzy msgid "\t-M\t\t\t--bignum\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 #, fuzzy msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3092,7 +3093,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3107,7 +3108,7 @@ msgstr "" "翻訳ã«é–¢ã™ã‚‹ãƒã‚°ã¯ã«å ±å‘Šã—ã¦ãã ã•" "ã„。\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3117,7 +3118,7 @@ msgstr "" "デフォルト設定ã§ã¯ã€æ¨™æº–入力を読ã¿è¾¼ã¿ã€æ¨™æº–å‡ºåŠ›ã«æ›¸ã出ã—ã¾ã™ã€‚\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3127,7 +3128,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3146,7 +3147,7 @@ msgstr "" "(at your option) any later version.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3160,7 +3161,7 @@ msgstr "" "GNU General Public License for more details.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3168,16 +3169,16 @@ msgstr "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "POSIX awk ã§ã¯ -Ft 㯠FS をタブã«è¨­å®šã—ã¾ã›ã‚“" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "フィールド指定ã«ä¸æ˜Žãªå€¤ãŒã‚りã¾ã™: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3186,102 +3187,120 @@ msgstr "" "%s: オプション `-v' ã®å¼•æ•° `%s' ㌠`変数=代入値' ã®å½¢å¼ã«ãªã£ã¦ã„ã¾ã›ã‚“。\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' ã¯å¤‰æ•°åã§ã¯ã‚りã¾ã›ã‚“。`%s=%s' ã®ãƒ•ァイルを探ã—ã¾ã™ã€‚" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "gawk ã«çµ„ã¿è¾¼ã¿ã® `%s' ã¯å¤‰æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "関数 `%s' ã¯å¤‰æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "æµ®å‹•å°æ•°ç‚¹ä¾‹å¤–" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "致命的エラー: 内部エラー" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "致命的エラー: 内部エラー: セグメンテーションé•å" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "致命的エラー: 内部エラー: スタックオーãƒãƒ¼ãƒ•ロー" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "fd %d ãŒäº‹å‰ã«é–‹ã„ã¦ã„ã¾ã›ã‚“。" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "事å‰ã« fd %d 用㫠/dev/null ã‚’é–‹ã‘ã¾ã›ã‚“。" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "`-e/--source' ã¸ã®ç©ºã®å¼•æ•°ã¯ç„¡è¦–ã•れã¾ã—ãŸ" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: オプション `-W %s' ã¯èªè­˜ã§ãã¾ã›ã‚“。無視ã•れã¾ã—ãŸ\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: 引数ãŒå¿…è¦ãªã‚ªãƒ—ション -- %c\n" + +#: mpfr.c:557 #, fuzzy, c-format msgid "PREC value `%.*s' is invalid" msgstr "BINMODE 値 `%s' ã¯ç„¡åйã§ã™ã€‚代ã‚り㫠3 を使用ã—ã¾ã™" -#: mpfr.c:608 +#: mpfr.c:615 #, fuzzy, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "BINMODE 値 `%s' ã¯ç„¡åйã§ã™ã€‚代ã‚り㫠3 を使用ã—ã¾ã™" -#: mpfr.c:698 +#: mpfr.c:711 #, fuzzy, c-format msgid "%s: received non-numeric argument" msgstr "cos: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: mpfr.c:800 +#: mpfr.c:820 #, fuzzy msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: mpfr.c:804 +#: mpfr.c:824 #, fuzzy msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" -#: mpfr.c:816 +#: mpfr.c:836 #, fuzzy, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: mpfr.c:835 +#: mpfr.c:855 #, fuzzy, c-format msgid "%s: received non-numeric argument #%d" msgstr "cos: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 #, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" -#: mpfr.c:863 +#: mpfr.c:883 #, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "and(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™" -#: mpfr.c:878 +#: mpfr.c:898 #, fuzzy, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™" @@ -3291,24 +3310,24 @@ msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ msgid "cmd. line:" msgstr "コマンドライン:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "文字列ã®çµ‚りã«ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥ãŒä½¿ã‚れã¦ã„ã¾ã™ã€‚" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "å¤ã„ awk 㯠`\\%c' エスケープシーケンスをサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX ã§ã¯ `\\x' エスケープã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "`\\x' エスケープシーケンスã«å六進数ãŒã‚りã¾ã›ã‚“" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3317,12 +3336,12 @@ msgstr "" "å六進エスケープ \\x%.*s (%d 文字) ã¯ãŠãらã予期ã—ãŸã‚ˆã†ã«ã¯è§£é‡ˆã•れãªã„ã§" "ã—ょã†" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "エスケープシーケンス `\\%c' 㯠`%c' ã¨åŒç­‰ã«æ‰±ã‚れã¾ã™" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3350,12 +3369,12 @@ msgid "sending profile to standard error" msgstr "プロファイルを標準エラーã«é€ã£ã¦ã„ã¾ã™" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s ブロック\n" +"\t# ルール\n" "\n" #: profile.c:198 @@ -3372,24 +3391,24 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "内部エラー: %s ã® vname ãŒç„¡åйã§ã™ã€‚" -#: profile.c:537 +#: profile.c:538 #, fuzzy msgid "internal error: builtin with null fname" msgstr "内部エラー: %s ã® vname ãŒç„¡åйã§ã™ã€‚" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk プロファイルã€ä½œæˆæ—¥æ™‚ %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3398,7 +3417,7 @@ msgstr "" "\n" "\t# 関数一覧(アルファベット順)\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: 䏿˜Žãªãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆåž‹ %d ã§ã™" @@ -3408,76 +3427,113 @@ msgstr "redir2str: 䏿˜Žãªãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆåž‹ %d ã§ã™" msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "æ­£è¦è¡¨ç¾ã®è¦ç´  `%.*s' ã¯ãŠãらã `[%.*s]' ã§ã‚ã‚‹ã¹ãã§ã™" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "æˆåŠŸã§ã™" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "一致ã—ã¾ã›ã‚“" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "ç„¡åŠ¹ãªæ­£è¦è¡¨ç¾ã§ã™" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "無効ãªç…§åˆæ–‡å­—ã§ã™" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "ç„¡åŠ¹ãªæ–‡å­—クラスåã§ã™" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "終端ã®ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "無効ãªå‰æ–¹å‚ç…§ã§ã™" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "[ ã¾ãŸã¯ [^ ãŒä¸ä¸€è‡´ã§ã™" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( ã¾ãŸã¯ \\( ãŒä¸ä¸€è‡´ã§ã™" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ ãŒä¸ä¸€è‡´ã§ã™" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "\\{\\} ã®ä¸­èº«ãŒç„¡åйã§ã™" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "無効ãªç¯„囲終了ã§ã™" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "ãƒ¡ãƒ¢ãƒªã‚’ä½¿ã„æžœãŸã—ã¾ã—ãŸ" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "無効ãªå‰æ–¹æ­£è¦è¡¨ç¾ã§ã™" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "æ­£è¦è¡¨ç¾ãŒé€”中ã§çµ‚了ã—ã¾ã—ãŸ" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "æ­£è¦è¡¨ç¾ãŒå¤§ãã™ãŽã¾ã™" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") ã¾ãŸã¯ \\) ãŒä¸ä¸€è‡´ã§ã™" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "以å‰ã«æ­£è¦è¡¨ç¾ãŒã‚りã¾ã›ã‚“" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "関数 `%s': 関数åを仮引数åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "関数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "`%s' ルールã®å†…部ã§ã¯ `getline var' ã¯ç„¡åйã§ã™" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "`%s' ルールã®å†…部ã§ã¯ `getline' ã¯ç„¡åйã§ã™" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "スペシャルファイルå `%s' ã«ï¼ˆèªè­˜ã§ãã‚‹ï¼‰ãƒ—ãƒ­ãƒˆã‚³ãƒ«ãŒæŒ‡å®šã•れã¦ã„ã¾ã›ã‚“" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "スペシャルファイルå `%s' ã¯ä¸å®Œå…¨ã§ã™" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "`/inet' ã«ã¯ãƒªãƒ¢ãƒ¼ãƒˆãƒ›ã‚¹ãƒˆåを与ãˆãªã‘れã°ã„ã‘ã¾ã›ã‚“" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "`/inet' ã«ã¯ãƒªãƒ¢ãƒ¼ãƒˆãƒãƒ¼ãƒˆç•ªå·ã‚’与ãˆãªã‘れã°ã„ã‘ã¾ã›ã‚“" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s ブロック\n" +#~ "\n" #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„è¦ç´  `%s[\"%.*s\"]' ã¸ã®å‚ç…§ã§ã™" @@ -3561,9 +3617,6 @@ msgstr "" #~ msgid "function `%s' not defined" #~ msgstr "関数 `%s' ã¯å®šç¾©ã•れã¦ã„ã¾ã›ã‚“" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "`%s' ルールã®å†…å´ã§ã¯ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã•れã¦ã„ãªã„ `getline' ã¯ç„¡åйã§ã™" - #~ msgid "`nextfile' cannot be called from a `%s' rule" #~ msgstr "`nextfile' 㯠`%s' ルールã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“" diff --git a/po/ms.gmo b/po/ms.gmo index 6123c873..12601818 100644 Binary files a/po/ms.gmo and b/po/ms.gmo differ diff --git a/po/ms.po b/po/ms.po index 09ec6472..cb09870e 100644 --- a/po/ms.po +++ b/po/ms.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.0.75\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2013-04-19 10:45+0800\n" "Last-Translator: Sharuzzaman Ahmat Raslan \n" "Language-Team: Malay \n" @@ -38,9 +38,9 @@ msgstr "cubaan untuk menggunakan parameter skalar `%s' sebagai tatasusunan" msgid "attempt to use scalar `%s' as an array" msgstr "cubaan untuk menggunakan skalar `%s' sebagai tatasusunan" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "cubaan untuk menggunakan tatasusunan `%s' dalam konteks skalar" @@ -91,422 +91,427 @@ msgstr "" msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "" -#: awkgram.y:1417 +#: awkgram.y:1411 #, c-format -msgid "`getline var' invalid inside `%s' rule" +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "" - -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "" -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "" -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "" -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" "or used as a variable or an array" msgstr "" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "" @@ -544,371 +549,387 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" msgstr "" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "" -#: builtin.c:3030 +#: builtin.c:2720 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "" @@ -1188,40 +1209,46 @@ msgstr "" msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "" -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1733,68 +1760,68 @@ msgstr "" msgid "`return' not allowed in current context; statement ignored" msgstr "" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +msgid "invalid content of \\{\\}" msgstr "" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +msgid "regular expression too big" msgstr "" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr "" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1802,211 +1829,211 @@ msgid "" "\n" msgstr "" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2150,7 +2177,7 @@ msgstr "" msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2179,55 +2206,55 @@ msgstr "" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "" @@ -2269,50 +2296,54 @@ msgstr "" msgid "readfile: called with no arguments" msgstr "" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2341,80 +2372,80 @@ msgstr "" msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "" @@ -2430,20 +2461,20 @@ msgstr "" msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2503,504 +2534,472 @@ msgstr "" msgid "%s: option '-W %s' requires an argument\n" msgstr "" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "" - -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" +#: main.c:586 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "" -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "" @@ -3009,7 +3008,7 @@ msgstr "" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3017,21 +3016,21 @@ msgid "" "\n" msgstr "" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" "\n" msgstr "" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" msgstr "" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3043,7 +3042,7 @@ msgid "" "\n" msgstr "" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3052,120 +3051,138 @@ msgid "" "\n" msgstr "" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" msgstr "" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "" @@ -3175,36 +3192,36 @@ msgstr "" msgid "cmd. line:" msgstr "" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " "expect" msgstr "" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3232,7 +3249,7 @@ msgstr "" #: profile.c:193 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" @@ -3248,30 +3265,30 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" "\t# Functions, listed alphabetically\n" msgstr "" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "" @@ -3281,70 +3298,83 @@ msgstr "" msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" msgstr "" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" diff --git a/po/nl.gmo b/po/nl.gmo index 76c57134..9b707e8e 100644 Binary files a/po/nl.gmo and b/po/nl.gmo differ diff --git a/po/nl.po b/po/nl.po index dc037a99..990b072d 100644 --- a/po/nl.po +++ b/po/nl.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-02-04 11:18+0100\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" @@ -40,9 +40,9 @@ msgstr "scalaire parameter '%s' wordt gebruikt als array" msgid "attempt to use scalar `%s' as an array" msgstr "scalair '%s' wordt gebruikt als array" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "array '%s' wordt gebruikt in een scalaire context" @@ -101,406 +101,411 @@ msgstr "" "asorti: een subarray van het tweede argument kan niet als eerste argument " "gebruikt worden" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "'%s' is ongeldig als functienaam" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "sorteervergelijkingsfunctie '%s' is niet gedefinieerd" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "%s-blokken horen een actiedeel te hebben" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "elke regel hoort een patroon of een actiedeel te hebben" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "oude 'awk' staat meerdere 'BEGIN'- en 'END'-regels niet toe" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "'%s' is een ingebouwde functie en is niet te herdefiniëren" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "regexp-constante '//' lijkt op C-commentaar, maar is het niet" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "regexp-constante '/%s/' lijkt op C-commentaar, maar is het niet" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "dubbele 'case'-waarde in 'switch'-opdracht: %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "dubbele 'default' in 'switch'-opdracht" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "'break' buiten een lus of 'switch'-opdracht is niet toegestaan" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "'continue' buiten een lus is niet toegestaan" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "'next' wordt gebruikt in %s-actie" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "'nextfile' wordt gebruikt in %s-actie" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "'return' wordt gebruikt buiten functiecontext" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "kale 'print' in BEGIN- of END-regel moet vermoedelijk 'print \"\"' zijn" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "'delete' is niet toegestaan met SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "'delete' is niet toegestaan met FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "'delete(array)' is een niet-overdraagbare 'tawk'-uitbreiding" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "meerfase-tweerichtings-pijplijnen werken niet" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "reguliere expressie rechts van toewijzing" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "reguliere expressie links van operator '~' of '!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "oude 'awk' kent het sleutelwoord 'in' niet, behalve na 'for'" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "reguliere expressie rechts van vergelijking" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "'getline var' is ongeldig binnen een '%s'-regel" - -#: awkgram.y:1420 +#: awkgram.y:1411 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "'getline' is ongeldig binnen een '%s'-regel" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "niet-omgeleide 'getline' is ongeldig binnen een '%s'-regel" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "niet-omgeleide 'getline' is ongedefinieerd binnen een END-actie" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "oude 'awk' kent geen meerdimensionale arrays" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "aanroep van 'length' zonder haakjes is niet overdraagbaar" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "indirecte functieaanroepen zijn een gawk-uitbreiding" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "kan speciale variabele '%s' niet voor indirecte functieaanroep gebruiken" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "functie '%s' wordt gebruikt als array" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "ongeldige index-expressie" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "waarschuwing: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fataal: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "onverwacht regeleinde of einde van string" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kan bronbestand '%s' niet openen om te lezen (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "kan gedeelde bibliotheek '%s' niet openen om te lezen (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "reden onbekend" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "kan '%s' niet invoegen en als programmabestand gebruiken" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "bronbestand '%s' is reeds ingesloten" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "gedeelde bibliotheek '%s' is reeds geladen" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "'@include' is een gawk-uitbreiding" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "lege bestandsnaam na '@include'" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "'@load' is een gawk-uitbreiding" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "lege bestandsnaam na '@load'" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "lege programmatekst op opdrachtregel" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kan bronbestand '%s' niet lezen (%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "bronbestand '%s' is leeg" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "bronbestand eindigt niet met een regeleindeteken (LF)" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "onafgesloten reguliere expressie eindigt met '\\' aan bestandseinde" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: regexp-optie '/.../%c' van 'tawk' werkt niet in gawk" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "regexp-optie '/.../%c' van 'tawk' werkt niet in gawk" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "onafgesloten reguliere expressie" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "onafgesloten reguliere expressie aan bestandseinde" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "gebruik van regelvoortzetting '\\ #...' is niet overdraagbaar" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "backslash is niet het laatste teken op de regel" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX staat operator '**=' niet toe" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "oude 'awk' kent de operator '**=' niet" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX staat operator '**' niet toe" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "oude 'awk' kent de operator '**' niet" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "oude 'awk' kent de operator '^=' niet" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "oude 'awk' kent de operator '^' niet" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "onafgesloten string" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "ongeldig teken '%c' in expressie" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "'%s' is een gawk-uitbreiding" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX staat '%s' niet toe" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "oude 'awk' kent '%s' niet" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "'goto' wordt als schadelijk beschouwd!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d is een ongeldig aantal argumenten voor %s" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: een stringwaarde als laatste vervangingsargument heeft geen effect" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s: derde parameter is geen veranderbaar object" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: derde argument is een gawk-uitbreiding" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: tweede argument is een gawk-uitbreiding" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcgettext(_\"...\") is onjuist: verwijder het liggende streepje" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcngettext(_\"...\") is onjuist: verwijder het liggende streepje" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "" "index: een reguliere-expressie-constante als tweede argument is niet " "toegestaan" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "functie '%s': parameter '%s' schaduwt een globale variabele" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "kan '%s' niet openen om te schrijven (%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "variabelenlijst gaat naar standaardfoutuitvoer" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: sluiten is mislukt (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() twee keer aangeroepen!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "er waren geschaduwde variabelen." -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "functienaam '%s' is al eerder gedefinieerd" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "functie '%s': kan functienaam niet als parameternaam gebruiken" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "functie '%s': kan speciale variabele '%s' niet als functieparameter gebruiken" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "functie '%s': parameter #%d, '%s', dupliceert parameter #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "functie '%s' wordt aangeroepen maar is nergens gedefinieerd" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "functie '%s' is gedefinieerd maar wordt nergens direct aangeroepen" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "regexp-constante als parameter #%d levert booleanwaarde op" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -509,23 +514,23 @@ msgstr "" "functie '%s' wordt aangeroepen met een spatie tussen naam en '(',\n" "of wordt gebruikt als variabele of array" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "deling door nul" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "deling door nul in '%%'" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "kan geen waarde toewijzen aan het resultaat van een post-increment-expressie " "van een veld" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "ongeldig doel van toewijzing (opcode %s)" @@ -567,188 +572,198 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: '%s' is geen open bestand, pijp, of co-proces" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: eerste argument is geen string" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: tweede argument is geen string" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: argument is geen getal" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: argument is een array" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "'length(array)' is een gawk-uitbreiding" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: argument is geen string" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: argument is geen getal" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: argument %g is negatief" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fataal: 'count$' hoort in alle opmaken gebruikt te worden, of in geen" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "veldbreedte wordt genegeerd voor opmaakaanduiding '%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "veldprecisie wordt genegeerd voor opmaakaanduiding '%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "veldbreedte en -precisie worden genegeerd voor opmaakaanduiding '%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fataal: '$' is niet toegestaan in awk-opmaak" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fataal: het aantal argumenten met '$' moet > 0 zijn" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "fataal: argumentental %ld is groter dan het gegeven aantal argumenten" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fataal: '$' is niet toegestaan na een punt in de opmaak" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "fataal: geen '$' opgegeven bij positionele veldbreedte of -precisie" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "'l' is betekenisloos in awk-opmaak; genegeerd" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fataal: 'l' is niet toegestaan in POSIX awk-opmaak" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "'L' is betekenisloos in awk-opmaak; genegeerd" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fataal: 'L' is niet toegestaan in POSIX awk-opmaak" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "'h' is betekenisloos in awk-opmaak; genegeerd" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fataal: 'h' is niet toegestaan in POSIX awk-opmaak" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: waarde %g ligt buiten toegestaan bereik voor opmaak '%%%c'" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: waarde %g ligt buiten toegestaan bereik voor opmaak '%%%c'" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: waarde %g ligt buiten toegestaan bereik voor opmaak '%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "onbekend opmaakteken '%c' wordt genegeerd: geen argument is geconverteerd" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "fataal: niet genoeg argumenten voor opmaakstring" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "niet genoeg ^ voor deze" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: opmaakaanduiding mist een stuurletter" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "te veel argumenten voor opmaakstring" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: geen argumenten" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: geen argumenten" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: argument is geen getal" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: argument %g is negatief" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: lengte %g is niet >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: lengte %g is niet >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: lengte %g is geen integer; wordt afgekapt" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: lengte %g is te groot voor stringindexering; wordt verkort tot %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: startindex %g is ongeldig; 1 wordt gebruikt" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: startindex %g is geen integer; wordt afgekapt" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: bronstring heeft lengte nul" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: startindex %g ligt voorbij het einde van de string" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -756,186 +771,192 @@ msgstr "" "substr: lengte %g bij startindex %g is groter dan de lengte van het eerste " "argument (%lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: opmaakwaarde in PROCINFO[\"strftime\"] is numeriek" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: tweede argument is geen getal" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: tweede argument is kleiner dan nul of te groot voor 'time_t'" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: eerste argument is geen string" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: opmaakstring is leeg" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: argument is geen string" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: minstens één van waarden valt buiten het standaardbereik" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "'system'-functie is niet toegestaan in sandbox-modus" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: argument is geen string" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "verwijzing naar ongeïnitialiseerd veld '$%d'" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: argument is geen string" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: argument is geen string" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: eerste argument is geen getal" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: tweede argument is geen getal" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: argument is geen getal" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: argument is geen getal" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: argument is geen getal" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: derde argument is geen array" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: derde argument is 0; wordt beschouwd als 1" -#: builtin.c:3030 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: derde argument is 0; wordt beschouwd als 1" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: eerste argument is geen getal" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: tweede argument is geen getal" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): negatieve waarden geven rare resultaten" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): cijfers na de komma worden afgekapt" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): te grote opschuifwaarden geven rare resultaten" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: eerste argument is geen getal" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: tweede argument is geen getal" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): negatieve waarden geven rare resultaten" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): cijfers na de komma worden afgekapt" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): te grote opschuifwaarden geven rare resultaten" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: aangeroepen met minder dan twee argumenten" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: argument %d is niet-numeriek" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: negatieve waarde %2$g van argument %1$d geeft rare resultaten" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: aangeroepen met minder dan twee argumenten" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: argument %d is niet-numeriek" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: negatieve waarde %2$g van argument %1$d geeft rare resultaten" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: aangeroepen met minder dan twee argumenten" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: argument %d is niet-numeriek" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: negatieve waarde %2$g van argument %1$d geeft rare resultaten" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: argument is geen getal" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): negatieve waarden geven rare resultaten" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): cijfers na de komma worden afgekapt" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: '%s' is geen geldige taalregio-deelcategorie" @@ -1249,40 +1270,49 @@ msgstr "up [AANTAL] - dit aantal frames naar boven in de stack gaan" msgid "watch var - set a watchpoint for a variable." msgstr "watch VAR - een kijkpunt voor een variabele zetten" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +#, fuzzy +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"backtrace [N] - een trace weergeven van alle of N binnenste frames (of " +"buitenste als N < 0)" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "fout: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "kan commando niet lezen (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "kan commando niet lezen (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "ongeldig teken in commando" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "onbekend commando - \"%.*s\", probeer help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "ongeldig teken" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "ongedefinieerd commando: %s\n" @@ -1811,68 +1841,70 @@ msgstr "'%s' is niet toegestaan in huidige context; statement is genegeerd" msgid "`return' not allowed in current context; statement ignored" msgstr "'return' is niet toegestaan in huidige context; statement is genegeerd" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Geen symbool '%s' in huidige context" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "ongepaarde [" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "ongeldige tekenklasse" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "syntax van tekenklasse is [[:space:]], niet [:space:]" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "onafgemaakte \\-stuurcode" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Ongeldige inhoud van \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "Reguliere expressie is te groot" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "ongepaarde (" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "geen syntax opgegeven" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr "ongepaarde )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "onbekend knooptype %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "onbekende opcode %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "opcode %s is geen operator noch sleutelwoord" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "bufferoverloop in genflags2str()" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1883,215 +1915,215 @@ msgstr "" "\t# Functieaanroepen-stack:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "'IGNORECASE' is een gawk-uitbreiding" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "'BINMODE' is een gawk-uitbreiding" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE-waarde '%s' is ongeldig, wordt behandeld als 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "onjuiste opgave van '%sFMT': '%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "'--lint' wordt uitgeschakeld wegens toewijzing aan 'LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "verwijzing naar ongeïnitialiseerd argument '%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "verwijzing naar ongeïnitialiseerde variabele '%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "veldverwijzingspoging via een waarde die geen getal is" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "veldverwijzingspoging via een lege string" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "toegangspoging tot veld %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "verwijzing naar ongeïnitialiseerd veld '$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "functie '%s' aangeroepen met meer argumenten dan gedeclareerd" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack(): onverwacht type '%s'" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "deling door nul in '/='" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "deling door nul in '%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "uitbreidingen zijn niet toegestaan in sandbox-modus" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / '@load' zijn gawk-uitbreidingen" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: lege bibliotheeknaam ontvangen" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: kan bibliotheek '%s' niet openen (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: bibliotheek '%s' definieert 'plugin_is_GPL_compatible' niet (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: bibliotheek '%s' kan functie '%s' niet aanroepen (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "load_ext: bibliotheek '%s': initialisatiefunctie '%s' is mislukt\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "'extension' is een gawk-uitbreiding" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "uitbreiding: lege bibliotheeknaam ontvangen" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: kan bibliotheek '%s' niet openen (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: bibliotheek '%s' definieert 'plugin_is_GPL_compatible' niet (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: bibliotheek '%s' kan functie '%s' niet aanroepen (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: ontbrekende functienaam" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: kan functie '%s' niet herdefiniëren" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: functie '%s' is al gedefinieerd" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: functienaam '%s' is al eerder gedefinieerd" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: kan in gawk ingebouwde '%s' niet als functienaam gebruiken" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negatief aantal argumenten voor functie '%s'" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: ontbrekende functienaam" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: ongeldig teken '%c' in functienaam '%s'" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: kan functie '%s' niet herdefiniëren" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: functie '%s' is al gedefinieerd" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: functienaam '%s' is al eerder gedefinieerd" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: kan in gawk ingebouwde '%s' niet als functienaam gebruiken" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "" "functie '%s' is gedefinieerd om niet meer dan %d argument(en) te accepteren" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "functie '%s': ontbrekend argument #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "functie '%s': argument #%d: een scalair wordt gebruikt als array" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "functie '%s': argument #%d: een array wordt gebruikt als scalair" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "het dynamisch laden van de bibliotheek wordt niet ondersteund" @@ -2237,7 +2269,7 @@ msgstr "wait: aangeroepen met te veel argumenten" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin(): in-situ-bewerken is al actief" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin(): verwachtte twee argumenten maar is aangeroepen met %d" @@ -2269,56 +2301,56 @@ msgstr "inplace_begin(): '%s' is geen normaal bestand" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin(): mkstemp('%s') is mislukt (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin(): chmod is mislukt (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin(): dup(stdout) is mislukt (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin(): dup2(%d, stdout) is mislukt (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin(): close(%d) is mislukt (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end(): kan eerste argument niet als bestandsnaamstring oppakken" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end(): in-situ-bewerken is niet actief" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end(): dup2(%d, stdout) is mislukt (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end(): close(%d) is mislukt (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end(): fsetpos(stdout) is mislukt (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end(): link('%s', '%s') is mislukt (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end(): rename('%s', '%s') is mislukt (%s)" @@ -2360,50 +2392,54 @@ msgstr "readfile: aangeroepen met te veel argumenten" msgid "readfile: called with no arguments" msgstr "readfile: aangeroepen zonder argumenten" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: aangeroepen met te veel argumenten" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argument 0 is geen string\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argument 1 is geen array\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: kan array niet pletten\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: kan geplet array niet vrijgeven\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: aangeroepen met te veel argumenten" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argument 0 is geen string\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argument 1 is geen array\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array() is mislukt\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element() is mislukt\n" @@ -2432,92 +2468,92 @@ msgstr "sleep: argument is negatief" msgid "sleep: not supported on this platform" msgstr "sleep: wordt op dit platform niet ondersteund" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF is op een negatieve waarde gezet" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: vierde argument is een gawk-uitbreiding" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: vierde argument is geen array" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: tweede argument is geen array" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: hetzelfde array kan niet zowel als tweede als als vierde argument " "gebruikt worden" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: een subarray van het tweede argument kan niet als vierde argument " "gebruikt worden" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: een subarray van het vierde argument kan niet als tweede argument " "gebruikt worden" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: lege string als derde argument is een gawk-uitbreiding" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: vierde argument is geen array" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: tweede argument is geen array" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: derde argument moet niet-nil zijn" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: hetzelfde array kan niet zowel als tweede als als vierde argument " "gebruikt worden" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: een subarray van het tweede argument kan niet als vierde argument " "gebruikt worden" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: een subarray van het vierde argument kan niet als tweede argument " "gebruikt worden" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "'FIELDWIDTHS' is een gawk-uitbreiding" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "ongeldige waarde voor FIELDWIDTHS, nabij '%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "een lege string als 'FS' is een gawk-uitbreiding" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "oude 'awk' staat geen reguliere expressies toe als waarde van 'FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "'FPAT' is een gawk-uitbreiding" @@ -2533,20 +2569,20 @@ msgstr "node_to_awk_value(): lege knoop ontvangen" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value(): lege waarde ontvangen" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element(): leeg array ontvangen" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element(): lege index ontvangen" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array(): kan index %d niet converteren\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array(): kan waarde %d niet converteren\n" @@ -2606,307 +2642,289 @@ msgstr "%s: optie '-W %s' staat geen argument toe\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: optie '-W %s' vereist een argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "opdrachtregelargument '%s' is een map -- overgeslagen" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "kan bestand '%s' niet openen om te lezen (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "sluiten van bestandsdescriptor %d ('%s') is mislukt (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "omleiding is niet toegestaan in sandbox-modus" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "expressie in omleiding '%s' heeft alleen een getal als waarde" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "expressie voor omleiding '%s' heeft een lege string als waarde" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "bestandsnaam '%s' voor omleiding '%s' kan het resultaat zijn van een " "logische expressie" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "onnodige mix van '>' en '>>' voor bestand '%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "kan pijp '%s' niet openen voor uitvoer (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "kan pijp '%s' niet openen voor invoer (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "kan tweerichtings-pijp '%s' niet openen voor in- en uitvoer (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "kan niet omleiden van '%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "kan niet omleiden naar '%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "systeemgrens voor aantal open bestanden is bereikt: begonnen met multiplexen" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "sluiten van '%s' is mislukt (%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "te veel pijpen of invoerbestanden geopend" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: tweede argument moet 'to' of 'from' zijn" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: '%.*s' is geen open bestand, pijp, of co-proces" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "sluiten van een nooit-geopende omleiding" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: omleiding '%s' is niet geopend met '|&'; tweede argument wordt " "genegeerd" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "afsluitwaarde %d bij mislukte sluiting van pijp '%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "afsluitwaarde %d bij mislukte sluiting van bestand '%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "geen expliciete sluiting van socket '%s' aangegeven" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "geen expliciete sluiting van co-proces '%s' aangegeven" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "geen expliciete sluiting van pijp '%s' aangegeven" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "geen expliciete sluiting van bestand '%s' aangegeven" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "fout tijdens schrijven van standaarduitvoer (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "fout tijdens schrijven van standaardfoutuitvoer (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "leegmaken van pijp '%s' is mislukt (%s)" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "leegmaken door co-proces van pijp naar '%s' is mislukt (%s)" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "leegmaken van bestand '%s' is mislukt (%s)" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "lokale poort %s is ongeldig in '/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "host- en poortinformatie (%s, %s) zijn ongeldig" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "geen (bekend) protocol aangegeven in speciale bestandsnaam '%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "speciale bestandsnaam '%s' is onvolledig" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "'/inet' heeft een gindse hostnaam nodig" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "'/inet' heeft een gindse poort nodig" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-communicatie wordt niet ondersteund" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "kan '%s' niet openen -- modus '%s'" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "kan meester-pty van dochterproces niet sluiten (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "kan standaarduitvoer van dochterproces niet sluiten (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "kan slaaf-pty niet overzetten naar standaarduitvoer van dochterproces (dup: " "%s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "kan standaardinvoer van dochterproces niet sluiten (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "kan slaaf-pty niet overzetten naar standaardinvoer van dochterproces (dup: " "%s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "kan slaaf-pty niet sluiten (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "kan pijp niet overzetten naar standaarduitvoer van dochterproces (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "kan pijp niet overzetten naar standaardinvoer van dochterproces (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "kan standaarduitvoer van ouderproces niet herstellen\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "kan standaardinvoer van ouderproces niet herstellen\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "kan pijp niet sluiten (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "'|&' wordt niet ondersteund" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "kan pijp '%s' niet openen (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "kan voor '%s' geen dochterproces starten (fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser(): NULL-pointer gekregen" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "invoer-parser '%s' botst met eerder geïnstalleerde invoer-parser '%s'" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "invoer-parser '%s' kan '%s' niet openen" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper(): NULL-pointer gekregen" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" "uitvoer-wrapper '%s' botst met eerder geïnstalleerde uitvoer-wrapper '%s'" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "uitvoer-wrapper '%s' kan '%s' niet openen" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor(): NULL-pointer gekregen" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2914,213 +2932,200 @@ msgid "" msgstr "" "tweeweg-processor '%s' botst met eerder geïnstalleerde tweeweg-processor '%s'" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "tweeweg-processor '%s' kan '%s' niet openen" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "databestand '%s' is leeg" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "kan geen extra invoergeheugen meer toewijzen" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "een 'RS' van meerdere tekens is een gawk-uitbreiding" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "IPv6-communicatie wordt niet ondersteund" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "argument van '-e/--source' is leeg; genegeerd" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: optie '-W %s' is onbekend; genegeerd\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: optie vereist een argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "omgevingsvariabele 'POSIXLY_CORRECT' is gezet: '--posix' ingeschakeld" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "'--posix' overstijgt '--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "'--posix'/'--traditional' overstijgen '--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "het uitvoeren van %s als 'setuid root' kan een veiligheidsrisico zijn" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "'--posix' overstijgt '--characters-as-bytes'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "kan standaardinvoer niet in binaire modus zetten (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "kan standaarduitvoer niet in binaire modus zetten (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "kan standaardfoutuitvoer niet in binaire modus zetten (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "helemaal geen programmatekst!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Gebruik: %s [opties] -f programmabestand [--] bestand...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" " of: %s [opties] [--] %cprogrammatekst%c bestand...\n" "\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "\tPOSIX-opties:\t\tEquivalente GNU-opties: (standaard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f programmabestand\t--file=programmabestand\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F veldscheidingsteken\t--field-separator=veldscheidingsteken\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" "\t-v var=waarde\t\t--assign=var=waarde\n" "\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "\tKorte opties:\t\tEquivalente GNU-opties: (uitbreidingen)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[bestand]\t\t--dump-variables[=bestand]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[bestand]\t\t--debug[=bestand]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'programmatekst'\t--source='programmatekst'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E bestand\t\t--exec=bestand\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i include-bestand\t\t--include=include-bestand\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l bibliotheek\t\t--load=bibliotheek\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fataal]\t\t--lint[=fataal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[bestand]\t\t--pretty-print[=bestand]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[bestand]\t\t--profile[=bestand]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t\t--parsedebug\n" @@ -3129,7 +3134,7 @@ msgstr "\t-Y\t\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3142,7 +3147,7 @@ msgstr "" "Meld fouten in de vertaling aan .\n" "\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3152,7 +3157,7 @@ msgstr "" "Standaard leest het van standaardinvoer en schrijft naar standaarduitvoer.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3162,7 +3167,7 @@ msgstr "" "\tgawk '{ som += $1 }; END { print som }' bestand\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3180,7 +3185,7 @@ msgstr "" "uitgegeven door de Free Software Foundation, naar keuze ofwel onder\n" "versie 3 of onder een nieuwere versie van die licentie.\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3194,7 +3199,7 @@ msgstr "" "Zie de GNU General Public License voor meer details.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3203,16 +3208,16 @@ msgstr "" "ontvangen te hebben; is dit niet het geval, dan kunt u deze licentie\n" "ook vinden op http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft maakt van FS geen tab in POSIX-awk" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "onbekende waarde voor veldspecificatie: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3221,99 +3226,117 @@ msgstr "" "%s: argument '%s' van '-v' is niet van de vorm 'var=waarde'\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "'%s' is geen geldige variabelenaam" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "'%s' is geen variabelenaam; zoekend naar bestand '%s=%s'" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "kan in gawk ingebouwde '%s' niet als variabelenaam gebruiken" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "kan functie '%s' niet als variabelenaam gebruiken" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "drijvendekomma-berekeningsfout" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "fatale fout: **interne fout**" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "fatale fout: **interne fout**: segmentatiefout" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "fatale fout: **interne fout**: stack is vol" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "geen reeds-geopende bestandsdescriptor %d" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "kan /dev/null niet openen voor bestandsdescriptor %d" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "argument van '-e/--source' is leeg; genegeerd" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: optie '-W %s' is onbekend; genegeerd\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: optie vereist een argument -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "PREC-waarde '%.*s' is ongeldig" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "RNDMODE-waarde '%.*s' is ongeldig" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: niet-numeriek argument ontvangen" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): negatieve waarden geven rare resultaten" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): cijfers na de komma worden afgekapt" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%Zd): negatieve waarden geven rare resultaten" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: niet-numeriek argument #%d ontvangen" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argument #%d heeft ongeldige waarde %Rg; 0 wordt gebruikt" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: negatieve waarde %2$Rg van argument #%1$d geeft rare resultaten" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "" "%s: cijfers na de komma van waarde %2$Rg van argument #%1$d worden afgekapt" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%1$s: negatieve waarde %3$Zd van argument #%2$d geeft rare resultaten" @@ -3323,24 +3346,24 @@ msgstr "%1$s: negatieve waarde %3$Zd van argument #%2$d geeft rare resultaten" msgid "cmd. line:" msgstr "commandoregel:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "backslash aan het einde van de string" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "oude 'awk' kent de stuurcodereeks '\\%c' niet" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX staat stuurcode '\\x' niet toe" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "geen hex cijfers in stuurcodereeks '\\x'" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3349,12 +3372,12 @@ msgstr "" "hexadecimale stuurcode \\x%.*s van %d tekens wordt waarschijnlijk niet " "afgehandeld zoals u verwacht" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "stuurcodereeks '\\%c' behandeld als normale '%c'" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3384,12 +3407,12 @@ msgid "sending profile to standard error" msgstr "profiel gaat naar standaardfoutuitvoer" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s-blok(ken)\n" +"\t# Regel(s)\n" "\n" #: profile.c:198 @@ -3406,11 +3429,11 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "**interne fout**: %s met lege 'vname'" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "**interne fout**: ingebouwde functie met lege 'fname'" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3419,12 +3442,12 @@ msgstr "" "\t# Geladen uitbreidingen ('-l' en/of '@load')\n" "\n" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk-profiel, gemaakt op %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3433,7 +3456,7 @@ msgstr "" "\n" "\t# Functies, alfabetisch geordend\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str(): onbekend omleidingstype %d" @@ -3444,82 +3467,118 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" "component '%.*s' van reguliere expressie moet vermoedelijk '[%.*s]' zijn" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Gelukt" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Geen overeenkomsten" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Ongeldige reguliere expressie" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ongeldig samengesteld teken" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Ongeldige tekenklassenaam" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Backslash aan het eind" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Ongeldige terugverwijzing" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "Ongepaarde [ of [^" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Ongepaarde ( of \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Ongepaarde \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ongeldige inhoud van \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Ongeldig bereikeinde" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Onvoldoende geheugen beschikbaar" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Ongeldige voorafgaande reguliere expressie" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Voortijdig einde van reguliere expressie" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Reguliere expressie is te groot" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Ongepaarde ) of \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Geen eerdere reguliere expressie" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "functie '%s': kan functienaam niet als parameternaam gebruiken" + +#: symbol.c:809 msgid "can not pop main context" msgstr "kan hoofdcontext niet poppen" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "'getline var' is ongeldig binnen een '%s'-regel" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "'getline' is ongeldig binnen een '%s'-regel" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "geen (bekend) protocol aangegeven in speciale bestandsnaam '%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "speciale bestandsnaam '%s' is onvolledig" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "'/inet' heeft een gindse hostnaam nodig" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "'/inet' heeft een gindse poort nodig" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s-blok(ken)\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "" #~ "de betekenis van een bereik van de vorm '[%c-%c]' is afhankelijk van de " #~ "taalregio" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "functie '%s' wordt gebruikt als array" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "verwijzing naar ongeïnitialiseerd element '%s[\"%.*s\"]'" @@ -3598,9 +3657,6 @@ msgstr "kan hoofdcontext niet poppen" #~ msgid "function `%s' not defined" #~ msgstr "functie '%s' is niet gedefinieerd" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "niet-omgeleide 'getline' is ongeldig binnen een '%s'-regel" - #~ msgid "`nextfile' cannot be called from a `%s' rule" #~ msgstr "'nextfile' kan niet aangeroepen worden in een '%s'-regel" diff --git a/po/pl.gmo b/po/pl.gmo index b2c8e5fa..02842916 100644 Binary files a/po/pl.gmo and b/po/pl.gmo differ diff --git a/po/pl.po b/po/pl.po index 95ddbec2..d7f71e93 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-03-22 17:49+0100\n" "Last-Translator: Wojciech Polak \n" "Language-Team: Polish \n" @@ -39,9 +39,9 @@ msgstr "próba użycia parametru `%s' skalaru jako tablicy" msgid "attempt to use scalar `%s' as an array" msgstr "próba użycia skalaru `%s' jako tablicy" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "próba użycia tablicy `%s' w kontekÅ›cie skalaru" @@ -96,417 +96,423 @@ msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "" "asorti: nie można użyć podtablicy drugiego argumentu dla pierwszego argumentu" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "nieprawidÅ‚owa nazwa funkcji `%s'" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "funkcja porównujÄ…ca w sortowaniu `%s' nie zostaÅ‚a zdefiniowna" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "%s bloków musi posiadać część dotyczÄ…cÄ… akcji" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "każda reguÅ‚a musi posiadać wzorzec lub część dotyczÄ…cÄ… akcji" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "stary awk nie wspiera wielokrotnych reguÅ‚ `BEGIN' lub `END'" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "" "`%s' jest funkcjÄ… wbudowanÄ…, wiÄ™c nie może zostać ponownie zdefiniowana" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "staÅ‚e wyrażenie regularne `//' wyglÄ…da jak komentarz C++, ale nim nie jest" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "staÅ‚e wyrażenie regularne `/%s/' wyglÄ…da jak komentarz C, ale nim nie jest" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "powielone wartoÅ›ci case w ciele switch: %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "wykryto powielony `default' w ciele switch" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "instrukcja `break' poza pÄ™tlÄ… lub switch'em jest niedozwolona" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "instrukcja `continue' poza pÄ™tlÄ… jest niedozwolona" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "`next' użyty w akcji %s" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' użyty w akcji %s" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "`return' użyty poza kontekstem funkcji" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "zwykÅ‚y `print' w reguÅ‚ach BEGIN lub END powinien prawdopodobnie być jako " "`print \"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "`delete' nie jest dozwolony z SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "`delete' nie jest dozwolony z FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(tablica)' jest nieprzenoÅ›nym rozszerzeniem tawk" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "wieloetapowe dwukierunkowe linie potokowe nie dziaÅ‚ajÄ…" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "wyrażanie regularne po prawej stronie przypisania" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "wyrażenie regularne po lewej stronie operatora `~' lub `!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" "stary awk nie wspiera sÅ‚owa kluczowego `in', z wyjÄ…tkiem po sÅ‚owie `for'" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "wyrażenie regularne po prawej stronie porównania" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "nieprawidÅ‚owy `getline var' wewnÄ…trz reguÅ‚y `%s'" - -#: awkgram.y:1420 +#: awkgram.y:1411 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "nieprawidÅ‚owy `getline' wewnÄ…trz reguÅ‚y `%s'" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "" +"komenda `getline' bez przekierowania jest nieprawidÅ‚owa wewnÄ…trz reguÅ‚y `%s'" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "" "komenda `getline' bez przekierowania nie jest zdefiniowana wewnÄ…trz akcji END" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "stary awk nie wspiera wielowymiarowych tablic" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "wywoÅ‚anie `length' bez nawiasów jest nieprzenoÅ›ne" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "poÅ›rednie wywoÅ‚ania funkcji sÄ… rozszerzeniem gawk" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "nie można użyć specjalnej zmiennej `%s' do poÅ›redniego wywoÅ‚ania funkcji" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "próba użycia funkcji `%s' jako tablicy" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "nieprawidÅ‚owe wyrażenie indeksowe" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "ostrzeżenie: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatalny błąd: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "niespodziewany znak nowego wiersza lub koÅ„ca Å‚aÅ„cucha" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "nie można otworzyć pliku źródÅ‚owego `%s' do czytania (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "nie można otworzyć współdzielonej biblioteki `%s' do czytania (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "nieznany powód" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "nie można dołączyć `%s' i używać go jako pliku programu" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "plik źródÅ‚owy `%s' jest już załączony" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "biblioteka współdzielona jest już zaÅ‚adowana `%s'" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include jest rozszerzeniem gawk" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "pusta nazwa pliku po @include" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "@load jest rozszerzeniem gawk" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "pusta nazwa pliku po @load" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "pusty tekst programu w linii poleceÅ„" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "nie można otworzyć pliku źródÅ‚owego `%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "plik źródÅ‚owy `%s' jest pusty" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "plik źródÅ‚owy nie posiada na koÅ„cu znaku nowego wiersza" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "niezakoÅ„czone prawidÅ‚owo wyrażenie regularne koÅ„czy siÄ™ znakiem `\\' na " "koÅ„cu pliku" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: modyfikator wyrażenia regularnego `/.../%c' tawk nie dziaÅ‚a w gawk" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "modyfikator wyrażenia regularnego `/.../%c' tawk nie dziaÅ‚a w gawk" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "niezakoÅ„czone wyrażenie regularne" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "niezakoÅ„czone wyrażenie regularne na koÅ„cu pliku" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "użycie `\\ #...' kontynuacji linii nie jest przenoÅ›ne" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "backslash nie jest ostatnim znakiem w wierszu" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX nie zezwala na operator `**='" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "stary awk nie wspiera operatora `**='" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX nie zezwala na operator `**'" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "stary awk nie wspiera operatora `**'" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "operator `^=' nie jest wspierany w starym awk" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "operator `^' nie jest wspierany w starym awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "niezakoÅ„czony Å‚aÅ„cuch" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "nieprawidÅ‚owy znak '%c' w wyrażeniu" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' jest rozszerzeniem gawk" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX nie zezwala na `%s'" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' nie jest wspierany w starym awk" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "`goto' uważane za szkodliwe!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d jest nieprawidÅ‚owe jako liczba argumentów dla %s" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: literaÅ‚ Å‚aÅ„cuchowy jako ostatni argument podstawienia nie ma żadnego " "efektu" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s trzeci parametr nie jest zmiennym obiektem" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: trzeci argument jest rozszerzeniem gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: drugi argument jest rozszerzeniem gawk" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "nieprawidÅ‚owe użycie dcgettext(_\"...\"): usuÅ„ znak podkreÅ›lenia" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "nieprawidÅ‚owe użycie dcngettext(_\"...\"): usuÅ„ znak podkreÅ›lenia" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "index: staÅ‚y regexp jako drugi argument nie jest dozwolony" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funkcja `%s': parametr `%s' zasÅ‚ania globalnÄ… zmiennÄ…" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "nie można otworzyć `%s' do zapisu (%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "wysyÅ‚anie listy zmiennych na standardowe wyjÅ›cie diagnostyczne" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: zamkniÄ™cie nie powiodÅ‚o siÄ™ (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() wywoÅ‚ana podwójnie!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "wystÄ…piÅ‚y przykryte zmienne." -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "nazwa funkcji `%s' zostaÅ‚a zdefiniowana poprzednio" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funkcja `%s': nie można użyć nazwy funkcji jako nazwy parametru" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funkcja `%s': nie można użyć specjalnej zmiennej `%s' jako parametru funkcji" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funkcja `%s': parametr #%d, `%s', powiela parametr #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "funkcja `%s' zostaÅ‚a wywoÅ‚ana, ale nigdy nie zostaÅ‚a zdefiniowana" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "" "funkcja `%s' zostaÅ‚a zdefiniowana, ale nigdy nie zostaÅ‚a wywoÅ‚ana " "bezpoÅ›rednio" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "staÅ‚e wyrażenie regularne dla parametru #%d daje wartość logicznÄ…" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -516,21 +522,21 @@ msgstr "" "`(',\n" "lub użyta jako zmienna lub jako tablica" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "próba dzielenia przez zero" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "próba dzielenia przez zero w `%%'" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "nie można przypisać wartoÅ›ci do wyniku tego wyrażenia" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "nieprawidÅ‚owy cel przypisania (opcode %s)" @@ -570,193 +576,203 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' nie jest ani otwartym plikiem, ani potokiem, ani procesem" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: otrzymano pierwszy argument, który nie jest Å‚aÅ„cuchem" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: otrzymano drugi argument, który nie jest Å‚aÅ„cuchem" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: otrzymano argument, który nie jest liczbÄ…" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: otrzymano argument, który jest tablicÄ…" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(tablica)' jest rozszerzeniem gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: otrzymano argument, który nie jest Å‚aÅ„cuchem" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: otrzymano argument, który nie jest liczbÄ…" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: otrzymano ujemny argument %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatal: należy użyć `count$' we wszystkich formatach lub nic" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "szerokość pola jest ignorowana dla specyfikatora `%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "precyzja jest ignorowana dla specyfikatora `%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "szerokość pola i precyzja sÄ… ignorowane dla specyfikatora `%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal: `$' jest niedozwolony w formatach awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal: argument count z `$' musi być > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "fatal: argument count %ld wiÄ™kszy niż caÅ‚kowita suma argumentów dostarczonych" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal: `$' jest niedozwolony po kropce w formacie" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "fatal: brak `$' dla pozycyjnej szerokoÅ›ci pola lub precyzji" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' jest bezsensowny w formatach awk; zignorowany" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal: `l' jest niedozwolony w formatach POSIX awk" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' jest bezsensowny w formatach awk; zignorowany" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal: `L' jest niedozwolony w formatach POSIX awk" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' jest bezsensowny w formatach awk; zignorowany" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal: `h' jest niedozwolony w formatach POSIX awk" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: wartość %g jest poza zasiÄ™giem dla formatu `%%%c'" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: wartość %g jest poza zasiÄ™giem dla formatu `%%%c'" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: wartość %g jest poza zasiÄ™giem dla formatu `%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "pominiÄ™cie nieznanego formatu specyfikatora znaku `%c': nie skonwertowano " "argumentu" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" "fatal: brak wystarczajÄ…cej liczby argumentów, aby zaspokoić Å‚aÅ„cuch " "formatujÄ…cy" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "zabrakÅ‚o ^" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: specyfikator formatu nie posiada kontrolnej litery" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "zbyt dużo podanych argumentów w Å‚aÅ„cuchu formatujÄ…cym" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: brak argumentów" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: brak argumentów" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: otrzymano argument, który nie jest liczbÄ…" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: wywoÅ‚ana z ujemnym argumentem %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: dÅ‚ugość %g nie jest >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: dÅ‚ugość %g nie jest >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: dÅ‚ugość %g, która nie jest liczbÄ… caÅ‚kowitÄ…, zostanie obciÄ™ta" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: dÅ‚ugość %g zbyt duża dla indeksu Å‚aÅ„cucha, obcinanie do %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: poczÄ…tkowy indeks %g jest nieprawidÅ‚owy, nastÄ…pi użycie 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" "substr: poczÄ…tkowy indeks %g, który nie jest liczbÄ… caÅ‚kowitÄ…, zostanie " "obciÄ™ty" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: Å‚aÅ„cuch źródÅ‚owy ma zerowÄ… dÅ‚ugość" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: poczÄ…tkowy indeks %g leży poza koÅ„cem Å‚aÅ„cucha" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -764,187 +780,193 @@ msgstr "" "substr: dÅ‚ugość %g zaczynajÄ…c od %g przekracza dÅ‚ugość pierwszego argumentu " "(%lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime: wartość formatu w PROCINFO[\"strftime\"] posiada typ numeryczny" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: otrzymano drugi argument, który nie jest liczbÄ…" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: drugi argument mniejszy od 0 lub zbyt duży dla time_t" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: otrzymano pierwszy argument, który nie jest Å‚aÅ„cuchem" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: otrzymano pusty Å‚aÅ„cuch formatujÄ…cy" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: otrzymano argument, który nie jest Å‚aÅ„cuchem" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: przynajmniej jedna z wartoÅ›ci jest poza domyÅ›lnym zakresem" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "funkcja 'system' nie jest dozwolona w trybie piaskownicy" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: otrzymano argument, który nie jest Å‚aÅ„cuchem" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "odwoÅ‚anie do niezainicjowanego pola `$%d'" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: otrzymano argument, który nie jest Å‚aÅ„cuchem" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: otrzymano argument, który nie jest Å‚aÅ„cuchem" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: otrzymano pierwszy argument, który nie jest liczbÄ…" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: otrzymano drugi argument, który nie jest liczbÄ…" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: otrzymano argument, który nie jest liczbÄ…" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: otrzymano argument, który nie jest liczbÄ…" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: otrzymano argument, który nie jest liczbÄ…" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: otrzymano trzeci argument, który nie jest tablicÄ…" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: trzeci argument 0 potraktowany jako 1" -#: builtin.c:3030 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: trzeci argument 0 potraktowany jako 1" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: otrzymano pierwszy argument, który nie jest liczbÄ…" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: otrzymano drugi argument, który nie jest liczbÄ…" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): ujemne wartoÅ›ci spowodujÄ… dziwne wyniki" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): uÅ‚amkowe wartoÅ›ci zostanÄ… obciÄ™te" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): zbyt duża wartość przesuniÄ™cia spowoduje dziwne wyniki" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: otrzymano pierwszy argument, który nie jest liczbÄ…" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: otrzymano drugi argument, który nie jest liczbÄ…" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): ujemne wartoÅ›ci spowodujÄ… dziwne wyniki" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): uÅ‚amkowe wartoÅ›ci zostanÄ… obciÄ™te" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): zbyt duża wartość przesuniÄ™cia spowoduje dziwne wyniki" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: wywoÅ‚ano z mniej niż dwoma argumentami" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: argument %d nie jest liczbÄ…" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argument %d ujemna wartość %g spowoduje dziwne wyniki" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: wywoÅ‚ano z mniej niż dwoma argumentami" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: argument %d nie jest liczbÄ…" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argument %d ujemna wartość %g spowoduje dziwne wyniki" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: wywoÅ‚ano z mniej niż dwoma argumentami" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: argument %d nie jest liczbÄ…" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argument %d ujemna wartość %g spowoduje dziwne wyniki" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: otrzymano argument, który nie jest liczbÄ…" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): ujemne wartoÅ›ci spowodujÄ… dziwne wyniki" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): uÅ‚amkowe wartoÅ›ci zostanÄ… obciÄ™te" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' nie jest prawidÅ‚owÄ… kategoriÄ… lokalizacji" @@ -1224,40 +1246,46 @@ msgstr "" msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "błąd: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "nie można odczytać komendy (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "nie można odczytać komendy (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "nieprawidÅ‚owy znak w komendzie" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "nieznana komenda - \"%.*s\", spróbuj pomoc" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "nieprawidÅ‚owy znak" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "niezdefiniowana komenda: %s\n" @@ -1778,68 +1806,70 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "" "instrukcja `return' nie może być wywoÅ‚ana w tym kontekÅ›cie; zignorowano" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Brak symbolu `%s' w bieżącym kontekÅ›cie" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "[ nie do pary" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "nieprawidÅ‚owa klasa znaku" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "skÅ‚adnia klasy znaku to [[:space:]], a nie [:space:]" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "niedokoÅ„czona sekwencja ucieczki \\" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "NieprawidÅ‚owa zawartość \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "Wyrażenie regularne jest zbyt duże" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "( nie do pary" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "nie podano skÅ‚adni" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr ") nie do pary" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "nieznany typ wÄ™zÅ‚a %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "nieznany opcode %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "opcode %s nie jest operatorem ani sÅ‚owem kluczowym" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "przepeÅ‚nienie bufora w genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1850,216 +1880,216 @@ msgstr "" "\t# Stos WywoÅ‚awczy Funkcji:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' jest rozszerzeniem gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' jest rozszerzeniem gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "wartość BINMODE `%s' jest nieprawidÅ‚owa, przyjÄ™to jÄ… jako 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "zÅ‚a specyfikacja `%sFMT' `%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "wyłączenie `--lint' z powodu przypisania do `LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "odwoÅ‚anie do niezainicjowanego argumentu `%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "odwoÅ‚anie do niezainicjowanej zmiennej `%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "próba odwoÅ‚ania do pola poprzez nienumerycznÄ… wartość" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "próba odwoÅ‚ania z zerowego Å‚aÅ„cucha" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "próba dostÄ™pu do pola %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "odwoÅ‚anie do niezainicjowanego pola `$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" "funkcja `%s' zostaÅ‚a wywoÅ‚ana z wiÄ™kszÄ… iloÅ›ciÄ… argumentów niż zostaÅ‚o to " "zadeklarowane" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: niespodziewany typ `%s'" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "próba dzielenia przez zero w `/='" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "próba dzielenia przez zero w `%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "rozszerzenia nie sÄ… dozwolone w trybie piaskownicy" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load sÄ… rozszerzeniami gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: otrzymano NULL lib_name" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: nie można otworzyć biblioteki `%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: biblioteka `%s': nie definiuje `plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: biblioteka `%s': nie można wywoÅ‚ać funkcji `%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext: funkcja inicjalizujÄ…ca `%s' biblioteki `%s' nie powiodÅ‚a siÄ™\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' jest rozszerzeniem gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension: otrzymano NULL lib_name" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: nie można otworzyć biblioteki `%s' (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: biblioteka `%s': nie definiuje `plugin_is_GPL_compatible' (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: biblioteka `%s': nie można wywoÅ‚ać funkcji `%s' (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: brakujÄ…ca nazwa funkcji" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: nie można zredefiniować funkcji `%s'" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: funkcja `%s' zostaÅ‚a już zdefiniowana" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: nazwa funkcji `%s' zostaÅ‚a zdefiniowana wczeÅ›niej" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "make_builtin: nie można użyć wbudowanej w gawk `%s' jako nazwy funkcji" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: ujemny licznik argumentów dla funkcji `%s'" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: brakujÄ…ca nazwa funkcji" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: nieprawidÅ‚owy znak `%c' w nazwie funkcji `%s'" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: nie można zredefiniować funkcji `%s'" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: funkcja `%s' zostaÅ‚a już zdefiniowana" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: nazwa funkcji `%s' zostaÅ‚a zdefiniowana wczeÅ›niej" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: nie można użyć wbudowanej w gawk `%s' jako nazwy funkcji" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funkcja `%s' zdefiniowana aby pobrać nie wiÄ™cej niż %d argument(ów)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funkcja `%s': brakuje #%d argumentu" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "funkcja `%s': argument #%d: próba użycia skalaru jako tablicy" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "funkcja `%s': argument #%d: próba użycia tablicy jako skalaru" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "dynamiczne Å‚adowanie biblioteki nie jest wspierane" @@ -2203,7 +2233,7 @@ msgstr "wait: wywoÅ‚ana ze zbyt dużą iloÅ›ciÄ… argumentów" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: edycja w miejscu jest już aktywna" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: spodziewano siÄ™ 2 argumentów, a otrzymano %d" @@ -2234,55 +2264,55 @@ msgstr "inplace_begin: `%s' nie jest zwykÅ‚ym plikiem" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: wywoÅ‚anie mkstemp(`%s') nie powiodÅ‚o siÄ™ (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: funkcja chmod nie powiodÅ‚a siÄ™ (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: wywoÅ‚anie dup(stdout) nie powiodÅ‚o siÄ™ (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: wywoÅ‚anie dup2(%d, stdout) nie powiodÅ‚o siÄ™ (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: wywoÅ‚anie close(%d) nie powiodÅ‚o siÄ™ (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "inplace_end: nie można pobrać pierwszego argumentu jako nazwy pliku" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: edycja w miejscu nie jest aktywna" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: wywoÅ‚anie dup2(%d, stdout) nie powiodÅ‚o siÄ™ (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: wywoÅ‚anie close(%d) nie powiodÅ‚o siÄ™ (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: wywoÅ‚anie fsetpos(stdout) nie powiodÅ‚o siÄ™ (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: wywoÅ‚anie link(`%s', `%s') nie powiodÅ‚o siÄ™ (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: wywoÅ‚anie rename(`%s', `%s') nie powiodÅ‚o siÄ™ (%s)" @@ -2324,50 +2354,54 @@ msgstr "readfile: wywoÅ‚ana ze zbyt dużą iloÅ›ciÄ… argumentów" msgid "readfile: called with no arguments" msgstr "readfile: wywoÅ‚ano bez argumentów" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: wywoÅ‚ana ze zbyt dużą iloÅ›ciÄ… argumentów" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argument 0 nie jest tekstem\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argument 1 nie jest tablicÄ…\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: nie można spÅ‚aszczyć tablicy\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: nie można byÅ‚o zwolnić spÅ‚aszczonej tablicy\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: wywoÅ‚ana ze zbyt dużą iloÅ›ciÄ… argumentów" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argument 0 nie jest tekstem\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argument 1 nie jest tablicÄ…\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array nie powiodÅ‚a siÄ™\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element nie powiodÅ‚a siÄ™\n" @@ -2396,88 +2430,88 @@ msgstr "sleep: argument jest ujemny" msgid "sleep: not supported on this platform" msgstr "sleep: funkcja nie jest wspierana na tej platformie" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF ustawiony na wartość ujemnÄ…" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: czwarty argument jest rozszerzeniem gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: czwarty argument nie jest tablicÄ…" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: drugi argument nie jest tablicÄ…" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: nie można użyć tej samej tablicy dla drugiego i czwartego argumentu" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: nie można użyć podtablicy drugiego argumentu dla czwartego argumentu" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: nie można użyć podtablicy czwartego argumentu dla drugiego argumentu" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: zerowy Å‚aÅ„cuch dla trzeciego argumentu jest rozszerzeniem gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: czwarty argument nie jest tablicÄ…" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: drugi argument nie jest tablicÄ…" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: trzeci argument nie może być pusty" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: nie można użyć tej samej tablicy dla drugiego i czwartego argumentu" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: nie można użyć podtablicy drugiego argumentu dla czwartego " "argumentu" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: nie można użyć podtablicy czwartego argumentu dla drugiego " "argumentu" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' jest rozszerzeniem gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "nieprawidÅ‚owa wartość FIELDWIDTHS, w pobliżu `%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "zerowy Å‚aÅ„cuch dla `FS' jest rozszerzeniem gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "stary awk nie wspiera wyrażeÅ„ regularnych jako wartoÅ›ci `FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' jest rozszerzeniem gawk" @@ -2493,20 +2527,20 @@ msgstr "node_to_awk_value: otrzymano null node" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: otrzymano null val" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: otrzymano tablicÄ™ null" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: otrzymano null subscript" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: nie można byÅ‚o skonwertować indeksu %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: nie można byÅ‚o skonwertować wartoÅ›ci %d\n" @@ -2566,318 +2600,300 @@ msgstr "%s: opcja '-W %s' nie może mieć argumentów\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: opcja '-W %s' wymaga argumentu\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "argument linii poleceÅ„ `%s' jest katalogiem: pominiÄ™to" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "nie można otworzyć pliku `%s' do czytania (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "zamkniÄ™cie fd %d (`%s') nie powiodÅ‚o siÄ™ (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "przekierowanie nie jest dozwolone w trybie piaskownicy" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "wyrażenie w przekierowaniu `%s' ma tylko wartość numerycznÄ…" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "wyrażenie dla przekierowania `%s' ma zerowÄ… wartość Å‚aÅ„cucha" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "nazwa pliku `%s' dla przekierowania `%s' może być rezultatem logicznego " "wyrażenia" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "niepotrzebne mieszanie `>' i `>>' dla pliku `%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "nie można otworzyć potoku `%s' jako wyjÅ›cia (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "nie można otworzyć potoku `%s' jako wejÅ›cia (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "nie można otworzyć dwukierunkowego potoku `%s' jako wejÅ›cia/wyjÅ›cia (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "nie można przekierować z `%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "nie można przekierować do `%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "osiÄ…gniÄ™to systemowy limit otwartych plików: rozpoczÄ™cie multipleksowania " "deskryptorów plików" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "zamkniÄ™cie `%s' nie powiodÅ‚o siÄ™ (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "zbyt dużo otwartych potoków lub plików wejÅ›ciowych" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: drugim argumentem musi być `to' lub `from'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" "close: `%.*s' nie jest ani otwartym plikiem, ani potokiem, ani procesem" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "zamkniÄ™cie przekierowania, które nigdy nie zostaÅ‚o otwarte" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: przekierowanie `%s' nie zostaÅ‚o otwarte z `|&', drugi argument " "zignorowany" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "status awarii (%d) podczas zamykania potoku `%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "status awarii (%d) podczas zamykania pliku `%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "brak jawnego zamkniÄ™cia gniazdka `%s'" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "brak jawnego zamkniÄ™cia procesu pomocniczego `%s'" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "brak jawnego zamkniÄ™cia potoku `%s'" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "brak jawnego zamkniÄ™cia pliku `%s'" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "błąd podczas zapisu na standardowe wyjÅ›cie (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "błąd podczas zapisu na standardowe wyjÅ›cie diagnostyczne (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "opróżnienie potoku `%s' nie powiodÅ‚o siÄ™ (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "" "opróżnienie potoku do `%s' przez proces pomocniczy nie powiodÅ‚o siÄ™ (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "opróżnienie pliku `%s' nie powiodÅ‚o siÄ™ (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "nieprawidÅ‚owy lokalny port %s w `/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "informacje o zdalnym hoÅ›cie i porcie sÄ… nieprawidÅ‚owe (%s, %s)" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "nie dostarczono (znanego) protokoÅ‚u w specjalnym pliku `%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "specjalna nazwa pliku `%s' jest niekompletna" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "należy dostarczyć nazwÄ™ zdalnego hosta do `/inet'" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "należy dostarczyć numer zdalnego portu do `/inet'" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "Komunikacja TCP/IP nie jest wspierana" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "nie można otworzyć `%s', tryb `%s'" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "zamkniÄ™cie nadrzÄ™dnego pty nie powiodÅ‚o siÄ™ (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" "zamkniÄ™cie standardowego wyjÅ›cia w procesie potomnym nie powiodÅ‚o siÄ™ (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "przesuniÄ™cie podlegÅ‚ego pty na standardowe wyjÅ›cie w procesie potomnym nie " "powiodÅ‚o siÄ™ (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" "zamkniÄ™cie standardowego wejÅ›cia w procesie potomnym nie powiodÅ‚o siÄ™ (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "przesuniÄ™cie podlegÅ‚ego pty na standardowe wejÅ›cie w procesie potomnym nie " "powiodÅ‚o siÄ™ (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "zamkniÄ™cie podlegÅ‚ego pty nie powiodÅ‚o siÄ™ (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "przesuniÄ™cie potoku na standardowe wyjÅ›cie w procesie potomnym nie powiodÅ‚o " "siÄ™ (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "przesuniÄ™cie potoku na standardowe wejÅ›cie w procesie potomnym nie powiodÅ‚o " "siÄ™ (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "" "odzyskanie standardowego wyjÅ›cia w procesie potomnym nie powiodÅ‚o siÄ™\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "" "odzyskanie standardowego wejÅ›cia w procesie potomnym nie powiodÅ‚o siÄ™\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "zamkniÄ™cie potoku nie powiodÅ‚o siÄ™ (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "`|&' nie jest wspierany" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "nie można otworzyć potoku `%s' (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "nie można utworzyć procesu potomnego dla `%s' (fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: otrzymano wskaźnik NULL" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "parser wejÅ›cia `%s' konfliktuje z poprzednio zainstalowanym parserem `%s'" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "parser wejÅ›cia `%s': nie powiodÅ‚o siÄ™ otwarcie `%s'" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: otrzymano wskaźnik NULL" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" "otoczka wyjÅ›cia `%s' konfliktuje z poprzednio zainstalowanÄ… otoczkÄ… `%s'" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "otoczka wyjÅ›cia `%s': nie powiodÅ‚o siÄ™ otwarcie `%s'" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: otrzymano wskaźnik NULL" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2886,212 +2902,199 @@ msgstr "" "dwukierunkowy procesor `%s' konfliktuje z poprzednio zainstalowanym " "procesorem `%s'" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "dwukierunkowy procesor `%s' zawiódÅ‚ w otwarciu `%s'" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "plik danych `%s' jest pusty" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "nie można zarezerwować wiÄ™cej pamiÄ™ci wejÅ›ciowej" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "wieloznakowa wartość `RS' jest rozszerzeniem gawk" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "Komunikacja IPv6 nie jest wspierana" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "pusty argument dla opcji `-e/--source' zostaÅ‚ zignorowany" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: opcja `-W %s' nierozpoznana i zignorowana\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: opcja musi mieć argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "zmienna Å›rodowiskowa `POSIXLY_CORRECT' ustawiona: `--posix' zostaÅ‚ włączony" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "opcja `--posix' zostanie użyta nad `--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' użyte nad opcjÄ… `--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" "uruchamianie %s setuid root może być problemem pod wzglÄ™dem bezpieczeÅ„stwa" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "opcja `--posix' zostanie użyta nad `--characters-as-bytes'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "nie można ustawić trybu binarnego na standardowym wejÅ›ciu (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "nie można ustawić trybu binarnego na standardowym wyjÅ›ciu (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "nie można ustawić trybu binarnego na wyjÅ›ciu diagnostycznym (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "brak tekstu programu!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Użycie: %s [styl opcji POSIX lub GNU] -f plik_z_programem [--] plik ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Użycie: %s [styl opcji POSIX lub GNU] [--] %cprogram%c plik ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opcje POSIX:\t\tDÅ‚ugie opcje GNU (standard):\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f program\t\t--file=program\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v zmienna=wartość\t--assign=zmienna=wartość\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Krótkie opcje:\t\tDÅ‚ugie opcje GNU: (rozszerzenia)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[plik]\t\t--dump-variables[=plik]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[plik]\t\t--debug[=plik]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'tekst-programu'\t--source='tekst-programu'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E plik\t\t\t--exec=plik\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i plikinclude\t\t--include=plikinclude\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l biblioteka\t\t--load=biblioteka\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[plik]\t\t--pretty-print[=plik]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[plik]\t\t--profile[=plik]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3100,7 +3103,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3113,7 +3116,7 @@ msgstr "" "dokumentacji.\n" "\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3123,7 +3126,7 @@ msgstr "" "Program domyÅ›lnie czyta standardowe wejÅ›cie i zapisuje standardowe wyjÅ›cie.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3133,7 +3136,7 @@ msgstr "" "\tgawk '{ suma += $1 }; END { print suma }' plik\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3152,7 +3155,7 @@ msgstr "" "tej Licencji lub którejÅ› z późniejszych wersji.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3167,7 +3170,7 @@ msgstr "" "PowszechnÄ… LicencjÄ™ PublicznÄ… GNU.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3176,16 +3179,16 @@ msgstr "" "Powszechnej Licencji Publicznej GNU (GNU General Public License);\n" "jeÅ›li zaÅ› nie - odwiedź stronÄ™ http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft nie ustawia FS na znak tabulatora w POSIX awk" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "nieznana wartość dla specyfikacji pola: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3194,98 +3197,116 @@ msgstr "" "%s: argument `%s' dla `-v' nie jest zgodny ze skÅ‚adniÄ… `zmienna=wartość'\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' nie jest dozwolonÄ… nazwÄ… zmiennej" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' nie jest nazwÄ… zmiennej, szukanie pliku `%s=%s'" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "nie można użyć wbudowanej w gawk `%s' jako nazwy zmiennej" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "nie można użyć funkcji `%s' jako nazwy zmiennej" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "wyjÄ…tek zmiennopozycyjny" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "fatalny błąd: wewnÄ™trzny błąd" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "fatalny błąd: wewnÄ™trzny błąd: błąd segmentacji" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "fatalny błąd: wewnÄ™trzny błąd: przepeÅ‚nienie stosu" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "brak już otwartego fd %d" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "nie można otworzyć zawczasu /dev/null dla fd %d" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "pusty argument dla opcji `-e/--source' zostaÅ‚ zignorowany" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: opcja `-W %s' nierozpoznana i zignorowana\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opcja musi mieć argument -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "wartość PREC `%.*s' jest nieprawidÅ‚owa" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "wartość RNDMODE `%.*s' jest nieprawidÅ‚owa" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: otrzymano argument, który nie jest liczbÄ…" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): ujemne wartoÅ›ci spowodujÄ… dziwne wyniki" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): uÅ‚amkowe wartoÅ›ci zostanÄ… obciÄ™te" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): ujemne wartoÅ›ci spowodujÄ… dziwne wyniki" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: otrzymano argument #%d, który nie jest liczbÄ…" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argument #%d ma nieprawidÅ‚owÄ… wartość %Rg, użyto 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: argument #%d ujemna wartość %Rg spowoduje dziwne wyniki" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: argument #%d uÅ‚amkowa wartość %Rg zostanie obciÄ™ta" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: argument #%d ujemna wartość %Zd spowoduje dziwne wyniki" @@ -3295,24 +3316,24 @@ msgstr "%s: argument #%d ujemna wartość %Zd spowoduje dziwne wyniki" msgid "cmd. line:" msgstr "linia poleceÅ„:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "backslash na koÅ„cu Å‚aÅ„cucha" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "stary awk nie wspiera sekwencji ucieczki `\\%c'" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX nie zezwala na sekwencjÄ™ ucieczki `\\x'" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "brak liczb szesnastkowych w sekwencji ucieczki `\\x'" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3321,12 +3342,12 @@ msgstr "" "szesnastkowa sekwencja ucieczki \\x%.*s %d znaków prawdopodobnie nie zostaÅ‚a " "zinterpretowana jak tego oczekujesz" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "sekwencja ucieczki `\\%c' potraktowana jako zwykÅ‚e `%c'" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3354,12 +3375,12 @@ msgid "sending profile to standard error" msgstr "wysyÅ‚anie profilu na standardowe wyjÅ›cie diagnostyczne" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s blok(i)\n" +"\t# ReguÅ‚a(i)\n" "\n" #: profile.c:198 @@ -3376,11 +3397,11 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "wewnÄ™trzny błąd: %s z zerowym vname" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "wewnÄ™trzny błąd: builtin z fname null" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3389,12 +3410,12 @@ msgstr "" "\t# ZaÅ‚adowane rozszerzenia (-l i/lub @load)\n" "\n" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profil programu gawk, utworzony %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3403,7 +3424,7 @@ msgstr "" "\n" "\t# Funkcje, spis alfabetyczny\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: nieznany typ przekierowania %d" @@ -3413,80 +3434,116 @@ msgstr "redir2str: nieznany typ przekierowania %d" msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "komponent regexp `%.*s' powinien być prawdopodobnie `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Sukces" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Brak dopasowania" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "NieprawidÅ‚owe wyrażenie regularne" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "NieprawidÅ‚owy znak porównania" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "NieprawidÅ‚owa nazwa klasy znaku" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "KoÅ„cowy znak backslash" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "NieprawidÅ‚owe odwoÅ‚anie wsteczne" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "Niedopasowany znak [ lub [^" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Niedopasowany znak ( lub \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Niedopasowany znak \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "NieprawidÅ‚owa zawartość \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "NieprawidÅ‚owy koniec zakresu" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Pamięć wyczerpana" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "NieprawidÅ‚owe poprzedzajÄ…ce wyrażenie regularne" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Przedwczesny koniec wyrażenia regularnego" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Wyrażenie regularne jest zbyt duże" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Niedopasowany znak ) lub \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Brak poprzedniego wyrażenia regularnego" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funkcja `%s': nie można użyć nazwy funkcji jako nazwy parametru" + +#: symbol.c:809 msgid "can not pop main context" msgstr "nie można zdjąć głównego kontekstu" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "nieprawidÅ‚owy `getline var' wewnÄ…trz reguÅ‚y `%s'" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "nieprawidÅ‚owy `getline' wewnÄ…trz reguÅ‚y `%s'" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "nie dostarczono (znanego) protokoÅ‚u w specjalnym pliku `%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "specjalna nazwa pliku `%s' jest niekompletna" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "należy dostarczyć nazwÄ™ zdalnego hosta do `/inet'" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "należy dostarczyć numer zdalnego portu do `/inet'" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s blok(i)\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "zasiÄ™g formy `[%c-%c]' jest zależny od lokalizacji" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "próba użycia funkcji `%s' jako tablicy" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "odwoÅ‚anie do niezainicjowanego elementu `%s[\"%.*s\"]'" @@ -3565,11 +3622,6 @@ msgstr "nie można zdjąć głównego kontekstu" #~ msgid "function `%s' not defined" #~ msgstr "funkcja `%s' nie zostaÅ‚a zdefiniowana" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "" -#~ "komenda `getline' bez przekierowania jest nieprawidÅ‚owa wewnÄ…trz reguÅ‚y `" -#~ "%s'" - #~ msgid "error reading input file `%s': %s" #~ msgstr "błąd podczas czytania z pliku `%s': %s" diff --git a/po/sv.gmo b/po/sv.gmo index acc069b3..70c34bbb 100644 Binary files a/po/sv.gmo and b/po/sv.gmo differ diff --git a/po/sv.po b/po/sv.po index 50eb2736..5c53e5f8 100644 --- a/po/sv.po +++ b/po/sv.po @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-09-22 09:12+0200\n" "Last-Translator: Göran Uddeborg \n" "Language-Team: Swedish \n" @@ -39,9 +39,9 @@ msgstr "försök att använda skalärparametern â€%s†som en vektor" msgid "attempt to use scalar `%s' as an array" msgstr "försök att använda skalären â€%s†som en vektor" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "försök att använda vektorn â€%s†i skalärsammanhang" @@ -100,413 +100,418 @@ msgstr "" "asorti: det gÃ¥r inte att använda en delvektor av andra argumentet som första " "argument" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "â€%s†är ogiltigt som ett funktionsnamn" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "jämförelsefunktionen â€%s†för sortering är inte definierad" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "%s-block mÃ¥ste ha en Ã¥tgärdsdel" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "varje regel mÃ¥ste ha ett mönster eller en Ã¥tgärdsdel" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "gamla awk stöder inte flera â€BEGINâ€- eller â€ENDâ€-regler" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "â€%s“ är en inbyggd funktion, den kan inte definieras om" -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "regexp-konstanten \"//\" ser ut som en C++-kommentar men är inte det" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "regexp-konstanten \"/%s/\" ser ut som en C-kommentar men är inte det" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "upprepade case-värden i switch-sats: %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "flera \"default\" upptäcktes i switch-sats" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "\"break\" är inte tillÃ¥tet utanför en slinga eller switch" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "\"continue\" är inte tillÃ¥tet utanför en slinga" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "\"next\" använt i %s-Ã¥tgärd" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "\"nextfile\" använt i %s-Ã¥tgärd" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "\"return\" använd utanför funktion" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "ensamt \"print\" i BEGIN eller END-regel bör troligen vara 'print \"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "â€delete†är inte tillÃ¥tet med SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "â€delete†är inte tillÃ¥tet med FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "\"delete(array)\" är en icke portabel tawk-utökning" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "flerstegs dubbelriktade rör fungerar inte" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "reguljärt uttryck i högerledet av en tilldelning" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "reguljärt uttryck pÃ¥ vänster sida om en \"~\"- eller \"!~\"-operator" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "gamla awk stöder inte operatorn \"**\"" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "reguljärt uttryck i högerledet av en jämförelse" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "\"getline var\" är ogiltigt inuti \"%s\"-regel" - -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" +#: awkgram.y:1411 +#, fuzzy, c-format +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "\"getline är ogiltigt inuti \"%s\"-regel" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "icke omdirigerad \"getline\" odefinierad inuti END-Ã¥tgärd" -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "gamla awk stöder inte flerdimensionella vektorer" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "anrop av \"length\" utan parenteser är inte portabelt" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "indirekta funktionsanrop är en gawk-utökning" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "det gÃ¥r inte att använda specialvariabeln \"%s\" för indirekta fuktionsanrop" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "ogiltig indexuttryck" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "varning: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "ödesdigert: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "oväntat nyradstecken eller slut pÃ¥ strängen" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kan inte öppna källfilen \"%s\" för läsning (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "kan inte öppna det delade biblioteket â€%s†för läsning (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "okänd anledning" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "kan inte inkludera â€%s†och använda den som en programfil" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "inkluderade redan källfilen \"%s\"" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "inkluderade redan det delade biblioteket â€%sâ€" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include är en gawk-utökning" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "tomt filnamn efter @include" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "@load är en gawk-utökning" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "tomt filnamn efter @load" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "tom programtext pÃ¥ kommandoraden" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kan inte läsa källfilen \"%s\" (%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "källfilen \"%s\" är tom" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "källfilen slutar inte med en ny rad" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "oavslutat reguljärt uttryck slutar med \"\\\" i slutet av filen" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: tawk-modifierare för reguljära uttryck \"/.../%c\" fungerar inte i " "gawk" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "tawk-modifierare för reguljära uttryck \"/.../%c\" fungerar inte i gawk" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "oavslutat reguljärt uttryck" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "oavslutat reguljärt uttryck i slutet av filen" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "Användning av \"\\ #...\" för radfortsättning är inte portabelt" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "sista tecknet pÃ¥ raden är inte ett omvänt snedstreck" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX tillÃ¥ter inte operatorn \"**=\"" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "gamla awk stöder inte operatorn \"**=\"" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX tillÃ¥ter inte operatorn \"**\"" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "gamla awk stöder inte operatorn \"**\"" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "operatorn \"^=\" stöds inte i gamla awk" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "operatorn \"^\" stöds inte i gamla awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "oavslutad sträng" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "ogiltigt tecken \"%c\" i uttryck" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "\"%s\" är en gawk-utökning" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX tillÃ¥ter inte \"%s\"" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "\"%s\" stöds inte i gamla awk" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "\"goto\" anses skadlig!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d är ett ogiltigt antal argument för %s" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: bokstavlig sträng som sista argument till ersättning har ingen effekt" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s: tredje argumentet är inte ett ändringsbart objekt" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: tredje argumentet är en gawk-utökning" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: andra argumentet är en gawk-utökning" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande " "understrykningstecknet" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "användandet av dcngettext(_\"...\") är felaktigt: ta bort det inledande " "understrykningstecknet" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "index: reguljäruttryck som andra argumentet är inte tillÃ¥tet" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funktionen \"%s\": parametern \"%s\" överskuggar en global variabel" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "kunde inte öppna \"%s\" för skrivning (%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "skickar variabellista till standard fel" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: misslyckades att stänga (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() anropad tvÃ¥ gÃ¥nger!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "det fanns överskuggade variabler." -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funktionen \"%s\": kan inte använda funktionsnamn som parameternamn" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funktionen \"%s\": det gÃ¥r inte att använda specialvariabeln \"%s\" som en " "funktionsparameter" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "funktionen \"%s\" anropad men aldrig definierad" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "funktionen \"%s\" definierad men aldrig anropad direkt" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "konstant reguljärt uttryck för parameter %d ger ett booleskt värde" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -515,23 +520,23 @@ msgstr "" "funktionen \"%s\" anropad med blanktecken mellan namnet och \"(\",\n" "eller använd som variabel eller vektor" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "försökte dividera med noll" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "försökte dividera med noll i \"%%\"" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "kan inte tilldela ett värde till uttryck som är en efterinkrementering av " "ett fält" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "ogiltigt mÃ¥l för tilldelning (op-kod %s)" @@ -571,189 +576,199 @@ msgstr "" msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: \"%s\" är inte en öppen fil, rör eller koprocess" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: första argumentet är inte en sträng" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: andra argumentet är inte en sträng" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: fick ett ickenumeriskt argument" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: fick ett vektorargument" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "\"length(array)\" är en gawk-utökning" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: fick ett argument som inte är en sträng" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: fick ett ickenumeriskt argument" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: fick ett negativt argumentet %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "ödesdigert: mÃ¥ste använda \"count$\" pÃ¥ alla eller inga format" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "fältbredd ignoreras för \"%%\"-specificerare" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "precision ignoreras för \"%%\"-specificerare" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "fältbredd och precision ignoreras för \"%%\"-specificerare" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "ödesdigert: \"$\" tillÃ¥ts inte i awk-format" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "ödesdigert: argumentantalet med \"$\" mÃ¥ste vara > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "ödesdigert: argumentantalet %ld är större än antalet givna argument" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "ödesdigert: \"$\" tillÃ¥ts inte efter en punkt i formatet" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "ödesdigert: inget \"$\" bifogat för positionsangiven fältbredd eller " "precision" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "\"l\" är meningslös i awk-format, ignorerad" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "ödesdigert: \"l\" tillÃ¥ts inte i POSIX awk-format" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "\"L\" är meningslös i awk-format, ignorerad" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "ödesdigert: \"L\" tillÃ¥ts inte i POSIX awk-format" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "\"h\" är meningslös i awk-format, ignorerad" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "ödesdigert: \"h\" tillÃ¥ts inte i POSIX awk-format" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: värdet %g är utanför \"%%%c\"-formatets giltiga intervall" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: värdet %g är utanför \"%%%c\"-formatets giltiga intervall" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: värdet %g är utanför \"%%%c\"-formatets giltiga intervall" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "ignorerar okänt formatspecifikationstecken \"%c\": inget argument konverterat" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "ödesdigert: för fÃ¥ argument för formatsträngen" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ tog slut här" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: formatspecificeraren har ingen kommandobokstav" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "för mÃ¥nga argument för formatsträngen" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: inga argument" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: inga argument" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: fick ickenumeriskt argument" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: anropad med negativt argument %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: längden %g är inte >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: längden %g är inte >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: längden %g som inte är ett heltal kommer huggas av" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: längden %g är för stor för strängindexering, huggas av till %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: startindex %g är ogiltigt, använder 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: startindex %g som inte är ett heltal kommer huggas av" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: källsträngen är tom" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: startindex %g är bortom strängens slut" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -761,186 +776,192 @@ msgstr "" "substr: längden %g vid startindex %g överskrider det första argumentets " "längd (%lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: formatvärde i PROCINFO[\"strftime\"] har numerisk typ" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: fick ett ickenumeriskt andra argument" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: andra argumentet mindre än 0 eller för stort för time_t" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: fick ett första argument som inte är en sträng" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: fick en tom formatsträng" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: fick ett argument som inte är en sträng" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: Ã¥tminstone ett av värdena är utanför standardintervallet" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "funktionen \"system\" är inte tillÃ¥ten i sandlÃ¥deläge" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: fick ett argument som inte är en sträng" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "referens till icke initierat fält \"$%d\"" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: fick ett argument som inte är en sträng" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: fick ett argument som inte är en sträng" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: fick ett ickenumeriskt första argument" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: fick ett ickenumeriskt andra argument" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: fick ett ickenumeriskt argument" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: fick ett ickenumeriskt argument" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: fick ett ickenumeriskt argument" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: tredje argumentet är inte en vektor" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: nollan i tredje argumentet behandlad som en etta" -#: builtin.c:3030 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: nollan i tredje argumentet behandlad som en etta" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: fick ett ickenumeriskt första argument" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: fick ett ickenumeriskt andra argument" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): negativa värden kommer ge konstiga resultat" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): flyttalsvärden kommer huggas av" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): för stort skiftvärde kommer ge konstiga resultat" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: fick ett ickenumeriskt första argument" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: fick ett ickenumeriskt andra argument" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): negativa värden kommer ge konstiga resultat" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): flyttalsvärden kommer huggas av" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): för stor skiftvärde kommer ge konstiga resultat" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: anropad med mindre än tvÃ¥ argument" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: argument %d är inte numeriskt" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argument %d med negativt värde %g kommer ge konstiga resultat" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: anropad med färre än tvÃ¥ argument" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: argument %d är inte numeriskt" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argument %d med negativt värde %g kommer ge konstiga resultat" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: anropad med färre än tvÃ¥ argument" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: argument %d är inte numeriskt" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argument %d med negativt värde %g kommer ge konstiga resultat" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: fick ett ickenumeriskt argument" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): negativt värde kommer ge konstiga resultat" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): flyttalsvärde kommer huggas av" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: \"%s\" är inte en giltig lokalkategori" @@ -1238,40 +1259,49 @@ msgstr "up [N] - flytta N ramar uppÃ¥t i stacken." msgid "watch var - set a watchpoint for a variable." msgstr "watch var - sätt en observationspunkt för en variabel." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +#, fuzzy +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"backtrace [N] - skriv ett spÃ¥r över alla eller N innersta (yttersta om N < " +"0) ramar." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "fel: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "kan inte läsa kommando (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "kan inte läsa kommandot (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "ogiltigt tecken i kommandot" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "okänt kommando - \"%.*s\", försök med help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "ogiltigt tecken" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "odefinierat kommando: %s\n" @@ -1800,68 +1830,70 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "" "â€return†är inte tillÃ¥tet i det aktuella sammanhanget; satsen ignoreras" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Ingen symbol â€%s†i aktuell omgivning" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "obalanserad [" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "ogiltig teckenklass" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "syntaxen för teckenklass är [[:space:]], inte [:space:]" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "oavslutad \\-följd" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Ogiltigt innehÃ¥ll i \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "Reguljärt uttryck för stort" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "obalanserad (" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "ingen syntax angiven" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr "obalanserad )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "okänd nodtyp %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "okänd op-kod %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "op-kod %s är inte en operator eller ett nyckelord" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "buffertöverflöd i genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1872,216 +1904,216 @@ msgstr "" "\t# Funktionsanropsstack:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "\"IGNORECASE\" är en gawk-utökning" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "\"BINMODE\" är en gawk-utökning" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE-värde \"%s\" är ogiltigt, behandlas som 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "felaktig \"%sFMT\"-specifikation \"%s\"" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "slÃ¥r av \"--lint\" pÃ¥ grund av en tilldelning till \"LINT\"" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referens till icke initierat argument \"%s\"" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "referens till icke initierad variabel \"%s\"" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "försök att fältreferera frÃ¥n ickenumeriskt värde" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "försök till fältreferens frÃ¥n en tom sträng" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "försök att komma Ã¥t fält nummer %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "referens till icke initierat fält \"$%ld\"" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funktionen \"%s\" anropad med fler argument än vad som deklarerats" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: oväntad typ \"%s\"" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "försökte dividera med noll i \"/=\"" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "försökte dividera med noll i \"%%=\"" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "utökningar är inte tillÃ¥tna i sandlÃ¥deläge" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load är gawk-utökningar" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: mottog NULL-lib_name" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: kan inte öppna biblioteket â€%s†(%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: biblioteket â€%sâ€: definierar inte â€plugin_is_GPL_compatible†(%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: biblioteket â€%sâ€: kan inte anropa funktionen â€%s†(%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext: initieringsrutinen â€%2$s†i biblioteket â€%1$s†misslyckades\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "\"extension\" är en gawk-utökning" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "utökning: mottog NULL-lib_name" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: kan inte öppna biblioteket â€%s†(%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: biblioteket â€%sâ€: definierar inte â€plugin_is_GPL_compatible†(%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: biblioteket â€%sâ€: kan inte anropa funktionen â€%s†(%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: funktionsnamn saknas" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: det gÃ¥r inte att definiera om funktionen â€%sâ€" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: funktionen â€%s†är redan definierad" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: funktionsnamnet â€%s†är definierat sedan tidigare" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: kan inte använda gawks inbyggda â€%s†som ett funktionsnamn" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negativt argumentantal för funktionen \"%s\"" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: saknar funktionsnamn" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: ogiltigt tecken \"%c\" i funktionsnamnet \"%s\"" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: det gÃ¥r inte att definiera om funktionen \"%s\"" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: funktionen \"%s\" är redan definierad" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: funktionsnamnet \"%s\" är definierat sedan tidigare" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: kan inte använda gawks inbyggda \"%s\" som ett funktionsnamn" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funktionen \"%s\" definierades för att ta maximalt %d argument" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funktionen \"%s\": argument %d saknas" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "funktionen \"%s\": argument %d: försök att använda skalär som vektor" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "funktionen \"%s\": argument %d: försök att använda vektor som skalär" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "dynamisk laddning av bibliotek stödjs inte" @@ -2225,7 +2257,7 @@ msgstr "wait: anropad med för mÃ¥nga argument" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: redigering pÃ¥ plats är redan aktivt" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: förväntar sig 2 argument men anropad med %d" @@ -2255,55 +2287,55 @@ msgstr "inplace_begin: â€%s†är inte en vanlig fil" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(â€%sâ€) misslyckades (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: chmod misslyckades (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(standard ut) misslyckades (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, standard ut) misslyckades (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) misslyckades (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "inplace_end: kan inte hämta 1:a argumentet som en filnamnssträng" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: redigering pÃ¥ plats är inte aktivt" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, standard ut) misslyckades (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) misslyckades (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(standard ut) misslyckades (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(â€%sâ€, â€%sâ€) misslyckades (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(â€%sâ€, â€%sâ€) misslyckades (%s)" @@ -2345,50 +2377,54 @@ msgstr "readfile: anropad med för mÃ¥nga argument" msgid "readfile: called with no arguments" msgstr "readfile: anropad utan argument" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: anropad med för mÃ¥nga argument" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argument 0 är inte en sträng\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argument 1 är inte en vektor\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: kunde inte platta till vektor\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: kunde inte släppa en tillplattad vektor\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: anropad med för mÃ¥nga argument" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argument 0 är inte en sträng\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argument 1 är inte en vektor\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array misslyckades\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element misslyckades\n" @@ -2417,90 +2453,90 @@ msgstr "sleep: argumentet är negativt" msgid "sleep: not supported on this platform" msgstr "sleep: stödjs inte pÃ¥ denna plattform" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF satt till ett negativt värde" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: fjärde argumentet är en gawk-utökning" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: fjärde argumentet är inte en vektor" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: andra argumentet är inte en vektor" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: det gÃ¥r inte att använda samma vektor som andra och fjärde argument" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: det gÃ¥r inte att använda en delvektor av andra argumentet som fjärde " "argument" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: det gÃ¥r inte att använda en delvektor av fjärde argumentet som andra " "argument" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: tom sträng som tredje argument är en gawk-utökning" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: fjärde argumentet är inte en vektor" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: andra argumentet är inte en vektor" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: tredje argumentet fÃ¥r inte vara tomt" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: det gÃ¥r inte att använda samma vektor som andra och fjärde argument" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: det gÃ¥r inte att använda en delvektor av andra argumentet som " "fjärde argument" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: det gÃ¥r inte att använda en delvektor av fjärde argumentet som " "andra argument" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "\"FIELDWIDTHS\" är en gawk-utökning" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "ogiltigt FIELDWITHS-värde i närheten av \"%s\"" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "tom sträng som \"FS\" är en gawk-utökning" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "gamla awk stöder inte reguljära uttryck som värden pÃ¥ \"FS\"" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "\"FPAT\" är en gawk-utökning" @@ -2516,20 +2552,20 @@ msgstr "node_to_awk_value: mottog null-nod" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: mottog null-värde" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: fick en null-vektor" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: mottog null-index" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: kunde inte konvertera index %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: kunde inte konvertera värdet %d\n" @@ -2589,288 +2625,269 @@ msgstr "%s: flaggan \"-W %s\" tillÃ¥ter inte nÃ¥got argument\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: flaggan \"-W %s\" kräver ett argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "kommandoradsargumentet \"%s\" är en katalog: hoppas över" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "kan inte öppna filen \"%s\" för läsning (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "stängning av fd %d (\"%s\") misslyckades (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "omdirigering är inte tillÃ¥ten i sandlÃ¥deläge" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "uttrycket i \"%s\"-omdirigering har bara numeriskt värde" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "uttrycket för \"%s\"-omdirigering har en tom sträng som värde" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "filnamnet \"%s\" för \"%s\"-omdirigering kan vara resultatet av ett logiskt " "uttryck" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "onödig blandning av \">\" och \">>\" för filen \"%.*s\"" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "kan inte öppna röret \"%s\" för utmatning (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "kan inte öppna röret \"%s\" för inmatning (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "kan inte öppna tvÃ¥vägsröret \"%s\" för in-/utmatning (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "kan inte dirigera om frÃ¥n \"%s\" (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "kan inte dirigera om till \"%s\" (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "nÃ¥dde systembegränsningen för öppna filer: börjar multiplexa fildeskriptorer" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "stängning av \"%s\" misslyckades (%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "för mÃ¥nga rör eller indatafiler öppna" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: andra argumentet mÃ¥ste vara \"to\" eller \"from\"" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: \"%.*s\" är inte en öppen fil, rör eller koprocess" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "stängning av omdirigering som aldrig öppnades" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: omdirigeringen \"%s\" öppnades inte med \"|&\", andra argumentet " "ignorerat" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "felstatus (%d) frÃ¥n rörstängning av \"%s\" (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "felstatus (%d) frÃ¥n filstängning av \"%s\" (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ingen explicit stängning av uttaget \"%s\" tillhandahÃ¥llen" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "ingen explicit stängning av koprocessen \"%s\" tillhandahÃ¥llen" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "ingen explicit stängning av röret \"%s\" tillhandahÃ¥llen" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ingen explicit stängning av filen \"%s\" tillhandahÃ¥llen" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "fel vid skrivning till standard ut (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "fel vid skrivning till standard fel (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "rörspolning av \"%s\" misslyckades (%s)" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "filspolning av \"%s\" misslyckades (%s)" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "lokal port %s ogiltig i \"/inet\"" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "ogiltig information (%s, %s) för fjärrvärd och fjärrport" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" -"inget (känt) protokoll tillhandahÃ¥llet i det speciella filnamnet \"%s\"" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "speciellt filnamn \"%s\" är ofullständigt" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "mÃ¥ste tillhandahÃ¥lla ett fjärrdatornamn till \"/inet\"" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "mÃ¥ste tillhandahÃ¥lla en fjärrport till \"/inet\"" - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-kommunikation stöds inte" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "kunde inte öppna \"%s\", läge \"%s\"" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "stängning av huvudpty misslyckades (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "stängning av standard ut i barnet misslyckades (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "flyttandet av slavpty till standard ut i barnet misslyckades (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "stängning av standard in i barnet misslyckades (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "flyttandet av slavpty till standard in i barnet misslyckades (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "stängning av slavpty misslyckades (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "flyttande av rör till standard ut i barnet misslyckades (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "flyttande av rör till standard in i barnet misslyckades (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "Ã¥terställande av standard ut i föräldraprocessen misslyckades\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "Ã¥terställande av standard in i föräldraprocessen misslyckades\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "stängning av röret misslyckades (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "\"|&\" stöds inte" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "kan inte öppna röret \"%s\" (%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "kan inte skapa barnprocess för \"%s\" (fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: mottog NULL-pekare" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "inmatningstolken â€%s†stÃ¥r i konflikt med tidigare installerad " "inmatningstolk â€%sâ€" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "inmatningstolken â€%s†misslyckades att öppna â€%sâ€" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: mottog NULL-pekare" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" @@ -2878,16 +2895,16 @@ msgstr "" "utmatningsomslag â€%s†stÃ¥r i konflikt med tidigare installerat " "utmatningsomslag â€%sâ€" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "utmatningsomslag â€%s†misslyckades att öppna â€%sâ€" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: mottog NULL-pekare" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2896,210 +2913,197 @@ msgstr "" "tvÃ¥vägsprocessorn â€%s†stÃ¥r i konflikt med tidigare installerad " "tvÃ¥vägsprocessor â€%sâ€" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "tvÃ¥vägsprocessorn â€%s†misslyckades att öppna â€%sâ€" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "datafilen \"%s\" är tom" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "kunde inte allokera mer indataminne" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "flerteckensvärdet av \"RS\" är en gawk-utökning" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "IPv6-kommunikation stöds inte" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "tomt argument till \"-e/--source\" ignorerat" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: flaggan kräver ett argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "miljövariabeln \"POSIXLY_CORRECT\" satt: slÃ¥r pÃ¥ \"--posix\"" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "\"--posix\" Ã¥sidosätter \"--traditional\"" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "\"--posix\"/\"--traditional\" Ã¥sidosätter \"--non-decimal-data\"" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "att köra %s setuid root kan vara ett säkerhetsproblem" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "â€--posix†åsidosätter â€--character-as-bytesâ€" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "kan inte sätta binärläge pÃ¥ standard in (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "kan inte sätta binärläge pÃ¥ standard ut (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "kan inte sätta binärläge pÃ¥ standard fel (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "ingen programtext alls!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Användning: %s [POSIX- eller GNU-stilsflaggor] -f progfil [--] fil ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Användning: %s [POSIX- eller GNU-stilsflaggor] %cprogram%c fil ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX-flaggor:\t\tGNU lÃ¥nga flaggor: (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f progfil\t\t--file=progfil\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=värde\t\t--assign=var=värde\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Korta flaggor:\t\tGNU lÃ¥nga flaggor: (utökningar)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[fil]\t\t\t--dump-variables[=fil]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[fil]\t\t\t--debug[=fil]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'programtext'\t--source='programtext'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E fil\t\t\t--exec=fil\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i inkluderingsfil\t--include=inkluderingsfil\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l bibliotek\t\t--load=bibliotek\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[fil]\t\t\t--pretty-print[=fil]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[fil]\t\t\t--profile[=fil]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3108,7 +3112,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3122,7 +3126,7 @@ msgstr "" "Rapportera synpunkter pÃ¥ översättningen till .\n" "\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3132,7 +3136,7 @@ msgstr "" "Normalt läser det frÃ¥n standard in och skriver till standard ut.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3142,7 +3146,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' fil\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3161,7 +3165,7 @@ msgstr "" "nÃ¥gon senare version.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3175,7 +3179,7 @@ msgstr "" "General Public License för ytterligare information.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3183,114 +3187,132 @@ msgstr "" "Du bör ha fÃ¥tt en kopia av GNU General Public License tillsammans\n" "med detta program. Om inte, se http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft sätter inte FS till tab i POSIX-awk" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "okänt värde till fältspecifikation: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "%s: Argumentet \"%s\" till \"-v\" är inte pÃ¥ formatet \"var=värde\"\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "\"%s\" är inte ett giltigt variabelnamn" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "\"%s\" är inte ett variabelnamn, letar efter filen \"%s=%s\"" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "kan inte använda gawks inbyggda \"%s\" som ett funktionsnamn" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "kan inte använda funktionen \"%s\" som variabelnamn" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "flyttalsundantag" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "ödesdigert fel: internt fel" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "ödesdigert fel: internt fel: segmenteringsfel" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "ödesdigert fel: internt fel: stackspill" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "ingen föröppnad fd %d" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "kunde inte föröppna /dev/null för fd %d" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "tomt argument till \"-e/--source\" ignorerat" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flaggan kräver ett argument -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "PREC-värdet â€%.*s†är ogiltigt" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "RNDMODE-värdet â€%.*s†är ogiltigt" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: fick ett ickenumeriskt argument" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): negativt värde kommer ge konstiga resultat" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): flyttalsvärden kommer huggas av" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): negativt värde kommer ge konstiga resultat" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: fick ett ickenumeriskt argument nr. %d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argument nr. %d har ogiltigt värde %Rg, använder 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: argument nr. %d negativa värde %Rg kommer ge konstiga resultat" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: argument nr. %d flyttalsvärde %Rg kommer huggas av" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: argument nr. %d negativa värde %Zd kommer ge konstiga resultat" @@ -3300,24 +3322,24 @@ msgstr "%s: argument nr. %d negativa värde %Zd kommer ge konstiga resultat" msgid "cmd. line:" msgstr "kommandorad:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "omvänt snedstreck i slutet av strängen" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "gamla awk stöder inte kontrollsekvensen \"\\%c\"" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX tillÃ¥ter inte \"\\x\"-kontrollsekvenser" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "inga hexadecimala siffror i \"\\x\"-kontrollsekvenser" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3326,12 +3348,12 @@ msgstr "" "hexkod \\x%.*s med %d tecken tolkas förmodligen inte pÃ¥ det sätt du " "förväntar dig" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "kontrollsekvensen \"\\%c\" behandlad som bara \"%c\"" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3359,12 +3381,12 @@ msgid "sending profile to standard error" msgstr "skickar profilen till standard fel" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s-block\n" +"\t# Regel/regler\n" "\n" #: profile.c:198 @@ -3381,11 +3403,11 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "internt fel: %s med null vname" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "internt fel: inbyggd med tomt fname" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3394,12 +3416,12 @@ msgstr "" "\t# Laddade utvidgningar (-l och/eller @load)\n" "\n" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawkprofil, skapad %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3408,7 +3430,7 @@ msgstr "" "\n" "\t# Funktioner, listade alfabetiskt\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: okänd omdirigeringstyp %d" @@ -3419,70 +3441,107 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" "komponenten \"%.*s\" i reguljäruttryck skall förmodligen vara \"[%.*s]\"" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Lyckades" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Misslyckades" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Ogiltigt reguljärt uttryck" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ogiltigt kollationeringstecken" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Ogiltigt teckenklassnamn" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Eftersläpande omvänt snedstreck" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Ogiltig bakÃ¥trerefens" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "Obalanserad [ eller [^" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Obalanserad ( eller \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Obalanserad \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ogiltigt innehÃ¥ll i \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Ogiltigt omfÃ¥ngsslut" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Minnet slut" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Ogiltigt föregÃ¥ende reguljärt uttryck" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "För tidigt slut pÃ¥ reguljärt uttryck" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Reguljärt uttryck för stort" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Obalanserad ) eller \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Inget föregÃ¥ende reguljärt uttryck" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funktionen \"%s\": kan inte använda funktionsnamn som parameternamn" + +#: symbol.c:809 msgid "can not pop main context" msgstr "kan inte poppa huvudsammanhang" + +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "\"getline var\" är ogiltigt inuti \"%s\"-regel" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "inget (känt) protokoll tillhandahÃ¥llet i det speciella filnamnet \"%s\"" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "speciellt filnamn \"%s\" är ofullständigt" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "mÃ¥ste tillhandahÃ¥lla ett fjärrdatornamn till \"/inet\"" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "mÃ¥ste tillhandahÃ¥lla en fjärrport till \"/inet\"" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s-block\n" +#~ "\n" diff --git a/po/vi.gmo b/po/vi.gmo index 10c710dc..3d4f023d 100644 Binary files a/po/vi.gmo and b/po/vi.gmo differ diff --git a/po/vi.po b/po/vi.po index faa458a1..2bd6f429 100644 --- a/po/vi.po +++ b/po/vi.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk-4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-02-26 20:05+0200\n" "PO-Revision-Date: 2014-01-16 14:52+0700\n" "Last-Translator: Trần Ngá»c Quân \n" "Language-Team: Vietnamese \n" @@ -40,9 +40,9 @@ msgstr "cố dùng tham số vô hướng “%s†như là mảng" msgid "attempt to use scalar `%s' as an array" msgstr "cố dùng “%s†vô hướng như là mảng" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2092 builtin.c:2106 eval.c:1149 eval.c:1153 +#: eval.c:1558 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "cố gắng dùng mảng “%s†trong má»™t ngữ cảnh vô hướng" @@ -101,422 +101,427 @@ msgstr "" "asorti (má»™t chương trình xắp xếp thứ tá»±): không thể sá»­ dụng mảng con cá»§a " "tham số thứ hai cho tham số thứ nhất" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "“%s†không phải là tên hàm hợp lệ" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "chưa định nghÄ©a hàm so sánh xắp xếp “%sâ€" -#: awkgram.y:233 +#: awkgram.y:226 #, c-format msgid "%s blocks must have an action part" msgstr "Má»i khối %s phải có má»™t phần kiểu hành động" -#: awkgram.y:236 +#: awkgram.y:229 msgid "each rule must have a pattern or an action part" msgstr "Má»i quy tắc phải có má»™t mẫu hay phần kiểu hành động" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:320 awkgram.y:331 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "" "awk cÅ© không há»— trợ nhiá»u quy tắc kiểu “BEGIN†(bắt đầu) hay “END†(kết thúc)" -#: awkgram.y:373 +#: awkgram.y:368 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "“%s†là má»™t hàm có sẵn nên nó không thể được định nghÄ©a lại." -#: awkgram.y:419 +#: awkgram.y:417 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "hằng biểu thức chính quy “//†trông giống như má»™t chú thích C++, nhưng mà " "không phải" -#: awkgram.y:423 +#: awkgram.y:421 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "hằng biểu thức chính quy “/%s/†trông giống như má»™t chú thích C, nhưng mà " "không phải" -#: awkgram.y:515 +#: awkgram.y:513 #, c-format msgid "duplicate case values in switch body: %s" msgstr "gặp giá trị case trùng trong thân chuyển đổi (switch body): %s" -#: awkgram.y:536 +#: awkgram.y:534 msgid "duplicate `default' detected in switch body" msgstr "" "đã phát hiện trùng “default†trong thân cấu trúc Ä‘iá»u khiển chá»n lá»±a (switch)" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:794 awkgram.y:3751 msgid "`break' is not allowed outside a loop or switch" msgstr "" "không cho phép “break†(ngắt) nằm ở ngoại vòng lặp hay cấu trúc chá»n lá»±a" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:803 awkgram.y:3743 msgid "`continue' is not allowed outside a loop" msgstr "không cho phép “continue†(tiếp tục) ở ngoài má»™t vòng lặp" -#: awkgram.y:815 +#: awkgram.y:813 #, c-format msgid "`next' used in %s action" msgstr "“next†(kế tiếp) được dùng trong hành động %s" -#: awkgram.y:824 +#: awkgram.y:822 #, c-format msgid "`nextfile' used in %s action" msgstr "“nextfile†(tập tin kế tiếp) được dùng trong hành động %s" -#: awkgram.y:848 +#: awkgram.y:846 msgid "`return' used outside function context" msgstr "“return†(trở vá») được dùng ở ngoại ngữ cảnh hàm" -#: awkgram.y:922 +#: awkgram.y:920 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "“print†(in) thưá»ng trong quy tắc “BEGIN†(bắt đầu) hay “END†(kết thúc) gần " "như chắc chắn nên là “printâ€â€â€" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:986 awkgram.y:1035 msgid "`delete' is not allowed with SYMTAB" msgstr "“delete†không được phép vá»›i SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:988 awkgram.y:1037 msgid "`delete' is not allowed with FUNCTAB" msgstr "“delete†không được phép vá»›i FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1022 awkgram.y:1026 msgid "`delete(array)' is a non-portable tawk extension" msgstr "“delete array†(xoá mảng) là phần mở rá»™ng gawk không khả chuyển" -#: awkgram.y:1149 +#: awkgram.y:1147 msgid "multistage two-way pipelines don't work" msgstr "đưá»ng ống dẫn hai chiếu Ä‘a giai Ä‘oạn không phải hoạt động được" -#: awkgram.y:1264 +#: awkgram.y:1262 msgid "regular expression on right of assignment" msgstr "biểu thức chính quy nằm bên phải phép gán" -#: awkgram.y:1275 +#: awkgram.y:1273 msgid "regular expression on left of `~' or `!~' operator" msgstr "biểu thức chính quy nằm bên trái toán tá»­ “~†hay “!~â€" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1289 awkgram.y:1431 msgid "old awk does not support the keyword `in' except after `for'" msgstr "awk cÅ© không há»— trợ từ khoá “inâ€, trừ khi nằm sau “forâ€" -#: awkgram.y:1301 +#: awkgram.y:1299 msgid "regular expression on right of comparison" msgstr "biểu thức chính quy nằm bên phải sá»± so sánh" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "“getline var†không hợp lệ bên trong quy tắc “%sâ€" - -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" +#: awkgram.y:1411 +#, fuzzy, c-format +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "“getline†không hợp lệ trong quy tắc “%sâ€" -#: awkgram.y:1425 +#: awkgram.y:1414 msgid "non-redirected `getline' undefined inside END action" msgstr "" "trong hành động “END†(kết thúc) có “getline†(lấy dòng) không được chuyển " "hướng lại và chưa được định nghÄ©a." -#: awkgram.y:1444 +#: awkgram.y:1433 msgid "old awk does not support multidimensional arrays" msgstr "awk cÅ© không há»— trợ mảng Ä‘a chiá»u" -#: awkgram.y:1541 +#: awkgram.y:1530 msgid "call of `length' without parentheses is not portable" msgstr "" "lá»i gá»i “length†(độ dài) mà không có dấu ngoặc đơn là không tương thích " "trên các hệ thống khác" -#: awkgram.y:1607 +#: awkgram.y:1596 msgid "indirect function calls are a gawk extension" msgstr "cuá»™c gá»i hàm gián tiếp là má»™t phần mở rá»™ng gawk" -#: awkgram.y:1620 +#: awkgram.y:1609 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "không thể dùng biến đặc biệt “%s†cho cú gá»i hàm gián tiếp" -#: awkgram.y:1698 +#: awkgram.y:1635 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "cố gắng dùng hàm “%s†như mảng" + +#: awkgram.y:1699 msgid "invalid subscript expression" msgstr "biểu thức in thấp không hợp lệ" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2045 awkgram.y:2065 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "cảnh báo: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2063 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "lá»—i nghiêm trá»ng: " -#: awkgram.y:2116 +#: awkgram.y:2113 msgid "unexpected newline or end of string" msgstr "gặp dòng má»›i hay kết thúc chuá»—i bất ngá»" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2392 awkgram.y:2468 awkgram.y:2691 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "không thể mở tập tin nguồn “%s†để Ä‘á»c (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2393 awkgram.y:2518 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "không thể mở tập thư viện chia sẻ “%s†để Ä‘á»c (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2395 awkgram.y:2469 awkgram.y:2519 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "không rõ lý do" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2404 awkgram.y:2428 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "không thể bao gồm “%s†và dùng nó như là tập tin chương trình" -#: awkgram.y:2408 +#: awkgram.y:2417 #, c-format msgid "already included source file `%s'" msgstr "đã sẵn bao gồm tập tin nguồn “%sâ€" -#: awkgram.y:2409 +#: awkgram.y:2418 #, c-format msgid "already loaded shared library `%s'" msgstr "thư viện dùng chung “%s†đã được sẵn được tải rồi" -#: awkgram.y:2444 +#: awkgram.y:2453 msgid "@include is a gawk extension" msgstr "@include là phần mở rá»™ng cá»§a gawk" -#: awkgram.y:2450 +#: awkgram.y:2459 msgid "empty filename after @include" msgstr "tập tin trống sau @include" -#: awkgram.y:2494 +#: awkgram.y:2503 msgid "@load is a gawk extension" msgstr "@load là má»™t phần mở rá»™ng gawk" -#: awkgram.y:2500 +#: awkgram.y:2509 msgid "empty filename after @load" msgstr "tên tập tin trống sau @load" -#: awkgram.y:2634 +#: awkgram.y:2643 msgid "empty program text on command line" msgstr "gặp Ä‘oạn chữ chương trình rá»—ng nằm trên dòng lệnh" -#: awkgram.y:2749 +#: awkgram.y:2758 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "không thể Ä‘á»c tập tin nguồn “%s†(%s)" -#: awkgram.y:2760 +#: awkgram.y:2769 #, c-format msgid "source file `%s' is empty" msgstr "tập tin nguồn “%s†là rá»—ng" -#: awkgram.y:2937 +#: awkgram.y:2828 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2959 msgid "source file does not end in newline" msgstr "tập tin nguồn không kết thúc vá»›i má»™t dòng má»›i" -#: awkgram.y:3042 +#: awkgram.y:3062 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "biểu thức chính quy chưa được chấm dứt kết thúc vá»›i “\\†tại kết thúc cá»§a " "tập tin" -#: awkgram.y:3066 +#: awkgram.y:3089 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: bá»™ sá»­a đổi biểu thức chính quy tawk “/.../%c†không hoạt động được " "trong gawk" -#: awkgram.y:3070 +#: awkgram.y:3093 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "bá»™ sá»­a đổi biểu thức chính quy tawk “/.../%c†không hoạt động được trong gawk" -#: awkgram.y:3077 +#: awkgram.y:3100 msgid "unterminated regexp" msgstr "biểu thức chính quy chưa được chấm dứt" -#: awkgram.y:3081 +#: awkgram.y:3104 msgid "unterminated regexp at end of file" msgstr "biểu thức chính quy chưa được chấm dứt nằm tại kết thúc cá»§a tập tin" -#: awkgram.y:3140 +#: awkgram.y:3162 msgid "use of `\\ #...' line continuation is not portable" msgstr "không thể mang khả năng dùng “\\#...†để tiếp tục dòng" -#: awkgram.y:3156 +#: awkgram.y:3178 msgid "backslash not last character on line" msgstr "dấu gạch ngược không phải là ký tá»± cuối cùng nằm trên dòng" -#: awkgram.y:3217 +#: awkgram.y:3239 msgid "POSIX does not allow operator `**='" msgstr "POSIX không cho phép toán tá»­ “**=â€" -#: awkgram.y:3219 +#: awkgram.y:3241 msgid "old awk does not support operator `**='" msgstr "awk cÅ© không há»— trợ toán tá»­ “**=â€" -#: awkgram.y:3228 +#: awkgram.y:3250 msgid "POSIX does not allow operator `**'" msgstr "POSIX không cho phép toán tá»­ “**â€" -#: awkgram.y:3230 +#: awkgram.y:3252 msgid "old awk does not support operator `**'" msgstr "awk cÅ© không há»— trợ toán tá»­ “**â€" -#: awkgram.y:3265 +#: awkgram.y:3287 msgid "operator `^=' is not supported in old awk" msgstr "awk cÅ© không há»— trợ toán tá»­ “^=â€" -#: awkgram.y:3273 +#: awkgram.y:3295 msgid "operator `^' is not supported in old awk" msgstr "awk cÅ© không há»— trợ toán tá»­ “^â€" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3392 awkgram.y:3410 command.y:1180 msgid "unterminated string" msgstr "chuá»—i không được chấm dứt" -#: awkgram.y:3603 +#: awkgram.y:3631 #, c-format msgid "invalid char '%c' in expression" msgstr "có ký tá»± không hợp lệ “%c†nằm trong biểu thức" -#: awkgram.y:3650 +#: awkgram.y:3678 #, c-format msgid "`%s' is a gawk extension" msgstr "“%s†là má»™t phần mở rá»™ng gawk" -#: awkgram.y:3655 +#: awkgram.y:3683 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX không cho phép “%sâ€" -#: awkgram.y:3663 +#: awkgram.y:3691 #, c-format msgid "`%s' is not supported in old awk" msgstr "awk kiểu cÅ© không há»— trợ “%sâ€" -#: awkgram.y:3753 +#: awkgram.y:3781 msgid "`goto' considered harmful!\n" msgstr "“goto†được xem là có hại!\n" -#: awkgram.y:3787 +#: awkgram.y:3815 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "“%d†không hợp lệ khi là số đối số cho “%sâ€" -#: awkgram.y:3822 +#: awkgram.y:3850 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: khi đối số cuối cùng cá»§a sá»± thay thế, hằng mã nguồn chuá»—i không có tác " "dụng" -#: awkgram.y:3827 +#: awkgram.y:3855 #, c-format msgid "%s third parameter is not a changeable object" msgstr "tham số thứ ba %s không phải là má»™t đối tượng có thể thay đổi" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3938 awkgram.y:3941 msgid "match: third argument is a gawk extension" msgstr "match: (khá»›p) đối số thứ ba là phần mở rá»™ng gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:3995 awkgram.y:3998 msgid "close: second argument is a gawk extension" msgstr "close: (đóng) đối số thứ hai là phần mở rá»™ng gawk" -#: awkgram.y:3982 +#: awkgram.y:4010 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "dùng “dcgettext(_\"...\")†không đúng: hãy gỡ bá» gạch dưới nằm trước" -#: awkgram.y:3997 +#: awkgram.y:4025 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "dùng “dcgettext(_\"...\")†không đúng: hãy gỡ bá» gạch dưới nằm trước" -#: awkgram.y:4016 +#: awkgram.y:4044 msgid "index: regexp constant as second argument is not allowed" msgstr "" "index: (chỉ mục) không cho phép hằng biểu thức chính quy làm đối số thứ hai" -#: awkgram.y:4069 +#: awkgram.y:4097 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "hàm “%sâ€: tham số “%s†che biến toàn cục" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4154 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "không mở được “%s†để ghi (%s)" -#: awkgram.y:4127 +#: awkgram.y:4155 msgid "sending variable list to standard error" msgstr "Ä‘ang gởi danh sách biến tá»›i thiết bị lá»—i chuẩn" -#: awkgram.y:4135 +#: awkgram.y:4163 #, c-format msgid "%s: close failed (%s)" msgstr "%s: gặp lá»—i khi đóng (%s)" -#: awkgram.y:4160 +#: awkgram.y:4188 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() (hàm bóng) được gá»i hai lần!" -#: awkgram.y:4168 +#: awkgram.y:4196 msgid "there were shadowed variables." msgstr "có biến bị bóng." -#: awkgram.y:4239 +#: awkgram.y:4267 #, c-format msgid "function name `%s' previously defined" msgstr "tên hàm “%s†trước đây đã được định nghÄ©a rồi" -#: awkgram.y:4285 +#: awkgram.y:4313 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "hàm “%sâ€: không thể dùng tên hàm như là tên tham số" -#: awkgram.y:4288 +#: awkgram.y:4316 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "hàm “%sâ€: không thể dùng biến đặc biệt “%s†như là tham số hàm" -#: awkgram.y:4296 +#: awkgram.y:4324 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "hàm “%sâ€: tham số “#%dâ€, “%sâ€, nhân đôi tham số “#%dâ€" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4411 awkgram.y:4417 #, c-format msgid "function `%s' called but never defined" msgstr "hàm “%s†được gá»i nhưng mà chưa định nghÄ©a" -#: awkgram.y:4393 +#: awkgram.y:4421 #, c-format msgid "function `%s' defined but never called directly" msgstr "hàm “%s†được định nghÄ©a nhưng mà chưa được gá»i trá»±c tiếp bao giá»" -#: awkgram.y:4425 +#: awkgram.y:4453 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "hằng biểu thức chính quy cho tham số “#%d†làm giá trị luận lý (bun)" -#: awkgram.y:4484 +#: awkgram.y:4468 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -525,21 +530,21 @@ msgstr "" "hàm “%s†được gá»i vá»›i dấu cách nằm giữa tên và “(â€\n" "hoặc được dùng như là biến hay mảng" -#: awkgram.y:4720 +#: awkgram.y:4674 msgid "division by zero attempted" msgstr "gặp phép chia cho số không" -#: awkgram.y:4729 +#: awkgram.y:4683 #, c-format msgid "division by zero attempted in `%%'" msgstr "gặp phép chia cho số không trong “%%â€" -#: awkgram.y:5049 +#: awkgram.y:5003 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "không thể gán giá trị cho kết quả cá»§a biểu thức trưá»ng tăng-trước" -#: awkgram.y:5052 +#: awkgram.y:5006 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "gán Ä‘ich không hợp lệ (mã thi hành “%sâ€)" @@ -582,194 +587,204 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" "fflush: “%s†không phải là tập tin, ống dẫn hay đồng tiến trình được mở" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: (chỉ số) đã nhận đối số thứ nhất không phải là chuá»—i" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: (chỉ số) đã nhận đối số thứ hai không phải là chuá»—i" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: (số nguyên?) đã nhận đối số không phải thuá»™c số" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: (chiá»u dài) đã nhận mảng đối số" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "“length(array)†(độ dài mảng) là má»™t phần mở rá»™ng gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: (chiá»u dài) đã nhận đối số không phải chuá»—i" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: (nhật ký) đã nhận đối số không phải thuá»™c số" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: (nhật ký) đã nhận đối số âm “%gâ€" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "lá»—i nghiêm trá»ng: phải dùng “count$†vá»›i má»i dạng thức hay không gì cả" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "chiá»u rá»™ng trưá»ng bị bá» qua đối vá»›i bá»™ chỉ định “%%â€" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "độ chính xác bị bá» qua đối vá»›i bá»™ chỉ định “%%â€" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "chiá»u rá»™ng trưá»ng và độ chính xác bị bá» qua đối vá»›i bá»™ chỉ định “%%â€" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "lá»—i nghiêm trá»ng: không cho phép “$†trong định dạng awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "lá»—i nghiêm trá»ng: số lượng đối số vá»›i “$†phải >0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "lá»—i nghiêm trá»ng: số lượng đối số %ld lá»›n hÆ¡n tổng số đối số được cung cấp" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "lá»—i nghiêm trá»ng: không cho phép “$†nằm sau dấu chấm trong định dạng" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "lá»—i nghiêm trá»ng: chưa cung cấp “$†cho độ rá»™ng trưá»ng thuá»™c vị trí hay cho " "độ chính xác" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "chữ “l†không có nghÄ©a trong định dạng awk nên bị bá» qua" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "lá»—i nghiêm trá»ng: không cho phép chữ “l†nằm trong định dạng awk POSIX" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "chữ “L†không có nghÄ©a trong định dạng awk nên bị bá» qua" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "lá»—i nghiêm trá»ng: không cho phép chữ “L†nằm trong định dạng awk POSIX" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "chữ “h†không có nghÄ©a trong định dạng awk nên bị bá» qua" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "lá»—i nghiêm trá»ng: không cho phép chữ “h†nằm trong định dạng awk POSIX" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: giá trị %g ở ngoại phạm vi cho dạng thức “%%%câ€" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: giá trị %g ở ngoại phạm vi cho dạng thức “%%%câ€" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: giá trị %g ở ngoại phạm vi cho dạng thức “%%%câ€" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "Ä‘ang bá» qua ký tá»± ghi rõ định dạng không rõ “%câ€: không có đối số được " "chuyển đổi" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "lá»—i nghiêm trá»ng: chưa có đủ đối số để đáp ứng chuá»—i định dạng" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "bị hết “^†cho cái này" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: chỉ định định dạng không có ký hiệu Ä‘iá»u khiển" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "quá nhiá»u đối số được cung cấp cho chuá»—i định dạng" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: không có đối số" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: không có đối số" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: (căn bậc hai) đã nhận đối số không phải thuá»™c số" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm “%gâ€" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: (chuá»—i con) độ dài %g không phải ≥1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: (chuá»—i con) độ dài %g không phải ≥0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: (chuá»—i con) sẽ cắt xén độ dài không phải số nguyên “%gâ€" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: (chuá»—i con) độ dài %g là quá lá»›n cho chỉ số chuá»—i, nên xén ngắn " "thành %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: (chuá»—i con) chỉ số đầu “%g†không hợp lệ nên dùng 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" "substr: (chuá»—i con) chỉ số đầu không phải số nguyên “%g†sẽ bị cắt ngắn" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: (chuá»—i con) chuá»—i nguồn có độ dài số không" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: (chuá»—i con) chỉ số đầu %g nằm sau kết thúc cá»§a chuá»—i" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -777,191 +792,197 @@ msgstr "" "substr: (chuá»—i con) độ dài %g chỉ số đầu %g vượt quá độ dài cá»§a đối số đầu " "(%lu)" -#: builtin.c:1900 +#: builtin.c:1890 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime: giá trị định dạng trong PROCINFO[â€strftimeâ€] phải thuá»™c kiểu số" -#: builtin.c:1923 +#: builtin.c:1913 msgid "strftime: received non-numeric second argument" msgstr "strftime: đã nhận đối số thứ hai khác thuá»™c số" -#: builtin.c:1927 +#: builtin.c:1917 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: tham số thứ hai nhá» hÆ¡n 0 hay quá lá»›n dành cho time_t" -#: builtin.c:1934 +#: builtin.c:1924 msgid "strftime: received non-string first argument" msgstr "strftime: đã nhận đối số thứ nhất khác chuá»—i" -#: builtin.c:1941 +#: builtin.c:1931 msgid "strftime: received empty format string" msgstr "strftime: đã nhận chuá»—i định dạng rá»—ng" -#: builtin.c:2007 +#: builtin.c:1997 msgid "mktime: received non-string argument" msgstr "mktime: đã nhận đối số khác chuá»—i" -#: builtin.c:2024 +#: builtin.c:2014 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: ít nhất má»™t cá»§a những giá trị nằm ở ngoại phạm vi mặc định" -#: builtin.c:2059 +#: builtin.c:2049 msgid "'system' function not allowed in sandbox mode" msgstr "hàm “system†không cho phép ở chế độ khuôn đúc" -#: builtin.c:2064 +#: builtin.c:2054 msgid "system: received non-string argument" msgstr "system: (hệ thống) đã nhận đối số khác chuá»—i" -#: builtin.c:2184 +#: builtin.c:2174 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "gặp tham chiếu đến trưá»ng chưa được khởi tạo “$%dâ€" -#: builtin.c:2271 +#: builtin.c:2259 msgid "tolower: received non-string argument" msgstr "tolower: (đến thấp hÆ¡n) đã nhận đối số khác chuá»—i" -#: builtin.c:2305 +#: builtin.c:2290 msgid "toupper: received non-string argument" msgstr "toupper: (đến cao hÆ¡n) đã nhận đối số khác chuá»—i" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2323 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: đã nhận đối số thứ nhất khác thuá»™c số" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2325 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: đã nhận đối số thứ hai khác thuá»™c số" -#: builtin.c:2362 +#: builtin.c:2344 msgid "sin: received non-numeric argument" msgstr "sin: đã nhận đối số không phải thuá»™c số" -#: builtin.c:2378 +#: builtin.c:2360 msgid "cos: received non-numeric argument" msgstr "cos: đã nhận đối số không phải thuá»™c số" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2413 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: đã nhận đối số không phải thuá»™c số" -#: builtin.c:2462 +#: builtin.c:2444 msgid "match: third argument is not an array" msgstr "match: (khá»›p) đối số thứ ba không phải là mảng" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2705 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: đối số thứ ba cá»§a 0 được xá»­ lý như 1" -#: builtin.c:3030 +#: builtin.c:2720 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: đối số thứ ba cá»§a 0 được xá»­ lý như 1" + +#: builtin.c:3020 msgid "lshift: received non-numeric first argument" msgstr "lshift: đã nhận đối số đầu không phải thuá»™c số" -#: builtin.c:3032 +#: builtin.c:3022 msgid "lshift: received non-numeric second argument" msgstr "lshift: (dịch bên trái) đã nhận đối số thứ hai khác thuá»™c số" -#: builtin.c:3038 +#: builtin.c:3028 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): giá trị âm sẽ gây ra kết quả không như mong muốn" -#: builtin.c:3040 +#: builtin.c:3030 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): giá trị thuá»™c phân số sẽ bị cắt ngắn" -#: builtin.c:3042 +#: builtin.c:3032 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" "lshift(%f, %f): giá trị dịch quá lá»›n sẽ gây ra kết quả không như mong muốn" -#: builtin.c:3067 +#: builtin.c:3057 msgid "rshift: received non-numeric first argument" msgstr "rshift: đã nhận đối số thứ nhất khác thuá»™c số" -#: builtin.c:3069 +#: builtin.c:3059 msgid "rshift: received non-numeric second argument" msgstr "rshift: (dịch phải) đã nhận đối số thứ hai khác thuá»™c số" -#: builtin.c:3075 +#: builtin.c:3065 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): giá trị âm sẽ gây ra kết quả không như mong muốn" -#: builtin.c:3077 +#: builtin.c:3067 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): giá trị thuá»™c kiểu phân số sẽ bị xén ngắn" -#: builtin.c:3079 +#: builtin.c:3069 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%f, %f): giá trị dịch quá lá»›n sẽ gây ra kết quả không như mong muốn" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3094 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: được gá»i vá»›i ít hÆ¡n hai đối số" -#: builtin.c:3109 +#: builtin.c:3099 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: đối số %d không phải thuá»™c số" -#: builtin.c:3113 +#: builtin.c:3103 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" "and: (và) đối số %d giá trị âm %g sẽ đưa lại kết quả không như mong muốn" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3126 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: (hoặc) được gá»i vá»›i ít hÆ¡n hai đối số" -#: builtin.c:3141 +#: builtin.c:3131 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: (hoặc) đối số %d không thuá»™c kiểu số" -#: builtin.c:3145 +#: builtin.c:3135 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "" "or: (hoặc) đối số %d giá trị âm %g sẽ đưa lại kết quả không như mong muốn" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3157 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: được gá»i vá»›i ít hÆ¡n hai đối số" -#: builtin.c:3173 +#: builtin.c:3163 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: đối số %d không thuá»™c kiểu số" -#: builtin.c:3177 +#: builtin.c:3167 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: đối số %d giá trị âm %g sẽ đưa lại kết quả không như mong muốn" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3192 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: (biên dịch) đã nhận được đối số không-phải-số" -#: builtin.c:3208 +#: builtin.c:3198 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): giá trị âm sẽ gây ra kết quả không như mong đợi" -#: builtin.c:3210 +#: builtin.c:3200 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): giá trị thuá»™c phân số sẽ bị cắt ngắn" -#: builtin.c:3379 +#: builtin.c:3369 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: “%s†không phải là má»™t phân loại miá»n địa phương hợp lệ" @@ -1261,40 +1282,49 @@ msgstr "up [N] - chuyển xuống N khung stack." msgid "watch var - set a watchpoint for a variable." msgstr "watch var - đặt Ä‘iểm theo dõi cho má»™t biến." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +#, fuzzy +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"backtrace [N] - in vết cá»§a tất cả hay N khung trong cùng nhất (ngoài cùng " +"nhất nếu N < 0)." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "lá»—i: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "không thể Ä‘á»c lệnh (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "không thể Ä‘á»c lệnh (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "ký tá»± trong câu lệnh không hợp lệ" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "không hiểu lệnh - “%.*sâ€, hãy gõ lệnh trợ giúp “helpâ€" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "ký tá»± không hợp lệ" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "lệnh chưa định nghÄ©a: %s\n" @@ -1821,68 +1851,70 @@ msgstr "“%s†không được phép trong ngữ cảnh hiện hành; câu l msgid "`return' not allowed in current context; statement ignored" msgstr "“return†không được phép trong ngữ cảnh hiện hành; câu lệnh bị bá» qua" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Không có ký hiệu “%s†trong ngữ cảnh hiện thá»i" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1063 dfa.c:1066 dfa.c:1085 dfa.c:1095 dfa.c:1107 dfa.c:1143 +#: dfa.c:1152 dfa.c:1155 dfa.c:1160 dfa.c:1174 dfa.c:1222 msgid "unbalanced [" msgstr "thiếu dấu ngoặc vuông mở [" -#: dfa.c:1174 +#: dfa.c:1119 msgid "invalid character class" msgstr "sai lá»›p ký tá»±" -#: dfa.c:1316 +#: dfa.c:1265 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "cú pháp lá»›p ký tá»± là [[:dấu_cách:]], không phải [:dấu_cách:]" -#: dfa.c:1366 +#: dfa.c:1327 msgid "unfinished \\ escape" msgstr "chưa kết thúc dãy thoát \\" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1474 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Ná»™i dung cá»§a “\\{\\}†không hợp lệ" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1477 +#, fuzzy +msgid "regular expression too big" msgstr "Biểu thức chính quy quá lá»›n" -#: dfa.c:1936 +#: dfa.c:1912 msgid "unbalanced (" msgstr "thiếu dấu (" -#: dfa.c:2062 +#: dfa.c:2038 msgid "no syntax specified" msgstr "chưa chỉ rõ cú pháp" -#: dfa.c:2070 +#: dfa.c:2046 msgid "unbalanced )" msgstr "thiếu dấu )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "không biết kiểu nút %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "gặp opcode (mã thao tác) không rõ %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "mã lệnh %s không phải là má»™t toán tá»­ hoặc từ khoá" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "tràn bá»™ đệm trong “genflags2str†(tạo ra cỠđến chuá»—i)" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1893,217 +1925,217 @@ msgstr "" "\t# Ngăn xếp gá»i hàm:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "“IGNORECASE†(bá» qua chữ HOA/thưá»ng) là phần mở rá»™ng gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "“BINMODE†(chế độ nhị phân) là phần mở rá»™ng gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "Giá trị BINMODE (chế độ nhị phân) “%s†không hợp lệ nên đã coi là 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "đặc tả “%sFMT†sai “%sâ€" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "Ä‘ang tắt “--lint†do việc gán cho “LINTâ€" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "gặp tham chiếu đến đối số chưa được khởi tạo “%sâ€" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "gặp tham chiếu đến biến chưa được khởi tạo “%sâ€" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "cố gắng tham chiếu trưá»ng từ giá trị khác thuá»™c số" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "cố gắng tham chiếu trưá»ng từ chuá»—i trống rá»—ng" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "cố gắng để truy cập trưá»ng %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "tham chiếu đến trưá»ng chưa được khởi tạo “$%ldâ€" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "hàm “%s†được gá»i vá»›i nhiá»u số đối số hÆ¡n số được khai báo" -#: eval.c:1473 +#: eval.c:1500 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: không cần kiểu “%sâ€" -#: eval.c:1569 +#: eval.c:1596 msgid "division by zero attempted in `/='" msgstr "gặp phép chia cho số không trong “/=â€" -#: eval.c:1576 +#: eval.c:1603 #, c-format msgid "division by zero attempted in `%%='" msgstr "gặp phép chia cho số không trong “%%=â€" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "phần mở rá»™ng không cho phép ở chế độ khuôn đúc" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load là má»™t phần mở rá»™ng gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: nhận được NULL lib_name" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: không thể mở thư viện “%s†(%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: thư viện “%sâ€: chưa định nghÄ©a “plugin_is_GPL_compatible†(%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: thư viện “%sâ€: không thể gá»i hàm “%s†(%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "load_ext: thư viện “%s†thá»§ tục khởi tạo “%s†gặp lá»—i\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "“extension†là má»™t phần mở rá»™ng gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension: nhận được NULL lib_name" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "phần mở rá»™ng: không thể mở thư viện “%s†(%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "phần mở rá»™ng: thư viện “%sâ€: chưa định nghÄ©a “plugin_is_GPL_compatible†(%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "phần mở rá»™ng: thư viện “%sâ€: không thể gá»i hàm “%s†(%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: thiếu tên hàm" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: không thể định nghÄ©a lại hàm “%sâ€" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: hàm “%s†đã được định nghÄ©a rồi" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: hàm “%s†đã được định nghÄ©a trước đây rồi" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: không thể sá»­ dụng “%s†như là má»™t hàm được xây dá»±ng sẵn trong " "gawk" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: đối số dành cho số đếm bị âm cho hàm “%sâ€" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: (phần mở rá»™ng) tên hàm còn thiếu" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: (phần mở rá»™ng) gặp ký tá»± cấm “%c†nằm trong tên hàm “%sâ€" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: (phần mở rá»™ng) không thể định nghÄ©a lại hàm “%sâ€" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: (phần mở rá»™ng) hàm “%s†đã được định nghÄ©a" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "tên hàm “%s†đã được định nghÄ©a trước đó" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: (phần mở rá»™ng) không thể dùng Ä‘iá»u có sẵn cá»§a gawk “%s†như là " "tên hàm" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "hàm “%s†được định nghÄ©a để chấp nhấn %d đối số tối Ä‘a" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "hàm “%sâ€: thiếu đối số #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "hàm “%sâ€: đối số thứ %d: cố gắng dùng kiểu vô hướng như là mảng" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "hàm “%sâ€: đối số thứ %d: cố gắng dùng mảng như là kiểu vô hướng" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "tải động cá»§a thư viện không được há»— trợ" @@ -2247,7 +2279,7 @@ msgstr "wait: được gá»i vá»›i quá nhiá»u đối số" msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: sá»­a in-place đã sẵn được kích hoạt rồi" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: cần 2 đối số như lại được gá»i vá»›i %d" @@ -2276,55 +2308,55 @@ msgstr "inplace_begin: “%s†không phải là tập tin thưá»ng" msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(“%sâ€) gặp lá»—i (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: chmod gặp lá»—i (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) gặp lá»—i (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) gặp lá»—i (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) gặp lá»—i (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "inplace_end: không thể lấy lại đối số thứ nhất như là má»™t tên tập tin" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: việc sá»­a in-place không được kích hoạt" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) gặp lá»—i (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) gặp lá»—i (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) gặp lá»—i (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(“%sâ€, “%sâ€) gặp lá»—i (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(“%sâ€, “%sâ€) gặp lá»—i (%s)" @@ -2366,50 +2398,54 @@ msgstr "readfile: được gá»i vá»›i quá nhiá»u đối số" msgid "readfile: called with no arguments" msgstr "readfile: được gá»i mà không có đối số" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: được gá»i vá»›i quá nhiá»u đối số" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: đối số 0 không phải là má»™t chuá»—i\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: đối số 1 không phải là má»™t mảng\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: không thể làm phẳng mảng\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: không thể giải phóng mảng được làm phẳng\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: được gá»i vá»›i quá nhiá»u đối số" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: đối số 0 không phải là má»™t chuá»—i\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: đối số 1 không phải là má»™t mảng\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array gặp lá»—i\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element gặp lá»—i\n" @@ -2438,93 +2474,93 @@ msgstr "sleep: đối số âm" msgid "sleep: not supported on this platform" msgstr "sleep: không được há»— trợ trên ná»n tảng này" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "“NF†được đặt thành giá trị âm" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split (chia tách): đối số thứ tư là phần mở rá»™ng gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split (chia tách): đối số thứ tư không phải là mảng" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: (chia tách) đối số thứ hai không phải là mảng" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split (chia tách): không thể sá»­ dụng cùng má»™t mảng có cả đối số thứ hai và " "thứ tư" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split (phân tách): không thể sá»­ dụng mảng con cá»§a tham số thứ hai cho tham " "số thứ tư" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split (phân tách): không thể sá»­ dụng mảng con cá»§a tham số thứ tư cho tham số " "thứ hai" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "" "split: (chia tách) chuá»—i vô giá trị cho đối số thứ ba là phần mở rá»™ng gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: đối số thứ tư không phải là mảng" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: đối số thứ hai không phải là mảng" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: đối số thứ ba không phải không rá»—ng" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit (chương trình chia tách): không thể sá»­ dụng cùng má»™t mảng cho cả " "hai đối số thứ hai và thứ tư" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit (chương trình phân tách): không thể sá»­ dụng mảng con cá»§a tham số " "thứ hai cho tham số thứ tư" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit (chương trình phân tách): không thể sá»­ dụng mảng con cá»§a tham số " "thứ tư cho tham số thứ hai" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "“FIELDWIDTHS†(độ rá»™ng trưá»ng) là phần mở rá»™ng gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "giá trị FIELDWIDTHS (độ rá»™ng trưá»ng) không hợp lệ, gần “%sâ€" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "chuá»—i vô giá trị cho “FS†là phần mở rá»™ng gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "awk cÅ© không há»— trợ biểu thức chính quy làm giá trị cá»§a “FSâ€" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "“FPAT†là phần mở rá»™ng cá»§a gawk" @@ -2540,20 +2576,20 @@ msgstr "node_to_awk_value: nút nhận được là null" msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: biến nhận được là null" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: mảng nhận được là null" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: nhận được là null" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: không thể chuyển đổi chỉ số %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: không thể chuyển đổi giá trị %d\n" @@ -2613,313 +2649,295 @@ msgstr "%s: tùy chá»n “-W %s†không cho phép đối số\n" msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: tùy chá»n “-W %s†yêu cầu má»™t đối số\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "tham số dòng lệnh “%s†là má»™t thư mục: đã bị bá» qua" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "không mở được tập tin “%s†để Ä‘á»c (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "lá»—i đóng fd %d (“%sâ€) (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "chuyển hướng không cho phép ở chế độ khuôn đúc" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "biểu thức trong Ä‘iá»u chuyển hướng “%s†chỉ có giá trị thuá»™c số" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "biểu thức cho Ä‘iá»u chuyển hướng “%s†có giá trị chuá»—i vô giá trị" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "tên tập tin “%s†cho Ä‘iá»u chuyển hướng “%s†có lẽ là kết quả cá»§a biểu thức " "luận lý" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "không cần hợp “>†và “>>†cho tập tin “%.*sâ€" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "không thể mở ống dẫn “%s†để xuất (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "không thể mở ống dẫn “%s†để nhập (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "không thể mở ống dẫn hai chiá»u “%s†để nhập/xuất (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "không thể chuyển hướng từ “%s†(%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "không thể chuyển hướng đến “%s†(%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "đã tá»›i giá»›i hạn hệ thống vá» tập tin được mở nên bắt đầu phối hợp nhiá»u dòng " "Ä‘iá»u mô tả tập tin" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "lá»—i đóng “%s†(%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "quá nhiá»u ống dẫn hay tập tin nhập được mở" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: (đóng) đối số thứ hai phải là “to†(đến) hay “from†(từ)" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" "close: (đóng) “%.*s†không phải là tập tin, ống dẫn hay đồng tiến trình đã " "được mở" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "đóng má»™t chuyển hướng mà nó chưa từng được mở" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: chuyển hướng “%s†không được mở bởi “|&†nên đối số thứ hai bị bá» qua" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "trạng thái thất bại (%d) khi đóng ống dẫn “%s†(%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "trạng thái thất bại (%d) khi đóng tập tin “%s†(%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "không cung cấp lệnh đóng ổ cắm “%s†rõ ràng" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "không cung cấp lệnh đóng đồng tiến trình “%s†rõ ràng" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "không cung cấp lệnh đóng đưá»ng ống dẫn lệnh “%s†rõ ràng" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "không cung cấp lệnh đóng tập tin “%s†rõ ràng" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:628 main.c:670 #, c-format msgid "error writing standard output (%s)" msgstr "gặp lá»—i khi ghi đầu ra tiêu chuẩn (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:630 #, c-format msgid "error writing standard error (%s)" msgstr "gặp lá»—i khi ghi thiết bị lá»—i chuẩn (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "lá»—i xoá sạch ống dẫn “%s†(%s)" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "lá»—i xoá sạch ống dẫn đồng tiến trình đến “%s†(%s)" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "lá»—i xoá sạch tập tin “%s†(%s)" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "cổng cục bá»™ %s không hợp lệ trong “/inetâ€" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "thông tin vá» máy/cổng ở xa (%s, %s) không phải hợp lệ" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "trong tên tập tin đặc biệt “%s†không cung cấp giao thức (đã biết) nào" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "tên tập tin đặc biệt “%s†chưa xong" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "phải cung cấp má»™t tên máy chá»§ cho " - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "phải cung cấp má»™t cổng máy chá»§ cho " - -#: io.c:1685 +#: io.c:1673 msgid "TCP/IP communications are not supported" msgstr "truyá»n thông TCP/IP không được há»— trợ" -#: io.c:1867 +#: io.c:1854 #, c-format msgid "could not open `%s', mode `%s'" msgstr "không mở được “%sâ€, chế độ “%sâ€" -#: io.c:1917 +#: io.c:1904 #, c-format msgid "close of master pty failed (%s)" msgstr "gặp lá»—i khi đóng thiết bị cuối giả (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1906 io.c:2092 io.c:2293 #, c-format msgid "close of stdout in child failed (%s)" msgstr "lá»—i đóng đầu ra tiêu chuẩn trong tiến trình con (%s)" -#: io.c:1922 +#: io.c:1909 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "gặp lá»—i khi di chuyển pty (thiết bị cuối giả) phụ thuá»™c đến thiết bị đầu ra " "tiêu chuẩn trong con (trùng: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1911 io.c:2097 #, c-format msgid "close of stdin in child failed (%s)" msgstr "lá»—i đóng thiết bị nhập chuẩn trong tiến trình con (%s)" -#: io.c:1927 +#: io.c:1914 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "lá»—i di chuyển pty (thiết bị cuối giả) phụ tá»›i thiết bị nhập chuẩn trong Ä‘iá»u " "con (nhân đôi: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1916 io.c:1938 #, c-format msgid "close of slave pty failed (%s)" msgstr "đóng pty (thiết bị cuối giả) phụ thuá»™c gặp lá»—i (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2027 io.c:2095 io.c:2264 io.c:2296 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "lá»—i di chuyển ống dẫn đến thiết bị xuất chuẩn trong tiến trình con (trùng: " "%s)" -#: io.c:2047 io.c:2113 +#: io.c:2034 io.c:2100 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "lá»—i di chuyển ống dẫn đến thiết bị nhập chuẩn trong tiến trình con (trùng: " "%s)" -#: io.c:2073 io.c:2298 +#: io.c:2060 io.c:2286 msgid "restoring stdout in parent process failed\n" msgstr "phục hồi đầu ra tiêu chuẩn trong tiến trình mẹ gặp lá»—i\n" -#: io.c:2081 +#: io.c:2068 msgid "restoring stdin in parent process failed\n" msgstr "phục hồi đầu vào tiêu chuẩn trong tiến trình mẹ gặp lá»—i\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2103 io.c:2298 io.c:2313 #, c-format msgid "close of pipe failed (%s)" msgstr "đóng ống dẫn gặp lá»—i (%s)" -#: io.c:2174 +#: io.c:2162 msgid "`|&' not supported" msgstr "“|&†không được há»— trợ" -#: io.c:2261 +#: io.c:2249 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "không thể mở ống dẫn “%s†(%s)" -#: io.c:2318 +#: io.c:2307 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "không thể tạo tiến trình con cho “%s†(fork: %s)" -#: io.c:2790 +#: io.c:2734 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: nhận được con trá» NULL" -#: io.c:2818 +#: io.c:2762 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "bá»™ phân tích đầu vào “%s†xung đột vá»›i bá»™ phân tích đầu vào được cài đặt " "trước đó “%sâ€" -#: io.c:2825 +#: io.c:2769 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "bá»™ phân tích đầu vào “%s†gặp lá»—i khi mở “%sâ€" -#: io.c:2845 +#: io.c:2789 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: nhận được con trá» NULL" -#: io.c:2873 +#: io.c:2817 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" "bá»™ bao kết xuất “%s†xung đột vá»›i bá»™ bao kết xuất được cài đặt trước đó “%sâ€" -#: io.c:2880 +#: io.c:2824 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "bá»™ bao kết xuất “%s†gặp lá»—i khi mở “%sâ€" -#: io.c:2901 +#: io.c:2845 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: nhận được con trá» NULL" -#: io.c:2930 +#: io.c:2874 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2928,221 +2946,208 @@ msgstr "" "bá»™ xá»­ lý hai hướng “%s†xung đột vá»›i bá»™ xá»­ lý hai hướng đã được cài đặt " "trước đó “%sâ€" -#: io.c:2939 +#: io.c:2883 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "bá»™ xá»­ lý hai hướng “%s†gặp lá»—i khi mở “%sâ€" -#: io.c:3064 +#: io.c:3008 #, c-format msgid "data file `%s' is empty" msgstr "tập tin dữ liệu “%s†là rá»—ng" -#: io.c:3106 io.c:3114 +#: io.c:3050 io.c:3058 msgid "could not allocate more input memory" msgstr "không thể cấp phát bá»™ nhá»› nhập thêm nữa" -#: io.c:3682 +#: io.c:3636 msgid "multicharacter value of `RS' is a gawk extension" msgstr "giá trị Ä‘a ký tá»± cá»§a “RS†là phần mở rá»™ng gawk" -#: io.c:3771 +#: io.c:3783 msgid "IPv6 communication is not supported" msgstr "Truyá»n thông trên IPv6 không được há»— trợ" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "đối số rá»—ng cho tuỳ chá»n “-e/--source†bị bá» qua" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: tùy chá»n “-W %s†không được nhận diện nên bị bá» qua\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: tùy chá»n cần đến đối số “-- %câ€\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "biến môi trưá»ng “POSIXLY_CORRECT†(đúng kiểu POSIX) đã được đặt; Ä‘ang bật " "tùy chá»n “--posixâ€" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "tùy chá»n “--posix†có quyá»n cao hÆ¡n “--traditional†(truyá»n thống)" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "“--posixâ€/“--traditional†(cổ Ä‘iển) có quyá»n cao hÆ¡n “--non-decimal-" "data†(dữ liệu khác thập phân)" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "việc chạy %s vá»›i tư cách “setuid root†có thể rá»§i rá» bảo mật" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "“--posix†đè lên “--characters-as-bytesâ€" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "không thể đặt chế độ nhị phân trên đầu vào tiêu chuẩn (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "không thể đặt chế độ nhị phân trên đầu ra tiêu chuẩn (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "không thể đặt chế độ nhị phân trên đầu ra lá»—i tiêu chuẩn (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "không có Ä‘oạn chữ chương trình nào cả!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Cách dùng: %s [tùy chá»n kiểu POSIX hay GNU] -f tập_tin_chương_trình [--] " "tập_tin ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Cách dùng: %s [tùy chá»n kiểu POSIX hay GNU] [--] %cchương_trình%c " "tập_tin ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Tùy chá»n POSIX:\t\t\tTùy chá»n dài GNU: (tiêu chuẩn)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f tập_tin_chương_trình\t--file=tập_tin_chương_trình\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=ký_hiệu_phân_cách_trưá»ng\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" "\t-v var=giá_trị\t\t--assign=biến=giá_trị\n" "(assign: gán)\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Tuỳ chá»n ngắn:\t\t\tTuỳ chá»n GNU dạng dài: (mở rá»™ng)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[tập_tin]\t\t--dump-variables[=tập_tin]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[tập_tin]\t\t--debug[=tập_tin]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e “program-textâ€\t--source=“program-textâ€\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=tập_tin\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i includefile\t\t--include=tập-tin-bao-gồm\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l library\t\t--load=thư-viện\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#: main.c:586 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:587 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:588 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:589 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:590 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[tập_tin]\t\t--pretty-print[=tập_tin]\n" -#: main.c:827 +#: main.c:591 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize (tạm dịch: tối_ưu_hoá)\n" -#: main.c:828 +#: main.c:592 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[tập_tin]\t\t--profile[=tập_tin]\n" -#: main.c:829 +#: main.c:593 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:594 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:595 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:596 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:597 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:599 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" "\t-W nostalgia\t\t--nostalgia\n" "(ná»—i luyến tiếc quá khứ)\n" -#: main.c:838 +#: main.c:602 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3151,7 +3156,7 @@ msgstr "\t-Y\t\t--parsedebug\n" #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:611 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3166,7 +3171,7 @@ msgstr "" "Thông báo lá»—i dịch cho: .\n" "\n" -#: main.c:851 +#: main.c:615 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3176,7 +3181,7 @@ msgstr "" "Mặc định, nó Ä‘á»c từ đầu vào tiêu chuẩn và ghi ra đầu ra tiêu chuẩn.\n" "\n" -#: main.c:855 +#: main.c:619 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3186,7 +3191,7 @@ msgstr "" "\tgawk \"{ sum += $1 }; END { print sum }\" file\n" "\tgawk -F: \"{ print $1 }\" /etc/passwd\n" -#: main.c:880 +#: main.c:644 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3205,7 +3210,7 @@ msgstr "" "cá»§a Giấy Phép này, hoặc là (tùy chá»n) bất kỳ phiên bản má»›i hÆ¡n.\n" "\n" -#: main.c:888 +#: main.c:652 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3219,7 +3224,7 @@ msgstr "" "Hãy xem Giấy phép Công Chung GNU (GPL) để biết chi tiết.\n" "\n" -#: main.c:894 +#: main.c:658 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3227,16 +3232,16 @@ msgstr "" "Bạn nên nhận má»™t bản sao cá»§a Giấy Phép Công Cá»™ng GNU cùng vá»›i chương\n" "trình này. Nếu chưa có, bạn xem tại .\n" -#: main.c:931 +#: main.c:695 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft không đặt FS (hệ thống tập tin?) vào tab trong awk POSIX" -#: main.c:1208 +#: main.c:982 #, c-format msgid "unknown value for field spec: %d\n" msgstr "không hiểu giá trị dành cho đặc tả trưá»ng: %d\n" -#: main.c:1306 +#: main.c:1080 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3245,98 +3250,116 @@ msgstr "" "%s: đối số “%s†cho “-v†không có dạng “biến=giá_trịâ€\n" "\n" -#: main.c:1332 +#: main.c:1106 #, c-format msgid "`%s' is not a legal variable name" msgstr "“%s†không phải là tên biến hợp lệ" -#: main.c:1335 +#: main.c:1109 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "“%s†không phải là tên biến; Ä‘ang tìm tập tin “%s=%sâ€" -#: main.c:1339 +#: main.c:1113 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "không thể dùng builtin (dá»±ng sẵn) cá»§a gawk “%s†như là tên biến" -#: main.c:1344 +#: main.c:1118 #, c-format msgid "cannot use function `%s' as variable name" msgstr "không thể dùng hàm “%s†như là tên biến" -#: main.c:1397 +#: main.c:1171 msgid "floating point exception" msgstr "ngoại lệ số thá»±c dấu chấm động" -#: main.c:1404 +#: main.c:1178 msgid "fatal error: internal error" msgstr "lá»—i nghiêm trá»ng: lá»—i ná»™i bá»™" -#: main.c:1419 +#: main.c:1193 msgid "fatal error: internal error: segfault" msgstr "lá»—i nghiêm trá»ng: lá»—i ná»™i bá»™: lá»—i phân Ä‘oạn" -#: main.c:1431 +#: main.c:1205 msgid "fatal error: internal error: stack overflow" msgstr "lá»—i nghiêm trá»ng: lá»—i ná»™i bá»™: tràn ngăn xếp" -#: main.c:1490 +#: main.c:1264 #, c-format msgid "no pre-opened fd %d" msgstr "không có fd (bá»™ mô tả tập tin) %d đã mở trước" -#: main.c:1497 +#: main.c:1271 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "không thể mở trước “/dev/null†cho fd %d" -#: mpfr.c:550 +#: main.c:1485 +msgid "empty argument to `-e/--source' ignored" +msgstr "đối số rá»—ng cho tuỳ chá»n “-e/--source†bị bá» qua" + +#: main.c:1556 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1577 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: tùy chá»n “-W %s†không được nhận diện nên bị bá» qua\n" + +#: main.c:1630 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: tùy chá»n cần đến đối số “-- %câ€\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "giá trị PREC “%.*s†là không hợp lệ" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "giá trị RNDMODE “%.*s†là không hợp lệ" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: đã nhận đối số không phải thuá»™c số" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): giá trị âm sẽ gây ra kết quả không như mong muốn" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): giá trị thuá»™c phân số sẽ bị cắt ngắn" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): giá trị âm sẽ gây ra kết quả không như mong muốn" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: đã nhận đối số không phải thuá»™c số #%d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: đối số #%d có giá trị không hợp lệ %Rg, dùng 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: đối số #%d giá trị âm %Rg sẽ gây ra kết quả không như mong muốn" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: đối số #%d giá trị phần phân số %Rg sẽ bị cắt cụt" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: đối số #%d có giá trị âm %Zd sẽ đưa ra kết quả không như mong muốn" @@ -3346,24 +3369,24 @@ msgstr "%s: đối số #%d có giá trị âm %Zd sẽ đưa ra kết quả kh msgid "cmd. line:" msgstr "dòng lệnh:" -#: node.c:421 +#: node.c:409 msgid "backslash at end of string" msgstr "gặp dấu gạch ngược tại kết thúc cá»§a chuá»—i" -#: node.c:500 +#: node.c:488 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "awk cÅ© không há»— trợ thoát chuá»—i “\\%câ€" -#: node.c:551 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX không cho phép thoát chuá»—i “\\xâ€" -#: node.c:557 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "không có số thập lúc nằm trong thoát chuá»—i “\\xâ€" -#: node.c:579 +#: node.c:567 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3372,12 +3395,12 @@ msgstr "" "thoát chuá»—i thập lục \\x%.*s chứa %d ký tá»± mà rất có thể không phải được Ä‘á»c " "bằng cách dá»± định" -#: node.c:594 +#: node.c:582 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "thoát chuá»—i “\\%c†được xá»­ lý như là “%c†chuẩn" -#: node.c:739 +#: node.c:726 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3407,12 +3430,12 @@ msgid "sending profile to standard error" msgstr "Ä‘ang gởi hồ sÆ¡ cho thiết bị lá»—i chuẩn" #: profile.c:193 -#, c-format +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s khối\n" +"\t# Quy tắc\n" "\n" #: profile.c:198 @@ -3429,11 +3452,11 @@ msgstr "" msgid "internal error: %s with null vname" msgstr "lá»—i ná»™i bá»™: %s vá»›i vname (tên biến?) vô giá trị" -#: profile.c:537 +#: profile.c:538 msgid "internal error: builtin with null fname" msgstr "lá»—i ná»™i bá»™: phần dá»±ng sẵn vá»›i fname là null" -#: profile.c:949 +#: profile.c:958 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3442,12 +3465,12 @@ msgstr "" "\t# Các phần mở rá»™ng được tải (-l và/hoặc @load)\n" "\n" -#: profile.c:972 +#: profile.c:981 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# hồ sÆ¡ gawk, được tạo %s\n" -#: profile.c:1475 +#: profile.c:1521 #, c-format msgid "" "\n" @@ -3456,7 +3479,7 @@ msgstr "" "\n" "\t# Danh sách các hàm theo thứ tá»± abc\n" -#: profile.c:1513 +#: profile.c:1559 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: không hiểu kiểu chuyển hướng %d" @@ -3468,80 +3491,114 @@ msgstr "" "thành phần cá»§a biểu thức chính qui (regexp) “%.*s†gần như chắc chắn nên là " "“[%.*s]â€" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Thành công" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Không khá»›p" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Biểu thức chính quy không hợp lệ" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ký tá»± đối chiếu không hợp lệ" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Tên hạng ký tá»± không hợp lệ" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Gặp dấu gạch ngược thừa" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Tham chiếu ngược không hợp lệ" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "Chưa khá»›p “[†hay “[^â€" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Chưa khá»›p “(†hay “\\(â€" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Chưa khá»›p “\\{â€" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ná»™i dung cá»§a “\\{\\}†không hợp lệ" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Kết thúc phạm vi không hợp lệ" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Hết bá»™ nhá»›" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Biểu thức chính quy nằm trước không hợp lệ" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Kết thúc quá sá»›m cá»§a biểu thức chính quy" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Biểu thức chính quy quá lá»›n" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Chưa khá»›p “)†hoặc “\\)â€" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Không có biểu thức chính quy nằm trước" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "hàm “%sâ€: không thể dùng tên hàm như là tên tham số" + +#: symbol.c:809 msgid "can not pop main context" msgstr "không thể pop (lấy ra) ngữ cảnh chính" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "“getline var†không hợp lệ bên trong quy tắc “%sâ€" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "trong tên tập tin đặc biệt “%s†không cung cấp giao thức (đã biết) nào" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "tên tập tin đặc biệt “%s†chưa xong" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "phải cung cấp má»™t tên máy chá»§ cho " + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "phải cung cấp má»™t cổng máy chá»§ cho " + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s khối\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "vùng cá»§a dạng thức “[%c-%c]†phụ thuá»™c vào vị trí" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "cố gắng dùng hàm “%s†như mảng" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "tham chiếu đến phần tá»­ chưa khởi tạo “%s[â€%.*sâ€]â€" -- cgit v1.2.3 From 1752d5ee472ce827ee66ea38c33085123575a033 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Feb 2015 08:59:09 +0200 Subject: Make socket open not immediately fatal. --- ChangeLog | 7 +++++++ io.c | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f024ec17..fe40c28f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-02-27 Andrew J. Schorr + + * io.c (socketopen): New parameter hard_error; set it if + getaddrinfo() fails. Change fatals to warnings. + (devopen): Pass in address of boolean hard_error variable + and stop trying to open the file if hard_error is true. + 2015-02-24 Arnold D. Robbins * POSIX.STD: Update copyright year. diff --git a/io.c b/io.c index f975353e..b00aa300 100644 --- a/io.c +++ b/io.c @@ -1466,7 +1466,7 @@ str2mode(const char *mode) static int socketopen(int family, int type, const char *localpname, - const char *remotepname, const char *remotehostname) + const char *remotepname, const char *remotehostname, bool *hard_error) { struct addrinfo *lres, *lres0; struct addrinfo lhints; @@ -1485,8 +1485,11 @@ socketopen(int family, int type, const char *localpname, lerror = getaddrinfo(NULL, localpname, & lhints, & lres); if (lerror) { - if (strcmp(localpname, "0") != 0) - fatal(_("local port %s invalid in `/inet'"), localpname); + if (strcmp(localpname, "0") != 0) { + warning(_("local port %s invalid in `/inet'"), localpname); + *hard_error = true; + return INVALID_HANDLE; + } lres0 = NULL; lres = & lhints; } else @@ -1504,7 +1507,9 @@ socketopen(int family, int type, const char *localpname, if (rerror) { if (lres0 != NULL) freeaddrinfo(lres0); - fatal(_("remote host and port information (%s, %s) invalid"), remotehostname, remotepname); + warning(_("remote host and port information (%s, %s) invalid"), remotehostname, remotepname); + *hard_error = true; + return INVALID_HANDLE; } rres0 = rres; socket_fd = INVALID_HANDLE; @@ -1668,6 +1673,7 @@ devopen(const char *name, const char *mode) static bool first_time = true; unsigned long retries = 0; static long msleep = 1000; + bool hard_error = false; if (first_time) { char *cp, *end; @@ -1697,9 +1703,9 @@ devopen(const char *name, const char *mode) retries = def_retries; do { - openfd = socketopen(isi.family, isi.protocol, name+isi.localport.offset, name+isi.remoteport.offset, name+isi.remotehost.offset); + openfd = socketopen(isi.family, isi.protocol, name+isi.localport.offset, name+isi.remoteport.offset, name+isi.remotehost.offset, & hard_error); retries--; - } while (openfd == INVALID_HANDLE && retries > 0 && usleep(msleep) == 0); + } while (openfd == INVALID_HANDLE && ! hard_error && retries > 0 && usleep(msleep) == 0); } /* restore original name string */ -- cgit v1.2.3 From 765d3a443f5121f148d47ec813069e1257212d5e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Feb 2015 09:06:01 +0200 Subject: For non-fatal sockets, get a better error message. --- ChangeLog | 2 ++ io.c | 8 +++++++- test/ChangeLog | 4 ++++ test/nonfatal1.ok | 4 ++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe40c28f..a0d233f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ getaddrinfo() fails. Change fatals to warnings. (devopen): Pass in address of boolean hard_error variable and stop trying to open the file if hard_error is true. + Save and restore errno around call to socketopen() and + use restored errno if open() fails at strictopen. 2015-02-24 Arnold D. Robbins diff --git a/io.c b/io.c index b00aa300..af963a80 100644 --- a/io.c +++ b/io.c @@ -1618,6 +1618,7 @@ devopen(const char *name, const char *mode) char *ptr; int flag = 0; struct inet_socket_info isi; + int save_errno = 0; if (strcmp(name, "-") == 0) return fileno(stdin); @@ -1702,10 +1703,12 @@ devopen(const char *name, const char *mode) } retries = def_retries; + errno = 0; do { openfd = socketopen(isi.family, isi.protocol, name+isi.localport.offset, name+isi.remoteport.offset, name+isi.remotehost.offset, & hard_error); retries--; } while (openfd == INVALID_HANDLE && ! hard_error && retries > 0 && usleep(msleep) == 0); + save_errno = errno; } /* restore original name string */ @@ -1717,8 +1720,11 @@ devopen(const char *name, const char *mode) } strictopen: - if (openfd == INVALID_HANDLE) + if (openfd == INVALID_HANDLE) { openfd = open(name, flag, 0666); + if (openfd == INVALID_HANDLE && save_errno) + errno = save_errno; + } #if defined(__EMX__) || defined(__MINGW32__) if (openfd == INVALID_HANDLE && errno == EACCES) { /* On OS/2 and Windows directory access via open() is diff --git a/test/ChangeLog b/test/ChangeLog index 43482705..3b9f494f 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2015-02-27 Arnold D. Robbins + + * nonfatal1.ok: Update after code changes. + 2015-02-26 Arnold D. Robbins * Makefile.am (EXTRA_DIST): Add profile0.in which got forgotten diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok index b96b8e27..b22393b2 100644 --- a/test/nonfatal1.ok +++ b/test/nonfatal1.ok @@ -1,2 +1,2 @@ -gawk: nonfatal1.awk:3: fatal: remote host and port information (ti10, 357) invalid -EXIT CODE: 2 +gawk: nonfatal1.awk:3: warning: remote host and port information (ti10, 357) invalid +Connection timed out -- cgit v1.2.3 From 9adb80ce25def725ddd98d63f62e35a27e04c570 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Feb 2015 09:09:11 +0200 Subject: Improve missing_d/getaddrinfo.[ch]. --- missing_d/ChangeLog | 6 ++++++ missing_d/getaddrinfo.c | 16 ++++++++++++---- missing_d/getaddrinfo.h | 2 ++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog index 70fbde64..89dbdb4d 100644 --- a/missing_d/ChangeLog +++ b/missing_d/ChangeLog @@ -1,3 +1,9 @@ +2015-02-27 Arnold D. Robbins + + * getaddrinfo.h (gai_strerror): Add declaration. + * getaddrinfo.c (gai_strerror): New function. + (getaddrinfo): Return errno values instead of just -1. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff --git a/missing_d/getaddrinfo.c b/missing_d/getaddrinfo.c index 677f27d0..f24ac598 100644 --- a/missing_d/getaddrinfo.c +++ b/missing_d/getaddrinfo.c @@ -12,6 +12,8 @@ #ifdef HAVE_ARPA_INET_H #include #endif +#include +#include /* strerror */ #include "getaddrinfo.h" @@ -29,12 +31,12 @@ getaddrinfo(const char *hostname, const char *portname, { struct addrinfo *out; if (res == NULL) - return -1; + return EINVAL; out = (struct addrinfo *) malloc(sizeof(*out)); if (out == NULL) { *res = NULL; - return -1; + return ENOMEM; } memset(out, '\0', sizeof(*out)); @@ -42,7 +44,7 @@ getaddrinfo(const char *hostname, const char *portname, if (out->ai_addr == NULL) { free(out); *res = NULL; - return -1; + return ENOMEM; } out->ai_socktype = SOCK_STREAM; @@ -78,7 +80,7 @@ getaddrinfo(const char *hostname, const char *portname, = ((struct in_addr *)he->h_addr_list[0])->s_addr; } else { freeaddrinfo(out); - return -1; + return EADDRNOTAVAIL; } } else { if (!(out->ai_flags & AI_PASSIVE)) @@ -109,4 +111,10 @@ getaddrinfo(const char *hostname, const char *portname, return 0; } + +const char * +gai_strerror(int errcode) +{ + return strerror(errcode); +} #endif diff --git a/missing_d/getaddrinfo.h b/missing_d/getaddrinfo.h index 3d816c93..873d67df 100644 --- a/missing_d/getaddrinfo.h +++ b/missing_d/getaddrinfo.h @@ -29,3 +29,5 @@ void freeaddrinfo(struct xaddrinfo * res); int getaddrinfo(const char * hostname, const char * portname, struct xaddrinfo * hints, struct xaddrinfo ** res); + +const char *gai_strerror(int errcode); -- cgit v1.2.3 From 64854e87c6b07ddc8d7a687decefaf5ae3a5c9fb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Feb 2015 11:26:29 +0200 Subject: Change update-date and fix copyright year. --- doc/ChangeLog | 4 ++++ doc/gawk.texi | 4 ++-- doc/gawktexi.in | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index bee6e3e0..1172c285 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-27 Arnold D. Robbins + + * gawktexi.in: Update UPDATE-MONTH and copyright year. + 2015-02-24 Arnold D. Robbins * texinfo.tex: Update to most current version. diff --git a/doc/gawk.texi b/doc/gawk.texi index 27aaa74f..e963992a 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -51,7 +51,7 @@ @c applies to and all the info about who's publishing this edition @c These apply across the board. -@set UPDATE-MONTH September, 2014 +@set UPDATE-MONTH February, 2015 @set VERSION 4.1 @set PATCHLEVEL 2 @@ -299,7 +299,7 @@ Fax: +1-617-542-2652 Email: gnu@@gnu.org URL: http://www.gnu.org/ -Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2014 +Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2015 Free Software Foundation, Inc. All Rights Reserved. @end docbook diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 450d1e5d..f7e3ee21 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -46,7 +46,7 @@ @c applies to and all the info about who's publishing this edition @c These apply across the board. -@set UPDATE-MONTH September, 2014 +@set UPDATE-MONTH February, 2015 @set VERSION 4.1 @set PATCHLEVEL 2 @@ -294,7 +294,7 @@ Fax: +1-617-542-2652 Email: gnu@@gnu.org URL: http://www.gnu.org/ -Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2014 +Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2015 Free Software Foundation, Inc. All Rights Reserved. @end docbook -- cgit v1.2.3 From 73fe58f8ed3ba97f703d3e516d0f502a6aa5b907 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Feb 2015 13:56:04 +0200 Subject: Minor doc update. --- doc/ChangeLog | 3 +++ doc/gawk.texi | 3 +++ doc/gawktexi.in | 3 +++ 3 files changed, 9 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 1172c285..d9679147 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,9 @@ 2015-02-27 Arnold D. Robbins * gawktexi.in: Update UPDATE-MONTH and copyright year. + Note that "the guide is definitive" quote is really + from "The Restaurant at the End of the Universe". Thanks + to Antonio Colombo for pointing this out. 2015-02-24 Arnold D. Robbins diff --git a/doc/gawk.texi b/doc/gawk.texi index e963992a..8a2de8b7 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -12003,6 +12003,9 @@ the string constant @code{"0"} is actually true, because it is non-null. @i{The Guide is definitive. Reality is frequently inaccurate.} @author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy} @end quotation +@c 2/2015: Antonio Colombo points out that this is really from +@c The Restaurant at the End of the Universe. But I'm going to +@c leave it alone. @cindex comparison expressions @cindex expressions, comparison diff --git a/doc/gawktexi.in b/doc/gawktexi.in index f7e3ee21..aecf8e54 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -11331,6 +11331,9 @@ the string constant @code{"0"} is actually true, because it is non-null. @i{The Guide is definitive. Reality is frequently inaccurate.} @author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy} @end quotation +@c 2/2015: Antonio Colombo points out that this is really from +@c The Restaurant at the End of the Universe. But I'm going to +@c leave it alone. @cindex comparison expressions @cindex expressions, comparison -- cgit v1.2.3 From 2d70e84851f48e1e4091583ea98f7437d4e080ed Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Feb 2015 13:57:03 +0200 Subject: Small bug fix. --- ChangeLog | 4 ++++ symbol.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 610cc4fe..88a96875 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-02-27 Arnold D. Robbins + + * symbol.c (check_param_names): Fix argument order in memset() call. + 2015-02-24 Arnold D. Robbins * POSIX.STD: Update copyright year. diff --git a/symbol.c b/symbol.c index d698299b..845d3797 100644 --- a/symbol.c +++ b/symbol.c @@ -642,7 +642,7 @@ check_param_names(void) max = func_table->table_size * 2; - memset(& n, sizeof n, 0); + memset(& n, 0, sizeof n); n.type = Node_val; n.flags = STRING|STRCUR; n.stfmt = -1; -- cgit v1.2.3 From d8fd5725c32a6aa76eb8438adc0c912e6ad2696b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Feb 2015 13:58:29 +0200 Subject: Small configuration fix. --- ChangeLog | 3 ++ configh.in | 3 -- configure | 141 ++++++++++++++++++++++++++++++++++++----------------------- configure.ac | 6 +-- 4 files changed, 93 insertions(+), 60 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88a96875..a23f0316 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2015-02-27 Arnold D. Robbins * symbol.c (check_param_names): Fix argument order in memset() call. + * configure.ac: Use AC_SEARCH_LIBS instead of AC_CHECK_LIB. This fixes + a long-standing problem where `-lm' was used twice in the final + compilation line. 2015-02-24 Arnold D. Robbins diff --git a/configh.in b/configh.in index 7ef6678d..f7ec5c91 100644 --- a/configh.in +++ b/configh.in @@ -96,9 +96,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - /* Define to 1 if you have a fully functional readline library. */ #undef HAVE_LIBREADLINE diff --git a/configure b/configure index b51250ae..2595fe3b 100755 --- a/configure +++ b/configure @@ -9600,13 +9600,12 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmod in -lm" >&5 -$as_echo_n "checking for fmod in -lm... " >&6; } -if ${ac_cv_lib_m_fmod+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fmod" >&5 +$as_echo_n "checking for library containing fmod... " >&6; } +if ${ac_cv_search_fmod+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9625,33 +9624,44 @@ return fmod (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_fmod=yes -else - ac_cv_lib_m_fmod=no +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_fmod=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_fmod+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fmod" >&5 -$as_echo "$ac_cv_lib_m_fmod" >&6; } -if test "x$ac_cv_lib_m_fmod" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +done +if ${ac_cv_search_fmod+:} false; then : - LIBS="-lm $LIBS" +else + ac_cv_search_fmod=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fmod" >&5 +$as_echo "$ac_cv_search_fmod" >&6; } +ac_res=$ac_cv_search_fmod +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf in -lm" >&5 -$as_echo_n "checking for isinf in -lm... " >&6; } -if ${ac_cv_lib_m_isinf+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing isinf" >&5 +$as_echo_n "checking for library containing isinf... " >&6; } +if ${ac_cv_search_isinf+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9670,33 +9680,44 @@ return isinf (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_isinf=yes -else - ac_cv_lib_m_isinf=no +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_isinf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_isinf+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isinf" >&5 -$as_echo "$ac_cv_lib_m_isinf" >&6; } -if test "x$ac_cv_lib_m_isinf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +done +if ${ac_cv_search_isinf+:} false; then : - LIBS="-lm $LIBS" +else + ac_cv_search_isinf=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_isinf" >&5 +$as_echo "$ac_cv_search_isinf" >&6; } +ac_res=$ac_cv_search_isinf +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ismod in -lm" >&5 -$as_echo_n "checking for ismod in -lm... " >&6; } -if ${ac_cv_lib_m_ismod+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ismod" >&5 +$as_echo_n "checking for library containing ismod... " >&6; } +if ${ac_cv_search_ismod+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9715,23 +9736,35 @@ return ismod (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_ismod=yes -else - ac_cv_lib_m_ismod=no +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_ismod=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_ismod+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ismod" >&5 -$as_echo "$ac_cv_lib_m_ismod" >&6; } -if test "x$ac_cv_lib_m_ismod" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +done +if ${ac_cv_search_ismod+:} false; then : - LIBS="-lm $LIBS" +else + ac_cv_search_ismod=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ismod" >&5 +$as_echo "$ac_cv_search_ismod" >&6; } +ac_res=$ac_cv_search_ismod +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi diff --git a/configure.ac b/configure.ac index 8dd79aae..7633e2e4 100644 --- a/configure.ac +++ b/configure.ac @@ -261,9 +261,9 @@ AC_CHECK_FUNC(getaddrinfo, [AC_DEFINE(HAVE_GETADDRINFO, 1, [have getaddrinfo])], [AC_DEFINE(HAVE_GETADDRINFO, 1, [have getaddrinfo])])]) -AC_CHECK_LIB(m, fmod) -AC_CHECK_LIB(m, isinf) -AC_CHECK_LIB(m, ismod) +AC_SEARCH_LIBS(fmod, m) +AC_SEARCH_LIBS(isinf, m) +AC_SEARCH_LIBS(ismod, m) dnl Don't look for libsigsegv on OSF/1, gives us severe headaches case $host_os in osf1) : ;; -- cgit v1.2.3 From 9fa41fc2c183d5920d64e6f34f8a6bb325188443 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sat, 28 Feb 2015 15:26:40 -0500 Subject: Improve testing for nonfatal socket connection attempts. --- ChangeLog | 5 +++++ io.c | 6 ++++-- test/ChangeLog | 11 +++++++++++ test/Makefile.am | 4 +++- test/Makefile.in | 9 ++++++++- test/Maketests | 5 +++++ test/nonfatal1.awk | 3 ++- test/nonfatal1.ok | 4 ++-- test/nonfatal3.awk | 6 ++++++ test/nonfatal3.ok | 1 + 10 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 test/nonfatal3.awk create mode 100644 test/nonfatal3.ok diff --git a/ChangeLog b/ChangeLog index a0d233f3..654c96b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-02-28 Andrew J. Schorr + + * io.c (pty_vs_pipe): Remove check for NULL PROCINFO_node, since + this is now checked inside in_PROCINFO. + 2015-02-27 Andrew J. Schorr * io.c (socketopen): New parameter hard_error; set it if diff --git a/io.c b/io.c index af963a80..162fb4e8 100644 --- a/io.c +++ b/io.c @@ -3704,8 +3704,10 @@ pty_vs_pipe(const char *command) #ifdef HAVE_TERMIOS_H NODE *val; - if (PROCINFO_node == NULL) - return false; + /* + * N.B. No need to check for NULL PROCINFO_node, since the + * in_PROCINFO function now checks that for us. + */ val = in_PROCINFO(command, "pty", NULL); if (val) { if ((val->flags & MAYBE_NUM) != 0) diff --git a/test/ChangeLog b/test/ChangeLog index 3b9f494f..5ece0875 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,14 @@ +2015-02-28 Andrew J. Schorr + + * Makefile.am (EXTRA_DIST): Add nonfatal3.{awk,ok}. + (GAWK_EXT_TESTS): Add nonfatal3. + * nonfatal1.awk: Replace "ti10/357" with "local:host/25", since + "local:host" should be a universally bad hostname due to the + invalid ":" character. + * nonfatal1.ok: Update. + * nonfatal3.{awk,ok}: New test for connecting to a TCP port where + nobody is listening. + 2015-02-27 Arnold D. Robbins * nonfatal1.ok: Update after code changes. diff --git a/test/Makefile.am b/test/Makefile.am index 1d652eca..15656ce6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -603,6 +603,8 @@ EXTRA_DIST = \ nonfatal1.ok \ nonfatal2.awk \ nonfatal2.ok \ + nonfatal3.awk \ + nonfatal3.ok \ nonl.awk \ nonl.ok \ noparms.awk \ @@ -1051,7 +1053,7 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ - nonfatal1 nonfatal2 \ + nonfatal1 nonfatal2 nonfatal3 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ profile8 pty1 \ diff --git a/test/Makefile.in b/test/Makefile.in index 65fd461a..87f9bf56 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -860,6 +860,8 @@ EXTRA_DIST = \ nonfatal1.ok \ nonfatal2.awk \ nonfatal2.ok \ + nonfatal3.awk \ + nonfatal3.ok \ nonl.awk \ nonl.ok \ noparms.awk \ @@ -1307,7 +1309,7 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ - nonfatal1 nonfatal2 \ + nonfatal1 nonfatal2 nonfatal3 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ profile8 pty1 \ @@ -3651,6 +3653,11 @@ nonfatal2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + patsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index c9e6a840..a2937451 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1162,6 +1162,11 @@ nonfatal2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + patsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/nonfatal1.awk b/test/nonfatal1.awk index bf821d49..1eb85b1b 100644 --- a/test/nonfatal1.awk +++ b/test/nonfatal1.awk @@ -1,5 +1,6 @@ BEGIN { PROCINFO["NONFATAL"] - print |& "/inet/tcp/0/ti10/357" + # note that ":" is not a valid hostname character + print |& "/inet/tcp/0/local:host/25" print ERRNO } diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok index b22393b2..04fd705d 100644 --- a/test/nonfatal1.ok +++ b/test/nonfatal1.ok @@ -1,2 +1,2 @@ -gawk: nonfatal1.awk:3: warning: remote host and port information (ti10, 357) invalid -Connection timed out +gawk: nonfatal1.awk:4: warning: remote host and port information (local:host, 25) invalid +No such file or directory diff --git a/test/nonfatal3.awk b/test/nonfatal3.awk new file mode 100644 index 00000000..eace9aec --- /dev/null +++ b/test/nonfatal3.awk @@ -0,0 +1,6 @@ +BEGIN { + PROCINFO["NONFATAL"] + # valid host but bogus port + print |& "/inet/tcp/0/localhost/0" + print ERRNO +} diff --git a/test/nonfatal3.ok b/test/nonfatal3.ok new file mode 100644 index 00000000..5d5be35a --- /dev/null +++ b/test/nonfatal3.ok @@ -0,0 +1 @@ +Connection refused -- cgit v1.2.3 From db6a69baecd9b7a98e6de31eec2e20477130d8ef Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 1 Mar 2015 06:14:42 +0200 Subject: Minor doc fix. --- doc/ChangeLog | 5 +++++ doc/gawk.info | 2 +- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d9679147..654d0cc0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-01 Arnold D. Robbins + + * gawktexi.in: Change quotes to @dfn for pseudorandom. + A last-minute O'Reilly fix. + 2015-02-27 Arnold D. Robbins * gawktexi.in: Update UPDATE-MONTH and copyright year. diff --git a/doc/gawk.info b/doc/gawk.info index 1b6a0a99..9c23943c 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -11999,7 +11999,7 @@ numbers. (2) `mawk' uses a different seed each time. (3) Computer-generated random numbers really are not truly random. -They are technically known as "pseudorandom." This means that although +They are technically known as "pseudorandom". This means that although the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again. diff --git a/doc/gawk.texi b/doc/gawk.texi index 8a2de8b7..05d03a61 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -17044,7 +17044,7 @@ for generating random numbers to the value @var{x}. Each seed value leads to a particular sequence of random numbers.@footnote{Computer-generated random numbers really are not truly -random. They are technically known as ``pseudorandom.'' This means +random. They are technically known as @dfn{pseudorandom}. This means that although the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again.} Thus, if the seed is set to the same value a second time, diff --git a/doc/gawktexi.in b/doc/gawktexi.in index aecf8e54..1efff5a1 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -16326,7 +16326,7 @@ for generating random numbers to the value @var{x}. Each seed value leads to a particular sequence of random numbers.@footnote{Computer-generated random numbers really are not truly -random. They are technically known as ``pseudorandom.'' This means +random. They are technically known as @dfn{pseudorandom}. This means that although the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again.} Thus, if the seed is set to the same value a second time, -- cgit v1.2.3 From b8ba9836e05eb96daeed9614f045f5b81a826730 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 2 Mar 2015 10:13:48 -0500 Subject: Fix test nonfatal1. --- test/ChangeLog | 6 ++++++ test/nonfatal1.awk | 2 +- test/nonfatal1.ok | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index 5ece0875..a2862206 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2015-03-02 Andrew J. Schorr + + * nonfatal1.awk: Do not print ERRNO, since the value appears to be + platform-dependent. Instead, print (ERRNO != ""). + * nonfatal1.ok: Update. + 2015-02-28 Andrew J. Schorr * Makefile.am (EXTRA_DIST): Add nonfatal3.{awk,ok}. diff --git a/test/nonfatal1.awk b/test/nonfatal1.awk index 1eb85b1b..a9228f3a 100644 --- a/test/nonfatal1.awk +++ b/test/nonfatal1.awk @@ -2,5 +2,5 @@ BEGIN { PROCINFO["NONFATAL"] # note that ":" is not a valid hostname character print |& "/inet/tcp/0/local:host/25" - print ERRNO + print (ERRNO != "") } diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok index 04fd705d..51583f2c 100644 --- a/test/nonfatal1.ok +++ b/test/nonfatal1.ok @@ -1,2 +1,2 @@ gawk: nonfatal1.awk:4: warning: remote host and port information (local:host, 25) invalid -No such file or directory +1 -- cgit v1.2.3 From 4e3f36b3b90aad7c5f392cd493ec10dbad567ce8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 6 Mar 2015 11:41:43 +0200 Subject: Fix permissions on some of the files in test. --- test/ChangeLog | 5 +++++ test/charasbytes.awk | 0 test/ofs1.awk | 0 test/range1.awk | 0 test/sortglos.awk | 0 test/sortglos.in | 0 6 files changed, 5 insertions(+) mode change 100755 => 100644 test/charasbytes.awk mode change 100755 => 100644 test/ofs1.awk mode change 100755 => 100644 test/range1.awk mode change 100755 => 100644 test/sortglos.awk mode change 100755 => 100644 test/sortglos.in diff --git a/test/ChangeLog b/test/ChangeLog index 6fa24a49..9f97f734 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-03-06 Arnold D. Robbins + + * charasbytes.awk, ofs1.awk, range1.awk, sortglos.awk, + sortglos.in: Remove execute permission. + 2015-02-26 Arnold D. Robbins * Makefile.am (EXTRA_DIST): Add profile0.in which got forgotten diff --git a/test/charasbytes.awk b/test/charasbytes.awk old mode 100755 new mode 100644 diff --git a/test/ofs1.awk b/test/ofs1.awk old mode 100755 new mode 100644 diff --git a/test/range1.awk b/test/range1.awk old mode 100755 new mode 100644 diff --git a/test/sortglos.awk b/test/sortglos.awk old mode 100755 new mode 100644 diff --git a/test/sortglos.in b/test/sortglos.in old mode 100755 new mode 100644 -- cgit v1.2.3 From b108a3ba2ab12dd7274589c6fe09c882df02827c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Mar 2015 06:06:19 +0200 Subject: Make nonfatal override GAWK_SOCK_RETRIES. Document it. --- ChangeLog | 8 ++++++++ doc/ChangeLog | 6 ++++++ doc/gawktexi.in | 10 ++++++++++ io.c | 43 +++++++++++++++++++++++++++---------------- 4 files changed, 51 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62777ab3..cc15ccbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-03-08 Arnold D. Robbins + + * io.c (devopen): Change the logic such that if nonfatal is true + for the socket, don't do retries. Also clean up the formatting + some. At strictopen, check if errno is ENOENT and if so, propagate + the error from getaddrinfo() up to the caller. Add explanatory + comments. + 2015-02-28 Andrew J. Schorr * io.c (pty_vs_pipe): Remove check for NULL PROCINFO_node, since diff --git a/doc/ChangeLog b/doc/ChangeLog index d8c42cb4..b58699a4 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-08 Arnold D. Robbins + + * gawktexi.in: Briefly describe that nonfatal I/O overrides + GAWK_SOCK_RETRIES, in the env var part and in the nonfatal I/O + part. + 2015-03-01 Arnold D. Robbins * gawktexi.in: Change quotes to @dfn for pseudorandom. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 1b99b5bc..8612876e 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -4461,6 +4461,8 @@ wait for input before returning with an error. Controls the number of times @command{gawk} attempts to retry a two-way TCP/IP (socket) connection before giving up. @xref{TCP/IP Networking}. +Note that when nonfatal I/O is enabled (@pxref{Nonfatal}), +@command{gawk} only tries to open a TCP/IP socket once. @item POSIXLY_CORRECT Causes @command{gawk} to switch to POSIX-compatibility @@ -9996,6 +9998,14 @@ For standard output, you may use @code{PROCINFO["-", "NONFATAL"]} or @code{PROCINFO["/dev/stdout", "NONFATAL"]}. For standard error, use @code{PROCINFO["/dev/stderr", "NONFATAL"]}. +When attempting to open a TCP/IP socket (@pxref{TCP/IP Networking}), +@command{gawk} tries multiple times. The @env{GAWK_SOCK_RETRIES} +environment variable (@pxref{Other Environment Variables}) allows you to +override @command{gawk}'s builtin default number of attempts. However, +once nonfatal I/O is enabled for a given socket, @command{gawk} only +retries once, relying on @command{awk}-level code to notice that there +was a problem. + @node Output Summary @section Summary diff --git a/io.c b/io.c index 162fb4e8..55c5d3a5 100644 --- a/io.c +++ b/io.c @@ -1661,20 +1661,20 @@ devopen(const char *name, const char *mode) goto strictopen; } else if (inetfile(name, & isi)) { #ifdef HAVE_SOCKETS - cp = (char *) name; - - /* socketopen requires NUL-terminated strings */ - cp[isi.localport.offset+isi.localport.len] = '\0'; - cp[isi.remotehost.offset+isi.remotehost.len] = '\0'; - /* remoteport comes last, so already NUL-terminated */ - - { #define DEFAULT_RETRIES 20 static unsigned long def_retries = DEFAULT_RETRIES; static bool first_time = true; unsigned long retries = 0; static long msleep = 1000; bool hard_error = false; + bool non_fatal = is_non_fatal_redirect(name); + + cp = (char *) name; + + /* socketopen requires NUL-terminated strings */ + cp[isi.localport.offset+isi.localport.len] = '\0'; + cp[isi.remotehost.offset+isi.remotehost.len] = '\0'; + /* remoteport comes last, so already NUL-terminated */ if (first_time) { char *cp, *end; @@ -1701,28 +1701,39 @@ devopen(const char *name, const char *mode) msleep *= 1000; } } - retries = def_retries; + /* + * PROCINFO["NONFATAL"] or PROCINFO[name, "NONFATAL"] overrrides + * GAWK_SOCK_RETRIES. The explicit code in the program carries + * a bigger stick than the environment variable does. + */ + retries = non_fatal ? 1 : def_retries; errno = 0; do { - openfd = socketopen(isi.family, isi.protocol, name+isi.localport.offset, name+isi.remoteport.offset, name+isi.remotehost.offset, & hard_error); + openfd = socketopen(isi.family, isi.protocol, name+isi.localport.offset, + name+isi.remoteport.offset, name+isi.remotehost.offset, + & hard_error); retries--; } while (openfd == INVALID_HANDLE && ! hard_error && retries > 0 && usleep(msleep) == 0); save_errno = errno; - } - /* restore original name string */ - cp[isi.localport.offset+isi.localport.len] = '/'; - cp[isi.remotehost.offset+isi.remotehost.len] = '/'; + /* restore original name string */ + cp[isi.localport.offset+isi.localport.len] = '/'; + cp[isi.remotehost.offset+isi.remotehost.len] = '/'; #else /* ! HAVE_SOCKETS */ - fatal(_("TCP/IP communications are not supported")); + fatal(_("TCP/IP communications are not supported")); #endif /* HAVE_SOCKETS */ } strictopen: if (openfd == INVALID_HANDLE) { openfd = open(name, flag, 0666); - if (openfd == INVALID_HANDLE && save_errno) + /* + * ENOENT means there is no such name in the filesystem. + * Therefore it's ok to propagate up the error from + * getaddrinfo() that's in save_errno. + */ + if (openfd == INVALID_HANDLE && errno == ENOENT && save_errno) errno = save_errno; } #if defined(__EMX__) || defined(__MINGW32__) -- cgit v1.2.3 From 6237311c0af460dd0ff5cf2ed4f935a33386375c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Mar 2015 06:06:56 +0200 Subject: Commit generated doc from previous commit. --- doc/gawk.info | 1022 +++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 10 + 2 files changed, 525 insertions(+), 507 deletions(-) diff --git a/doc/gawk.info b/doc/gawk.info index cbcf529c..7e548a8e 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -3014,7 +3014,8 @@ used by regular users: `GAWK_SOCK_RETRIES' Controls the number of times `gawk' attempts to retry a two-way TCP/IP (socket) connection before giving up. *Note TCP/IP - Networking::. + Networking::. Note that when nonfatal I/O is enabled (*note + Nonfatal::), `gawk' only tries to open a TCP/IP socket once. `POSIXLY_CORRECT' Causes `gawk' to switch to POSIX-compatibility mode, disabling all @@ -7263,6 +7264,13 @@ For standard output, you may use `PROCINFO["-", "NONFATAL"]' or `PROCINFO["/dev/stdout", "NONFATAL"]'. For standard error, use `PROCINFO["/dev/stderr", "NONFATAL"]'. + When attempting to open a TCP/IP socket (*note TCP/IP Networking::), +`gawk' tries multiple times. The `GAWK_SOCK_RETRIES' environment +variable (*note Other Environment Variables::) allows you to override +`gawk''s builtin default number of attempts. However, once nonfatal +I/O is enabled for a given socket, `gawk' only retries once, relying on +`awk'-level code to notice that there was a problem. +  File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Nonfatal, Up: Printing @@ -34781,511 +34789,511 @@ Ref: AWKPATH Variable-Footnote-1140222 Ref: AWKPATH Variable-Footnote-2140267 Node: AWKLIBPATH Variable140527 Node: Other Environment Variables141783 -Node: Exit Status145301 -Node: Include Files145977 -Node: Loading Shared Libraries149566 -Node: Obsolete150993 -Node: Undocumented151685 -Node: Invoking Summary151952 -Node: Regexp153615 -Node: Regexp Usage155069 -Node: Escape Sequences157106 -Node: Regexp Operators163335 -Ref: Regexp Operators-Footnote-1170745 -Ref: Regexp Operators-Footnote-2170892 -Node: Bracket Expressions170990 -Ref: table-char-classes173005 -Node: Leftmost Longest175947 -Node: Computed Regexps177249 -Node: GNU Regexp Operators180678 -Node: Case-sensitivity184350 -Ref: Case-sensitivity-Footnote-1187235 -Ref: Case-sensitivity-Footnote-2187470 -Node: Regexp Summary187578 -Node: Reading Files189045 -Node: Records191138 -Node: awk split records191871 -Node: gawk split records196800 -Ref: gawk split records-Footnote-1201339 -Node: Fields201376 -Ref: Fields-Footnote-1204154 -Node: Nonconstant Fields204240 -Ref: Nonconstant Fields-Footnote-1206478 -Node: Changing Fields206681 -Node: Field Separators212612 -Node: Default Field Splitting215316 -Node: Regexp Field Splitting216433 -Node: Single Character Fields219783 -Node: Command Line Field Separator220842 -Node: Full Line Fields224059 -Ref: Full Line Fields-Footnote-1225580 -Ref: Full Line Fields-Footnote-2225626 -Node: Field Splitting Summary225727 -Node: Constant Size227801 -Node: Splitting By Content232384 -Ref: Splitting By Content-Footnote-1236349 -Node: Multiple Line236512 -Ref: Multiple Line-Footnote-1242393 -Node: Getline242572 -Node: Plain Getline244779 -Node: Getline/Variable247419 -Node: Getline/File248568 -Node: Getline/Variable/File249953 -Ref: Getline/Variable/File-Footnote-1251556 -Node: Getline/Pipe251643 -Node: Getline/Variable/Pipe254321 -Node: Getline/Coprocess255452 -Node: Getline/Variable/Coprocess256716 -Node: Getline Notes257455 -Node: Getline Summary260249 -Ref: table-getline-variants260661 -Node: Read Timeout261490 -Ref: Read Timeout-Footnote-1265327 -Node: Command-line directories265385 -Node: Input Summary266290 -Node: Input Exercises269675 -Node: Printing270403 -Node: Print272238 -Node: Print Examples273695 -Node: Output Separators276474 -Node: OFMT278492 -Node: Printf279847 -Node: Basic Printf280632 -Node: Control Letters282204 -Node: Format Modifiers286189 -Node: Printf Examples292195 -Node: Redirection294681 -Node: Special FD301519 -Ref: Special FD-Footnote-1304685 -Node: Special Files304759 -Node: Other Inherited Files305376 -Node: Special Network306376 -Node: Special Caveats307238 -Node: Close Files And Pipes308187 -Ref: Close Files And Pipes-Footnote-1315372 -Ref: Close Files And Pipes-Footnote-2315520 -Node: Nonfatal315670 -Node: Output Summary317593 -Node: Output Exercises318814 -Node: Expressions319494 -Node: Values320683 -Node: Constants321360 -Node: Scalar Constants322051 -Ref: Scalar Constants-Footnote-1322913 -Node: Nondecimal-numbers323163 -Node: Regexp Constants326173 -Node: Using Constant Regexps326699 -Node: Variables329862 -Node: Using Variables330519 -Node: Assignment Options332430 -Node: Conversion334305 -Node: Strings And Numbers334829 -Ref: Strings And Numbers-Footnote-1337894 -Node: Locale influences conversions338003 -Ref: table-locale-affects340749 -Node: All Operators341341 -Node: Arithmetic Ops341970 -Node: Concatenation344475 -Ref: Concatenation-Footnote-1347294 -Node: Assignment Ops347401 -Ref: table-assign-ops352380 -Node: Increment Ops353690 -Node: Truth Values and Conditions357121 -Node: Truth Values358204 -Node: Typing and Comparison359253 -Node: Variable Typing360069 -Node: Comparison Operators363736 -Ref: table-relational-ops364146 -Node: POSIX String Comparison367641 -Ref: POSIX String Comparison-Footnote-1368713 -Node: Boolean Ops368852 -Ref: Boolean Ops-Footnote-1373330 -Node: Conditional Exp373421 -Node: Function Calls375159 -Node: Precedence379039 -Node: Locales382699 -Node: Expressions Summary384331 -Node: Patterns and Actions386902 -Node: Pattern Overview388022 -Node: Regexp Patterns389701 -Node: Expression Patterns390244 -Node: Ranges394024 -Node: BEGIN/END397131 -Node: Using BEGIN/END397892 -Ref: Using BEGIN/END-Footnote-1400628 -Node: I/O And BEGIN/END400734 -Node: BEGINFILE/ENDFILE403049 -Node: Empty405946 -Node: Using Shell Variables406263 -Node: Action Overview408536 -Node: Statements410862 -Node: If Statement412710 -Node: While Statement414205 -Node: Do Statement416233 -Node: For Statement417381 -Node: Switch Statement420539 -Node: Break Statement422921 -Node: Continue Statement425014 -Node: Next Statement426841 -Node: Nextfile Statement429222 -Node: Exit Statement431850 -Node: Built-in Variables434261 -Node: User-modified435394 -Ref: User-modified-Footnote-1443028 -Node: Auto-set443090 -Ref: Auto-set-Footnote-1456799 -Ref: Auto-set-Footnote-2457004 -Node: ARGC and ARGV457060 -Node: Pattern Action Summary461278 -Node: Arrays463711 -Node: Array Basics465040 -Node: Array Intro465884 -Ref: figure-array-elements467818 -Ref: Array Intro-Footnote-1470438 -Node: Reference to Elements470566 -Node: Assigning Elements473028 -Node: Array Example473519 -Node: Scanning an Array475278 -Node: Controlling Scanning478298 -Ref: Controlling Scanning-Footnote-1483692 -Node: Numeric Array Subscripts484008 -Node: Uninitialized Subscripts486193 -Node: Delete487810 -Ref: Delete-Footnote-1490559 -Node: Multidimensional490616 -Node: Multiscanning493713 -Node: Arrays of Arrays495302 -Node: Arrays Summary500056 -Node: Functions502147 -Node: Built-in503186 -Node: Calling Built-in504264 -Node: Numeric Functions506259 -Ref: Numeric Functions-Footnote-1511077 -Ref: Numeric Functions-Footnote-2511434 -Ref: Numeric Functions-Footnote-3511482 -Node: String Functions511754 -Ref: String Functions-Footnote-1535255 -Ref: String Functions-Footnote-2535384 -Ref: String Functions-Footnote-3535632 -Node: Gory Details535719 -Ref: table-sub-escapes537500 -Ref: table-sub-proposed539015 -Ref: table-posix-sub540377 -Ref: table-gensub-escapes541914 -Ref: Gory Details-Footnote-1542747 -Node: I/O Functions542898 -Ref: I/O Functions-Footnote-1550134 -Node: Time Functions550281 -Ref: Time Functions-Footnote-1560790 -Ref: Time Functions-Footnote-2560858 -Ref: Time Functions-Footnote-3561016 -Ref: Time Functions-Footnote-4561127 -Ref: Time Functions-Footnote-5561239 -Ref: Time Functions-Footnote-6561466 -Node: Bitwise Functions561732 -Ref: table-bitwise-ops562294 -Ref: Bitwise Functions-Footnote-1566622 -Node: Type Functions566794 -Node: I18N Functions567946 -Node: User-defined569593 -Node: Definition Syntax570398 -Ref: Definition Syntax-Footnote-1576057 -Node: Function Example576128 -Ref: Function Example-Footnote-1579049 -Node: Function Caveats579071 -Node: Calling A Function579589 -Node: Variable Scope580547 -Node: Pass By Value/Reference583540 -Node: Return Statement587037 -Node: Dynamic Typing590016 -Node: Indirect Calls590945 -Ref: Indirect Calls-Footnote-1600810 -Node: Functions Summary600938 -Node: Library Functions603640 -Ref: Library Functions-Footnote-1607248 -Ref: Library Functions-Footnote-2607391 -Node: Library Names607562 -Ref: Library Names-Footnote-1611020 -Ref: Library Names-Footnote-2611243 -Node: General Functions611329 -Node: Strtonum Function612432 -Node: Assert Function615454 -Node: Round Function618778 -Node: Cliff Random Function620319 -Node: Ordinal Functions621335 -Ref: Ordinal Functions-Footnote-1624398 -Ref: Ordinal Functions-Footnote-2624650 -Node: Join Function624861 -Ref: Join Function-Footnote-1626631 -Node: Getlocaltime Function626831 -Node: Readfile Function630575 -Node: Shell Quoting632547 -Node: Data File Management633948 -Node: Filetrans Function634580 -Node: Rewind Function638676 -Node: File Checking640062 -Ref: File Checking-Footnote-1641395 -Node: Empty Files641596 -Node: Ignoring Assigns643575 -Node: Getopt Function645125 -Ref: Getopt Function-Footnote-1656589 -Node: Passwd Functions656789 -Ref: Passwd Functions-Footnote-1665629 -Node: Group Functions665717 -Ref: Group Functions-Footnote-1673614 -Node: Walking Arrays673819 -Node: Library Functions Summary676825 -Node: Library Exercises678227 -Node: Sample Programs679507 -Node: Running Examples680277 -Node: Clones681005 -Node: Cut Program682229 -Node: Egrep Program691949 -Ref: Egrep Program-Footnote-1699452 -Node: Id Program699562 -Node: Split Program703238 -Ref: Split Program-Footnote-1706692 -Node: Tee Program706820 -Node: Uniq Program709609 -Node: Wc Program717028 -Ref: Wc Program-Footnote-1721278 -Node: Miscellaneous Programs721372 -Node: Dupword Program722585 -Node: Alarm Program724616 -Node: Translate Program729421 -Ref: Translate Program-Footnote-1733984 -Node: Labels Program734254 -Ref: Labels Program-Footnote-1737605 -Node: Word Sorting737689 -Node: History Sorting741759 -Node: Extract Program743594 -Node: Simple Sed751118 -Node: Igawk Program754188 -Ref: Igawk Program-Footnote-1768514 -Ref: Igawk Program-Footnote-2768715 -Ref: Igawk Program-Footnote-3768837 -Node: Anagram Program768952 -Node: Signature Program772013 -Node: Programs Summary773260 -Node: Programs Exercises774481 -Ref: Programs Exercises-Footnote-1778612 -Node: Advanced Features778703 -Node: Nondecimal Data780685 -Node: Array Sorting782275 -Node: Controlling Array Traversal782975 -Ref: Controlling Array Traversal-Footnote-1791341 -Node: Array Sorting Functions791459 -Ref: Array Sorting Functions-Footnote-1795345 -Node: Two-way I/O795541 -Ref: Two-way I/O-Footnote-1800486 -Ref: Two-way I/O-Footnote-2800672 -Node: TCP/IP Networking800754 -Node: Profiling803626 -Node: Advanced Features Summary811897 -Node: Internationalization813830 -Node: I18N and L10N815310 -Node: Explaining gettext815996 -Ref: Explaining gettext-Footnote-1821021 -Ref: Explaining gettext-Footnote-2821205 -Node: Programmer i18n821370 -Ref: Programmer i18n-Footnote-1826246 -Node: Translator i18n826295 -Node: String Extraction827089 -Ref: String Extraction-Footnote-1828220 -Node: Printf Ordering828306 -Ref: Printf Ordering-Footnote-1831092 -Node: I18N Portability831156 -Ref: I18N Portability-Footnote-1833612 -Node: I18N Example833675 -Ref: I18N Example-Footnote-1836478 -Node: Gawk I18N836550 -Node: I18N Summary837194 -Node: Debugger838534 -Node: Debugging839556 -Node: Debugging Concepts839997 -Node: Debugging Terms841807 -Node: Awk Debugging844379 -Node: Sample Debugging Session845285 -Node: Debugger Invocation845819 -Node: Finding The Bug847204 -Node: List of Debugger Commands853683 -Node: Breakpoint Control855015 -Node: Debugger Execution Control858692 -Node: Viewing And Changing Data862051 -Node: Execution Stack865427 -Node: Debugger Info867062 -Node: Miscellaneous Debugger Commands871107 -Node: Readline Support876108 -Node: Limitations877002 -Node: Debugging Summary879117 -Node: Arbitrary Precision Arithmetic880291 -Node: Computer Arithmetic881707 -Ref: table-numeric-ranges885306 -Ref: Computer Arithmetic-Footnote-1885830 -Node: Math Definitions885887 -Ref: table-ieee-formats889182 -Ref: Math Definitions-Footnote-1889786 -Node: MPFR features889891 -Node: FP Math Caution891562 -Ref: FP Math Caution-Footnote-1892612 -Node: Inexactness of computations892981 -Node: Inexact representation893940 -Node: Comparing FP Values895298 -Node: Errors accumulate896380 -Node: Getting Accuracy897812 -Node: Try To Round900516 -Node: Setting precision901415 -Ref: table-predefined-precision-strings902099 -Node: Setting the rounding mode903928 -Ref: table-gawk-rounding-modes904292 -Ref: Setting the rounding mode-Footnote-1907744 -Node: Arbitrary Precision Integers907923 -Ref: Arbitrary Precision Integers-Footnote-1912821 -Node: POSIX Floating Point Problems912970 -Ref: POSIX Floating Point Problems-Footnote-1916849 -Node: Floating point summary916887 -Node: Dynamic Extensions919074 -Node: Extension Intro920626 -Node: Plugin License921891 -Node: Extension Mechanism Outline922688 -Ref: figure-load-extension923116 -Ref: figure-register-new-function924596 -Ref: figure-call-new-function925600 -Node: Extension API Description927587 -Node: Extension API Functions Introduction929037 -Node: General Data Types933858 -Ref: General Data Types-Footnote-1939758 -Node: Memory Allocation Functions940057 -Ref: Memory Allocation Functions-Footnote-1942896 -Node: Constructor Functions942995 -Node: Registration Functions944734 -Node: Extension Functions945419 -Node: Exit Callback Functions947716 -Node: Extension Version String948964 -Node: Input Parsers949627 -Node: Output Wrappers959502 -Node: Two-way processors964015 -Node: Printing Messages966278 -Ref: Printing Messages-Footnote-1967354 -Node: Updating `ERRNO'967506 -Node: Requesting Values968246 -Ref: table-value-types-returned968973 -Node: Accessing Parameters969930 -Node: Symbol Table Access971164 -Node: Symbol table by name971678 -Node: Symbol table by cookie973698 -Ref: Symbol table by cookie-Footnote-1977843 -Node: Cached values977906 -Ref: Cached values-Footnote-1981402 -Node: Array Manipulation981493 -Ref: Array Manipulation-Footnote-1982591 -Node: Array Data Types982628 -Ref: Array Data Types-Footnote-1985283 -Node: Array Functions985375 -Node: Flattening Arrays989234 -Node: Creating Arrays996136 -Node: Extension API Variables1000907 -Node: Extension Versioning1001543 -Node: Extension API Informational Variables1003434 -Node: Extension API Boilerplate1004499 -Node: Finding Extensions1008308 -Node: Extension Example1008868 -Node: Internal File Description1009640 -Node: Internal File Ops1013707 -Ref: Internal File Ops-Footnote-11025458 -Node: Using Internal File Ops1025598 -Ref: Using Internal File Ops-Footnote-11027981 -Node: Extension Samples1028254 -Node: Extension Sample File Functions1029782 -Node: Extension Sample Fnmatch1037463 -Node: Extension Sample Fork1038951 -Node: Extension Sample Inplace1040166 -Node: Extension Sample Ord1041842 -Node: Extension Sample Readdir1042678 -Ref: table-readdir-file-types1043555 -Node: Extension Sample Revout1044366 -Node: Extension Sample Rev2way1044955 -Node: Extension Sample Read write array1045695 -Node: Extension Sample Readfile1047635 -Node: Extension Sample Time1048730 -Node: Extension Sample API Tests1050078 -Node: gawkextlib1050569 -Node: Extension summary1053247 -Node: Extension Exercises1056936 -Node: Language History1057658 -Node: V7/SVR3.11059314 -Node: SVR41061467 -Node: POSIX1062901 -Node: BTL1064282 -Node: POSIX/GNU1065013 -Node: Feature History1070849 -Node: Common Extensions1084643 -Node: Ranges and Locales1086015 -Ref: Ranges and Locales-Footnote-11090634 -Ref: Ranges and Locales-Footnote-21090661 -Ref: Ranges and Locales-Footnote-31090896 -Node: Contributors1091117 -Node: History summary1096657 -Node: Installation1098036 -Node: Gawk Distribution1098982 -Node: Getting1099466 -Node: Extracting1100289 -Node: Distribution contents1101926 -Node: Unix Installation1108028 -Node: Quick Installation1108711 -Node: Shell Startup Files1111122 -Node: Additional Configuration Options1112201 -Node: Configuration Philosophy1114005 -Node: Non-Unix Installation1116374 -Node: PC Installation1116832 -Node: PC Binary Installation1118152 -Node: PC Compiling1120000 -Ref: PC Compiling-Footnote-11123021 -Node: PC Testing1123130 -Node: PC Using1124306 -Node: Cygwin1128421 -Node: MSYS1129191 -Node: VMS Installation1129692 -Node: VMS Compilation1130484 -Ref: VMS Compilation-Footnote-11131713 -Node: VMS Dynamic Extensions1131771 -Node: VMS Installation Details1133455 -Node: VMS Running1135706 -Node: VMS GNV1138546 -Node: VMS Old Gawk1139281 -Node: Bugs1139751 -Node: Other Versions1143640 -Node: Installation summary1150074 -Node: Notes1151133 -Node: Compatibility Mode1151998 -Node: Additions1152780 -Node: Accessing The Source1153705 -Node: Adding Code1155140 -Node: New Ports1161297 -Node: Derived Files1165779 -Ref: Derived Files-Footnote-11171254 -Ref: Derived Files-Footnote-21171288 -Ref: Derived Files-Footnote-31171884 -Node: Future Extensions1171998 -Node: Implementation Limitations1172604 -Node: Extension Design1173852 -Node: Old Extension Problems1175006 -Ref: Old Extension Problems-Footnote-11176523 -Node: Extension New Mechanism Goals1176580 -Ref: Extension New Mechanism Goals-Footnote-11179940 -Node: Extension Other Design Decisions1180129 -Node: Extension Future Growth1182237 -Node: Old Extension Mechanism1183073 -Node: Notes summary1184835 -Node: Basic Concepts1186021 -Node: Basic High Level1186702 -Ref: figure-general-flow1186974 -Ref: figure-process-flow1187573 -Ref: Basic High Level-Footnote-11190802 -Node: Basic Data Typing1190987 -Node: Glossary1194315 -Node: Copying1226244 -Node: GNU Free Documentation License1263800 -Node: Index1288936 +Node: Exit Status145414 +Node: Include Files146090 +Node: Loading Shared Libraries149679 +Node: Obsolete151106 +Node: Undocumented151798 +Node: Invoking Summary152065 +Node: Regexp153728 +Node: Regexp Usage155182 +Node: Escape Sequences157219 +Node: Regexp Operators163448 +Ref: Regexp Operators-Footnote-1170858 +Ref: Regexp Operators-Footnote-2171005 +Node: Bracket Expressions171103 +Ref: table-char-classes173118 +Node: Leftmost Longest176060 +Node: Computed Regexps177362 +Node: GNU Regexp Operators180791 +Node: Case-sensitivity184463 +Ref: Case-sensitivity-Footnote-1187348 +Ref: Case-sensitivity-Footnote-2187583 +Node: Regexp Summary187691 +Node: Reading Files189158 +Node: Records191251 +Node: awk split records191984 +Node: gawk split records196913 +Ref: gawk split records-Footnote-1201452 +Node: Fields201489 +Ref: Fields-Footnote-1204267 +Node: Nonconstant Fields204353 +Ref: Nonconstant Fields-Footnote-1206591 +Node: Changing Fields206794 +Node: Field Separators212725 +Node: Default Field Splitting215429 +Node: Regexp Field Splitting216546 +Node: Single Character Fields219896 +Node: Command Line Field Separator220955 +Node: Full Line Fields224172 +Ref: Full Line Fields-Footnote-1225693 +Ref: Full Line Fields-Footnote-2225739 +Node: Field Splitting Summary225840 +Node: Constant Size227914 +Node: Splitting By Content232497 +Ref: Splitting By Content-Footnote-1236462 +Node: Multiple Line236625 +Ref: Multiple Line-Footnote-1242506 +Node: Getline242685 +Node: Plain Getline244892 +Node: Getline/Variable247532 +Node: Getline/File248681 +Node: Getline/Variable/File250066 +Ref: Getline/Variable/File-Footnote-1251669 +Node: Getline/Pipe251756 +Node: Getline/Variable/Pipe254434 +Node: Getline/Coprocess255565 +Node: Getline/Variable/Coprocess256829 +Node: Getline Notes257568 +Node: Getline Summary260362 +Ref: table-getline-variants260774 +Node: Read Timeout261603 +Ref: Read Timeout-Footnote-1265440 +Node: Command-line directories265498 +Node: Input Summary266403 +Node: Input Exercises269788 +Node: Printing270516 +Node: Print272351 +Node: Print Examples273808 +Node: Output Separators276587 +Node: OFMT278605 +Node: Printf279960 +Node: Basic Printf280745 +Node: Control Letters282317 +Node: Format Modifiers286302 +Node: Printf Examples292308 +Node: Redirection294794 +Node: Special FD301632 +Ref: Special FD-Footnote-1304798 +Node: Special Files304872 +Node: Other Inherited Files305489 +Node: Special Network306489 +Node: Special Caveats307351 +Node: Close Files And Pipes308300 +Ref: Close Files And Pipes-Footnote-1315485 +Ref: Close Files And Pipes-Footnote-2315633 +Node: Nonfatal315783 +Node: Output Summary318108 +Node: Output Exercises319329 +Node: Expressions320009 +Node: Values321198 +Node: Constants321875 +Node: Scalar Constants322566 +Ref: Scalar Constants-Footnote-1323428 +Node: Nondecimal-numbers323678 +Node: Regexp Constants326688 +Node: Using Constant Regexps327214 +Node: Variables330377 +Node: Using Variables331034 +Node: Assignment Options332945 +Node: Conversion334820 +Node: Strings And Numbers335344 +Ref: Strings And Numbers-Footnote-1338409 +Node: Locale influences conversions338518 +Ref: table-locale-affects341264 +Node: All Operators341856 +Node: Arithmetic Ops342485 +Node: Concatenation344990 +Ref: Concatenation-Footnote-1347809 +Node: Assignment Ops347916 +Ref: table-assign-ops352895 +Node: Increment Ops354205 +Node: Truth Values and Conditions357636 +Node: Truth Values358719 +Node: Typing and Comparison359768 +Node: Variable Typing360584 +Node: Comparison Operators364251 +Ref: table-relational-ops364661 +Node: POSIX String Comparison368156 +Ref: POSIX String Comparison-Footnote-1369228 +Node: Boolean Ops369367 +Ref: Boolean Ops-Footnote-1373845 +Node: Conditional Exp373936 +Node: Function Calls375674 +Node: Precedence379554 +Node: Locales383214 +Node: Expressions Summary384846 +Node: Patterns and Actions387417 +Node: Pattern Overview388537 +Node: Regexp Patterns390216 +Node: Expression Patterns390759 +Node: Ranges394539 +Node: BEGIN/END397646 +Node: Using BEGIN/END398407 +Ref: Using BEGIN/END-Footnote-1401143 +Node: I/O And BEGIN/END401249 +Node: BEGINFILE/ENDFILE403564 +Node: Empty406461 +Node: Using Shell Variables406778 +Node: Action Overview409051 +Node: Statements411377 +Node: If Statement413225 +Node: While Statement414720 +Node: Do Statement416748 +Node: For Statement417896 +Node: Switch Statement421054 +Node: Break Statement423436 +Node: Continue Statement425529 +Node: Next Statement427356 +Node: Nextfile Statement429737 +Node: Exit Statement432365 +Node: Built-in Variables434776 +Node: User-modified435909 +Ref: User-modified-Footnote-1443543 +Node: Auto-set443605 +Ref: Auto-set-Footnote-1457314 +Ref: Auto-set-Footnote-2457519 +Node: ARGC and ARGV457575 +Node: Pattern Action Summary461793 +Node: Arrays464226 +Node: Array Basics465555 +Node: Array Intro466399 +Ref: figure-array-elements468333 +Ref: Array Intro-Footnote-1470953 +Node: Reference to Elements471081 +Node: Assigning Elements473543 +Node: Array Example474034 +Node: Scanning an Array475793 +Node: Controlling Scanning478813 +Ref: Controlling Scanning-Footnote-1484207 +Node: Numeric Array Subscripts484523 +Node: Uninitialized Subscripts486708 +Node: Delete488325 +Ref: Delete-Footnote-1491074 +Node: Multidimensional491131 +Node: Multiscanning494228 +Node: Arrays of Arrays495817 +Node: Arrays Summary500571 +Node: Functions502662 +Node: Built-in503701 +Node: Calling Built-in504779 +Node: Numeric Functions506774 +Ref: Numeric Functions-Footnote-1511592 +Ref: Numeric Functions-Footnote-2511949 +Ref: Numeric Functions-Footnote-3511997 +Node: String Functions512269 +Ref: String Functions-Footnote-1535770 +Ref: String Functions-Footnote-2535899 +Ref: String Functions-Footnote-3536147 +Node: Gory Details536234 +Ref: table-sub-escapes538015 +Ref: table-sub-proposed539530 +Ref: table-posix-sub540892 +Ref: table-gensub-escapes542429 +Ref: Gory Details-Footnote-1543262 +Node: I/O Functions543413 +Ref: I/O Functions-Footnote-1550649 +Node: Time Functions550796 +Ref: Time Functions-Footnote-1561305 +Ref: Time Functions-Footnote-2561373 +Ref: Time Functions-Footnote-3561531 +Ref: Time Functions-Footnote-4561642 +Ref: Time Functions-Footnote-5561754 +Ref: Time Functions-Footnote-6561981 +Node: Bitwise Functions562247 +Ref: table-bitwise-ops562809 +Ref: Bitwise Functions-Footnote-1567137 +Node: Type Functions567309 +Node: I18N Functions568461 +Node: User-defined570108 +Node: Definition Syntax570913 +Ref: Definition Syntax-Footnote-1576572 +Node: Function Example576643 +Ref: Function Example-Footnote-1579564 +Node: Function Caveats579586 +Node: Calling A Function580104 +Node: Variable Scope581062 +Node: Pass By Value/Reference584055 +Node: Return Statement587552 +Node: Dynamic Typing590531 +Node: Indirect Calls591460 +Ref: Indirect Calls-Footnote-1601325 +Node: Functions Summary601453 +Node: Library Functions604155 +Ref: Library Functions-Footnote-1607763 +Ref: Library Functions-Footnote-2607906 +Node: Library Names608077 +Ref: Library Names-Footnote-1611535 +Ref: Library Names-Footnote-2611758 +Node: General Functions611844 +Node: Strtonum Function612947 +Node: Assert Function615969 +Node: Round Function619293 +Node: Cliff Random Function620834 +Node: Ordinal Functions621850 +Ref: Ordinal Functions-Footnote-1624913 +Ref: Ordinal Functions-Footnote-2625165 +Node: Join Function625376 +Ref: Join Function-Footnote-1627146 +Node: Getlocaltime Function627346 +Node: Readfile Function631090 +Node: Shell Quoting633062 +Node: Data File Management634463 +Node: Filetrans Function635095 +Node: Rewind Function639191 +Node: File Checking640577 +Ref: File Checking-Footnote-1641910 +Node: Empty Files642111 +Node: Ignoring Assigns644090 +Node: Getopt Function645640 +Ref: Getopt Function-Footnote-1657104 +Node: Passwd Functions657304 +Ref: Passwd Functions-Footnote-1666144 +Node: Group Functions666232 +Ref: Group Functions-Footnote-1674129 +Node: Walking Arrays674334 +Node: Library Functions Summary677340 +Node: Library Exercises678742 +Node: Sample Programs680022 +Node: Running Examples680792 +Node: Clones681520 +Node: Cut Program682744 +Node: Egrep Program692464 +Ref: Egrep Program-Footnote-1699967 +Node: Id Program700077 +Node: Split Program703753 +Ref: Split Program-Footnote-1707207 +Node: Tee Program707335 +Node: Uniq Program710124 +Node: Wc Program717543 +Ref: Wc Program-Footnote-1721793 +Node: Miscellaneous Programs721887 +Node: Dupword Program723100 +Node: Alarm Program725131 +Node: Translate Program729936 +Ref: Translate Program-Footnote-1734499 +Node: Labels Program734769 +Ref: Labels Program-Footnote-1738120 +Node: Word Sorting738204 +Node: History Sorting742274 +Node: Extract Program744109 +Node: Simple Sed751633 +Node: Igawk Program754703 +Ref: Igawk Program-Footnote-1769029 +Ref: Igawk Program-Footnote-2769230 +Ref: Igawk Program-Footnote-3769352 +Node: Anagram Program769467 +Node: Signature Program772528 +Node: Programs Summary773775 +Node: Programs Exercises774996 +Ref: Programs Exercises-Footnote-1779127 +Node: Advanced Features779218 +Node: Nondecimal Data781200 +Node: Array Sorting782790 +Node: Controlling Array Traversal783490 +Ref: Controlling Array Traversal-Footnote-1791856 +Node: Array Sorting Functions791974 +Ref: Array Sorting Functions-Footnote-1795860 +Node: Two-way I/O796056 +Ref: Two-way I/O-Footnote-1801001 +Ref: Two-way I/O-Footnote-2801187 +Node: TCP/IP Networking801269 +Node: Profiling804141 +Node: Advanced Features Summary812412 +Node: Internationalization814345 +Node: I18N and L10N815825 +Node: Explaining gettext816511 +Ref: Explaining gettext-Footnote-1821536 +Ref: Explaining gettext-Footnote-2821720 +Node: Programmer i18n821885 +Ref: Programmer i18n-Footnote-1826761 +Node: Translator i18n826810 +Node: String Extraction827604 +Ref: String Extraction-Footnote-1828735 +Node: Printf Ordering828821 +Ref: Printf Ordering-Footnote-1831607 +Node: I18N Portability831671 +Ref: I18N Portability-Footnote-1834127 +Node: I18N Example834190 +Ref: I18N Example-Footnote-1836993 +Node: Gawk I18N837065 +Node: I18N Summary837709 +Node: Debugger839049 +Node: Debugging840071 +Node: Debugging Concepts840512 +Node: Debugging Terms842322 +Node: Awk Debugging844894 +Node: Sample Debugging Session845800 +Node: Debugger Invocation846334 +Node: Finding The Bug847719 +Node: List of Debugger Commands854198 +Node: Breakpoint Control855530 +Node: Debugger Execution Control859207 +Node: Viewing And Changing Data862566 +Node: Execution Stack865942 +Node: Debugger Info867577 +Node: Miscellaneous Debugger Commands871622 +Node: Readline Support876623 +Node: Limitations877517 +Node: Debugging Summary879632 +Node: Arbitrary Precision Arithmetic880806 +Node: Computer Arithmetic882222 +Ref: table-numeric-ranges885821 +Ref: Computer Arithmetic-Footnote-1886345 +Node: Math Definitions886402 +Ref: table-ieee-formats889697 +Ref: Math Definitions-Footnote-1890301 +Node: MPFR features890406 +Node: FP Math Caution892077 +Ref: FP Math Caution-Footnote-1893127 +Node: Inexactness of computations893496 +Node: Inexact representation894455 +Node: Comparing FP Values895813 +Node: Errors accumulate896895 +Node: Getting Accuracy898327 +Node: Try To Round901031 +Node: Setting precision901930 +Ref: table-predefined-precision-strings902614 +Node: Setting the rounding mode904443 +Ref: table-gawk-rounding-modes904807 +Ref: Setting the rounding mode-Footnote-1908259 +Node: Arbitrary Precision Integers908438 +Ref: Arbitrary Precision Integers-Footnote-1913336 +Node: POSIX Floating Point Problems913485 +Ref: POSIX Floating Point Problems-Footnote-1917364 +Node: Floating point summary917402 +Node: Dynamic Extensions919589 +Node: Extension Intro921141 +Node: Plugin License922406 +Node: Extension Mechanism Outline923203 +Ref: figure-load-extension923631 +Ref: figure-register-new-function925111 +Ref: figure-call-new-function926115 +Node: Extension API Description928102 +Node: Extension API Functions Introduction929552 +Node: General Data Types934373 +Ref: General Data Types-Footnote-1940273 +Node: Memory Allocation Functions940572 +Ref: Memory Allocation Functions-Footnote-1943411 +Node: Constructor Functions943510 +Node: Registration Functions945249 +Node: Extension Functions945934 +Node: Exit Callback Functions948231 +Node: Extension Version String949479 +Node: Input Parsers950142 +Node: Output Wrappers960017 +Node: Two-way processors964530 +Node: Printing Messages966793 +Ref: Printing Messages-Footnote-1967869 +Node: Updating `ERRNO'968021 +Node: Requesting Values968761 +Ref: table-value-types-returned969488 +Node: Accessing Parameters970445 +Node: Symbol Table Access971679 +Node: Symbol table by name972193 +Node: Symbol table by cookie974213 +Ref: Symbol table by cookie-Footnote-1978358 +Node: Cached values978421 +Ref: Cached values-Footnote-1981917 +Node: Array Manipulation982008 +Ref: Array Manipulation-Footnote-1983106 +Node: Array Data Types983143 +Ref: Array Data Types-Footnote-1985798 +Node: Array Functions985890 +Node: Flattening Arrays989749 +Node: Creating Arrays996651 +Node: Extension API Variables1001422 +Node: Extension Versioning1002058 +Node: Extension API Informational Variables1003949 +Node: Extension API Boilerplate1005014 +Node: Finding Extensions1008823 +Node: Extension Example1009383 +Node: Internal File Description1010155 +Node: Internal File Ops1014222 +Ref: Internal File Ops-Footnote-11025973 +Node: Using Internal File Ops1026113 +Ref: Using Internal File Ops-Footnote-11028496 +Node: Extension Samples1028769 +Node: Extension Sample File Functions1030297 +Node: Extension Sample Fnmatch1037978 +Node: Extension Sample Fork1039466 +Node: Extension Sample Inplace1040681 +Node: Extension Sample Ord1042357 +Node: Extension Sample Readdir1043193 +Ref: table-readdir-file-types1044070 +Node: Extension Sample Revout1044881 +Node: Extension Sample Rev2way1045470 +Node: Extension Sample Read write array1046210 +Node: Extension Sample Readfile1048150 +Node: Extension Sample Time1049245 +Node: Extension Sample API Tests1050593 +Node: gawkextlib1051084 +Node: Extension summary1053762 +Node: Extension Exercises1057451 +Node: Language History1058173 +Node: V7/SVR3.11059829 +Node: SVR41061982 +Node: POSIX1063416 +Node: BTL1064797 +Node: POSIX/GNU1065528 +Node: Feature History1071364 +Node: Common Extensions1085158 +Node: Ranges and Locales1086530 +Ref: Ranges and Locales-Footnote-11091149 +Ref: Ranges and Locales-Footnote-21091176 +Ref: Ranges and Locales-Footnote-31091411 +Node: Contributors1091632 +Node: History summary1097172 +Node: Installation1098551 +Node: Gawk Distribution1099497 +Node: Getting1099981 +Node: Extracting1100804 +Node: Distribution contents1102441 +Node: Unix Installation1108543 +Node: Quick Installation1109226 +Node: Shell Startup Files1111637 +Node: Additional Configuration Options1112716 +Node: Configuration Philosophy1114520 +Node: Non-Unix Installation1116889 +Node: PC Installation1117347 +Node: PC Binary Installation1118667 +Node: PC Compiling1120515 +Ref: PC Compiling-Footnote-11123536 +Node: PC Testing1123645 +Node: PC Using1124821 +Node: Cygwin1128936 +Node: MSYS1129706 +Node: VMS Installation1130207 +Node: VMS Compilation1130999 +Ref: VMS Compilation-Footnote-11132228 +Node: VMS Dynamic Extensions1132286 +Node: VMS Installation Details1133970 +Node: VMS Running1136221 +Node: VMS GNV1139061 +Node: VMS Old Gawk1139796 +Node: Bugs1140266 +Node: Other Versions1144155 +Node: Installation summary1150589 +Node: Notes1151648 +Node: Compatibility Mode1152513 +Node: Additions1153295 +Node: Accessing The Source1154220 +Node: Adding Code1155655 +Node: New Ports1161812 +Node: Derived Files1166294 +Ref: Derived Files-Footnote-11171769 +Ref: Derived Files-Footnote-21171803 +Ref: Derived Files-Footnote-31172399 +Node: Future Extensions1172513 +Node: Implementation Limitations1173119 +Node: Extension Design1174367 +Node: Old Extension Problems1175521 +Ref: Old Extension Problems-Footnote-11177038 +Node: Extension New Mechanism Goals1177095 +Ref: Extension New Mechanism Goals-Footnote-11180455 +Node: Extension Other Design Decisions1180644 +Node: Extension Future Growth1182752 +Node: Old Extension Mechanism1183588 +Node: Notes summary1185350 +Node: Basic Concepts1186536 +Node: Basic High Level1187217 +Ref: figure-general-flow1187489 +Ref: figure-process-flow1188088 +Ref: Basic High Level-Footnote-11191317 +Node: Basic Data Typing1191502 +Node: Glossary1194830 +Node: Copying1226759 +Node: GNU Free Documentation License1264315 +Node: Index1289451  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 67077117..615330d1 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -4550,6 +4550,8 @@ wait for input before returning with an error. Controls the number of times @command{gawk} attempts to retry a two-way TCP/IP (socket) connection before giving up. @xref{TCP/IP Networking}. +Note that when nonfatal I/O is enabled (@pxref{Nonfatal}), +@command{gawk} only tries to open a TCP/IP socket once. @item POSIXLY_CORRECT Causes @command{gawk} to switch to POSIX-compatibility @@ -10500,6 +10502,14 @@ For standard output, you may use @code{PROCINFO["-", "NONFATAL"]} or @code{PROCINFO["/dev/stdout", "NONFATAL"]}. For standard error, use @code{PROCINFO["/dev/stderr", "NONFATAL"]}. +When attempting to open a TCP/IP socket (@pxref{TCP/IP Networking}), +@command{gawk} tries multiple times. The @env{GAWK_SOCK_RETRIES} +environment variable (@pxref{Other Environment Variables}) allows you to +override @command{gawk}'s builtin default number of attempts. However, +once nonfatal I/O is enabled for a given socket, @command{gawk} only +retries once, relying on @command{awk}-level code to notice that there +was a problem. + @node Output Summary @section Summary -- cgit v1.2.3 From dae49acd6f32a875fed4781f33a926f8013c69b4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Mar 2015 21:21:23 +0200 Subject: Remove unneeded routine. --- ChangeLog | 4 ++++ re.c | 37 ------------------------------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index a23f0316..9dfad08a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-03-08 Arnold D. Robbins + + * re.c (regexflags2str): Removed. It was redundant. + 2015-02-27 Arnold D. Robbins * symbol.c (check_param_names): Fix argument order in memset() call. diff --git a/re.c b/re.c index edb5bc48..7abb9430 100644 --- a/re.c +++ b/re.c @@ -616,40 +616,3 @@ again: done: s[length] = save; } - -/* regexflags2str --- make regex flags printable */ - -const char * -regexflags2str(int flags) -{ - static const struct flagtab regextab[] = { - { RE_BACKSLASH_ESCAPE_IN_LISTS, "RE_BACKSLASH_ESCAPE_IN_LISTS" }, - { RE_BK_PLUS_QM, "RE_BK_PLUS_QM" }, - { RE_CHAR_CLASSES, "RE_CHAR_CLASSES" }, - { RE_CONTEXT_INDEP_ANCHORS, "RE_CONTEXT_INDEP_ANCHORS" }, - { RE_CONTEXT_INDEP_OPS, "RE_CONTEXT_INDEP_OPS" }, - { RE_CONTEXT_INVALID_OPS, "RE_CONTEXT_INVALID_OPS" }, - { RE_DOT_NEWLINE, "RE_DOT_NEWLINE" }, - { RE_DOT_NOT_NULL, "RE_DOT_NOT_NULL" }, - { RE_HAT_LISTS_NOT_NEWLINE, "RE_HAT_LISTS_NOT_NEWLINE" }, - { RE_INTERVALS, "RE_INTERVALS" }, - { RE_LIMITED_OPS, "RE_LIMITED_OPS" }, - { RE_NEWLINE_ALT, "RE_NEWLINE_ALT" }, - { RE_NO_BK_BRACES, "RE_NO_BK_BRACES" }, - { RE_NO_BK_PARENS, "RE_NO_BK_PARENS" }, - { RE_NO_BK_REFS, "RE_NO_BK_REFS" }, - { RE_NO_BK_VBAR, "RE_NO_BK_VBAR" }, - { RE_NO_EMPTY_RANGES, "RE_NO_EMPTY_RANGES" }, - { RE_UNMATCHED_RIGHT_PAREN_ORD, "RE_UNMATCHED_RIGHT_PAREN_ORD" }, - { RE_NO_POSIX_BACKTRACKING, "RE_NO_POSIX_BACKTRACKING" }, - { RE_NO_GNU_OPS, "RE_NO_GNU_OPS" }, - { RE_DEBUG, "RE_DEBUG" }, - { RE_INVALID_INTERVAL_ORD, "RE_INVALID_INTERVAL_ORD" }, - { RE_ICASE, "RE_ICASE" }, - { RE_CARET_ANCHORS_HERE, "RE_CARET_ANCHORS_HERE" }, - { RE_CONTEXT_INVALID_DUP, "RE_CONTEXT_INVALID_DUP" }, - { 0, NULL } - }; - - return genflags2str(flags, regextab); -} -- cgit v1.2.3 From b6c957dae27d5f10393572391c75c51c85a3a68c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Mar 2015 21:25:28 +0200 Subject: Fix nonfatal3 test. --- test/ChangeLog | 5 +++++ test/nonfatal3.awk | 2 +- test/nonfatal3.ok | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index 2652429f..b6338a8d 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-03-08 Arnold D. Robbins + + * nonfatal3.awk, nonfatal3.ok: Adjust for portability. + Thanks to Hermann Peifer for the report. + 2015-03-06 Arnold D. Robbins * charasbytes.awk, ofs1.awk, range1.awk, sortglos.awk, diff --git a/test/nonfatal3.awk b/test/nonfatal3.awk index eace9aec..b2a4ec9e 100644 --- a/test/nonfatal3.awk +++ b/test/nonfatal3.awk @@ -2,5 +2,5 @@ BEGIN { PROCINFO["NONFATAL"] # valid host but bogus port print |& "/inet/tcp/0/localhost/0" - print ERRNO + print ERRNO != "" } diff --git a/test/nonfatal3.ok b/test/nonfatal3.ok index 5d5be35a..d00491fd 100644 --- a/test/nonfatal3.ok +++ b/test/nonfatal3.ok @@ -1 +1 @@ -Connection refused +1 -- cgit v1.2.3 From 8c76e6abfa7857da0ecb64cc545b5cbea2a0ca68 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 10 Mar 2015 06:21:53 +0200 Subject: Add additional fpat test. --- test/ChangeLog | 5 +++ test/Makefile.am | 4 ++- test/Makefile.in | 9 ++++- test/Maketests | 5 +++ test/fpat4.awk | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test/fpat4.ok | 65 ++++++++++++++++++++++++++++++++++ 6 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 test/fpat4.awk create mode 100644 test/fpat4.ok diff --git a/test/ChangeLog b/test/ChangeLog index 9f97f734..8a264e3f 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-03-10 Arnold D. Robbins + + * Makefile.am (fpat4): New test. + * fpat4.awk, fpat4.ok: New files. + 2015-03-06 Arnold D. Robbins * charasbytes.awk, ofs1.awk, range1.awk, sortglos.awk, diff --git a/test/Makefile.am b/test/Makefile.am index 71cfa513..34899943 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -285,6 +285,8 @@ EXTRA_DIST = \ fpat3.awk \ fpat3.in \ fpat3.ok \ + fpat4.awk \ + fpat4.ok \ fpatnull.awk \ fpatnull.in \ fpatnull.ok \ @@ -1034,7 +1036,7 @@ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ - fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ + fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ diff --git a/test/Makefile.in b/test/Makefile.in index 7ac2ad7d..489b0d14 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -542,6 +542,8 @@ EXTRA_DIST = \ fpat3.awk \ fpat3.in \ fpat3.ok \ + fpat4.awk \ + fpat4.ok \ fpatnull.awk \ fpatnull.in \ fpatnull.ok \ @@ -1290,7 +1292,7 @@ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ - fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ + fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ @@ -3462,6 +3464,11 @@ fpat3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index adf95cc5..8c270869 100644 --- a/test/Maketests +++ b/test/Maketests @@ -992,6 +992,11 @@ fpat3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/fpat4.awk b/test/fpat4.awk new file mode 100644 index 00000000..79cd6a7f --- /dev/null +++ b/test/fpat4.awk @@ -0,0 +1,105 @@ +BEGIN { + false = 0 + true = 1 + + fpat[1] = "([^,]*)|(\"[^\"]+\")" + fpat[2] = fpat[1] + fpat[3] = fpat[1] + fpat[4] = "aa+" + fpat[5] = fpat[4] + fpat[6] = "[a-z]" + + data[1] = "Robbins,,Arnold," + data[2] = "Smith,,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA" + data[3] = "Robbins,Arnold,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA" + data[4] = "bbbaaacccdddaaaaaqqqq" + data[5] = "bbbaaacccdddaaaaaqqqqa" # should get trailing qqqa + data[6] = "aAbBcC" + + for (i = 1; i in data; i++) { + printf("Splitting: <%s>\n", data[i]) + n = mypatsplit(data[i], fields, fpat[i], seps) + m = patsplit(data[i], fields2, fpat[i], seps2) + print "n =", n, "m =", m + if (n != m) { + printf("ERROR: counts wrong!\n") > "/dev/stderr" + exit 1 + } + for (j = 1; j <= n; j++) { + printf("fields[%d] = <%s>\tfields2[%d] = <%s>\n", j, fields[j], j, fields2[j]) + if (fields[j] != fields2[j]) { + printf("ERROR: data %d, field %d mismatch!\n", i, j) > "/dev/stderr" + exit 1 + } + } + for (j = 0; j in seps; j++) { + printf("seps[%d] = <%s>\tseps2[%d] = <%s>\n", j, seps[j], j, seps2[j]) + if (seps[j] != seps2[j]) { + printf("ERROR: data %d, separator %d mismatch!\n", i, j) > "/dev/stderr" + exit 1 + } + } + } +} + +function mypatsplit(string, array, pattern, seps, + eosflag, non_empty, nf) # locals +{ + delete array + delete seps + if (length(string) == 0) + return 0 + + eosflag = non_empty = false + nf = 0 + while (match(string, pattern)) { + if (RLENGTH > 0) { # easy case + non_empty = true + if (! (nf in seps)) { + if (RSTART == 1) # match at front of string + seps[nf] = "" + else + seps[nf] = substr(string, 1, RSTART - 1) + } + array[++nf] = substr(string, RSTART, RLENGTH) + string = substr(string, RSTART+RLENGTH) + if (length(string) == 0) + break + } else if (non_empty) { + # last match was non-empty, and at the + # current character we get a zero length match, + # which we don't want, so skip over it + non_empty = false + seps[nf] = substr(string, 1, 1) + string = substr(string, 2) + } else { + # 0 length match + if (! (nf in seps)) { + if (RSTART == 1) + seps[nf] = "" + else + seps[nf] = substr(string, 1, RSTART - 1) + } + array[++nf] = "" + if (! non_empty && ! eosflag) { # prev was empty + seps[nf] = substr(string, 1, 1) + } + if (RSTART == 1) { + string = substr(string, 2) + } else { + string = substr(string, RSTART + 1) + } + non_empty = false + } + if (length(string) == 0) { + if (eosflag) + break + else + eosflag = true + } + } + if (length(string) > 0) + seps[nf] = string + + return length(array) +} diff --git a/test/fpat4.ok b/test/fpat4.ok new file mode 100644 index 00000000..b4430aba --- /dev/null +++ b/test/fpat4.ok @@ -0,0 +1,65 @@ +Splitting: +n = 4 m = 4 +fields[1] = fields2[1] = +fields[2] = <> fields2[2] = <> +fields[3] = fields2[3] = +fields[4] = <> fields2[4] = <> +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +Splitting: +n = 7 m = 7 +fields[1] = fields2[1] = +fields[2] = <> fields2[2] = <> +fields[3] = <"1234 A Pretty Place, NE"> fields2[3] = <"1234 A Pretty Place, NE"> +fields[4] = fields2[4] = +fields[5] = fields2[5] = +fields[6] = <12345-6789> fields2[6] = <12345-6789> +fields[7] = fields2[7] = +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +seps[4] = <,> seps2[4] = <,> +seps[5] = <,> seps2[5] = <,> +seps[6] = <,> seps2[6] = <,> +Splitting: +n = 7 m = 7 +fields[1] = fields2[1] = +fields[2] = fields2[2] = +fields[3] = <"1234 A Pretty Place, NE"> fields2[3] = <"1234 A Pretty Place, NE"> +fields[4] = fields2[4] = +fields[5] = fields2[5] = +fields[6] = <12345-6789> fields2[6] = <12345-6789> +fields[7] = fields2[7] = +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +seps[4] = <,> seps2[4] = <,> +seps[5] = <,> seps2[5] = <,> +seps[6] = <,> seps2[6] = <,> +Splitting: +n = 2 m = 2 +fields[1] = fields2[1] = +fields[2] = fields2[2] = +seps[0] = seps2[0] = +seps[1] = seps2[1] = +seps[2] = seps2[2] = +Splitting: +n = 2 m = 2 +fields[1] = fields2[1] = +fields[2] = fields2[2] = +seps[0] = seps2[0] = +seps[1] = seps2[1] = +seps[2] = seps2[2] = +Splitting: +n = 3 m = 3 +fields[1] = fields2[1] = +fields[2] = fields2[2] = +fields[3] = fields2[3] = +seps[0] = <> seps2[0] = <> +seps[1] = seps2[1] = +seps[2] = seps2[2] = +seps[3] = seps2[3] = -- cgit v1.2.3 From 93a817e1d94bf7227391b131b6df2d1f3e5176cc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 17 Mar 2015 22:27:09 +0200 Subject: Fix a compiler warning. --- extension/ChangeLog | 5 +++++ extension/inplace.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index 749871dc..b10ff17d 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2015-03-17 Arnold D. Robbins + + * inplace.c (do_inplace_begin): Jump through more hoops to satisfy + a newer version of clang. + 2015-02-26 Arnold D. Robbins * Makefile.am (EXTRA_DIST): Add rwarray0.c to the list. diff --git a/extension/inplace.c b/extension/inplace.c index 0693ad92..e3685e30 100644 --- a/extension/inplace.c +++ b/extension/inplace.c @@ -171,10 +171,10 @@ do_inplace_begin(int nargs, awk_value_t *result) /* N.B. chown/chmod should be more portable than fchown/fchmod */ if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) { - /* jumping through hoops to silence gcc. :-( */ + /* jumping through hoops to silence gcc and clang. :-( */ int junk; junk = chown(state.tname, -1, sbuf.st_gid); - junk = junk; + ++junk; } if (chmod(state.tname, sbuf.st_mode) < 0) -- cgit v1.2.3 From 822d727b719ad486bb5eca0f064c69047a424bf5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 17 Mar 2015 22:28:00 +0200 Subject: Document a limitation in the inplace extension. --- extension/ChangeLog | 1 + extension/inplace.3am | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/extension/ChangeLog b/extension/ChangeLog index b10ff17d..9d7e6173 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -2,6 +2,7 @@ * inplace.c (do_inplace_begin): Jump through more hoops to satisfy a newer version of clang. + * inplace.3am (BUGS): Add new section and documentation. 2015-02-26 Arnold D. Robbins diff --git a/extension/inplace.3am b/extension/inplace.3am index 5ca04be2..d6339c4a 100644 --- a/extension/inplace.3am +++ b/extension/inplace.3am @@ -1,4 +1,4 @@ -.TH INPLACE 3am "Jan 15 2013" "Free Software Foundation" "GNU Awk Extension Modules" +.TH INPLACE 3am "Mar 16 2015" "Free Software Foundation" "GNU Awk Extension Modules" .SH NAME inplace \- emulate sed/perl/ruby in-place editing .SH SYNOPSIS @@ -45,7 +45,10 @@ extension concatenates that suffix onto the original filename and uses the result as a filename for renaming the original. ... .SH NOTES -... .SH BUGS +.SH BUGS +As currently written, output from an \f(CWENDFILE\fP +rule does not get redirected into the replacement file. +Neither does output from an \f(CWEND\fP rule. .SH EXAMPLE .ft CW .nf -- cgit v1.2.3 From 1b047a42077ca58eeeaa93e0561c0b589350702b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 17 Mar 2015 22:28:56 +0200 Subject: Documentation fix: positive -> nonnegative as appropriate. --- doc/ChangeLog | 6 + doc/gawk.info | 943 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 12 +- doc/gawktexi.in | 12 +- 4 files changed, 489 insertions(+), 484 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 654d0cc0..f8a317fa 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-17 Arnold D. Robbins + + * gawktexi.in: Turn "positive" into non-negative as appropriate. + Thanks to Nicholas Mills for pointing out + the issue. + 2015-03-01 Arnold D. Robbins * gawktexi.in: Change quotes to @dfn for pseudorandom. diff --git a/doc/gawk.info b/doc/gawk.info index 9c23943c..2d4fd906 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -5097,9 +5097,9 @@ the built-in variable `FIELDWIDTHS'. Each number specifies the width of the field, _including_ columns between fields. If you want to ignore the columns between fields, you can specify the width as a separate field that is subsequently ignored. It is a fatal error to -supply a field width that is not a positive number. The following data -is the output of the Unix `w' utility. It is useful to illustrate the -use of `FIELDWIDTHS': +supply a field width that has a negative value. The following data is +the output of the Unix `w' utility. It is useful to illustrate the use +of `FIELDWIDTHS': 10:06pm up 21 days, 14:04, 23 users User tty login idle JCPU PCPU what @@ -10851,7 +10851,7 @@ be used as an array index. including a specification of how many elements or components they contain. In such languages, the declaration causes a contiguous block of memory to be allocated for that many elements. Usually, an index in -the array must be a positive integer. For example, the index zero +the array must be a nonnegative integer. For example, the index zero specifies the first element in the array, which is actually stored at the beginning of the block of memory. Index one specifies the second element, which is stored in memory right after the first element, and @@ -10906,8 +10906,8 @@ It has elements 0-3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or 9. Another consequence of associative arrays is that the indices don't -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 +have to be nonnegative 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 Value @@ -11078,7 +11078,7 @@ File: gawk.info, Node: Scanning an Array, Next: Controlling Scanning, Prev: A In programs that use arrays, it is often necessary to use a loop that executes once for each element of an array. In other languages, where -arrays are contiguous and indices are limited to positive integers, +arrays are contiguous and indices are limited to nonnegative integers, this is easy: all the valid indices can be found by counting from the lowest index up to the highest. This technique won't do the job in `awk', because any number or string can be an array index. So `awk' @@ -21791,8 +21791,7 @@ Integer arithmetic In computers, integer values come in two flavors: "signed" and "unsigned". Signed values may be negative or positive, whereas - unsigned values are always positive (i.e., greater than or equal - to zero). + unsigned values are always greater than or equal to zero. In computer systems, integer arithmetic is exact, but the possible range of values is limited. Integer arithmetic is generally @@ -34579,468 +34578,468 @@ Ref: Full Line Fields-Footnote-1225370 Ref: Full Line Fields-Footnote-2225416 Node: Field Splitting Summary225517 Node: Constant Size227591 -Node: Splitting By Content232174 -Ref: Splitting By Content-Footnote-1236139 -Node: Multiple Line236302 -Ref: Multiple Line-Footnote-1242183 -Node: Getline242362 -Node: Plain Getline244569 -Node: Getline/Variable247209 -Node: Getline/File248358 -Node: Getline/Variable/File249743 -Ref: Getline/Variable/File-Footnote-1251346 -Node: Getline/Pipe251433 -Node: Getline/Variable/Pipe254111 -Node: Getline/Coprocess255242 -Node: Getline/Variable/Coprocess256506 -Node: Getline Notes257245 -Node: Getline Summary260039 -Ref: table-getline-variants260451 -Node: Read Timeout261280 -Ref: Read Timeout-Footnote-1265117 -Node: Command-line directories265175 -Node: Input Summary266080 -Node: Input Exercises269465 -Node: Printing270193 -Node: Print271970 -Node: Print Examples273427 -Node: Output Separators276206 -Node: OFMT278224 -Node: Printf279579 -Node: Basic Printf280364 -Node: Control Letters281936 -Node: Format Modifiers285921 -Node: Printf Examples291927 -Node: Redirection294413 -Node: Special FD301251 -Ref: Special FD-Footnote-1304417 -Node: Special Files304491 -Node: Other Inherited Files305108 -Node: Special Network306108 -Node: Special Caveats306970 -Node: Close Files And Pipes307919 -Ref: Close Files And Pipes-Footnote-1315110 -Ref: Close Files And Pipes-Footnote-2315258 -Node: Output Summary315408 -Node: Output Exercises316406 -Node: Expressions317086 -Node: Values318275 -Node: Constants318952 -Node: Scalar Constants319643 -Ref: Scalar Constants-Footnote-1320505 -Node: Nondecimal-numbers320755 -Node: Regexp Constants323765 -Node: Using Constant Regexps324291 -Node: Variables327454 -Node: Using Variables328111 -Node: Assignment Options330022 -Node: Conversion331897 -Node: Strings And Numbers332421 -Ref: Strings And Numbers-Footnote-1335486 -Node: Locale influences conversions335595 -Ref: table-locale-affects338341 -Node: All Operators338933 -Node: Arithmetic Ops339562 -Node: Concatenation342067 -Ref: Concatenation-Footnote-1344886 -Node: Assignment Ops344993 -Ref: table-assign-ops349972 -Node: Increment Ops351282 -Node: Truth Values and Conditions354713 -Node: Truth Values355796 -Node: Typing and Comparison356845 -Node: Variable Typing357661 -Node: Comparison Operators361328 -Ref: table-relational-ops361738 -Node: POSIX String Comparison365233 -Ref: POSIX String Comparison-Footnote-1366305 -Node: Boolean Ops366444 -Ref: Boolean Ops-Footnote-1370922 -Node: Conditional Exp371013 -Node: Function Calls372751 -Node: Precedence376631 -Node: Locales380291 -Node: Expressions Summary381923 -Node: Patterns and Actions384494 -Node: Pattern Overview385614 -Node: Regexp Patterns387293 -Node: Expression Patterns387836 -Node: Ranges391616 -Node: BEGIN/END394723 -Node: Using BEGIN/END395484 -Ref: Using BEGIN/END-Footnote-1398220 -Node: I/O And BEGIN/END398326 -Node: BEGINFILE/ENDFILE400641 -Node: Empty403538 -Node: Using Shell Variables403855 -Node: Action Overview406128 -Node: Statements408454 -Node: If Statement410302 -Node: While Statement411797 -Node: Do Statement413825 -Node: For Statement414973 -Node: Switch Statement418131 -Node: Break Statement420513 -Node: Continue Statement422606 -Node: Next Statement424433 -Node: Nextfile Statement426814 -Node: Exit Statement429442 -Node: Built-in Variables431853 -Node: User-modified432986 -Ref: User-modified-Footnote-1440620 -Node: Auto-set440682 -Ref: Auto-set-Footnote-1453734 -Ref: Auto-set-Footnote-2453939 -Node: ARGC and ARGV453995 -Node: Pattern Action Summary458213 -Node: Arrays460646 -Node: Array Basics461975 -Node: Array Intro462819 -Ref: figure-array-elements464753 -Ref: Array Intro-Footnote-1467373 -Node: Reference to Elements467501 -Node: Assigning Elements469963 -Node: Array Example470454 -Node: Scanning an Array472213 -Node: Controlling Scanning475233 -Ref: Controlling Scanning-Footnote-1480627 -Node: Numeric Array Subscripts480943 -Node: Uninitialized Subscripts483128 -Node: Delete484745 -Ref: Delete-Footnote-1487494 -Node: Multidimensional487551 -Node: Multiscanning490648 -Node: Arrays of Arrays492237 -Node: Arrays Summary496991 -Node: Functions499082 -Node: Built-in500121 -Node: Calling Built-in501199 -Node: Numeric Functions503194 -Ref: Numeric Functions-Footnote-1507210 -Ref: Numeric Functions-Footnote-2507567 -Ref: Numeric Functions-Footnote-3507615 -Node: String Functions507887 -Ref: String Functions-Footnote-1531388 -Ref: String Functions-Footnote-2531517 -Ref: String Functions-Footnote-3531765 -Node: Gory Details531852 -Ref: table-sub-escapes533633 -Ref: table-sub-proposed535148 -Ref: table-posix-sub536510 -Ref: table-gensub-escapes538047 -Ref: Gory Details-Footnote-1538880 -Node: I/O Functions539031 -Ref: I/O Functions-Footnote-1546267 -Node: Time Functions546414 -Ref: Time Functions-Footnote-1556923 -Ref: Time Functions-Footnote-2556991 -Ref: Time Functions-Footnote-3557149 -Ref: Time Functions-Footnote-4557260 -Ref: Time Functions-Footnote-5557372 -Ref: Time Functions-Footnote-6557599 -Node: Bitwise Functions557865 -Ref: table-bitwise-ops558427 -Ref: Bitwise Functions-Footnote-1562755 -Node: Type Functions562927 -Node: I18N Functions564079 -Node: User-defined565726 -Node: Definition Syntax566531 -Ref: Definition Syntax-Footnote-1572190 -Node: Function Example572261 -Ref: Function Example-Footnote-1575182 -Node: Function Caveats575204 -Node: Calling A Function575722 -Node: Variable Scope576680 -Node: Pass By Value/Reference579673 -Node: Return Statement583170 -Node: Dynamic Typing586149 -Node: Indirect Calls587078 -Ref: Indirect Calls-Footnote-1596943 -Node: Functions Summary597071 -Node: Library Functions599773 -Ref: Library Functions-Footnote-1603381 -Ref: Library Functions-Footnote-2603524 -Node: Library Names603695 -Ref: Library Names-Footnote-1607153 -Ref: Library Names-Footnote-2607376 -Node: General Functions607462 -Node: Strtonum Function608565 -Node: Assert Function611587 -Node: Round Function614911 -Node: Cliff Random Function616452 -Node: Ordinal Functions617468 -Ref: Ordinal Functions-Footnote-1620531 -Ref: Ordinal Functions-Footnote-2620783 -Node: Join Function620994 -Ref: Join Function-Footnote-1622764 -Node: Getlocaltime Function622964 -Node: Readfile Function626708 -Node: Shell Quoting628680 -Node: Data File Management630081 -Node: Filetrans Function630713 -Node: Rewind Function634809 -Node: File Checking636195 -Ref: File Checking-Footnote-1637528 -Node: Empty Files637729 -Node: Ignoring Assigns639708 -Node: Getopt Function641258 -Ref: Getopt Function-Footnote-1652722 -Node: Passwd Functions652922 -Ref: Passwd Functions-Footnote-1661762 -Node: Group Functions661850 -Ref: Group Functions-Footnote-1669747 -Node: Walking Arrays669952 -Node: Library Functions Summary672958 -Node: Library Exercises674360 -Node: Sample Programs675640 -Node: Running Examples676410 -Node: Clones677138 -Node: Cut Program678362 -Node: Egrep Program688082 -Ref: Egrep Program-Footnote-1695585 -Node: Id Program695695 -Node: Split Program699371 -Ref: Split Program-Footnote-1702825 -Node: Tee Program702953 -Node: Uniq Program705742 -Node: Wc Program713161 -Ref: Wc Program-Footnote-1717411 -Node: Miscellaneous Programs717505 -Node: Dupword Program718718 -Node: Alarm Program720749 -Node: Translate Program725554 -Ref: Translate Program-Footnote-1730117 -Node: Labels Program730387 -Ref: Labels Program-Footnote-1733738 -Node: Word Sorting733822 -Node: History Sorting737892 -Node: Extract Program739727 -Node: Simple Sed747251 -Node: Igawk Program750321 -Ref: Igawk Program-Footnote-1764647 -Ref: Igawk Program-Footnote-2764848 -Ref: Igawk Program-Footnote-3764970 -Node: Anagram Program765085 -Node: Signature Program768146 -Node: Programs Summary769393 -Node: Programs Exercises770614 -Ref: Programs Exercises-Footnote-1774745 -Node: Advanced Features774836 -Node: Nondecimal Data776818 -Node: Array Sorting778408 -Node: Controlling Array Traversal779108 -Ref: Controlling Array Traversal-Footnote-1787474 -Node: Array Sorting Functions787592 -Ref: Array Sorting Functions-Footnote-1791478 -Node: Two-way I/O791674 -Ref: Two-way I/O-Footnote-1796619 -Ref: Two-way I/O-Footnote-2796805 -Node: TCP/IP Networking796887 -Node: Profiling799759 -Node: Advanced Features Summary807300 -Node: Internationalization809233 -Node: I18N and L10N810713 -Node: Explaining gettext811399 -Ref: Explaining gettext-Footnote-1816424 -Ref: Explaining gettext-Footnote-2816608 -Node: Programmer i18n816773 -Ref: Programmer i18n-Footnote-1821649 -Node: Translator i18n821698 -Node: String Extraction822492 -Ref: String Extraction-Footnote-1823623 -Node: Printf Ordering823709 -Ref: Printf Ordering-Footnote-1826495 -Node: I18N Portability826559 -Ref: I18N Portability-Footnote-1829015 -Node: I18N Example829078 -Ref: I18N Example-Footnote-1831881 -Node: Gawk I18N831953 -Node: I18N Summary832597 -Node: Debugger833937 -Node: Debugging834959 -Node: Debugging Concepts835400 -Node: Debugging Terms837210 -Node: Awk Debugging839782 -Node: Sample Debugging Session840688 -Node: Debugger Invocation841222 -Node: Finding The Bug842607 -Node: List of Debugger Commands849086 -Node: Breakpoint Control850418 -Node: Debugger Execution Control854095 -Node: Viewing And Changing Data857454 -Node: Execution Stack860830 -Node: Debugger Info862465 -Node: Miscellaneous Debugger Commands866510 -Node: Readline Support871511 -Node: Limitations872405 -Node: Debugging Summary874520 -Node: Arbitrary Precision Arithmetic875694 -Node: Computer Arithmetic877110 -Ref: table-numeric-ranges880709 -Ref: Computer Arithmetic-Footnote-1881233 -Node: Math Definitions881290 -Ref: table-ieee-formats884585 -Ref: Math Definitions-Footnote-1885189 -Node: MPFR features885294 -Node: FP Math Caution886965 -Ref: FP Math Caution-Footnote-1888015 -Node: Inexactness of computations888384 -Node: Inexact representation889343 -Node: Comparing FP Values890701 -Node: Errors accumulate891783 -Node: Getting Accuracy893215 -Node: Try To Round895919 -Node: Setting precision896818 -Ref: table-predefined-precision-strings897502 -Node: Setting the rounding mode899331 -Ref: table-gawk-rounding-modes899695 -Ref: Setting the rounding mode-Footnote-1903147 -Node: Arbitrary Precision Integers903326 -Ref: Arbitrary Precision Integers-Footnote-1906310 -Node: POSIX Floating Point Problems906459 -Ref: POSIX Floating Point Problems-Footnote-1910338 -Node: Floating point summary910376 -Node: Dynamic Extensions912563 -Node: Extension Intro914115 -Node: Plugin License915380 -Node: Extension Mechanism Outline916177 -Ref: figure-load-extension916605 -Ref: figure-register-new-function918085 -Ref: figure-call-new-function919089 -Node: Extension API Description921076 -Node: Extension API Functions Introduction922526 -Node: General Data Types927347 -Ref: General Data Types-Footnote-1933247 -Node: Memory Allocation Functions933546 -Ref: Memory Allocation Functions-Footnote-1936385 -Node: Constructor Functions936484 -Node: Registration Functions938223 -Node: Extension Functions938908 -Node: Exit Callback Functions941205 -Node: Extension Version String942453 -Node: Input Parsers943116 -Node: Output Wrappers952991 -Node: Two-way processors957504 -Node: Printing Messages959767 -Ref: Printing Messages-Footnote-1960843 -Node: Updating `ERRNO'960995 -Node: Requesting Values961735 -Ref: table-value-types-returned962462 -Node: Accessing Parameters963419 -Node: Symbol Table Access964653 -Node: Symbol table by name965167 -Node: Symbol table by cookie967187 -Ref: Symbol table by cookie-Footnote-1971332 -Node: Cached values971395 -Ref: Cached values-Footnote-1974891 -Node: Array Manipulation974982 -Ref: Array Manipulation-Footnote-1976080 -Node: Array Data Types976117 -Ref: Array Data Types-Footnote-1978772 -Node: Array Functions978864 -Node: Flattening Arrays982723 -Node: Creating Arrays989625 -Node: Extension API Variables994396 -Node: Extension Versioning995032 -Node: Extension API Informational Variables996923 -Node: Extension API Boilerplate997988 -Node: Finding Extensions1001797 -Node: Extension Example1002357 -Node: Internal File Description1003129 -Node: Internal File Ops1007196 -Ref: Internal File Ops-Footnote-11018947 -Node: Using Internal File Ops1019087 -Ref: Using Internal File Ops-Footnote-11021470 -Node: Extension Samples1021743 -Node: Extension Sample File Functions1023271 -Node: Extension Sample Fnmatch1030952 -Node: Extension Sample Fork1032440 -Node: Extension Sample Inplace1033655 -Node: Extension Sample Ord1035331 -Node: Extension Sample Readdir1036167 -Ref: table-readdir-file-types1037044 -Node: Extension Sample Revout1037855 -Node: Extension Sample Rev2way1038444 -Node: Extension Sample Read write array1039184 -Node: Extension Sample Readfile1041124 -Node: Extension Sample Time1042219 -Node: Extension Sample API Tests1043567 -Node: gawkextlib1044058 -Node: Extension summary1046736 -Node: Extension Exercises1050425 -Node: Language History1051147 -Node: V7/SVR3.11052803 -Node: SVR41054956 -Node: POSIX1056390 -Node: BTL1057771 -Node: POSIX/GNU1058502 -Node: Feature History1064023 -Node: Common Extensions1077121 -Node: Ranges and Locales1078493 -Ref: Ranges and Locales-Footnote-11083112 -Ref: Ranges and Locales-Footnote-21083139 -Ref: Ranges and Locales-Footnote-31083374 -Node: Contributors1083595 -Node: History summary1089135 -Node: Installation1090514 -Node: Gawk Distribution1091460 -Node: Getting1091944 -Node: Extracting1092767 -Node: Distribution contents1094404 -Node: Unix Installation1100158 -Node: Quick Installation1100775 -Node: Additional Configuration Options1103199 -Node: Configuration Philosophy1105002 -Node: Non-Unix Installation1107371 -Node: PC Installation1107829 -Node: PC Binary Installation1109149 -Node: PC Compiling1110997 -Ref: PC Compiling-Footnote-11114018 -Node: PC Testing1114127 -Node: PC Using1115303 -Node: Cygwin1119418 -Node: MSYS1120188 -Node: VMS Installation1120689 -Node: VMS Compilation1121481 -Ref: VMS Compilation-Footnote-11122710 -Node: VMS Dynamic Extensions1122768 -Node: VMS Installation Details1124452 -Node: VMS Running1126703 -Node: VMS GNV1129543 -Node: VMS Old Gawk1130278 -Node: Bugs1130748 -Node: Other Versions1134637 -Node: Installation summary1141071 -Node: Notes1142130 -Node: Compatibility Mode1142995 -Node: Additions1143777 -Node: Accessing The Source1144702 -Node: Adding Code1146137 -Node: New Ports1152294 -Node: Derived Files1156776 -Ref: Derived Files-Footnote-11162251 -Ref: Derived Files-Footnote-21162285 -Ref: Derived Files-Footnote-31162881 -Node: Future Extensions1162995 -Node: Implementation Limitations1163601 -Node: Extension Design1164849 -Node: Old Extension Problems1166003 -Ref: Old Extension Problems-Footnote-11167520 -Node: Extension New Mechanism Goals1167577 -Ref: Extension New Mechanism Goals-Footnote-11170937 -Node: Extension Other Design Decisions1171126 -Node: Extension Future Growth1173234 -Node: Old Extension Mechanism1174070 -Node: Notes summary1175832 -Node: Basic Concepts1177018 -Node: Basic High Level1177699 -Ref: figure-general-flow1177971 -Ref: figure-process-flow1178570 -Ref: Basic High Level-Footnote-11181799 -Node: Basic Data Typing1181984 -Node: Glossary1185312 -Node: Copying1217241 -Node: GNU Free Documentation License1254797 -Node: Index1279933 +Node: Splitting By Content232170 +Ref: Splitting By Content-Footnote-1236135 +Node: Multiple Line236298 +Ref: Multiple Line-Footnote-1242179 +Node: Getline242358 +Node: Plain Getline244565 +Node: Getline/Variable247205 +Node: Getline/File248354 +Node: Getline/Variable/File249739 +Ref: Getline/Variable/File-Footnote-1251342 +Node: Getline/Pipe251429 +Node: Getline/Variable/Pipe254107 +Node: Getline/Coprocess255238 +Node: Getline/Variable/Coprocess256502 +Node: Getline Notes257241 +Node: Getline Summary260035 +Ref: table-getline-variants260447 +Node: Read Timeout261276 +Ref: Read Timeout-Footnote-1265113 +Node: Command-line directories265171 +Node: Input Summary266076 +Node: Input Exercises269461 +Node: Printing270189 +Node: Print271966 +Node: Print Examples273423 +Node: Output Separators276202 +Node: OFMT278220 +Node: Printf279575 +Node: Basic Printf280360 +Node: Control Letters281932 +Node: Format Modifiers285917 +Node: Printf Examples291923 +Node: Redirection294409 +Node: Special FD301247 +Ref: Special FD-Footnote-1304413 +Node: Special Files304487 +Node: Other Inherited Files305104 +Node: Special Network306104 +Node: Special Caveats306966 +Node: Close Files And Pipes307915 +Ref: Close Files And Pipes-Footnote-1315106 +Ref: Close Files And Pipes-Footnote-2315254 +Node: Output Summary315404 +Node: Output Exercises316402 +Node: Expressions317082 +Node: Values318271 +Node: Constants318948 +Node: Scalar Constants319639 +Ref: Scalar Constants-Footnote-1320501 +Node: Nondecimal-numbers320751 +Node: Regexp Constants323761 +Node: Using Constant Regexps324287 +Node: Variables327450 +Node: Using Variables328107 +Node: Assignment Options330018 +Node: Conversion331893 +Node: Strings And Numbers332417 +Ref: Strings And Numbers-Footnote-1335482 +Node: Locale influences conversions335591 +Ref: table-locale-affects338337 +Node: All Operators338929 +Node: Arithmetic Ops339558 +Node: Concatenation342063 +Ref: Concatenation-Footnote-1344882 +Node: Assignment Ops344989 +Ref: table-assign-ops349968 +Node: Increment Ops351278 +Node: Truth Values and Conditions354709 +Node: Truth Values355792 +Node: Typing and Comparison356841 +Node: Variable Typing357657 +Node: Comparison Operators361324 +Ref: table-relational-ops361734 +Node: POSIX String Comparison365229 +Ref: POSIX String Comparison-Footnote-1366301 +Node: Boolean Ops366440 +Ref: Boolean Ops-Footnote-1370918 +Node: Conditional Exp371009 +Node: Function Calls372747 +Node: Precedence376627 +Node: Locales380287 +Node: Expressions Summary381919 +Node: Patterns and Actions384490 +Node: Pattern Overview385610 +Node: Regexp Patterns387289 +Node: Expression Patterns387832 +Node: Ranges391612 +Node: BEGIN/END394719 +Node: Using BEGIN/END395480 +Ref: Using BEGIN/END-Footnote-1398216 +Node: I/O And BEGIN/END398322 +Node: BEGINFILE/ENDFILE400637 +Node: Empty403534 +Node: Using Shell Variables403851 +Node: Action Overview406124 +Node: Statements408450 +Node: If Statement410298 +Node: While Statement411793 +Node: Do Statement413821 +Node: For Statement414969 +Node: Switch Statement418127 +Node: Break Statement420509 +Node: Continue Statement422602 +Node: Next Statement424429 +Node: Nextfile Statement426810 +Node: Exit Statement429438 +Node: Built-in Variables431849 +Node: User-modified432982 +Ref: User-modified-Footnote-1440616 +Node: Auto-set440678 +Ref: Auto-set-Footnote-1453730 +Ref: Auto-set-Footnote-2453935 +Node: ARGC and ARGV453991 +Node: Pattern Action Summary458209 +Node: Arrays460642 +Node: Array Basics461971 +Node: Array Intro462815 +Ref: figure-array-elements464752 +Ref: Array Intro-Footnote-1467375 +Node: Reference to Elements467503 +Node: Assigning Elements469965 +Node: Array Example470456 +Node: Scanning an Array472215 +Node: Controlling Scanning475238 +Ref: Controlling Scanning-Footnote-1480632 +Node: Numeric Array Subscripts480948 +Node: Uninitialized Subscripts483133 +Node: Delete484750 +Ref: Delete-Footnote-1487499 +Node: Multidimensional487556 +Node: Multiscanning490653 +Node: Arrays of Arrays492242 +Node: Arrays Summary496996 +Node: Functions499087 +Node: Built-in500126 +Node: Calling Built-in501204 +Node: Numeric Functions503199 +Ref: Numeric Functions-Footnote-1507215 +Ref: Numeric Functions-Footnote-2507572 +Ref: Numeric Functions-Footnote-3507620 +Node: String Functions507892 +Ref: String Functions-Footnote-1531393 +Ref: String Functions-Footnote-2531522 +Ref: String Functions-Footnote-3531770 +Node: Gory Details531857 +Ref: table-sub-escapes533638 +Ref: table-sub-proposed535153 +Ref: table-posix-sub536515 +Ref: table-gensub-escapes538052 +Ref: Gory Details-Footnote-1538885 +Node: I/O Functions539036 +Ref: I/O Functions-Footnote-1546272 +Node: Time Functions546419 +Ref: Time Functions-Footnote-1556928 +Ref: Time Functions-Footnote-2556996 +Ref: Time Functions-Footnote-3557154 +Ref: Time Functions-Footnote-4557265 +Ref: Time Functions-Footnote-5557377 +Ref: Time Functions-Footnote-6557604 +Node: Bitwise Functions557870 +Ref: table-bitwise-ops558432 +Ref: Bitwise Functions-Footnote-1562760 +Node: Type Functions562932 +Node: I18N Functions564084 +Node: User-defined565731 +Node: Definition Syntax566536 +Ref: Definition Syntax-Footnote-1572195 +Node: Function Example572266 +Ref: Function Example-Footnote-1575187 +Node: Function Caveats575209 +Node: Calling A Function575727 +Node: Variable Scope576685 +Node: Pass By Value/Reference579678 +Node: Return Statement583175 +Node: Dynamic Typing586154 +Node: Indirect Calls587083 +Ref: Indirect Calls-Footnote-1596948 +Node: Functions Summary597076 +Node: Library Functions599778 +Ref: Library Functions-Footnote-1603386 +Ref: Library Functions-Footnote-2603529 +Node: Library Names603700 +Ref: Library Names-Footnote-1607158 +Ref: Library Names-Footnote-2607381 +Node: General Functions607467 +Node: Strtonum Function608570 +Node: Assert Function611592 +Node: Round Function614916 +Node: Cliff Random Function616457 +Node: Ordinal Functions617473 +Ref: Ordinal Functions-Footnote-1620536 +Ref: Ordinal Functions-Footnote-2620788 +Node: Join Function620999 +Ref: Join Function-Footnote-1622769 +Node: Getlocaltime Function622969 +Node: Readfile Function626713 +Node: Shell Quoting628685 +Node: Data File Management630086 +Node: Filetrans Function630718 +Node: Rewind Function634814 +Node: File Checking636200 +Ref: File Checking-Footnote-1637533 +Node: Empty Files637734 +Node: Ignoring Assigns639713 +Node: Getopt Function641263 +Ref: Getopt Function-Footnote-1652727 +Node: Passwd Functions652927 +Ref: Passwd Functions-Footnote-1661767 +Node: Group Functions661855 +Ref: Group Functions-Footnote-1669752 +Node: Walking Arrays669957 +Node: Library Functions Summary672963 +Node: Library Exercises674365 +Node: Sample Programs675645 +Node: Running Examples676415 +Node: Clones677143 +Node: Cut Program678367 +Node: Egrep Program688087 +Ref: Egrep Program-Footnote-1695590 +Node: Id Program695700 +Node: Split Program699376 +Ref: Split Program-Footnote-1702830 +Node: Tee Program702958 +Node: Uniq Program705747 +Node: Wc Program713166 +Ref: Wc Program-Footnote-1717416 +Node: Miscellaneous Programs717510 +Node: Dupword Program718723 +Node: Alarm Program720754 +Node: Translate Program725559 +Ref: Translate Program-Footnote-1730122 +Node: Labels Program730392 +Ref: Labels Program-Footnote-1733743 +Node: Word Sorting733827 +Node: History Sorting737897 +Node: Extract Program739732 +Node: Simple Sed747256 +Node: Igawk Program750326 +Ref: Igawk Program-Footnote-1764652 +Ref: Igawk Program-Footnote-2764853 +Ref: Igawk Program-Footnote-3764975 +Node: Anagram Program765090 +Node: Signature Program768151 +Node: Programs Summary769398 +Node: Programs Exercises770619 +Ref: Programs Exercises-Footnote-1774750 +Node: Advanced Features774841 +Node: Nondecimal Data776823 +Node: Array Sorting778413 +Node: Controlling Array Traversal779113 +Ref: Controlling Array Traversal-Footnote-1787479 +Node: Array Sorting Functions787597 +Ref: Array Sorting Functions-Footnote-1791483 +Node: Two-way I/O791679 +Ref: Two-way I/O-Footnote-1796624 +Ref: Two-way I/O-Footnote-2796810 +Node: TCP/IP Networking796892 +Node: Profiling799764 +Node: Advanced Features Summary807305 +Node: Internationalization809238 +Node: I18N and L10N810718 +Node: Explaining gettext811404 +Ref: Explaining gettext-Footnote-1816429 +Ref: Explaining gettext-Footnote-2816613 +Node: Programmer i18n816778 +Ref: Programmer i18n-Footnote-1821654 +Node: Translator i18n821703 +Node: String Extraction822497 +Ref: String Extraction-Footnote-1823628 +Node: Printf Ordering823714 +Ref: Printf Ordering-Footnote-1826500 +Node: I18N Portability826564 +Ref: I18N Portability-Footnote-1829020 +Node: I18N Example829083 +Ref: I18N Example-Footnote-1831886 +Node: Gawk I18N831958 +Node: I18N Summary832602 +Node: Debugger833942 +Node: Debugging834964 +Node: Debugging Concepts835405 +Node: Debugging Terms837215 +Node: Awk Debugging839787 +Node: Sample Debugging Session840693 +Node: Debugger Invocation841227 +Node: Finding The Bug842612 +Node: List of Debugger Commands849091 +Node: Breakpoint Control850423 +Node: Debugger Execution Control854100 +Node: Viewing And Changing Data857459 +Node: Execution Stack860835 +Node: Debugger Info862470 +Node: Miscellaneous Debugger Commands866515 +Node: Readline Support871516 +Node: Limitations872410 +Node: Debugging Summary874525 +Node: Arbitrary Precision Arithmetic875699 +Node: Computer Arithmetic877115 +Ref: table-numeric-ranges880692 +Ref: Computer Arithmetic-Footnote-1881216 +Node: Math Definitions881273 +Ref: table-ieee-formats884568 +Ref: Math Definitions-Footnote-1885172 +Node: MPFR features885277 +Node: FP Math Caution886948 +Ref: FP Math Caution-Footnote-1887998 +Node: Inexactness of computations888367 +Node: Inexact representation889326 +Node: Comparing FP Values890684 +Node: Errors accumulate891766 +Node: Getting Accuracy893198 +Node: Try To Round895902 +Node: Setting precision896801 +Ref: table-predefined-precision-strings897485 +Node: Setting the rounding mode899314 +Ref: table-gawk-rounding-modes899678 +Ref: Setting the rounding mode-Footnote-1903130 +Node: Arbitrary Precision Integers903309 +Ref: Arbitrary Precision Integers-Footnote-1906293 +Node: POSIX Floating Point Problems906442 +Ref: POSIX Floating Point Problems-Footnote-1910321 +Node: Floating point summary910359 +Node: Dynamic Extensions912546 +Node: Extension Intro914098 +Node: Plugin License915363 +Node: Extension Mechanism Outline916160 +Ref: figure-load-extension916588 +Ref: figure-register-new-function918068 +Ref: figure-call-new-function919072 +Node: Extension API Description921059 +Node: Extension API Functions Introduction922509 +Node: General Data Types927330 +Ref: General Data Types-Footnote-1933230 +Node: Memory Allocation Functions933529 +Ref: Memory Allocation Functions-Footnote-1936368 +Node: Constructor Functions936467 +Node: Registration Functions938206 +Node: Extension Functions938891 +Node: Exit Callback Functions941188 +Node: Extension Version String942436 +Node: Input Parsers943099 +Node: Output Wrappers952974 +Node: Two-way processors957487 +Node: Printing Messages959750 +Ref: Printing Messages-Footnote-1960826 +Node: Updating `ERRNO'960978 +Node: Requesting Values961718 +Ref: table-value-types-returned962445 +Node: Accessing Parameters963402 +Node: Symbol Table Access964636 +Node: Symbol table by name965150 +Node: Symbol table by cookie967170 +Ref: Symbol table by cookie-Footnote-1971315 +Node: Cached values971378 +Ref: Cached values-Footnote-1974874 +Node: Array Manipulation974965 +Ref: Array Manipulation-Footnote-1976063 +Node: Array Data Types976100 +Ref: Array Data Types-Footnote-1978755 +Node: Array Functions978847 +Node: Flattening Arrays982706 +Node: Creating Arrays989608 +Node: Extension API Variables994379 +Node: Extension Versioning995015 +Node: Extension API Informational Variables996906 +Node: Extension API Boilerplate997971 +Node: Finding Extensions1001780 +Node: Extension Example1002340 +Node: Internal File Description1003112 +Node: Internal File Ops1007179 +Ref: Internal File Ops-Footnote-11018930 +Node: Using Internal File Ops1019070 +Ref: Using Internal File Ops-Footnote-11021453 +Node: Extension Samples1021726 +Node: Extension Sample File Functions1023254 +Node: Extension Sample Fnmatch1030935 +Node: Extension Sample Fork1032423 +Node: Extension Sample Inplace1033638 +Node: Extension Sample Ord1035314 +Node: Extension Sample Readdir1036150 +Ref: table-readdir-file-types1037027 +Node: Extension Sample Revout1037838 +Node: Extension Sample Rev2way1038427 +Node: Extension Sample Read write array1039167 +Node: Extension Sample Readfile1041107 +Node: Extension Sample Time1042202 +Node: Extension Sample API Tests1043550 +Node: gawkextlib1044041 +Node: Extension summary1046719 +Node: Extension Exercises1050408 +Node: Language History1051130 +Node: V7/SVR3.11052786 +Node: SVR41054939 +Node: POSIX1056373 +Node: BTL1057754 +Node: POSIX/GNU1058485 +Node: Feature History1064006 +Node: Common Extensions1077104 +Node: Ranges and Locales1078476 +Ref: Ranges and Locales-Footnote-11083095 +Ref: Ranges and Locales-Footnote-21083122 +Ref: Ranges and Locales-Footnote-31083357 +Node: Contributors1083578 +Node: History summary1089118 +Node: Installation1090497 +Node: Gawk Distribution1091443 +Node: Getting1091927 +Node: Extracting1092750 +Node: Distribution contents1094387 +Node: Unix Installation1100141 +Node: Quick Installation1100758 +Node: Additional Configuration Options1103182 +Node: Configuration Philosophy1104985 +Node: Non-Unix Installation1107354 +Node: PC Installation1107812 +Node: PC Binary Installation1109132 +Node: PC Compiling1110980 +Ref: PC Compiling-Footnote-11114001 +Node: PC Testing1114110 +Node: PC Using1115286 +Node: Cygwin1119401 +Node: MSYS1120171 +Node: VMS Installation1120672 +Node: VMS Compilation1121464 +Ref: VMS Compilation-Footnote-11122693 +Node: VMS Dynamic Extensions1122751 +Node: VMS Installation Details1124435 +Node: VMS Running1126686 +Node: VMS GNV1129526 +Node: VMS Old Gawk1130261 +Node: Bugs1130731 +Node: Other Versions1134620 +Node: Installation summary1141054 +Node: Notes1142113 +Node: Compatibility Mode1142978 +Node: Additions1143760 +Node: Accessing The Source1144685 +Node: Adding Code1146120 +Node: New Ports1152277 +Node: Derived Files1156759 +Ref: Derived Files-Footnote-11162234 +Ref: Derived Files-Footnote-21162268 +Ref: Derived Files-Footnote-31162864 +Node: Future Extensions1162978 +Node: Implementation Limitations1163584 +Node: Extension Design1164832 +Node: Old Extension Problems1165986 +Ref: Old Extension Problems-Footnote-11167503 +Node: Extension New Mechanism Goals1167560 +Ref: Extension New Mechanism Goals-Footnote-11170920 +Node: Extension Other Design Decisions1171109 +Node: Extension Future Growth1173217 +Node: Old Extension Mechanism1174053 +Node: Notes summary1175815 +Node: Basic Concepts1177001 +Node: Basic High Level1177682 +Ref: figure-general-flow1177954 +Ref: figure-process-flow1178553 +Ref: Basic High Level-Footnote-11181782 +Node: Basic Data Typing1181967 +Node: Glossary1185295 +Node: Copying1217224 +Node: GNU Free Documentation License1254780 +Node: Index1279916  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 05d03a61..8d219a0f 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -7671,7 +7671,7 @@ variable @code{FIELDWIDTHS}. Each number specifies the width of the field, @emph{including} columns between fields. If you want to ignore the columns between fields, you can specify the width as a separate field that is subsequently ignored. -It is a fatal error to supply a field width that is not a positive number. +It is a fatal error to supply a field width that has a negative value. The following data is the output of the Unix @command{w} utility. It is useful to illustrate the use of @code{FIELDWIDTHS}: @@ -15496,7 +15496,7 @@ In most other languages, arrays must be @dfn{declared} before use, including a specification of how many elements or components they contain. In such languages, the declaration causes a contiguous block of memory to be allocated for that -many elements. Usually, an index in the array must be a positive integer. +many elements. Usually, an index in the array must be a nonnegative integer. For example, the index zero specifies the first element in the array, which is actually stored at the beginning of the block of memory. Index one specifies the second element, which is stored in memory right after the @@ -15676,7 +15676,7 @@ Now the array is @dfn{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 9. Another consequence of associative arrays is that the indices don't -have to be positive integers. Any number, or even a string, can be +have to be nonnegative 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: @@ -15939,7 +15939,7 @@ END @{ In programs that use arrays, it is often necessary to use a loop that executes once for each element of an array. In other languages, where -arrays are contiguous and indices are limited to positive integers, +arrays are contiguous and indices are limited to nonnegative integers, this is easy: all the valid indices can be found by counting from the lowest index up to the highest. This technique won't do the job in @command{awk}, because any number or string can be an array index. @@ -30165,8 +30165,8 @@ The disadvantage is that their range is limited. @cindex integers, unsigned In computers, integer values come in two flavors: @dfn{signed} and @dfn{unsigned}. Signed values may be negative or positive, whereas -unsigned values are always positive (i.e., greater than or equal -to zero). +unsigned values are always greater than or equal +to zero. In computer systems, integer arithmetic is exact, but the possible range of values is limited. Integer arithmetic is generally faster than diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 1efff5a1..d4067f70 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -7271,7 +7271,7 @@ variable @code{FIELDWIDTHS}. Each number specifies the width of the field, @emph{including} columns between fields. If you want to ignore the columns between fields, you can specify the width as a separate field that is subsequently ignored. -It is a fatal error to supply a field width that is not a positive number. +It is a fatal error to supply a field width that has a negative value. The following data is the output of the Unix @command{w} utility. It is useful to illustrate the use of @code{FIELDWIDTHS}: @@ -14778,7 +14778,7 @@ In most other languages, arrays must be @dfn{declared} before use, including a specification of how many elements or components they contain. In such languages, the declaration causes a contiguous block of memory to be allocated for that -many elements. Usually, an index in the array must be a positive integer. +many elements. Usually, an index in the array must be a nonnegative integer. For example, the index zero specifies the first element in the array, which is actually stored at the beginning of the block of memory. Index one specifies the second element, which is stored in memory right after the @@ -14958,7 +14958,7 @@ Now the array is @dfn{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 9. Another consequence of associative arrays is that the indices don't -have to be positive integers. Any number, or even a string, can be +have to be nonnegative 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: @@ -15221,7 +15221,7 @@ END @{ In programs that use arrays, it is often necessary to use a loop that executes once for each element of an array. In other languages, where -arrays are contiguous and indices are limited to positive integers, +arrays are contiguous and indices are limited to nonnegative integers, this is easy: all the valid indices can be found by counting from the lowest index up to the highest. This technique won't do the job in @command{awk}, because any number or string can be an array index. @@ -29256,8 +29256,8 @@ The disadvantage is that their range is limited. @cindex integers, unsigned In computers, integer values come in two flavors: @dfn{signed} and @dfn{unsigned}. Signed values may be negative or positive, whereas -unsigned values are always positive (i.e., greater than or equal -to zero). +unsigned values are always greater than or equal +to zero. In computer systems, integer arithmetic is exact, but the possible range of values is limited. Integer arithmetic is generally faster than -- cgit v1.2.3 From cffd09247c1681fbf3d5cad5253b3199704f83e7 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 17 Mar 2015 22:46:11 +0200 Subject: Fix bad allocs -M and profiling. --- ChangeLog | 6 ++++++ profile.c | 26 ++++++++++++++++++++------ test/ChangeLog | 5 +++++ test/Makefile.am | 11 +++++++++-- test/Makefile.in | 11 +++++++++-- test/mpfrmemok1.awk | 7 +++++++ test/mpfrmemok1.ok | 7 +++++++ 7 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 test/mpfrmemok1.awk create mode 100644 test/mpfrmemok1.ok diff --git a/ChangeLog b/ChangeLog index 9dfad08a..cf18c51c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-03-17 Arnold D. Robbins + + * profile.c (pp_number): Allocate enough room to print the number + in all cases. Was a problem mixing -M with profiling with a really + big number. Thanks to Hermann Peifer for the bug report. + 2015-03-08 Arnold D. Robbins * re.c (regexflags2str): Removed. It was redundant. diff --git a/profile.c b/profile.c index 316ba393..fd37bc61 100644 --- a/profile.c +++ b/profile.c @@ -1304,16 +1304,30 @@ pp_number(NODE *n) { #define PP_PRECISION 6 char *str; + size_t count; - emalloc(str, char *, PP_PRECISION + 10, "pp_number"); #ifdef HAVE_MPFR - if (is_mpg_float(n)) - mpfr_sprintf(str, "%0.*R*g", PP_PRECISION, ROUND_MODE, n->mpg_numbr); - else if (is_mpg_integer(n)) + if (is_mpg_float(n)) { + count = mpfr_get_prec(n->mpg_numbr) / 3; /* ~ 3.22 binary digits per decimal digit */ + emalloc(str, char *, count, "pp_number"); + /* + * 3/2015: Format string used to be "%0.*R*g". That padded + * with leading zeros. But it doesn't do that for regular + * numbers in the non-MPFR case. + */ + mpfr_sprintf(str, "%.*R*g", PP_PRECISION, ROUND_MODE, n->mpg_numbr); + } else if (is_mpg_integer(n)) { + count = mpz_sizeinbase(n->mpg_i, 10) + 2; /* +1 for sign, +1 for NUL at end */ + emalloc(str, char *, count, "pp_number"); mpfr_sprintf(str, "%Zd", n->mpg_i); - else + } else #endif - sprintf(str, "%0.*g", PP_PRECISION, n->numbr); + { + count = PP_PRECISION + 10; + emalloc(str, char *, count, "pp_number"); + sprintf(str, "%0.*g", PP_PRECISION, n->numbr); + } + return str; #undef PP_PRECISION } diff --git a/test/ChangeLog b/test/ChangeLog index 8a264e3f..24d6bcd7 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-03-17 Arnold D. Robbins + + * Makefile.am (mpfrmemok1): New test. + * mpfrmemok1.awk, mpfrmemok1.ok: New files. + 2015-03-10 Arnold D. Robbins * Makefile.am (fpat4): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 34899943..f1a0a275 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -537,6 +537,8 @@ EXTRA_DIST = \ mpfrexprange.ok \ mpfrieee.awk \ mpfrieee.ok \ + mpfrmemok1.awk \ + mpfrmemok1.ok \ mpfrnegzero.awk \ mpfrnegzero.ok \ mpfrnr.awk \ @@ -1059,8 +1061,8 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrnegzero mpfrrem mpfrrnd mpfrieee mpfrexprange \ - mpfrsort mpfrsqrt mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \ + mpfrexprange mpfrsort mpfrsqrt mpfrbigint LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ @@ -1812,6 +1814,11 @@ mpfrrem: @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrmemok1: + @echo $@ + @$(AWK) -p/dev/stdout -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + jarebug:: @echo $@ @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@" diff --git a/test/Makefile.in b/test/Makefile.in index 489b0d14..b794e04e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -794,6 +794,8 @@ EXTRA_DIST = \ mpfrexprange.ok \ mpfrieee.awk \ mpfrieee.ok \ + mpfrmemok1.awk \ + mpfrmemok1.ok \ mpfrnegzero.awk \ mpfrnegzero.ok \ mpfrnr.awk \ @@ -1312,8 +1314,8 @@ GAWK_EXT_TESTS = \ EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrnegzero mpfrrem mpfrrnd mpfrieee mpfrexprange \ - mpfrsort mpfrsqrt mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \ + mpfrexprange mpfrsort mpfrsqrt mpfrbigint LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ @@ -2249,6 +2251,11 @@ mpfrrem: @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrmemok1: + @echo $@ + @$(AWK) -p/dev/stdout -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + jarebug:: @echo $@ @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@" diff --git a/test/mpfrmemok1.awk b/test/mpfrmemok1.awk new file mode 100644 index 00000000..9331a34d --- /dev/null +++ b/test/mpfrmemok1.awk @@ -0,0 +1,7 @@ +# This program tests that -M works with profiling. +# It does not do anything real, but there should not be glibc memory +# errors and it should be valgrind-clean too. + +BEGIN { + v = 0x0100000000000000000000000000000000 +} diff --git a/test/mpfrmemok1.ok b/test/mpfrmemok1.ok new file mode 100644 index 00000000..2389a2d5 --- /dev/null +++ b/test/mpfrmemok1.ok @@ -0,0 +1,7 @@ + + # BEGIN rule(s) + + BEGIN { + 1 v = 340282366920938463463374607431768211456 + } + -- cgit v1.2.3 From e0c1194c4348e7adf99802461d45e3dd1bd192ff Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 18 Mar 2015 21:43:14 +0200 Subject: Bug fix to inplace extension and doc updates. --- awklib/eg/lib/inplace.awk | 9 ++- doc/ChangeLog | 6 ++ doc/gawk.info | 185 ++++++++++++++++++++++++---------------------- doc/gawk.texi | 13 +++- doc/gawktexi.in | 13 +++- extension/ChangeLog | 6 ++ extension/inplace.3am | 23 +----- test/ChangeLog | 5 ++ test/inplace1.ok | 2 +- test/inplace2.ok | 2 +- test/inplace3.ok | 4 +- 11 files changed, 151 insertions(+), 117 deletions(-) diff --git a/awklib/eg/lib/inplace.awk b/awklib/eg/lib/inplace.awk index 6403a228..d1574654 100644 --- a/awklib/eg/lib/inplace.awk +++ b/awklib/eg/lib/inplace.awk @@ -5,10 +5,15 @@ # Please set INPLACE_SUFFIX to make a backup copy. For example, you may # want to set INPLACE_SUFFIX to .bak on the command line or in a BEGIN rule. +# N.B. We call inplace_end() in the BEGINFILE and END rules so that any +# actions in an ENDFILE rule will be redirected as expected. + BEGINFILE { - inplace_begin(FILENAME, INPLACE_SUFFIX) + if (_inplace_filename != "") + inplace_end(_inplace_filename, INPLACE_SUFFIX) + inplace_begin(_inplace_filename = FILENAME, INPLACE_SUFFIX) } -ENDFILE { +END { inplace_end(FILENAME, INPLACE_SUFFIX) } diff --git a/doc/ChangeLog b/doc/ChangeLog index f8a317fa..f2fa97bc 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-17 Andrew J. Schorr + + * gawktexi.in: Modify inplace.awk to call inplace_end in BEGINFILE + and END instead of in ENDFILE. This way, actions in ENDFILE rules + will be redirected as expected. + 2015-03-17 Arnold D. Robbins * gawktexi.in: Turn "positive" into non-negative as appropriate. diff --git a/doc/gawk.info b/doc/gawk.info index 2d4fd906..d6aea49f 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -25670,11 +25670,16 @@ performs "in-place" editing of each input file. It uses the bundled # Please set INPLACE_SUFFIX to make a backup copy. For example, you may # want to set INPLACE_SUFFIX to .bak on the command line or in a BEGIN rule. + # N.B. We call inplace_end() in the BEGINFILE and END rules so that any + # actions in an ENDFILE rule will be redirected as expected. + BEGINFILE { - inplace_begin(FILENAME, INPLACE_SUFFIX) + if (_inplace_filename != "") + inplace_end(_inplace_filename, INPLACE_SUFFIX) + inplace_begin(_inplace_filename = FILENAME, INPLACE_SUFFIX) } - ENDFILE { + END { inplace_end(FILENAME, INPLACE_SUFFIX) } @@ -25686,6 +25691,10 @@ the extension restores standard output to its original destination. If a backup file name created by appending that suffix. Finally, the temporary file is renamed to the original file name. + The `_inplace_filename' variable serves to keep track of the current +filename so as to not invoke `inplace_end()' before processing the +first file. + If any error occurs, the extension issues a fatal error to terminate processing immediately without damaging the original file. @@ -34955,91 +34964,91 @@ Node: Extension Sample File Functions1023254 Node: Extension Sample Fnmatch1030935 Node: Extension Sample Fork1032423 Node: Extension Sample Inplace1033638 -Node: Extension Sample Ord1035314 -Node: Extension Sample Readdir1036150 -Ref: table-readdir-file-types1037027 -Node: Extension Sample Revout1037838 -Node: Extension Sample Rev2way1038427 -Node: Extension Sample Read write array1039167 -Node: Extension Sample Readfile1041107 -Node: Extension Sample Time1042202 -Node: Extension Sample API Tests1043550 -Node: gawkextlib1044041 -Node: Extension summary1046719 -Node: Extension Exercises1050408 -Node: Language History1051130 -Node: V7/SVR3.11052786 -Node: SVR41054939 -Node: POSIX1056373 -Node: BTL1057754 -Node: POSIX/GNU1058485 -Node: Feature History1064006 -Node: Common Extensions1077104 -Node: Ranges and Locales1078476 -Ref: Ranges and Locales-Footnote-11083095 -Ref: Ranges and Locales-Footnote-21083122 -Ref: Ranges and Locales-Footnote-31083357 -Node: Contributors1083578 -Node: History summary1089118 -Node: Installation1090497 -Node: Gawk Distribution1091443 -Node: Getting1091927 -Node: Extracting1092750 -Node: Distribution contents1094387 -Node: Unix Installation1100141 -Node: Quick Installation1100758 -Node: Additional Configuration Options1103182 -Node: Configuration Philosophy1104985 -Node: Non-Unix Installation1107354 -Node: PC Installation1107812 -Node: PC Binary Installation1109132 -Node: PC Compiling1110980 -Ref: PC Compiling-Footnote-11114001 -Node: PC Testing1114110 -Node: PC Using1115286 -Node: Cygwin1119401 -Node: MSYS1120171 -Node: VMS Installation1120672 -Node: VMS Compilation1121464 -Ref: VMS Compilation-Footnote-11122693 -Node: VMS Dynamic Extensions1122751 -Node: VMS Installation Details1124435 -Node: VMS Running1126686 -Node: VMS GNV1129526 -Node: VMS Old Gawk1130261 -Node: Bugs1130731 -Node: Other Versions1134620 -Node: Installation summary1141054 -Node: Notes1142113 -Node: Compatibility Mode1142978 -Node: Additions1143760 -Node: Accessing The Source1144685 -Node: Adding Code1146120 -Node: New Ports1152277 -Node: Derived Files1156759 -Ref: Derived Files-Footnote-11162234 -Ref: Derived Files-Footnote-21162268 -Ref: Derived Files-Footnote-31162864 -Node: Future Extensions1162978 -Node: Implementation Limitations1163584 -Node: Extension Design1164832 -Node: Old Extension Problems1165986 -Ref: Old Extension Problems-Footnote-11167503 -Node: Extension New Mechanism Goals1167560 -Ref: Extension New Mechanism Goals-Footnote-11170920 -Node: Extension Other Design Decisions1171109 -Node: Extension Future Growth1173217 -Node: Old Extension Mechanism1174053 -Node: Notes summary1175815 -Node: Basic Concepts1177001 -Node: Basic High Level1177682 -Ref: figure-general-flow1177954 -Ref: figure-process-flow1178553 -Ref: Basic High Level-Footnote-11181782 -Node: Basic Data Typing1181967 -Node: Glossary1185295 -Node: Copying1217224 -Node: GNU Free Documentation License1254780 -Node: Index1279916 +Node: Extension Sample Ord1035724 +Node: Extension Sample Readdir1036560 +Ref: table-readdir-file-types1037437 +Node: Extension Sample Revout1038248 +Node: Extension Sample Rev2way1038837 +Node: Extension Sample Read write array1039577 +Node: Extension Sample Readfile1041517 +Node: Extension Sample Time1042612 +Node: Extension Sample API Tests1043960 +Node: gawkextlib1044451 +Node: Extension summary1047129 +Node: Extension Exercises1050818 +Node: Language History1051540 +Node: V7/SVR3.11053196 +Node: SVR41055349 +Node: POSIX1056783 +Node: BTL1058164 +Node: POSIX/GNU1058895 +Node: Feature History1064416 +Node: Common Extensions1077514 +Node: Ranges and Locales1078886 +Ref: Ranges and Locales-Footnote-11083505 +Ref: Ranges and Locales-Footnote-21083532 +Ref: Ranges and Locales-Footnote-31083767 +Node: Contributors1083988 +Node: History summary1089528 +Node: Installation1090907 +Node: Gawk Distribution1091853 +Node: Getting1092337 +Node: Extracting1093160 +Node: Distribution contents1094797 +Node: Unix Installation1100551 +Node: Quick Installation1101168 +Node: Additional Configuration Options1103592 +Node: Configuration Philosophy1105395 +Node: Non-Unix Installation1107764 +Node: PC Installation1108222 +Node: PC Binary Installation1109542 +Node: PC Compiling1111390 +Ref: PC Compiling-Footnote-11114411 +Node: PC Testing1114520 +Node: PC Using1115696 +Node: Cygwin1119811 +Node: MSYS1120581 +Node: VMS Installation1121082 +Node: VMS Compilation1121874 +Ref: VMS Compilation-Footnote-11123103 +Node: VMS Dynamic Extensions1123161 +Node: VMS Installation Details1124845 +Node: VMS Running1127096 +Node: VMS GNV1129936 +Node: VMS Old Gawk1130671 +Node: Bugs1131141 +Node: Other Versions1135030 +Node: Installation summary1141464 +Node: Notes1142523 +Node: Compatibility Mode1143388 +Node: Additions1144170 +Node: Accessing The Source1145095 +Node: Adding Code1146530 +Node: New Ports1152687 +Node: Derived Files1157169 +Ref: Derived Files-Footnote-11162644 +Ref: Derived Files-Footnote-21162678 +Ref: Derived Files-Footnote-31163274 +Node: Future Extensions1163388 +Node: Implementation Limitations1163994 +Node: Extension Design1165242 +Node: Old Extension Problems1166396 +Ref: Old Extension Problems-Footnote-11167913 +Node: Extension New Mechanism Goals1167970 +Ref: Extension New Mechanism Goals-Footnote-11171330 +Node: Extension Other Design Decisions1171519 +Node: Extension Future Growth1173627 +Node: Old Extension Mechanism1174463 +Node: Notes summary1176225 +Node: Basic Concepts1177411 +Node: Basic High Level1178092 +Ref: figure-general-flow1178364 +Ref: figure-process-flow1178963 +Ref: Basic High Level-Footnote-11182192 +Node: Basic Data Typing1182377 +Node: Glossary1185705 +Node: Copying1217634 +Node: GNU Free Documentation License1255190 +Node: Index1280326  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 8d219a0f..96d3370e 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -34595,11 +34595,16 @@ properly: # Please set INPLACE_SUFFIX to make a backup copy. For example, you may # want to set INPLACE_SUFFIX to .bak on the command line or in a BEGIN rule. +# N.B. We call inplace_end() in the BEGINFILE and END rules so that any +# actions in an ENDFILE rule will be redirected as expected. + BEGINFILE @{ - inplace_begin(FILENAME, INPLACE_SUFFIX) + if (_inplace_filename != "") + inplace_end(_inplace_filename, INPLACE_SUFFIX) + inplace_begin(_inplace_filename = FILENAME, INPLACE_SUFFIX) @} -ENDFILE @{ +END @{ inplace_end(FILENAME, INPLACE_SUFFIX) @} @end group @@ -34614,6 +34619,10 @@ If @code{INPLACE_SUFFIX} is not an empty string, the original file is linked to a backup @value{FN} created by appending that suffix. Finally, the temporary file is renamed to the original @value{FN}. +The @code{_inplace_filename} variable serves to keep track of the +current filename so as to not invoke @code{inplace_end()} before +processing the first file. + If any error occurs, the extension issues a fatal error to terminate processing immediately without damaging the original file. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index d4067f70..08a9f7c3 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -33686,11 +33686,16 @@ properly: # Please set INPLACE_SUFFIX to make a backup copy. For example, you may # want to set INPLACE_SUFFIX to .bak on the command line or in a BEGIN rule. +# N.B. We call inplace_end() in the BEGINFILE and END rules so that any +# actions in an ENDFILE rule will be redirected as expected. + BEGINFILE @{ - inplace_begin(FILENAME, INPLACE_SUFFIX) + if (_inplace_filename != "") + inplace_end(_inplace_filename, INPLACE_SUFFIX) + inplace_begin(_inplace_filename = FILENAME, INPLACE_SUFFIX) @} -ENDFILE @{ +END @{ inplace_end(FILENAME, INPLACE_SUFFIX) @} @end group @@ -33705,6 +33710,10 @@ If @code{INPLACE_SUFFIX} is not an empty string, the original file is linked to a backup @value{FN} created by appending that suffix. Finally, the temporary file is renamed to the original @value{FN}. +The @code{_inplace_filename} variable serves to keep track of the +current filename so as to not invoke @code{inplace_end()} before +processing the first file. + If any error occurs, the extension issues a fatal error to terminate processing immediately without damaging the original file. diff --git a/extension/ChangeLog b/extension/ChangeLog index 9d7e6173..b3c9c0d7 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2015-03-18 Arnold D. Robbins + + * inplace.3am (SYNOPSIS): Updated to not show the contents + of the extension. + (BUGS): Removed. + 2015-03-17 Arnold D. Robbins * inplace.c (do_inplace_begin): Jump through more hoops to satisfy diff --git a/extension/inplace.3am b/extension/inplace.3am index d6339c4a..f8fc098f 100644 --- a/extension/inplace.3am +++ b/extension/inplace.3am @@ -1,21 +1,10 @@ -.TH INPLACE 3am "Mar 16 2015" "Free Software Foundation" "GNU Awk Extension Modules" +.TH INPLACE 3am "Mar 18 2015" "Free Software Foundation" "GNU Awk Extension Modules" .SH NAME inplace \- emulate sed/perl/ruby in-place editing .SH SYNOPSIS .ft CW .nf -@load "inplace" - -# Please set INPLACE_SUFFIX to make a backup copy. For example, you may -# want to set INPLACE_SUFFIX to .bak on the command line or in a BEGIN rule. - -BEGINFILE { - inplace_begin(FILENAME, INPLACE_SUFFIX) -} - -ENDFILE { - inplace_end(FILENAME, INPLACE_SUFFIX) -} +gawk -i inplace ... .fi .ft R .SH DESCRIPTION @@ -27,8 +16,7 @@ and .BR inplace_end() . These functions are meant to be invoked from the .I inplace.awk -wrapper (whose contents are displayed above) -which is installed when +wrapper which is installed when .I gawk is. .PP @@ -45,10 +33,7 @@ extension concatenates that suffix onto the original filename and uses the result as a filename for renaming the original. ... .SH NOTES -.SH BUGS -As currently written, output from an \f(CWENDFILE\fP -rule does not get redirected into the replacement file. -Neither does output from an \f(CWEND\fP rule. +... .SH BUGS .SH EXAMPLE .ft CW .nf diff --git a/test/ChangeLog b/test/ChangeLog index 24d6bcd7..c33ac108 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-03-17 Andrew J. Schorr + + * inplace1.ok, inplace2.ok, inplace3.ok: Update error message line + numbers to reflect changes to inplace.awk. + 2015-03-17 Arnold D. Robbins * Makefile.am (mpfrmemok1): New test. diff --git a/test/inplace1.ok b/test/inplace1.ok index ffcb768d..82562235 100644 --- a/test/inplace1.ok +++ b/test/inplace1.ok @@ -1,5 +1,5 @@ before -gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end diff --git a/test/inplace2.ok b/test/inplace2.ok index ffcb768d..82562235 100644 --- a/test/inplace2.ok +++ b/test/inplace2.ok @@ -1,5 +1,5 @@ before -gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end diff --git a/test/inplace3.ok b/test/inplace3.ok index 7cd960bc..a7b7254f 100644 --- a/test/inplace3.ok +++ b/test/inplace3.ok @@ -1,11 +1,11 @@ before -gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end after Before -gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' stdin start is foo replaced? stdin end -- cgit v1.2.3 From 925f9363c4b0a5bb9375298afcdcf404efb32587 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 18 Mar 2015 21:53:21 +0200 Subject: Update to libtool 2.4.6. --- ChangeLog | 4 ++++ NEWS | 5 +++-- config.guess | 6 +++--- config.sub | 8 +++---- extension/ChangeLog | 4 ++++ extension/build-aux/ChangeLog | 4 ++++ extension/build-aux/config.guess | 6 +++--- extension/build-aux/config.sub | 8 +++---- extension/build-aux/ltmain.sh | 23 +++++++++++++------- extension/configure | 45 ++++++++++++++++++++++++++-------------- extension/m4/ChangeLog | 4 ++++ extension/m4/libtool.m4 | 27 ++++++++++++++---------- extension/m4/ltversion.m4 | 10 ++++----- 13 files changed, 98 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf18c51c..b8b3ee9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-03-18 Arnold D. Robbins + + * config.guess, config.sub: Updated, from libtool 2.4.6. + 2015-03-17 Arnold D. Robbins * profile.c (pp_number): Allocate enough room to print the number diff --git a/NEWS b/NEWS index faeb461f..0df1f0cd 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ - Copyright (C) 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, + Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -42,7 +43,7 @@ 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.15, Gettext 0.19.4, Libtool 2.4.5, +10. Infrastructure upgrades: Automake 1.15, Gettext 0.19.4, Libtool 2.4.6, Bison 3.0.4. 11. If a user-defined function has a parameter with the same name as another diff --git a/config.guess b/config.guess index 6c32c864..dbfb9786 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-11-04' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-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." diff --git a/config.sub b/config.sub index 7ffe3737..6d2e94c8 100755 --- a/config.sub +++ b/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-12-03' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -68,7 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-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." @@ -260,7 +260,7 @@ case $basic_machine in | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ - | fido | fr30 | frv \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ diff --git a/extension/ChangeLog b/extension/ChangeLog index b3c9c0d7..5d8c7b8a 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,7 @@ +2015-03-18 Arnold D. Robbins + + * configure: Updated to libtool 2.4.6. + 2015-03-18 Arnold D. Robbins * inplace.3am (SYNOPSIS): Updated to not show the contents diff --git a/extension/build-aux/ChangeLog b/extension/build-aux/ChangeLog index 697db607..589d20cc 100644 --- a/extension/build-aux/ChangeLog +++ b/extension/build-aux/ChangeLog @@ -1,3 +1,7 @@ +2015-03-18 Arnold D. Robbins + + * config.guess, config.sub, ltmain.sh: Updated, from libtool 2.4.6. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff --git a/extension/build-aux/config.guess b/extension/build-aux/config.guess index 6c32c864..dbfb9786 100755 --- a/extension/build-aux/config.guess +++ b/extension/build-aux/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-11-04' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-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." diff --git a/extension/build-aux/config.sub b/extension/build-aux/config.sub index 7ffe3737..6d2e94c8 100755 --- a/extension/build-aux/config.sub +++ b/extension/build-aux/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-12-03' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -68,7 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-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." @@ -260,7 +260,7 @@ case $basic_machine in | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ - | fido | fr30 | frv \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ diff --git a/extension/build-aux/ltmain.sh b/extension/build-aux/ltmain.sh index b8915268..0f0a2da3 100644 --- a/extension/build-aux/ltmain.sh +++ b/extension/build-aux/ltmain.sh @@ -2,7 +2,7 @@ ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.5 +# libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.5 -package_revision=2.4.5 +VERSION=2.4.6 +package_revision=2.4.6 ## ------ ## @@ -64,7 +64,7 @@ package_revision=2.4.5 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2014-01-03.01; # UTC +scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 @@ -192,7 +192,7 @@ func_path_progs () _G_path_prog_max=0 _G_path_prog_found=false - _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. @@ -1977,7 +1977,7 @@ func_version () # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.5' +scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... @@ -2039,7 +2039,12 @@ usage_message="Options: " # Additional text appended to 'usage_message' in response to '--help'. -long_help_message=$long_help_message" +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message MODE must be one of the following: @@ -2063,13 +2068,15 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.5 + version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." + exit 0 +} # func_lo2o OBJECT-NAME diff --git a/extension/configure b/extension/configure index 6818958b..199833f7 100755 --- a/extension/configure +++ b/extension/configure @@ -4852,8 +4852,8 @@ esac -macro_version='2.4.5' -macro_revision='2.4.5' +macro_version='2.4.6' +macro_revision='2.4.6' @@ -8187,7 +8187,7 @@ func_munge_path_list () x) ;; *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" @@ -11693,13 +11693,20 @@ 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 +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$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: +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + @@ -13791,7 +13798,8 @@ 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"`' -lt_cv_sys_lib_dlsearch_path_spec='`$ECHO "$lt_cv_sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $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"`' @@ -13909,7 +13917,8 @@ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -lt_cv_sys_lib_dlsearch_path_spec; do +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; 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 @@ -14685,7 +14694,7 @@ $as_echo X"$file" | available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -14936,8 +14945,11 @@ hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_lt_cv_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -15089,9 +15101,8 @@ hardcode_action=$hardcode_action _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" -## -------------------------------------- ## -## Shell functions shared with configure. ## -## -------------------------------------- ## + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- @@ -15113,7 +15124,7 @@ func_munge_path_list () x) ;; *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" @@ -15144,6 +15155,8 @@ func_cc_basename () } +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in diff --git a/extension/m4/ChangeLog b/extension/m4/ChangeLog index f991eac3..6895c6b6 100644 --- a/extension/m4/ChangeLog +++ b/extension/m4/ChangeLog @@ -1,3 +1,7 @@ +2015-03-18 Arnold D. Robbins + + * libtoolm4, ltversion.m4: Updated to libtool 2.4.6. + 2015-01-24 Arnold D. Robbins * gettext.m4, iconv.m4, intlmacosx.m4, po.m4: Removed. diff --git a/extension/m4/libtool.m4 b/extension/m4/libtool.m4 index f796d7bc..a3bc337b 100644 --- a/extension/m4/libtool.m4 +++ b/extension/m4/libtool.m4 @@ -738,7 +738,7 @@ _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS @@ -748,13 +748,14 @@ _LT_LIBTOOL_TAG_VARS _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" -## -------------------------------------- ## -## Shell functions shared with configure. ## -## -------------------------------------- ## + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in @@ -2256,7 +2257,7 @@ func_munge_path_list () x) ;; *:) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \$@S|@1\" + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" @@ -3100,13 +3101,15 @@ 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 +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$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: +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$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]) @@ -3139,8 +3142,10 @@ _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], [lt_cv_sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER diff --git a/extension/m4/ltversion.m4 b/extension/m4/ltversion.m4 index a4c5ed43..fa04b52a 100644 --- a/extension/m4/ltversion.m4 +++ b/extension/m4/ltversion.m4 @@ -9,15 +9,15 @@ # @configure_input@ -# serial 4171 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.5]) -m4_define([LT_PACKAGE_REVISION], [2.4.5]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.5' -macro_revision='2.4.5' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) -- cgit v1.2.3 From 59514868fde1190f719e78d4c4b91bd14a321541 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 20 Mar 2015 10:31:49 +0200 Subject: Start on testing/fixing indirect calls of builtins. --- ChangeLog | 11 +++ awk.h | 1 + awkgram.c | 18 +++- awkgram.y | 18 +++- builtin.c | 23 +++++ indirectbuitin.awk | 247 +++++++++++++++++++++++++++++++++++++++++++++++++++++ interpret.h | 6 +- 7 files changed, 319 insertions(+), 5 deletions(-) create mode 100644 indirectbuitin.awk diff --git a/ChangeLog b/ChangeLog index b8b3ee9a..723ee3a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2015-03-20 Arnold D. Robbins + + Start on fixing indirect calls of builtins. + + * awk.h (call_sub_func): Add declaration. + * awkgram.y (lookup_builtin): Handle length, sub functions. + (install_builtin): Handle length function. + * builtin.c (call_sub_func): New function. + * interpret.h (r_interpret): If calling do_sub, do it through + call_sub_func(). + 2015-03-18 Arnold D. Robbins * config.guess, config.sub: Updated, from libtool 2.4.6. diff --git a/awk.h b/awk.h index 08c6891c..f2ef3582 100644 --- a/awk.h +++ b/awk.h @@ -1360,6 +1360,7 @@ extern NODE *do_rand(int nargs); extern NODE *do_srand(int nargs); extern NODE *do_match(int nargs); extern NODE *do_sub(int nargs, unsigned int flags); +extern NODE *call_sub_func(const char *name, int nargs); extern NODE *format_tree(const char *, size_t, NODE **, long); extern NODE *do_lshift(int nargs); extern NODE *do_rshift(int nargs); diff --git a/awkgram.c b/awkgram.c index 5376d010..ec9b16ac 100644 --- a/awkgram.c +++ b/awkgram.c @@ -7969,13 +7969,26 @@ lookup_builtin(const char *name) { int mid = check_special(name); - if (mid == -1 || tokentab[mid].class != LEX_BUILTIN) + if (mid == -1) return NULL; + + switch (tokentab[mid].class) { + case LEX_BUILTIN: + case LEX_LENGTH: + break; + default: + return NULL; + } + #ifdef HAVE_MPFR if (do_mpfr) return tokentab[mid].ptr2; #endif + /* And another special case... */ + if (tokentab[mid].value == Op_sub_builtin) + return (builtin_func_t) do_sub; + return tokentab[mid].ptr; } @@ -7988,7 +8001,8 @@ install_builtins(void) j = sizeof(tokentab) / sizeof(tokentab[0]); for (i = 0; i < j; i++) { - if ( tokentab[i].class == LEX_BUILTIN + if ( (tokentab[i].class == LEX_BUILTIN + || tokentab[i].class == LEX_LENGTH) && (tokentab[i].flags & DEBUG_USE) == 0) { (void) install_symbol(tokentab[i].operator, Node_builtin_func); } diff --git a/awkgram.y b/awkgram.y index 2307c362..2be4d37c 100644 --- a/awkgram.y +++ b/awkgram.y @@ -5630,13 +5630,26 @@ lookup_builtin(const char *name) { int mid = check_special(name); - if (mid == -1 || tokentab[mid].class != LEX_BUILTIN) + if (mid == -1) return NULL; + + switch (tokentab[mid].class) { + case LEX_BUILTIN: + case LEX_LENGTH: + break; + default: + return NULL; + } + #ifdef HAVE_MPFR if (do_mpfr) return tokentab[mid].ptr2; #endif + /* And another special case... */ + if (tokentab[mid].value == Op_sub_builtin) + return (builtin_func_t) do_sub; + return tokentab[mid].ptr; } @@ -5649,7 +5662,8 @@ install_builtins(void) j = sizeof(tokentab) / sizeof(tokentab[0]); for (i = 0; i < j; i++) { - if ( tokentab[i].class == LEX_BUILTIN + if ( (tokentab[i].class == LEX_BUILTIN + || tokentab[i].class == LEX_LENGTH) && (tokentab[i].flags & DEBUG_USE) == 0) { (void) install_symbol(tokentab[i].operator, Node_builtin_func); } diff --git a/builtin.c b/builtin.c index 1383572a..4dd08eb1 100644 --- a/builtin.c +++ b/builtin.c @@ -2994,6 +2994,29 @@ done: return make_number((AWKNUM) matches); } +/* call_sub_func --- call do_sub indirectly */ + +NODE * +call_sub_func(const char *name, int nargs) +{ + unsigned int flags = 0; + NODE *tmp; + + if (name[0] == 'g') { + if (name[1] == 'e') + flags = GENSUB; + else + flags = GSUB; + } + + tmp = PEEK(1); + if (tmp->type == Node_val) { + flags |= LITERAL; + } + + return do_sub(nargs, flags); +} + /* make_integer - Convert an integer to a number node. */ diff --git a/indirectbuitin.awk b/indirectbuitin.awk new file mode 100644 index 00000000..26cb5cc4 --- /dev/null +++ b/indirectbuitin.awk @@ -0,0 +1,247 @@ +function print_result(category, fname, builtin_result, indirect_result) +{ + if (builtin_result == indirect_result) + printf("%s: %s: pass\n", category, fname) + else + printf("%s: %s: fail: builtin: %s \tindirect: %s\n", category, fname, + builtin_result, indirect_result) +} + +BEGIN { + + fun = "sub" + x = "ff11bb" + b1 = sub("f", "q", x) + i1 = @fun("f", "q", x) + print_result("string", fun, b1, i1) +} + + +BEGIN { +# math functions + + fun = "and" + b1 = and(0x11, 0x01) + i1 = @fun(0x11, 0x01) + print_result("math", fun, b1, i1) + + fun = "atan2" + b1 = atan2(-1, 0) + i1 = @fun(-1, 0) + print_result("math", fun, b1, i1) + + fun = "compl" + b1 = compl(0x1111) + i1 = @fun(0x1111) + print_result("math", fun, b1, i1) + + fun = "cos" + b1 = cos(3.1415927 / 4) + i1 = @fun(3.1415927 / 4) + print_result("math", fun, b1, i1) + + fun = "exp" + b1 = exp(2) + i1 = @fun(2) + print_result("math", fun, b1, i1) + + fun = "int" + b1 = int(3.1415927) + i1 = @fun(3.1415927) + print_result("math", fun, b1, i1) + + fun = "log" + b1 = log(10) + i1 = @fun(10) + print_result("math", fun, b1, i1) + + fun = "lshift" + b1 = lshift(1, 2) + i1 = @fun(1, 2) + print_result("math", fun, b1, i1) + + fun = "or" + b1 = or(0x10, 0x01) + i1 = @fun(0x10, 0x01) + print_result("math", fun, b1, i1) + + fun = "rand" + srand(1) + b1 = rand(); + srand(1) + i1 = @fun() + print_result("math", fun, b1, i1) + + fun = "rshift" + b1 = rshift(0x10, 1) + i1 = @fun(0x10, 1) + print_result("math", fun, b1, i1) + + fun = "sin" + b1 = sin(3.1415927 / 4) + i1 = @fun(3.1415927 / 4) + print_result("math", fun, b1, i1) + + fun = "sqrt" + b1 = sqrt(2) + i1 = @fun(2) + print_result("math", fun, b1, i1) + + srand() + fun = "srand" + b1 = srand() + i1 = @fun() + print_result("math", fun, b1, i1) + + fun = "xor" + b1 = xor(0x11, 0x01) + i1 = @fun(0x11, 0x01) + print_result("math", fun, b1, i1) + +# string functions + +# fun = "gensub" +# b1 = gensub("f", "q","g", "ff11bb") +# i1 = @fun("f", "q", "g", "ff11bb") +# print_result("string", fun, b1, i1) + +# fun = "gsub" +# x = "ff11bb" +# b1 = gsub("f", "q", x) +# i1 = @fun("f", "q", x) +# print_result("string", fun, b1, i1) + + fun = "index" + b1 = index("hi, how are you", "how") + i1 = @fun("hi, how are you", "how") + print_result("string", fun, b1, i1) + + fun = "dcgettext" + b1 = dcgettext("hello, world") + i1 = @fun("hello, world") + print_result("string", fun, b1, i1) + + fun = "dcngettext" + b1 = dcngettext("hello, world", "howdy", 2) + i1 = @fun("hello, world", "howdy", 2) + print_result("string", fun, b1, i1) + + fun = "length" + b1 = length("hi, how are you") + i1 = @fun("hi, how are you") + print_result("string", fun, b1, i1) + + fun = "sprintf" + b1 = sprintf("%s world", "hello") + i1 = @fun("%s world", "hello") + print_result("string", fun, b1, i1) + + fun = "strtonum" + b1 = strtonum("0xdeadbeef") + i1 = @fun("0xdeadbeef") + print_result("string", fun, b1, i1) + + fun = "sub" + x = "ff11bb" + b1 = sub("f", "q", x) + i1 = @fun("f", "q", x) + print_result("string", fun, b1, i1) + + fun = "substr" + b1 = substr("0xdeadbeef", 7, 4) + i1 = @fun("0xdeadbeef", 7, 4) + print_result("string", fun, b1, i1) + + fun = "tolower" + b1 = tolower("0xDeAdBeEf") + i1 = @fun("0xDeAdBeEf") + print_result("string", fun, b1, i1) + + fun = "toupper" + b1 = toupper("0xDeAdBeEf") + i1 = @fun("0xDeAdBeEf") + print_result("string", fun, b1, i1) + +# time functions + + fun = "mktime" + b1 = mktime("1990 02 11 12 00 00") + i1 = @fun("1990 02 11 12 00 00") + print_result("time", fun, b1, i1) + + then = b1 + fun = "strftime" + b1 = strftime(PROCINFO["strftime"], then) + i1 = @fun(PROCINFO["strftime"], then) + print_result("time", fun, b1, i1) + + fun = "systime" + b1 = systime() + i1 = @fun() + print_result("time", fun, b1, i1) + +# regexp functions + +# fun = "match" +# print_result("regexp", fun, b1, i1) + +# fun = "patsplit" +# print_result("regexp", fun, b1, i1) + +# fun = "split" +# print_result("regexp", fun, b1, i1) + +# array functions + + split("z y x w v u t", data) + fun = "asort" + asort(data, newdata) + @fun(data, newdata2) + print_result("array", fun, b1, i1) + for (i in newdata) { + if (! (i in newdata2) || newdata[i] != newdata2[i]) { + print fun ": failed, index", i + exit + } + } + + for (i in data) + data2[data[i]] = i + + fun = "asorti" + asort(data2, newdata) + @fun(data2, newdata2) + print_result("array", fun, b1, i1) + for (i in newdata) { + if (! (i in newdata2) || newdata[i] != newdata2[i]) { + print fun ": failed, index", i + exit + } + } + + arr[1] = arr[2] = 42 + fun = "isarray" + b1 = isarray(arr) + i1 = @fun(arr) + print_result("array", fun, b1, i1) + +# i/o functions + + print("hi") > "x1.out" + print("hi") > "x2.out" + + fun = "fflush" + b1 = fflush("x1.out") + i1 = @fun("x2.out") + print_result("i/o", fun, b1, i1) + + fun = "close" + b1 = close("x1.out") + i1 = @fun("x2.out") + print_result("i/o", fun, b1, i1) + + fun = "system" + b1 = system("rm x1.out") + i1 = @fun("rm x2.out") + print_result("i/o", fun, b1, i1) +} diff --git a/interpret.h b/interpret.h index b16dc126..9160d479 100644 --- a/interpret.h +++ b/interpret.h @@ -1066,7 +1066,11 @@ match_re: assert(the_func != NULL); /* call it */ - r = the_func(arg_count); + if (the_func == do_sub) + r = call_sub_func(t1->stptr, arg_count); + else + r = the_func(arg_count); + PUSH(r); break; } else if (f->type != Node_func) { -- cgit v1.2.3 From 981e106b111672aac520fbb397ee82c64f3c4f2a Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Mar 2015 22:07:41 +0200 Subject: Doc updates. --- doc/ChangeLog | 5 ++ doc/gawk.info | 170 ++++++++++++++++++++++++++++++-------------------------- doc/gawk.texi | 22 +++++++- doc/gawktexi.in | 22 +++++++- 4 files changed, 137 insertions(+), 82 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f2fa97bc..6dbe79dc 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Arnold D. Robbins + + * gawktexi.in: Minor fixes from Antonio Colombo and new exercise + in chapter 16. + 2015-03-17 Andrew J. Schorr * gawktexi.in: Modify inplace.awk to call inplace_end in BEGINFILE diff --git a/doc/gawk.info b/doc/gawk.info index d6aea49f..6cb2abdb 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -26121,12 +26121,26 @@ File: gawk.info, Node: Extension Exercises, Prev: Extension summary, Up: Dyna `chmod()', and `umask()' to the file operations extension presented in *note Internal File Ops::. - 2. (Hard.) How would you provide namespaces in `gawk', so that the + 2. Write an input parser that prints a prompt if the input is a from + a "terminal" device. You can use the `isatty()' function to tell + if the input file is a terminal. (Hint: this function is usually + expensive to call; try to call it just once.) The content of the + prompt should come from a variable settable by `awk'-level code. + You can write the prompt to stanard error. However, for best + results, open a new file descriptor (or file pointer) on + `/dev/tty' and print the prompt there, in case standard error has + been redirected. + + Why is standard error a better choice than standard output for + writing the prompt? Which reading mechanism should you replace, + the one to get a record, or the one to read raw bytes? + + 3. (Hard.) How would you provide namespaces in `gawk', so that the names of functions in different extensions don't conflict with each other? If you come up with a really good scheme, contact the `gawk' maintainer to tell him about it. - 3. Write a wrapper script that provides an interface similar to `sed + 4. Write a wrapper script that provides an interface similar to `sed -i' for the "inplace" extension presented in *note Extension Sample Inplace::. @@ -33416,7 +33430,7 @@ Index * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) * metacharacters, escape sequences for: Escape Sequences. (line 136) -* minimum precision supported by MPFR library: Auto-set. (line 224) +* minimum precision required by MPFR library: Auto-set. (line 224) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 104) @@ -33756,7 +33770,7 @@ Index * printing, unduplicated lines of text: Uniq Program. (line 6) * printing, user information: Id Program. (line 6) * private variables: Library Names. (line 11) -* process group idIDof gawk process: Auto-set. (line 183) +* process group ID of gawk process: Auto-set. (line 183) * process ID of gawk process: Auto-set. (line 186) * processes, two-way communications with: Two-way I/O. (line 6) * processing data: Basic High Level. (line 6) @@ -34976,79 +34990,79 @@ Node: Extension Sample API Tests1043960 Node: gawkextlib1044451 Node: Extension summary1047129 Node: Extension Exercises1050818 -Node: Language History1051540 -Node: V7/SVR3.11053196 -Node: SVR41055349 -Node: POSIX1056783 -Node: BTL1058164 -Node: POSIX/GNU1058895 -Node: Feature History1064416 -Node: Common Extensions1077514 -Node: Ranges and Locales1078886 -Ref: Ranges and Locales-Footnote-11083505 -Ref: Ranges and Locales-Footnote-21083532 -Ref: Ranges and Locales-Footnote-31083767 -Node: Contributors1083988 -Node: History summary1089528 -Node: Installation1090907 -Node: Gawk Distribution1091853 -Node: Getting1092337 -Node: Extracting1093160 -Node: Distribution contents1094797 -Node: Unix Installation1100551 -Node: Quick Installation1101168 -Node: Additional Configuration Options1103592 -Node: Configuration Philosophy1105395 -Node: Non-Unix Installation1107764 -Node: PC Installation1108222 -Node: PC Binary Installation1109542 -Node: PC Compiling1111390 -Ref: PC Compiling-Footnote-11114411 -Node: PC Testing1114520 -Node: PC Using1115696 -Node: Cygwin1119811 -Node: MSYS1120581 -Node: VMS Installation1121082 -Node: VMS Compilation1121874 -Ref: VMS Compilation-Footnote-11123103 -Node: VMS Dynamic Extensions1123161 -Node: VMS Installation Details1124845 -Node: VMS Running1127096 -Node: VMS GNV1129936 -Node: VMS Old Gawk1130671 -Node: Bugs1131141 -Node: Other Versions1135030 -Node: Installation summary1141464 -Node: Notes1142523 -Node: Compatibility Mode1143388 -Node: Additions1144170 -Node: Accessing The Source1145095 -Node: Adding Code1146530 -Node: New Ports1152687 -Node: Derived Files1157169 -Ref: Derived Files-Footnote-11162644 -Ref: Derived Files-Footnote-21162678 -Ref: Derived Files-Footnote-31163274 -Node: Future Extensions1163388 -Node: Implementation Limitations1163994 -Node: Extension Design1165242 -Node: Old Extension Problems1166396 -Ref: Old Extension Problems-Footnote-11167913 -Node: Extension New Mechanism Goals1167970 -Ref: Extension New Mechanism Goals-Footnote-11171330 -Node: Extension Other Design Decisions1171519 -Node: Extension Future Growth1173627 -Node: Old Extension Mechanism1174463 -Node: Notes summary1176225 -Node: Basic Concepts1177411 -Node: Basic High Level1178092 -Ref: figure-general-flow1178364 -Ref: figure-process-flow1178963 -Ref: Basic High Level-Footnote-11182192 -Node: Basic Data Typing1182377 -Node: Glossary1185705 -Node: Copying1217634 -Node: GNU Free Documentation License1255190 -Node: Index1280326 +Node: Language History1052314 +Node: V7/SVR3.11053970 +Node: SVR41056123 +Node: POSIX1057557 +Node: BTL1058938 +Node: POSIX/GNU1059669 +Node: Feature History1065190 +Node: Common Extensions1078288 +Node: Ranges and Locales1079660 +Ref: Ranges and Locales-Footnote-11084279 +Ref: Ranges and Locales-Footnote-21084306 +Ref: Ranges and Locales-Footnote-31084541 +Node: Contributors1084762 +Node: History summary1090302 +Node: Installation1091681 +Node: Gawk Distribution1092627 +Node: Getting1093111 +Node: Extracting1093934 +Node: Distribution contents1095571 +Node: Unix Installation1101325 +Node: Quick Installation1101942 +Node: Additional Configuration Options1104366 +Node: Configuration Philosophy1106169 +Node: Non-Unix Installation1108538 +Node: PC Installation1108996 +Node: PC Binary Installation1110316 +Node: PC Compiling1112164 +Ref: PC Compiling-Footnote-11115185 +Node: PC Testing1115294 +Node: PC Using1116470 +Node: Cygwin1120585 +Node: MSYS1121355 +Node: VMS Installation1121856 +Node: VMS Compilation1122648 +Ref: VMS Compilation-Footnote-11123877 +Node: VMS Dynamic Extensions1123935 +Node: VMS Installation Details1125619 +Node: VMS Running1127870 +Node: VMS GNV1130710 +Node: VMS Old Gawk1131445 +Node: Bugs1131915 +Node: Other Versions1135804 +Node: Installation summary1142238 +Node: Notes1143297 +Node: Compatibility Mode1144162 +Node: Additions1144944 +Node: Accessing The Source1145869 +Node: Adding Code1147304 +Node: New Ports1153461 +Node: Derived Files1157943 +Ref: Derived Files-Footnote-11163418 +Ref: Derived Files-Footnote-21163452 +Ref: Derived Files-Footnote-31164048 +Node: Future Extensions1164162 +Node: Implementation Limitations1164768 +Node: Extension Design1166016 +Node: Old Extension Problems1167170 +Ref: Old Extension Problems-Footnote-11168687 +Node: Extension New Mechanism Goals1168744 +Ref: Extension New Mechanism Goals-Footnote-11172104 +Node: Extension Other Design Decisions1172293 +Node: Extension Future Growth1174401 +Node: Old Extension Mechanism1175237 +Node: Notes summary1176999 +Node: Basic Concepts1178185 +Node: Basic High Level1178866 +Ref: figure-general-flow1179138 +Ref: figure-process-flow1179737 +Ref: Basic High Level-Footnote-11182966 +Node: Basic Data Typing1183151 +Node: Glossary1186479 +Node: Copying1218408 +Node: GNU Free Documentation License1255964 +Node: Index1281100  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 96d3370e..80f8528d 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -14956,7 +14956,7 @@ while the program runs. The value of the @code{getgid()} system call. @item PROCINFO["pgrpid"] -@cindex process group idIDof @command{gawk} process +@cindex process group ID of @command{gawk} process The process group ID of the current process. @item PROCINFO["pid"] @@ -15008,7 +15008,7 @@ The version of the GNU MP library. The maximum precision supported by MPFR. @item PROCINFO["prec_min"] -@cindex minimum precision supported by MPFR library +@cindex minimum precision required by MPFR library The minimum precision required by MPFR. @end table @@ -35117,6 +35117,24 @@ Add functions to implement system calls such as @code{chown()}, @code{chmod()}, and @code{umask()} to the file operations extension presented in @ref{Internal File Ops}. +@c Idea from comp.lang.awk, February 2015 +@item +Write an input parser that prints a prompt if the input is +a from a ``terminal'' device. You can use the @code{isatty()} +function to tell if the input file is a terminal. (Hint: this function +is usually expensive to call; try to call it just once.) +The content of the prompt should come from a variable settable +by @command{awk}-level code. +You can write the prompt to stanard error. However, +for best results, open a new file descriptor (or file pointer) +on @file{/dev/tty} and print the prompt there, in case standard +error has been redirected. + +Why is standard error a better +choice than standard output for writing the prompt? +Which reading mechanism should you replace, the one to get +a record, or the one to read raw bytes? + @item (Hard.) How would you provide namespaces in @command{gawk}, so that the diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 08a9f7c3..cf669976 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -14284,7 +14284,7 @@ while the program runs. The value of the @code{getgid()} system call. @item PROCINFO["pgrpid"] -@cindex process group idIDof @command{gawk} process +@cindex process group ID of @command{gawk} process The process group ID of the current process. @item PROCINFO["pid"] @@ -14336,7 +14336,7 @@ The version of the GNU MP library. The maximum precision supported by MPFR. @item PROCINFO["prec_min"] -@cindex minimum precision supported by MPFR library +@cindex minimum precision required by MPFR library The minimum precision required by MPFR. @end table @@ -34208,6 +34208,24 @@ Add functions to implement system calls such as @code{chown()}, @code{chmod()}, and @code{umask()} to the file operations extension presented in @ref{Internal File Ops}. +@c Idea from comp.lang.awk, February 2015 +@item +Write an input parser that prints a prompt if the input is +a from a ``terminal'' device. You can use the @code{isatty()} +function to tell if the input file is a terminal. (Hint: this function +is usually expensive to call; try to call it just once.) +The content of the prompt should come from a variable settable +by @command{awk}-level code. +You can write the prompt to stanard error. However, +for best results, open a new file descriptor (or file pointer) +on @file{/dev/tty} and print the prompt there, in case standard +error has been redirected. + +Why is standard error a better +choice than standard output for writing the prompt? +Which reading mechanism should you replace, the one to get +a record, or the one to read raw bytes? + @item (Hard.) How would you provide namespaces in @command{gawk}, so that the -- cgit v1.2.3 From 75459887958f5246bc5126261ec92c8f4d366a47 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Mar 2015 22:12:17 +0200 Subject: Fix a test. --- test/ChangeLog | 4 ++++ test/id.ok | 1 + 2 files changed, 5 insertions(+) diff --git a/test/ChangeLog b/test/ChangeLog index c33ac108..ab7a2163 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2015-03-24 Arnold D. Robbins + + * id.ok: Update after fixes in code. + 2015-03-17 Andrew J. Schorr * inplace1.ok, inplace2.ok, inplace3.ok: Update error message line diff --git a/test/id.ok b/test/id.ok index a3271cff..011d6cf2 100644 --- a/test/id.ok +++ b/test/id.ok @@ -14,6 +14,7 @@ sprintf -> builtin ROUNDMODE -> scalar strftime -> builtin systime -> builtin +length -> builtin and -> builtin srand -> builtin FNR -> scalar -- cgit v1.2.3 From 080694ae82635e76992158591b39a06af7363da0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Mar 2015 22:15:31 +0200 Subject: Further progress on indirect calls of builtins. --- ChangeLog | 9 + awk.h | 1 + awkgram.c | 721 ++++++++++++++++++++++++++--------------------------- awkgram.y | 3 +- builtin.c | 15 +- indirectbuitin.awk | 9 +- interpret.h | 2 +- node.c | 8 + 8 files changed, 395 insertions(+), 373 deletions(-) diff --git a/ChangeLog b/ChangeLog index 723ee3a6..8610df82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-03-24 Arnold D. Robbins + + * awkgram.y (make_regnode): Make extern. + * awk.h (make_regnode): Declare. + * builtin.c (call_sub_func): Start on reworking the stack to + be what do_sub() expects. Still needs work. + * interpret.h (r_interpret): Add a cast in comparison with do_sub(). + * node.c (r_unref): Handle Node_regex nodes. + 2015-03-20 Arnold D. Robbins Start on fixing indirect calls of builtins. diff --git a/awk.h b/awk.h index f2ef3582..f23977fb 100644 --- a/awk.h +++ b/awk.h @@ -1331,6 +1331,7 @@ extern void install_builtins(void); extern bool is_alpha(int c); extern bool is_alnum(int c); extern bool is_identchar(int c); +extern NODE *make_regnode(int type, NODE *exp); /* builtin.c */ extern double double_to_int(double d); extern NODE *do_exp(int nargs); diff --git a/awkgram.c b/awkgram.c index ec9b16ac..fcde2564 100644 --- a/awkgram.c +++ b/awkgram.c @@ -113,7 +113,6 @@ static INSTRUCTION *mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op) static INSTRUCTION *mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTION *op); static INSTRUCTION *mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op); static INSTRUCTION *mk_getline(INSTRUCTION *op, INSTRUCTION *opt_var, INSTRUCTION *redir, int redirtype); -static NODE *make_regnode(int type, NODE *exp); static int count_expressions(INSTRUCTION **list, bool isarg); static INSTRUCTION *optimize_assignment(INSTRUCTION *exp); static void add_lint(INSTRUCTION *list, LINTTYPE linttype); @@ -192,7 +191,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -#line 196 "awkgram.c" /* yacc.c:339 */ +#line 195 "awkgram.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -346,7 +345,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 350 "awkgram.c" /* yacc.c:358 */ +#line 349 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -648,25 +647,25 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 195, 195, 197, 202, 203, 207, 219, 223, 234, - 240, 246, 255, 263, 265, 270, 278, 280, 286, 287, - 289, 315, 326, 337, 343, 352, 362, 364, 366, 372, - 380, 381, 385, 404, 403, 437, 439, 444, 445, 458, - 463, 464, 468, 470, 472, 479, 569, 611, 653, 766, - 773, 780, 790, 799, 808, 817, 828, 844, 843, 867, - 879, 879, 977, 977, 1010, 1040, 1046, 1047, 1053, 1054, - 1061, 1066, 1078, 1092, 1094, 1102, 1107, 1109, 1117, 1119, - 1128, 1129, 1137, 1142, 1142, 1153, 1157, 1165, 1166, 1169, - 1171, 1176, 1177, 1186, 1187, 1192, 1197, 1203, 1205, 1207, - 1214, 1215, 1221, 1222, 1227, 1229, 1234, 1236, 1244, 1249, - 1258, 1265, 1267, 1269, 1285, 1295, 1302, 1304, 1309, 1311, - 1313, 1321, 1323, 1328, 1330, 1335, 1337, 1339, 1389, 1391, - 1393, 1395, 1397, 1399, 1401, 1403, 1417, 1422, 1427, 1452, - 1458, 1460, 1462, 1464, 1466, 1468, 1473, 1477, 1509, 1511, - 1517, 1523, 1536, 1537, 1538, 1543, 1548, 1552, 1556, 1571, - 1584, 1589, 1626, 1655, 1656, 1662, 1663, 1668, 1670, 1677, - 1694, 1711, 1713, 1720, 1725, 1733, 1743, 1755, 1764, 1768, - 1772, 1776, 1780, 1784, 1787, 1789, 1793, 1797, 1801 + 0, 194, 194, 196, 201, 202, 206, 218, 222, 233, + 239, 245, 254, 262, 264, 269, 277, 279, 285, 286, + 288, 314, 325, 336, 342, 351, 361, 363, 365, 371, + 379, 380, 384, 403, 402, 436, 438, 443, 444, 457, + 462, 463, 467, 469, 471, 478, 568, 610, 652, 765, + 772, 779, 789, 798, 807, 816, 827, 843, 842, 866, + 878, 878, 976, 976, 1009, 1039, 1045, 1046, 1052, 1053, + 1060, 1065, 1077, 1091, 1093, 1101, 1106, 1108, 1116, 1118, + 1127, 1128, 1136, 1141, 1141, 1152, 1156, 1164, 1165, 1168, + 1170, 1175, 1176, 1185, 1186, 1191, 1196, 1202, 1204, 1206, + 1213, 1214, 1220, 1221, 1226, 1228, 1233, 1235, 1243, 1248, + 1257, 1264, 1266, 1268, 1284, 1294, 1301, 1303, 1308, 1310, + 1312, 1320, 1322, 1327, 1329, 1334, 1336, 1338, 1388, 1390, + 1392, 1394, 1396, 1398, 1400, 1402, 1416, 1421, 1426, 1451, + 1457, 1459, 1461, 1463, 1465, 1467, 1472, 1476, 1508, 1510, + 1516, 1522, 1535, 1536, 1537, 1542, 1547, 1551, 1555, 1570, + 1583, 1588, 1625, 1654, 1655, 1661, 1662, 1667, 1669, 1676, + 1693, 1710, 1712, 1719, 1724, 1732, 1742, 1754, 1763, 1767, + 1771, 1775, 1779, 1783, 1786, 1788, 1792, 1796, 1800 }; #endif @@ -1839,24 +1838,24 @@ yyreduce: switch (yyn) { case 3: -#line 198 "awkgram.y" /* yacc.c:1646 */ +#line 197 "awkgram.y" /* yacc.c:1646 */ { rule = 0; yyerrok; } -#line 1848 "awkgram.c" /* yacc.c:1646 */ +#line 1847 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 204 "awkgram.y" /* yacc.c:1646 */ +#line 203 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); } -#line 1856 "awkgram.c" /* yacc.c:1646 */ +#line 1855 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 208 "awkgram.y" /* yacc.c:1646 */ +#line 207 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -1865,19 +1864,19 @@ yyreduce: */ /* yyerrok; */ } -#line 1869 "awkgram.c" /* yacc.c:1646 */ +#line 1868 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 220 "awkgram.y" /* yacc.c:1646 */ +#line 219 "awkgram.y" /* yacc.c:1646 */ { (void) append_rule((yyvsp[-1]), (yyvsp[0])); } -#line 1877 "awkgram.c" /* yacc.c:1646 */ +#line 1876 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 224 "awkgram.y" /* yacc.c:1646 */ +#line 223 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1888,41 +1887,41 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1892 "awkgram.c" /* yacc.c:1646 */ +#line 1891 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 235 "awkgram.y" /* yacc.c:1646 */ +#line 234 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1902 "awkgram.c" /* yacc.c:1646 */ +#line 1901 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 241 "awkgram.y" /* yacc.c:1646 */ +#line 240 "awkgram.y" /* yacc.c:1646 */ { want_source = false; at_seen = false; yyerrok; } -#line 1912 "awkgram.c" /* yacc.c:1646 */ +#line 1911 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 247 "awkgram.y" /* yacc.c:1646 */ +#line 246 "awkgram.y" /* yacc.c:1646 */ { want_source = false; at_seen = false; yyerrok; } -#line 1922 "awkgram.c" /* yacc.c:1646 */ +#line 1921 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 256 "awkgram.y" /* yacc.c:1646 */ +#line 255 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1930,23 +1929,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1934 "awkgram.c" /* yacc.c:1646 */ +#line 1933 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 264 "awkgram.y" /* yacc.c:1646 */ +#line 263 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1940 "awkgram.c" /* yacc.c:1646 */ +#line 1939 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 266 "awkgram.y" /* yacc.c:1646 */ +#line 265 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1946 "awkgram.c" /* yacc.c:1646 */ +#line 1945 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 271 "awkgram.y" /* yacc.c:1646 */ +#line 270 "awkgram.y" /* yacc.c:1646 */ { if (load_library((yyvsp[0])) < 0) YYABORT; @@ -1954,35 +1953,35 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1958 "awkgram.c" /* yacc.c:1646 */ +#line 1957 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 279 "awkgram.y" /* yacc.c:1646 */ +#line 278 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1964 "awkgram.c" /* yacc.c:1646 */ +#line 1963 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 281 "awkgram.y" /* yacc.c:1646 */ +#line 280 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1970 "awkgram.c" /* yacc.c:1646 */ +#line 1969 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 286 "awkgram.y" /* yacc.c:1646 */ +#line 285 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; rule = Rule; } -#line 1976 "awkgram.c" /* yacc.c:1646 */ +#line 1975 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 288 "awkgram.y" /* yacc.c:1646 */ +#line 287 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); rule = Rule; } -#line 1982 "awkgram.c" /* yacc.c:1646 */ +#line 1981 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 290 "awkgram.y" /* yacc.c:1646 */ +#line 289 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2008,11 +2007,11 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2012 "awkgram.c" /* yacc.c:1646 */ +#line 2011 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 316 "awkgram.y" /* yacc.c:1646 */ +#line 315 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; if (do_lint_old && ++begin_seen == 2) @@ -2023,11 +2022,11 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2027 "awkgram.c" /* yacc.c:1646 */ +#line 2026 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 327 "awkgram.y" /* yacc.c:1646 */ +#line 326 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; if (do_lint_old && ++end_seen == 2) @@ -2038,73 +2037,73 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2042 "awkgram.c" /* yacc.c:1646 */ +#line 2041 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 338 "awkgram.y" /* yacc.c:1646 */ +#line 337 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2052 "awkgram.c" /* yacc.c:1646 */ +#line 2051 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 344 "awkgram.y" /* yacc.c:1646 */ +#line 343 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2062 "awkgram.c" /* yacc.c:1646 */ +#line 2061 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 353 "awkgram.y" /* yacc.c:1646 */ +#line 352 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-3]) == NULL) (yyval) = list_create(instruction(Op_no_op)); else (yyval) = (yyvsp[-3]); } -#line 2073 "awkgram.c" /* yacc.c:1646 */ +#line 2072 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 363 "awkgram.y" /* yacc.c:1646 */ +#line 362 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2079 "awkgram.c" /* yacc.c:1646 */ +#line 2078 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 365 "awkgram.y" /* yacc.c:1646 */ +#line 364 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2085 "awkgram.c" /* yacc.c:1646 */ +#line 2084 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 367 "awkgram.y" /* yacc.c:1646 */ +#line 366 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2095 "awkgram.c" /* yacc.c:1646 */ +#line 2094 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 373 "awkgram.y" /* yacc.c:1646 */ +#line 372 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); at_seen = false; } -#line 2104 "awkgram.c" /* yacc.c:1646 */ +#line 2103 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 386 "awkgram.y" /* yacc.c:1646 */ +#line 385 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-5])->source_file = source; if (install_function((yyvsp[-4])->lextok, (yyvsp[-5]), (yyvsp[-2])) < 0) @@ -2115,17 +2114,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2119 "awkgram.c" /* yacc.c:1646 */ +#line 2118 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 404 "awkgram.y" /* yacc.c:1646 */ +#line 403 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2125 "awkgram.c" /* yacc.c:1646 */ +#line 2124 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 406 "awkgram.y" /* yacc.c:1646 */ +#line 405 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2154,23 +2153,23 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2158 "awkgram.c" /* yacc.c:1646 */ +#line 2157 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 438 "awkgram.y" /* yacc.c:1646 */ +#line 437 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2164 "awkgram.c" /* yacc.c:1646 */ +#line 2163 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 444 "awkgram.y" /* yacc.c:1646 */ +#line 443 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2170 "awkgram.c" /* yacc.c:1646 */ +#line 2169 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 446 "awkgram.y" /* yacc.c:1646 */ +#line 445 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) (yyval) = (yyvsp[-1]); @@ -2183,40 +2182,40 @@ yyreduce: } yyerrok; } -#line 2187 "awkgram.c" /* yacc.c:1646 */ +#line 2186 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 459 "awkgram.y" /* yacc.c:1646 */ +#line 458 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2193 "awkgram.c" /* yacc.c:1646 */ +#line 2192 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 469 "awkgram.y" /* yacc.c:1646 */ +#line 468 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2199 "awkgram.c" /* yacc.c:1646 */ +#line 2198 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 471 "awkgram.y" /* yacc.c:1646 */ +#line 470 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2205 "awkgram.c" /* yacc.c:1646 */ +#line 2204 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 473 "awkgram.y" /* yacc.c:1646 */ +#line 472 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2216 "awkgram.c" /* yacc.c:1646 */ +#line 2215 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 480 "awkgram.y" /* yacc.c:1646 */ +#line 479 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2306,11 +2305,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2310 "awkgram.c" /* yacc.c:1646 */ +#line 2309 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 570 "awkgram.y" /* yacc.c:1646 */ +#line 569 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2352,11 +2351,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2356 "awkgram.c" /* yacc.c:1646 */ +#line 2355 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 612 "awkgram.y" /* yacc.c:1646 */ +#line 611 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2398,11 +2397,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2402 "awkgram.c" /* yacc.c:1646 */ +#line 2401 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 654 "awkgram.y" /* yacc.c:1646 */ +#line 653 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2515,44 +2514,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2519 "awkgram.c" /* yacc.c:1646 */ +#line 2518 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 767 "awkgram.y" /* yacc.c:1646 */ +#line 766 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2530 "awkgram.c" /* yacc.c:1646 */ +#line 2529 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 774 "awkgram.y" /* yacc.c:1646 */ +#line 773 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2541 "awkgram.c" /* yacc.c:1646 */ +#line 2540 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 781 "awkgram.y" /* yacc.c:1646 */ +#line 780 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2552 "awkgram.c" /* yacc.c:1646 */ +#line 2551 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 791 "awkgram.y" /* yacc.c:1646 */ +#line 790 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2561,11 +2560,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2565 "awkgram.c" /* yacc.c:1646 */ +#line 2564 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 800 "awkgram.y" /* yacc.c:1646 */ +#line 799 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2574,11 +2573,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2578 "awkgram.c" /* yacc.c:1646 */ +#line 2577 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 809 "awkgram.y" /* yacc.c:1646 */ +#line 808 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2587,11 +2586,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2591 "awkgram.c" /* yacc.c:1646 */ +#line 2590 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 818 "awkgram.y" /* yacc.c:1646 */ +#line 817 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2602,11 +2601,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2606 "awkgram.c" /* yacc.c:1646 */ +#line 2605 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 829 "awkgram.y" /* yacc.c:1646 */ +#line 828 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2621,20 +2620,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2625 "awkgram.c" /* yacc.c:1646 */ +#line 2624 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 844 "awkgram.y" /* yacc.c:1646 */ +#line 843 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2634 "awkgram.c" /* yacc.c:1646 */ +#line 2633 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 847 "awkgram.y" /* yacc.c:1646 */ +#line 846 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2655,17 +2654,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2659 "awkgram.c" /* yacc.c:1646 */ +#line 2658 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 879 "awkgram.y" /* yacc.c:1646 */ +#line 878 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2665 "awkgram.c" /* yacc.c:1646 */ +#line 2664 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 880 "awkgram.y" /* yacc.c:1646 */ +#line 879 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2762,17 +2761,17 @@ regular_print: } } } -#line 2766 "awkgram.c" /* yacc.c:1646 */ +#line 2765 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 977 "awkgram.y" /* yacc.c:1646 */ +#line 976 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2772 "awkgram.c" /* yacc.c:1646 */ +#line 2771 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 978 "awkgram.y" /* yacc.c:1646 */ +#line 977 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2805,11 +2804,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2809 "awkgram.c" /* yacc.c:1646 */ +#line 2808 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1015 "awkgram.y" /* yacc.c:1646 */ +#line 1014 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2835,52 +2834,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2839 "awkgram.c" /* yacc.c:1646 */ +#line 2838 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1041 "awkgram.y" /* yacc.c:1646 */ +#line 1040 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2845 "awkgram.c" /* yacc.c:1646 */ +#line 2844 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1046 "awkgram.y" /* yacc.c:1646 */ +#line 1045 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2851 "awkgram.c" /* yacc.c:1646 */ +#line 2850 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1048 "awkgram.y" /* yacc.c:1646 */ +#line 1047 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2857 "awkgram.c" /* yacc.c:1646 */ +#line 2856 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1053 "awkgram.y" /* yacc.c:1646 */ +#line 1052 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2863 "awkgram.c" /* yacc.c:1646 */ +#line 2862 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1055 "awkgram.y" /* yacc.c:1646 */ +#line 1054 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2874 "awkgram.c" /* yacc.c:1646 */ +#line 2873 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1062 "awkgram.y" /* yacc.c:1646 */ +#line 1061 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2880 "awkgram.c" /* yacc.c:1646 */ +#line 2879 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1067 "awkgram.y" /* yacc.c:1646 */ +#line 1066 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2892,11 +2891,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2896 "awkgram.c" /* yacc.c:1646 */ +#line 2895 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1079 "awkgram.y" /* yacc.c:1646 */ +#line 1078 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2907,17 +2906,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2911 "awkgram.c" /* yacc.c:1646 */ +#line 2910 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1093 "awkgram.y" /* yacc.c:1646 */ +#line 1092 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2917 "awkgram.c" /* yacc.c:1646 */ +#line 2916 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1095 "awkgram.y" /* yacc.c:1646 */ +#line 1094 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2925,71 +2924,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2929 "awkgram.c" /* yacc.c:1646 */ +#line 2928 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1103 "awkgram.y" /* yacc.c:1646 */ +#line 1102 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2938 "awkgram.c" /* yacc.c:1646 */ +#line 2937 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1108 "awkgram.y" /* yacc.c:1646 */ +#line 1107 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2944 "awkgram.c" /* yacc.c:1646 */ +#line 2943 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1110 "awkgram.y" /* yacc.c:1646 */ +#line 1109 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 2953 "awkgram.c" /* yacc.c:1646 */ +#line 2952 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1118 "awkgram.y" /* yacc.c:1646 */ +#line 1117 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2959 "awkgram.c" /* yacc.c:1646 */ +#line 2958 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1120 "awkgram.y" /* yacc.c:1646 */ +#line 1119 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2965 "awkgram.c" /* yacc.c:1646 */ +#line 2964 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1130 "awkgram.y" /* yacc.c:1646 */ +#line 1129 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2973 "awkgram.c" /* yacc.c:1646 */ +#line 2972 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1137 "awkgram.y" /* yacc.c:1646 */ +#line 1136 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 2983 "awkgram.c" /* yacc.c:1646 */ +#line 2982 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1142 "awkgram.y" /* yacc.c:1646 */ +#line 1141 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 2989 "awkgram.c" /* yacc.c:1646 */ +#line 2988 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1143 "awkgram.y" /* yacc.c:1646 */ +#line 1142 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -2997,136 +2996,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3001 "awkgram.c" /* yacc.c:1646 */ +#line 3000 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1154 "awkgram.y" /* yacc.c:1646 */ +#line 1153 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3009 "awkgram.c" /* yacc.c:1646 */ +#line 3008 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1159 "awkgram.y" /* yacc.c:1646 */ +#line 1158 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3017 "awkgram.c" /* yacc.c:1646 */ +#line 3016 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1176 "awkgram.y" /* yacc.c:1646 */ +#line 1175 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3023 "awkgram.c" /* yacc.c:1646 */ +#line 3022 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1178 "awkgram.y" /* yacc.c:1646 */ +#line 1177 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3032 "awkgram.c" /* yacc.c:1646 */ +#line 3031 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1186 "awkgram.y" /* yacc.c:1646 */ +#line 1185 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3038 "awkgram.c" /* yacc.c:1646 */ +#line 3037 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1188 "awkgram.y" /* yacc.c:1646 */ +#line 1187 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]) ; } -#line 3044 "awkgram.c" /* yacc.c:1646 */ +#line 3043 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1193 "awkgram.y" /* yacc.c:1646 */ +#line 1192 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3053 "awkgram.c" /* yacc.c:1646 */ +#line 3052 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1198 "awkgram.y" /* yacc.c:1646 */ +#line 1197 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3063 "awkgram.c" /* yacc.c:1646 */ +#line 3062 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1204 "awkgram.y" /* yacc.c:1646 */ +#line 1203 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3069 "awkgram.c" /* yacc.c:1646 */ +#line 3068 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1206 "awkgram.y" /* yacc.c:1646 */ +#line 1205 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3075 "awkgram.c" /* yacc.c:1646 */ +#line 3074 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1208 "awkgram.y" /* yacc.c:1646 */ +#line 1207 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3081 "awkgram.c" /* yacc.c:1646 */ +#line 3080 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1214 "awkgram.y" /* yacc.c:1646 */ +#line 1213 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3087 "awkgram.c" /* yacc.c:1646 */ +#line 3086 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1216 "awkgram.y" /* yacc.c:1646 */ +#line 1215 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3093 "awkgram.c" /* yacc.c:1646 */ +#line 3092 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1221 "awkgram.y" /* yacc.c:1646 */ +#line 1220 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3099 "awkgram.c" /* yacc.c:1646 */ +#line 3098 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1223 "awkgram.y" /* yacc.c:1646 */ +#line 1222 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3105 "awkgram.c" /* yacc.c:1646 */ +#line 3104 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1228 "awkgram.y" /* yacc.c:1646 */ +#line 1227 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3111 "awkgram.c" /* yacc.c:1646 */ +#line 3110 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1230 "awkgram.y" /* yacc.c:1646 */ +#line 1229 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3120 "awkgram.c" /* yacc.c:1646 */ +#line 3119 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1235 "awkgram.y" /* yacc.c:1646 */ +#line 1234 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3126 "awkgram.c" /* yacc.c:1646 */ +#line 3125 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1237 "awkgram.y" /* yacc.c:1646 */ +#line 1236 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3134,52 +3133,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3138 "awkgram.c" /* yacc.c:1646 */ +#line 3137 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1245 "awkgram.y" /* yacc.c:1646 */ +#line 1244 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3147 "awkgram.c" /* yacc.c:1646 */ +#line 3146 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1250 "awkgram.y" /* yacc.c:1646 */ +#line 1249 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3156 "awkgram.c" /* yacc.c:1646 */ +#line 3155 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1259 "awkgram.y" /* yacc.c:1646 */ +#line 1258 "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 3167 "awkgram.c" /* yacc.c:1646 */ +#line 3166 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1266 "awkgram.y" /* yacc.c:1646 */ +#line 1265 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3173 "awkgram.c" /* yacc.c:1646 */ +#line 3172 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1268 "awkgram.y" /* yacc.c:1646 */ +#line 1267 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3179 "awkgram.c" /* yacc.c:1646 */ +#line 3178 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1270 "awkgram.y" /* yacc.c:1646 */ +#line 1269 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3195,11 +3194,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3199 "awkgram.c" /* yacc.c:1646 */ +#line 3198 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1286 "awkgram.y" /* yacc.c:1646 */ +#line 1285 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3209,91 +3208,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3213 "awkgram.c" /* yacc.c:1646 */ +#line 3212 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1296 "awkgram.y" /* yacc.c:1646 */ +#line 1295 "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 3224 "awkgram.c" /* yacc.c:1646 */ +#line 3223 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1303 "awkgram.y" /* yacc.c:1646 */ +#line 1302 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3230 "awkgram.c" /* yacc.c:1646 */ +#line 3229 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1305 "awkgram.y" /* yacc.c:1646 */ +#line 1304 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3236 "awkgram.c" /* yacc.c:1646 */ +#line 3235 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1310 "awkgram.y" /* yacc.c:1646 */ +#line 1309 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3242 "awkgram.c" /* yacc.c:1646 */ +#line 3241 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1312 "awkgram.y" /* yacc.c:1646 */ +#line 1311 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3248 "awkgram.c" /* yacc.c:1646 */ +#line 3247 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1314 "awkgram.y" /* yacc.c:1646 */ +#line 1313 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3257 "awkgram.c" /* yacc.c:1646 */ +#line 3256 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1322 "awkgram.y" /* yacc.c:1646 */ +#line 1321 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3263 "awkgram.c" /* yacc.c:1646 */ +#line 3262 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1324 "awkgram.y" /* yacc.c:1646 */ +#line 1323 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3269 "awkgram.c" /* yacc.c:1646 */ +#line 3268 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1329 "awkgram.y" /* yacc.c:1646 */ +#line 1328 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3275 "awkgram.c" /* yacc.c:1646 */ +#line 3274 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1331 "awkgram.y" /* yacc.c:1646 */ +#line 1330 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3281 "awkgram.c" /* yacc.c:1646 */ +#line 3280 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1336 "awkgram.y" /* yacc.c:1646 */ +#line 1335 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3287 "awkgram.c" /* yacc.c:1646 */ +#line 3286 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1338 "awkgram.y" /* yacc.c:1646 */ +#line 1337 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3293 "awkgram.c" /* yacc.c:1646 */ +#line 3292 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1340 "awkgram.y" /* yacc.c:1646 */ +#line 1339 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3340,47 +3339,47 @@ regular_print: max_args = count; } } -#line 3344 "awkgram.c" /* yacc.c:1646 */ +#line 3343 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1392 "awkgram.y" /* yacc.c:1646 */ +#line 1391 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3350 "awkgram.c" /* yacc.c:1646 */ +#line 3349 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1394 "awkgram.y" /* yacc.c:1646 */ +#line 1393 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3356 "awkgram.c" /* yacc.c:1646 */ +#line 3355 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1396 "awkgram.y" /* yacc.c:1646 */ +#line 1395 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3362 "awkgram.c" /* yacc.c:1646 */ +#line 3361 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1398 "awkgram.y" /* yacc.c:1646 */ +#line 1397 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3368 "awkgram.c" /* yacc.c:1646 */ +#line 3367 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1400 "awkgram.y" /* yacc.c:1646 */ +#line 1399 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3374 "awkgram.c" /* yacc.c:1646 */ +#line 3373 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1402 "awkgram.y" /* yacc.c:1646 */ +#line 1401 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3380 "awkgram.c" /* yacc.c:1646 */ +#line 3379 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1404 "awkgram.y" /* yacc.c:1646 */ +#line 1403 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3394,29 +3393,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3398 "awkgram.c" /* yacc.c:1646 */ +#line 3397 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1418 "awkgram.y" /* yacc.c:1646 */ +#line 1417 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3407 "awkgram.c" /* yacc.c:1646 */ +#line 3406 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1423 "awkgram.y" /* yacc.c:1646 */ +#line 1422 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3416 "awkgram.c" /* yacc.c:1646 */ +#line 3415 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1428 "awkgram.y" /* yacc.c:1646 */ +#line 1427 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3436,64 +3435,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3440 "awkgram.c" /* yacc.c:1646 */ +#line 3439 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1453 "awkgram.y" /* yacc.c:1646 */ +#line 1452 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3449 "awkgram.c" /* yacc.c:1646 */ +#line 3448 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1459 "awkgram.y" /* yacc.c:1646 */ +#line 1458 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3455 "awkgram.c" /* yacc.c:1646 */ +#line 3454 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1461 "awkgram.y" /* yacc.c:1646 */ +#line 1460 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3461 "awkgram.c" /* yacc.c:1646 */ +#line 3460 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1463 "awkgram.y" /* yacc.c:1646 */ +#line 1462 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3467 "awkgram.c" /* yacc.c:1646 */ +#line 3466 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1465 "awkgram.y" /* yacc.c:1646 */ +#line 1464 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3473 "awkgram.c" /* yacc.c:1646 */ +#line 3472 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1467 "awkgram.y" /* yacc.c:1646 */ +#line 1466 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3479 "awkgram.c" /* yacc.c:1646 */ +#line 3478 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1469 "awkgram.y" /* yacc.c:1646 */ +#line 1468 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3485 "awkgram.c" /* yacc.c:1646 */ +#line 3484 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1474 "awkgram.y" /* yacc.c:1646 */ +#line 1473 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3493 "awkgram.c" /* yacc.c:1646 */ +#line 3492 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1478 "awkgram.y" /* yacc.c:1646 */ +#line 1477 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3525,37 +3524,37 @@ regular_print: } } } -#line 3529 "awkgram.c" /* yacc.c:1646 */ +#line 3528 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1510 "awkgram.y" /* yacc.c:1646 */ +#line 1509 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3535 "awkgram.c" /* yacc.c:1646 */ +#line 3534 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1512 "awkgram.y" /* yacc.c:1646 */ +#line 1511 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3545 "awkgram.c" /* yacc.c:1646 */ +#line 3544 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1518 "awkgram.y" /* yacc.c:1646 */ +#line 1517 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3555 "awkgram.c" /* yacc.c:1646 */ +#line 3554 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1524 "awkgram.y" /* yacc.c:1646 */ +#line 1523 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3568,45 +3567,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3572 "awkgram.c" /* yacc.c:1646 */ +#line 3571 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1539 "awkgram.y" /* yacc.c:1646 */ +#line 1538 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3581 "awkgram.c" /* yacc.c:1646 */ +#line 3580 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1544 "awkgram.y" /* yacc.c:1646 */ +#line 1543 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3590 "awkgram.c" /* yacc.c:1646 */ +#line 3589 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1549 "awkgram.y" /* yacc.c:1646 */ +#line 1548 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3598 "awkgram.c" /* yacc.c:1646 */ +#line 3597 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1553 "awkgram.y" /* yacc.c:1646 */ +#line 1552 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3606 "awkgram.c" /* yacc.c:1646 */ +#line 3605 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1557 "awkgram.y" /* yacc.c:1646 */ +#line 1556 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3621,11 +3620,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3625 "awkgram.c" /* yacc.c:1646 */ +#line 3624 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1572 "awkgram.y" /* yacc.c:1646 */ +#line 1571 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3635,20 +3634,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3639 "awkgram.c" /* yacc.c:1646 */ +#line 3638 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1585 "awkgram.y" /* yacc.c:1646 */ +#line 1584 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3648 "awkgram.c" /* yacc.c:1646 */ +#line 3647 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1590 "awkgram.y" /* yacc.c:1646 */ +#line 1589 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3682,11 +3681,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); at_seen = false; } -#line 3686 "awkgram.c" /* yacc.c:1646 */ +#line 3685 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1627 "awkgram.y" /* yacc.c:1646 */ +#line 1626 "awkgram.y" /* yacc.c:1646 */ { NODE *n; @@ -3711,49 +3710,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3715 "awkgram.c" /* yacc.c:1646 */ +#line 3714 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1655 "awkgram.y" /* yacc.c:1646 */ +#line 1654 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3721 "awkgram.c" /* yacc.c:1646 */ +#line 3720 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1657 "awkgram.y" /* yacc.c:1646 */ +#line 1656 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3727 "awkgram.c" /* yacc.c:1646 */ +#line 3726 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1662 "awkgram.y" /* yacc.c:1646 */ +#line 1661 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3733 "awkgram.c" /* yacc.c:1646 */ +#line 3732 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1664 "awkgram.y" /* yacc.c:1646 */ +#line 1663 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3739 "awkgram.c" /* yacc.c:1646 */ +#line 3738 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1669 "awkgram.y" /* yacc.c:1646 */ +#line 1668 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3745 "awkgram.c" /* yacc.c:1646 */ +#line 3744 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1671 "awkgram.y" /* yacc.c:1646 */ +#line 1670 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3753 "awkgram.c" /* yacc.c:1646 */ +#line 3752 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1678 "awkgram.y" /* yacc.c:1646 */ +#line 1677 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3767,11 +3766,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3771 "awkgram.c" /* yacc.c:1646 */ +#line 3770 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1695 "awkgram.y" /* yacc.c:1646 */ +#line 1694 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3785,31 +3784,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3789 "awkgram.c" /* yacc.c:1646 */ +#line 3788 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1712 "awkgram.y" /* yacc.c:1646 */ +#line 1711 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3795 "awkgram.c" /* yacc.c:1646 */ +#line 3794 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1714 "awkgram.y" /* yacc.c:1646 */ +#line 1713 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3803 "awkgram.c" /* yacc.c:1646 */ +#line 3802 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1721 "awkgram.y" /* yacc.c:1646 */ +#line 1720 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3809 "awkgram.c" /* yacc.c:1646 */ +#line 3808 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1726 "awkgram.y" /* yacc.c:1646 */ +#line 1725 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3817,22 +3816,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3821 "awkgram.c" /* yacc.c:1646 */ +#line 3820 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1734 "awkgram.y" /* yacc.c:1646 */ +#line 1733 "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 3832 "awkgram.c" /* yacc.c:1646 */ +#line 3831 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1744 "awkgram.y" /* yacc.c:1646 */ +#line 1743 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3844,73 +3843,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3848 "awkgram.c" /* yacc.c:1646 */ +#line 3847 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1756 "awkgram.y" /* yacc.c:1646 */ +#line 1755 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3858 "awkgram.c" /* yacc.c:1646 */ +#line 3857 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1765 "awkgram.y" /* yacc.c:1646 */ +#line 1764 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3866 "awkgram.c" /* yacc.c:1646 */ +#line 3865 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1769 "awkgram.y" /* yacc.c:1646 */ +#line 1768 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3874 "awkgram.c" /* yacc.c:1646 */ +#line 3873 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1772 "awkgram.y" /* yacc.c:1646 */ +#line 1771 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3880 "awkgram.c" /* yacc.c:1646 */ +#line 3879 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1780 "awkgram.y" /* yacc.c:1646 */ +#line 1779 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3886 "awkgram.c" /* yacc.c:1646 */ +#line 3885 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1784 "awkgram.y" /* yacc.c:1646 */ +#line 1783 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3892 "awkgram.c" /* yacc.c:1646 */ +#line 3891 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1793 "awkgram.y" /* yacc.c:1646 */ +#line 1792 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3898 "awkgram.c" /* yacc.c:1646 */ +#line 3897 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1797 "awkgram.y" /* yacc.c:1646 */ +#line 1796 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3904 "awkgram.c" /* yacc.c:1646 */ +#line 3903 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1801 "awkgram.y" /* yacc.c:1646 */ +#line 1800 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3910 "awkgram.c" /* yacc.c:1646 */ +#line 3909 "awkgram.c" /* yacc.c:1646 */ break; -#line 3914 "awkgram.c" /* yacc.c:1646 */ +#line 3913 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4138,7 +4137,7 @@ yyreturn: #endif return yyresult; } -#line 1803 "awkgram.y" /* yacc.c:1906 */ +#line 1802 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -6816,7 +6815,7 @@ variable(int location, char *name, NODETYPE type) /* make_regnode --- make a regular expression node */ -static NODE * +NODE * make_regnode(int type, NODE *exp) { NODE *n; diff --git a/awkgram.y b/awkgram.y index 2be4d37c..0b3a97c9 100644 --- a/awkgram.y +++ b/awkgram.y @@ -73,7 +73,6 @@ static INSTRUCTION *mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op) static INSTRUCTION *mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTION *op); static INSTRUCTION *mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op); static INSTRUCTION *mk_getline(INSTRUCTION *op, INSTRUCTION *opt_var, INSTRUCTION *redir, int redirtype); -static NODE *make_regnode(int type, NODE *exp); static int count_expressions(INSTRUCTION **list, bool isarg); static INSTRUCTION *optimize_assignment(INSTRUCTION *exp); static void add_lint(INSTRUCTION *list, LINTTYPE linttype); @@ -4477,7 +4476,7 @@ variable(int location, char *name, NODETYPE type) /* make_regnode --- make a regular expression node */ -static NODE * +NODE * make_regnode(int type, NODE *exp) { NODE *n; diff --git a/builtin.c b/builtin.c index 4dd08eb1..7926a320 100644 --- a/builtin.c +++ b/builtin.c @@ -3000,7 +3000,7 @@ NODE * call_sub_func(const char *name, int nargs) { unsigned int flags = 0; - NODE *tmp; + NODE *regex, *replace; if (name[0] == 'g') { if (name[1] == 'e') @@ -3009,10 +3009,15 @@ call_sub_func(const char *name, int nargs) flags = GSUB; } - tmp = PEEK(1); - if (tmp->type == Node_val) { - flags |= LITERAL; - } + if ((flags == 0 || flags == GSUB) && nargs != 2) + fatal(_("%s: can be called indirectly only with two arguments"), name); + + replace = POP(); + + regex = POP(); /* the regex */ + regex = make_regnode(Node_regex, regex); + PUSH(regex); + PUSH(replace); return do_sub(nargs, flags); } diff --git a/indirectbuitin.awk b/indirectbuitin.awk index 26cb5cc4..8c78593c 100644 --- a/indirectbuitin.awk +++ b/indirectbuitin.awk @@ -8,12 +8,13 @@ function print_result(category, fname, builtin_result, indirect_result) } BEGIN { - fun = "sub" - x = "ff11bb" - b1 = sub("f", "q", x) - i1 = @fun("f", "q", x) + $0 = "ff11bb" + b1 = sub("f", "q") + $0 = "ff11bb" + i1 = @fun("f", "q") print_result("string", fun, b1, i1) + exit } diff --git a/interpret.h b/interpret.h index 9160d479..f9aa3115 100644 --- a/interpret.h +++ b/interpret.h @@ -1066,7 +1066,7 @@ match_re: assert(the_func != NULL); /* call it */ - if (the_func == do_sub) + if (the_func == (builtin_func_t) do_sub) r = call_sub_func(t1->stptr, arg_count); else r = the_func(arg_count); diff --git a/node.c b/node.c index 9fd4c7b9..179d272e 100644 --- a/node.c +++ b/node.c @@ -431,6 +431,13 @@ r_unref(NODE *tmp) #ifdef GAWKDEBUG if (tmp == NULL) return; + if (tmp->type == Node_regex) { + if (tmp->re_reg != NULL) + refree(tmp->re_reg); + if (tmp->re_text != NULL) + unref(tmp->re_text); + goto free_the_node; + } if ((tmp->flags & MALLOC) != 0) { if (tmp->valref > 1) { tmp->valref--; @@ -447,6 +454,7 @@ r_unref(NODE *tmp) mpfr_unset(tmp); free_wstr(tmp); +free_the_node: freenode(tmp); } -- cgit v1.2.3 From 6522e5b623e083565229dc742336219a0dda1344 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Mar 2015 22:58:20 +0200 Subject: General cleanups prepatory to merging. --- ChangeLog | 5 + awk.h | 4 +- doc/ChangeLog | 3 + doc/gawk.1 | 6 +- doc/gawk.info | 1024 ++++++++++++++++++++++++++++--------------------------- doc/gawk.texi | 99 +++--- doc/gawktexi.in | 99 +++--- gawkapi.c | 53 +-- io.c | 13 +- 9 files changed, 680 insertions(+), 626 deletions(-) diff --git a/ChangeLog b/ChangeLog index d52c86f0..468875fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-03-24 Arnold D. Robbins + + * awk.h, gawkapi.c, io.c: Minor code reformatting. + 2015-03-18 Arnold D. Robbins * config.guess, config.sub: Updated, from libtool 2.4.6. @@ -1672,6 +1676,7 @@ * eval.c (update_ERRNO_int, unset_ERRNO): Update PROCINFO["errno"]. 2013-06-30 Andrew J. Schorr + * awk.h (redirect_string): Declare new function that provides API access to the redirection mechanism. * gawkapi.h (GAWK_API_MINOR_VERSION): Bump from 0 to 1 since 2 new diff --git a/awk.h b/awk.h index 101e5866..6b9ac10b 100644 --- a/awk.h +++ b/awk.h @@ -1483,7 +1483,9 @@ extern void set_FNR(void); extern void set_NR(void); extern struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg, bool failure_fatal); -extern struct redirect *redirect_string(const char *redir_exp_str, size_t redir_exp_len, bool not_string_flag, int redirtype, int *errflg, int extfd, bool failure_fatal); +extern struct redirect *redirect_string(const char *redir_exp_str, + size_t redir_exp_len, bool not_string_flag, int redirtype, + int *errflg, int extfd, bool failure_fatal); extern NODE *do_close(int nargs); extern int flush_io(void); extern int close_io(bool *stdio_problem); diff --git a/doc/ChangeLog b/doc/ChangeLog index f0c7523b..679e1bea 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,6 +2,9 @@ * gawktexi.in: Minor fixes from Antonio Colombo and new exercise in chapter 16. + * gawk.1: Minor edits. + * gawktexi.in: Edits in material on errno and retryable and get_file + API. 2015-03-17 Andrew J. Schorr diff --git a/doc/gawk.1 b/doc/gawk.1 index b425c24c..45a4c9f2 100644 --- a/doc/gawk.1 +++ b/doc/gawk.1 @@ -13,7 +13,7 @@ . if \w'\(rq' .ds rq "\(rq . \} .\} -.TH GAWK 1 "Aug 03 2014" "Free Software Foundation" "Utility Commands" +.TH GAWK 1 "Mar 24 2015" "Free Software Foundation" "Utility Commands" .SH NAME gawk \- pattern scanning and processing language .SH SYNOPSIS @@ -1241,8 +1241,8 @@ less than zero means no timeout. If an I/O error that may be retried occurs when reading data from .IR input , and this array entry exists, then -.BR getline -will return -2 instead of following the default behavior of returning -1 +.B getline +will return \-2 instead of following the default behavior of returning \-1 and configuring .IR input to return no further data. diff --git a/doc/gawk.info b/doc/gawk.info index f0318e20..6b107344 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -5451,11 +5451,11 @@ how `awk' works. encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then `getline' returns -1. In this case, `gawk' sets the variable `ERRNO' to a string -describing the error that occurred. If the `errno' variable indicates -that the I/O operation may be retried, and `PROCINFO["input", "RETRY"]' -is set, then -2 will be returned instead of -1, and further calls to -`getline' may be attemped. *Note Retrying Input::, for further -information about this feature. +describing the error that occurred. If `ERRNO' indicates that the I/O +operation may be retried, and `PROCINFO["input", "RETRY"]' is set, then +-2 will be returned instead of -1, and further calls to `getline' may +be attemped. *Note Retrying Input::, for further information about +this feature. In the following examples, COMMAND stands for a string value that represents a shell command. @@ -5995,22 +5995,22 @@ File: gawk.info, Node: Retrying Input, Next: Command-line directories, Prev: This minor node describes a feature that is specific to `gawk'. - When `gawk' encounters an error while reading input, it will by -default return -1 from getline, and subsequent attempts to read from -that file will result in an end-of-file indication. However, you may -optionally instruct `gawk' to allow I/O to be retried when certain -errors are encountered by setting setting a special element in the -`PROCINFO' array (*note Auto-set::): + When `gawk' encounters an error while reading input, by default +`getline' returns -1, and subsequent attempts to read from that file +result in an end-of-file indication. However, you may optionally +instruct `gawk' to allow I/O to be retried when certain errors are +encountered by setting setting a special element in the `PROCINFO' +array (*note Auto-set::): - PROCINFO["input_name", "RETRY"] + PROCINFO["INPUT_NAME", "RETRY"] = 1 - When set, this causes `gawk' to check the value of the system + When this element exists, `gawk' checks the value of the system `errno' variable when an I/O error occurs. If `errno' indicates a -subsequent I/O attempt may succeed, `getline' will instead return -2 and +subsequent I/O attempt may succeed, `getline' instead returns -2 and further calls to `getline' may succeed. This applies to `errno' values -EAGAIN, EWOULDBLOCK, EINTR, or ETIMEDOUT. +`EAGAIN', `EWOULDBLOCK', `EINTR', or `ETIMEDOUT'. - This feature is useful in conjunction with `PROCINFO["input_name", + This feature is useful in conjunction with `PROCINFO["INPUT_NAME", "READ_TIMEOUT"]' or situations where a file descriptor has been configured to behave in a non-blocking fashion. @@ -24796,49 +24796,55 @@ redirections. ` const awk_input_buf_t **ibufp,' ` const awk_output_buf_t **obufp);' Look up a file in `gawk''s internal redirection table. If `name' - is NULL or `name_len' is 0, it returns data for the currently open - input file corresponding to `FILENAME' (and it will not access the - `filetype' argument, so that may be undefined). If the file is - not already open, it tries to open it. The `filetype' argument - must be NUL-terminated and should be one of: - `>' + is `NULL' or `name_len' is zero, return data for the currently + open input file corresponding to `FILENAME'. (This does not + access the `filetype' argument, so that may be undefined). If the + file is not already open, attempt to open it. The `filetype' + argument must be zero-terminated and should be one of: + + `">"' A file opened for output. - `>>' + `">>"' A file opened for append. - `<' + `"<"' A file opened for input. - `|>' + `"|>"' A pipe opened for output. - `|<' + `"|<"' A pipe opened for input. - `|&' + `"|&"' A two-way coprocess. - On error, a `false' value is returned. Otherwise, the return - status is `true', and additional information about the redirection - is returned in the `ibufp' and `obufp' pointers. For input - redirections, the `*ibufp' value should be non-NULL, and `*obufp' - should be NULL. For output redirections, the `*obufp' value - should be non-NULL, and `*ibufp' should be NULL. For two-way - coprocesses, both values should be non-NULL. In the usual case, - the extension is interested in `(*ibufp)->fd' and/or - `fileno((*obufp)->fp)'. If the file is not already open, and the - fd argument is non-negative, `gawk' will use that file descriptor - instead of opening the file in the usual way. If the fd is - non-negative, but the file exists already, `gawk' ignores the fd + + On error, return a `false' value. Otherwise, return `true', and + return additional information about the redirection in the `ibufp' + and `obufp' pointers. For input redirections, the `*ibufp' value + should be non-`NULL', and `*obufp' should be `NULL'. For output + redirections, the `*obufp' value should be non-`NULL', and `*ibufp' + should be `NULL'. For two-way coprocesses, both values should be + non-`NULL'. + + In the usual case, the extension is interested in `(*ibufp)->fd' + and/or `fileno((*obufp)->fp)'. If the file is not already open, + and the `fd' argument is non-negative, `gawk' will use that file + descriptor instead of opening the file in the usual way. If `fd' + is non-negative, but the file exists already, `gawk' ignores `fd' and returns the existing file. It is the caller's responsibility - to notice that neither the fd in the returned `awk_input_buf_t' - nor the fd in the returned `awk_output_buf_t' matches the - requested value. Note that supplying a file descriptor is - currently NOT supported for pipes. It should work for input, - output, append, and two-way (coprocess) sockets. If `filetype' is - two-way, we assume that it is a socket! Note that in the two-way - case, the input and output file descriptors may differ. To check - for success, one must check whether either matches. + to notice that neither the `fd' in the returned `awk_input_buf_t' + nor the `fd' in the returned `awk_output_buf_t' matches the + requested value. + + Note that supplying a file descriptor is currently _not_ supported + for pipes. However, supplying a file descriptor should work for + input, output, append, and two-way (coprocess) sockets. If + `filetype' is two-way, `gawk' assumes that it is a socket! Note + that in the two-way case, the input and output file descriptors + may differ. To check for success, you must check whether either + matches. It is anticipated that this API function will be used to implement I/O multiplexing and a socket library. @@ -34975,467 +34981,467 @@ Ref: Splitting By Content-Footnote-1236687 Node: Multiple Line236850 Ref: Multiple Line-Footnote-1242731 Node: Getline242910 -Node: Plain Getline245389 -Node: Getline/Variable248029 -Node: Getline/File249178 -Node: Getline/Variable/File250563 -Ref: Getline/Variable/File-Footnote-1252166 -Node: Getline/Pipe252253 -Node: Getline/Variable/Pipe254931 -Node: Getline/Coprocess256062 -Node: Getline/Variable/Coprocess257326 -Node: Getline Notes258065 -Node: Getline Summary260859 -Ref: table-getline-variants261271 -Node: Read Timeout262100 -Ref: Read Timeout-Footnote-1266003 -Node: Retrying Input266061 -Node: Command-line directories267256 -Node: Input Summary268163 -Node: Input Exercises271548 -Node: Printing272276 -Node: Print274111 -Node: Print Examples275568 -Node: Output Separators278347 -Node: OFMT280365 -Node: Printf281720 -Node: Basic Printf282505 -Node: Control Letters284077 -Node: Format Modifiers288062 -Node: Printf Examples294068 -Node: Redirection296554 -Node: Special FD303392 -Ref: Special FD-Footnote-1306558 -Node: Special Files306632 -Node: Other Inherited Files307249 -Node: Special Network308249 -Node: Special Caveats309111 -Node: Close Files And Pipes310060 -Ref: Close Files And Pipes-Footnote-1317245 -Ref: Close Files And Pipes-Footnote-2317393 -Node: Nonfatal317543 -Node: Output Summary319868 -Node: Output Exercises321089 -Node: Expressions321769 -Node: Values322958 -Node: Constants323635 -Node: Scalar Constants324326 -Ref: Scalar Constants-Footnote-1325188 -Node: Nondecimal-numbers325438 -Node: Regexp Constants328448 -Node: Using Constant Regexps328974 -Node: Variables332137 -Node: Using Variables332794 -Node: Assignment Options334705 -Node: Conversion336580 -Node: Strings And Numbers337104 -Ref: Strings And Numbers-Footnote-1340169 -Node: Locale influences conversions340278 -Ref: table-locale-affects343024 -Node: All Operators343616 -Node: Arithmetic Ops344245 -Node: Concatenation346750 -Ref: Concatenation-Footnote-1349569 -Node: Assignment Ops349676 -Ref: table-assign-ops354655 -Node: Increment Ops355965 -Node: Truth Values and Conditions359396 -Node: Truth Values360479 -Node: Typing and Comparison361528 -Node: Variable Typing362344 -Node: Comparison Operators366011 -Ref: table-relational-ops366421 -Node: POSIX String Comparison369916 -Ref: POSIX String Comparison-Footnote-1370988 -Node: Boolean Ops371127 -Ref: Boolean Ops-Footnote-1375605 -Node: Conditional Exp375696 -Node: Function Calls377434 -Node: Precedence381314 -Node: Locales384974 -Node: Expressions Summary386606 -Node: Patterns and Actions389177 -Node: Pattern Overview390297 -Node: Regexp Patterns391976 -Node: Expression Patterns392519 -Node: Ranges396299 -Node: BEGIN/END399406 -Node: Using BEGIN/END400167 -Ref: Using BEGIN/END-Footnote-1402903 -Node: I/O And BEGIN/END403009 -Node: BEGINFILE/ENDFILE405324 -Node: Empty408221 -Node: Using Shell Variables408538 -Node: Action Overview410811 -Node: Statements413137 -Node: If Statement414985 -Node: While Statement416480 -Node: Do Statement418508 -Node: For Statement419656 -Node: Switch Statement422814 -Node: Break Statement425196 -Node: Continue Statement427289 -Node: Next Statement429116 -Node: Nextfile Statement431497 -Node: Exit Statement434125 -Node: Built-in Variables436536 -Node: User-modified437669 -Ref: User-modified-Footnote-1445303 -Node: Auto-set445365 -Ref: Auto-set-Footnote-1459598 -Ref: Auto-set-Footnote-2459803 -Node: ARGC and ARGV459859 -Node: Pattern Action Summary464077 -Node: Arrays466510 -Node: Array Basics467839 -Node: Array Intro468683 -Ref: figure-array-elements470620 -Ref: Array Intro-Footnote-1473243 -Node: Reference to Elements473371 -Node: Assigning Elements475833 -Node: Array Example476324 -Node: Scanning an Array478083 -Node: Controlling Scanning481106 -Ref: Controlling Scanning-Footnote-1486500 -Node: Numeric Array Subscripts486816 -Node: Uninitialized Subscripts489001 -Node: Delete490618 -Ref: Delete-Footnote-1493367 -Node: Multidimensional493424 -Node: Multiscanning496521 -Node: Arrays of Arrays498110 -Node: Arrays Summary502864 -Node: Functions504955 -Node: Built-in505994 -Node: Calling Built-in507072 -Node: Numeric Functions509067 -Ref: Numeric Functions-Footnote-1513885 -Ref: Numeric Functions-Footnote-2514242 -Ref: Numeric Functions-Footnote-3514290 -Node: String Functions514562 -Ref: String Functions-Footnote-1538063 -Ref: String Functions-Footnote-2538192 -Ref: String Functions-Footnote-3538440 -Node: Gory Details538527 -Ref: table-sub-escapes540308 -Ref: table-sub-proposed541823 -Ref: table-posix-sub543185 -Ref: table-gensub-escapes544722 -Ref: Gory Details-Footnote-1545555 -Node: I/O Functions545706 -Ref: I/O Functions-Footnote-1552942 -Node: Time Functions553089 -Ref: Time Functions-Footnote-1563598 -Ref: Time Functions-Footnote-2563666 -Ref: Time Functions-Footnote-3563824 -Ref: Time Functions-Footnote-4563935 -Ref: Time Functions-Footnote-5564047 -Ref: Time Functions-Footnote-6564274 -Node: Bitwise Functions564540 -Ref: table-bitwise-ops565102 -Ref: Bitwise Functions-Footnote-1569430 -Node: Type Functions569602 -Node: I18N Functions570754 -Node: User-defined572401 -Node: Definition Syntax573206 -Ref: Definition Syntax-Footnote-1578865 -Node: Function Example578936 -Ref: Function Example-Footnote-1581857 -Node: Function Caveats581879 -Node: Calling A Function582397 -Node: Variable Scope583355 -Node: Pass By Value/Reference586348 -Node: Return Statement589845 -Node: Dynamic Typing592824 -Node: Indirect Calls593753 -Ref: Indirect Calls-Footnote-1603618 -Node: Functions Summary603746 -Node: Library Functions606448 -Ref: Library Functions-Footnote-1610056 -Ref: Library Functions-Footnote-2610199 -Node: Library Names610370 -Ref: Library Names-Footnote-1613828 -Ref: Library Names-Footnote-2614051 -Node: General Functions614137 -Node: Strtonum Function615240 -Node: Assert Function618262 -Node: Round Function621586 -Node: Cliff Random Function623127 -Node: Ordinal Functions624143 -Ref: Ordinal Functions-Footnote-1627206 -Ref: Ordinal Functions-Footnote-2627458 -Node: Join Function627669 -Ref: Join Function-Footnote-1629439 -Node: Getlocaltime Function629639 -Node: Readfile Function633383 -Node: Shell Quoting635355 -Node: Data File Management636756 -Node: Filetrans Function637388 -Node: Rewind Function641484 -Node: File Checking642870 -Ref: File Checking-Footnote-1644203 -Node: Empty Files644404 -Node: Ignoring Assigns646383 -Node: Getopt Function647933 -Ref: Getopt Function-Footnote-1659397 -Node: Passwd Functions659597 -Ref: Passwd Functions-Footnote-1668437 -Node: Group Functions668525 -Ref: Group Functions-Footnote-1676422 -Node: Walking Arrays676627 -Node: Library Functions Summary679633 -Node: Library Exercises681035 -Node: Sample Programs682315 -Node: Running Examples683085 -Node: Clones683813 -Node: Cut Program685037 -Node: Egrep Program694757 -Ref: Egrep Program-Footnote-1702260 -Node: Id Program702370 -Node: Split Program706046 -Ref: Split Program-Footnote-1709500 -Node: Tee Program709628 -Node: Uniq Program712417 -Node: Wc Program719836 -Ref: Wc Program-Footnote-1724086 -Node: Miscellaneous Programs724180 -Node: Dupword Program725393 -Node: Alarm Program727424 -Node: Translate Program732229 -Ref: Translate Program-Footnote-1736792 -Node: Labels Program737062 -Ref: Labels Program-Footnote-1740413 -Node: Word Sorting740497 -Node: History Sorting744567 -Node: Extract Program746402 -Node: Simple Sed753926 -Node: Igawk Program756996 -Ref: Igawk Program-Footnote-1771322 -Ref: Igawk Program-Footnote-2771523 -Ref: Igawk Program-Footnote-3771645 -Node: Anagram Program771760 -Node: Signature Program774821 -Node: Programs Summary776068 -Node: Programs Exercises777289 -Ref: Programs Exercises-Footnote-1781420 -Node: Advanced Features781511 -Node: Nondecimal Data783493 -Node: Array Sorting785083 -Node: Controlling Array Traversal785783 -Ref: Controlling Array Traversal-Footnote-1794149 -Node: Array Sorting Functions794267 -Ref: Array Sorting Functions-Footnote-1798153 -Node: Two-way I/O798349 -Ref: Two-way I/O-Footnote-1803294 -Ref: Two-way I/O-Footnote-2803480 -Node: TCP/IP Networking803562 -Node: Profiling806434 -Node: Advanced Features Summary814705 -Node: Internationalization816638 -Node: I18N and L10N818118 -Node: Explaining gettext818804 -Ref: Explaining gettext-Footnote-1823829 -Ref: Explaining gettext-Footnote-2824013 -Node: Programmer i18n824178 -Ref: Programmer i18n-Footnote-1829054 -Node: Translator i18n829103 -Node: String Extraction829897 -Ref: String Extraction-Footnote-1831028 -Node: Printf Ordering831114 -Ref: Printf Ordering-Footnote-1833900 -Node: I18N Portability833964 -Ref: I18N Portability-Footnote-1836420 -Node: I18N Example836483 -Ref: I18N Example-Footnote-1839286 -Node: Gawk I18N839358 -Node: I18N Summary840002 -Node: Debugger841342 -Node: Debugging842364 -Node: Debugging Concepts842805 -Node: Debugging Terms844615 -Node: Awk Debugging847187 -Node: Sample Debugging Session848093 -Node: Debugger Invocation848627 -Node: Finding The Bug850012 -Node: List of Debugger Commands856491 -Node: Breakpoint Control857823 -Node: Debugger Execution Control861500 -Node: Viewing And Changing Data864859 -Node: Execution Stack868235 -Node: Debugger Info869870 -Node: Miscellaneous Debugger Commands873915 -Node: Readline Support878916 -Node: Limitations879810 -Node: Debugging Summary881925 -Node: Arbitrary Precision Arithmetic883099 -Node: Computer Arithmetic884515 -Ref: table-numeric-ranges888092 -Ref: Computer Arithmetic-Footnote-1888616 -Node: Math Definitions888673 -Ref: table-ieee-formats891968 -Ref: Math Definitions-Footnote-1892572 -Node: MPFR features892677 -Node: FP Math Caution894348 -Ref: FP Math Caution-Footnote-1895398 -Node: Inexactness of computations895767 -Node: Inexact representation896726 -Node: Comparing FP Values898084 -Node: Errors accumulate899166 -Node: Getting Accuracy900598 -Node: Try To Round903302 -Node: Setting precision904201 -Ref: table-predefined-precision-strings904885 -Node: Setting the rounding mode906714 -Ref: table-gawk-rounding-modes907078 -Ref: Setting the rounding mode-Footnote-1910530 -Node: Arbitrary Precision Integers910709 -Ref: Arbitrary Precision Integers-Footnote-1915607 -Node: POSIX Floating Point Problems915756 -Ref: POSIX Floating Point Problems-Footnote-1919635 -Node: Floating point summary919673 -Node: Dynamic Extensions921860 -Node: Extension Intro923412 -Node: Plugin License924677 -Node: Extension Mechanism Outline925474 -Ref: figure-load-extension925902 -Ref: figure-register-new-function927382 -Ref: figure-call-new-function928386 -Node: Extension API Description930373 -Node: Extension API Functions Introduction931907 -Node: General Data Types936776 -Ref: General Data Types-Footnote-1942676 -Node: Memory Allocation Functions942975 -Ref: Memory Allocation Functions-Footnote-1945814 -Node: Constructor Functions945913 -Node: Registration Functions947652 -Node: Extension Functions948337 -Node: Exit Callback Functions950634 -Node: Extension Version String951882 -Node: Input Parsers952545 -Node: Output Wrappers962420 -Node: Two-way processors966933 -Node: Printing Messages969196 -Ref: Printing Messages-Footnote-1970272 -Node: Updating `ERRNO'970424 -Node: Requesting Values971164 -Ref: table-value-types-returned971891 -Node: Accessing Parameters972848 -Node: Symbol Table Access974082 -Node: Symbol table by name974596 -Node: Symbol table by cookie976616 -Ref: Symbol table by cookie-Footnote-1980761 -Node: Cached values980824 -Ref: Cached values-Footnote-1984320 -Node: Array Manipulation984411 -Ref: Array Manipulation-Footnote-1985501 -Node: Array Data Types985538 -Ref: Array Data Types-Footnote-1988193 -Node: Array Functions988285 -Node: Flattening Arrays992144 -Node: Creating Arrays999046 -Node: Redirection API1003817 -Node: Extension API Variables1006588 -Node: Extension Versioning1007221 -Node: Extension API Informational Variables1009112 -Node: Extension API Boilerplate1010177 -Node: Finding Extensions1013986 -Node: Extension Example1014546 -Node: Internal File Description1015318 -Node: Internal File Ops1019385 -Ref: Internal File Ops-Footnote-11031136 -Node: Using Internal File Ops1031276 -Ref: Using Internal File Ops-Footnote-11033659 -Node: Extension Samples1033932 -Node: Extension Sample File Functions1035460 -Node: Extension Sample Fnmatch1043141 -Node: Extension Sample Fork1044629 -Node: Extension Sample Inplace1045844 -Node: Extension Sample Ord1047930 -Node: Extension Sample Readdir1048766 -Ref: table-readdir-file-types1049643 -Node: Extension Sample Revout1050454 -Node: Extension Sample Rev2way1051043 -Node: Extension Sample Read write array1051783 -Node: Extension Sample Readfile1053723 -Node: Extension Sample Time1054818 -Node: Extension Sample API Tests1056166 -Node: gawkextlib1056657 -Node: Extension summary1059335 -Node: Extension Exercises1063024 -Node: Language History1064520 -Node: V7/SVR3.11066176 -Node: SVR41068329 -Node: POSIX1069763 -Node: BTL1071144 -Node: POSIX/GNU1071875 -Node: Feature History1077711 -Node: Common Extensions1091505 -Node: Ranges and Locales1092877 -Ref: Ranges and Locales-Footnote-11097496 -Ref: Ranges and Locales-Footnote-21097523 -Ref: Ranges and Locales-Footnote-31097758 -Node: Contributors1097979 -Node: History summary1103519 -Node: Installation1104898 -Node: Gawk Distribution1105844 -Node: Getting1106328 -Node: Extracting1107151 -Node: Distribution contents1108788 -Node: Unix Installation1114890 -Node: Quick Installation1115573 -Node: Shell Startup Files1117984 -Node: Additional Configuration Options1119063 -Node: Configuration Philosophy1120867 -Node: Non-Unix Installation1123236 -Node: PC Installation1123694 -Node: PC Binary Installation1125014 -Node: PC Compiling1126862 -Ref: PC Compiling-Footnote-11129883 -Node: PC Testing1129992 -Node: PC Using1131168 -Node: Cygwin1135283 -Node: MSYS1136053 -Node: VMS Installation1136554 -Node: VMS Compilation1137346 -Ref: VMS Compilation-Footnote-11138575 -Node: VMS Dynamic Extensions1138633 -Node: VMS Installation Details1140317 -Node: VMS Running1142568 -Node: VMS GNV1145408 -Node: VMS Old Gawk1146143 -Node: Bugs1146613 -Node: Other Versions1150502 -Node: Installation summary1156936 -Node: Notes1157995 -Node: Compatibility Mode1158860 -Node: Additions1159642 -Node: Accessing The Source1160567 -Node: Adding Code1162002 -Node: New Ports1168159 -Node: Derived Files1172641 -Ref: Derived Files-Footnote-11178116 -Ref: Derived Files-Footnote-21178150 -Ref: Derived Files-Footnote-31178746 -Node: Future Extensions1178860 -Node: Implementation Limitations1179466 -Node: Extension Design1180714 -Node: Old Extension Problems1181868 -Ref: Old Extension Problems-Footnote-11183385 -Node: Extension New Mechanism Goals1183442 -Ref: Extension New Mechanism Goals-Footnote-11186802 -Node: Extension Other Design Decisions1186991 -Node: Extension Future Growth1189099 -Node: Old Extension Mechanism1189935 -Node: Notes summary1191697 -Node: Basic Concepts1192883 -Node: Basic High Level1193564 -Ref: figure-general-flow1193836 -Ref: figure-process-flow1194435 -Ref: Basic High Level-Footnote-11197664 -Node: Basic Data Typing1197849 -Node: Glossary1201177 -Node: Copying1233106 -Node: GNU Free Documentation License1270662 -Node: Index1295798 +Node: Plain Getline245376 +Node: Getline/Variable248016 +Node: Getline/File249165 +Node: Getline/Variable/File250550 +Ref: Getline/Variable/File-Footnote-1252153 +Node: Getline/Pipe252240 +Node: Getline/Variable/Pipe254918 +Node: Getline/Coprocess256049 +Node: Getline/Variable/Coprocess257313 +Node: Getline Notes258052 +Node: Getline Summary260846 +Ref: table-getline-variants261258 +Node: Read Timeout262087 +Ref: Read Timeout-Footnote-1265990 +Node: Retrying Input266048 +Node: Command-line directories267238 +Node: Input Summary268145 +Node: Input Exercises271530 +Node: Printing272258 +Node: Print274093 +Node: Print Examples275550 +Node: Output Separators278329 +Node: OFMT280347 +Node: Printf281702 +Node: Basic Printf282487 +Node: Control Letters284059 +Node: Format Modifiers288044 +Node: Printf Examples294050 +Node: Redirection296536 +Node: Special FD303374 +Ref: Special FD-Footnote-1306540 +Node: Special Files306614 +Node: Other Inherited Files307231 +Node: Special Network308231 +Node: Special Caveats309093 +Node: Close Files And Pipes310042 +Ref: Close Files And Pipes-Footnote-1317227 +Ref: Close Files And Pipes-Footnote-2317375 +Node: Nonfatal317525 +Node: Output Summary319850 +Node: Output Exercises321071 +Node: Expressions321751 +Node: Values322940 +Node: Constants323617 +Node: Scalar Constants324308 +Ref: Scalar Constants-Footnote-1325170 +Node: Nondecimal-numbers325420 +Node: Regexp Constants328430 +Node: Using Constant Regexps328956 +Node: Variables332119 +Node: Using Variables332776 +Node: Assignment Options334687 +Node: Conversion336562 +Node: Strings And Numbers337086 +Ref: Strings And Numbers-Footnote-1340151 +Node: Locale influences conversions340260 +Ref: table-locale-affects343006 +Node: All Operators343598 +Node: Arithmetic Ops344227 +Node: Concatenation346732 +Ref: Concatenation-Footnote-1349551 +Node: Assignment Ops349658 +Ref: table-assign-ops354637 +Node: Increment Ops355947 +Node: Truth Values and Conditions359378 +Node: Truth Values360461 +Node: Typing and Comparison361510 +Node: Variable Typing362326 +Node: Comparison Operators365993 +Ref: table-relational-ops366403 +Node: POSIX String Comparison369898 +Ref: POSIX String Comparison-Footnote-1370970 +Node: Boolean Ops371109 +Ref: Boolean Ops-Footnote-1375587 +Node: Conditional Exp375678 +Node: Function Calls377416 +Node: Precedence381296 +Node: Locales384956 +Node: Expressions Summary386588 +Node: Patterns and Actions389159 +Node: Pattern Overview390279 +Node: Regexp Patterns391958 +Node: Expression Patterns392501 +Node: Ranges396281 +Node: BEGIN/END399388 +Node: Using BEGIN/END400149 +Ref: Using BEGIN/END-Footnote-1402885 +Node: I/O And BEGIN/END402991 +Node: BEGINFILE/ENDFILE405306 +Node: Empty408203 +Node: Using Shell Variables408520 +Node: Action Overview410793 +Node: Statements413119 +Node: If Statement414967 +Node: While Statement416462 +Node: Do Statement418490 +Node: For Statement419638 +Node: Switch Statement422796 +Node: Break Statement425178 +Node: Continue Statement427271 +Node: Next Statement429098 +Node: Nextfile Statement431479 +Node: Exit Statement434107 +Node: Built-in Variables436518 +Node: User-modified437651 +Ref: User-modified-Footnote-1445285 +Node: Auto-set445347 +Ref: Auto-set-Footnote-1459580 +Ref: Auto-set-Footnote-2459785 +Node: ARGC and ARGV459841 +Node: Pattern Action Summary464059 +Node: Arrays466492 +Node: Array Basics467821 +Node: Array Intro468665 +Ref: figure-array-elements470602 +Ref: Array Intro-Footnote-1473225 +Node: Reference to Elements473353 +Node: Assigning Elements475815 +Node: Array Example476306 +Node: Scanning an Array478065 +Node: Controlling Scanning481088 +Ref: Controlling Scanning-Footnote-1486482 +Node: Numeric Array Subscripts486798 +Node: Uninitialized Subscripts488983 +Node: Delete490600 +Ref: Delete-Footnote-1493349 +Node: Multidimensional493406 +Node: Multiscanning496503 +Node: Arrays of Arrays498092 +Node: Arrays Summary502846 +Node: Functions504937 +Node: Built-in505976 +Node: Calling Built-in507054 +Node: Numeric Functions509049 +Ref: Numeric Functions-Footnote-1513867 +Ref: Numeric Functions-Footnote-2514224 +Ref: Numeric Functions-Footnote-3514272 +Node: String Functions514544 +Ref: String Functions-Footnote-1538045 +Ref: String Functions-Footnote-2538174 +Ref: String Functions-Footnote-3538422 +Node: Gory Details538509 +Ref: table-sub-escapes540290 +Ref: table-sub-proposed541805 +Ref: table-posix-sub543167 +Ref: table-gensub-escapes544704 +Ref: Gory Details-Footnote-1545537 +Node: I/O Functions545688 +Ref: I/O Functions-Footnote-1552924 +Node: Time Functions553071 +Ref: Time Functions-Footnote-1563580 +Ref: Time Functions-Footnote-2563648 +Ref: Time Functions-Footnote-3563806 +Ref: Time Functions-Footnote-4563917 +Ref: Time Functions-Footnote-5564029 +Ref: Time Functions-Footnote-6564256 +Node: Bitwise Functions564522 +Ref: table-bitwise-ops565084 +Ref: Bitwise Functions-Footnote-1569412 +Node: Type Functions569584 +Node: I18N Functions570736 +Node: User-defined572383 +Node: Definition Syntax573188 +Ref: Definition Syntax-Footnote-1578847 +Node: Function Example578918 +Ref: Function Example-Footnote-1581839 +Node: Function Caveats581861 +Node: Calling A Function582379 +Node: Variable Scope583337 +Node: Pass By Value/Reference586330 +Node: Return Statement589827 +Node: Dynamic Typing592806 +Node: Indirect Calls593735 +Ref: Indirect Calls-Footnote-1603600 +Node: Functions Summary603728 +Node: Library Functions606430 +Ref: Library Functions-Footnote-1610038 +Ref: Library Functions-Footnote-2610181 +Node: Library Names610352 +Ref: Library Names-Footnote-1613810 +Ref: Library Names-Footnote-2614033 +Node: General Functions614119 +Node: Strtonum Function615222 +Node: Assert Function618244 +Node: Round Function621568 +Node: Cliff Random Function623109 +Node: Ordinal Functions624125 +Ref: Ordinal Functions-Footnote-1627188 +Ref: Ordinal Functions-Footnote-2627440 +Node: Join Function627651 +Ref: Join Function-Footnote-1629421 +Node: Getlocaltime Function629621 +Node: Readfile Function633365 +Node: Shell Quoting635337 +Node: Data File Management636738 +Node: Filetrans Function637370 +Node: Rewind Function641466 +Node: File Checking642852 +Ref: File Checking-Footnote-1644185 +Node: Empty Files644386 +Node: Ignoring Assigns646365 +Node: Getopt Function647915 +Ref: Getopt Function-Footnote-1659379 +Node: Passwd Functions659579 +Ref: Passwd Functions-Footnote-1668419 +Node: Group Functions668507 +Ref: Group Functions-Footnote-1676404 +Node: Walking Arrays676609 +Node: Library Functions Summary679615 +Node: Library Exercises681017 +Node: Sample Programs682297 +Node: Running Examples683067 +Node: Clones683795 +Node: Cut Program685019 +Node: Egrep Program694739 +Ref: Egrep Program-Footnote-1702242 +Node: Id Program702352 +Node: Split Program706028 +Ref: Split Program-Footnote-1709482 +Node: Tee Program709610 +Node: Uniq Program712399 +Node: Wc Program719818 +Ref: Wc Program-Footnote-1724068 +Node: Miscellaneous Programs724162 +Node: Dupword Program725375 +Node: Alarm Program727406 +Node: Translate Program732211 +Ref: Translate Program-Footnote-1736774 +Node: Labels Program737044 +Ref: Labels Program-Footnote-1740395 +Node: Word Sorting740479 +Node: History Sorting744549 +Node: Extract Program746384 +Node: Simple Sed753908 +Node: Igawk Program756978 +Ref: Igawk Program-Footnote-1771304 +Ref: Igawk Program-Footnote-2771505 +Ref: Igawk Program-Footnote-3771627 +Node: Anagram Program771742 +Node: Signature Program774803 +Node: Programs Summary776050 +Node: Programs Exercises777271 +Ref: Programs Exercises-Footnote-1781402 +Node: Advanced Features781493 +Node: Nondecimal Data783475 +Node: Array Sorting785065 +Node: Controlling Array Traversal785765 +Ref: Controlling Array Traversal-Footnote-1794131 +Node: Array Sorting Functions794249 +Ref: Array Sorting Functions-Footnote-1798135 +Node: Two-way I/O798331 +Ref: Two-way I/O-Footnote-1803276 +Ref: Two-way I/O-Footnote-2803462 +Node: TCP/IP Networking803544 +Node: Profiling806416 +Node: Advanced Features Summary814687 +Node: Internationalization816620 +Node: I18N and L10N818100 +Node: Explaining gettext818786 +Ref: Explaining gettext-Footnote-1823811 +Ref: Explaining gettext-Footnote-2823995 +Node: Programmer i18n824160 +Ref: Programmer i18n-Footnote-1829036 +Node: Translator i18n829085 +Node: String Extraction829879 +Ref: String Extraction-Footnote-1831010 +Node: Printf Ordering831096 +Ref: Printf Ordering-Footnote-1833882 +Node: I18N Portability833946 +Ref: I18N Portability-Footnote-1836402 +Node: I18N Example836465 +Ref: I18N Example-Footnote-1839268 +Node: Gawk I18N839340 +Node: I18N Summary839984 +Node: Debugger841324 +Node: Debugging842346 +Node: Debugging Concepts842787 +Node: Debugging Terms844597 +Node: Awk Debugging847169 +Node: Sample Debugging Session848075 +Node: Debugger Invocation848609 +Node: Finding The Bug849994 +Node: List of Debugger Commands856473 +Node: Breakpoint Control857805 +Node: Debugger Execution Control861482 +Node: Viewing And Changing Data864841 +Node: Execution Stack868217 +Node: Debugger Info869852 +Node: Miscellaneous Debugger Commands873897 +Node: Readline Support878898 +Node: Limitations879792 +Node: Debugging Summary881907 +Node: Arbitrary Precision Arithmetic883081 +Node: Computer Arithmetic884497 +Ref: table-numeric-ranges888074 +Ref: Computer Arithmetic-Footnote-1888598 +Node: Math Definitions888655 +Ref: table-ieee-formats891950 +Ref: Math Definitions-Footnote-1892554 +Node: MPFR features892659 +Node: FP Math Caution894330 +Ref: FP Math Caution-Footnote-1895380 +Node: Inexactness of computations895749 +Node: Inexact representation896708 +Node: Comparing FP Values898066 +Node: Errors accumulate899148 +Node: Getting Accuracy900580 +Node: Try To Round903284 +Node: Setting precision904183 +Ref: table-predefined-precision-strings904867 +Node: Setting the rounding mode906696 +Ref: table-gawk-rounding-modes907060 +Ref: Setting the rounding mode-Footnote-1910512 +Node: Arbitrary Precision Integers910691 +Ref: Arbitrary Precision Integers-Footnote-1915589 +Node: POSIX Floating Point Problems915738 +Ref: POSIX Floating Point Problems-Footnote-1919617 +Node: Floating point summary919655 +Node: Dynamic Extensions921842 +Node: Extension Intro923394 +Node: Plugin License924659 +Node: Extension Mechanism Outline925456 +Ref: figure-load-extension925884 +Ref: figure-register-new-function927364 +Ref: figure-call-new-function928368 +Node: Extension API Description930355 +Node: Extension API Functions Introduction931889 +Node: General Data Types936758 +Ref: General Data Types-Footnote-1942658 +Node: Memory Allocation Functions942957 +Ref: Memory Allocation Functions-Footnote-1945796 +Node: Constructor Functions945895 +Node: Registration Functions947634 +Node: Extension Functions948319 +Node: Exit Callback Functions950616 +Node: Extension Version String951864 +Node: Input Parsers952527 +Node: Output Wrappers962402 +Node: Two-way processors966915 +Node: Printing Messages969178 +Ref: Printing Messages-Footnote-1970254 +Node: Updating `ERRNO'970406 +Node: Requesting Values971146 +Ref: table-value-types-returned971873 +Node: Accessing Parameters972830 +Node: Symbol Table Access974064 +Node: Symbol table by name974578 +Node: Symbol table by cookie976598 +Ref: Symbol table by cookie-Footnote-1980743 +Node: Cached values980806 +Ref: Cached values-Footnote-1984302 +Node: Array Manipulation984393 +Ref: Array Manipulation-Footnote-1985483 +Node: Array Data Types985520 +Ref: Array Data Types-Footnote-1988175 +Node: Array Functions988267 +Node: Flattening Arrays992126 +Node: Creating Arrays999028 +Node: Redirection API1003799 +Node: Extension API Variables1006624 +Node: Extension Versioning1007257 +Node: Extension API Informational Variables1009148 +Node: Extension API Boilerplate1010213 +Node: Finding Extensions1014022 +Node: Extension Example1014582 +Node: Internal File Description1015354 +Node: Internal File Ops1019421 +Ref: Internal File Ops-Footnote-11031172 +Node: Using Internal File Ops1031312 +Ref: Using Internal File Ops-Footnote-11033695 +Node: Extension Samples1033968 +Node: Extension Sample File Functions1035496 +Node: Extension Sample Fnmatch1043177 +Node: Extension Sample Fork1044665 +Node: Extension Sample Inplace1045880 +Node: Extension Sample Ord1047966 +Node: Extension Sample Readdir1048802 +Ref: table-readdir-file-types1049679 +Node: Extension Sample Revout1050490 +Node: Extension Sample Rev2way1051079 +Node: Extension Sample Read write array1051819 +Node: Extension Sample Readfile1053759 +Node: Extension Sample Time1054854 +Node: Extension Sample API Tests1056202 +Node: gawkextlib1056693 +Node: Extension summary1059371 +Node: Extension Exercises1063060 +Node: Language History1064556 +Node: V7/SVR3.11066212 +Node: SVR41068365 +Node: POSIX1069799 +Node: BTL1071180 +Node: POSIX/GNU1071911 +Node: Feature History1077747 +Node: Common Extensions1091541 +Node: Ranges and Locales1092913 +Ref: Ranges and Locales-Footnote-11097532 +Ref: Ranges and Locales-Footnote-21097559 +Ref: Ranges and Locales-Footnote-31097794 +Node: Contributors1098015 +Node: History summary1103555 +Node: Installation1104934 +Node: Gawk Distribution1105880 +Node: Getting1106364 +Node: Extracting1107187 +Node: Distribution contents1108824 +Node: Unix Installation1114926 +Node: Quick Installation1115609 +Node: Shell Startup Files1118020 +Node: Additional Configuration Options1119099 +Node: Configuration Philosophy1120903 +Node: Non-Unix Installation1123272 +Node: PC Installation1123730 +Node: PC Binary Installation1125050 +Node: PC Compiling1126898 +Ref: PC Compiling-Footnote-11129919 +Node: PC Testing1130028 +Node: PC Using1131204 +Node: Cygwin1135319 +Node: MSYS1136089 +Node: VMS Installation1136590 +Node: VMS Compilation1137382 +Ref: VMS Compilation-Footnote-11138611 +Node: VMS Dynamic Extensions1138669 +Node: VMS Installation Details1140353 +Node: VMS Running1142604 +Node: VMS GNV1145444 +Node: VMS Old Gawk1146179 +Node: Bugs1146649 +Node: Other Versions1150538 +Node: Installation summary1156972 +Node: Notes1158031 +Node: Compatibility Mode1158896 +Node: Additions1159678 +Node: Accessing The Source1160603 +Node: Adding Code1162038 +Node: New Ports1168195 +Node: Derived Files1172677 +Ref: Derived Files-Footnote-11178152 +Ref: Derived Files-Footnote-21178186 +Ref: Derived Files-Footnote-31178782 +Node: Future Extensions1178896 +Node: Implementation Limitations1179502 +Node: Extension Design1180750 +Node: Old Extension Problems1181904 +Ref: Old Extension Problems-Footnote-11183421 +Node: Extension New Mechanism Goals1183478 +Ref: Extension New Mechanism Goals-Footnote-11186838 +Node: Extension Other Design Decisions1187027 +Node: Extension Future Growth1189135 +Node: Old Extension Mechanism1189971 +Node: Notes summary1191733 +Node: Basic Concepts1192919 +Node: Basic High Level1193600 +Ref: figure-general-flow1193872 +Ref: figure-process-flow1194471 +Ref: Basic High Level-Footnote-11197700 +Node: Basic Data Typing1197885 +Node: Glossary1201213 +Node: Copying1233142 +Node: GNU Free Documentation License1270698 +Node: Index1295834  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index ff730b21..0c21d923 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -8115,7 +8115,7 @@ it encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @code{ERRNO} to a string describing the error that occurred. -If the @code{errno} variable indicates that the I/O operation may be +If @code{ERRNO} indicates that the I/O operation may be retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2 will be returned instead of @minus{}1, and further calls to @code{getline} may be attemped. @DBXREF{Retrying Input} for further information about @@ -8793,26 +8793,26 @@ indefinitely until some other process opens it for writing. @cindex differences in @command{awk} and @command{gawk}, retrying input This @value{SECTION} describes a feature that is specific to @command{gawk}. -When @command{gawk} encounters an error while reading input, it will by default -return @minus{}1 from getline, and subsequent attempts to read from that file -will result in an end-of-file indication. However, you may optionally instruct -@command{gawk} to allow I/O to be retried when certain errors are encountered -by setting setting a special element -in the @code{PROCINFO} array (@pxref{Auto-set}): +When @command{gawk} encounters an error while reading input, by +default @code{getline} returns @minus{}1, and subsequent attempts to +read from that file result in an end-of-file indication. However, you +may optionally instruct @command{gawk} to allow I/O to be retried when +certain errors are encountered by setting setting a special element in +the @code{PROCINFO} array (@pxref{Auto-set}): @example -PROCINFO["input_name", "RETRY"] +PROCINFO["@var{input_name}", "RETRY"] = 1 @end example -When set, this causes @command{gawk} to check the value of the system +When this element exists, @command{gawk} checks the value of the system @code{errno} variable when an I/O error occurs. If @code{errno} indicates -a subsequent I/O attempt may succeed, @code{getline} will instead return +a subsequent I/O attempt may succeed, @code{getline} instead returns @minus{}2 and further calls to @code{getline} may succeed. This applies to @code{errno} -values EAGAIN, EWOULDBLOCK, EINTR, or ETIMEDOUT. +values @code{EAGAIN}, @code{EWOULDBLOCK}, @code{EINTR}, or @code{ETIMEDOUT}. This feature is useful in conjunction with -@code{PROCINFO["input_name", "READ_TIMEOUT"]} or situations where a file +@code{PROCINFO["@var{input_name}", "READ_TIMEOUT"]} or situations where a file descriptor has been configured to behave in a non-blocking fashion. @node Command-line directories @@ -33685,45 +33685,58 @@ The following function allows extensions to access and manipulate redirections. @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ int fd, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_input_buf_t **ibufp, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_output_buf_t **obufp); -Look up a file in @command{gawk}'s internal redirection table. If @code{name} is NULL or @code{name_len} is 0, it returns -data for the currently open input file corresponding to @code{FILENAME} -(and it will not access the @code{filetype} argument, so that may be -undefined). -If the file is not already open, it tries to open it. -The @code{filetype} argument must be NUL-terminated and should be one of: +Look up a file in @command{gawk}'s internal redirection table. +If @code{name} is @code{NULL} or @code{name_len} is zero, return +data for the currently open input file corresponding to @code{FILENAME}. +(This does not access the @code{filetype} argument, so that may be undefined). +If the file is not already open, attempt to open it. +The @code{filetype} argument must be zero-terminated and should be one of: + @table @code -@item > +@item ">" A file opened for output. -@item >> + +@item ">>" A file opened for append. -@item < + +@item "<" A file opened for input. -@item |> + +@item "|>" A pipe opened for output. -@item |< + +@item "|<" A pipe opened for input. -@item |& + +@item "|&" A two-way coprocess. @end table -On error, a @code{false} value is returned. Otherwise, the return status -is @code{true}, and additional information about the redirection is -returned in the @code{ibufp} and @code{obufp} pointers. For input redirections, -the @code{*ibufp} value should be non-NULL, and @code{*obufp} should be NULL. -For output redirections, -the @code{*obufp} value should be non-NULL, and @code{*ibufp} should be NULL. -For two-way coprocesses, both values should be non-NULL. In the usual case, -the extension is interested in @code{(*ibufp)->fd} and/or @code{fileno((*obufp)->fp)}. -If the file is not already open, and the fd argument is non-negative, -@command{gawk} will use that file descriptor instead of opening the file -in the usual way. If the fd is non-negative, but the file exists -already, @command{gawk} ignores the fd and returns the existing file. It is -the caller's responsibility to notice that neither the fd in the returned -@code{awk_input_buf_t} nor the fd in the returned @code{awk_output_buf_t} matches the requested value. Note that -supplying a file descriptor is currently NOT supported for pipes. -It should work for input, output, append, and two-way (coprocess) -sockets. If @code{filetype} is two-way, we assume that it is a socket! -Note that in the two-way case, the input and output file descriptors -may differ. To check for success, one must check whether either matches. + +On error, return a @code{false} value. Otherwise, return +@code{true}, and return additional information about the redirection +in the @code{ibufp} and @code{obufp} pointers. For input +redirections, the @code{*ibufp} value should be non-@code{NULL}, +and @code{*obufp} should be @code{NULL}. For output redirections, +the @code{*obufp} value should be non-@code{NULL}, and @code{*ibufp} +should be @code{NULL}. For two-way coprocesses, both values should +be non-@code{NULL}. + +In the usual case, the extension is interested in @code{(*ibufp)->fd} +and/or @code{fileno((*obufp)->fp)}. If the file is not already +open, and the @code{fd} argument is non-negative, @command{gawk} +will use that file descriptor instead of opening the file in the +usual way. If @code{fd} is non-negative, but the file exists already, +@command{gawk} ignores @code{fd} and returns the existing file. It is +the caller's responsibility to notice that neither the @code{fd} in +the returned @code{awk_input_buf_t} nor the @code{fd} in the returned +@code{awk_output_buf_t} matches the requested value. + +Note that supplying a file descriptor is currently @emph{not} supported +for pipes. However, supplying a file descriptor should work for input, +output, append, and two-way (coprocess) sockets. If @code{filetype} +is two-way, @command{gawk} assumes that it is a socket! Note that in +the two-way case, the input and output file descriptors may differ. +To check for success, you must check whether either matches. @end table It is anticipated that this API function will be used to implement I/O diff --git a/doc/gawktexi.in b/doc/gawktexi.in index eda9fc9d..7aa427aa 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -7715,7 +7715,7 @@ it encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @code{ERRNO} to a string describing the error that occurred. -If the @code{errno} variable indicates that the I/O operation may be +If @code{ERRNO} indicates that the I/O operation may be retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2 will be returned instead of @minus{}1, and further calls to @code{getline} may be attemped. @DBXREF{Retrying Input} for further information about @@ -8393,26 +8393,26 @@ indefinitely until some other process opens it for writing. @cindex differences in @command{awk} and @command{gawk}, retrying input This @value{SECTION} describes a feature that is specific to @command{gawk}. -When @command{gawk} encounters an error while reading input, it will by default -return @minus{}1 from getline, and subsequent attempts to read from that file -will result in an end-of-file indication. However, you may optionally instruct -@command{gawk} to allow I/O to be retried when certain errors are encountered -by setting setting a special element -in the @code{PROCINFO} array (@pxref{Auto-set}): +When @command{gawk} encounters an error while reading input, by +default @code{getline} returns @minus{}1, and subsequent attempts to +read from that file result in an end-of-file indication. However, you +may optionally instruct @command{gawk} to allow I/O to be retried when +certain errors are encountered by setting setting a special element in +the @code{PROCINFO} array (@pxref{Auto-set}): @example -PROCINFO["input_name", "RETRY"] +PROCINFO["@var{input_name}", "RETRY"] = 1 @end example -When set, this causes @command{gawk} to check the value of the system +When this element exists, @command{gawk} checks the value of the system @code{errno} variable when an I/O error occurs. If @code{errno} indicates -a subsequent I/O attempt may succeed, @code{getline} will instead return +a subsequent I/O attempt may succeed, @code{getline} instead returns @minus{}2 and further calls to @code{getline} may succeed. This applies to @code{errno} -values EAGAIN, EWOULDBLOCK, EINTR, or ETIMEDOUT. +values @code{EAGAIN}, @code{EWOULDBLOCK}, @code{EINTR}, or @code{ETIMEDOUT}. This feature is useful in conjunction with -@code{PROCINFO["input_name", "READ_TIMEOUT"]} or situations where a file +@code{PROCINFO["@var{input_name}", "READ_TIMEOUT"]} or situations where a file descriptor has been configured to behave in a non-blocking fashion. @node Command-line directories @@ -32776,45 +32776,58 @@ The following function allows extensions to access and manipulate redirections. @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ int fd, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_input_buf_t **ibufp, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_output_buf_t **obufp); -Look up a file in @command{gawk}'s internal redirection table. If @code{name} is NULL or @code{name_len} is 0, it returns -data for the currently open input file corresponding to @code{FILENAME} -(and it will not access the @code{filetype} argument, so that may be -undefined). -If the file is not already open, it tries to open it. -The @code{filetype} argument must be NUL-terminated and should be one of: +Look up a file in @command{gawk}'s internal redirection table. +If @code{name} is @code{NULL} or @code{name_len} is zero, return +data for the currently open input file corresponding to @code{FILENAME}. +(This does not access the @code{filetype} argument, so that may be undefined). +If the file is not already open, attempt to open it. +The @code{filetype} argument must be zero-terminated and should be one of: + @table @code -@item > +@item ">" A file opened for output. -@item >> + +@item ">>" A file opened for append. -@item < + +@item "<" A file opened for input. -@item |> + +@item "|>" A pipe opened for output. -@item |< + +@item "|<" A pipe opened for input. -@item |& + +@item "|&" A two-way coprocess. @end table -On error, a @code{false} value is returned. Otherwise, the return status -is @code{true}, and additional information about the redirection is -returned in the @code{ibufp} and @code{obufp} pointers. For input redirections, -the @code{*ibufp} value should be non-NULL, and @code{*obufp} should be NULL. -For output redirections, -the @code{*obufp} value should be non-NULL, and @code{*ibufp} should be NULL. -For two-way coprocesses, both values should be non-NULL. In the usual case, -the extension is interested in @code{(*ibufp)->fd} and/or @code{fileno((*obufp)->fp)}. -If the file is not already open, and the fd argument is non-negative, -@command{gawk} will use that file descriptor instead of opening the file -in the usual way. If the fd is non-negative, but the file exists -already, @command{gawk} ignores the fd and returns the existing file. It is -the caller's responsibility to notice that neither the fd in the returned -@code{awk_input_buf_t} nor the fd in the returned @code{awk_output_buf_t} matches the requested value. Note that -supplying a file descriptor is currently NOT supported for pipes. -It should work for input, output, append, and two-way (coprocess) -sockets. If @code{filetype} is two-way, we assume that it is a socket! -Note that in the two-way case, the input and output file descriptors -may differ. To check for success, one must check whether either matches. + +On error, return a @code{false} value. Otherwise, return +@code{true}, and return additional information about the redirection +in the @code{ibufp} and @code{obufp} pointers. For input +redirections, the @code{*ibufp} value should be non-@code{NULL}, +and @code{*obufp} should be @code{NULL}. For output redirections, +the @code{*obufp} value should be non-@code{NULL}, and @code{*ibufp} +should be @code{NULL}. For two-way coprocesses, both values should +be non-@code{NULL}. + +In the usual case, the extension is interested in @code{(*ibufp)->fd} +and/or @code{fileno((*obufp)->fp)}. If the file is not already +open, and the @code{fd} argument is non-negative, @command{gawk} +will use that file descriptor instead of opening the file in the +usual way. If @code{fd} is non-negative, but the file exists already, +@command{gawk} ignores @code{fd} and returns the existing file. It is +the caller's responsibility to notice that neither the @code{fd} in +the returned @code{awk_input_buf_t} nor the @code{fd} in the returned +@code{awk_output_buf_t} matches the requested value. + +Note that supplying a file descriptor is currently @emph{not} supported +for pipes. However, supplying a file descriptor should work for input, +output, append, and two-way (coprocess) sockets. If @code{filetype} +is two-way, @command{gawk} assumes that it is a socket! Note that in +the two-way case, the input and output file descriptors may differ. +To check for success, you must check whether either matches. @end table It is anticipated that this API function will be used to implement I/O diff --git a/gawkapi.c b/gawkapi.c index 01bfa765..01ccdf2b 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -1044,42 +1044,48 @@ api_release_value(awk_ext_id_t id, awk_value_cookie_t value) /* api_get_file --- return a handle to an existing or newly opened file */ static awk_bool_t -api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, int fd, const awk_input_buf_t **ibufp, const awk_output_buf_t **obufp) +api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *filetype, + int fd, const awk_input_buf_t **ibufp, const awk_output_buf_t **obufp) { const struct redirect *f; int flag; /* not used, sigh */ enum redirval redirtype; - if ((name == NULL) || (namelen == 0)) { + if (name == NULL || namelen == 0) { if (curfile == NULL) { + INSTRUCTION *pc; + int save_rule; + char *save_source; + if (nextfile(& curfile, false) <= 0) return awk_false; - { - INSTRUCTION *pc = main_beginfile; - /* save execution state */ - int save_rule = currule; - char *save_source = source; - - while (1) { - if (!pc) - fatal(_("cannot find end of BEGINFILE rule")); - if (pc->opcode == Op_after_beginfile) - break; - pc = pc->nexti; - } - pc->opcode = Op_stop; - (void) (*interpret)(main_beginfile); - pc->opcode = Op_after_beginfile; - after_beginfile(& curfile); - /* restore execution state */ - currule = save_rule; - source = save_source; + + pc = main_beginfile; + /* save execution state */ + save_rule = currule; + save_source = source; + + while (1) { + if (!pc) + fatal(_("cannot find end of BEGINFILE rule")); + if (pc->opcode == Op_after_beginfile) + break; + pc = pc->nexti; } + pc->opcode = Op_stop; + (void) (*interpret)(main_beginfile); + pc->opcode = Op_after_beginfile; + after_beginfile(& curfile); + /* restore execution state */ + currule = save_rule; + source = save_source; } *ibufp = &curfile->public; *obufp = NULL; + return awk_true; } + redirtype = redirect_none; switch (filetype[0]) { case '<': @@ -1113,13 +1119,16 @@ api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *file } break; } + if (redirtype == redirect_none) { warning(_("cannot open unrecognized file type `%s' for `%s'"), filetype, name); return awk_false; } + if ((f = redirect_string(name, namelen, 0, redirtype, &flag, fd, false)) == NULL) return awk_false; + *ibufp = f->iop ? & f->iop->public : NULL; *obufp = f->output.fp ? & f->output : NULL; return awk_true; diff --git a/io.c b/io.c index 5f977355..4dbe16fb 100644 --- a/io.c +++ b/io.c @@ -724,7 +724,7 @@ redflags2str(int flags) return genflags2str(flags, redtab); } -/* redirect --- Redirection for printf and print commands */ +/* redirect_string --- Redirection for printf and print commands, use string info */ struct redirect * redirect_string(const char *str, size_t explen, bool not_string, @@ -1065,6 +1065,8 @@ redirect_string(const char *str, size_t explen, bool not_string, return rp; } +/* redirect --- Redirection for printf and print commands */ + struct redirect * redirect(NODE *redir_exp, int redirtype, int *errflg, bool failure_fatal) { @@ -2303,7 +2305,7 @@ wait_any(int interesting) /* pid of interest, if any */ break; } } -#else +#else /* ! __MINGW32__ */ #ifndef HAVE_SIGPROCMASK hstat = signal(SIGHUP, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); @@ -2340,7 +2342,7 @@ wait_any(int interesting) /* pid of interest, if any */ signal(SIGHUP, hstat); signal(SIGQUIT, qstat); #endif -#endif +#endif /* ! __MINGW32__ */ #ifndef HAVE_SIGPROCMASK signal(SIGINT, istat); #else @@ -3509,14 +3511,15 @@ find_longest_terminator: return REC_OK; } -/* return true if PROCINFO[, "RETRY"] exists */ +/* retryable --- return true if PROCINFO[, "RETRY"] exists */ + static inline int retryable(IOBUF *iop) { return PROCINFO_node && in_PROCINFO(iop->public.name, "RETRY", NULL); } -/* Does the I/O error indicate that the operation should be retried later? */ +/* errno_io_retry --- Does the I/O error indicate that the operation should be retried later? */ static inline int errno_io_retry(void) -- cgit v1.2.3 From 90e1d42a99178608ec22216f7f35dadcad5a8b3a Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 24 Mar 2015 20:32:42 -0400 Subject: Fix bug where exit with no argument was setting the exit status to zero. --- ChangeLog | 5 +++++ interpret.h | 19 ++++++++++--------- test/ChangeLog | 6 ++++++ test/Makefile.am | 4 +++- test/Makefile.in | 9 ++++++++- test/Maketests | 5 +++++ test/exitval3.awk | 2 ++ test/exitval3.ok | 1 + 8 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 test/exitval3.awk create mode 100644 test/exitval3.ok diff --git a/ChangeLog b/ChangeLog index b8b3ee9a..a3496ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Andrew J. Schorr + + * interpret.h (r_interpret): When Op_K_exit has an argument of + Nnull_string, do not update exit_val, since no value was supplied. + 2015-03-18 Arnold D. Robbins * config.guess, config.sub: Updated, from libtool 2.4.6. diff --git a/interpret.h b/interpret.h index b16dc126..372679df 100644 --- a/interpret.h +++ b/interpret.h @@ -1313,17 +1313,18 @@ match_re: fatal(_("`exit' cannot be called in the current context")); exiting = true; - t1 = POP_NUMBER(); - exit_val = (int) get_number_si(t1); - DEREF(t1); + if ((t1 = POP_NUMBER()) != Nnull_string) { + exit_val = (int) get_number_si(t1); #ifdef VMS - if (exit_val == 0) - exit_val = EXIT_SUCCESS; - else if (exit_val == 1) - exit_val = EXIT_FAILURE; - /* else - just pass anything else on through */ + if (exit_val == 0) + exit_val = EXIT_SUCCESS; + else if (exit_val == 1) + exit_val = EXIT_FAILURE; + /* else + just pass anything else on through */ #endif + } + DEREF(t1); if (currule == BEGINFILE || currule == ENDFILE) { diff --git a/test/ChangeLog b/test/ChangeLog index c33ac108..862b8491 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2015-03-24 Andrew J. Schorr + + * Makefile.am (EXTRA_DIST): Add exitval3.awk and exitval3.ok. + (BASIC_TESTS): Add new test exitval3. + * exitval3.awk, exitval3.ok: New files. + 2015-03-17 Andrew J. Schorr * inplace1.ok, inplace2.ok, inplace3.ok: Update error message line diff --git a/test/Makefile.am b/test/Makefile.am index f1a0a275..1b5a2a50 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -221,6 +221,8 @@ EXTRA_DIST = \ exitval2.awk \ exitval2.ok \ exitval2.w32 \ + exitval3.awk \ + exitval3.ok \ fcall_exit.awk \ fcall_exit.ok \ fcall_exit2.awk \ @@ -1001,7 +1003,7 @@ BASIC_TESTS = \ 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 \ + eofsplit exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ diff --git a/test/Makefile.in b/test/Makefile.in index b794e04e..d5f39447 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -478,6 +478,8 @@ EXTRA_DIST = \ exitval2.awk \ exitval2.ok \ exitval2.w32 \ + exitval3.awk \ + exitval3.ok \ fcall_exit.awk \ fcall_exit.ok \ fcall_exit2.awk \ @@ -1257,7 +1259,7 @@ BASIC_TESTS = \ 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 \ + eofsplit exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ @@ -2709,6 +2711,11 @@ exitval2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +exitval3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fcall_exit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 8c270869..58a1d670 100644 --- a/test/Maketests +++ b/test/Maketests @@ -230,6 +230,11 @@ exitval2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +exitval3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fcall_exit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/exitval3.awk b/test/exitval3.awk new file mode 100644 index 00000000..33e8c433 --- /dev/null +++ b/test/exitval3.awk @@ -0,0 +1,2 @@ +BEGIN { exit 42 } +END { exit } diff --git a/test/exitval3.ok b/test/exitval3.ok new file mode 100644 index 00000000..20f64b8c --- /dev/null +++ b/test/exitval3.ok @@ -0,0 +1 @@ +EXIT CODE: 42 -- cgit v1.2.3 From 9d43b510f74f63806279ce40f65245ea7e5b0d53 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Mar 2015 06:32:13 +0300 Subject: Some more cleanups. Ready to merge! --- ChangeLog | 5 +++++ doc/ChangeLog | 4 ++++ doc/gawk.info | 49 +++++++++++++++++++++++++------------------------ doc/gawk.texi | 10 ++++++---- doc/gawktexi.in | 10 ++++++---- extension/ChangeLog | 4 ++++ extension/testext.c | 12 ++++++++++++ gawkapi.c | 4 ++-- io.c | 3 ++- test/ChangeLog | 7 +++++++ test/Makefile.am | 9 +-------- test/Makefile.in | 9 +-------- test/defvar.awk | 3 --- test/defvar.ok | 5 ----- test/testext.ok | 6 ++++++ 15 files changed, 81 insertions(+), 59 deletions(-) delete mode 100644 test/defvar.awk delete mode 100644 test/defvar.ok diff --git a/ChangeLog b/ChangeLog index ae1a846a..a1cbb919 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-03-27 Arnold D. Robbins + + * io.c (redirect): Change not_string from int to bool. + * gawkapi.c (api_get_file): Minor stylistic improvements. + 2015-03-24 Andrew J. Schorr * interpret.h (r_interpret): When Op_K_exit has an argument of diff --git a/doc/ChangeLog b/doc/ChangeLog index 679e1bea..f4a6f19b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-03-27 Arnold D. Robbins + + * gawktexi.in: Minor edits. + 2015-03-24 Arnold D. Robbins * gawktexi.in: Minor fixes from Antonio Colombo and new exercise diff --git a/doc/gawk.info b/doc/gawk.info index 6b107344..d0312ec6 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -5451,11 +5451,12 @@ how `awk' works. encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then `getline' returns -1. In this case, `gawk' sets the variable `ERRNO' to a string -describing the error that occurred. If `ERRNO' indicates that the I/O -operation may be retried, and `PROCINFO["input", "RETRY"]' is set, then --2 will be returned instead of -1, and further calls to `getline' may -be attemped. *Note Retrying Input::, for further information about -this feature. +describing the error that occurred. + + If `ERRNO' indicates that the I/O operation may be retried, and +`PROCINFO["INPUT", "RETRY"]' is set, then `getline' returns -2 instead +of -1, and further calls to `getline' may be attemped. *Note Retrying +Input::, for further information about this feature. In the following examples, COMMAND stands for a string value that represents a shell command. @@ -5999,16 +6000,16 @@ This minor node describes a feature that is specific to `gawk'. `getline' returns -1, and subsequent attempts to read from that file result in an end-of-file indication. However, you may optionally instruct `gawk' to allow I/O to be retried when certain errors are -encountered by setting setting a special element in the `PROCINFO' -array (*note Auto-set::): +encountered by setting a special element in the `PROCINFO' array (*note +Auto-set::): PROCINFO["INPUT_NAME", "RETRY"] = 1 When this element exists, `gawk' checks the value of the system `errno' variable when an I/O error occurs. If `errno' indicates a subsequent I/O attempt may succeed, `getline' instead returns -2 and -further calls to `getline' may succeed. This applies to `errno' values -`EAGAIN', `EWOULDBLOCK', `EINTR', or `ETIMEDOUT'. +further calls to `getline' may succeed. This applies to the `errno' +values `EAGAIN', `EWOULDBLOCK', `EINTR', or `ETIMEDOUT'. This feature is useful in conjunction with `PROCINFO["INPUT_NAME", "READ_TIMEOUT"]' or situations where a file descriptor has been @@ -34981,21 +34982,21 @@ Ref: Splitting By Content-Footnote-1236687 Node: Multiple Line236850 Ref: Multiple Line-Footnote-1242731 Node: Getline242910 -Node: Plain Getline245376 -Node: Getline/Variable248016 -Node: Getline/File249165 -Node: Getline/Variable/File250550 -Ref: Getline/Variable/File-Footnote-1252153 -Node: Getline/Pipe252240 -Node: Getline/Variable/Pipe254918 -Node: Getline/Coprocess256049 -Node: Getline/Variable/Coprocess257313 -Node: Getline Notes258052 -Node: Getline Summary260846 -Ref: table-getline-variants261258 -Node: Read Timeout262087 -Ref: Read Timeout-Footnote-1265990 -Node: Retrying Input266048 +Node: Plain Getline245380 +Node: Getline/Variable248020 +Node: Getline/File249169 +Node: Getline/Variable/File250554 +Ref: Getline/Variable/File-Footnote-1252157 +Node: Getline/Pipe252244 +Node: Getline/Variable/Pipe254922 +Node: Getline/Coprocess256053 +Node: Getline/Variable/Coprocess257317 +Node: Getline Notes258056 +Node: Getline Summary260850 +Ref: table-getline-variants261262 +Node: Read Timeout262091 +Ref: Read Timeout-Footnote-1265994 +Node: Retrying Input266052 Node: Command-line directories267238 Node: Input Summary268145 Node: Input Exercises271530 diff --git a/doc/gawk.texi b/doc/gawk.texi index 0c21d923..e9d987f0 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -8115,9 +8115,11 @@ it encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @code{ERRNO} to a string describing the error that occurred. + If @code{ERRNO} indicates that the I/O operation may be -retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2 -will be returned instead of @minus{}1, and further calls to @code{getline} +retried, and @code{PROCINFO["@var{input}", "RETRY"]} is set, +then @code{getline} returns @minus{}2 +instead of @minus{}1, and further calls to @code{getline} may be attemped. @DBXREF{Retrying Input} for further information about this feature. @@ -8797,7 +8799,7 @@ When @command{gawk} encounters an error while reading input, by default @code{getline} returns @minus{}1, and subsequent attempts to read from that file result in an end-of-file indication. However, you may optionally instruct @command{gawk} to allow I/O to be retried when -certain errors are encountered by setting setting a special element in +certain errors are encountered by setting a special element in the @code{PROCINFO} array (@pxref{Auto-set}): @example @@ -8808,7 +8810,7 @@ When this element exists, @command{gawk} checks the value of the system @code{errno} variable when an I/O error occurs. If @code{errno} indicates a subsequent I/O attempt may succeed, @code{getline} instead returns @minus{}2 and -further calls to @code{getline} may succeed. This applies to @code{errno} +further calls to @code{getline} may succeed. This applies to the @code{errno} values @code{EAGAIN}, @code{EWOULDBLOCK}, @code{EINTR}, or @code{ETIMEDOUT}. This feature is useful in conjunction with diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 7aa427aa..178444a4 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -7715,9 +7715,11 @@ it encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @code{ERRNO} to a string describing the error that occurred. + If @code{ERRNO} indicates that the I/O operation may be -retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2 -will be returned instead of @minus{}1, and further calls to @code{getline} +retried, and @code{PROCINFO["@var{input}", "RETRY"]} is set, +then @code{getline} returns @minus{}2 +instead of @minus{}1, and further calls to @code{getline} may be attemped. @DBXREF{Retrying Input} for further information about this feature. @@ -8397,7 +8399,7 @@ When @command{gawk} encounters an error while reading input, by default @code{getline} returns @minus{}1, and subsequent attempts to read from that file result in an end-of-file indication. However, you may optionally instruct @command{gawk} to allow I/O to be retried when -certain errors are encountered by setting setting a special element in +certain errors are encountered by setting a special element in the @code{PROCINFO} array (@pxref{Auto-set}): @example @@ -8408,7 +8410,7 @@ When this element exists, @command{gawk} checks the value of the system @code{errno} variable when an I/O error occurs. If @code{errno} indicates a subsequent I/O attempt may succeed, @code{getline} instead returns @minus{}2 and -further calls to @code{getline} may succeed. This applies to @code{errno} +further calls to @code{getline} may succeed. This applies to the @code{errno} values @code{EAGAIN}, @code{EWOULDBLOCK}, @code{EINTR}, or @code{ETIMEDOUT}. This feature is useful in conjunction with diff --git a/extension/ChangeLog b/extension/ChangeLog index 334c97af..5d1651fd 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,7 @@ +2015-03-27 Arnold D. Robbins + + * testext.c: Move test for deferred variables here. + 2015-03-18 Arnold D. Robbins * configure: Updated to libtool 2.4.6. diff --git a/extension/testext.c b/extension/testext.c index 8a906c67..e2ddbe87 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -374,6 +374,17 @@ out: return result; } +/* + * 3/2015: This test is no longer strictly necessary, + * since PROCINFO is no longer a deferred variable. + * But we leave it in for safety, anyway. + */ +/* +BEGIN { + print "test_deferred returns", test_deferred() + print "" +} +*/ static awk_value_t * test_deferred(int nargs, awk_value_t *result) { @@ -1037,6 +1048,7 @@ static awk_bool_t init_testext(void) static const char message[] = "hello, world"; /* of course */ static const char message2[] = "i am a scalar"; + /* This is used by the getfile test */ if (sym_lookup("TESTEXT_QUIET", AWK_NUMBER, & value)) return awk_true; diff --git a/gawkapi.c b/gawkapi.c index 01ccdf2b..9d8c6f36 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -1065,8 +1065,8 @@ api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char *file save_rule = currule; save_source = source; - while (1) { - if (!pc) + for (;;) { + if (pc == NULL) fatal(_("cannot find end of BEGINFILE rule")); if (pc->opcode == Op_after_beginfile) break; diff --git a/io.c b/io.c index 4dbe16fb..cf9dd943 100644 --- a/io.c +++ b/io.c @@ -1070,7 +1070,8 @@ redirect_string(const char *str, size_t explen, bool not_string, struct redirect * redirect(NODE *redir_exp, int redirtype, int *errflg, bool failure_fatal) { - int not_string = ((redir_exp->flags & STRCUR) == 0); + bool not_string = ((redir_exp->flags & STRCUR) == 0); + redir_exp = force_string(redir_exp); return redirect_string(redir_exp->stptr, redir_exp->stlen, not_string, redirtype, errflg, -1, failure_fatal); diff --git a/test/ChangeLog b/test/ChangeLog index 106a88d5..8aedf6f2 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2015-03-27 Arnold D. Robbins + + * Makefile.am: Remove defvar test and reference to files; test + code moved into extension/testext.c. + * defvar.awk, defvar.ok: Removed. + * testext.ok: Updated. + 2015-03-24 Andrew J. Schorr * Makefile.am (EXTRA_DIST): Add exitval3.awk and exitval3.ok. diff --git a/test/Makefile.am b/test/Makefile.am index fe06de7a..788fff5e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -178,8 +178,6 @@ EXTRA_DIST = \ dbugeval.ok \ defref.awk \ defref.ok \ - defvar.awk \ - defvar.ok \ delargv.awk \ delargv.ok \ delarpm2.awk \ @@ -1094,7 +1092,7 @@ LOCALE_CHARSET_TESTS = \ mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc SHLIB_TESTS = \ - defvar fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ + fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time # List of the tests which should be run with --lint option: @@ -1951,11 +1949,6 @@ testext:: @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk -defvar: - @echo $@ - @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - getfile: @echo $@ @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Makefile.in b/test/Makefile.in index fa3598a5..ad27412a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -435,8 +435,6 @@ EXTRA_DIST = \ dbugeval.ok \ defref.awk \ defref.ok \ - defvar.awk \ - defvar.ok \ delargv.awk \ delargv.ok \ delarpm2.awk \ @@ -1347,7 +1345,7 @@ LOCALE_CHARSET_TESTS = \ mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc SHLIB_TESTS = \ - defvar fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ + fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \ ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time @@ -2388,11 +2386,6 @@ testext:: @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk -defvar: - @echo $@ - @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - getfile: @echo $@ @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/defvar.awk b/test/defvar.awk deleted file mode 100644 index 444b81c9..00000000 --- a/test/defvar.awk +++ /dev/null @@ -1,3 +0,0 @@ -BEGIN { - print "test_deferred returns", test_deferred() -} diff --git a/test/defvar.ok b/test/defvar.ok deleted file mode 100644 index 4c85427e..00000000 --- a/test/defvar.ok +++ /dev/null @@ -1,5 +0,0 @@ -fubar = 9 -rumpus = -5 -uid matches 1 -api_major matches 1 -test_deferred returns 1 diff --git a/test/testext.ok b/test/testext.ok index 9dae010f..897a7336 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -23,6 +23,12 @@ var_test() returned 1, test_var = 42 test_errno() returned 1, ERRNO = No child processes +fubar = 9 +rumpus = -5 +uid matches 1 +api_major matches 1 +test_deferred returns 1 + length of test_array is 10, should be 10 test_array_size: incoming size is 10 test_array_size() returned 1, length is now 0 -- cgit v1.2.3 From 7d3d7d27391db40c0561ea47e6b8a5a1ae24c6fb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 27 Mar 2015 06:35:32 +0300 Subject: Update NEWS. --- ChangeLog | 1 + NEWS | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index a1cbb919..b2e0214d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * io.c (redirect): Change not_string from int to bool. * gawkapi.c (api_get_file): Minor stylistic improvements. + * NEWS: Updated for retryable I/O and new API function. 2015-03-24 Andrew J. Schorr diff --git a/NEWS b/NEWS index 1613cd8d..0c27c2c0 100644 --- a/NEWS +++ b/NEWS @@ -45,6 +45,12 @@ Changes from 4.1.x to 4.2.0 system, these files belong in /etc/profile.d, but the appropriate location may be different on other platforms. +11. Gawk now supports retryable I/O via PROCINFO[input-file, "RETRY"]; see + the manual. + +12. The API minor version has been increased to two; the get_file() + API provides access to open redirections. Also see the manual. + Changes from 4.1.1 to 4.1.2 --------------------------- -- cgit v1.2.3 From 2ee1a928483f4fe4f594aebc5c1f8da1253c28b9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 31 Mar 2015 06:23:04 +0300 Subject: Further improvements. sub/gsub working. --- ChangeLog | 7 ++++++ awk.h | 1 + builtin.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++-------- eval.c | 2 +- indirectbuitin.awk | 54 ++++++++++++++++++++++++-------------------- node.c | 1 + 6 files changed, 97 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8610df82..47ef45ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-03-31 Arnold D. Robbins + + * awk.h (r_get_field): Declare. + * builtin.c (call_sub_func): Rearrange the stack to be what + the buitin function expects. + * eval.c (r_get_field): Make extern. + 2015-03-24 Arnold D. Robbins * awkgram.y (make_regnode): Make extern. diff --git a/awk.h b/awk.h index f23977fb..1205401b 100644 --- a/awk.h +++ b/awk.h @@ -1408,6 +1408,7 @@ extern NODE **r_get_lhs(NODE *n, bool reference); extern STACK_ITEM *grow_stack(void); extern void dump_fcall_stack(FILE *fp); extern int register_exec_hook(Func_pre_exec preh, Func_post_exec posth); +extern NODE **r_get_field(NODE *n, Func_ptr *assign, bool reference); /* ext.c */ extern NODE *do_ext(int nargs); void load_ext(const char *lib_name); /* temporary */ diff --git a/builtin.c b/builtin.c index 7926a320..c222ce78 100644 --- a/builtin.c +++ b/builtin.c @@ -3000,7 +3000,10 @@ NODE * call_sub_func(const char *name, int nargs) { unsigned int flags = 0; - NODE *regex, *replace; + NODE *regex, *replace, *glob_flag; + NODE **lhs, *rhs; + NODE *zero = make_number(0.0); + NODE *result; if (name[0] == 'g') { if (name[1] == 'e') @@ -3009,17 +3012,62 @@ call_sub_func(const char *name, int nargs) flags = GSUB; } - if ((flags == 0 || flags == GSUB) && nargs != 2) - fatal(_("%s: can be called indirectly only with two arguments"), name); + if (flags == 0 || flags == GSUB) { + /* sub or gsub */ + if (nargs != 2) + fatal(_("%s: can be called indirectly only with two arguments"), name); - replace = POP(); + replace = POP_STRING(); + regex = POP(); /* the regex */ + /* + * push regex + * push replace + * push $0 + */ + regex = make_regnode(Node_regex, regex); + PUSH(regex); + PUSH(replace); + lhs = r_get_field(zero, (Func_ptr *) 0, true); + nargs++; + PUSH_ADDRESS(lhs); + } else { + /* gensub */ + if (nargs == 4) + rhs = POP(); + else + rhs = NULL; + glob_flag = POP_STRING(); + replace = POP_STRING(); + regex = POP(); /* the regex */ + /* + * push regex + * push replace + * push glob_flag + * if (nargs = 3) { + * push $0 + * nargs++ + * } + */ + regex = make_regnode(Node_regex, regex); + PUSH(regex); + PUSH(replace); + PUSH(glob_flag); + if (rhs == NULL) { + lhs = r_get_field(zero, (Func_ptr *) 0, true); + rhs = *lhs; + UPREF(rhs); + PUSH(rhs); + nargs++; + } + PUSH(rhs); + } - regex = POP(); /* the regex */ - regex = make_regnode(Node_regex, regex); - PUSH(regex); - PUSH(replace); - return do_sub(nargs, flags); + unref(zero); + result = do_sub(nargs, flags); + if (flags != GENSUB) + reset_record(); + return result; } diff --git a/eval.c b/eval.c index 2ba79956..5f66763a 100644 --- a/eval.c +++ b/eval.c @@ -1180,7 +1180,7 @@ r_get_lhs(NODE *n, bool reference) /* r_get_field --- get the address of a field node */ -static inline NODE ** +NODE ** r_get_field(NODE *n, Func_ptr *assign, bool reference) { long field_num; diff --git a/indirectbuitin.awk b/indirectbuitin.awk index 8c78593c..de3d5ccd 100644 --- a/indirectbuitin.awk +++ b/indirectbuitin.awk @@ -7,16 +7,6 @@ function print_result(category, fname, builtin_result, indirect_result) builtin_result, indirect_result) } -BEGIN { - fun = "sub" - $0 = "ff11bb" - b1 = sub("f", "q") - $0 = "ff11bb" - i1 = @fun("f", "q") - print_result("string", fun, b1, i1) - exit -} - BEGIN { # math functions @@ -101,16 +91,24 @@ BEGIN { # string functions -# fun = "gensub" -# b1 = gensub("f", "q","g", "ff11bb") -# i1 = @fun("f", "q", "g", "ff11bb") -# print_result("string", fun, b1, i1) + fun = "gensub" + b1 = gensub("f", "q", "g", "ff11bb") + i1 = @fun("f", "q", "g", "ff11bb") + print_result("string", fun, b1, i1) -# fun = "gsub" -# x = "ff11bb" -# b1 = gsub("f", "q", x) -# i1 = @fun("f", "q", x) -# print_result("string", fun, b1, i1) + fun = "gsub" + $0 = "ff11bb" + b1 = gsub("f", "q") + b2 = $0 + $0 = "ff11bb" + i1 = @fun("f", "q") + i2 = $0 + print_result("string", fun, b1, i1) + if (b2 != i2) { + printf("string: %s: fail: $0 (%s) != $0 (%s)\n", + fun, b2, i2) + exit 1 + } fun = "index" b1 = index("hi, how are you", "how") @@ -143,10 +141,18 @@ BEGIN { print_result("string", fun, b1, i1) fun = "sub" - x = "ff11bb" - b1 = sub("f", "q", x) - i1 = @fun("f", "q", x) + $0 = "ff11bb" + b1 = sub("f", "q") + b2 = $0 + $0 = "ff11bb" + i1 = @fun("f", "q") + i2 = $0 print_result("string", fun, b1, i1) + if (b2 != i2) { + printf("string: %s: fail: $0 (%s) != $0 (%s)\n", + fun, b2, i2) + exit 1 + } fun = "substr" b1 = substr("0xdeadbeef", 7, 4) @@ -210,12 +216,12 @@ BEGIN { data2[data[i]] = i fun = "asorti" - asort(data2, newdata) + asorti(data2, newdata) @fun(data2, newdata2) print_result("array", fun, b1, i1) for (i in newdata) { if (! (i in newdata2) || newdata[i] != newdata2[i]) { - print fun ": failed, index", i + print fun ": failed, index", i, "value", newdata[i], newdata2[i] exit } } diff --git a/node.c b/node.c index 179d272e..7a1d99f6 100644 --- a/node.c +++ b/node.c @@ -432,6 +432,7 @@ r_unref(NODE *tmp) if (tmp == NULL) return; if (tmp->type == Node_regex) { +fprintf(stderr, "got here!\n"); fflush(stderr); if (tmp->re_reg != NULL) refree(tmp->re_reg); if (tmp->re_text != NULL) -- cgit v1.2.3 From 2bdaa6b89e00984d79305ba1066cf98c5674b556 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 31 Mar 2015 06:24:55 +0300 Subject: Minor doc edits. --- doc/ChangeLog | 4 + doc/gawk.info | 916 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 12 +- doc/gawktexi.in | 12 +- 4 files changed, 479 insertions(+), 465 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f4a6f19b..08c91bd7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-03-31 Arnold D. Robbins + + * gawktexi.in: Minor edits. + 2015-03-27 Arnold D. Robbins * gawktexi.in: Minor edits. diff --git a/doc/gawk.info b/doc/gawk.info index d0312ec6..a208f834 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -6005,11 +6005,11 @@ Auto-set::): PROCINFO["INPUT_NAME", "RETRY"] = 1 - When this element exists, `gawk' checks the value of the system -`errno' variable when an I/O error occurs. If `errno' indicates a -subsequent I/O attempt may succeed, `getline' instead returns -2 and -further calls to `getline' may succeed. This applies to the `errno' -values `EAGAIN', `EWOULDBLOCK', `EINTR', or `ETIMEDOUT'. + When this element exists, `gawk' checks the value of the system (C +language) `errno' variable when an I/O error occurs. If `errno' +indicates a subsequent I/O attempt may succeed, `getline' instead +returns -2 and further calls to `getline' may succeed. This applies to +the `errno' values `EAGAIN', `EWOULDBLOCK', `EINTR', or `ETIMEDOUT'. This feature is useful in conjunction with `PROCINFO["INPUT_NAME", "READ_TIMEOUT"]' or situations where a file descriptor has been @@ -26259,15 +26259,17 @@ project. * GD graphics library extension + * MPFR library extension (this provides access to a number of MPFR + functions that `gawk''s native MPFR support does not) + * PDF extension * PostgreSQL extension - * MPFR library extension (this provides access to a number of MPFR - functions that `gawk''s native MPFR support does not) - * Redis extension + * Select extension + * XML parser extension, using the Expat (http://expat.sourceforge.net) XML parsing library @@ -33053,7 +33055,7 @@ Index (line 99) * exp: Numeric Functions. (line 33) * expand utility: Very Simple. (line 73) -* Expat XML parser library: gawkextlib. (line 35) +* Expat XML parser library: gawkextlib. (line 37) * exponent: Numeric Functions. (line 33) * expressions: Expressions. (line 6) * expressions, as patterns: Expression Patterns. (line 6) @@ -33473,7 +33475,7 @@ Index * git utility <2>: Accessing The Source. (line 10) * git utility <3>: Other Versions. (line 29) -* git utility: gawkextlib. (line 29) +* git utility: gawkextlib. (line 31) * Git, use of for gawk source code: Derived Files. (line 6) * GNITS mailing list: Acknowledgments. (line 52) * GNU awk, See gawk: Preface. (line 51) @@ -34997,452 +34999,452 @@ Ref: table-getline-variants261262 Node: Read Timeout262091 Ref: Read Timeout-Footnote-1265994 Node: Retrying Input266052 -Node: Command-line directories267238 -Node: Input Summary268145 -Node: Input Exercises271530 -Node: Printing272258 -Node: Print274093 -Node: Print Examples275550 -Node: Output Separators278329 -Node: OFMT280347 -Node: Printf281702 -Node: Basic Printf282487 -Node: Control Letters284059 -Node: Format Modifiers288044 -Node: Printf Examples294050 -Node: Redirection296536 -Node: Special FD303374 -Ref: Special FD-Footnote-1306540 -Node: Special Files306614 -Node: Other Inherited Files307231 -Node: Special Network308231 -Node: Special Caveats309093 -Node: Close Files And Pipes310042 -Ref: Close Files And Pipes-Footnote-1317227 -Ref: Close Files And Pipes-Footnote-2317375 -Node: Nonfatal317525 -Node: Output Summary319850 -Node: Output Exercises321071 -Node: Expressions321751 -Node: Values322940 -Node: Constants323617 -Node: Scalar Constants324308 -Ref: Scalar Constants-Footnote-1325170 -Node: Nondecimal-numbers325420 -Node: Regexp Constants328430 -Node: Using Constant Regexps328956 -Node: Variables332119 -Node: Using Variables332776 -Node: Assignment Options334687 -Node: Conversion336562 -Node: Strings And Numbers337086 -Ref: Strings And Numbers-Footnote-1340151 -Node: Locale influences conversions340260 -Ref: table-locale-affects343006 -Node: All Operators343598 -Node: Arithmetic Ops344227 -Node: Concatenation346732 -Ref: Concatenation-Footnote-1349551 -Node: Assignment Ops349658 -Ref: table-assign-ops354637 -Node: Increment Ops355947 -Node: Truth Values and Conditions359378 -Node: Truth Values360461 -Node: Typing and Comparison361510 -Node: Variable Typing362326 -Node: Comparison Operators365993 -Ref: table-relational-ops366403 -Node: POSIX String Comparison369898 -Ref: POSIX String Comparison-Footnote-1370970 -Node: Boolean Ops371109 -Ref: Boolean Ops-Footnote-1375587 -Node: Conditional Exp375678 -Node: Function Calls377416 -Node: Precedence381296 -Node: Locales384956 -Node: Expressions Summary386588 -Node: Patterns and Actions389159 -Node: Pattern Overview390279 -Node: Regexp Patterns391958 -Node: Expression Patterns392501 -Node: Ranges396281 -Node: BEGIN/END399388 -Node: Using BEGIN/END400149 -Ref: Using BEGIN/END-Footnote-1402885 -Node: I/O And BEGIN/END402991 -Node: BEGINFILE/ENDFILE405306 -Node: Empty408203 -Node: Using Shell Variables408520 -Node: Action Overview410793 -Node: Statements413119 -Node: If Statement414967 -Node: While Statement416462 -Node: Do Statement418490 -Node: For Statement419638 -Node: Switch Statement422796 -Node: Break Statement425178 -Node: Continue Statement427271 -Node: Next Statement429098 -Node: Nextfile Statement431479 -Node: Exit Statement434107 -Node: Built-in Variables436518 -Node: User-modified437651 -Ref: User-modified-Footnote-1445285 -Node: Auto-set445347 -Ref: Auto-set-Footnote-1459580 -Ref: Auto-set-Footnote-2459785 -Node: ARGC and ARGV459841 -Node: Pattern Action Summary464059 -Node: Arrays466492 -Node: Array Basics467821 -Node: Array Intro468665 -Ref: figure-array-elements470602 -Ref: Array Intro-Footnote-1473225 -Node: Reference to Elements473353 -Node: Assigning Elements475815 -Node: Array Example476306 -Node: Scanning an Array478065 -Node: Controlling Scanning481088 -Ref: Controlling Scanning-Footnote-1486482 -Node: Numeric Array Subscripts486798 -Node: Uninitialized Subscripts488983 -Node: Delete490600 -Ref: Delete-Footnote-1493349 -Node: Multidimensional493406 -Node: Multiscanning496503 -Node: Arrays of Arrays498092 -Node: Arrays Summary502846 -Node: Functions504937 -Node: Built-in505976 -Node: Calling Built-in507054 -Node: Numeric Functions509049 -Ref: Numeric Functions-Footnote-1513867 -Ref: Numeric Functions-Footnote-2514224 -Ref: Numeric Functions-Footnote-3514272 -Node: String Functions514544 -Ref: String Functions-Footnote-1538045 -Ref: String Functions-Footnote-2538174 -Ref: String Functions-Footnote-3538422 -Node: Gory Details538509 -Ref: table-sub-escapes540290 -Ref: table-sub-proposed541805 -Ref: table-posix-sub543167 -Ref: table-gensub-escapes544704 -Ref: Gory Details-Footnote-1545537 -Node: I/O Functions545688 -Ref: I/O Functions-Footnote-1552924 -Node: Time Functions553071 -Ref: Time Functions-Footnote-1563580 -Ref: Time Functions-Footnote-2563648 -Ref: Time Functions-Footnote-3563806 -Ref: Time Functions-Footnote-4563917 -Ref: Time Functions-Footnote-5564029 -Ref: Time Functions-Footnote-6564256 -Node: Bitwise Functions564522 -Ref: table-bitwise-ops565084 -Ref: Bitwise Functions-Footnote-1569412 -Node: Type Functions569584 -Node: I18N Functions570736 -Node: User-defined572383 -Node: Definition Syntax573188 -Ref: Definition Syntax-Footnote-1578847 -Node: Function Example578918 -Ref: Function Example-Footnote-1581839 -Node: Function Caveats581861 -Node: Calling A Function582379 -Node: Variable Scope583337 -Node: Pass By Value/Reference586330 -Node: Return Statement589827 -Node: Dynamic Typing592806 -Node: Indirect Calls593735 -Ref: Indirect Calls-Footnote-1603600 -Node: Functions Summary603728 -Node: Library Functions606430 -Ref: Library Functions-Footnote-1610038 -Ref: Library Functions-Footnote-2610181 -Node: Library Names610352 -Ref: Library Names-Footnote-1613810 -Ref: Library Names-Footnote-2614033 -Node: General Functions614119 -Node: Strtonum Function615222 -Node: Assert Function618244 -Node: Round Function621568 -Node: Cliff Random Function623109 -Node: Ordinal Functions624125 -Ref: Ordinal Functions-Footnote-1627188 -Ref: Ordinal Functions-Footnote-2627440 -Node: Join Function627651 -Ref: Join Function-Footnote-1629421 -Node: Getlocaltime Function629621 -Node: Readfile Function633365 -Node: Shell Quoting635337 -Node: Data File Management636738 -Node: Filetrans Function637370 -Node: Rewind Function641466 -Node: File Checking642852 -Ref: File Checking-Footnote-1644185 -Node: Empty Files644386 -Node: Ignoring Assigns646365 -Node: Getopt Function647915 -Ref: Getopt Function-Footnote-1659379 -Node: Passwd Functions659579 -Ref: Passwd Functions-Footnote-1668419 -Node: Group Functions668507 -Ref: Group Functions-Footnote-1676404 -Node: Walking Arrays676609 -Node: Library Functions Summary679615 -Node: Library Exercises681017 -Node: Sample Programs682297 -Node: Running Examples683067 -Node: Clones683795 -Node: Cut Program685019 -Node: Egrep Program694739 -Ref: Egrep Program-Footnote-1702242 -Node: Id Program702352 -Node: Split Program706028 -Ref: Split Program-Footnote-1709482 -Node: Tee Program709610 -Node: Uniq Program712399 -Node: Wc Program719818 -Ref: Wc Program-Footnote-1724068 -Node: Miscellaneous Programs724162 -Node: Dupword Program725375 -Node: Alarm Program727406 -Node: Translate Program732211 -Ref: Translate Program-Footnote-1736774 -Node: Labels Program737044 -Ref: Labels Program-Footnote-1740395 -Node: Word Sorting740479 -Node: History Sorting744549 -Node: Extract Program746384 -Node: Simple Sed753908 -Node: Igawk Program756978 -Ref: Igawk Program-Footnote-1771304 -Ref: Igawk Program-Footnote-2771505 -Ref: Igawk Program-Footnote-3771627 -Node: Anagram Program771742 -Node: Signature Program774803 -Node: Programs Summary776050 -Node: Programs Exercises777271 -Ref: Programs Exercises-Footnote-1781402 -Node: Advanced Features781493 -Node: Nondecimal Data783475 -Node: Array Sorting785065 -Node: Controlling Array Traversal785765 -Ref: Controlling Array Traversal-Footnote-1794131 -Node: Array Sorting Functions794249 -Ref: Array Sorting Functions-Footnote-1798135 -Node: Two-way I/O798331 -Ref: Two-way I/O-Footnote-1803276 -Ref: Two-way I/O-Footnote-2803462 -Node: TCP/IP Networking803544 -Node: Profiling806416 -Node: Advanced Features Summary814687 -Node: Internationalization816620 -Node: I18N and L10N818100 -Node: Explaining gettext818786 -Ref: Explaining gettext-Footnote-1823811 -Ref: Explaining gettext-Footnote-2823995 -Node: Programmer i18n824160 -Ref: Programmer i18n-Footnote-1829036 -Node: Translator i18n829085 -Node: String Extraction829879 -Ref: String Extraction-Footnote-1831010 -Node: Printf Ordering831096 -Ref: Printf Ordering-Footnote-1833882 -Node: I18N Portability833946 -Ref: I18N Portability-Footnote-1836402 -Node: I18N Example836465 -Ref: I18N Example-Footnote-1839268 -Node: Gawk I18N839340 -Node: I18N Summary839984 -Node: Debugger841324 -Node: Debugging842346 -Node: Debugging Concepts842787 -Node: Debugging Terms844597 -Node: Awk Debugging847169 -Node: Sample Debugging Session848075 -Node: Debugger Invocation848609 -Node: Finding The Bug849994 -Node: List of Debugger Commands856473 -Node: Breakpoint Control857805 -Node: Debugger Execution Control861482 -Node: Viewing And Changing Data864841 -Node: Execution Stack868217 -Node: Debugger Info869852 -Node: Miscellaneous Debugger Commands873897 -Node: Readline Support878898 -Node: Limitations879792 -Node: Debugging Summary881907 -Node: Arbitrary Precision Arithmetic883081 -Node: Computer Arithmetic884497 -Ref: table-numeric-ranges888074 -Ref: Computer Arithmetic-Footnote-1888598 -Node: Math Definitions888655 -Ref: table-ieee-formats891950 -Ref: Math Definitions-Footnote-1892554 -Node: MPFR features892659 -Node: FP Math Caution894330 -Ref: FP Math Caution-Footnote-1895380 -Node: Inexactness of computations895749 -Node: Inexact representation896708 -Node: Comparing FP Values898066 -Node: Errors accumulate899148 -Node: Getting Accuracy900580 -Node: Try To Round903284 -Node: Setting precision904183 -Ref: table-predefined-precision-strings904867 -Node: Setting the rounding mode906696 -Ref: table-gawk-rounding-modes907060 -Ref: Setting the rounding mode-Footnote-1910512 -Node: Arbitrary Precision Integers910691 -Ref: Arbitrary Precision Integers-Footnote-1915589 -Node: POSIX Floating Point Problems915738 -Ref: POSIX Floating Point Problems-Footnote-1919617 -Node: Floating point summary919655 -Node: Dynamic Extensions921842 -Node: Extension Intro923394 -Node: Plugin License924659 -Node: Extension Mechanism Outline925456 -Ref: figure-load-extension925884 -Ref: figure-register-new-function927364 -Ref: figure-call-new-function928368 -Node: Extension API Description930355 -Node: Extension API Functions Introduction931889 -Node: General Data Types936758 -Ref: General Data Types-Footnote-1942658 -Node: Memory Allocation Functions942957 -Ref: Memory Allocation Functions-Footnote-1945796 -Node: Constructor Functions945895 -Node: Registration Functions947634 -Node: Extension Functions948319 -Node: Exit Callback Functions950616 -Node: Extension Version String951864 -Node: Input Parsers952527 -Node: Output Wrappers962402 -Node: Two-way processors966915 -Node: Printing Messages969178 -Ref: Printing Messages-Footnote-1970254 -Node: Updating `ERRNO'970406 -Node: Requesting Values971146 -Ref: table-value-types-returned971873 -Node: Accessing Parameters972830 -Node: Symbol Table Access974064 -Node: Symbol table by name974578 -Node: Symbol table by cookie976598 -Ref: Symbol table by cookie-Footnote-1980743 -Node: Cached values980806 -Ref: Cached values-Footnote-1984302 -Node: Array Manipulation984393 -Ref: Array Manipulation-Footnote-1985483 -Node: Array Data Types985520 -Ref: Array Data Types-Footnote-1988175 -Node: Array Functions988267 -Node: Flattening Arrays992126 -Node: Creating Arrays999028 -Node: Redirection API1003799 -Node: Extension API Variables1006624 -Node: Extension Versioning1007257 -Node: Extension API Informational Variables1009148 -Node: Extension API Boilerplate1010213 -Node: Finding Extensions1014022 -Node: Extension Example1014582 -Node: Internal File Description1015354 -Node: Internal File Ops1019421 -Ref: Internal File Ops-Footnote-11031172 -Node: Using Internal File Ops1031312 -Ref: Using Internal File Ops-Footnote-11033695 -Node: Extension Samples1033968 -Node: Extension Sample File Functions1035496 -Node: Extension Sample Fnmatch1043177 -Node: Extension Sample Fork1044665 -Node: Extension Sample Inplace1045880 -Node: Extension Sample Ord1047966 -Node: Extension Sample Readdir1048802 -Ref: table-readdir-file-types1049679 -Node: Extension Sample Revout1050490 -Node: Extension Sample Rev2way1051079 -Node: Extension Sample Read write array1051819 -Node: Extension Sample Readfile1053759 -Node: Extension Sample Time1054854 -Node: Extension Sample API Tests1056202 -Node: gawkextlib1056693 -Node: Extension summary1059371 -Node: Extension Exercises1063060 -Node: Language History1064556 -Node: V7/SVR3.11066212 -Node: SVR41068365 -Node: POSIX1069799 -Node: BTL1071180 -Node: POSIX/GNU1071911 -Node: Feature History1077747 -Node: Common Extensions1091541 -Node: Ranges and Locales1092913 -Ref: Ranges and Locales-Footnote-11097532 -Ref: Ranges and Locales-Footnote-21097559 -Ref: Ranges and Locales-Footnote-31097794 -Node: Contributors1098015 -Node: History summary1103555 -Node: Installation1104934 -Node: Gawk Distribution1105880 -Node: Getting1106364 -Node: Extracting1107187 -Node: Distribution contents1108824 -Node: Unix Installation1114926 -Node: Quick Installation1115609 -Node: Shell Startup Files1118020 -Node: Additional Configuration Options1119099 -Node: Configuration Philosophy1120903 -Node: Non-Unix Installation1123272 -Node: PC Installation1123730 -Node: PC Binary Installation1125050 -Node: PC Compiling1126898 -Ref: PC Compiling-Footnote-11129919 -Node: PC Testing1130028 -Node: PC Using1131204 -Node: Cygwin1135319 -Node: MSYS1136089 -Node: VMS Installation1136590 -Node: VMS Compilation1137382 -Ref: VMS Compilation-Footnote-11138611 -Node: VMS Dynamic Extensions1138669 -Node: VMS Installation Details1140353 -Node: VMS Running1142604 -Node: VMS GNV1145444 -Node: VMS Old Gawk1146179 -Node: Bugs1146649 -Node: Other Versions1150538 -Node: Installation summary1156972 -Node: Notes1158031 -Node: Compatibility Mode1158896 -Node: Additions1159678 -Node: Accessing The Source1160603 -Node: Adding Code1162038 -Node: New Ports1168195 -Node: Derived Files1172677 -Ref: Derived Files-Footnote-11178152 -Ref: Derived Files-Footnote-21178186 -Ref: Derived Files-Footnote-31178782 -Node: Future Extensions1178896 -Node: Implementation Limitations1179502 -Node: Extension Design1180750 -Node: Old Extension Problems1181904 -Ref: Old Extension Problems-Footnote-11183421 -Node: Extension New Mechanism Goals1183478 -Ref: Extension New Mechanism Goals-Footnote-11186838 -Node: Extension Other Design Decisions1187027 -Node: Extension Future Growth1189135 -Node: Old Extension Mechanism1189971 -Node: Notes summary1191733 -Node: Basic Concepts1192919 -Node: Basic High Level1193600 -Ref: figure-general-flow1193872 -Ref: figure-process-flow1194471 -Ref: Basic High Level-Footnote-11197700 -Node: Basic Data Typing1197885 -Node: Glossary1201213 -Node: Copying1233142 -Node: GNU Free Documentation License1270698 -Node: Index1295834 +Node: Command-line directories267251 +Node: Input Summary268158 +Node: Input Exercises271543 +Node: Printing272271 +Node: Print274106 +Node: Print Examples275563 +Node: Output Separators278342 +Node: OFMT280360 +Node: Printf281715 +Node: Basic Printf282500 +Node: Control Letters284072 +Node: Format Modifiers288057 +Node: Printf Examples294063 +Node: Redirection296549 +Node: Special FD303387 +Ref: Special FD-Footnote-1306553 +Node: Special Files306627 +Node: Other Inherited Files307244 +Node: Special Network308244 +Node: Special Caveats309106 +Node: Close Files And Pipes310055 +Ref: Close Files And Pipes-Footnote-1317240 +Ref: Close Files And Pipes-Footnote-2317388 +Node: Nonfatal317538 +Node: Output Summary319863 +Node: Output Exercises321084 +Node: Expressions321764 +Node: Values322953 +Node: Constants323630 +Node: Scalar Constants324321 +Ref: Scalar Constants-Footnote-1325183 +Node: Nondecimal-numbers325433 +Node: Regexp Constants328443 +Node: Using Constant Regexps328969 +Node: Variables332132 +Node: Using Variables332789 +Node: Assignment Options334700 +Node: Conversion336575 +Node: Strings And Numbers337099 +Ref: Strings And Numbers-Footnote-1340164 +Node: Locale influences conversions340273 +Ref: table-locale-affects343019 +Node: All Operators343611 +Node: Arithmetic Ops344240 +Node: Concatenation346745 +Ref: Concatenation-Footnote-1349564 +Node: Assignment Ops349671 +Ref: table-assign-ops354650 +Node: Increment Ops355960 +Node: Truth Values and Conditions359391 +Node: Truth Values360474 +Node: Typing and Comparison361523 +Node: Variable Typing362339 +Node: Comparison Operators366006 +Ref: table-relational-ops366416 +Node: POSIX String Comparison369911 +Ref: POSIX String Comparison-Footnote-1370983 +Node: Boolean Ops371122 +Ref: Boolean Ops-Footnote-1375600 +Node: Conditional Exp375691 +Node: Function Calls377429 +Node: Precedence381309 +Node: Locales384969 +Node: Expressions Summary386601 +Node: Patterns and Actions389172 +Node: Pattern Overview390292 +Node: Regexp Patterns391971 +Node: Expression Patterns392514 +Node: Ranges396294 +Node: BEGIN/END399401 +Node: Using BEGIN/END400162 +Ref: Using BEGIN/END-Footnote-1402898 +Node: I/O And BEGIN/END403004 +Node: BEGINFILE/ENDFILE405319 +Node: Empty408216 +Node: Using Shell Variables408533 +Node: Action Overview410806 +Node: Statements413132 +Node: If Statement414980 +Node: While Statement416475 +Node: Do Statement418503 +Node: For Statement419651 +Node: Switch Statement422809 +Node: Break Statement425191 +Node: Continue Statement427284 +Node: Next Statement429111 +Node: Nextfile Statement431492 +Node: Exit Statement434120 +Node: Built-in Variables436531 +Node: User-modified437664 +Ref: User-modified-Footnote-1445298 +Node: Auto-set445360 +Ref: Auto-set-Footnote-1459593 +Ref: Auto-set-Footnote-2459798 +Node: ARGC and ARGV459854 +Node: Pattern Action Summary464072 +Node: Arrays466505 +Node: Array Basics467834 +Node: Array Intro468678 +Ref: figure-array-elements470615 +Ref: Array Intro-Footnote-1473238 +Node: Reference to Elements473366 +Node: Assigning Elements475828 +Node: Array Example476319 +Node: Scanning an Array478078 +Node: Controlling Scanning481101 +Ref: Controlling Scanning-Footnote-1486495 +Node: Numeric Array Subscripts486811 +Node: Uninitialized Subscripts488996 +Node: Delete490613 +Ref: Delete-Footnote-1493362 +Node: Multidimensional493419 +Node: Multiscanning496516 +Node: Arrays of Arrays498105 +Node: Arrays Summary502859 +Node: Functions504950 +Node: Built-in505989 +Node: Calling Built-in507067 +Node: Numeric Functions509062 +Ref: Numeric Functions-Footnote-1513880 +Ref: Numeric Functions-Footnote-2514237 +Ref: Numeric Functions-Footnote-3514285 +Node: String Functions514557 +Ref: String Functions-Footnote-1538058 +Ref: String Functions-Footnote-2538187 +Ref: String Functions-Footnote-3538435 +Node: Gory Details538522 +Ref: table-sub-escapes540303 +Ref: table-sub-proposed541818 +Ref: table-posix-sub543180 +Ref: table-gensub-escapes544717 +Ref: Gory Details-Footnote-1545550 +Node: I/O Functions545701 +Ref: I/O Functions-Footnote-1552937 +Node: Time Functions553084 +Ref: Time Functions-Footnote-1563593 +Ref: Time Functions-Footnote-2563661 +Ref: Time Functions-Footnote-3563819 +Ref: Time Functions-Footnote-4563930 +Ref: Time Functions-Footnote-5564042 +Ref: Time Functions-Footnote-6564269 +Node: Bitwise Functions564535 +Ref: table-bitwise-ops565097 +Ref: Bitwise Functions-Footnote-1569425 +Node: Type Functions569597 +Node: I18N Functions570749 +Node: User-defined572396 +Node: Definition Syntax573201 +Ref: Definition Syntax-Footnote-1578860 +Node: Function Example578931 +Ref: Function Example-Footnote-1581852 +Node: Function Caveats581874 +Node: Calling A Function582392 +Node: Variable Scope583350 +Node: Pass By Value/Reference586343 +Node: Return Statement589840 +Node: Dynamic Typing592819 +Node: Indirect Calls593748 +Ref: Indirect Calls-Footnote-1603613 +Node: Functions Summary603741 +Node: Library Functions606443 +Ref: Library Functions-Footnote-1610051 +Ref: Library Functions-Footnote-2610194 +Node: Library Names610365 +Ref: Library Names-Footnote-1613823 +Ref: Library Names-Footnote-2614046 +Node: General Functions614132 +Node: Strtonum Function615235 +Node: Assert Function618257 +Node: Round Function621581 +Node: Cliff Random Function623122 +Node: Ordinal Functions624138 +Ref: Ordinal Functions-Footnote-1627201 +Ref: Ordinal Functions-Footnote-2627453 +Node: Join Function627664 +Ref: Join Function-Footnote-1629434 +Node: Getlocaltime Function629634 +Node: Readfile Function633378 +Node: Shell Quoting635350 +Node: Data File Management636751 +Node: Filetrans Function637383 +Node: Rewind Function641479 +Node: File Checking642865 +Ref: File Checking-Footnote-1644198 +Node: Empty Files644399 +Node: Ignoring Assigns646378 +Node: Getopt Function647928 +Ref: Getopt Function-Footnote-1659392 +Node: Passwd Functions659592 +Ref: Passwd Functions-Footnote-1668432 +Node: Group Functions668520 +Ref: Group Functions-Footnote-1676417 +Node: Walking Arrays676622 +Node: Library Functions Summary679628 +Node: Library Exercises681030 +Node: Sample Programs682310 +Node: Running Examples683080 +Node: Clones683808 +Node: Cut Program685032 +Node: Egrep Program694752 +Ref: Egrep Program-Footnote-1702255 +Node: Id Program702365 +Node: Split Program706041 +Ref: Split Program-Footnote-1709495 +Node: Tee Program709623 +Node: Uniq Program712412 +Node: Wc Program719831 +Ref: Wc Program-Footnote-1724081 +Node: Miscellaneous Programs724175 +Node: Dupword Program725388 +Node: Alarm Program727419 +Node: Translate Program732224 +Ref: Translate Program-Footnote-1736787 +Node: Labels Program737057 +Ref: Labels Program-Footnote-1740408 +Node: Word Sorting740492 +Node: History Sorting744562 +Node: Extract Program746397 +Node: Simple Sed753921 +Node: Igawk Program756991 +Ref: Igawk Program-Footnote-1771317 +Ref: Igawk Program-Footnote-2771518 +Ref: Igawk Program-Footnote-3771640 +Node: Anagram Program771755 +Node: Signature Program774816 +Node: Programs Summary776063 +Node: Programs Exercises777284 +Ref: Programs Exercises-Footnote-1781415 +Node: Advanced Features781506 +Node: Nondecimal Data783488 +Node: Array Sorting785078 +Node: Controlling Array Traversal785778 +Ref: Controlling Array Traversal-Footnote-1794144 +Node: Array Sorting Functions794262 +Ref: Array Sorting Functions-Footnote-1798148 +Node: Two-way I/O798344 +Ref: Two-way I/O-Footnote-1803289 +Ref: Two-way I/O-Footnote-2803475 +Node: TCP/IP Networking803557 +Node: Profiling806429 +Node: Advanced Features Summary814700 +Node: Internationalization816633 +Node: I18N and L10N818113 +Node: Explaining gettext818799 +Ref: Explaining gettext-Footnote-1823824 +Ref: Explaining gettext-Footnote-2824008 +Node: Programmer i18n824173 +Ref: Programmer i18n-Footnote-1829049 +Node: Translator i18n829098 +Node: String Extraction829892 +Ref: String Extraction-Footnote-1831023 +Node: Printf Ordering831109 +Ref: Printf Ordering-Footnote-1833895 +Node: I18N Portability833959 +Ref: I18N Portability-Footnote-1836415 +Node: I18N Example836478 +Ref: I18N Example-Footnote-1839281 +Node: Gawk I18N839353 +Node: I18N Summary839997 +Node: Debugger841337 +Node: Debugging842359 +Node: Debugging Concepts842800 +Node: Debugging Terms844610 +Node: Awk Debugging847182 +Node: Sample Debugging Session848088 +Node: Debugger Invocation848622 +Node: Finding The Bug850007 +Node: List of Debugger Commands856486 +Node: Breakpoint Control857818 +Node: Debugger Execution Control861495 +Node: Viewing And Changing Data864854 +Node: Execution Stack868230 +Node: Debugger Info869865 +Node: Miscellaneous Debugger Commands873910 +Node: Readline Support878911 +Node: Limitations879805 +Node: Debugging Summary881920 +Node: Arbitrary Precision Arithmetic883094 +Node: Computer Arithmetic884510 +Ref: table-numeric-ranges888087 +Ref: Computer Arithmetic-Footnote-1888611 +Node: Math Definitions888668 +Ref: table-ieee-formats891963 +Ref: Math Definitions-Footnote-1892567 +Node: MPFR features892672 +Node: FP Math Caution894343 +Ref: FP Math Caution-Footnote-1895393 +Node: Inexactness of computations895762 +Node: Inexact representation896721 +Node: Comparing FP Values898079 +Node: Errors accumulate899161 +Node: Getting Accuracy900593 +Node: Try To Round903297 +Node: Setting precision904196 +Ref: table-predefined-precision-strings904880 +Node: Setting the rounding mode906709 +Ref: table-gawk-rounding-modes907073 +Ref: Setting the rounding mode-Footnote-1910525 +Node: Arbitrary Precision Integers910704 +Ref: Arbitrary Precision Integers-Footnote-1915602 +Node: POSIX Floating Point Problems915751 +Ref: POSIX Floating Point Problems-Footnote-1919630 +Node: Floating point summary919668 +Node: Dynamic Extensions921855 +Node: Extension Intro923407 +Node: Plugin License924672 +Node: Extension Mechanism Outline925469 +Ref: figure-load-extension925897 +Ref: figure-register-new-function927377 +Ref: figure-call-new-function928381 +Node: Extension API Description930368 +Node: Extension API Functions Introduction931902 +Node: General Data Types936771 +Ref: General Data Types-Footnote-1942671 +Node: Memory Allocation Functions942970 +Ref: Memory Allocation Functions-Footnote-1945809 +Node: Constructor Functions945908 +Node: Registration Functions947647 +Node: Extension Functions948332 +Node: Exit Callback Functions950629 +Node: Extension Version String951877 +Node: Input Parsers952540 +Node: Output Wrappers962415 +Node: Two-way processors966928 +Node: Printing Messages969191 +Ref: Printing Messages-Footnote-1970267 +Node: Updating `ERRNO'970419 +Node: Requesting Values971159 +Ref: table-value-types-returned971886 +Node: Accessing Parameters972843 +Node: Symbol Table Access974077 +Node: Symbol table by name974591 +Node: Symbol table by cookie976611 +Ref: Symbol table by cookie-Footnote-1980756 +Node: Cached values980819 +Ref: Cached values-Footnote-1984315 +Node: Array Manipulation984406 +Ref: Array Manipulation-Footnote-1985496 +Node: Array Data Types985533 +Ref: Array Data Types-Footnote-1988188 +Node: Array Functions988280 +Node: Flattening Arrays992139 +Node: Creating Arrays999041 +Node: Redirection API1003812 +Node: Extension API Variables1006637 +Node: Extension Versioning1007270 +Node: Extension API Informational Variables1009161 +Node: Extension API Boilerplate1010226 +Node: Finding Extensions1014035 +Node: Extension Example1014595 +Node: Internal File Description1015367 +Node: Internal File Ops1019434 +Ref: Internal File Ops-Footnote-11031185 +Node: Using Internal File Ops1031325 +Ref: Using Internal File Ops-Footnote-11033708 +Node: Extension Samples1033981 +Node: Extension Sample File Functions1035509 +Node: Extension Sample Fnmatch1043190 +Node: Extension Sample Fork1044678 +Node: Extension Sample Inplace1045893 +Node: Extension Sample Ord1047979 +Node: Extension Sample Readdir1048815 +Ref: table-readdir-file-types1049692 +Node: Extension Sample Revout1050503 +Node: Extension Sample Rev2way1051092 +Node: Extension Sample Read write array1051832 +Node: Extension Sample Readfile1053772 +Node: Extension Sample Time1054867 +Node: Extension Sample API Tests1056215 +Node: gawkextlib1056706 +Node: Extension summary1059407 +Node: Extension Exercises1063096 +Node: Language History1064592 +Node: V7/SVR3.11066248 +Node: SVR41068401 +Node: POSIX1069835 +Node: BTL1071216 +Node: POSIX/GNU1071947 +Node: Feature History1077783 +Node: Common Extensions1091577 +Node: Ranges and Locales1092949 +Ref: Ranges and Locales-Footnote-11097568 +Ref: Ranges and Locales-Footnote-21097595 +Ref: Ranges and Locales-Footnote-31097830 +Node: Contributors1098051 +Node: History summary1103591 +Node: Installation1104970 +Node: Gawk Distribution1105916 +Node: Getting1106400 +Node: Extracting1107223 +Node: Distribution contents1108860 +Node: Unix Installation1114962 +Node: Quick Installation1115645 +Node: Shell Startup Files1118056 +Node: Additional Configuration Options1119135 +Node: Configuration Philosophy1120939 +Node: Non-Unix Installation1123308 +Node: PC Installation1123766 +Node: PC Binary Installation1125086 +Node: PC Compiling1126934 +Ref: PC Compiling-Footnote-11129955 +Node: PC Testing1130064 +Node: PC Using1131240 +Node: Cygwin1135355 +Node: MSYS1136125 +Node: VMS Installation1136626 +Node: VMS Compilation1137418 +Ref: VMS Compilation-Footnote-11138647 +Node: VMS Dynamic Extensions1138705 +Node: VMS Installation Details1140389 +Node: VMS Running1142640 +Node: VMS GNV1145480 +Node: VMS Old Gawk1146215 +Node: Bugs1146685 +Node: Other Versions1150574 +Node: Installation summary1157008 +Node: Notes1158067 +Node: Compatibility Mode1158932 +Node: Additions1159714 +Node: Accessing The Source1160639 +Node: Adding Code1162074 +Node: New Ports1168231 +Node: Derived Files1172713 +Ref: Derived Files-Footnote-11178188 +Ref: Derived Files-Footnote-21178222 +Ref: Derived Files-Footnote-31178818 +Node: Future Extensions1178932 +Node: Implementation Limitations1179538 +Node: Extension Design1180786 +Node: Old Extension Problems1181940 +Ref: Old Extension Problems-Footnote-11183457 +Node: Extension New Mechanism Goals1183514 +Ref: Extension New Mechanism Goals-Footnote-11186874 +Node: Extension Other Design Decisions1187063 +Node: Extension Future Growth1189171 +Node: Old Extension Mechanism1190007 +Node: Notes summary1191769 +Node: Basic Concepts1192955 +Node: Basic High Level1193636 +Ref: figure-general-flow1193908 +Ref: figure-process-flow1194507 +Ref: Basic High Level-Footnote-11197736 +Node: Basic Data Typing1197921 +Node: Glossary1201249 +Node: Copying1233178 +Node: GNU Free Documentation License1270734 +Node: Index1295870  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index e9d987f0..e0b44fa1 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -8807,6 +8807,7 @@ PROCINFO["@var{input_name}", "RETRY"] = 1 @end example When this element exists, @command{gawk} checks the value of the system +(C language) @code{errno} variable when an I/O error occurs. If @code{errno} indicates a subsequent I/O attempt may succeed, @code{getline} instead returns @minus{}2 and @@ -35284,6 +35285,11 @@ As of this writing, there are seven extensions: @item GD graphics library extension +@item +MPFR library extension +(this provides access to a number of MPFR functions that @command{gawk}'s +native MPFR support does not) + @item PDF extension @@ -35291,12 +35297,10 @@ PDF extension PostgreSQL extension @item -MPFR library extension -(this provides access to a number of MPFR functions that @command{gawk}'s -native MPFR support does not) +Redis extension @item -Redis extension +Select extension @item XML parser extension, using the @uref{http://expat.sourceforge.net, Expat} diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 178444a4..f8642fca 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -8407,6 +8407,7 @@ PROCINFO["@var{input_name}", "RETRY"] = 1 @end example When this element exists, @command{gawk} checks the value of the system +(C language) @code{errno} variable when an I/O error occurs. If @code{errno} indicates a subsequent I/O attempt may succeed, @code{getline} instead returns @minus{}2 and @@ -34375,6 +34376,11 @@ As of this writing, there are seven extensions: @item GD graphics library extension +@item +MPFR library extension +(this provides access to a number of MPFR functions that @command{gawk}'s +native MPFR support does not) + @item PDF extension @@ -34382,12 +34388,10 @@ PDF extension PostgreSQL extension @item -MPFR library extension -(this provides access to a number of MPFR functions that @command{gawk}'s -native MPFR support does not) +Redis extension @item -Redis extension +Select extension @item XML parser extension, using the @uref{http://expat.sourceforge.net, Expat} -- cgit v1.2.3 From a47af3141cf4a6b43e20db872e2b45ff9abb071f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 31 Mar 2015 22:07:53 +0300 Subject: Get indirect calls working! --- ChangeLog | 9 ++++ awk.h | 4 +- builtin.c | 68 ++++++++++++++++++++++++++- indirectbuitin.awk | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++--- interpret.h | 6 ++- node.c | 9 ---- 6 files changed, 207 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47ef45ee..4b7766d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-03-31 Arnold D. Robbins + + * awk.h (call_sub): Renamed from call_sub_func. + (call_match, call_split_func): Declare. + * builtin.c (call_sub): Renamed from call_sub_func. + (call_match, call_split_func): New functions. + * interpret.h (r_interpret): Call new functions as appropriate. + * node.c (r_unref): Revert change to handle Node_regex, not needed. + 2015-03-31 Arnold D. Robbins * awk.h (r_get_field): Declare. diff --git a/awk.h b/awk.h index 1205401b..4ac32e4a 100644 --- a/awk.h +++ b/awk.h @@ -1361,7 +1361,9 @@ extern NODE *do_rand(int nargs); extern NODE *do_srand(int nargs); extern NODE *do_match(int nargs); extern NODE *do_sub(int nargs, unsigned int flags); -extern NODE *call_sub_func(const char *name, int nargs); +extern NODE *call_sub(const char *name, int nargs); +extern NODE *call_match(int nargs); +extern NODE *call_split_func(const char *name, int nargs); extern NODE *format_tree(const char *, size_t, NODE **, long); extern NODE *do_lshift(int nargs); extern NODE *do_rshift(int nargs); diff --git a/builtin.c b/builtin.c index c222ce78..dde3121c 100644 --- a/builtin.c +++ b/builtin.c @@ -2994,10 +2994,10 @@ done: return make_number((AWKNUM) matches); } -/* call_sub_func --- call do_sub indirectly */ +/* call_sub --- call do_sub indirectly */ NODE * -call_sub_func(const char *name, int nargs) +call_sub(const char *name, int nargs) { unsigned int flags = 0; NODE *regex, *replace, *glob_flag; @@ -3070,6 +3070,70 @@ call_sub_func(const char *name, int nargs) return result; } +/* call_match --- call do_match indirectly */ + +NODE * +call_match(int nargs) +{ + NODE *regex, *text, *array; + NODE *result; + + regex = text = array = NULL; + if (nargs == 3) + array = POP(); + regex = POP(); + + /* Don't need to pop the string just to push it back ... */ + + regex = make_regnode(Node_regex, regex); + PUSH(regex); + + if (array) + PUSH(array); + + result = do_match(nargs); + return result; +} + +/* call_split_func --- call do_split or do_pat_split indirectly */ + +NODE * +call_split_func(const char *name, int nargs) +{ + NODE *regex, *seps; + NODE *result; + + regex = seps = NULL; + if (nargs < 2) + fatal(_("indirect call to %s requires at least two arguments"), + name); + + if (nargs == 4) + seps = POP(); + + if (nargs >= 3) { + regex = POP_STRING(); + regex = make_regnode(Node_regex, regex); + } else { + if (name[0] == 's') { + regex = make_regnode(Node_regex, FS_node->var_value); + regex->re_flags |= FS_DFLT; + } else + regex = make_regnode(Node_regex, FPAT_node->var_value); + nargs++; + } + + /* Don't need to pop the string or the data array */ + + PUSH(regex); + + if (seps) + PUSH(seps); + + result = (name[0] == 's') ? do_split(nargs) : do_patsplit(nargs); + + return result; +} /* make_integer - Convert an integer to a number node. */ diff --git a/indirectbuitin.awk b/indirectbuitin.awk index de3d5ccd..4d5291d2 100644 --- a/indirectbuitin.awk +++ b/indirectbuitin.awk @@ -2,9 +2,11 @@ function print_result(category, fname, builtin_result, indirect_result) { if (builtin_result == indirect_result) printf("%s: %s: pass\n", category, fname) - else + else { printf("%s: %s: fail: builtin: %s \tindirect: %s\n", category, fname, builtin_result, indirect_result) + exit 1 + } } @@ -189,14 +191,129 @@ BEGIN { # regexp functions -# fun = "match" -# print_result("regexp", fun, b1, i1) + fun = "match" + b1 = match("o+", "fooob") + rstart = RSTART + rlength = RLENGTH + i1 = @fun("o+", "fooob") + print_result("regexp", fun, b1, i1) + if (rstart != RSTART) { + printf("match: failure: biRSTART (%d) != iRSTART (%d)\n", + rstart, RSTART) + exit 1 + } + if (rlength != RLENGTH) { + printf("match: failure: biRLENGTH (%d) != iRLENGTH (%d)\n", + rlength, RLENGTH) + exit 1 + } -# fun = "patsplit" -# print_result("regexp", fun, b1, i1) + ############## start patsplit ############## + fun = "patsplit" + delete data + delete data2 + delete seps + delete seps2 + b1 = patsplit("a:b:c:d", data, ":", seps) + i1 = @fun("a:b:c:d", data2, ":", seps2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + for (i in seps) { + if ((! (i in seps2)) || seps[i] != seps2[i]) { + printf("patsplit1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n", + i, seps[i], i, seps2[i]) + exit 1 + } + } + + fun = "patsplit" + delete data + delete data2 + b1 = patsplit("a:b:c:d", data, ":") + i1 = @fun("a:b:c:d", data2, ":") + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } -# fun = "split" -# print_result("regexp", fun, b1, i1) + fun = "patsplit" + delete data + delete data2 + FPAT = "[a-z]+" + b1 = patsplit("a b c d", data) + i1 = @fun("a b c d", data2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + ############## end patsplit ############## + + ############## start split ############## + fun = "split" + delete data + delete data2 + delete seps + delete seps2 + b1 = split("a:b:c:d", data, ":", seps) + i1 = @fun("a:b:c:d", data2, ":", seps2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + for (i in seps) { + if ((! (i in seps2)) || seps[i] != seps2[i]) { + printf("split1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n", + i, seps[i], i, seps2[i]) + exit 1 + } + } + + fun = "split" + delete data + delete data2 + b1 = split("a:b:c:d", data, ":") + i1 = @fun("a:b:c:d", data2, ":") + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + + fun = "split" + delete data + delete data2 + b1 = split("a b c d", data) + i1 = @fun("a b c d", data2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + ############## end split ############## # array functions diff --git a/interpret.h b/interpret.h index f9aa3115..6dce863a 100644 --- a/interpret.h +++ b/interpret.h @@ -1067,7 +1067,11 @@ match_re: /* call it */ if (the_func == (builtin_func_t) do_sub) - r = call_sub_func(t1->stptr, arg_count); + r = call_sub(t1->stptr, arg_count); + else if (the_func == do_match) + r = call_match(arg_count); + else if (the_func == do_split || the_func == do_patsplit) + r = call_split_func(t1->stptr, arg_count); else r = the_func(arg_count); diff --git a/node.c b/node.c index 7a1d99f6..9fd4c7b9 100644 --- a/node.c +++ b/node.c @@ -431,14 +431,6 @@ r_unref(NODE *tmp) #ifdef GAWKDEBUG if (tmp == NULL) return; - if (tmp->type == Node_regex) { -fprintf(stderr, "got here!\n"); fflush(stderr); - if (tmp->re_reg != NULL) - refree(tmp->re_reg); - if (tmp->re_text != NULL) - unref(tmp->re_text); - goto free_the_node; - } if ((tmp->flags & MALLOC) != 0) { if (tmp->valref > 1) { tmp->valref--; @@ -455,7 +447,6 @@ fprintf(stderr, "got here!\n"); fflush(stderr); mpfr_unset(tmp); free_wstr(tmp); -free_the_node: freenode(tmp); } -- cgit v1.2.3 From 67d5cc4c4034f16a2390e30d8e988713e5aedb68 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 31 Mar 2015 22:13:41 +0300 Subject: Add tests for indirect call of builtins. --- indirectbuitin.awk | 371 ----------------------------------------------- test/ChangeLog | 5 + test/Makefile.am | 4 +- test/Makefile.in | 9 +- test/Maketests | 5 + test/indirectbuiltin.awk | 371 +++++++++++++++++++++++++++++++++++++++++++++++ test/indirectbuiltin.ok | 43 ++++++ 7 files changed, 435 insertions(+), 373 deletions(-) delete mode 100644 indirectbuitin.awk create mode 100644 test/indirectbuiltin.awk create mode 100644 test/indirectbuiltin.ok diff --git a/indirectbuitin.awk b/indirectbuitin.awk deleted file mode 100644 index 4d5291d2..00000000 --- a/indirectbuitin.awk +++ /dev/null @@ -1,371 +0,0 @@ -function print_result(category, fname, builtin_result, indirect_result) -{ - if (builtin_result == indirect_result) - printf("%s: %s: pass\n", category, fname) - else { - printf("%s: %s: fail: builtin: %s \tindirect: %s\n", category, fname, - builtin_result, indirect_result) - exit 1 - } -} - - -BEGIN { -# math functions - - fun = "and" - b1 = and(0x11, 0x01) - i1 = @fun(0x11, 0x01) - print_result("math", fun, b1, i1) - - fun = "atan2" - b1 = atan2(-1, 0) - i1 = @fun(-1, 0) - print_result("math", fun, b1, i1) - - fun = "compl" - b1 = compl(0x1111) - i1 = @fun(0x1111) - print_result("math", fun, b1, i1) - - fun = "cos" - b1 = cos(3.1415927 / 4) - i1 = @fun(3.1415927 / 4) - print_result("math", fun, b1, i1) - - fun = "exp" - b1 = exp(2) - i1 = @fun(2) - print_result("math", fun, b1, i1) - - fun = "int" - b1 = int(3.1415927) - i1 = @fun(3.1415927) - print_result("math", fun, b1, i1) - - fun = "log" - b1 = log(10) - i1 = @fun(10) - print_result("math", fun, b1, i1) - - fun = "lshift" - b1 = lshift(1, 2) - i1 = @fun(1, 2) - print_result("math", fun, b1, i1) - - fun = "or" - b1 = or(0x10, 0x01) - i1 = @fun(0x10, 0x01) - print_result("math", fun, b1, i1) - - fun = "rand" - srand(1) - b1 = rand(); - srand(1) - i1 = @fun() - print_result("math", fun, b1, i1) - - fun = "rshift" - b1 = rshift(0x10, 1) - i1 = @fun(0x10, 1) - print_result("math", fun, b1, i1) - - fun = "sin" - b1 = sin(3.1415927 / 4) - i1 = @fun(3.1415927 / 4) - print_result("math", fun, b1, i1) - - fun = "sqrt" - b1 = sqrt(2) - i1 = @fun(2) - print_result("math", fun, b1, i1) - - srand() - fun = "srand" - b1 = srand() - i1 = @fun() - print_result("math", fun, b1, i1) - - fun = "xor" - b1 = xor(0x11, 0x01) - i1 = @fun(0x11, 0x01) - print_result("math", fun, b1, i1) - -# string functions - - fun = "gensub" - b1 = gensub("f", "q", "g", "ff11bb") - i1 = @fun("f", "q", "g", "ff11bb") - print_result("string", fun, b1, i1) - - fun = "gsub" - $0 = "ff11bb" - b1 = gsub("f", "q") - b2 = $0 - $0 = "ff11bb" - i1 = @fun("f", "q") - i2 = $0 - print_result("string", fun, b1, i1) - if (b2 != i2) { - printf("string: %s: fail: $0 (%s) != $0 (%s)\n", - fun, b2, i2) - exit 1 - } - - fun = "index" - b1 = index("hi, how are you", "how") - i1 = @fun("hi, how are you", "how") - print_result("string", fun, b1, i1) - - fun = "dcgettext" - b1 = dcgettext("hello, world") - i1 = @fun("hello, world") - print_result("string", fun, b1, i1) - - fun = "dcngettext" - b1 = dcngettext("hello, world", "howdy", 2) - i1 = @fun("hello, world", "howdy", 2) - print_result("string", fun, b1, i1) - - fun = "length" - b1 = length("hi, how are you") - i1 = @fun("hi, how are you") - print_result("string", fun, b1, i1) - - fun = "sprintf" - b1 = sprintf("%s world", "hello") - i1 = @fun("%s world", "hello") - print_result("string", fun, b1, i1) - - fun = "strtonum" - b1 = strtonum("0xdeadbeef") - i1 = @fun("0xdeadbeef") - print_result("string", fun, b1, i1) - - fun = "sub" - $0 = "ff11bb" - b1 = sub("f", "q") - b2 = $0 - $0 = "ff11bb" - i1 = @fun("f", "q") - i2 = $0 - print_result("string", fun, b1, i1) - if (b2 != i2) { - printf("string: %s: fail: $0 (%s) != $0 (%s)\n", - fun, b2, i2) - exit 1 - } - - fun = "substr" - b1 = substr("0xdeadbeef", 7, 4) - i1 = @fun("0xdeadbeef", 7, 4) - print_result("string", fun, b1, i1) - - fun = "tolower" - b1 = tolower("0xDeAdBeEf") - i1 = @fun("0xDeAdBeEf") - print_result("string", fun, b1, i1) - - fun = "toupper" - b1 = toupper("0xDeAdBeEf") - i1 = @fun("0xDeAdBeEf") - print_result("string", fun, b1, i1) - -# time functions - - fun = "mktime" - b1 = mktime("1990 02 11 12 00 00") - i1 = @fun("1990 02 11 12 00 00") - print_result("time", fun, b1, i1) - - then = b1 - fun = "strftime" - b1 = strftime(PROCINFO["strftime"], then) - i1 = @fun(PROCINFO["strftime"], then) - print_result("time", fun, b1, i1) - - fun = "systime" - b1 = systime() - i1 = @fun() - print_result("time", fun, b1, i1) - -# regexp functions - - fun = "match" - b1 = match("o+", "fooob") - rstart = RSTART - rlength = RLENGTH - i1 = @fun("o+", "fooob") - print_result("regexp", fun, b1, i1) - if (rstart != RSTART) { - printf("match: failure: biRSTART (%d) != iRSTART (%d)\n", - rstart, RSTART) - exit 1 - } - if (rlength != RLENGTH) { - printf("match: failure: biRLENGTH (%d) != iRLENGTH (%d)\n", - rlength, RLENGTH) - exit 1 - } - - ############## start patsplit ############## - fun = "patsplit" - delete data - delete data2 - delete seps - delete seps2 - b1 = patsplit("a:b:c:d", data, ":", seps) - i1 = @fun("a:b:c:d", data2, ":", seps2) - print_result("regexp", fun, b1, i1) - for (i in data) { - if ((! (i in data2)) || data[i] != data2[i]) { - printf("patsplit1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", - i, data[i], i, data2[i]) - exit 1 - } - } - for (i in seps) { - if ((! (i in seps2)) || seps[i] != seps2[i]) { - printf("patsplit1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n", - i, seps[i], i, seps2[i]) - exit 1 - } - } - - fun = "patsplit" - delete data - delete data2 - b1 = patsplit("a:b:c:d", data, ":") - i1 = @fun("a:b:c:d", data2, ":") - print_result("regexp", fun, b1, i1) - for (i in data) { - if ((! (i in data2)) || data[i] != data2[i]) { - printf("patsplit2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", - i, data[i], i, data2[i]) - exit 1 - } - } - - fun = "patsplit" - delete data - delete data2 - FPAT = "[a-z]+" - b1 = patsplit("a b c d", data) - i1 = @fun("a b c d", data2) - print_result("regexp", fun, b1, i1) - for (i in data) { - if ((! (i in data2)) || data[i] != data2[i]) { - printf("patsplit3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", - i, data[i], i, data2[i]) - exit 1 - } - } - ############## end patsplit ############## - - ############## start split ############## - fun = "split" - delete data - delete data2 - delete seps - delete seps2 - b1 = split("a:b:c:d", data, ":", seps) - i1 = @fun("a:b:c:d", data2, ":", seps2) - print_result("regexp", fun, b1, i1) - for (i in data) { - if ((! (i in data2)) || data[i] != data2[i]) { - printf("split1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", - i, data[i], i, data2[i]) - exit 1 - } - } - for (i in seps) { - if ((! (i in seps2)) || seps[i] != seps2[i]) { - printf("split1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n", - i, seps[i], i, seps2[i]) - exit 1 - } - } - - fun = "split" - delete data - delete data2 - b1 = split("a:b:c:d", data, ":") - i1 = @fun("a:b:c:d", data2, ":") - print_result("regexp", fun, b1, i1) - for (i in data) { - if ((! (i in data2)) || data[i] != data2[i]) { - printf("split2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", - i, data[i], i, data2[i]) - exit 1 - } - } - - fun = "split" - delete data - delete data2 - b1 = split("a b c d", data) - i1 = @fun("a b c d", data2) - print_result("regexp", fun, b1, i1) - for (i in data) { - if ((! (i in data2)) || data[i] != data2[i]) { - printf("split3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", - i, data[i], i, data2[i]) - exit 1 - } - } - ############## end split ############## - -# array functions - - split("z y x w v u t", data) - fun = "asort" - asort(data, newdata) - @fun(data, newdata2) - print_result("array", fun, b1, i1) - for (i in newdata) { - if (! (i in newdata2) || newdata[i] != newdata2[i]) { - print fun ": failed, index", i - exit - } - } - - for (i in data) - data2[data[i]] = i - - fun = "asorti" - asorti(data2, newdata) - @fun(data2, newdata2) - print_result("array", fun, b1, i1) - for (i in newdata) { - if (! (i in newdata2) || newdata[i] != newdata2[i]) { - print fun ": failed, index", i, "value", newdata[i], newdata2[i] - exit - } - } - - arr[1] = arr[2] = 42 - fun = "isarray" - b1 = isarray(arr) - i1 = @fun(arr) - print_result("array", fun, b1, i1) - -# i/o functions - - print("hi") > "x1.out" - print("hi") > "x2.out" - - fun = "fflush" - b1 = fflush("x1.out") - i1 = @fun("x2.out") - print_result("i/o", fun, b1, i1) - - fun = "close" - b1 = close("x1.out") - i1 = @fun("x2.out") - print_result("i/o", fun, b1, i1) - - fun = "system" - b1 = system("rm x1.out") - i1 = @fun("rm x2.out") - print_result("i/o", fun, b1, i1) -} diff --git a/test/ChangeLog b/test/ChangeLog index ab7a2163..38ae4d3a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-03-31 Arnold D. Robbins + + * Makefile.am (indirectbuiltin): New test. + * indirectbuiltin.awk, indirectbuiltin.ok: New files. + 2015-03-24 Arnold D. Robbins * id.ok: Update after fixes in code. diff --git a/test/Makefile.am b/test/Makefile.am index f1a0a275..ec15fcd9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -429,6 +429,8 @@ EXTRA_DIST = \ include.awk \ include.ok \ include2.ok \ + indirectbuiltin.awk \ + indirectbuiltin.ok \ indirectcall.awk \ indirectcall.in \ indirectcall.ok \ @@ -1043,7 +1045,7 @@ GAWK_EXT_TESTS = \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ - include include2 indirectcall indirectcall2 \ + include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ diff --git a/test/Makefile.in b/test/Makefile.in index b794e04e..e2656588 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -686,6 +686,8 @@ EXTRA_DIST = \ include.awk \ include.ok \ include2.ok \ + indirectbuiltin.awk \ + indirectbuiltin.ok \ indirectcall.awk \ indirectcall.in \ indirectcall.ok \ @@ -1299,7 +1301,7 @@ GAWK_EXT_TESTS = \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ - include include2 indirectcall indirectcall2 \ + include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ @@ -3586,6 +3588,11 @@ include: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +indirectbuiltin: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + indirectcall: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 8c270869..f36e495e 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1107,6 +1107,11 @@ include: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +indirectbuiltin: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + indirectcall: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/indirectbuiltin.awk b/test/indirectbuiltin.awk new file mode 100644 index 00000000..4d5291d2 --- /dev/null +++ b/test/indirectbuiltin.awk @@ -0,0 +1,371 @@ +function print_result(category, fname, builtin_result, indirect_result) +{ + if (builtin_result == indirect_result) + printf("%s: %s: pass\n", category, fname) + else { + printf("%s: %s: fail: builtin: %s \tindirect: %s\n", category, fname, + builtin_result, indirect_result) + exit 1 + } +} + + +BEGIN { +# math functions + + fun = "and" + b1 = and(0x11, 0x01) + i1 = @fun(0x11, 0x01) + print_result("math", fun, b1, i1) + + fun = "atan2" + b1 = atan2(-1, 0) + i1 = @fun(-1, 0) + print_result("math", fun, b1, i1) + + fun = "compl" + b1 = compl(0x1111) + i1 = @fun(0x1111) + print_result("math", fun, b1, i1) + + fun = "cos" + b1 = cos(3.1415927 / 4) + i1 = @fun(3.1415927 / 4) + print_result("math", fun, b1, i1) + + fun = "exp" + b1 = exp(2) + i1 = @fun(2) + print_result("math", fun, b1, i1) + + fun = "int" + b1 = int(3.1415927) + i1 = @fun(3.1415927) + print_result("math", fun, b1, i1) + + fun = "log" + b1 = log(10) + i1 = @fun(10) + print_result("math", fun, b1, i1) + + fun = "lshift" + b1 = lshift(1, 2) + i1 = @fun(1, 2) + print_result("math", fun, b1, i1) + + fun = "or" + b1 = or(0x10, 0x01) + i1 = @fun(0x10, 0x01) + print_result("math", fun, b1, i1) + + fun = "rand" + srand(1) + b1 = rand(); + srand(1) + i1 = @fun() + print_result("math", fun, b1, i1) + + fun = "rshift" + b1 = rshift(0x10, 1) + i1 = @fun(0x10, 1) + print_result("math", fun, b1, i1) + + fun = "sin" + b1 = sin(3.1415927 / 4) + i1 = @fun(3.1415927 / 4) + print_result("math", fun, b1, i1) + + fun = "sqrt" + b1 = sqrt(2) + i1 = @fun(2) + print_result("math", fun, b1, i1) + + srand() + fun = "srand" + b1 = srand() + i1 = @fun() + print_result("math", fun, b1, i1) + + fun = "xor" + b1 = xor(0x11, 0x01) + i1 = @fun(0x11, 0x01) + print_result("math", fun, b1, i1) + +# string functions + + fun = "gensub" + b1 = gensub("f", "q", "g", "ff11bb") + i1 = @fun("f", "q", "g", "ff11bb") + print_result("string", fun, b1, i1) + + fun = "gsub" + $0 = "ff11bb" + b1 = gsub("f", "q") + b2 = $0 + $0 = "ff11bb" + i1 = @fun("f", "q") + i2 = $0 + print_result("string", fun, b1, i1) + if (b2 != i2) { + printf("string: %s: fail: $0 (%s) != $0 (%s)\n", + fun, b2, i2) + exit 1 + } + + fun = "index" + b1 = index("hi, how are you", "how") + i1 = @fun("hi, how are you", "how") + print_result("string", fun, b1, i1) + + fun = "dcgettext" + b1 = dcgettext("hello, world") + i1 = @fun("hello, world") + print_result("string", fun, b1, i1) + + fun = "dcngettext" + b1 = dcngettext("hello, world", "howdy", 2) + i1 = @fun("hello, world", "howdy", 2) + print_result("string", fun, b1, i1) + + fun = "length" + b1 = length("hi, how are you") + i1 = @fun("hi, how are you") + print_result("string", fun, b1, i1) + + fun = "sprintf" + b1 = sprintf("%s world", "hello") + i1 = @fun("%s world", "hello") + print_result("string", fun, b1, i1) + + fun = "strtonum" + b1 = strtonum("0xdeadbeef") + i1 = @fun("0xdeadbeef") + print_result("string", fun, b1, i1) + + fun = "sub" + $0 = "ff11bb" + b1 = sub("f", "q") + b2 = $0 + $0 = "ff11bb" + i1 = @fun("f", "q") + i2 = $0 + print_result("string", fun, b1, i1) + if (b2 != i2) { + printf("string: %s: fail: $0 (%s) != $0 (%s)\n", + fun, b2, i2) + exit 1 + } + + fun = "substr" + b1 = substr("0xdeadbeef", 7, 4) + i1 = @fun("0xdeadbeef", 7, 4) + print_result("string", fun, b1, i1) + + fun = "tolower" + b1 = tolower("0xDeAdBeEf") + i1 = @fun("0xDeAdBeEf") + print_result("string", fun, b1, i1) + + fun = "toupper" + b1 = toupper("0xDeAdBeEf") + i1 = @fun("0xDeAdBeEf") + print_result("string", fun, b1, i1) + +# time functions + + fun = "mktime" + b1 = mktime("1990 02 11 12 00 00") + i1 = @fun("1990 02 11 12 00 00") + print_result("time", fun, b1, i1) + + then = b1 + fun = "strftime" + b1 = strftime(PROCINFO["strftime"], then) + i1 = @fun(PROCINFO["strftime"], then) + print_result("time", fun, b1, i1) + + fun = "systime" + b1 = systime() + i1 = @fun() + print_result("time", fun, b1, i1) + +# regexp functions + + fun = "match" + b1 = match("o+", "fooob") + rstart = RSTART + rlength = RLENGTH + i1 = @fun("o+", "fooob") + print_result("regexp", fun, b1, i1) + if (rstart != RSTART) { + printf("match: failure: biRSTART (%d) != iRSTART (%d)\n", + rstart, RSTART) + exit 1 + } + if (rlength != RLENGTH) { + printf("match: failure: biRLENGTH (%d) != iRLENGTH (%d)\n", + rlength, RLENGTH) + exit 1 + } + + ############## start patsplit ############## + fun = "patsplit" + delete data + delete data2 + delete seps + delete seps2 + b1 = patsplit("a:b:c:d", data, ":", seps) + i1 = @fun("a:b:c:d", data2, ":", seps2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + for (i in seps) { + if ((! (i in seps2)) || seps[i] != seps2[i]) { + printf("patsplit1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n", + i, seps[i], i, seps2[i]) + exit 1 + } + } + + fun = "patsplit" + delete data + delete data2 + b1 = patsplit("a:b:c:d", data, ":") + i1 = @fun("a:b:c:d", data2, ":") + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + + fun = "patsplit" + delete data + delete data2 + FPAT = "[a-z]+" + b1 = patsplit("a b c d", data) + i1 = @fun("a b c d", data2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + ############## end patsplit ############## + + ############## start split ############## + fun = "split" + delete data + delete data2 + delete seps + delete seps2 + b1 = split("a:b:c:d", data, ":", seps) + i1 = @fun("a:b:c:d", data2, ":", seps2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + for (i in seps) { + if ((! (i in seps2)) || seps[i] != seps2[i]) { + printf("split1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n", + i, seps[i], i, seps2[i]) + exit 1 + } + } + + fun = "split" + delete data + delete data2 + b1 = split("a:b:c:d", data, ":") + i1 = @fun("a:b:c:d", data2, ":") + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + + fun = "split" + delete data + delete data2 + b1 = split("a b c d", data) + i1 = @fun("a b c d", data2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + ############## end split ############## + +# array functions + + split("z y x w v u t", data) + fun = "asort" + asort(data, newdata) + @fun(data, newdata2) + print_result("array", fun, b1, i1) + for (i in newdata) { + if (! (i in newdata2) || newdata[i] != newdata2[i]) { + print fun ": failed, index", i + exit + } + } + + for (i in data) + data2[data[i]] = i + + fun = "asorti" + asorti(data2, newdata) + @fun(data2, newdata2) + print_result("array", fun, b1, i1) + for (i in newdata) { + if (! (i in newdata2) || newdata[i] != newdata2[i]) { + print fun ": failed, index", i, "value", newdata[i], newdata2[i] + exit + } + } + + arr[1] = arr[2] = 42 + fun = "isarray" + b1 = isarray(arr) + i1 = @fun(arr) + print_result("array", fun, b1, i1) + +# i/o functions + + print("hi") > "x1.out" + print("hi") > "x2.out" + + fun = "fflush" + b1 = fflush("x1.out") + i1 = @fun("x2.out") + print_result("i/o", fun, b1, i1) + + fun = "close" + b1 = close("x1.out") + i1 = @fun("x2.out") + print_result("i/o", fun, b1, i1) + + fun = "system" + b1 = system("rm x1.out") + i1 = @fun("rm x2.out") + print_result("i/o", fun, b1, i1) +} diff --git a/test/indirectbuiltin.ok b/test/indirectbuiltin.ok new file mode 100644 index 00000000..312bbd76 --- /dev/null +++ b/test/indirectbuiltin.ok @@ -0,0 +1,43 @@ +math: and: pass +math: atan2: pass +math: compl: pass +math: cos: pass +math: exp: pass +math: int: pass +math: log: pass +math: lshift: pass +math: or: pass +math: rand: pass +math: rshift: pass +math: sin: pass +math: sqrt: pass +math: srand: pass +math: xor: pass +string: gensub: pass +string: gsub: pass +string: index: pass +string: dcgettext: pass +string: dcngettext: pass +string: length: pass +string: sprintf: pass +string: strtonum: pass +string: sub: pass +string: substr: pass +string: tolower: pass +string: toupper: pass +time: mktime: pass +time: strftime: pass +time: systime: pass +regexp: match: pass +regexp: patsplit: pass +regexp: patsplit: pass +regexp: patsplit: pass +regexp: split: pass +regexp: split: pass +regexp: split: pass +array: asort: pass +array: asorti: pass +array: isarray: pass +i/o: fflush: pass +i/o: close: pass +i/o: system: pass -- cgit v1.2.3 From 0ed7e09458bdb6185586a8a0bec747b2f800ca16 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 31 Mar 2015 22:21:30 +0300 Subject: Update doc on calling built-ins indirectly. --- doc/ChangeLog | 5 + doc/gawk.info | 588 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 21 +- doc/gawktexi.in | 21 +- 4 files changed, 337 insertions(+), 298 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 6dbe79dc..2f5dabb0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-31 Arnold D. Robbins + + * gawktexi.in: Update discussion of calling built-in functions + indirectly. + 2015-03-24 Arnold D. Robbins * gawktexi.in: Minor fixes from Antonio Colombo and new exercise diff --git a/doc/gawk.info b/doc/gawk.info index 6cb2abdb..9b6a46fc 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -14294,9 +14294,17 @@ function call. Starting with version 4.1.2 of `gawk', indirect function calls may also be used with built-in functions and with extension functions -(*note Dynamic Extensions::). The only thing you cannot do is pass a -regular expression constant to a built-in function through an indirect -function call.(1) +(*note Dynamic Extensions::). There are some limitations when calling +built-in functions indirectly, as follows. + + * You cannot pass a regular expression constant to a built-in + function through an indirect function call.(1) This applies to the + `sub()', `gsub()', `gensub()', `match()', `split()' and + `patsplit()' functions. + + * If calling `sub()' or `gsub()', you may only pass two arguments, + since those functions are unusual in that they update their third + argument. This means that `$0' will be updated. `gawk' does its best to make indirect function calls efficient. For example, in the following case: @@ -34777,292 +34785,292 @@ Node: Pass By Value/Reference579678 Node: Return Statement583175 Node: Dynamic Typing586154 Node: Indirect Calls587083 -Ref: Indirect Calls-Footnote-1596948 -Node: Functions Summary597076 -Node: Library Functions599778 -Ref: Library Functions-Footnote-1603386 -Ref: Library Functions-Footnote-2603529 -Node: Library Names603700 -Ref: Library Names-Footnote-1607158 -Ref: Library Names-Footnote-2607381 -Node: General Functions607467 -Node: Strtonum Function608570 -Node: Assert Function611592 -Node: Round Function614916 -Node: Cliff Random Function616457 -Node: Ordinal Functions617473 -Ref: Ordinal Functions-Footnote-1620536 -Ref: Ordinal Functions-Footnote-2620788 -Node: Join Function620999 -Ref: Join Function-Footnote-1622769 -Node: Getlocaltime Function622969 -Node: Readfile Function626713 -Node: Shell Quoting628685 -Node: Data File Management630086 -Node: Filetrans Function630718 -Node: Rewind Function634814 -Node: File Checking636200 -Ref: File Checking-Footnote-1637533 -Node: Empty Files637734 -Node: Ignoring Assigns639713 -Node: Getopt Function641263 -Ref: Getopt Function-Footnote-1652727 -Node: Passwd Functions652927 -Ref: Passwd Functions-Footnote-1661767 -Node: Group Functions661855 -Ref: Group Functions-Footnote-1669752 -Node: Walking Arrays669957 -Node: Library Functions Summary672963 -Node: Library Exercises674365 -Node: Sample Programs675645 -Node: Running Examples676415 -Node: Clones677143 -Node: Cut Program678367 -Node: Egrep Program688087 -Ref: Egrep Program-Footnote-1695590 -Node: Id Program695700 -Node: Split Program699376 -Ref: Split Program-Footnote-1702830 -Node: Tee Program702958 -Node: Uniq Program705747 -Node: Wc Program713166 -Ref: Wc Program-Footnote-1717416 -Node: Miscellaneous Programs717510 -Node: Dupword Program718723 -Node: Alarm Program720754 -Node: Translate Program725559 -Ref: Translate Program-Footnote-1730122 -Node: Labels Program730392 -Ref: Labels Program-Footnote-1733743 -Node: Word Sorting733827 -Node: History Sorting737897 -Node: Extract Program739732 -Node: Simple Sed747256 -Node: Igawk Program750326 -Ref: Igawk Program-Footnote-1764652 -Ref: Igawk Program-Footnote-2764853 -Ref: Igawk Program-Footnote-3764975 -Node: Anagram Program765090 -Node: Signature Program768151 -Node: Programs Summary769398 -Node: Programs Exercises770619 -Ref: Programs Exercises-Footnote-1774750 -Node: Advanced Features774841 -Node: Nondecimal Data776823 -Node: Array Sorting778413 -Node: Controlling Array Traversal779113 -Ref: Controlling Array Traversal-Footnote-1787479 -Node: Array Sorting Functions787597 -Ref: Array Sorting Functions-Footnote-1791483 -Node: Two-way I/O791679 -Ref: Two-way I/O-Footnote-1796624 -Ref: Two-way I/O-Footnote-2796810 -Node: TCP/IP Networking796892 -Node: Profiling799764 -Node: Advanced Features Summary807305 -Node: Internationalization809238 -Node: I18N and L10N810718 -Node: Explaining gettext811404 -Ref: Explaining gettext-Footnote-1816429 -Ref: Explaining gettext-Footnote-2816613 -Node: Programmer i18n816778 -Ref: Programmer i18n-Footnote-1821654 -Node: Translator i18n821703 -Node: String Extraction822497 -Ref: String Extraction-Footnote-1823628 -Node: Printf Ordering823714 -Ref: Printf Ordering-Footnote-1826500 -Node: I18N Portability826564 -Ref: I18N Portability-Footnote-1829020 -Node: I18N Example829083 -Ref: I18N Example-Footnote-1831886 -Node: Gawk I18N831958 -Node: I18N Summary832602 -Node: Debugger833942 -Node: Debugging834964 -Node: Debugging Concepts835405 -Node: Debugging Terms837215 -Node: Awk Debugging839787 -Node: Sample Debugging Session840693 -Node: Debugger Invocation841227 -Node: Finding The Bug842612 -Node: List of Debugger Commands849091 -Node: Breakpoint Control850423 -Node: Debugger Execution Control854100 -Node: Viewing And Changing Data857459 -Node: Execution Stack860835 -Node: Debugger Info862470 -Node: Miscellaneous Debugger Commands866515 -Node: Readline Support871516 -Node: Limitations872410 -Node: Debugging Summary874525 -Node: Arbitrary Precision Arithmetic875699 -Node: Computer Arithmetic877115 -Ref: table-numeric-ranges880692 -Ref: Computer Arithmetic-Footnote-1881216 -Node: Math Definitions881273 -Ref: table-ieee-formats884568 -Ref: Math Definitions-Footnote-1885172 -Node: MPFR features885277 -Node: FP Math Caution886948 -Ref: FP Math Caution-Footnote-1887998 -Node: Inexactness of computations888367 -Node: Inexact representation889326 -Node: Comparing FP Values890684 -Node: Errors accumulate891766 -Node: Getting Accuracy893198 -Node: Try To Round895902 -Node: Setting precision896801 -Ref: table-predefined-precision-strings897485 -Node: Setting the rounding mode899314 -Ref: table-gawk-rounding-modes899678 -Ref: Setting the rounding mode-Footnote-1903130 -Node: Arbitrary Precision Integers903309 -Ref: Arbitrary Precision Integers-Footnote-1906293 -Node: POSIX Floating Point Problems906442 -Ref: POSIX Floating Point Problems-Footnote-1910321 -Node: Floating point summary910359 -Node: Dynamic Extensions912546 -Node: Extension Intro914098 -Node: Plugin License915363 -Node: Extension Mechanism Outline916160 -Ref: figure-load-extension916588 -Ref: figure-register-new-function918068 -Ref: figure-call-new-function919072 -Node: Extension API Description921059 -Node: Extension API Functions Introduction922509 -Node: General Data Types927330 -Ref: General Data Types-Footnote-1933230 -Node: Memory Allocation Functions933529 -Ref: Memory Allocation Functions-Footnote-1936368 -Node: Constructor Functions936467 -Node: Registration Functions938206 -Node: Extension Functions938891 -Node: Exit Callback Functions941188 -Node: Extension Version String942436 -Node: Input Parsers943099 -Node: Output Wrappers952974 -Node: Two-way processors957487 -Node: Printing Messages959750 -Ref: Printing Messages-Footnote-1960826 -Node: Updating `ERRNO'960978 -Node: Requesting Values961718 -Ref: table-value-types-returned962445 -Node: Accessing Parameters963402 -Node: Symbol Table Access964636 -Node: Symbol table by name965150 -Node: Symbol table by cookie967170 -Ref: Symbol table by cookie-Footnote-1971315 -Node: Cached values971378 -Ref: Cached values-Footnote-1974874 -Node: Array Manipulation974965 -Ref: Array Manipulation-Footnote-1976063 -Node: Array Data Types976100 -Ref: Array Data Types-Footnote-1978755 -Node: Array Functions978847 -Node: Flattening Arrays982706 -Node: Creating Arrays989608 -Node: Extension API Variables994379 -Node: Extension Versioning995015 -Node: Extension API Informational Variables996906 -Node: Extension API Boilerplate997971 -Node: Finding Extensions1001780 -Node: Extension Example1002340 -Node: Internal File Description1003112 -Node: Internal File Ops1007179 -Ref: Internal File Ops-Footnote-11018930 -Node: Using Internal File Ops1019070 -Ref: Using Internal File Ops-Footnote-11021453 -Node: Extension Samples1021726 -Node: Extension Sample File Functions1023254 -Node: Extension Sample Fnmatch1030935 -Node: Extension Sample Fork1032423 -Node: Extension Sample Inplace1033638 -Node: Extension Sample Ord1035724 -Node: Extension Sample Readdir1036560 -Ref: table-readdir-file-types1037437 -Node: Extension Sample Revout1038248 -Node: Extension Sample Rev2way1038837 -Node: Extension Sample Read write array1039577 -Node: Extension Sample Readfile1041517 -Node: Extension Sample Time1042612 -Node: Extension Sample API Tests1043960 -Node: gawkextlib1044451 -Node: Extension summary1047129 -Node: Extension Exercises1050818 -Node: Language History1052314 -Node: V7/SVR3.11053970 -Node: SVR41056123 -Node: POSIX1057557 -Node: BTL1058938 -Node: POSIX/GNU1059669 -Node: Feature History1065190 -Node: Common Extensions1078288 -Node: Ranges and Locales1079660 -Ref: Ranges and Locales-Footnote-11084279 -Ref: Ranges and Locales-Footnote-21084306 -Ref: Ranges and Locales-Footnote-31084541 -Node: Contributors1084762 -Node: History summary1090302 -Node: Installation1091681 -Node: Gawk Distribution1092627 -Node: Getting1093111 -Node: Extracting1093934 -Node: Distribution contents1095571 -Node: Unix Installation1101325 -Node: Quick Installation1101942 -Node: Additional Configuration Options1104366 -Node: Configuration Philosophy1106169 -Node: Non-Unix Installation1108538 -Node: PC Installation1108996 -Node: PC Binary Installation1110316 -Node: PC Compiling1112164 -Ref: PC Compiling-Footnote-11115185 -Node: PC Testing1115294 -Node: PC Using1116470 -Node: Cygwin1120585 -Node: MSYS1121355 -Node: VMS Installation1121856 -Node: VMS Compilation1122648 -Ref: VMS Compilation-Footnote-11123877 -Node: VMS Dynamic Extensions1123935 -Node: VMS Installation Details1125619 -Node: VMS Running1127870 -Node: VMS GNV1130710 -Node: VMS Old Gawk1131445 -Node: Bugs1131915 -Node: Other Versions1135804 -Node: Installation summary1142238 -Node: Notes1143297 -Node: Compatibility Mode1144162 -Node: Additions1144944 -Node: Accessing The Source1145869 -Node: Adding Code1147304 -Node: New Ports1153461 -Node: Derived Files1157943 -Ref: Derived Files-Footnote-11163418 -Ref: Derived Files-Footnote-21163452 -Ref: Derived Files-Footnote-31164048 -Node: Future Extensions1164162 -Node: Implementation Limitations1164768 -Node: Extension Design1166016 -Node: Old Extension Problems1167170 -Ref: Old Extension Problems-Footnote-11168687 -Node: Extension New Mechanism Goals1168744 -Ref: Extension New Mechanism Goals-Footnote-11172104 -Node: Extension Other Design Decisions1172293 -Node: Extension Future Growth1174401 -Node: Old Extension Mechanism1175237 -Node: Notes summary1176999 -Node: Basic Concepts1178185 -Node: Basic High Level1178866 -Ref: figure-general-flow1179138 -Ref: figure-process-flow1179737 -Ref: Basic High Level-Footnote-11182966 -Node: Basic Data Typing1183151 -Node: Glossary1186479 -Node: Copying1218408 -Node: GNU Free Documentation License1255964 -Node: Index1281100 +Ref: Indirect Calls-Footnote-1597326 +Node: Functions Summary597454 +Node: Library Functions600156 +Ref: Library Functions-Footnote-1603764 +Ref: Library Functions-Footnote-2603907 +Node: Library Names604078 +Ref: Library Names-Footnote-1607536 +Ref: Library Names-Footnote-2607759 +Node: General Functions607845 +Node: Strtonum Function608948 +Node: Assert Function611970 +Node: Round Function615294 +Node: Cliff Random Function616835 +Node: Ordinal Functions617851 +Ref: Ordinal Functions-Footnote-1620914 +Ref: Ordinal Functions-Footnote-2621166 +Node: Join Function621377 +Ref: Join Function-Footnote-1623147 +Node: Getlocaltime Function623347 +Node: Readfile Function627091 +Node: Shell Quoting629063 +Node: Data File Management630464 +Node: Filetrans Function631096 +Node: Rewind Function635192 +Node: File Checking636578 +Ref: File Checking-Footnote-1637911 +Node: Empty Files638112 +Node: Ignoring Assigns640091 +Node: Getopt Function641641 +Ref: Getopt Function-Footnote-1653105 +Node: Passwd Functions653305 +Ref: Passwd Functions-Footnote-1662145 +Node: Group Functions662233 +Ref: Group Functions-Footnote-1670130 +Node: Walking Arrays670335 +Node: Library Functions Summary673341 +Node: Library Exercises674743 +Node: Sample Programs676023 +Node: Running Examples676793 +Node: Clones677521 +Node: Cut Program678745 +Node: Egrep Program688465 +Ref: Egrep Program-Footnote-1695968 +Node: Id Program696078 +Node: Split Program699754 +Ref: Split Program-Footnote-1703208 +Node: Tee Program703336 +Node: Uniq Program706125 +Node: Wc Program713544 +Ref: Wc Program-Footnote-1717794 +Node: Miscellaneous Programs717888 +Node: Dupword Program719101 +Node: Alarm Program721132 +Node: Translate Program725937 +Ref: Translate Program-Footnote-1730500 +Node: Labels Program730770 +Ref: Labels Program-Footnote-1734121 +Node: Word Sorting734205 +Node: History Sorting738275 +Node: Extract Program740110 +Node: Simple Sed747634 +Node: Igawk Program750704 +Ref: Igawk Program-Footnote-1765030 +Ref: Igawk Program-Footnote-2765231 +Ref: Igawk Program-Footnote-3765353 +Node: Anagram Program765468 +Node: Signature Program768529 +Node: Programs Summary769776 +Node: Programs Exercises770997 +Ref: Programs Exercises-Footnote-1775128 +Node: Advanced Features775219 +Node: Nondecimal Data777201 +Node: Array Sorting778791 +Node: Controlling Array Traversal779491 +Ref: Controlling Array Traversal-Footnote-1787857 +Node: Array Sorting Functions787975 +Ref: Array Sorting Functions-Footnote-1791861 +Node: Two-way I/O792057 +Ref: Two-way I/O-Footnote-1797002 +Ref: Two-way I/O-Footnote-2797188 +Node: TCP/IP Networking797270 +Node: Profiling800142 +Node: Advanced Features Summary807683 +Node: Internationalization809616 +Node: I18N and L10N811096 +Node: Explaining gettext811782 +Ref: Explaining gettext-Footnote-1816807 +Ref: Explaining gettext-Footnote-2816991 +Node: Programmer i18n817156 +Ref: Programmer i18n-Footnote-1822032 +Node: Translator i18n822081 +Node: String Extraction822875 +Ref: String Extraction-Footnote-1824006 +Node: Printf Ordering824092 +Ref: Printf Ordering-Footnote-1826878 +Node: I18N Portability826942 +Ref: I18N Portability-Footnote-1829398 +Node: I18N Example829461 +Ref: I18N Example-Footnote-1832264 +Node: Gawk I18N832336 +Node: I18N Summary832980 +Node: Debugger834320 +Node: Debugging835342 +Node: Debugging Concepts835783 +Node: Debugging Terms837593 +Node: Awk Debugging840165 +Node: Sample Debugging Session841071 +Node: Debugger Invocation841605 +Node: Finding The Bug842990 +Node: List of Debugger Commands849469 +Node: Breakpoint Control850801 +Node: Debugger Execution Control854478 +Node: Viewing And Changing Data857837 +Node: Execution Stack861213 +Node: Debugger Info862848 +Node: Miscellaneous Debugger Commands866893 +Node: Readline Support871894 +Node: Limitations872788 +Node: Debugging Summary874903 +Node: Arbitrary Precision Arithmetic876077 +Node: Computer Arithmetic877493 +Ref: table-numeric-ranges881070 +Ref: Computer Arithmetic-Footnote-1881594 +Node: Math Definitions881651 +Ref: table-ieee-formats884946 +Ref: Math Definitions-Footnote-1885550 +Node: MPFR features885655 +Node: FP Math Caution887326 +Ref: FP Math Caution-Footnote-1888376 +Node: Inexactness of computations888745 +Node: Inexact representation889704 +Node: Comparing FP Values891062 +Node: Errors accumulate892144 +Node: Getting Accuracy893576 +Node: Try To Round896280 +Node: Setting precision897179 +Ref: table-predefined-precision-strings897863 +Node: Setting the rounding mode899692 +Ref: table-gawk-rounding-modes900056 +Ref: Setting the rounding mode-Footnote-1903508 +Node: Arbitrary Precision Integers903687 +Ref: Arbitrary Precision Integers-Footnote-1906671 +Node: POSIX Floating Point Problems906820 +Ref: POSIX Floating Point Problems-Footnote-1910699 +Node: Floating point summary910737 +Node: Dynamic Extensions912924 +Node: Extension Intro914476 +Node: Plugin License915741 +Node: Extension Mechanism Outline916538 +Ref: figure-load-extension916966 +Ref: figure-register-new-function918446 +Ref: figure-call-new-function919450 +Node: Extension API Description921437 +Node: Extension API Functions Introduction922887 +Node: General Data Types927708 +Ref: General Data Types-Footnote-1933608 +Node: Memory Allocation Functions933907 +Ref: Memory Allocation Functions-Footnote-1936746 +Node: Constructor Functions936845 +Node: Registration Functions938584 +Node: Extension Functions939269 +Node: Exit Callback Functions941566 +Node: Extension Version String942814 +Node: Input Parsers943477 +Node: Output Wrappers953352 +Node: Two-way processors957865 +Node: Printing Messages960128 +Ref: Printing Messages-Footnote-1961204 +Node: Updating `ERRNO'961356 +Node: Requesting Values962096 +Ref: table-value-types-returned962823 +Node: Accessing Parameters963780 +Node: Symbol Table Access965014 +Node: Symbol table by name965528 +Node: Symbol table by cookie967548 +Ref: Symbol table by cookie-Footnote-1971693 +Node: Cached values971756 +Ref: Cached values-Footnote-1975252 +Node: Array Manipulation975343 +Ref: Array Manipulation-Footnote-1976441 +Node: Array Data Types976478 +Ref: Array Data Types-Footnote-1979133 +Node: Array Functions979225 +Node: Flattening Arrays983084 +Node: Creating Arrays989986 +Node: Extension API Variables994757 +Node: Extension Versioning995393 +Node: Extension API Informational Variables997284 +Node: Extension API Boilerplate998349 +Node: Finding Extensions1002158 +Node: Extension Example1002718 +Node: Internal File Description1003490 +Node: Internal File Ops1007557 +Ref: Internal File Ops-Footnote-11019308 +Node: Using Internal File Ops1019448 +Ref: Using Internal File Ops-Footnote-11021831 +Node: Extension Samples1022104 +Node: Extension Sample File Functions1023632 +Node: Extension Sample Fnmatch1031313 +Node: Extension Sample Fork1032801 +Node: Extension Sample Inplace1034016 +Node: Extension Sample Ord1036102 +Node: Extension Sample Readdir1036938 +Ref: table-readdir-file-types1037815 +Node: Extension Sample Revout1038626 +Node: Extension Sample Rev2way1039215 +Node: Extension Sample Read write array1039955 +Node: Extension Sample Readfile1041895 +Node: Extension Sample Time1042990 +Node: Extension Sample API Tests1044338 +Node: gawkextlib1044829 +Node: Extension summary1047507 +Node: Extension Exercises1051196 +Node: Language History1052692 +Node: V7/SVR3.11054348 +Node: SVR41056501 +Node: POSIX1057935 +Node: BTL1059316 +Node: POSIX/GNU1060047 +Node: Feature History1065568 +Node: Common Extensions1078666 +Node: Ranges and Locales1080038 +Ref: Ranges and Locales-Footnote-11084657 +Ref: Ranges and Locales-Footnote-21084684 +Ref: Ranges and Locales-Footnote-31084919 +Node: Contributors1085140 +Node: History summary1090680 +Node: Installation1092059 +Node: Gawk Distribution1093005 +Node: Getting1093489 +Node: Extracting1094312 +Node: Distribution contents1095949 +Node: Unix Installation1101703 +Node: Quick Installation1102320 +Node: Additional Configuration Options1104744 +Node: Configuration Philosophy1106547 +Node: Non-Unix Installation1108916 +Node: PC Installation1109374 +Node: PC Binary Installation1110694 +Node: PC Compiling1112542 +Ref: PC Compiling-Footnote-11115563 +Node: PC Testing1115672 +Node: PC Using1116848 +Node: Cygwin1120963 +Node: MSYS1121733 +Node: VMS Installation1122234 +Node: VMS Compilation1123026 +Ref: VMS Compilation-Footnote-11124255 +Node: VMS Dynamic Extensions1124313 +Node: VMS Installation Details1125997 +Node: VMS Running1128248 +Node: VMS GNV1131088 +Node: VMS Old Gawk1131823 +Node: Bugs1132293 +Node: Other Versions1136182 +Node: Installation summary1142616 +Node: Notes1143675 +Node: Compatibility Mode1144540 +Node: Additions1145322 +Node: Accessing The Source1146247 +Node: Adding Code1147682 +Node: New Ports1153839 +Node: Derived Files1158321 +Ref: Derived Files-Footnote-11163796 +Ref: Derived Files-Footnote-21163830 +Ref: Derived Files-Footnote-31164426 +Node: Future Extensions1164540 +Node: Implementation Limitations1165146 +Node: Extension Design1166394 +Node: Old Extension Problems1167548 +Ref: Old Extension Problems-Footnote-11169065 +Node: Extension New Mechanism Goals1169122 +Ref: Extension New Mechanism Goals-Footnote-11172482 +Node: Extension Other Design Decisions1172671 +Node: Extension Future Growth1174779 +Node: Old Extension Mechanism1175615 +Node: Notes summary1177377 +Node: Basic Concepts1178563 +Node: Basic High Level1179244 +Ref: figure-general-flow1179516 +Ref: figure-process-flow1180115 +Ref: Basic High Level-Footnote-11183344 +Node: Basic Data Typing1183529 +Node: Glossary1186857 +Node: Copying1218786 +Node: GNU Free Documentation License1256342 +Node: Index1281478  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 80f8528d..d23b2128 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -20344,10 +20344,23 @@ Remember that you must supply a leading @samp{@@} in front of an indirect functi Starting with @value{PVERSION} 4.1.2 of @command{gawk}, indirect function calls may also be used with built-in functions and with extension functions -(@pxref{Dynamic Extensions}). The only thing you cannot do is pass a regular -expression constant to a built-in function through an indirect function -call.@footnote{This may change in a future version; recheck the documentation that -comes with your version of @command{gawk} to see if it has.} +(@pxref{Dynamic Extensions}). There are some limitations when calling +built-in functions indirectly, as follows. + +@itemize @value{BULLET} +@item +You cannot pass a regular expression constant to a built-in function +through an indirect function call.@footnote{This may change in a future +version; recheck the documentation that comes with your version of +@command{gawk} to see if it has.} This applies to the @code{sub()}, +@code{gsub()}, @code{gensub()}, @code{match()}, @code{split()} and +@code{patsplit()} functions. + +@item +If calling @code{sub()} or @code{gsub()}, you may only pass two arguments, +since those functions are unusual in that they update their third argument. +This means that @code{$0} will be updated. +@end itemize @command{gawk} does its best to make indirect function calls efficient. For example, in the following case: diff --git a/doc/gawktexi.in b/doc/gawktexi.in index cf669976..8e7d4010 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -19465,10 +19465,23 @@ Remember that you must supply a leading @samp{@@} in front of an indirect functi Starting with @value{PVERSION} 4.1.2 of @command{gawk}, indirect function calls may also be used with built-in functions and with extension functions -(@pxref{Dynamic Extensions}). The only thing you cannot do is pass a regular -expression constant to a built-in function through an indirect function -call.@footnote{This may change in a future version; recheck the documentation that -comes with your version of @command{gawk} to see if it has.} +(@pxref{Dynamic Extensions}). There are some limitations when calling +built-in functions indirectly, as follows. + +@itemize @value{BULLET} +@item +You cannot pass a regular expression constant to a built-in function +through an indirect function call.@footnote{This may change in a future +version; recheck the documentation that comes with your version of +@command{gawk} to see if it has.} This applies to the @code{sub()}, +@code{gsub()}, @code{gensub()}, @code{match()}, @code{split()} and +@code{patsplit()} functions. + +@item +If calling @code{sub()} or @code{gsub()}, you may only pass two arguments, +since those functions are unusual in that they update their third argument. +This means that @code{$0} will be updated. +@end itemize @command{gawk} does its best to make indirect function calls efficient. For example, in the following case: -- cgit v1.2.3 From 9730efeabb2116fdf7e93b4553825ba147f5f523 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 31 Mar 2015 22:27:48 +0300 Subject: Small doc fix. --- doc/ChangeLog | 3 +- doc/gawk.info | 658 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 4 +- doc/gawktexi.in | 4 +- 4 files changed, 335 insertions(+), 334 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 2f5dabb0..982db16c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,8 @@ 2015-03-31 Arnold D. Robbins * gawktexi.in: Update discussion of calling built-in functions - indirectly. + indirectly. Small additional fix relating to rand(). Thanks + to Antonio Colombo. 2015-03-24 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index 9b6a46fc..b927b445 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -11929,9 +11929,9 @@ brackets ([ ]): return int(n * rand()) } - The multiplication produces a random number greater than zero and - less than `n'. Using `int()', this result is made into an integer - between zero and `n' - 1, inclusive. + The multiplication produces a random number greater than or equal + to zero and less than `n'. Using `int()', this result is made into + an integer between zero and `n' - 1, inclusive. The following example uses a similar function to produce random integers between one and N. This program prints a new random @@ -34746,331 +34746,331 @@ Node: Functions499087 Node: Built-in500126 Node: Calling Built-in501204 Node: Numeric Functions503199 -Ref: Numeric Functions-Footnote-1507215 -Ref: Numeric Functions-Footnote-2507572 -Ref: Numeric Functions-Footnote-3507620 -Node: String Functions507892 -Ref: String Functions-Footnote-1531393 -Ref: String Functions-Footnote-2531522 -Ref: String Functions-Footnote-3531770 -Node: Gory Details531857 -Ref: table-sub-escapes533638 -Ref: table-sub-proposed535153 -Ref: table-posix-sub536515 -Ref: table-gensub-escapes538052 -Ref: Gory Details-Footnote-1538885 -Node: I/O Functions539036 -Ref: I/O Functions-Footnote-1546272 -Node: Time Functions546419 -Ref: Time Functions-Footnote-1556928 -Ref: Time Functions-Footnote-2556996 -Ref: Time Functions-Footnote-3557154 -Ref: Time Functions-Footnote-4557265 -Ref: Time Functions-Footnote-5557377 -Ref: Time Functions-Footnote-6557604 -Node: Bitwise Functions557870 -Ref: table-bitwise-ops558432 -Ref: Bitwise Functions-Footnote-1562760 -Node: Type Functions562932 -Node: I18N Functions564084 -Node: User-defined565731 -Node: Definition Syntax566536 -Ref: Definition Syntax-Footnote-1572195 -Node: Function Example572266 -Ref: Function Example-Footnote-1575187 -Node: Function Caveats575209 -Node: Calling A Function575727 -Node: Variable Scope576685 -Node: Pass By Value/Reference579678 -Node: Return Statement583175 -Node: Dynamic Typing586154 -Node: Indirect Calls587083 -Ref: Indirect Calls-Footnote-1597326 -Node: Functions Summary597454 -Node: Library Functions600156 -Ref: Library Functions-Footnote-1603764 -Ref: Library Functions-Footnote-2603907 -Node: Library Names604078 -Ref: Library Names-Footnote-1607536 -Ref: Library Names-Footnote-2607759 -Node: General Functions607845 -Node: Strtonum Function608948 -Node: Assert Function611970 -Node: Round Function615294 -Node: Cliff Random Function616835 -Node: Ordinal Functions617851 -Ref: Ordinal Functions-Footnote-1620914 -Ref: Ordinal Functions-Footnote-2621166 -Node: Join Function621377 -Ref: Join Function-Footnote-1623147 -Node: Getlocaltime Function623347 -Node: Readfile Function627091 -Node: Shell Quoting629063 -Node: Data File Management630464 -Node: Filetrans Function631096 -Node: Rewind Function635192 -Node: File Checking636578 -Ref: File Checking-Footnote-1637911 -Node: Empty Files638112 -Node: Ignoring Assigns640091 -Node: Getopt Function641641 -Ref: Getopt Function-Footnote-1653105 -Node: Passwd Functions653305 -Ref: Passwd Functions-Footnote-1662145 -Node: Group Functions662233 -Ref: Group Functions-Footnote-1670130 -Node: Walking Arrays670335 -Node: Library Functions Summary673341 -Node: Library Exercises674743 -Node: Sample Programs676023 -Node: Running Examples676793 -Node: Clones677521 -Node: Cut Program678745 -Node: Egrep Program688465 -Ref: Egrep Program-Footnote-1695968 -Node: Id Program696078 -Node: Split Program699754 -Ref: Split Program-Footnote-1703208 -Node: Tee Program703336 -Node: Uniq Program706125 -Node: Wc Program713544 -Ref: Wc Program-Footnote-1717794 -Node: Miscellaneous Programs717888 -Node: Dupword Program719101 -Node: Alarm Program721132 -Node: Translate Program725937 -Ref: Translate Program-Footnote-1730500 -Node: Labels Program730770 -Ref: Labels Program-Footnote-1734121 -Node: Word Sorting734205 -Node: History Sorting738275 -Node: Extract Program740110 -Node: Simple Sed747634 -Node: Igawk Program750704 -Ref: Igawk Program-Footnote-1765030 -Ref: Igawk Program-Footnote-2765231 -Ref: Igawk Program-Footnote-3765353 -Node: Anagram Program765468 -Node: Signature Program768529 -Node: Programs Summary769776 -Node: Programs Exercises770997 -Ref: Programs Exercises-Footnote-1775128 -Node: Advanced Features775219 -Node: Nondecimal Data777201 -Node: Array Sorting778791 -Node: Controlling Array Traversal779491 -Ref: Controlling Array Traversal-Footnote-1787857 -Node: Array Sorting Functions787975 -Ref: Array Sorting Functions-Footnote-1791861 -Node: Two-way I/O792057 -Ref: Two-way I/O-Footnote-1797002 -Ref: Two-way I/O-Footnote-2797188 -Node: TCP/IP Networking797270 -Node: Profiling800142 -Node: Advanced Features Summary807683 -Node: Internationalization809616 -Node: I18N and L10N811096 -Node: Explaining gettext811782 -Ref: Explaining gettext-Footnote-1816807 -Ref: Explaining gettext-Footnote-2816991 -Node: Programmer i18n817156 -Ref: Programmer i18n-Footnote-1822032 -Node: Translator i18n822081 -Node: String Extraction822875 -Ref: String Extraction-Footnote-1824006 -Node: Printf Ordering824092 -Ref: Printf Ordering-Footnote-1826878 -Node: I18N Portability826942 -Ref: I18N Portability-Footnote-1829398 -Node: I18N Example829461 -Ref: I18N Example-Footnote-1832264 -Node: Gawk I18N832336 -Node: I18N Summary832980 -Node: Debugger834320 -Node: Debugging835342 -Node: Debugging Concepts835783 -Node: Debugging Terms837593 -Node: Awk Debugging840165 -Node: Sample Debugging Session841071 -Node: Debugger Invocation841605 -Node: Finding The Bug842990 -Node: List of Debugger Commands849469 -Node: Breakpoint Control850801 -Node: Debugger Execution Control854478 -Node: Viewing And Changing Data857837 -Node: Execution Stack861213 -Node: Debugger Info862848 -Node: Miscellaneous Debugger Commands866893 -Node: Readline Support871894 -Node: Limitations872788 -Node: Debugging Summary874903 -Node: Arbitrary Precision Arithmetic876077 -Node: Computer Arithmetic877493 -Ref: table-numeric-ranges881070 -Ref: Computer Arithmetic-Footnote-1881594 -Node: Math Definitions881651 -Ref: table-ieee-formats884946 -Ref: Math Definitions-Footnote-1885550 -Node: MPFR features885655 -Node: FP Math Caution887326 -Ref: FP Math Caution-Footnote-1888376 -Node: Inexactness of computations888745 -Node: Inexact representation889704 -Node: Comparing FP Values891062 -Node: Errors accumulate892144 -Node: Getting Accuracy893576 -Node: Try To Round896280 -Node: Setting precision897179 -Ref: table-predefined-precision-strings897863 -Node: Setting the rounding mode899692 -Ref: table-gawk-rounding-modes900056 -Ref: Setting the rounding mode-Footnote-1903508 -Node: Arbitrary Precision Integers903687 -Ref: Arbitrary Precision Integers-Footnote-1906671 -Node: POSIX Floating Point Problems906820 -Ref: POSIX Floating Point Problems-Footnote-1910699 -Node: Floating point summary910737 -Node: Dynamic Extensions912924 -Node: Extension Intro914476 -Node: Plugin License915741 -Node: Extension Mechanism Outline916538 -Ref: figure-load-extension916966 -Ref: figure-register-new-function918446 -Ref: figure-call-new-function919450 -Node: Extension API Description921437 -Node: Extension API Functions Introduction922887 -Node: General Data Types927708 -Ref: General Data Types-Footnote-1933608 -Node: Memory Allocation Functions933907 -Ref: Memory Allocation Functions-Footnote-1936746 -Node: Constructor Functions936845 -Node: Registration Functions938584 -Node: Extension Functions939269 -Node: Exit Callback Functions941566 -Node: Extension Version String942814 -Node: Input Parsers943477 -Node: Output Wrappers953352 -Node: Two-way processors957865 -Node: Printing Messages960128 -Ref: Printing Messages-Footnote-1961204 -Node: Updating `ERRNO'961356 -Node: Requesting Values962096 -Ref: table-value-types-returned962823 -Node: Accessing Parameters963780 -Node: Symbol Table Access965014 -Node: Symbol table by name965528 -Node: Symbol table by cookie967548 -Ref: Symbol table by cookie-Footnote-1971693 -Node: Cached values971756 -Ref: Cached values-Footnote-1975252 -Node: Array Manipulation975343 -Ref: Array Manipulation-Footnote-1976441 -Node: Array Data Types976478 -Ref: Array Data Types-Footnote-1979133 -Node: Array Functions979225 -Node: Flattening Arrays983084 -Node: Creating Arrays989986 -Node: Extension API Variables994757 -Node: Extension Versioning995393 -Node: Extension API Informational Variables997284 -Node: Extension API Boilerplate998349 -Node: Finding Extensions1002158 -Node: Extension Example1002718 -Node: Internal File Description1003490 -Node: Internal File Ops1007557 -Ref: Internal File Ops-Footnote-11019308 -Node: Using Internal File Ops1019448 -Ref: Using Internal File Ops-Footnote-11021831 -Node: Extension Samples1022104 -Node: Extension Sample File Functions1023632 -Node: Extension Sample Fnmatch1031313 -Node: Extension Sample Fork1032801 -Node: Extension Sample Inplace1034016 -Node: Extension Sample Ord1036102 -Node: Extension Sample Readdir1036938 -Ref: table-readdir-file-types1037815 -Node: Extension Sample Revout1038626 -Node: Extension Sample Rev2way1039215 -Node: Extension Sample Read write array1039955 -Node: Extension Sample Readfile1041895 -Node: Extension Sample Time1042990 -Node: Extension Sample API Tests1044338 -Node: gawkextlib1044829 -Node: Extension summary1047507 -Node: Extension Exercises1051196 -Node: Language History1052692 -Node: V7/SVR3.11054348 -Node: SVR41056501 -Node: POSIX1057935 -Node: BTL1059316 -Node: POSIX/GNU1060047 -Node: Feature History1065568 -Node: Common Extensions1078666 -Node: Ranges and Locales1080038 -Ref: Ranges and Locales-Footnote-11084657 -Ref: Ranges and Locales-Footnote-21084684 -Ref: Ranges and Locales-Footnote-31084919 -Node: Contributors1085140 -Node: History summary1090680 -Node: Installation1092059 -Node: Gawk Distribution1093005 -Node: Getting1093489 -Node: Extracting1094312 -Node: Distribution contents1095949 -Node: Unix Installation1101703 -Node: Quick Installation1102320 -Node: Additional Configuration Options1104744 -Node: Configuration Philosophy1106547 -Node: Non-Unix Installation1108916 -Node: PC Installation1109374 -Node: PC Binary Installation1110694 -Node: PC Compiling1112542 -Ref: PC Compiling-Footnote-11115563 -Node: PC Testing1115672 -Node: PC Using1116848 -Node: Cygwin1120963 -Node: MSYS1121733 -Node: VMS Installation1122234 -Node: VMS Compilation1123026 -Ref: VMS Compilation-Footnote-11124255 -Node: VMS Dynamic Extensions1124313 -Node: VMS Installation Details1125997 -Node: VMS Running1128248 -Node: VMS GNV1131088 -Node: VMS Old Gawk1131823 -Node: Bugs1132293 -Node: Other Versions1136182 -Node: Installation summary1142616 -Node: Notes1143675 -Node: Compatibility Mode1144540 -Node: Additions1145322 -Node: Accessing The Source1146247 -Node: Adding Code1147682 -Node: New Ports1153839 -Node: Derived Files1158321 -Ref: Derived Files-Footnote-11163796 -Ref: Derived Files-Footnote-21163830 -Ref: Derived Files-Footnote-31164426 -Node: Future Extensions1164540 -Node: Implementation Limitations1165146 -Node: Extension Design1166394 -Node: Old Extension Problems1167548 -Ref: Old Extension Problems-Footnote-11169065 -Node: Extension New Mechanism Goals1169122 -Ref: Extension New Mechanism Goals-Footnote-11172482 -Node: Extension Other Design Decisions1172671 -Node: Extension Future Growth1174779 -Node: Old Extension Mechanism1175615 -Node: Notes summary1177377 -Node: Basic Concepts1178563 -Node: Basic High Level1179244 -Ref: figure-general-flow1179516 -Ref: figure-process-flow1180115 -Ref: Basic High Level-Footnote-11183344 -Node: Basic Data Typing1183529 -Node: Glossary1186857 -Node: Copying1218786 -Node: GNU Free Documentation License1256342 -Node: Index1281478 +Ref: Numeric Functions-Footnote-1507227 +Ref: Numeric Functions-Footnote-2507584 +Ref: Numeric Functions-Footnote-3507632 +Node: String Functions507904 +Ref: String Functions-Footnote-1531405 +Ref: String Functions-Footnote-2531534 +Ref: String Functions-Footnote-3531782 +Node: Gory Details531869 +Ref: table-sub-escapes533650 +Ref: table-sub-proposed535165 +Ref: table-posix-sub536527 +Ref: table-gensub-escapes538064 +Ref: Gory Details-Footnote-1538897 +Node: I/O Functions539048 +Ref: I/O Functions-Footnote-1546284 +Node: Time Functions546431 +Ref: Time Functions-Footnote-1556940 +Ref: Time Functions-Footnote-2557008 +Ref: Time Functions-Footnote-3557166 +Ref: Time Functions-Footnote-4557277 +Ref: Time Functions-Footnote-5557389 +Ref: Time Functions-Footnote-6557616 +Node: Bitwise Functions557882 +Ref: table-bitwise-ops558444 +Ref: Bitwise Functions-Footnote-1562772 +Node: Type Functions562944 +Node: I18N Functions564096 +Node: User-defined565743 +Node: Definition Syntax566548 +Ref: Definition Syntax-Footnote-1572207 +Node: Function Example572278 +Ref: Function Example-Footnote-1575199 +Node: Function Caveats575221 +Node: Calling A Function575739 +Node: Variable Scope576697 +Node: Pass By Value/Reference579690 +Node: Return Statement583187 +Node: Dynamic Typing586166 +Node: Indirect Calls587095 +Ref: Indirect Calls-Footnote-1597338 +Node: Functions Summary597466 +Node: Library Functions600168 +Ref: Library Functions-Footnote-1603776 +Ref: Library Functions-Footnote-2603919 +Node: Library Names604090 +Ref: Library Names-Footnote-1607548 +Ref: Library Names-Footnote-2607771 +Node: General Functions607857 +Node: Strtonum Function608960 +Node: Assert Function611982 +Node: Round Function615306 +Node: Cliff Random Function616847 +Node: Ordinal Functions617863 +Ref: Ordinal Functions-Footnote-1620926 +Ref: Ordinal Functions-Footnote-2621178 +Node: Join Function621389 +Ref: Join Function-Footnote-1623159 +Node: Getlocaltime Function623359 +Node: Readfile Function627103 +Node: Shell Quoting629075 +Node: Data File Management630476 +Node: Filetrans Function631108 +Node: Rewind Function635204 +Node: File Checking636590 +Ref: File Checking-Footnote-1637923 +Node: Empty Files638124 +Node: Ignoring Assigns640103 +Node: Getopt Function641653 +Ref: Getopt Function-Footnote-1653117 +Node: Passwd Functions653317 +Ref: Passwd Functions-Footnote-1662157 +Node: Group Functions662245 +Ref: Group Functions-Footnote-1670142 +Node: Walking Arrays670347 +Node: Library Functions Summary673353 +Node: Library Exercises674755 +Node: Sample Programs676035 +Node: Running Examples676805 +Node: Clones677533 +Node: Cut Program678757 +Node: Egrep Program688477 +Ref: Egrep Program-Footnote-1695980 +Node: Id Program696090 +Node: Split Program699766 +Ref: Split Program-Footnote-1703220 +Node: Tee Program703348 +Node: Uniq Program706137 +Node: Wc Program713556 +Ref: Wc Program-Footnote-1717806 +Node: Miscellaneous Programs717900 +Node: Dupword Program719113 +Node: Alarm Program721144 +Node: Translate Program725949 +Ref: Translate Program-Footnote-1730512 +Node: Labels Program730782 +Ref: Labels Program-Footnote-1734133 +Node: Word Sorting734217 +Node: History Sorting738287 +Node: Extract Program740122 +Node: Simple Sed747646 +Node: Igawk Program750716 +Ref: Igawk Program-Footnote-1765042 +Ref: Igawk Program-Footnote-2765243 +Ref: Igawk Program-Footnote-3765365 +Node: Anagram Program765480 +Node: Signature Program768541 +Node: Programs Summary769788 +Node: Programs Exercises771009 +Ref: Programs Exercises-Footnote-1775140 +Node: Advanced Features775231 +Node: Nondecimal Data777213 +Node: Array Sorting778803 +Node: Controlling Array Traversal779503 +Ref: Controlling Array Traversal-Footnote-1787869 +Node: Array Sorting Functions787987 +Ref: Array Sorting Functions-Footnote-1791873 +Node: Two-way I/O792069 +Ref: Two-way I/O-Footnote-1797014 +Ref: Two-way I/O-Footnote-2797200 +Node: TCP/IP Networking797282 +Node: Profiling800154 +Node: Advanced Features Summary807695 +Node: Internationalization809628 +Node: I18N and L10N811108 +Node: Explaining gettext811794 +Ref: Explaining gettext-Footnote-1816819 +Ref: Explaining gettext-Footnote-2817003 +Node: Programmer i18n817168 +Ref: Programmer i18n-Footnote-1822044 +Node: Translator i18n822093 +Node: String Extraction822887 +Ref: String Extraction-Footnote-1824018 +Node: Printf Ordering824104 +Ref: Printf Ordering-Footnote-1826890 +Node: I18N Portability826954 +Ref: I18N Portability-Footnote-1829410 +Node: I18N Example829473 +Ref: I18N Example-Footnote-1832276 +Node: Gawk I18N832348 +Node: I18N Summary832992 +Node: Debugger834332 +Node: Debugging835354 +Node: Debugging Concepts835795 +Node: Debugging Terms837605 +Node: Awk Debugging840177 +Node: Sample Debugging Session841083 +Node: Debugger Invocation841617 +Node: Finding The Bug843002 +Node: List of Debugger Commands849481 +Node: Breakpoint Control850813 +Node: Debugger Execution Control854490 +Node: Viewing And Changing Data857849 +Node: Execution Stack861225 +Node: Debugger Info862860 +Node: Miscellaneous Debugger Commands866905 +Node: Readline Support871906 +Node: Limitations872800 +Node: Debugging Summary874915 +Node: Arbitrary Precision Arithmetic876089 +Node: Computer Arithmetic877505 +Ref: table-numeric-ranges881082 +Ref: Computer Arithmetic-Footnote-1881606 +Node: Math Definitions881663 +Ref: table-ieee-formats884958 +Ref: Math Definitions-Footnote-1885562 +Node: MPFR features885667 +Node: FP Math Caution887338 +Ref: FP Math Caution-Footnote-1888388 +Node: Inexactness of computations888757 +Node: Inexact representation889716 +Node: Comparing FP Values891074 +Node: Errors accumulate892156 +Node: Getting Accuracy893588 +Node: Try To Round896292 +Node: Setting precision897191 +Ref: table-predefined-precision-strings897875 +Node: Setting the rounding mode899704 +Ref: table-gawk-rounding-modes900068 +Ref: Setting the rounding mode-Footnote-1903520 +Node: Arbitrary Precision Integers903699 +Ref: Arbitrary Precision Integers-Footnote-1906683 +Node: POSIX Floating Point Problems906832 +Ref: POSIX Floating Point Problems-Footnote-1910711 +Node: Floating point summary910749 +Node: Dynamic Extensions912936 +Node: Extension Intro914488 +Node: Plugin License915753 +Node: Extension Mechanism Outline916550 +Ref: figure-load-extension916978 +Ref: figure-register-new-function918458 +Ref: figure-call-new-function919462 +Node: Extension API Description921449 +Node: Extension API Functions Introduction922899 +Node: General Data Types927720 +Ref: General Data Types-Footnote-1933620 +Node: Memory Allocation Functions933919 +Ref: Memory Allocation Functions-Footnote-1936758 +Node: Constructor Functions936857 +Node: Registration Functions938596 +Node: Extension Functions939281 +Node: Exit Callback Functions941578 +Node: Extension Version String942826 +Node: Input Parsers943489 +Node: Output Wrappers953364 +Node: Two-way processors957877 +Node: Printing Messages960140 +Ref: Printing Messages-Footnote-1961216 +Node: Updating `ERRNO'961368 +Node: Requesting Values962108 +Ref: table-value-types-returned962835 +Node: Accessing Parameters963792 +Node: Symbol Table Access965026 +Node: Symbol table by name965540 +Node: Symbol table by cookie967560 +Ref: Symbol table by cookie-Footnote-1971705 +Node: Cached values971768 +Ref: Cached values-Footnote-1975264 +Node: Array Manipulation975355 +Ref: Array Manipulation-Footnote-1976453 +Node: Array Data Types976490 +Ref: Array Data Types-Footnote-1979145 +Node: Array Functions979237 +Node: Flattening Arrays983096 +Node: Creating Arrays989998 +Node: Extension API Variables994769 +Node: Extension Versioning995405 +Node: Extension API Informational Variables997296 +Node: Extension API Boilerplate998361 +Node: Finding Extensions1002170 +Node: Extension Example1002730 +Node: Internal File Description1003502 +Node: Internal File Ops1007569 +Ref: Internal File Ops-Footnote-11019320 +Node: Using Internal File Ops1019460 +Ref: Using Internal File Ops-Footnote-11021843 +Node: Extension Samples1022116 +Node: Extension Sample File Functions1023644 +Node: Extension Sample Fnmatch1031325 +Node: Extension Sample Fork1032813 +Node: Extension Sample Inplace1034028 +Node: Extension Sample Ord1036114 +Node: Extension Sample Readdir1036950 +Ref: table-readdir-file-types1037827 +Node: Extension Sample Revout1038638 +Node: Extension Sample Rev2way1039227 +Node: Extension Sample Read write array1039967 +Node: Extension Sample Readfile1041907 +Node: Extension Sample Time1043002 +Node: Extension Sample API Tests1044350 +Node: gawkextlib1044841 +Node: Extension summary1047519 +Node: Extension Exercises1051208 +Node: Language History1052704 +Node: V7/SVR3.11054360 +Node: SVR41056513 +Node: POSIX1057947 +Node: BTL1059328 +Node: POSIX/GNU1060059 +Node: Feature History1065580 +Node: Common Extensions1078678 +Node: Ranges and Locales1080050 +Ref: Ranges and Locales-Footnote-11084669 +Ref: Ranges and Locales-Footnote-21084696 +Ref: Ranges and Locales-Footnote-31084931 +Node: Contributors1085152 +Node: History summary1090692 +Node: Installation1092071 +Node: Gawk Distribution1093017 +Node: Getting1093501 +Node: Extracting1094324 +Node: Distribution contents1095961 +Node: Unix Installation1101715 +Node: Quick Installation1102332 +Node: Additional Configuration Options1104756 +Node: Configuration Philosophy1106559 +Node: Non-Unix Installation1108928 +Node: PC Installation1109386 +Node: PC Binary Installation1110706 +Node: PC Compiling1112554 +Ref: PC Compiling-Footnote-11115575 +Node: PC Testing1115684 +Node: PC Using1116860 +Node: Cygwin1120975 +Node: MSYS1121745 +Node: VMS Installation1122246 +Node: VMS Compilation1123038 +Ref: VMS Compilation-Footnote-11124267 +Node: VMS Dynamic Extensions1124325 +Node: VMS Installation Details1126009 +Node: VMS Running1128260 +Node: VMS GNV1131100 +Node: VMS Old Gawk1131835 +Node: Bugs1132305 +Node: Other Versions1136194 +Node: Installation summary1142628 +Node: Notes1143687 +Node: Compatibility Mode1144552 +Node: Additions1145334 +Node: Accessing The Source1146259 +Node: Adding Code1147694 +Node: New Ports1153851 +Node: Derived Files1158333 +Ref: Derived Files-Footnote-11163808 +Ref: Derived Files-Footnote-21163842 +Ref: Derived Files-Footnote-31164438 +Node: Future Extensions1164552 +Node: Implementation Limitations1165158 +Node: Extension Design1166406 +Node: Old Extension Problems1167560 +Ref: Old Extension Problems-Footnote-11169077 +Node: Extension New Mechanism Goals1169134 +Ref: Extension New Mechanism Goals-Footnote-11172494 +Node: Extension Other Design Decisions1172683 +Node: Extension Future Growth1174791 +Node: Old Extension Mechanism1175627 +Node: Notes summary1177389 +Node: Basic Concepts1178575 +Node: Basic High Level1179256 +Ref: figure-general-flow1179528 +Ref: figure-process-flow1180127 +Ref: Basic High Level-Footnote-11183356 +Node: Basic Data Typing1183541 +Node: Glossary1186869 +Node: Copying1218798 +Node: GNU Free Documentation License1256354 +Node: Index1281490  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index d23b2128..eb2e968b 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -16991,8 +16991,8 @@ function randint(n) @end example @noindent -The multiplication produces a random number greater than zero and less -than @code{n}. Using @code{int()}, this result is made into +The multiplication produces a random number greater than or equal to +zero and less than @code{n}. Using @code{int()}, this result is made into an integer between zero and @code{n} @minus{} 1, inclusive. The following example uses a similar function to produce random integers diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 8e7d4010..706754e2 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -16273,8 +16273,8 @@ function randint(n) @end example @noindent -The multiplication produces a random number greater than zero and less -than @code{n}. Using @code{int()}, this result is made into +The multiplication produces a random number greater than or equal to +zero and less than @code{n}. Using @code{int()}, this result is made into an integer between zero and @code{n} @minus{} 1, inclusive. The following example uses a similar function to produce random integers -- cgit v1.2.3 From ddc290584b39bab2c1edcec935a31ea12d343246 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 3 Apr 2015 09:08:54 +0300 Subject: Rename "div()" to "intdiv()". --- ChangeLog | 9 + awk.h | 4 +- awkgram.c | 6 +- awkgram.y | 6 +- awklib/eg/lib/div.awk | 17 -- awklib/eg/lib/intdiv.awk | 20 ++ awklib/eg/prog/pi.awk | 2 +- builtin.c | 12 +- doc/ChangeLog | 4 + doc/awkcard.in | 6 +- doc/gawk.1 | 16 +- doc/gawk.info | 711 ++++++++++++++++++++++++----------------------- doc/gawk.texi | 59 ++-- doc/gawktexi.in | 59 ++-- mpfr.c | 12 +- test/ChangeLog | 4 + test/id.ok | 2 +- test/mpfrsqrt.awk | 6 +- 18 files changed, 491 insertions(+), 464 deletions(-) delete mode 100644 awklib/eg/lib/div.awk create mode 100644 awklib/eg/lib/intdiv.awk diff --git a/ChangeLog b/ChangeLog index 9b2490bb..0a395564 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-04-02 Arnold D. Robbins + + Rename div() to intdiv(). + + * builtin.c (do_intdiv): Renamed from do_div. + * mfpr.c (do_mpfr_intdiv): Renamed from do_mpfr_div. + * awk.h: Update declarations. + * awkgram.y (tokentab, snode): Revise accordingly. + 2015-03-31 Arnold D. Robbins * awk.h (call_sub): Renamed from call_sub_func. diff --git a/awk.h b/awk.h index 384e6f16..6f812e71 100644 --- a/awk.h +++ b/awk.h @@ -1383,7 +1383,7 @@ extern AWKNUM nondec2awknum(char *str, size_t len); extern NODE *do_dcgettext(int nargs); extern NODE *do_dcngettext(int nargs); extern NODE *do_bindtextdomain(int nargs); -extern NODE *do_div(int nargs); +extern NODE *do_intdiv(int nargs); extern int strncasecmpmbs(const unsigned char *, const unsigned char *, size_t); /* eval.c */ @@ -1526,9 +1526,9 @@ extern NODE *do_mpfr_and(int); extern NODE *do_mpfr_atan2(int); extern NODE *do_mpfr_compl(int); extern NODE *do_mpfr_cos(int); -extern NODE *do_mpfr_div(int); extern NODE *do_mpfr_exp(int); extern NODE *do_mpfr_int(int); +extern NODE *do_mpfr_intdiv(int); extern NODE *do_mpfr_log(int); extern NODE *do_mpfr_lshift(int); extern NODE *do_mpfr_or(int); diff --git a/awkgram.c b/awkgram.c index 40f5d286..67c8feae 100644 --- a/awkgram.c +++ b/awkgram.c @@ -4287,7 +4287,6 @@ static const struct token tokentab[] = { {"dcngettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext, 0}, {"default", Op_K_default, LEX_DEFAULT, GAWKX, 0, 0}, {"delete", Op_K_delete, LEX_DELETE, NOT_OLD, 0, 0}, -{"div", Op_builtin, LEX_BUILTIN, GAWKX|A(3), do_div, MPF(div)}, {"do", Op_K_do, LEX_DO, NOT_OLD|BREAK|CONTINUE, 0, 0}, {"else", Op_K_else, LEX_ELSE, 0, 0, 0}, {"eval", Op_symbol, LEX_EVAL, 0, 0, 0}, @@ -4308,6 +4307,7 @@ static const struct token tokentab[] = { {"include", Op_symbol, LEX_INCLUDE, GAWKX, 0, 0}, {"index", Op_builtin, LEX_BUILTIN, A(2), do_index, 0}, {"int", Op_builtin, LEX_BUILTIN, A(1), do_int, MPF(int)}, +{"intdiv", Op_builtin, LEX_BUILTIN, GAWKX|A(3), do_intdiv, MPF(intdiv)}, {"isarray", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_isarray, 0}, {"length", Op_builtin, LEX_LENGTH, A(0)|A(1), do_length, 0}, {"load", Op_symbol, LEX_LOAD, GAWKX, 0, 0}, @@ -6481,9 +6481,9 @@ snode(INSTRUCTION *subn, INSTRUCTION *r) arg = subn->nexti; if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push) arg->nexti->opcode = Op_push_arg; /* argument may be array */ - } else if (r->builtin == do_div + } else if (r->builtin == do_intdiv #ifdef HAVE_MPFR - || r->builtin == MPF(div) + || r->builtin == MPF(intdiv) #endif ) { arg = subn->nexti->lasti->nexti->lasti->nexti; /* 3rd arg list */ diff --git a/awkgram.y b/awkgram.y index 4092a177..e04c2c65 100644 --- a/awkgram.y +++ b/awkgram.y @@ -1949,7 +1949,6 @@ static const struct token tokentab[] = { {"dcngettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext, 0}, {"default", Op_K_default, LEX_DEFAULT, GAWKX, 0, 0}, {"delete", Op_K_delete, LEX_DELETE, NOT_OLD, 0, 0}, -{"div", Op_builtin, LEX_BUILTIN, GAWKX|A(3), do_div, MPF(div)}, {"do", Op_K_do, LEX_DO, NOT_OLD|BREAK|CONTINUE, 0, 0}, {"else", Op_K_else, LEX_ELSE, 0, 0, 0}, {"eval", Op_symbol, LEX_EVAL, 0, 0, 0}, @@ -1970,6 +1969,7 @@ static const struct token tokentab[] = { {"include", Op_symbol, LEX_INCLUDE, GAWKX, 0, 0}, {"index", Op_builtin, LEX_BUILTIN, A(2), do_index, 0}, {"int", Op_builtin, LEX_BUILTIN, A(1), do_int, MPF(int)}, +{"intdiv", Op_builtin, LEX_BUILTIN, GAWKX|A(3), do_intdiv, MPF(intdiv)}, {"isarray", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_isarray, 0}, {"length", Op_builtin, LEX_LENGTH, A(0)|A(1), do_length, 0}, {"load", Op_symbol, LEX_LOAD, GAWKX, 0, 0}, @@ -4143,9 +4143,9 @@ snode(INSTRUCTION *subn, INSTRUCTION *r) arg = subn->nexti; if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push) arg->nexti->opcode = Op_push_arg; /* argument may be array */ - } else if (r->builtin == do_div + } else if (r->builtin == do_intdiv #ifdef HAVE_MPFR - || r->builtin == MPF(div) + || r->builtin == MPF(intdiv) #endif ) { arg = subn->nexti->lasti->nexti->lasti->nexti; /* 3rd arg list */ diff --git a/awklib/eg/lib/div.awk b/awklib/eg/lib/div.awk deleted file mode 100644 index 5939024d..00000000 --- a/awklib/eg/lib/div.awk +++ /dev/null @@ -1,17 +0,0 @@ -# div --- do integer division - -# -# Arnold Robbins, arnold@skeeve.com, Public Domain -# July, 2014 - -function div(numerator, denominator, result) -{ - split("", result) - - numerator = int(numerator) - denominator = int(denominator) - result["quotient"] = int(numerator / denominator) - result["remainder"] = int(numerator % denominator) - - return 0.0 -} diff --git a/awklib/eg/lib/intdiv.awk b/awklib/eg/lib/intdiv.awk new file mode 100644 index 00000000..dbc553b0 --- /dev/null +++ b/awklib/eg/lib/intdiv.awk @@ -0,0 +1,20 @@ +# intdiv --- do integer division + +# +# Arnold Robbins, arnold@skeeve.com, Public Domain +# July, 2014 +# +# Name changed from div() to intdiv() +# April, 2015 + +function intdiv(numerator, denominator, result) +{ + split("", result) + + numerator = int(numerator) + denominator = int(denominator) + result["quotient"] = int(numerator / denominator) + result["remainder"] = int(numerator % denominator) + + return 0.0 +} diff --git a/awklib/eg/prog/pi.awk b/awklib/eg/prog/pi.awk index 3297beff..e1b5bc4f 100644 --- a/awklib/eg/prog/pi.awk +++ b/awklib/eg/prog/pi.awk @@ -10,7 +10,7 @@ BEGIN { for (m = digits * 4; m > 0; --m) { d = m * 2 + 1 x = pi * m - div(x, d, result) + intdiv(x, d, result) pi = result["quotient"] pi = pi + two } diff --git a/builtin.c b/builtin.c index 99293b9a..b70176dc 100644 --- a/builtin.c +++ b/builtin.c @@ -3752,7 +3752,7 @@ do_bindtextdomain(int nargs) return make_string(the_result, strlen(the_result)); } -/* do_div --- do integer division, return quotient and remainder in dest array */ +/* do_intdiv --- do integer division, return quotient and remainder in dest array */ /* * We define the semantics as: @@ -3763,7 +3763,7 @@ do_bindtextdomain(int nargs) */ NODE * -do_div(int nargs) +do_intdiv(int nargs) { NODE *numerator, *denominator, *result; double num, denom, quotient, remainder; @@ -3771,7 +3771,7 @@ do_div(int nargs) result = POP_PARAM(); if (result->type != Node_var_array) - fatal(_("div: third argument is not an array")); + fatal(_("intdiv: third argument is not an array")); assoc_clear(result); denominator = POP_SCALAR(); @@ -3779,9 +3779,9 @@ do_div(int nargs) if (do_lint) { if ((numerator->flags & (NUMCUR|NUMBER)) == 0) - lintwarn(_("div: received non-numeric first argument")); + lintwarn(_("intdiv: received non-numeric first argument")); if ((denominator->flags & (NUMCUR|NUMBER)) == 0) - lintwarn(_("div: received non-numeric second argument")); + lintwarn(_("intdiv: received non-numeric second argument")); } (void) force_number(numerator); @@ -3790,7 +3790,7 @@ do_div(int nargs) denom = double_to_int(get_number_d(denominator)); if (denom == 0.0) - fatal(_("div: division by zero attempted")); + fatal(_("intdiv: division by zero attempted")); quotient = double_to_int(num / denom); /* diff --git a/doc/ChangeLog b/doc/ChangeLog index e41bf158..0e88c869 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-04-02 Arnold D. Robbins + + * gawktexi.in, gawk.1, awkcard.in: Name change: div() --> intdiv(). + 2015-03-31 Arnold D. Robbins * gawktexi.in: Update discussion of calling built-in functions diff --git a/doc/awkcard.in b/doc/awkcard.in index 556bdc1e..2e455b2d 100644 --- a/doc/awkcard.in +++ b/doc/awkcard.in @@ -1609,11 +1609,11 @@ expand; l lw(2i). \*(CD\*(FCatan2(\*(FIy\*(FC, \*(FIx\*(FC)\*(FR The arctangent of \*(FIy/x\fP in radians. \*(FCcos(\*(FIexpr\*(FC)\*(FR The cosine of \*(FIexpr\fP, which is in radians. -\*(CB\*(FCdiv(\*(FIn\*(FR\*(FC,\*(FI d\*(FR\*(FC,\*(FI res\*(FR\*(FC)\*(FR T{ -Return the result of integer division in \*(FIres\*(FR.\*(CD -T} \*(FCexp(\*(FIexpr\*(FC)\*(FR The exponential function (\*(FIe \*(FC^ \*(FIx\*(FR). \*(FCint(\*(FIexpr\*(FC)\*(FR Truncate to integer. +\*(CB\*(FCintdiv(\*(FIn\*(FR\*(FC,\*(FI d\*(FR\*(FC,\*(FI res\*(FR\*(FC)\*(FR T{ +Return the result of integer division in \*(FIres\*(FR.\*(CD +T} \*(FClog(\*(FIexpr\*(FC)\*(FR The natural logarithm function (base \*(FIe\^\*(FR). \*(FCrand()\fP A random number \*(FIN\fP such that 0 \(<= \*(FIN\fP < 1. \*(FCsin(\*(FIexpr\*(FC)\*(FR The sine of \*(FIexpr\fP, which is in radians. diff --git a/doc/gawk.1 b/doc/gawk.1 index 45a4c9f2..cbc15d15 100644 --- a/doc/gawk.1 +++ b/doc/gawk.1 @@ -13,7 +13,7 @@ . if \w'\(rq' .ds rq "\(rq . \} .\} -.TH GAWK 1 "Mar 24 2015" "Free Software Foundation" "Utility Commands" +.TH GAWK 1 "Apr 02 2015" "Free Software Foundation" "Utility Commands" .SH NAME gawk \- pattern scanning and processing language .SH SYNOPSIS @@ -2680,7 +2680,13 @@ Return the cosine of .IR expr , which is in radians. .TP -.BI div( num ", " denom ", " result ) +.BI exp( expr ) +The exponential function. +.TP +.BI int( expr ) +Truncate to integer. +.TP +.BI intdiv( num ", " denom ", " result ) Truncate .I num and @@ -2697,12 +2703,6 @@ This is a extension, primarily of value when working with arbitrarily large integers. .TP -.BI exp( expr ) -The exponential function. -.TP -.BI int( expr ) -Truncate to integer. -.TP .BI log( expr ) The natural logarithm function. .TP diff --git a/doc/gawk.info b/doc/gawk.info index 24a4a638..685df45b 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -12031,7 +12031,17 @@ brackets ([ ]): `cos(X)' Return the cosine of X, with X in radians. -`div(NUMERATOR, DENOMINATOR, RESULT)' +`exp(X)' + Return the exponential of X (`e ^ X') or report an error if X is + out of range. The range of values X can have depends on your + machine's floating-point representation. + +`int(X)' + Return the nearest integer to X, located between X and zero and + truncated toward zero. For example, `int(3)' is 3, `int(3.9)' is + 3, `int(-3.9)' is -3, and `int(-3)' is -3 as well. + +`intdiv(NUMERATOR, DENOMINATOR, RESULT)' Perform integer division, similar to the standard C function of the same name. First, truncate `numerator' and `denominator' towards zero, creating integer values. Clear the `result' array, and then @@ -12046,16 +12056,6 @@ brackets ([ ]): This function is a `gawk' extension. It is not available in compatibility mode (*note Options::). -`exp(X)' - Return the exponential of X (`e ^ X') or report an error if X is - out of range. The range of values X can have depends on your - machine's floating-point representation. - -`int(X)' - Return the nearest integer to X, located between X and zero and - truncated toward zero. For example, `int(3)' is 3, `int(3.9)' is - 3, `int(-3.9)' is -3, and `int(-3)' is -3 as well. - `log(X)' Return the natural logarithm of X, if X is positive; otherwise, return `NaN' ("not a number") on IEEE 754 systems. Additionally, @@ -22618,14 +22618,15 @@ the following: `%', the result is typically an arbitrary precision floating point value (unless the denominator evenly divides into the numerator). In order to do integer division or remainder with arbitrary precision -integers, use the built-in `div()' function (*note Numeric Functions::). +integers, use the built-in `intdiv()' function (*note Numeric +Functions::). - You can simulate the `div()' function in standard `awk' using this -user-defined function: + You can simulate the `intdiv()' function in standard `awk' using +this user-defined function: - # div --- do integer division + # intdiv --- do integer division - function div(numerator, denominator, result) + function intdiv(numerator, denominator, result) { split("", result) @@ -22638,8 +22639,8 @@ user-defined function: } The following example program, contributed by Katie Wasserman, uses -`div()' to compute the digits of pi to as many places as you choose to -set: +`intdiv()' to compute the digits of pi to as many places as you choose +to set: # pi.awk --- compute the digits of pi @@ -22650,7 +22651,7 @@ set: for (m = digits * 4; m > 0; --m) { d = m * 2 + 1 x = pi * m - div(x, d, result) + intdiv(x, d, result) pi = result["quotient"] pi = pi + two } @@ -26752,8 +26753,8 @@ the current version of `gawk'. - The `bindtextdomain()', `dcgettext()', and `dcngettext()' functions for internationalization (*note Programmer i18n::) - - The `div()' function for doing integer division and remainder - (*note Numeric Functions::) + - The `intdiv()' function for doing integer division and + remainder (*note Numeric Functions::) * Changes and/or additions in the command-line options: @@ -27213,7 +27214,7 @@ in POSIX `awk', in the order they were added to `gawk'. * The `igawk' program and its manual page are no longer installed when `gawk' is built. *Note Igawk Program::. - * The `div()' function. *Note Numeric Functions::. + * The `intdiv()' function. *Note Numeric Functions::. * The maximum number of hexdecimal digits in `\x' escapes is now two. *Note Escape Sequences::. @@ -32941,7 +32942,6 @@ Index * display debugger command: Viewing And Changing Data. (line 8) * display debugger options: Debugger Info. (line 57) -* div: Numeric Functions. (line 18) * division: Arithmetic Ops. (line 44) * do-while statement: Do Statement. (line 6) * do-while statement, use of regexps in: Regexp Usage. (line 19) @@ -33061,10 +33061,10 @@ Index * exit status, of VMS: VMS Running. (line 28) * exit the debugger: Miscellaneous Debugger Commands. (line 99) -* exp: Numeric Functions. (line 33) +* exp: Numeric Functions. (line 18) * expand utility: Very Simple. (line 73) * Expat XML parser library: gawkextlib. (line 37) -* exponent: Numeric Functions. (line 33) +* exponent: Numeric Functions. (line 18) * expressions: Expressions. (line 6) * expressions, as patterns: Expression Patterns. (line 6) * expressions, assignment: Assignment Ops. (line 6) @@ -33608,8 +33608,9 @@ Index * installation, VMS: VMS Installation. (line 6) * installing gawk: Installation. (line 6) * instruction tracing, in debugger: Debugger Info. (line 90) -* int: Numeric Functions. (line 38) +* int: Numeric Functions. (line 23) * INT signal (MS-Windows): Profiling. (line 213) +* intdiv: Numeric Functions. (line 28) * integer array indices: Numeric Array Subscripts. (line 31) * integers, arbitrary precision: Arbitrary Precision Integers. @@ -34349,7 +34350,7 @@ Index * Robbins, Miriam <2>: Getline/Pipe. (line 39) * Robbins, Miriam: Acknowledgments. (line 94) * Rommel, Kai Uwe: Contributors. (line 42) -* round to nearest integer: Numeric Functions. (line 38) +* round to nearest integer: Numeric Functions. (line 23) * round() user-defined function: Round Function. (line 16) * rounding numbers: Round Function. (line 6) * ROUNDMODE variable: User-modified. (line 127) @@ -35126,333 +35127,333 @@ Node: Functions504950 Node: Built-in505989 Node: Calling Built-in507067 Node: Numeric Functions509062 -Ref: Numeric Functions-Footnote-1513892 -Ref: Numeric Functions-Footnote-2514249 -Ref: Numeric Functions-Footnote-3514297 -Node: String Functions514569 -Ref: String Functions-Footnote-1538070 -Ref: String Functions-Footnote-2538199 -Ref: String Functions-Footnote-3538447 -Node: Gory Details538534 -Ref: table-sub-escapes540315 -Ref: table-sub-proposed541830 -Ref: table-posix-sub543192 -Ref: table-gensub-escapes544729 -Ref: Gory Details-Footnote-1545562 -Node: I/O Functions545713 -Ref: I/O Functions-Footnote-1552949 -Node: Time Functions553096 -Ref: Time Functions-Footnote-1563605 -Ref: Time Functions-Footnote-2563673 -Ref: Time Functions-Footnote-3563831 -Ref: Time Functions-Footnote-4563942 -Ref: Time Functions-Footnote-5564054 -Ref: Time Functions-Footnote-6564281 -Node: Bitwise Functions564547 -Ref: table-bitwise-ops565109 -Ref: Bitwise Functions-Footnote-1569437 -Node: Type Functions569609 -Node: I18N Functions570761 -Node: User-defined572408 -Node: Definition Syntax573213 -Ref: Definition Syntax-Footnote-1578872 -Node: Function Example578943 -Ref: Function Example-Footnote-1581864 -Node: Function Caveats581886 -Node: Calling A Function582404 -Node: Variable Scope583362 -Node: Pass By Value/Reference586355 -Node: Return Statement589852 -Node: Dynamic Typing592831 -Node: Indirect Calls593760 -Ref: Indirect Calls-Footnote-1604003 -Node: Functions Summary604131 -Node: Library Functions606833 -Ref: Library Functions-Footnote-1610441 -Ref: Library Functions-Footnote-2610584 -Node: Library Names610755 -Ref: Library Names-Footnote-1614213 -Ref: Library Names-Footnote-2614436 -Node: General Functions614522 -Node: Strtonum Function615625 -Node: Assert Function618647 -Node: Round Function621971 -Node: Cliff Random Function623512 -Node: Ordinal Functions624528 -Ref: Ordinal Functions-Footnote-1627591 -Ref: Ordinal Functions-Footnote-2627843 -Node: Join Function628054 -Ref: Join Function-Footnote-1629824 -Node: Getlocaltime Function630024 -Node: Readfile Function633768 -Node: Shell Quoting635740 -Node: Data File Management637141 -Node: Filetrans Function637773 -Node: Rewind Function641869 -Node: File Checking643255 -Ref: File Checking-Footnote-1644588 -Node: Empty Files644789 -Node: Ignoring Assigns646768 -Node: Getopt Function648318 -Ref: Getopt Function-Footnote-1659782 -Node: Passwd Functions659982 -Ref: Passwd Functions-Footnote-1668822 -Node: Group Functions668910 -Ref: Group Functions-Footnote-1676807 -Node: Walking Arrays677012 -Node: Library Functions Summary680018 -Node: Library Exercises681420 -Node: Sample Programs682700 -Node: Running Examples683470 -Node: Clones684198 -Node: Cut Program685422 -Node: Egrep Program695142 -Ref: Egrep Program-Footnote-1702645 -Node: Id Program702755 -Node: Split Program706431 -Ref: Split Program-Footnote-1709885 -Node: Tee Program710013 -Node: Uniq Program712802 -Node: Wc Program720221 -Ref: Wc Program-Footnote-1724471 -Node: Miscellaneous Programs724565 -Node: Dupword Program725778 -Node: Alarm Program727809 -Node: Translate Program732614 -Ref: Translate Program-Footnote-1737177 -Node: Labels Program737447 -Ref: Labels Program-Footnote-1740798 -Node: Word Sorting740882 -Node: History Sorting744952 -Node: Extract Program746787 -Node: Simple Sed754311 -Node: Igawk Program757381 -Ref: Igawk Program-Footnote-1771707 -Ref: Igawk Program-Footnote-2771908 -Ref: Igawk Program-Footnote-3772030 -Node: Anagram Program772145 -Node: Signature Program775206 -Node: Programs Summary776453 -Node: Programs Exercises777674 -Ref: Programs Exercises-Footnote-1781805 -Node: Advanced Features781896 -Node: Nondecimal Data783878 -Node: Array Sorting785468 -Node: Controlling Array Traversal786168 -Ref: Controlling Array Traversal-Footnote-1794534 -Node: Array Sorting Functions794652 -Ref: Array Sorting Functions-Footnote-1798538 -Node: Two-way I/O798734 -Ref: Two-way I/O-Footnote-1803679 -Ref: Two-way I/O-Footnote-2803865 -Node: TCP/IP Networking803947 -Node: Profiling806819 -Node: Advanced Features Summary815090 -Node: Internationalization817023 -Node: I18N and L10N818503 -Node: Explaining gettext819189 -Ref: Explaining gettext-Footnote-1824214 -Ref: Explaining gettext-Footnote-2824398 -Node: Programmer i18n824563 -Ref: Programmer i18n-Footnote-1829439 -Node: Translator i18n829488 -Node: String Extraction830282 -Ref: String Extraction-Footnote-1831413 -Node: Printf Ordering831499 -Ref: Printf Ordering-Footnote-1834285 -Node: I18N Portability834349 -Ref: I18N Portability-Footnote-1836805 -Node: I18N Example836868 -Ref: I18N Example-Footnote-1839671 -Node: Gawk I18N839743 -Node: I18N Summary840387 -Node: Debugger841727 -Node: Debugging842749 -Node: Debugging Concepts843190 -Node: Debugging Terms845000 -Node: Awk Debugging847572 -Node: Sample Debugging Session848478 -Node: Debugger Invocation849012 -Node: Finding The Bug850397 -Node: List of Debugger Commands856876 -Node: Breakpoint Control858208 -Node: Debugger Execution Control861885 -Node: Viewing And Changing Data865244 -Node: Execution Stack868620 -Node: Debugger Info870255 -Node: Miscellaneous Debugger Commands874300 -Node: Readline Support879301 -Node: Limitations880195 -Node: Debugging Summary882310 -Node: Arbitrary Precision Arithmetic883484 -Node: Computer Arithmetic884900 -Ref: table-numeric-ranges888477 -Ref: Computer Arithmetic-Footnote-1889001 -Node: Math Definitions889058 -Ref: table-ieee-formats892353 -Ref: Math Definitions-Footnote-1892957 -Node: MPFR features893062 -Node: FP Math Caution894733 -Ref: FP Math Caution-Footnote-1895783 -Node: Inexactness of computations896152 -Node: Inexact representation897111 -Node: Comparing FP Values898469 -Node: Errors accumulate899551 -Node: Getting Accuracy900983 -Node: Try To Round903687 -Node: Setting precision904586 -Ref: table-predefined-precision-strings905270 -Node: Setting the rounding mode907099 -Ref: table-gawk-rounding-modes907463 -Ref: Setting the rounding mode-Footnote-1910915 -Node: Arbitrary Precision Integers911094 -Ref: Arbitrary Precision Integers-Footnote-1915992 -Node: POSIX Floating Point Problems916141 -Ref: POSIX Floating Point Problems-Footnote-1920020 -Node: Floating point summary920058 -Node: Dynamic Extensions922245 -Node: Extension Intro923797 -Node: Plugin License925062 -Node: Extension Mechanism Outline925859 -Ref: figure-load-extension926287 -Ref: figure-register-new-function927767 -Ref: figure-call-new-function928771 -Node: Extension API Description930758 -Node: Extension API Functions Introduction932292 -Node: General Data Types937161 -Ref: General Data Types-Footnote-1943061 -Node: Memory Allocation Functions943360 -Ref: Memory Allocation Functions-Footnote-1946199 -Node: Constructor Functions946298 -Node: Registration Functions948037 -Node: Extension Functions948722 -Node: Exit Callback Functions951019 -Node: Extension Version String952267 -Node: Input Parsers952930 -Node: Output Wrappers962805 -Node: Two-way processors967318 -Node: Printing Messages969581 -Ref: Printing Messages-Footnote-1970657 -Node: Updating `ERRNO'970809 -Node: Requesting Values971549 -Ref: table-value-types-returned972276 -Node: Accessing Parameters973233 -Node: Symbol Table Access974467 -Node: Symbol table by name974981 -Node: Symbol table by cookie977001 -Ref: Symbol table by cookie-Footnote-1981146 -Node: Cached values981209 -Ref: Cached values-Footnote-1984705 -Node: Array Manipulation984796 -Ref: Array Manipulation-Footnote-1985886 -Node: Array Data Types985923 -Ref: Array Data Types-Footnote-1988578 -Node: Array Functions988670 -Node: Flattening Arrays992529 -Node: Creating Arrays999431 -Node: Redirection API1004202 -Node: Extension API Variables1007027 -Node: Extension Versioning1007660 -Node: Extension API Informational Variables1009551 -Node: Extension API Boilerplate1010616 -Node: Finding Extensions1014425 -Node: Extension Example1014985 -Node: Internal File Description1015757 -Node: Internal File Ops1019824 -Ref: Internal File Ops-Footnote-11031575 -Node: Using Internal File Ops1031715 -Ref: Using Internal File Ops-Footnote-11034098 -Node: Extension Samples1034371 -Node: Extension Sample File Functions1035899 -Node: Extension Sample Fnmatch1043580 -Node: Extension Sample Fork1045068 -Node: Extension Sample Inplace1046283 -Node: Extension Sample Ord1048369 -Node: Extension Sample Readdir1049205 -Ref: table-readdir-file-types1050082 -Node: Extension Sample Revout1050893 -Node: Extension Sample Rev2way1051482 -Node: Extension Sample Read write array1052222 -Node: Extension Sample Readfile1054162 -Node: Extension Sample Time1055257 -Node: Extension Sample API Tests1056605 -Node: gawkextlib1057096 -Node: Extension summary1059797 -Node: Extension Exercises1063486 -Node: Language History1064982 -Node: V7/SVR3.11066638 -Node: SVR41068791 -Node: POSIX1070225 -Node: BTL1071606 -Node: POSIX/GNU1072337 -Node: Feature History1078173 -Node: Common Extensions1091967 -Node: Ranges and Locales1093339 -Ref: Ranges and Locales-Footnote-11097958 -Ref: Ranges and Locales-Footnote-21097985 -Ref: Ranges and Locales-Footnote-31098220 -Node: Contributors1098441 -Node: History summary1103981 -Node: Installation1105360 -Node: Gawk Distribution1106306 -Node: Getting1106790 -Node: Extracting1107613 -Node: Distribution contents1109250 -Node: Unix Installation1115352 -Node: Quick Installation1116035 -Node: Shell Startup Files1118446 -Node: Additional Configuration Options1119525 -Node: Configuration Philosophy1121329 -Node: Non-Unix Installation1123698 -Node: PC Installation1124156 -Node: PC Binary Installation1125476 -Node: PC Compiling1127324 -Ref: PC Compiling-Footnote-11130345 -Node: PC Testing1130454 -Node: PC Using1131630 -Node: Cygwin1135745 -Node: MSYS1136515 -Node: VMS Installation1137016 -Node: VMS Compilation1137808 -Ref: VMS Compilation-Footnote-11139037 -Node: VMS Dynamic Extensions1139095 -Node: VMS Installation Details1140779 -Node: VMS Running1143030 -Node: VMS GNV1145870 -Node: VMS Old Gawk1146605 -Node: Bugs1147075 -Node: Other Versions1150964 -Node: Installation summary1157398 -Node: Notes1158457 -Node: Compatibility Mode1159322 -Node: Additions1160104 -Node: Accessing The Source1161029 -Node: Adding Code1162464 -Node: New Ports1168621 -Node: Derived Files1173103 -Ref: Derived Files-Footnote-11178578 -Ref: Derived Files-Footnote-21178612 -Ref: Derived Files-Footnote-31179208 -Node: Future Extensions1179322 -Node: Implementation Limitations1179928 -Node: Extension Design1181176 -Node: Old Extension Problems1182330 -Ref: Old Extension Problems-Footnote-11183847 -Node: Extension New Mechanism Goals1183904 -Ref: Extension New Mechanism Goals-Footnote-11187264 -Node: Extension Other Design Decisions1187453 -Node: Extension Future Growth1189561 -Node: Old Extension Mechanism1190397 -Node: Notes summary1192159 -Node: Basic Concepts1193345 -Node: Basic High Level1194026 -Ref: figure-general-flow1194298 -Ref: figure-process-flow1194897 -Ref: Basic High Level-Footnote-11198126 -Node: Basic Data Typing1198311 -Node: Glossary1201639 -Node: Copying1233568 -Node: GNU Free Documentation License1271124 -Node: Index1296260 +Ref: Numeric Functions-Footnote-1513895 +Ref: Numeric Functions-Footnote-2514252 +Ref: Numeric Functions-Footnote-3514300 +Node: String Functions514572 +Ref: String Functions-Footnote-1538073 +Ref: String Functions-Footnote-2538202 +Ref: String Functions-Footnote-3538450 +Node: Gory Details538537 +Ref: table-sub-escapes540318 +Ref: table-sub-proposed541833 +Ref: table-posix-sub543195 +Ref: table-gensub-escapes544732 +Ref: Gory Details-Footnote-1545565 +Node: I/O Functions545716 +Ref: I/O Functions-Footnote-1552952 +Node: Time Functions553099 +Ref: Time Functions-Footnote-1563608 +Ref: Time Functions-Footnote-2563676 +Ref: Time Functions-Footnote-3563834 +Ref: Time Functions-Footnote-4563945 +Ref: Time Functions-Footnote-5564057 +Ref: Time Functions-Footnote-6564284 +Node: Bitwise Functions564550 +Ref: table-bitwise-ops565112 +Ref: Bitwise Functions-Footnote-1569440 +Node: Type Functions569612 +Node: I18N Functions570764 +Node: User-defined572411 +Node: Definition Syntax573216 +Ref: Definition Syntax-Footnote-1578875 +Node: Function Example578946 +Ref: Function Example-Footnote-1581867 +Node: Function Caveats581889 +Node: Calling A Function582407 +Node: Variable Scope583365 +Node: Pass By Value/Reference586358 +Node: Return Statement589855 +Node: Dynamic Typing592834 +Node: Indirect Calls593763 +Ref: Indirect Calls-Footnote-1604006 +Node: Functions Summary604134 +Node: Library Functions606836 +Ref: Library Functions-Footnote-1610444 +Ref: Library Functions-Footnote-2610587 +Node: Library Names610758 +Ref: Library Names-Footnote-1614216 +Ref: Library Names-Footnote-2614439 +Node: General Functions614525 +Node: Strtonum Function615628 +Node: Assert Function618650 +Node: Round Function621974 +Node: Cliff Random Function623515 +Node: Ordinal Functions624531 +Ref: Ordinal Functions-Footnote-1627594 +Ref: Ordinal Functions-Footnote-2627846 +Node: Join Function628057 +Ref: Join Function-Footnote-1629827 +Node: Getlocaltime Function630027 +Node: Readfile Function633771 +Node: Shell Quoting635743 +Node: Data File Management637144 +Node: Filetrans Function637776 +Node: Rewind Function641872 +Node: File Checking643258 +Ref: File Checking-Footnote-1644591 +Node: Empty Files644792 +Node: Ignoring Assigns646771 +Node: Getopt Function648321 +Ref: Getopt Function-Footnote-1659785 +Node: Passwd Functions659985 +Ref: Passwd Functions-Footnote-1668825 +Node: Group Functions668913 +Ref: Group Functions-Footnote-1676810 +Node: Walking Arrays677015 +Node: Library Functions Summary680021 +Node: Library Exercises681423 +Node: Sample Programs682703 +Node: Running Examples683473 +Node: Clones684201 +Node: Cut Program685425 +Node: Egrep Program695145 +Ref: Egrep Program-Footnote-1702648 +Node: Id Program702758 +Node: Split Program706434 +Ref: Split Program-Footnote-1709888 +Node: Tee Program710016 +Node: Uniq Program712805 +Node: Wc Program720224 +Ref: Wc Program-Footnote-1724474 +Node: Miscellaneous Programs724568 +Node: Dupword Program725781 +Node: Alarm Program727812 +Node: Translate Program732617 +Ref: Translate Program-Footnote-1737180 +Node: Labels Program737450 +Ref: Labels Program-Footnote-1740801 +Node: Word Sorting740885 +Node: History Sorting744955 +Node: Extract Program746790 +Node: Simple Sed754314 +Node: Igawk Program757384 +Ref: Igawk Program-Footnote-1771710 +Ref: Igawk Program-Footnote-2771911 +Ref: Igawk Program-Footnote-3772033 +Node: Anagram Program772148 +Node: Signature Program775209 +Node: Programs Summary776456 +Node: Programs Exercises777677 +Ref: Programs Exercises-Footnote-1781808 +Node: Advanced Features781899 +Node: Nondecimal Data783881 +Node: Array Sorting785471 +Node: Controlling Array Traversal786171 +Ref: Controlling Array Traversal-Footnote-1794537 +Node: Array Sorting Functions794655 +Ref: Array Sorting Functions-Footnote-1798541 +Node: Two-way I/O798737 +Ref: Two-way I/O-Footnote-1803682 +Ref: Two-way I/O-Footnote-2803868 +Node: TCP/IP Networking803950 +Node: Profiling806822 +Node: Advanced Features Summary815093 +Node: Internationalization817026 +Node: I18N and L10N818506 +Node: Explaining gettext819192 +Ref: Explaining gettext-Footnote-1824217 +Ref: Explaining gettext-Footnote-2824401 +Node: Programmer i18n824566 +Ref: Programmer i18n-Footnote-1829442 +Node: Translator i18n829491 +Node: String Extraction830285 +Ref: String Extraction-Footnote-1831416 +Node: Printf Ordering831502 +Ref: Printf Ordering-Footnote-1834288 +Node: I18N Portability834352 +Ref: I18N Portability-Footnote-1836808 +Node: I18N Example836871 +Ref: I18N Example-Footnote-1839674 +Node: Gawk I18N839746 +Node: I18N Summary840390 +Node: Debugger841730 +Node: Debugging842752 +Node: Debugging Concepts843193 +Node: Debugging Terms845003 +Node: Awk Debugging847575 +Node: Sample Debugging Session848481 +Node: Debugger Invocation849015 +Node: Finding The Bug850400 +Node: List of Debugger Commands856879 +Node: Breakpoint Control858211 +Node: Debugger Execution Control861888 +Node: Viewing And Changing Data865247 +Node: Execution Stack868623 +Node: Debugger Info870258 +Node: Miscellaneous Debugger Commands874303 +Node: Readline Support879304 +Node: Limitations880198 +Node: Debugging Summary882313 +Node: Arbitrary Precision Arithmetic883487 +Node: Computer Arithmetic884903 +Ref: table-numeric-ranges888480 +Ref: Computer Arithmetic-Footnote-1889004 +Node: Math Definitions889061 +Ref: table-ieee-formats892356 +Ref: Math Definitions-Footnote-1892960 +Node: MPFR features893065 +Node: FP Math Caution894736 +Ref: FP Math Caution-Footnote-1895786 +Node: Inexactness of computations896155 +Node: Inexact representation897114 +Node: Comparing FP Values898472 +Node: Errors accumulate899554 +Node: Getting Accuracy900986 +Node: Try To Round903690 +Node: Setting precision904589 +Ref: table-predefined-precision-strings905273 +Node: Setting the rounding mode907102 +Ref: table-gawk-rounding-modes907466 +Ref: Setting the rounding mode-Footnote-1910918 +Node: Arbitrary Precision Integers911097 +Ref: Arbitrary Precision Integers-Footnote-1916013 +Node: POSIX Floating Point Problems916162 +Ref: POSIX Floating Point Problems-Footnote-1920041 +Node: Floating point summary920079 +Node: Dynamic Extensions922266 +Node: Extension Intro923818 +Node: Plugin License925083 +Node: Extension Mechanism Outline925880 +Ref: figure-load-extension926308 +Ref: figure-register-new-function927788 +Ref: figure-call-new-function928792 +Node: Extension API Description930779 +Node: Extension API Functions Introduction932313 +Node: General Data Types937182 +Ref: General Data Types-Footnote-1943082 +Node: Memory Allocation Functions943381 +Ref: Memory Allocation Functions-Footnote-1946220 +Node: Constructor Functions946319 +Node: Registration Functions948058 +Node: Extension Functions948743 +Node: Exit Callback Functions951040 +Node: Extension Version String952288 +Node: Input Parsers952951 +Node: Output Wrappers962826 +Node: Two-way processors967339 +Node: Printing Messages969602 +Ref: Printing Messages-Footnote-1970678 +Node: Updating `ERRNO'970830 +Node: Requesting Values971570 +Ref: table-value-types-returned972297 +Node: Accessing Parameters973254 +Node: Symbol Table Access974488 +Node: Symbol table by name975002 +Node: Symbol table by cookie977022 +Ref: Symbol table by cookie-Footnote-1981167 +Node: Cached values981230 +Ref: Cached values-Footnote-1984726 +Node: Array Manipulation984817 +Ref: Array Manipulation-Footnote-1985907 +Node: Array Data Types985944 +Ref: Array Data Types-Footnote-1988599 +Node: Array Functions988691 +Node: Flattening Arrays992550 +Node: Creating Arrays999452 +Node: Redirection API1004223 +Node: Extension API Variables1007048 +Node: Extension Versioning1007681 +Node: Extension API Informational Variables1009572 +Node: Extension API Boilerplate1010637 +Node: Finding Extensions1014446 +Node: Extension Example1015006 +Node: Internal File Description1015778 +Node: Internal File Ops1019845 +Ref: Internal File Ops-Footnote-11031596 +Node: Using Internal File Ops1031736 +Ref: Using Internal File Ops-Footnote-11034119 +Node: Extension Samples1034392 +Node: Extension Sample File Functions1035920 +Node: Extension Sample Fnmatch1043601 +Node: Extension Sample Fork1045089 +Node: Extension Sample Inplace1046304 +Node: Extension Sample Ord1048390 +Node: Extension Sample Readdir1049226 +Ref: table-readdir-file-types1050103 +Node: Extension Sample Revout1050914 +Node: Extension Sample Rev2way1051503 +Node: Extension Sample Read write array1052243 +Node: Extension Sample Readfile1054183 +Node: Extension Sample Time1055278 +Node: Extension Sample API Tests1056626 +Node: gawkextlib1057117 +Node: Extension summary1059818 +Node: Extension Exercises1063507 +Node: Language History1065003 +Node: V7/SVR3.11066659 +Node: SVR41068812 +Node: POSIX1070246 +Node: BTL1071627 +Node: POSIX/GNU1072358 +Node: Feature History1078197 +Node: Common Extensions1091994 +Node: Ranges and Locales1093366 +Ref: Ranges and Locales-Footnote-11097985 +Ref: Ranges and Locales-Footnote-21098012 +Ref: Ranges and Locales-Footnote-31098247 +Node: Contributors1098468 +Node: History summary1104008 +Node: Installation1105387 +Node: Gawk Distribution1106333 +Node: Getting1106817 +Node: Extracting1107640 +Node: Distribution contents1109277 +Node: Unix Installation1115379 +Node: Quick Installation1116062 +Node: Shell Startup Files1118473 +Node: Additional Configuration Options1119552 +Node: Configuration Philosophy1121356 +Node: Non-Unix Installation1123725 +Node: PC Installation1124183 +Node: PC Binary Installation1125503 +Node: PC Compiling1127351 +Ref: PC Compiling-Footnote-11130372 +Node: PC Testing1130481 +Node: PC Using1131657 +Node: Cygwin1135772 +Node: MSYS1136542 +Node: VMS Installation1137043 +Node: VMS Compilation1137835 +Ref: VMS Compilation-Footnote-11139064 +Node: VMS Dynamic Extensions1139122 +Node: VMS Installation Details1140806 +Node: VMS Running1143057 +Node: VMS GNV1145897 +Node: VMS Old Gawk1146632 +Node: Bugs1147102 +Node: Other Versions1150991 +Node: Installation summary1157425 +Node: Notes1158484 +Node: Compatibility Mode1159349 +Node: Additions1160131 +Node: Accessing The Source1161056 +Node: Adding Code1162491 +Node: New Ports1168648 +Node: Derived Files1173130 +Ref: Derived Files-Footnote-11178605 +Ref: Derived Files-Footnote-21178639 +Ref: Derived Files-Footnote-31179235 +Node: Future Extensions1179349 +Node: Implementation Limitations1179955 +Node: Extension Design1181203 +Node: Old Extension Problems1182357 +Ref: Old Extension Problems-Footnote-11183874 +Node: Extension New Mechanism Goals1183931 +Ref: Extension New Mechanism Goals-Footnote-11187291 +Node: Extension Other Design Decisions1187480 +Node: Extension Future Growth1189588 +Node: Old Extension Mechanism1190424 +Node: Notes summary1192186 +Node: Basic Concepts1193372 +Node: Basic High Level1194053 +Ref: figure-general-flow1194325 +Ref: figure-process-flow1194924 +Ref: Basic High Level-Footnote-11198153 +Node: Basic Data Typing1198338 +Node: Glossary1201666 +Node: Copying1233595 +Node: GNU Free Documentation License1271151 +Node: Index1296287  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index f710d725..ca378cca 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -17089,23 +17089,6 @@ You can use @samp{pi = atan2(0, -1)} to retrieve the value of @cindex cosine Return the cosine of @var{x}, with @var{x} in radians. -@item @code{div(@var{numerator}, @var{denominator}, @var{result})} -@cindexawkfunc{div} -@cindex div -Perform integer division, similar to the standard C function of the -same name. First, truncate @code{numerator} and @code{denominator} -towards zero, creating integer values. Clear the @code{result} -array, and then set @code{result["quotient"]} to the result of -@samp{numerator / denominator}, truncated towards zero to an integer, -and set @code{result["remainder"]} to the result of @samp{numerator % -denominator}, truncated towards zero to an integer. This function is -primarily intended for use with arbitrary length integers; it avoids -creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary -Precision Integers}). - -This function is a @code{gawk} extension. It is not available in -compatibility mode (@pxref{Options}). - @item @code{exp(@var{x})} @cindexawkfunc{exp} @cindex exponent @@ -17121,6 +17104,23 @@ truncated toward zero. For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)} is @minus{}3, and @code{int(-3)} is @minus{}3 as well. +@item @code{intdiv(@var{numerator}, @var{denominator}, @var{result})} +@cindexawkfunc{intdiv} +@cindex intdiv +Perform integer division, similar to the standard C function of the +same name. First, truncate @code{numerator} and @code{denominator} +towards zero, creating integer values. Clear the @code{result} +array, and then set @code{result["quotient"]} to the result of +@samp{numerator / denominator}, truncated towards zero to an integer, +and set @code{result["remainder"]} to the result of @samp{numerator % +denominator}, truncated towards zero to an integer. This function is +primarily intended for use with arbitrary length integers; it avoids +creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary +Precision Integers}). + +This function is a @code{gawk} extension. It is not available in +compatibility mode (@pxref{Options}). + @item @code{log(@var{x})} @cindexawkfunc{log} @cindex logarithm @@ -31114,27 +31114,30 @@ When dividing two arbitrary precision integers with either precision floating point value (unless the denominator evenly divides into the numerator). In order to do integer division or remainder with arbitrary precision integers, use the built-in -@code{div()} function (@pxref{Numeric Functions}). +@code{intdiv()} function (@pxref{Numeric Functions}). -You can simulate the @code{div()} function in standard @command{awk} +You can simulate the @code{intdiv()} function in standard @command{awk} using this user-defined function: @example -@c file eg/lib/div.awk -# div --- do integer division +@c file eg/lib/intdiv.awk +# intdiv --- do integer division @c endfile @ignore -@c file eg/lib/div.awk +@c file eg/lib/intdiv.awk # # Arnold Robbins, arnold@@skeeve.com, Public Domain # July, 2014 +# +# Name changed from div() to intdiv() +# April, 2015 @c endfile @end ignore -@c file eg/lib/div.awk -function div(numerator, denominator, result) +@c file eg/lib/intdiv.awk +function intdiv(numerator, denominator, result) @{ split("", result) @@ -31149,7 +31152,7 @@ function div(numerator, denominator, result) @end example The following example program, contributed by Katie Wasserman, -uses @code{div()} to +uses @code{intdiv()} to compute the digits of @value{PI} to as many places as you choose to set: @@ -31174,7 +31177,7 @@ BEGIN @{ for (m = digits * 4; m > 0; --m) @{ d = m * 2 + 1 x = pi * m - div(x, d, result) + intdiv(x, d, result) pi = result["quotient"] pi = pi + two @} @@ -36043,7 +36046,7 @@ functions for internationalization (@pxref{Programmer i18n}) @item -The @code{div()} function for doing integer +The @code{intdiv()} function for doing integer division and remainder (@pxref{Numeric Functions}) @end itemize @@ -36824,7 +36827,7 @@ installed when @command{gawk} is built. @xref{Igawk Program}. @item -The @code{div()} function. +The @code{intdiv()} function. @xref{Numeric Functions}. @item diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 4e2b67d7..4cd04763 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -16371,23 +16371,6 @@ You can use @samp{pi = atan2(0, -1)} to retrieve the value of @cindex cosine Return the cosine of @var{x}, with @var{x} in radians. -@item @code{div(@var{numerator}, @var{denominator}, @var{result})} -@cindexawkfunc{div} -@cindex div -Perform integer division, similar to the standard C function of the -same name. First, truncate @code{numerator} and @code{denominator} -towards zero, creating integer values. Clear the @code{result} -array, and then set @code{result["quotient"]} to the result of -@samp{numerator / denominator}, truncated towards zero to an integer, -and set @code{result["remainder"]} to the result of @samp{numerator % -denominator}, truncated towards zero to an integer. This function is -primarily intended for use with arbitrary length integers; it avoids -creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary -Precision Integers}). - -This function is a @code{gawk} extension. It is not available in -compatibility mode (@pxref{Options}). - @item @code{exp(@var{x})} @cindexawkfunc{exp} @cindex exponent @@ -16403,6 +16386,23 @@ truncated toward zero. For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)} is @minus{}3, and @code{int(-3)} is @minus{}3 as well. +@item @code{intdiv(@var{numerator}, @var{denominator}, @var{result})} +@cindexawkfunc{intdiv} +@cindex intdiv +Perform integer division, similar to the standard C function of the +same name. First, truncate @code{numerator} and @code{denominator} +towards zero, creating integer values. Clear the @code{result} +array, and then set @code{result["quotient"]} to the result of +@samp{numerator / denominator}, truncated towards zero to an integer, +and set @code{result["remainder"]} to the result of @samp{numerator % +denominator}, truncated towards zero to an integer. This function is +primarily intended for use with arbitrary length integers; it avoids +creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary +Precision Integers}). + +This function is a @code{gawk} extension. It is not available in +compatibility mode (@pxref{Options}). + @item @code{log(@var{x})} @cindexawkfunc{log} @cindex logarithm @@ -30205,27 +30205,30 @@ When dividing two arbitrary precision integers with either precision floating point value (unless the denominator evenly divides into the numerator). In order to do integer division or remainder with arbitrary precision integers, use the built-in -@code{div()} function (@pxref{Numeric Functions}). +@code{intdiv()} function (@pxref{Numeric Functions}). -You can simulate the @code{div()} function in standard @command{awk} +You can simulate the @code{intdiv()} function in standard @command{awk} using this user-defined function: @example -@c file eg/lib/div.awk -# div --- do integer division +@c file eg/lib/intdiv.awk +# intdiv --- do integer division @c endfile @ignore -@c file eg/lib/div.awk +@c file eg/lib/intdiv.awk # # Arnold Robbins, arnold@@skeeve.com, Public Domain # July, 2014 +# +# Name changed from div() to intdiv() +# April, 2015 @c endfile @end ignore -@c file eg/lib/div.awk -function div(numerator, denominator, result) +@c file eg/lib/intdiv.awk +function intdiv(numerator, denominator, result) @{ split("", result) @@ -30240,7 +30243,7 @@ function div(numerator, denominator, result) @end example The following example program, contributed by Katie Wasserman, -uses @code{div()} to +uses @code{intdiv()} to compute the digits of @value{PI} to as many places as you choose to set: @@ -30265,7 +30268,7 @@ BEGIN @{ for (m = digits * 4; m > 0; --m) @{ d = m * 2 + 1 x = pi * m - div(x, d, result) + intdiv(x, d, result) pi = result["quotient"] pi = pi + two @} @@ -35134,7 +35137,7 @@ functions for internationalization (@pxref{Programmer i18n}) @item -The @code{div()} function for doing integer +The @code{intdiv()} function for doing integer division and remainder (@pxref{Numeric Functions}) @end itemize @@ -35915,7 +35918,7 @@ installed when @command{gawk} is built. @xref{Igawk Program}. @item -The @code{div()} function. +The @code{intdiv()} function. @xref{Numeric Functions}. @item diff --git a/mpfr.c b/mpfr.c index 571b334b..080ed7fa 100644 --- a/mpfr.c +++ b/mpfr.c @@ -1186,7 +1186,7 @@ do_mpfr_srand(int nargs) return res; } -/* do_mpfr_div --- do integer division, return quotient and remainder in dest array */ +/* do_mpfr_intdiv --- do integer division, return quotient and remainder in dest array */ /* * We define the semantics as: @@ -1197,7 +1197,7 @@ do_mpfr_srand(int nargs) */ NODE * -do_mpfr_div(int nargs) +do_mpfr_intdiv(int nargs) { NODE *numerator, *denominator, *result; NODE *num, *denom; @@ -1206,7 +1206,7 @@ do_mpfr_div(int nargs) result = POP_PARAM(); if (result->type != Node_var_array) - fatal(_("div: third argument is not an array")); + fatal(_("intdiv: third argument is not an array")); assoc_clear(result); denominator = POP_SCALAR(); @@ -1214,9 +1214,9 @@ do_mpfr_div(int nargs) if (do_lint) { if ((numerator->flags & (NUMCUR|NUMBER)) == 0) - lintwarn(_("div: received non-numeric first argument")); + lintwarn(_("intdiv: received non-numeric first argument")); if ((denominator->flags & (NUMCUR|NUMBER)) == 0) - lintwarn(_("div: received non-numeric second argument")); + lintwarn(_("intdiv: received non-numeric second argument")); } (void) force_number(numerator); @@ -1250,7 +1250,7 @@ do_mpfr_div(int nargs) } if (mpz_sgn(denom->mpg_i) == 0) - fatal(_("div: division by zero attempted")); + fatal(_("intdiv: division by zero attempted")); quotient = mpg_integer(); remainder = mpg_integer(); diff --git a/test/ChangeLog b/test/ChangeLog index 0c21218e..f9e49945 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2015-04-02 Arnold D. Robbins + + * id.ok, mpfrsqrt.awk: Update after rename of div() --> intdiv(). + 2015-03-31 Arnold D. Robbins * Makefile.am (indirectbuiltin): New test. diff --git a/test/id.ok b/test/id.ok index b5baf15a..bd26b473 100644 --- a/test/id.ok +++ b/test/id.ok @@ -24,7 +24,6 @@ cos -> builtin TEXTDOMAIN -> scalar ORS -> scalar split -> builtin -div -> builtin RSTART -> scalar compl -> builtin bindtextdomain -> builtin @@ -63,6 +62,7 @@ sub -> builtin OFMT -> scalar RLENGTH -> scalar substr -> builtin +intdiv -> builtin FPAT -> scalar RS -> scalar xor -> builtin diff --git a/test/mpfrsqrt.awk b/test/mpfrsqrt.awk index 23a15c92..3fb1f5f8 100644 --- a/test/mpfrsqrt.awk +++ b/test/mpfrsqrt.awk @@ -14,7 +14,7 @@ a=11111111111111111111111111111111111111111111111111111111111 print sqrt(a^2) #print sq_root(a^2) -# ADR: Added for gawk-4.1-stable which doesn't have built-in div() function +# ADR: Added for gawk-4.1-stable which doesn't have built-in intdiv() function if (PROCINFO["version"] < "4.1.60") print sq_root2(a^2) else @@ -27,9 +27,9 @@ function sq_root(x, temp,r,z) z=0 while (abs(z-temp)>1) { z=temp - div(x,temp,r) + intdiv(x,temp,r) temp=r["quotient"] + temp - div(temp,2,r) + intdiv(temp,2,r) temp=r["quotient"] } return temp -- cgit v1.2.3 From f82aa0619d803ebe0dc1710edf1a3e108a4210c8 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 3 Apr 2015 11:01:17 -0400 Subject: In NEWS file, rename div to intdiv. --- ChangeLog | 4 ++++ NEWS | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0a395564..9b9b114c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-04-02 Andrew J. Schorr + + * NEWS: Rename div to intdiv. + 2015-04-02 Arnold D. Robbins Rename div() to intdiv(). diff --git a/NEWS b/NEWS index 0c27c2c0..d3c1b055 100644 --- a/NEWS +++ b/NEWS @@ -23,7 +23,7 @@ Changes from 4.1.x to 4.2.0 4. The igawk script and igawk.1 man page are no longer installed by `make install'. They have been obsolete since gawk 4.0.0. -5. Gawk now has a `div()' function to perform integer division; this is +5. Gawk now has a `intdiv()' function to perform integer division; this is primarily useful for the -M option to avoid MPFR division when all values involved are integers. -- cgit v1.2.3 From e7ee504434e315852ebd449e20d72929de63cfe6 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 5 Apr 2015 10:50:37 +0300 Subject: Don't install gawk extensions if --posix or --traditional. --- ChangeLog | 10 ++++++++++ awkgram.c | 14 +++++++++++--- awkgram.y | 14 +++++++++++--- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53f2545a..52064109 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2015-04-05 Arnold D. Robbins + + * awkgram.y (install_builtins): If do_traditional is true, do not + install gawk extensions flagged with GAWKX. Similarly, if do_posix + is true, do not install functions flagged with NOT_POSIX. + This fixes a problem with spurious lint complaints about shadowing + a global variable that is not valid in traditional or posix mode. + Thanks to Andrew Schorr for finding the problem and supplying + initial code; I did it slightly differently. + 2015-03-31 Arnold D. Robbins * awk.h (call_sub): Renamed from call_sub_func. diff --git a/awkgram.c b/awkgram.c index fcde2564..8313afcb 100644 --- a/awkgram.c +++ b/awkgram.c @@ -7997,12 +7997,20 @@ void install_builtins(void) { int i, j; + int flags_that_must_be_clear = DEBUG_USE; + + if (do_traditional) + flags_that_must_be_clear |= GAWKX; + + if (do_posix) + flags_that_must_be_clear |= NOT_POSIX; + j = sizeof(tokentab) / sizeof(tokentab[0]); for (i = 0; i < j; i++) { - if ( (tokentab[i].class == LEX_BUILTIN - || tokentab[i].class == LEX_LENGTH) - && (tokentab[i].flags & DEBUG_USE) == 0) { + if ( (tokentab[i].class == LEX_BUILTIN + || tokentab[i].class == LEX_LENGTH) + && (tokentab[i].flags & flags_that_must_be_clear) == 0) { (void) install_symbol(tokentab[i].operator, Node_builtin_func); } } diff --git a/awkgram.y b/awkgram.y index 0b3a97c9..71ca0a84 100644 --- a/awkgram.y +++ b/awkgram.y @@ -5658,12 +5658,20 @@ void install_builtins(void) { int i, j; + int flags_that_must_be_clear = DEBUG_USE; + + if (do_traditional) + flags_that_must_be_clear |= GAWKX; + + if (do_posix) + flags_that_must_be_clear |= NOT_POSIX; + j = sizeof(tokentab) / sizeof(tokentab[0]); for (i = 0; i < j; i++) { - if ( (tokentab[i].class == LEX_BUILTIN - || tokentab[i].class == LEX_LENGTH) - && (tokentab[i].flags & DEBUG_USE) == 0) { + if ( (tokentab[i].class == LEX_BUILTIN + || tokentab[i].class == LEX_LENGTH) + && (tokentab[i].flags & flags_that_must_be_clear) == 0) { (void) install_symbol(tokentab[i].operator, Node_builtin_func); } } -- cgit v1.2.3