aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/ChangeLog19
-rw-r--r--doc/gawk.145
-rw-r--r--doc/gawk.info1340
-rw-r--r--doc/gawk.texi115
-rw-r--r--doc/gawktexi.in115
5 files changed, 1022 insertions, 612 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 27dca3dc..19948706 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -36,6 +36,25 @@
* gawkinet.texi: Fix capitalization in document title.
* gawktexi.in: Here we again: Starting on more O'Reilly fixes.
+2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawktexi.in: Improve get_file documentation.
+
+2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawktexi.in: Replace "Retrying I/O" with "Retrying Input", since this
+ feature pertains to input, not output.
+
+2015-01-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawktexi.in: Document the get_file API function.
+
+2015-01-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * 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 <azc100@gmail.com>
* 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 1c74fc99..e399353b 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 Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on
the command line.
* Input Summary:: Input summary.
@@ -557,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
@@ -4170,6 +4172,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 Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on the
command line.
* Input Summary:: Input summary.
@@ -5440,7 +5443,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 Input::, for further
+information about this feature.
In the following examples, COMMAND stands for a string value that
represents a shell command.
@@ -5878,7 +5885,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 Input, Prev: Getline, Up: Reading Files
4.10 Reading Input with a Timeout
=================================
@@ -5957,7 +5964,8 @@ 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
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
+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
@@ -5972,9 +5980,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 Input, Next: Command-line directories, Prev: Read Timeout, Up: Reading Files
-4.11 Directories on the Command Line
+4.11 Retrying Reads After 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 Input, Up: Reading Files
+
+4.12 Directories on the Command Line
====================================
According to the POSIX standard, files named on the `awk' command line
@@ -5997,7 +6032,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
@@ -6071,7 +6106,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
@@ -10367,6 +10402,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
@@ -10415,6 +10455,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.
@@ -10525,6 +10569,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 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
discussed further in *note Two-way I/O::.
@@ -22896,6 +22944,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.
@@ -22956,6 +23005,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
@@ -24162,7 +24214,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
--------------------------
@@ -24647,9 +24699,72 @@ 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.
+ 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
+
+16.4.13 API Variables
---------------------
The API provides two sets of variables. The first provides information
@@ -24666,7 +24781,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
@@ -24715,7 +24830,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
@@ -24750,7 +24865,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
@@ -32414,9 +32529,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)
@@ -32610,7 +32725,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)
@@ -32633,7 +32748,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)
@@ -32641,9 +32756,11 @@ Index
(line 43)
* differences in awk and gawk, regular expressions: Case-sensitivity.
(line 26)
+* 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 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.
@@ -32651,7 +32768,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 152)
* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
@@ -32692,8 +32809,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)
@@ -32808,7 +32925,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)
@@ -32889,7 +33006,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)
@@ -32957,9 +33074,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.
@@ -33009,7 +33126,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)
@@ -33059,7 +33176,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)
@@ -33094,7 +33211,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.
@@ -33126,7 +33243,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.
@@ -33134,14 +33251,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 152)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 34)
@@ -33233,7 +33350,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.
@@ -33528,7 +33645,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 258)
* McPhee, Patrick: Contributors. (line 100)
* message object files: Explaining gettext. (line 42)
@@ -33541,7 +33658,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)
@@ -33590,7 +33707,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.
@@ -33599,9 +33716,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.
@@ -33715,7 +33832,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)
@@ -33881,24 +33998,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)
@@ -34033,6 +34150,7 @@ Index
* relational operators, See comparison operators: Typing and Comparison.
(line 9)
* replace in string: String Functions. (line 409)
+* retrying input: Retrying Input. (line 6)
* return debugger command: Debugger Execution Control.
(line 54)
* return statement, user-defined functions: Return Statement. (line 6)
@@ -34056,7 +34174,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)
@@ -34082,9 +34200,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)
@@ -34104,7 +34222,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)
@@ -34187,7 +34305,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 139)
* sidebar, Escape Sequences for Metacharacters: Escape Sequences.
@@ -34349,9 +34467,9 @@ Index
* substr: String Functions. (line 482)
* substring: String Functions. (line 482)
* 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 107)
@@ -34528,10 +34646,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)
@@ -34621,560 +34739,562 @@ Index

Tag Table:
Node: Top1204
-Node: Foreword342225
-Node: Foreword446669
-Node: Preface48200
-Ref: Preface-Footnote-151071
-Ref: Preface-Footnote-251178
-Ref: Preface-Footnote-351411
-Node: History51553
-Node: Names53904
-Ref: Names-Footnote-154997
-Node: This Manual55143
-Ref: This Manual-Footnote-161643
-Node: Conventions61743
-Node: Manual History64080
-Ref: Manual History-Footnote-167073
-Ref: Manual History-Footnote-267114
-Node: How To Contribute67188
-Node: Acknowledgments68317
-Node: Getting Started73134
-Node: Running gawk75573
-Node: One-shot76763
-Node: Read Terminal78027
-Node: Long80058
-Node: Executable Scripts81571
-Ref: Executable Scripts-Footnote-184360
-Node: Comments84463
-Node: Quoting86945
-Node: DOS Quoting92463
-Node: Sample Data Files93138
-Node: Very Simple95733
-Node: Two Rules100632
-Node: More Complex102518
-Node: Statements/Lines105380
-Ref: Statements/Lines-Footnote-1109835
-Node: Other Features110100
-Node: When111036
-Ref: When-Footnote-1112790
-Node: Intro Summary112855
-Node: Invoking Gawk113739
-Node: Command Line115253
-Node: Options116051
-Ref: Options-Footnote-1131846
-Ref: Options-Footnote-2132075
-Node: Other Arguments132100
-Node: Naming Standard Input135048
-Node: Environment Variables136141
-Node: AWKPATH Variable136699
-Ref: AWKPATH Variable-Footnote-1140106
-Ref: AWKPATH Variable-Footnote-2140151
-Node: AWKLIBPATH Variable140411
-Node: Other Environment Variables141667
-Node: Exit Status145185
-Node: Include Files145861
-Node: Loading Shared Libraries149450
-Node: Obsolete150877
-Node: Undocumented151569
-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-1564253
-Node: Type Functions564425
-Node: I18N Functions565576
-Node: User-defined567221
-Node: Definition Syntax568026
-Ref: Definition Syntax-Footnote-1573525
-Node: Function Example573596
-Ref: Function Example-Footnote-1576515
-Node: Function Caveats576537
-Node: Calling A Function577055
-Node: Variable Scope578013
-Node: Pass By Value/Reference581001
-Node: Return Statement584496
-Node: Dynamic Typing587477
-Node: Indirect Calls588406
-Ref: Indirect Calls-Footnote-1599724
-Node: Functions Summary599852
-Node: Library Functions602554
-Ref: Library Functions-Footnote-1606163
-Ref: Library Functions-Footnote-2606306
-Node: Library Names606477
-Ref: Library Names-Footnote-1609931
-Ref: Library Names-Footnote-2610154
-Node: General Functions610240
-Node: Strtonum Function611343
-Node: Assert Function614365
-Node: Round Function617689
-Node: Cliff Random Function619230
-Node: Ordinal Functions620246
-Ref: Ordinal Functions-Footnote-1623309
-Ref: Ordinal Functions-Footnote-2623561
-Node: Join Function623772
-Ref: Join Function-Footnote-1625541
-Node: Getlocaltime Function625741
-Node: Readfile Function629485
-Node: Shell Quoting631455
-Node: Data File Management632856
-Node: Filetrans Function633488
-Node: Rewind Function637544
-Node: File Checking638931
-Ref: File Checking-Footnote-1640263
-Node: Empty Files640464
-Node: Ignoring Assigns642443
-Node: Getopt Function643994
-Ref: Getopt Function-Footnote-1655456
-Node: Passwd Functions655656
-Ref: Passwd Functions-Footnote-1664493
-Node: Group Functions664581
-Ref: Group Functions-Footnote-1672475
-Node: Walking Arrays672688
-Node: Library Functions Summary674291
-Node: Library Exercises675692
-Node: Sample Programs676972
-Node: Running Examples677742
-Node: Clones678470
-Node: Cut Program679694
-Node: Egrep Program689413
-Ref: Egrep Program-Footnote-1696911
-Node: Id Program697021
-Node: Split Program700666
-Ref: Split Program-Footnote-1704114
-Node: Tee Program704242
-Node: Uniq Program707031
-Node: Wc Program714450
-Ref: Wc Program-Footnote-1718700
-Node: Miscellaneous Programs718794
-Node: Dupword Program720007
-Node: Alarm Program722038
-Node: Translate Program726842
-Ref: Translate Program-Footnote-1731407
-Node: Labels Program731677
-Ref: Labels Program-Footnote-1735028
-Node: Word Sorting735112
-Node: History Sorting739183
-Node: Extract Program741019
-Node: Simple Sed748544
-Node: Igawk Program751612
-Ref: Igawk Program-Footnote-1765936
-Ref: Igawk Program-Footnote-2766137
-Ref: Igawk Program-Footnote-3766259
-Node: Anagram Program766374
-Node: Signature Program769431
-Node: Programs Summary770678
-Node: Programs Exercises771871
-Ref: Programs Exercises-Footnote-1776002
-Node: Advanced Features776093
-Node: Nondecimal Data778041
-Node: Array Sorting779631
-Node: Controlling Array Traversal780328
-Ref: Controlling Array Traversal-Footnote-1788661
-Node: Array Sorting Functions788779
-Ref: Array Sorting Functions-Footnote-1792668
-Node: Two-way I/O792864
-Ref: Two-way I/O-Footnote-1797809
-Ref: Two-way I/O-Footnote-2797995
-Node: TCP/IP Networking798077
-Node: Profiling800950
-Node: Advanced Features Summary809227
-Node: Internationalization811160
-Node: I18N and L10N812640
-Node: Explaining gettext813326
-Ref: Explaining gettext-Footnote-1818351
-Ref: Explaining gettext-Footnote-2818535
-Node: Programmer i18n818700
-Ref: Programmer i18n-Footnote-1823566
-Node: Translator i18n823615
-Node: String Extraction824409
-Ref: String Extraction-Footnote-1825540
-Node: Printf Ordering825626
-Ref: Printf Ordering-Footnote-1828412
-Node: I18N Portability828476
-Ref: I18N Portability-Footnote-1830931
-Node: I18N Example830994
-Ref: I18N Example-Footnote-1833797
-Node: Gawk I18N833869
-Node: I18N Summary834507
-Node: Debugger835846
-Node: Debugging836868
-Node: Debugging Concepts837309
-Node: Debugging Terms839162
-Node: Awk Debugging841734
-Node: Sample Debugging Session842628
-Node: Debugger Invocation843148
-Node: Finding The Bug844532
-Node: List of Debugger Commands851007
-Node: Breakpoint Control852340
-Node: Debugger Execution Control856036
-Node: Viewing And Changing Data859400
-Node: Execution Stack862778
-Node: Debugger Info864415
-Node: Miscellaneous Debugger Commands868432
-Node: Readline Support873461
-Node: Limitations874353
-Node: Debugging Summary876467
-Node: Arbitrary Precision Arithmetic877635
-Node: Computer Arithmetic879051
-Ref: table-numeric-ranges882649
-Ref: Computer Arithmetic-Footnote-1883508
-Node: Math Definitions883565
-Ref: table-ieee-formats886853
-Ref: Math Definitions-Footnote-1887457
-Node: MPFR features887562
-Node: FP Math Caution889233
-Ref: FP Math Caution-Footnote-1890283
-Node: Inexactness of computations890652
-Node: Inexact representation891611
-Node: Comparing FP Values892968
-Node: Errors accumulate894050
-Node: Getting Accuracy895483
-Node: Try To Round898145
-Node: Setting precision899044
-Ref: table-predefined-precision-strings899728
-Node: Setting the rounding mode901517
-Ref: table-gawk-rounding-modes901881
-Ref: Setting the rounding mode-Footnote-1905336
-Node: Arbitrary Precision Integers905515
-Ref: Arbitrary Precision Integers-Footnote-1910415
-Node: POSIX Floating Point Problems910564
-Ref: POSIX Floating Point Problems-Footnote-1914437
-Node: Floating point summary914475
-Node: Dynamic Extensions916669
-Node: Extension Intro918221
-Node: Plugin License919487
-Node: Extension Mechanism Outline920284
-Ref: figure-load-extension920712
-Ref: figure-register-new-function922192
-Ref: figure-call-new-function923196
-Node: Extension API Description925182
-Node: Extension API Functions Introduction926632
-Node: General Data Types931456
-Ref: General Data Types-Footnote-1937195
-Node: Memory Allocation Functions937494
-Ref: Memory Allocation Functions-Footnote-1940333
-Node: Constructor Functions940429
-Node: Registration Functions942163
-Node: Extension Functions942848
-Node: Exit Callback Functions945145
-Node: Extension Version String946393
-Node: Input Parsers947058
-Node: Output Wrappers956937
-Node: Two-way processors961452
-Node: Printing Messages963656
-Ref: Printing Messages-Footnote-1964732
-Node: Updating `ERRNO'964884
-Node: Requesting Values965624
-Ref: table-value-types-returned966352
-Node: Accessing Parameters967309
-Node: Symbol Table Access968540
-Node: Symbol table by name969054
-Node: Symbol table by cookie971035
-Ref: Symbol table by cookie-Footnote-1975179
-Node: Cached values975242
-Ref: Cached values-Footnote-1978741
-Node: Array Manipulation978832
-Ref: Array Manipulation-Footnote-1979930
-Node: Array Data Types979967
-Ref: Array Data Types-Footnote-1982622
-Node: Array Functions982714
-Node: Flattening Arrays986568
-Node: Creating Arrays993460
-Node: Extension API Variables998231
-Node: Extension Versioning998867
-Node: Extension API Informational Variables1000768
-Node: Extension API Boilerplate1001833
-Node: Finding Extensions1005642
-Node: Extension Example1006202
-Node: Internal File Description1006974
-Node: Internal File Ops1011041
-Ref: Internal File Ops-Footnote-11022711
-Node: Using Internal File Ops1022851
-Ref: Using Internal File Ops-Footnote-11025234
-Node: Extension Samples1025507
-Node: Extension Sample File Functions1027033
-Node: Extension Sample Fnmatch1034671
-Node: Extension Sample Fork1036162
-Node: Extension Sample Inplace1037377
-Node: Extension Sample Ord1039052
-Node: Extension Sample Readdir1039888
-Ref: table-readdir-file-types1040764
-Node: Extension Sample Revout1041575
-Node: Extension Sample Rev2way1042165
-Node: Extension Sample Read write array1042905
-Node: Extension Sample Readfile1044845
-Node: Extension Sample Time1045940
-Node: Extension Sample API Tests1047289
-Node: gawkextlib1047780
-Node: Extension summary1050438
-Node: Extension Exercises1054127
-Node: Language History1054849
-Node: V7/SVR3.11056505
-Node: SVR41058686
-Node: POSIX1060131
-Node: BTL1061520
-Node: POSIX/GNU1062254
-Node: Feature History1067878
-Node: Common Extensions1080976
-Node: Ranges and Locales1082300
-Ref: Ranges and Locales-Footnote-11086918
-Ref: Ranges and Locales-Footnote-21086945
-Ref: Ranges and Locales-Footnote-31087179
-Node: Contributors1087400
-Node: History summary1092941
-Node: Installation1094311
-Node: Gawk Distribution1095257
-Node: Getting1095741
-Node: Extracting1096564
-Node: Distribution contents1098199
-Node: Unix Installation1104264
-Node: Quick Installation1104947
-Node: Shell Startup Files1107358
-Node: Additional Configuration Options1108437
-Node: Configuration Philosophy1110176
-Node: Non-Unix Installation1112545
-Node: PC Installation1113003
-Node: PC Binary Installation1114322
-Node: PC Compiling1116170
-Ref: PC Compiling-Footnote-11119191
-Node: PC Testing1119300
-Node: PC Using1120476
-Node: Cygwin1124591
-Node: MSYS1125414
-Node: VMS Installation1125914
-Node: VMS Compilation1126706
-Ref: VMS Compilation-Footnote-11127928
-Node: VMS Dynamic Extensions1127986
-Node: VMS Installation Details1129670
-Node: VMS Running1131922
-Node: VMS GNV1134758
-Node: VMS Old Gawk1135492
-Node: Bugs1135962
-Node: Other Versions1139845
-Node: Installation summary1146269
-Node: Notes1147325
-Node: Compatibility Mode1148190
-Node: Additions1148972
-Node: Accessing The Source1149897
-Node: Adding Code1151332
-Node: New Ports1157489
-Node: Derived Files1161971
-Ref: Derived Files-Footnote-11167446
-Ref: Derived Files-Footnote-21167480
-Ref: Derived Files-Footnote-31168076
-Node: Future Extensions1168190
-Node: Implementation Limitations1168796
-Node: Extension Design1170044
-Node: Old Extension Problems1171198
-Ref: Old Extension Problems-Footnote-11172715
-Node: Extension New Mechanism Goals1172772
-Ref: Extension New Mechanism Goals-Footnote-11176132
-Node: Extension Other Design Decisions1176321
-Node: Extension Future Growth1178429
-Node: Old Extension Mechanism1179265
-Node: Notes summary1181027
-Node: Basic Concepts1182213
-Node: Basic High Level1182894
-Ref: figure-general-flow1183166
-Ref: figure-process-flow1183765
-Ref: Basic High Level-Footnote-11186994
-Node: Basic Data Typing1187179
-Node: Glossary1190507
-Node: Copying1222436
-Node: GNU Free Documentation License1259992
-Node: Index1285128
+Node: Foreword342385
+Node: Foreword446829
+Node: Preface48360
+Ref: Preface-Footnote-151231
+Ref: Preface-Footnote-251338
+Ref: Preface-Footnote-351571
+Node: History51713
+Node: Names54064
+Ref: Names-Footnote-155157
+Node: This Manual55303
+Ref: This Manual-Footnote-161803
+Node: Conventions61903
+Node: Manual History64240
+Ref: Manual History-Footnote-167233
+Ref: Manual History-Footnote-267274
+Node: How To Contribute67348
+Node: Acknowledgments68477
+Node: Getting Started73294
+Node: Running gawk75733
+Node: One-shot76923
+Node: Read Terminal78187
+Node: Long80218
+Node: Executable Scripts81731
+Ref: Executable Scripts-Footnote-184520
+Node: Comments84623
+Node: Quoting87105
+Node: DOS Quoting92623
+Node: Sample Data Files93298
+Node: Very Simple95893
+Node: Two Rules100792
+Node: More Complex102678
+Node: Statements/Lines105540
+Ref: Statements/Lines-Footnote-1109995
+Node: Other Features110260
+Node: When111196
+Ref: When-Footnote-1112950
+Node: Intro Summary113015
+Node: Invoking Gawk113899
+Node: Command Line115413
+Node: Options116211
+Ref: Options-Footnote-1132006
+Ref: Options-Footnote-2132235
+Node: Other Arguments132260
+Node: Naming Standard Input135208
+Node: Environment Variables136301
+Node: AWKPATH Variable136859
+Ref: AWKPATH Variable-Footnote-1140266
+Ref: AWKPATH Variable-Footnote-2140311
+Node: AWKLIBPATH Variable140571
+Node: Other Environment Variables141827
+Node: Exit Status145345
+Node: Include Files146021
+Node: Loading Shared Libraries149610
+Node: Obsolete151037
+Node: Undocumented151729
+Node: Invoking Summary151996
+Node: Regexp153659
+Node: Regexp Usage155113
+Node: Escape Sequences157150
+Node: Regexp Operators163390
+Ref: Regexp Operators-Footnote-1170800
+Ref: Regexp Operators-Footnote-2170947
+Node: Bracket Expressions171045
+Ref: table-char-classes173060
+Node: Leftmost Longest176002
+Node: Computed Regexps177304
+Node: GNU Regexp Operators180733
+Node: Case-sensitivity184405
+Ref: Case-sensitivity-Footnote-1187290
+Ref: Case-sensitivity-Footnote-2187525
+Node: Regexp Summary187633
+Node: Reading Files189100
+Node: Records191262
+Node: awk split records191995
+Node: gawk split records196924
+Ref: gawk split records-Footnote-1201463
+Node: Fields201500
+Ref: Fields-Footnote-1204278
+Node: Nonconstant Fields204364
+Ref: Nonconstant Fields-Footnote-1206602
+Node: Changing Fields206805
+Node: Field Separators212736
+Node: Default Field Splitting215440
+Node: Regexp Field Splitting216557
+Node: Single Character Fields219907
+Node: Command Line Field Separator220966
+Node: Full Line Fields224183
+Ref: Full Line Fields-Footnote-1225704
+Ref: Full Line Fields-Footnote-2225750
+Node: Field Splitting Summary225851
+Node: Constant Size227925
+Node: Splitting By Content232508
+Ref: Splitting By Content-Footnote-1236473
+Node: Multiple Line236636
+Ref: Multiple Line-Footnote-1242517
+Node: Getline242696
+Node: Plain Getline245175
+Node: Getline/Variable247815
+Node: Getline/File248964
+Node: Getline/Variable/File250349
+Ref: Getline/Variable/File-Footnote-1251952
+Node: Getline/Pipe252039
+Node: Getline/Variable/Pipe254717
+Node: Getline/Coprocess255848
+Node: Getline/Variable/Coprocess257112
+Node: Getline Notes257851
+Node: Getline Summary260645
+Ref: table-getline-variants261057
+Node: Read Timeout261886
+Ref: Read Timeout-Footnote-1265789
+Node: Retrying Input265847
+Node: Command-line directories267042
+Node: Input Summary267949
+Node: Input Exercises271334
+Node: Printing272062
+Node: Print273839
+Node: Print Examples275296
+Node: Output Separators278075
+Node: OFMT280093
+Node: Printf281448
+Node: Basic Printf282233
+Node: Control Letters283805
+Node: Format Modifiers287790
+Node: Printf Examples293800
+Node: Redirection296286
+Node: Special FD303124
+Ref: Special FD-Footnote-1306290
+Node: Special Files306364
+Node: Other Inherited Files306981
+Node: Special Network307981
+Node: Special Caveats308843
+Node: Close Files And Pipes309792
+Ref: Close Files And Pipes-Footnote-1316983
+Ref: Close Files And Pipes-Footnote-2317131
+Node: Output Summary317281
+Node: Output Exercises318279
+Node: Expressions318959
+Node: Values320148
+Node: Constants320825
+Node: Scalar Constants321516
+Ref: Scalar Constants-Footnote-1322378
+Node: Nondecimal-numbers322628
+Node: Regexp Constants325638
+Node: Using Constant Regexps326164
+Node: Variables329327
+Node: Using Variables329984
+Node: Assignment Options331895
+Node: Conversion333770
+Node: Strings And Numbers334294
+Ref: Strings And Numbers-Footnote-1337359
+Node: Locale influences conversions337468
+Ref: table-locale-affects340214
+Node: All Operators340806
+Node: Arithmetic Ops341435
+Node: Concatenation343940
+Ref: Concatenation-Footnote-1346759
+Node: Assignment Ops346866
+Ref: table-assign-ops351845
+Node: Increment Ops353155
+Node: Truth Values and Conditions356586
+Node: Truth Values357669
+Node: Typing and Comparison358718
+Node: Variable Typing359534
+Node: Comparison Operators363201
+Ref: table-relational-ops363611
+Node: POSIX String Comparison367106
+Ref: POSIX String Comparison-Footnote-1368178
+Node: Boolean Ops368317
+Ref: Boolean Ops-Footnote-1372795
+Node: Conditional Exp372886
+Node: Function Calls374624
+Node: Precedence378504
+Node: Locales382164
+Node: Expressions Summary383796
+Node: Patterns and Actions386367
+Node: Pattern Overview387487
+Node: Regexp Patterns389166
+Node: Expression Patterns389709
+Node: Ranges393418
+Node: BEGIN/END396525
+Node: Using BEGIN/END397286
+Ref: Using BEGIN/END-Footnote-1400022
+Node: I/O And BEGIN/END400128
+Node: BEGINFILE/ENDFILE402443
+Node: Empty405340
+Node: Using Shell Variables405657
+Node: Action Overview407930
+Node: Statements410256
+Node: If Statement412104
+Node: While Statement413599
+Node: Do Statement415627
+Node: For Statement416775
+Node: Switch Statement419933
+Node: Break Statement422315
+Node: Continue Statement424356
+Node: Next Statement426183
+Node: Nextfile Statement428564
+Node: Exit Statement431192
+Node: Built-in Variables433603
+Node: User-modified434736
+Ref: User-modified-Footnote-1442439
+Node: Auto-set442501
+Ref: Auto-set-Footnote-1456734
+Ref: Auto-set-Footnote-2456939
+Node: ARGC and ARGV456995
+Node: Pattern Action Summary461213
+Node: Arrays463646
+Node: Array Basics464975
+Node: Array Intro465819
+Ref: figure-array-elements467753
+Ref: Array Intro-Footnote-1470373
+Node: Reference to Elements470501
+Node: Assigning Elements472963
+Node: Array Example473454
+Node: Scanning an Array475213
+Node: Controlling Scanning478233
+Ref: Controlling Scanning-Footnote-1483627
+Node: Numeric Array Subscripts483943
+Node: Uninitialized Subscripts486128
+Node: Delete487745
+Ref: Delete-Footnote-1490494
+Node: Multidimensional490551
+Node: Multiscanning493648
+Node: Arrays of Arrays495237
+Node: Arrays Summary499991
+Node: Functions502082
+Node: Built-in503121
+Node: Calling Built-in504199
+Node: Numeric Functions506194
+Ref: Numeric Functions-Footnote-1511012
+Ref: Numeric Functions-Footnote-2511369
+Ref: Numeric Functions-Footnote-3511417
+Node: String Functions511689
+Ref: String Functions-Footnote-1535190
+Ref: String Functions-Footnote-2535319
+Ref: String Functions-Footnote-3535567
+Node: Gory Details535654
+Ref: table-sub-escapes537435
+Ref: table-sub-proposed538950
+Ref: table-posix-sub540312
+Ref: table-gensub-escapes541849
+Ref: Gory Details-Footnote-1542682
+Node: I/O Functions542833
+Ref: I/O Functions-Footnote-1550069
+Node: Time Functions550216
+Ref: Time Functions-Footnote-1560725
+Ref: Time Functions-Footnote-2560793
+Ref: Time Functions-Footnote-3560951
+Ref: Time Functions-Footnote-4561062
+Ref: Time Functions-Footnote-5561174
+Ref: Time Functions-Footnote-6561401
+Node: Bitwise Functions561667
+Ref: table-bitwise-ops562229
+Ref: Bitwise Functions-Footnote-1566541
+Node: Type Functions566713
+Node: I18N Functions567864
+Node: User-defined569509
+Node: Definition Syntax570314
+Ref: Definition Syntax-Footnote-1575813
+Node: Function Example575884
+Ref: Function Example-Footnote-1578803
+Node: Function Caveats578825
+Node: Calling A Function579343
+Node: Variable Scope580301
+Node: Pass By Value/Reference583289
+Node: Return Statement586784
+Node: Dynamic Typing589765
+Node: Indirect Calls590694
+Ref: Indirect Calls-Footnote-1602012
+Node: Functions Summary602140
+Node: Library Functions604842
+Ref: Library Functions-Footnote-1608451
+Ref: Library Functions-Footnote-2608594
+Node: Library Names608765
+Ref: Library Names-Footnote-1612219
+Ref: Library Names-Footnote-2612442
+Node: General Functions612528
+Node: Strtonum Function613631
+Node: Assert Function616653
+Node: Round Function619977
+Node: Cliff Random Function621518
+Node: Ordinal Functions622534
+Ref: Ordinal Functions-Footnote-1625597
+Ref: Ordinal Functions-Footnote-2625849
+Node: Join Function626060
+Ref: Join Function-Footnote-1627829
+Node: Getlocaltime Function628029
+Node: Readfile Function631773
+Node: Shell Quoting633743
+Node: Data File Management635144
+Node: Filetrans Function635776
+Node: Rewind Function639832
+Node: File Checking641219
+Ref: File Checking-Footnote-1642551
+Node: Empty Files642752
+Node: Ignoring Assigns644731
+Node: Getopt Function646282
+Ref: Getopt Function-Footnote-1657744
+Node: Passwd Functions657944
+Ref: Passwd Functions-Footnote-1666781
+Node: Group Functions666869
+Ref: Group Functions-Footnote-1674763
+Node: Walking Arrays674976
+Node: Library Functions Summary676579
+Node: Library Exercises677980
+Node: Sample Programs679260
+Node: Running Examples680030
+Node: Clones680758
+Node: Cut Program681982
+Node: Egrep Program691701
+Ref: Egrep Program-Footnote-1699199
+Node: Id Program699309
+Node: Split Program702954
+Ref: Split Program-Footnote-1706402
+Node: Tee Program706530
+Node: Uniq Program709319
+Node: Wc Program716738
+Ref: Wc Program-Footnote-1720988
+Node: Miscellaneous Programs721082
+Node: Dupword Program722295
+Node: Alarm Program724326
+Node: Translate Program729130
+Ref: Translate Program-Footnote-1733695
+Node: Labels Program733965
+Ref: Labels Program-Footnote-1737316
+Node: Word Sorting737400
+Node: History Sorting741471
+Node: Extract Program743307
+Node: Simple Sed750832
+Node: Igawk Program753900
+Ref: Igawk Program-Footnote-1768224
+Ref: Igawk Program-Footnote-2768425
+Ref: Igawk Program-Footnote-3768547
+Node: Anagram Program768662
+Node: Signature Program771719
+Node: Programs Summary772966
+Node: Programs Exercises774159
+Ref: Programs Exercises-Footnote-1778290
+Node: Advanced Features778381
+Node: Nondecimal Data780329
+Node: Array Sorting781919
+Node: Controlling Array Traversal782616
+Ref: Controlling Array Traversal-Footnote-1790949
+Node: Array Sorting Functions791067
+Ref: Array Sorting Functions-Footnote-1794956
+Node: Two-way I/O795152
+Ref: Two-way I/O-Footnote-1800097
+Ref: Two-way I/O-Footnote-2800283
+Node: TCP/IP Networking800365
+Node: Profiling803238
+Node: Advanced Features Summary811515
+Node: Internationalization813448
+Node: I18N and L10N814928
+Node: Explaining gettext815614
+Ref: Explaining gettext-Footnote-1820639
+Ref: Explaining gettext-Footnote-2820823
+Node: Programmer i18n820988
+Ref: Programmer i18n-Footnote-1825854
+Node: Translator i18n825903
+Node: String Extraction826697
+Ref: String Extraction-Footnote-1827828
+Node: Printf Ordering827914
+Ref: Printf Ordering-Footnote-1830700
+Node: I18N Portability830764
+Ref: I18N Portability-Footnote-1833219
+Node: I18N Example833282
+Ref: I18N Example-Footnote-1836085
+Node: Gawk I18N836157
+Node: I18N Summary836795
+Node: Debugger838134
+Node: Debugging839156
+Node: Debugging Concepts839597
+Node: Debugging Terms841450
+Node: Awk Debugging844022
+Node: Sample Debugging Session844916
+Node: Debugger Invocation845436
+Node: Finding The Bug846820
+Node: List of Debugger Commands853295
+Node: Breakpoint Control854628
+Node: Debugger Execution Control858324
+Node: Viewing And Changing Data861688
+Node: Execution Stack865066
+Node: Debugger Info866703
+Node: Miscellaneous Debugger Commands870720
+Node: Readline Support875749
+Node: Limitations876641
+Node: Debugging Summary878755
+Node: Arbitrary Precision Arithmetic879923
+Node: Computer Arithmetic881339
+Ref: table-numeric-ranges884937
+Ref: Computer Arithmetic-Footnote-1885796
+Node: Math Definitions885853
+Ref: table-ieee-formats889141
+Ref: Math Definitions-Footnote-1889745
+Node: MPFR features889850
+Node: FP Math Caution891521
+Ref: FP Math Caution-Footnote-1892571
+Node: Inexactness of computations892940
+Node: Inexact representation893899
+Node: Comparing FP Values895256
+Node: Errors accumulate896338
+Node: Getting Accuracy897771
+Node: Try To Round900433
+Node: Setting precision901332
+Ref: table-predefined-precision-strings902016
+Node: Setting the rounding mode903805
+Ref: table-gawk-rounding-modes904169
+Ref: Setting the rounding mode-Footnote-1907624
+Node: Arbitrary Precision Integers907803
+Ref: Arbitrary Precision Integers-Footnote-1912703
+Node: POSIX Floating Point Problems912852
+Ref: POSIX Floating Point Problems-Footnote-1916725
+Node: Floating point summary916763
+Node: Dynamic Extensions918957
+Node: Extension Intro920509
+Node: Plugin License921775
+Node: Extension Mechanism Outline922572
+Ref: figure-load-extension923000
+Ref: figure-register-new-function924480
+Ref: figure-call-new-function925484
+Node: Extension API Description927470
+Node: Extension API Functions Introduction929004
+Node: General Data Types933876
+Ref: General Data Types-Footnote-1939615
+Node: Memory Allocation Functions939914
+Ref: Memory Allocation Functions-Footnote-1942753
+Node: Constructor Functions942849
+Node: Registration Functions944583
+Node: Extension Functions945268
+Node: Exit Callback Functions947565
+Node: Extension Version String948813
+Node: Input Parsers949478
+Node: Output Wrappers959357
+Node: Two-way processors963872
+Node: Printing Messages966076
+Ref: Printing Messages-Footnote-1967152
+Node: Updating `ERRNO'967304
+Node: Requesting Values968044
+Ref: table-value-types-returned968772
+Node: Accessing Parameters969729
+Node: Symbol Table Access970960
+Node: Symbol table by name971474
+Node: Symbol table by cookie973455
+Ref: Symbol table by cookie-Footnote-1977599
+Node: Cached values977662
+Ref: Cached values-Footnote-1981161
+Node: Array Manipulation981252
+Ref: Array Manipulation-Footnote-1982342
+Node: Array Data Types982379
+Ref: Array Data Types-Footnote-1985034
+Node: Array Functions985126
+Node: Flattening Arrays988980
+Node: Creating Arrays995872
+Node: Redirection API1000643
+Node: Extension API Variables1003414
+Node: Extension Versioning1004047
+Node: Extension API Informational Variables1005948
+Node: Extension API Boilerplate1007013
+Node: Finding Extensions1010822
+Node: Extension Example1011382
+Node: Internal File Description1012154
+Node: Internal File Ops1016221
+Ref: Internal File Ops-Footnote-11027891
+Node: Using Internal File Ops1028031
+Ref: Using Internal File Ops-Footnote-11030414
+Node: Extension Samples1030687
+Node: Extension Sample File Functions1032213
+Node: Extension Sample Fnmatch1039851
+Node: Extension Sample Fork1041342
+Node: Extension Sample Inplace1042557
+Node: Extension Sample Ord1044232
+Node: Extension Sample Readdir1045068
+Ref: table-readdir-file-types1045944
+Node: Extension Sample Revout1046755
+Node: Extension Sample Rev2way1047345
+Node: Extension Sample Read write array1048085
+Node: Extension Sample Readfile1050025
+Node: Extension Sample Time1051120
+Node: Extension Sample API Tests1052469
+Node: gawkextlib1052960
+Node: Extension summary1055618
+Node: Extension Exercises1059307
+Node: Language History1060029
+Node: V7/SVR3.11061685
+Node: SVR41063866
+Node: POSIX1065311
+Node: BTL1066700
+Node: POSIX/GNU1067434
+Node: Feature History1073058
+Node: Common Extensions1086156
+Node: Ranges and Locales1087480
+Ref: Ranges and Locales-Footnote-11092098
+Ref: Ranges and Locales-Footnote-21092125
+Ref: Ranges and Locales-Footnote-31092359
+Node: Contributors1092580
+Node: History summary1098121
+Node: Installation1099491
+Node: Gawk Distribution1100437
+Node: Getting1100921
+Node: Extracting1101744
+Node: Distribution contents1103379
+Node: Unix Installation1109444
+Node: Quick Installation1110127
+Node: Shell Startup Files1112538
+Node: Additional Configuration Options1113617
+Node: Configuration Philosophy1115356
+Node: Non-Unix Installation1117725
+Node: PC Installation1118183
+Node: PC Binary Installation1119502
+Node: PC Compiling1121350
+Ref: PC Compiling-Footnote-11124371
+Node: PC Testing1124480
+Node: PC Using1125656
+Node: Cygwin1129771
+Node: MSYS1130594
+Node: VMS Installation1131094
+Node: VMS Compilation1131886
+Ref: VMS Compilation-Footnote-11133108
+Node: VMS Dynamic Extensions1133166
+Node: VMS Installation Details1134850
+Node: VMS Running1137102
+Node: VMS GNV1139938
+Node: VMS Old Gawk1140672
+Node: Bugs1141142
+Node: Other Versions1145025
+Node: Installation summary1151449
+Node: Notes1152505
+Node: Compatibility Mode1153370
+Node: Additions1154152
+Node: Accessing The Source1155077
+Node: Adding Code1156512
+Node: New Ports1162669
+Node: Derived Files1167151
+Ref: Derived Files-Footnote-11172626
+Ref: Derived Files-Footnote-21172660
+Ref: Derived Files-Footnote-31173256
+Node: Future Extensions1173370
+Node: Implementation Limitations1173976
+Node: Extension Design1175224
+Node: Old Extension Problems1176378
+Ref: Old Extension Problems-Footnote-11177895
+Node: Extension New Mechanism Goals1177952
+Ref: Extension New Mechanism Goals-Footnote-11181312
+Node: Extension Other Design Decisions1181501
+Node: Extension Future Growth1183609
+Node: Old Extension Mechanism1184445
+Node: Notes summary1186207
+Node: Basic Concepts1187393
+Node: Basic High Level1188074
+Ref: figure-general-flow1188346
+Ref: figure-process-flow1188945
+Ref: Basic High Level-Footnote-11192174
+Node: Basic Data Typing1192359
+Node: Glossary1195687
+Node: Copying1227616
+Node: GNU Free Documentation License1265172
+Node: Index1290308

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 68512c2d..9ad9e3d4 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 Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on
the command line.
* Input Summary:: Input summary.
@@ -943,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
@@ -6318,6 +6320,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 Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on the
command line.
* Input Summary:: Input summary.
@@ -8103,6 +8106,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 Input} for further information about
+this feature.
In the following examples, @var{command} stands for a string value that
represents a shell command.
@@ -8758,7 +8766,8 @@ on a per-command or per-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 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
@@ -8768,6 +8777,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 Input
+@section Retrying Reads After Certain Input Errors
+@cindex retrying input
+
+@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}):
+
+@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
@@ -14841,6 +14879,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}
@@ -14909,6 +14952,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.
@@ -15048,6 +15095,11 @@ open input file, pipe, or coprocess.
@DBXREF{Read Timeout} for more information.
@item
+It may be used to indicate that input may be retried when it fails due to
+certain errors.
+@DBXREF{Retrying Input} 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
@ref{Two-way I/O}.
@@ -31461,6 +31513,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
@@ -31536,6 +31589,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:
@@ -33500,6 +33557,62 @@ $ @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
+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.
+@end table
+
+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 f3805887..e557efae 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 Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on
the command line.
* Input Summary:: Input summary.
@@ -938,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
@@ -6102,6 +6104,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 Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on the
command line.
* Input Summary:: Input summary.
@@ -7703,6 +7706,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 Input} for further information about
+this feature.
In the following examples, @var{command} stands for a string value that
represents a shell command.
@@ -8358,7 +8366,8 @@ on a per-command or per-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 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
@@ -8368,6 +8377,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 Input
+@section Retrying Reads After Certain Input Errors
+@cindex retrying input
+
+@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}):
+
+@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
@@ -14169,6 +14207,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}
@@ -14237,6 +14280,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.
@@ -14376,6 +14423,11 @@ open input file, pipe, or coprocess.
@DBXREF{Read Timeout} for more information.
@item
+It may be used to indicate that input may be retried when it fails due to
+certain errors.
+@DBXREF{Retrying Input} 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
@ref{Two-way I/O}.
@@ -30553,6 +30605,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
@@ -30628,6 +30681,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:
@@ -32592,6 +32649,62 @@ $ @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
+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.
+@end table
+
+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