aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-09-28 22:13:43 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-09-28 22:13:43 +0300
commit342139ab3ed41800b6844c11efaaa21b2bc61b36 (patch)
tree36782b0633edee5f1f0148d3796ab303a5410a92
parent983b6996b019850733fc9cd2ea57352f9dbbf7d8 (diff)
downloadegawk-342139ab3ed41800b6844c11efaaa21b2bc61b36.tar.gz
egawk-342139ab3ed41800b6844c11efaaa21b2bc61b36.tar.bz2
egawk-342139ab3ed41800b6844c11efaaa21b2bc61b36.zip
More doc stuff, incl. debugger "where" command.
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.info663
-rw-r--r--doc/gawk.texi182
-rw-r--r--doc/gawktexi.in182
4 files changed, 553 insertions, 479 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 314192c0..194f928c 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: More fixes after reading through the MS.
+ Document the debugger's "where" command.
+
2014-09-27 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Lots more fixes after reading through the MS.
diff --git a/doc/gawk.info b/doc/gawk.info
index bd3966bd..b8981b17 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -19450,7 +19450,7 @@ File: gawk.info, Node: TCP/IP Networking, Next: Profiling, Prev: Two-way I/O,
A host is a host from coast to coast,
and no-one can talk to host that's close,
unless the host that isn't close
- is busy, hung, or dead.
+ is busy, hung, or dead. -- Mike O'Brien (aka Mr. Protocol)
In addition to being able to open a two-way pipeline to a coprocess on
the same system (*note Two-way I/O::), it is possible to make a two-way
@@ -19579,9 +19579,9 @@ First, the `awk' program:
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 Thu Feb 27 05:16:21 2014
+ # gawk profile, created Mon Sep 29 05:16:21 2014
- # BEGIN block(s)
+ # BEGIN rule(s)
BEGIN {
1 print "First BEGIN rule"
@@ -19608,7 +19608,7 @@ profiler on this program and data. (This example also illustrates that
}
}
- # END block(s)
+ # END rule(s)
END {
1 print "First END rule"
@@ -19694,7 +19694,7 @@ come out as:
print $0
}
-which is correct, but possibly surprising.
+which is correct, but possibly unexpected.
Besides creating profiles when a program has completed, `gawk' can
produce a profile while it is running. This is useful if your `awk'
@@ -19711,7 +19711,7 @@ The shell prints a job number and process ID number; in this case,
$ kill -USR1 13992
As usual, the profiled version of the program is written to
-`awkprof.out', or to a different file if one specified with the
+`awkprof.out', or to a different file if one was specified with the
`--profile' option.
Along with the regular profile, as shown earlier, the profile file
@@ -19755,7 +19755,8 @@ File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanc
* The `--non-decimal-data' option causes `gawk' to treat octal- and
hexadecimal-looking input data as octal and hexadecimal. This
option should be used with caution or not at all; use of
- `strtonum()' is preferable.
+ `strtonum()' is preferable. Note that this option may disappear
+ in a future version of `gawk'.
* You can take over complete control of sorting in `for (INDX in
ARRAY)' array traversal by setting `PROCINFO["sorted_in"]' to the
@@ -19774,9 +19775,9 @@ File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanc
coprocess completely, or optionally, close off one side of the
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.
- `gawk' supports both IPv4 an IPv6.
+ * By using special file names with the `|&' operator, you can open a
+ TCP/IP (or UDP/IP) connection to remote hosts in the Internet.
+ `gawk' supports both IPv4 and IPv6.
* You can generate statement count profiles of your program. This
can help you determine which parts of your program may be taking
@@ -19937,7 +19938,7 @@ are:
Character-type information (alphabetic, digit, upper- or
lowercase, and so on) as well as character encoding. This
information is accessed via the POSIX character classes in regular
- expressions, such as `/[[:alnum:]]/' (*note Regexp Operators::).
+ expressions, such as `/[[:alnum:]]/' (*note Bracket Expressions::).
`LC_MONETARY'
Monetary information, such as the currency symbol, and whether the
@@ -20005,8 +20006,8 @@ internationalization:
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"'.
The same remarks about argument order as for the `dcgettext()'
@@ -20059,9 +20060,11 @@ outlined in *note Explaining gettext::, like so:
one. This example would be better done with `dcngettext()':
if (groggy)
- message = dcngettext("%d customer disturbing me\n", "%d customers disturbing me\n", "adminprog")
+ message = dcngettext("%d customer disturbing me\n",
+ "%d customers disturbing me\n", "adminprog")
else
- message = dcngettext("enjoying %d customer\n", "enjoying %d customers\n", "adminprog")
+ message = dcngettext("enjoying %d customer\n",
+ "enjoying %d customers\n", "adminprog")
printf(message, ncustomers)
4. During development, you might want to put the `.gmo' file in a
@@ -20119,7 +20122,7 @@ marked and you've set (and perhaps bound) the text domain, it is time
to produce translations. First, use the `--gen-pot' command-line
option to create the initial `.pot' file:
- $ gawk --gen-pot -f guide.awk > guide.pot
+ gawk --gen-pot -f guide.awk > guide.pot
When run with `--gen-pot', `gawk' does not execute your program.
Instead, it parses it as usual and prints all marked strings to
@@ -20171,11 +20174,11 @@ example, `string' is the first argument and `length(string)' is the
second:
$ gawk 'BEGIN {
- > string = "Dont Panic"
+ > string = "Don\47t Panic"
> printf "%2$d characters live in \"%1$s\"\n",
> string, length(string)
> }'
- -| 10 characters live in "Dont Panic"
+ -| 11 characters live in "Don't Panic"
If present, positional specifiers come first in the format
specification, before the flags, the field width, and/or the precision.
@@ -20336,7 +20339,8 @@ 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. The directory
+our file is to be used in the `en_US.UTF-8' locale, since 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:
@@ -20345,7 +20349,7 @@ Other versions of `gettext' may use a different layout:
The `msgfmt' utility does the conversion from human-readable `.po'
file to machine-readable `.mo' file. By default, `msgfmt' creates a
file named `messages'. This file must be renamed and placed in the
-proper directory so that `gawk' can find it:
+proper directory (using the `-o' option) so that `gawk' can find it:
$ msgfmt guide-mellow.po -o en_US.UTF-8/LC_MESSAGES/guide.mo
@@ -20378,8 +20382,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.1
-(ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.1.tar.gz).
+writing, the latest version of GNU `gettext' is version 0.19.2
+(ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.2.tar.gz).
If a translation of `gawk''s messages exists, then `gawk' produces
usage messages, warnings, and fatal errors in the local language.
@@ -20464,7 +20468,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 `awk'
+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
@@ -20500,8 +20504,8 @@ functional program that you or someone else wrote).

File: gawk.info, Node: Debugging Terms, Next: Awk Debugging, Prev: Debugging Concepts, Up: Debugging
-14.1.2 Additional Debugging Concepts
-------------------------------------
+14.1.2 Debugging Concepts
+-------------------------
Before diving in to the details, we need to introduce several important
concepts that apply to just about all debuggers. The following list
@@ -20593,13 +20597,13 @@ File: gawk.info, Node: Debugger Invocation, Next: Finding The Bug, Up: Sample
14.2.1 How to Start the Debugger
--------------------------------
-Starting the debugger is almost exactly like running `gawk', 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 the debugger like
-this:
+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
+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
+the debugger like this:
$ gawk -D -f getopt.awk -f join.awk -f uniq.awk -1 inputfile
@@ -20608,7 +20612,7 @@ users of GDB or similar debuggers should note that this syntax is
slightly different from what they 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.)
+debugger prompt.) The `-1' is an option to `uniq.awk'.
Instead of immediately running the program on `inputfile', as `gawk'
would ordinarily do, the debugger merely loads all the program source
@@ -20756,9 +20760,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
-yet 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?
+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?
The first choice would be to use subscripts:
@@ -20908,13 +20912,13 @@ controlling breakpoints are:
`condition' N `"EXPRESSION"'
Add a condition to existing breakpoint or watchpoint N. The
- condition is an `awk' expression 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.
+ condition is an `awk' expression _enclosed in double quotes_ 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.
`delete' [N1 N2 ...] [N-M]
`d' [N1 N2 ...] [N-M]
@@ -21033,9 +21037,9 @@ execution of the program than we saw in our earlier example:
`until' [[FILENAME`:']N | FUNCTION]
`u' [[FILENAME`:']N | FUNCTION]
Without any argument, continue execution until a line past the
- current line in current stack frame is reached. With an argument,
- continue execution until the specified location is reached, or the
- current stack frame returns.
+ current line in the current stack frame is reached. With an
+ argument, continue execution until the specified location is
+ reached, or the current stack frame returns.

File: gawk.info, Node: Viewing And Changing Data, Next: Execution Stack, Prev: Debugger Execution Control, Up: List of Debugger Commands
@@ -21082,9 +21086,9 @@ AWK STATEMENTS
This prints the third field in the input record (if the specified
field does not exist, it prints `Null field'). A variable can be
- an array element, with the subscripts being constant values. To
- print the contents of an array, prefix the name of the array with
- the `@' symbol:
+ an array element, with the subscripts being constant string
+ values. To print the contents of an array, prefix the name of the
+ array with the `@' symbol:
gawk> print @a
@@ -21129,7 +21133,7 @@ AWK STATEMENTS

File: gawk.info, Node: Execution Stack, Next: Debugger Info, Prev: Viewing And Changing Data, Up: List of Debugger Commands
-14.3.4 Dealing with the Stack
+14.3.4 Working with the Stack
-----------------------------
Whenever you run a program which contains any function calls, `gawk'
@@ -21141,11 +21145,13 @@ are:
`backtrace' [COUNT]
`bt' [COUNT]
+`where' [COUNT]
Print a backtrace of all function calls (stack frames), or
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.
+ number. The alias `where' for `backtrace' is provided for
+ long-time GDB users who may be used to that command.
`down' [COUNT]
Move COUNT (default 1) frames down the stack toward the innermost
@@ -21182,7 +21188,7 @@ know:
The value for WHAT should be one of the following:
`args'
- Arguments of the selected frame.
+ List arguments of the selected frame.
`break'
List all currently set breakpoints.
@@ -21191,19 +21197,19 @@ know:
List all items in the automatic display list.
`frame'
- Description of the selected stack frame.
+ Give a description of the selected stack frame.
`functions'
List all function definitions including source file names and
line numbers.
`locals'
- Local variables of the selected frame.
+ List local variables of the selected frame.
`source'
- The name of the current source file. Each time the program
- stops, the current source file is the file containing the
- current instruction. When the debugger first starts, the
+ Print the name of the current source file. Each time the
+ program stops, the current source file is the file containing
+ the current instruction. When the debugger first starts, the
current source file is the first file included via the `-f'
option. The `list FILENAME:LINENO' command can be used at any
time to change the current source.
@@ -21351,7 +21357,7 @@ categories, as follows:
or the file named FILENAME. The possible arguments to `list' are
as follows:
- `-'
+ `-' (Minus)
Print lines before the lines last printed.
`+'
@@ -21422,8 +21428,8 @@ Variable name completion

File: gawk.info, Node: Limitations, Next: Debugging Summary, Prev: Readline Support, Up: Debugger
-14.5 Limitations and Future Plans
-=================================
+14.5 Limitations
+================
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
@@ -21462,10 +21468,6 @@ some limitations. A few which are worth being aware of are:
* The `gawk' debugger only accepts source supplied with the `-f'
option.
- Look forward to a future release when these and other missing
-features may be added, and of course feel free to try to add them
-yourself!
-

File: gawk.info, Node: Debugging Summary, Prev: Limitations, Up: Debugger
@@ -21502,8 +21504,7 @@ File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Dynamic Extension
************************************************************
This major node introduces some basic concepts relating to how
-computers do arithmetic and briefly lists the features in `gawk' for
-performing arbitrary precision floating point computations. It then
+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
@@ -21598,7 +21599,8 @@ Floating point arithmetic
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 the following table.
+signed. The possible ranges of values are shown in *note
+table-numeric-ranges::.
Numeric representation Miniumum value Maximum value
---------------------------------------------------------------------------
@@ -21613,6 +21615,8 @@ Double precision `2.225074e-308' `1.797693e+308'
floating point
(approximate)
+Table 15.1: Value Ranges for Different Numeric Representations
+
---------- Footnotes ----------
(1) We don't know why they expect this, but they do.
@@ -21645,7 +21649,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
@@ -21703,21 +21707,22 @@ 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:
-Name Total bits Precision emin emax
+Name Total bits Precision Minimum Maximum
+ exponent exponent
---------------------------------------------------------------------------
Single 32 24 -126 +127
Double 64 53 -1022 +1023
Quadruple 128 113 -16382 +16383
-Table 15.1: Basic IEEE Format Context 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.
---------- Footnotes ----------
- (1) Thanks to Michael Brennan for this description, which I have
-paraphrased, and for the examples
+ (1) Thanks to Michael Brennan for this description, which we have
+paraphrased, and for the examples.

File: gawk.info, Node: MPFR features, Next: FP Math Caution, Prev: Math Definitions, Up: Arbitrary Precision Arithmetic
@@ -21725,15 +21730,15 @@ File: gawk.info, Node: MPFR features, Next: FP Math Caution, Prev: Math Defin
15.3 Arbitrary Precison 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, `gawk' uses the GNU MPFR (http://www.mpfr.org) and GNU
-MP (http://gmplib.org) (GMP) libraries for arbitrary precision
+compiled to do so, `gawk' uses the `http://www.mpfr.org GNU MPFR' and
+GNU MP (http://gmplib.org) (GMP) libraries for arbitrary precision
arithmetic on numbers. You can see if MPFR support is available like
so:
$ gawk --version
- -| GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2)
+ -| 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.
...
@@ -21754,7 +21759,8 @@ results to any desired precision level supported by MPFR.
Two built-in variables, `PREC' and `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. *Note
-Auto-set::, for more information.
+Setting precision::, and *note Setting the rounding mode::, for more
+information.

File: gawk.info, Node: FP Math Caution, Next: Arbitrary Precision Integers, Prev: MPFR features, Up: Arbitrary Precision Arithmetic
@@ -21868,6 +21874,9 @@ you. Code to do this looks something like this:
else
# not ok
+(We assume that you have a simple absolute value function named `abs()'
+defined elsewhere in your program.)
+

File: gawk.info, Node: Errors accumulate, Prev: Comparing FP Values, Up: Inexactness of computations
@@ -21950,7 +21959,7 @@ 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
-computations with a particular precision and effective rounding rule, a
+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.
@@ -22026,7 +22035,7 @@ binary format.
`"quad"' Basic 128-bit quadruple precision.
`"oct"' 256-bit octuple precision.
-Table 15.2: 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:
@@ -22040,7 +22049,7 @@ on arithmetic operations:
floating-point constant from program source code, `gawk' uses the
default precision (that of a C `double'), unless overridden by an
assignment to the special variable `PREC' on the command line, to
- store it internally as a MPFR number. Changing the precision
+ store it internally as an MPFR number. Changing the precision
using `PREC' in the program text does _not_ change the precision
of a constant.
@@ -22079,10 +22088,10 @@ Round toward zero `roundTowardZero' `"Z"' or `"z"'
Round to nearest, ties away `roundTiesToAway' `"A"' or `"a"'
from zero
-Table 15.3: `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.3:
+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.
@@ -22161,15 +22170,15 @@ 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
+which is beyond the limits of ordinary hardware double precision
floating point values:
$ gawk -M 'BEGIN {
> x = 5^4^3^2
- > print "# of digits =", length(x)
+ > print "number of digits =", length(x)
> print substr(x, 1, 20), "...", substr(x, length(x) - 19, 20)
> }'
- -| # of digits = 183231
+ -| number of digits = 183231
-| 62060698786608744707 ... 92256259918212890625
If instead you were to compute the same value using arbitrary
@@ -22321,8 +22330,8 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob
============
* Most computer arithmetic is done using either integers or
- floating-point values. The default for `awk' is to use
- double-precision floating-point values.
+ 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
@@ -22423,7 +22432,7 @@ 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'
developers. The rest of this major node explains the facilities that
-the API provides and how to use them, and presents a small sample
+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
Extension Design::, for a discussion of the extension mechanism goals
@@ -22435,10 +22444,13 @@ File: gawk.info, Node: Plugin License, Next: Extension Mechanism Outline, Pre
16.2 Extension Licensing
========================
-Every dynamic extension should define the global symbol
-`plugin_is_GPL_compatible' to assert that it has been licensed under a
-GPL-compatible license. If this symbol does not exist, `gawk' emits a
-fatal error and exits when it tries to load your extension.
+Every dynamic extension must be distributed under a license that is
+compatible with the GNU GPL (*note Copying::).
+
+ In order for the extension to tell `gawk' that it is properly
+licensed, the extension must define the global symbol
+`plugin_is_GPL_compatible'. If this symbol does not exist, `gawk'
+emits a fatal error and exits when it tries to load your extension.
The declared type of the symbol should be `int'. It does not need
to be in any allocated section, though. The code merely asserts that
@@ -22453,7 +22465,7 @@ File: gawk.info, Node: Extension Mechanism Outline, Next: Extension API Descri
=================================
Communication between `gawk' and an extension is two-way. First, when
-an extension is loaded, it is passed a pointer to a `struct' whose
+an extension is loaded, `gawk' passes it a pointer to a `struct' whose
fields are function pointers. This is shown in *note
figure-load-extension::.
@@ -22486,8 +22498,8 @@ 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
`gawk''s symbols. One of these function pointers is to a function for
-"registering" new built-in functions. This is shown in *note
-figure-load-new-function::.
+"registering" new functions. This is shown in *note
+figure-register-new-function::.
register_ext_func({ "chdir", do_chdir, 1 });
@@ -22501,7 +22513,7 @@ figure-load-new-function::.
+-------+-+---+-+---+-+------------------+--------------+-+---+
gawk Main Program Address Space Extension
-Figure 16.2: Loading The 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
@@ -22534,8 +22546,8 @@ and understandable.
Although all of this sounds somewhat complicated, the result is that
extension code is quite straightforward to write and to read. You can
-see this in the sample extensions `filefuncs.c' (*note Extension
-Example::) and also the `testext.c' code for testing the APIs.
+see this in the sample extension `filefuncs.c' (*note Extension
+Example::) and also in the `testext.c' code for testing the APIs.
Some other bits and pieces:
@@ -22689,7 +22701,7 @@ operations:
* When retrieving a value (such as a parameter or that of a global
variable or array element), the extension requests a specific type
- (number, string, scalars, value cookie, array, or "undefined").
+ (number, string, scalar, value cookie, array, or "undefined").
When the request is "undefined," the returned value will have the
real underlying type.
@@ -22833,7 +22845,7 @@ 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 first find it.
+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
@@ -31197,10 +31209,10 @@ Index
* .gmo files: Explaining gettext. (line 42)
* .gmo files, specifying directory of <1>: Programmer i18n. (line 47)
* .gmo files, specifying directory of: Explaining gettext. (line 54)
-* .mo files, converting from .po: I18N Example. (line 63)
+* .mo files, converting from .po: I18N Example. (line 64)
* .po files <1>: Translator i18n. (line 6)
* .po files: Explaining gettext. (line 37)
-* .po files, converting to .mo: I18N Example. (line 63)
+* .po files, converting to .mo: I18N Example. (line 64)
* .pot files: Explaining gettext. (line 31)
* / (forward slash) to enclose regular expressions: Regexp. (line 10)
* / (forward slash), / operator: Precedence. (line 55)
@@ -31963,7 +31975,7 @@ Index
* debugger commands, disable: Breakpoint Control. (line 69)
* debugger commands, display: Viewing And Changing Data.
(line 8)
-* debugger commands, down: Execution Stack. (line 21)
+* debugger commands, down: Execution Stack. (line 23)
* debugger commands, dump: Miscellaneous Debugger Commands.
(line 9)
* debugger commands, e (enable): Breakpoint Control. (line 73)
@@ -31972,10 +31984,10 @@ Index
(line 10)
* debugger commands, eval: Viewing And Changing Data.
(line 23)
-* debugger commands, f (frame): Execution Stack. (line 25)
+* debugger commands, f (frame): Execution Stack. (line 27)
* debugger commands, finish: Debugger Execution Control.
(line 39)
-* debugger commands, frame: Execution Stack. (line 25)
+* debugger commands, frame: Execution Stack. (line 27)
* debugger commands, h (help): Miscellaneous Debugger Commands.
(line 66)
* debugger commands, help: Miscellaneous Debugger Commands.
@@ -32037,11 +32049,12 @@ Index
(line 83)
* debugger commands, unwatch: Viewing And Changing Data.
(line 84)
-* debugger commands, up: Execution Stack. (line 34)
+* debugger commands, up: Execution Stack. (line 36)
* debugger commands, w (watch): Viewing And Changing Data.
(line 67)
* debugger commands, watch: Viewing And Changing Data.
(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 size: Debugger Info. (line 65)
@@ -32165,7 +32178,7 @@ Index
* dollar sign ($), regexp operator: Regexp Operators. (line 35)
* double quote ("), in regexp constants: Computed Regexps. (line 29)
* double quote ("), in shell commands: Quoting. (line 54)
-* down debugger command: Execution Stack. (line 21)
+* down debugger command: Execution Stack. (line 23)
* Drepper, Ulrich: Acknowledgments. (line 52)
* dump all variables of a program: Options. (line 93)
* dump debugger command: Miscellaneous Debugger Commands.
@@ -32324,7 +32337,7 @@ Index
* extract.awk program: Extract Program. (line 79)
* extraction, of marked strings (internationalization): String Extraction.
(line 6)
-* f debugger command (alias for frame): Execution Stack. (line 25)
+* f debugger command (alias for frame): Execution Stack. (line 27)
* false, logical: Truth Values. (line 6)
* FDL (Free Documentation License): GNU Free Documentation License.
(line 7)
@@ -32380,10 +32393,10 @@ Index
* files, .gmo: Explaining gettext. (line 42)
* files, .gmo, specifying directory of <1>: Programmer i18n. (line 47)
* files, .gmo, specifying directory of: Explaining gettext. (line 54)
-* files, .mo, converting from .po: I18N Example. (line 63)
+* files, .mo, converting from .po: I18N Example. (line 64)
* files, .po <1>: Translator i18n. (line 6)
* files, .po: Explaining gettext. (line 37)
-* files, .po, converting to .mo: I18N Example. (line 63)
+* files, .po, converting to .mo: I18N Example. (line 64)
* files, .pot: Explaining gettext. (line 31)
* files, /dev/... special files: Special FD. (line 48)
* files, /inet/... (gawk): TCP/IP Networking. (line 6)
@@ -32403,7 +32416,7 @@ Index
* files, managing, data file boundaries: Filetrans Function. (line 6)
* files, message object: Explaining gettext. (line 42)
* files, message object, converting from portable object files: I18N Example.
- (line 63)
+ (line 64)
* files, message object, specifying directory of <1>: Programmer i18n.
(line 47)
* files, message object, specifying directory of: Explaining gettext.
@@ -32417,7 +32430,7 @@ Index
* files, portable object: Explaining gettext. (line 37)
* files, portable object template: Explaining gettext. (line 31)
* files, portable object, converting to message object files: I18N Example.
- (line 63)
+ (line 64)
* files, portable object, generating: Options. (line 147)
* files, processing, ARGIND variable and: Auto-set. (line 51)
* files, reading: Rewind Function. (line 6)
@@ -32468,7 +32481,7 @@ Index
* FPAT variable <1>: User-modified. (line 43)
* FPAT variable: Splitting By Content.
(line 27)
-* frame debugger command: Execution Stack. (line 25)
+* 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)
@@ -32882,7 +32895,7 @@ Index
* LC_CTYPE locale category: Explaining gettext. (line 98)
* LC_MESSAGES locale category: Explaining gettext. (line 88)
* LC_MESSAGES locale category, bindtextdomain() function (gawk): Programmer i18n.
- (line 99)
+ (line 101)
* LC_MONETARY locale category: Explaining gettext. (line 104)
* LC_NUMERIC locale category: Explaining gettext. (line 108)
* LC_TIME locale category: Explaining gettext. (line 112)
@@ -33010,7 +33023,7 @@ Index
* McPhee, Patrick: Contributors. (line 100)
* message object files: Explaining gettext. (line 42)
* message object files, converting from portable object files: I18N Example.
- (line 63)
+ (line 64)
* message object files, specifying directory of <1>: Programmer i18n.
(line 47)
* message object files, specifying directory of: Explaining gettext.
@@ -33023,7 +33036,7 @@ Index
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 104)
* Moore, Duncan: Getline Notes. (line 40)
-* msgfmt utility: I18N Example. (line 63)
+* msgfmt utility: I18N Example. (line 64)
* multiple precision: Arbitrary Precision Arithmetic.
(line 6)
* multiple-line records: Multiple Line. (line 6)
@@ -33264,7 +33277,7 @@ Index
* 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.
- (line 63)
+ (line 64)
* portable object files, generating: Options. (line 147)
* portable object template files: Explaining gettext. (line 31)
* porting gawk: New Ports. (line 6)
@@ -33963,7 +33976,7 @@ Index
(line 83)
* unwatch debugger command: Viewing And Changing Data.
(line 84)
-* up debugger command: Execution Stack. (line 34)
+* up debugger command: Execution Stack. (line 36)
* user database, reading: Passwd Functions. (line 6)
* user-defined functions: User-defined. (line 6)
* user-defined, functions, counts, in a profile: Profiling. (line 137)
@@ -34037,6 +34050,9 @@ Index
* wc.awk program: Wc Program. (line 46)
* Weinberger, Peter <1>: Contributors. (line 11)
* Weinberger, Peter: History. (line 17)
+* where debugger command: Execution Stack. (line 13)
+* where debugger command (alias for backtrace): Execution Stack.
+ (line 13)
* while statement: While Statement. (line 6)
* while statement, use of regexps in: Regexp Usage. (line 19)
* whitespace, as field separators: Default Field Splitting.
@@ -34441,210 +34457,211 @@ Node: Two-way I/O783527
Ref: Two-way I/O-Footnote-1788471
Ref: Two-way I/O-Footnote-2788657
Node: TCP/IP Networking788739
-Node: Profiling791580
-Node: Advanced Features Summary799122
-Node: Internationalization800983
-Node: I18N and L10N802463
-Node: Explaining gettext803149
-Ref: Explaining gettext-Footnote-1808175
-Ref: Explaining gettext-Footnote-2808359
-Node: Programmer i18n808524
-Ref: Programmer i18n-Footnote-1813318
-Node: Translator i18n813367
-Node: String Extraction814161
-Ref: String Extraction-Footnote-1815294
-Node: Printf Ordering815380
-Ref: Printf Ordering-Footnote-1818162
-Node: I18N Portability818226
-Ref: I18N Portability-Footnote-1820675
-Node: I18N Example820738
-Ref: I18N Example-Footnote-1823444
-Node: Gawk I18N823516
-Node: I18N Summary824154
-Node: Debugger825493
-Node: Debugging826515
-Node: Debugging Concepts826956
-Node: Debugging Terms828812
-Node: Awk Debugging831409
-Node: Sample Debugging Session832301
-Node: Debugger Invocation832821
-Node: Finding The Bug834157
-Node: List of Debugger Commands840636
-Node: Breakpoint Control841968
-Node: Debugger Execution Control845632
-Node: Viewing And Changing Data848992
-Node: Execution Stack852350
-Node: Debugger Info853863
-Node: Miscellaneous Debugger Commands857857
-Node: Readline Support863041
-Node: Limitations863933
-Node: Debugging Summary866206
-Node: Arbitrary Precision Arithmetic867374
-Node: Computer Arithmetic868861
-Ref: Computer Arithmetic-Footnote-1873248
-Node: Math Definitions873305
-Ref: table-ieee-formats876594
-Ref: Math Definitions-Footnote-1877134
-Node: MPFR features877237
-Node: FP Math Caution878854
-Ref: FP Math Caution-Footnote-1879904
-Node: Inexactness of computations880273
-Node: Inexact representation881221
-Node: Comparing FP Values882576
-Node: Errors accumulate883540
-Node: Getting Accuracy884973
-Node: Try To Round887632
-Node: Setting precision888531
-Ref: table-predefined-precision-strings889213
-Node: Setting the rounding mode891006
-Ref: table-gawk-rounding-modes891370
-Ref: Setting the rounding mode-Footnote-1894824
-Node: Arbitrary Precision Integers895003
-Ref: Arbitrary Precision Integers-Footnote-1897984
-Node: POSIX Floating Point Problems898133
-Ref: POSIX Floating Point Problems-Footnote-1902009
-Node: Floating point summary902047
-Node: Dynamic Extensions904251
-Node: Extension Intro905803
-Node: Plugin License907068
-Node: Extension Mechanism Outline907753
-Ref: figure-load-extension908177
-Ref: figure-load-new-function909662
-Ref: figure-call-new-function910664
-Node: Extension API Description912648
-Node: Extension API Functions Introduction914098
-Node: General Data Types918965
-Ref: General Data Types-Footnote-1924658
-Node: Requesting Values924957
-Ref: table-value-types-returned925694
-Node: Memory Allocation Functions926652
-Ref: Memory Allocation Functions-Footnote-1929399
-Node: Constructor Functions929495
-Node: Registration Functions931253
-Node: Extension Functions931938
-Node: Exit Callback Functions934240
-Node: Extension Version String935488
-Node: Input Parsers936138
-Node: Output Wrappers945952
-Node: Two-way processors950468
-Node: Printing Messages952672
-Ref: Printing Messages-Footnote-1953749
-Node: Updating `ERRNO'953901
-Node: Accessing Parameters954640
-Node: Symbol Table Access955870
-Node: Symbol table by name956384
-Node: Symbol table by cookie958360
-Ref: Symbol table by cookie-Footnote-1962493
-Node: Cached values962556
-Ref: Cached values-Footnote-1966060
-Node: Array Manipulation966151
-Ref: Array Manipulation-Footnote-1967249
-Node: Array Data Types967288
-Ref: Array Data Types-Footnote-1969991
-Node: Array Functions970083
-Node: Flattening Arrays973957
-Node: Creating Arrays980809
-Node: Extension API Variables985540
-Node: Extension Versioning986176
-Node: Extension API Informational Variables988077
-Node: Extension API Boilerplate989163
-Node: Finding Extensions992967
-Node: Extension Example993527
-Node: Internal File Description994257
-Node: Internal File Ops998348
-Ref: Internal File Ops-Footnote-11009780
-Node: Using Internal File Ops1009920
-Ref: Using Internal File Ops-Footnote-11012267
-Node: Extension Samples1012535
-Node: Extension Sample File Functions1014059
-Node: Extension Sample Fnmatch1021627
-Node: Extension Sample Fork1023109
-Node: Extension Sample Inplace1024322
-Node: Extension Sample Ord1025997
-Node: Extension Sample Readdir1026833
-Ref: table-readdir-file-types1027689
-Node: Extension Sample Revout1028488
-Node: Extension Sample Rev2way1029079
-Node: Extension Sample Read write array1029820
-Node: Extension Sample Readfile1031699
-Node: Extension Sample API Tests1032799
-Node: Extension Sample Time1033324
-Node: gawkextlib1034639
-Node: Extension summary1037452
-Node: Extension Exercises1041145
-Node: Language History1041867
-Node: V7/SVR3.11043510
-Node: SVR41045830
-Node: POSIX1047272
-Node: BTL1048658
-Node: POSIX/GNU1049392
-Node: Feature History1055108
-Node: Common Extensions1068199
-Node: Ranges and Locales1069511
-Ref: Ranges and Locales-Footnote-11074128
-Ref: Ranges and Locales-Footnote-21074155
-Ref: Ranges and Locales-Footnote-31074389
-Node: Contributors1074610
-Node: History summary1080035
-Node: Installation1081404
-Node: Gawk Distribution1082355
-Node: Getting1082839
-Node: Extracting1083663
-Node: Distribution contents1085305
-Node: Unix Installation1091022
-Node: Quick Installation1091639
-Node: Additional Configuration Options1094081
-Node: Configuration Philosophy1095819
-Node: Non-Unix Installation1098170
-Node: PC Installation1098628
-Node: PC Binary Installation1099939
-Node: PC Compiling1101787
-Ref: PC Compiling-Footnote-11104786
-Node: PC Testing1104891
-Node: PC Using1106067
-Node: Cygwin1110219
-Node: MSYS1111028
-Node: VMS Installation1111526
-Node: VMS Compilation1112322
-Ref: VMS Compilation-Footnote-11113544
-Node: VMS Dynamic Extensions1113602
-Node: VMS Installation Details1114975
-Node: VMS Running1117227
-Node: VMS GNV1120061
-Node: VMS Old Gawk1120784
-Node: Bugs1121254
-Node: Other Versions1125258
-Node: Installation summary1131482
-Node: Notes1132538
-Node: Compatibility Mode1133403
-Node: Additions1134185
-Node: Accessing The Source1135110
-Node: Adding Code1136546
-Node: New Ports1142724
-Node: Derived Files1147205
-Ref: Derived Files-Footnote-11152680
-Ref: Derived Files-Footnote-21152714
-Ref: Derived Files-Footnote-31153310
-Node: Future Extensions1153424
-Node: Implementation Limitations1154030
-Node: Extension Design1155278
-Node: Old Extension Problems1156432
-Ref: Old Extension Problems-Footnote-11157949
-Node: Extension New Mechanism Goals1158006
-Ref: Extension New Mechanism Goals-Footnote-11161366
-Node: Extension Other Design Decisions1161555
-Node: Extension Future Growth1163661
-Node: Old Extension Mechanism1164497
-Node: Notes summary1166259
-Node: Basic Concepts1167445
-Node: Basic High Level1168126
-Ref: figure-general-flow1168398
-Ref: figure-process-flow1168997
-Ref: Basic High Level-Footnote-11172226
-Node: Basic Data Typing1172411
-Node: Glossary1175739
-Node: Copying1200891
-Node: GNU Free Documentation License1238447
-Node: Index1263583
+Node: Profiling791616
+Node: Advanced Features Summary799160
+Node: Internationalization801093
+Node: I18N and L10N802573
+Node: Explaining gettext803259
+Ref: Explaining gettext-Footnote-1808288
+Ref: Explaining gettext-Footnote-2808472
+Node: Programmer i18n808637
+Ref: Programmer i18n-Footnote-1813503
+Node: Translator i18n813552
+Node: String Extraction814346
+Ref: String Extraction-Footnote-1815477
+Node: Printf Ordering815563
+Ref: Printf Ordering-Footnote-1818349
+Node: I18N Portability818413
+Ref: I18N Portability-Footnote-1820862
+Node: I18N Example820925
+Ref: I18N Example-Footnote-1823725
+Node: Gawk I18N823797
+Node: I18N Summary824435
+Node: Debugger825774
+Node: Debugging826796
+Node: Debugging Concepts827237
+Node: Debugging Terms829094
+Node: Awk Debugging831669
+Node: Sample Debugging Session832561
+Node: Debugger Invocation833081
+Node: Finding The Bug834465
+Node: List of Debugger Commands840940
+Node: Breakpoint Control842272
+Node: Debugger Execution Control845964
+Node: Viewing And Changing Data849328
+Node: Execution Stack852693
+Node: Debugger Info854331
+Node: Miscellaneous Debugger Commands858348
+Node: Readline Support863540
+Node: Limitations864432
+Node: Debugging Summary866529
+Node: Arbitrary Precision Arithmetic867697
+Node: Computer Arithmetic869113
+Ref: table-numeric-ranges872714
+Ref: Computer Arithmetic-Footnote-1873573
+Node: Math Definitions873630
+Ref: table-ieee-formats876917
+Ref: Math Definitions-Footnote-1877521
+Node: MPFR features877626
+Node: FP Math Caution879294
+Ref: FP Math Caution-Footnote-1880344
+Node: Inexactness of computations880713
+Node: Inexact representation881661
+Node: Comparing FP Values883016
+Node: Errors accumulate884089
+Node: Getting Accuracy885522
+Node: Try To Round888181
+Node: Setting precision889080
+Ref: table-predefined-precision-strings889762
+Node: Setting the rounding mode891556
+Ref: table-gawk-rounding-modes891920
+Ref: Setting the rounding mode-Footnote-1895374
+Node: Arbitrary Precision Integers895553
+Ref: Arbitrary Precision Integers-Footnote-1898544
+Node: POSIX Floating Point Problems898693
+Ref: POSIX Floating Point Problems-Footnote-1902569
+Node: Floating point summary902607
+Node: Dynamic Extensions904799
+Node: Extension Intro906351
+Node: Plugin License907617
+Node: Extension Mechanism Outline908414
+Ref: figure-load-extension908842
+Ref: figure-register-new-function910322
+Ref: figure-call-new-function911326
+Node: Extension API Description913312
+Node: Extension API Functions Introduction914762
+Node: General Data Types919628
+Ref: General Data Types-Footnote-1925321
+Node: Requesting Values925620
+Ref: table-value-types-returned926357
+Node: Memory Allocation Functions927315
+Ref: Memory Allocation Functions-Footnote-1930062
+Node: Constructor Functions930158
+Node: Registration Functions931916
+Node: Extension Functions932601
+Node: Exit Callback Functions934903
+Node: Extension Version String936151
+Node: Input Parsers936801
+Node: Output Wrappers946615
+Node: Two-way processors951131
+Node: Printing Messages953335
+Ref: Printing Messages-Footnote-1954412
+Node: Updating `ERRNO'954564
+Node: Accessing Parameters955303
+Node: Symbol Table Access956533
+Node: Symbol table by name957047
+Node: Symbol table by cookie959023
+Ref: Symbol table by cookie-Footnote-1963156
+Node: Cached values963219
+Ref: Cached values-Footnote-1966723
+Node: Array Manipulation966814
+Ref: Array Manipulation-Footnote-1967912
+Node: Array Data Types967951
+Ref: Array Data Types-Footnote-1970654
+Node: Array Functions970746
+Node: Flattening Arrays974620
+Node: Creating Arrays981472
+Node: Extension API Variables986203
+Node: Extension Versioning986839
+Node: Extension API Informational Variables988740
+Node: Extension API Boilerplate989826
+Node: Finding Extensions993630
+Node: Extension Example994190
+Node: Internal File Description994920
+Node: Internal File Ops999011
+Ref: Internal File Ops-Footnote-11010443
+Node: Using Internal File Ops1010583
+Ref: Using Internal File Ops-Footnote-11012930
+Node: Extension Samples1013198
+Node: Extension Sample File Functions1014722
+Node: Extension Sample Fnmatch1022290
+Node: Extension Sample Fork1023772
+Node: Extension Sample Inplace1024985
+Node: Extension Sample Ord1026660
+Node: Extension Sample Readdir1027496
+Ref: table-readdir-file-types1028352
+Node: Extension Sample Revout1029151
+Node: Extension Sample Rev2way1029742
+Node: Extension Sample Read write array1030483
+Node: Extension Sample Readfile1032362
+Node: Extension Sample API Tests1033462
+Node: Extension Sample Time1033987
+Node: gawkextlib1035302
+Node: Extension summary1038115
+Node: Extension Exercises1041808
+Node: Language History1042530
+Node: V7/SVR3.11044173
+Node: SVR41046493
+Node: POSIX1047935
+Node: BTL1049321
+Node: POSIX/GNU1050055
+Node: Feature History1055771
+Node: Common Extensions1068862
+Node: Ranges and Locales1070174
+Ref: Ranges and Locales-Footnote-11074791
+Ref: Ranges and Locales-Footnote-21074818
+Ref: Ranges and Locales-Footnote-31075052
+Node: Contributors1075273
+Node: History summary1080698
+Node: Installation1082067
+Node: Gawk Distribution1083018
+Node: Getting1083502
+Node: Extracting1084326
+Node: Distribution contents1085968
+Node: Unix Installation1091685
+Node: Quick Installation1092302
+Node: Additional Configuration Options1094744
+Node: Configuration Philosophy1096482
+Node: Non-Unix Installation1098833
+Node: PC Installation1099291
+Node: PC Binary Installation1100602
+Node: PC Compiling1102450
+Ref: PC Compiling-Footnote-11105449
+Node: PC Testing1105554
+Node: PC Using1106730
+Node: Cygwin1110882
+Node: MSYS1111691
+Node: VMS Installation1112189
+Node: VMS Compilation1112985
+Ref: VMS Compilation-Footnote-11114207
+Node: VMS Dynamic Extensions1114265
+Node: VMS Installation Details1115638
+Node: VMS Running1117890
+Node: VMS GNV1120724
+Node: VMS Old Gawk1121447
+Node: Bugs1121917
+Node: Other Versions1125921
+Node: Installation summary1132145
+Node: Notes1133201
+Node: Compatibility Mode1134066
+Node: Additions1134848
+Node: Accessing The Source1135773
+Node: Adding Code1137209
+Node: New Ports1143387
+Node: Derived Files1147868
+Ref: Derived Files-Footnote-11153343
+Ref: Derived Files-Footnote-21153377
+Ref: Derived Files-Footnote-31153973
+Node: Future Extensions1154087
+Node: Implementation Limitations1154693
+Node: Extension Design1155941
+Node: Old Extension Problems1157095
+Ref: Old Extension Problems-Footnote-11158612
+Node: Extension New Mechanism Goals1158669
+Ref: Extension New Mechanism Goals-Footnote-11162029
+Node: Extension Other Design Decisions1162218
+Node: Extension Future Growth1164324
+Node: Old Extension Mechanism1165160
+Node: Notes summary1166922
+Node: Basic Concepts1168108
+Node: Basic High Level1168789
+Ref: figure-general-flow1169061
+Ref: figure-process-flow1169660
+Ref: Basic High Level-Footnote-11172889
+Node: Basic Data Typing1173074
+Node: Glossary1176402
+Node: Copying1201554
+Node: GNU Free Documentation License1239110
+Node: Index1264246

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index dae2bc3e..875e53d8 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -27321,11 +27321,13 @@ using regular pipes.
@ @ @ @ and no-one can talk to host that's close,@*
@ @ @ @ unless the host that isn't close@*
@ @ @ @ is busy, hung, or dead.}
+@author Mike O'Brien (aka Mr.@: Protocol)
@end quotation
@end ifnotdocbook
@docbook
<blockquote>
+<attribution>Mike O'Brien (aka Mr.&nbsp;Protocol)</attribution>
<literallayout class="normal"><literal>EMISTERED</literal>:
&nbsp;&nbsp;&nbsp;&nbsp;<emphasis>A host is a host from coast to coast,</emphasis>
&nbsp;&nbsp;&nbsp;&nbsp;<emphasis>and no-one can talk to host that's close,</emphasis>
@@ -27500,9 +27502,9 @@ in the morning to work.)
@cindex @code{BEGIN} pattern, and profiling
@cindex @code{END} pattern, and profiling
@example
- # gawk profile, created Thu Feb 27 05:16:21 2014
+ # gawk profile, created Mon Sep 29 05:16:21 2014
- # BEGIN block(s)
+ # BEGIN rule(s)
BEGIN @{
1 print "First BEGIN rule"
@@ -27529,7 +27531,7 @@ in the morning to work.)
@}
@}
- # END block(s)
+ # END rule(s)
END @{
1 print "First END rule"
@@ -27657,7 +27659,7 @@ come out as:
@end example
@noindent
-which is correct, but possibly surprising.
+which is correct, but possibly unexpected.
@cindex profiling @command{awk} programs, dynamically
@cindex @command{gawk} program, dynamic profiling
@@ -27689,7 +27691,7 @@ $ @kbd{kill -USR1 13992}
@noindent
As usual, the profiled version of the program is written to
-@file{awkprof.out}, or to a different file if one specified with
+@file{awkprof.out}, or to a different file if one was specified with
the @option{--profile} option.
Along with the regular profile, as shown earlier, the profile file
@@ -27749,6 +27751,7 @@ The @option{--non-decimal-data} option causes @command{gawk} to treat
octal- and hexadecimal-looking input data as octal and hexadecimal.
This option should be used with caution or not at all; use of @code{strtonum()}
is preferable.
+Note that this option may disappear in a future version of @command{gawk}.
@item
You can take over complete control of sorting in @samp{for (@var{indx} in @var{array})}
@@ -27768,9 +27771,9 @@ or @code{printf}. Use @code{close()} to close off the coprocess completely, or
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
+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}
-supports both IPv4 an IPv6.
+supports both IPv4 and IPv6.
@item
You can generate statement count profiles of your program. This can help you
@@ -28008,7 +28011,7 @@ In June 2001 Bruno Haible wrote:
This information is accessed via the
POSIX character classes in regular expressions,
such as @code{/[[:alnum:]]/}
-(@pxref{Regexp Operators}).
+(@pxref{Bracket Expressions}).
@cindex monetary information, localization
@cindex currency symbols, localization
@@ -28091,7 +28094,7 @@ default arguments.
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"}.
@@ -28179,9 +28182,11 @@ This example would be better done with @code{dcngettext()}:
@example
if (groggy)
- message = dcngettext("%d customer disturbing me\n", "%d customers disturbing me\n", "adminprog")
+ message = dcngettext("%d customer disturbing me\n",
+ "%d customers disturbing me\n", "adminprog")
else
- message = dcngettext("enjoying %d customer\n", "enjoying %d customers\n", "adminprog")
+ message = dcngettext("enjoying %d customer\n",
+ "enjoying %d customers\n", "adminprog")
printf(message, ncustomers)
@end example
@@ -28253,7 +28258,7 @@ First, use the @option{--gen-pot} command-line option to create
the initial @file{.pot} file:
@example
-$ @kbd{gawk --gen-pot -f guide.awk > guide.pot}
+gawk --gen-pot -f guide.awk > guide.pot
@end example
@cindex @code{xgettext} utility
@@ -28317,11 +28322,11 @@ example, @samp{string} is the first argument and @samp{length(string)} is the se
@example
$ @kbd{gawk 'BEGIN @{}
-> @kbd{string = "Dont Panic"}
+> @kbd{string = "Don\47t Panic"}
> @kbd{printf "%2$d characters live in \"%1$s\"\n",}
> @kbd{string, length(string)}
> @kbd{@}'}
-@print{} 10 characters live in "Dont Panic"
+@print{} 11 characters live in "Don't Panic"
@end example
If present, positional specifiers come first in the format specification,
@@ -28533,7 +28538,8 @@ msgstr "Like, the scoop is"
@cindex GNU/Linux
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.
+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.
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:
@@ -28554,8 +28560,8 @@ $ @kbd{mkdir en_US.UTF-8 en_US.UTF-8/LC_MESSAGES}
The @command{msgfmt} utility does the conversion from human-readable
@file{.po} file to machine-readable @file{.mo} file.
By default, @command{msgfmt} creates a file named @file{messages}.
-This file must be renamed and placed in the proper directory so that
-@command{gawk} can find it:
+This file must be renamed and placed in the proper directory (using
+the @option{-o} option) so that @command{gawk} can find it:
@example
$ @kbd{msgfmt guide-mellow.po -o en_US.UTF-8/LC_MESSAGES/guide.mo}
@@ -28598,8 +28604,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.1.tar.gz,
-@value{PVERSION} 0.19.1}.
+@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.2.tar.gz,
+@value{PVERSION} 0.19.2}.
If a translation of @command{gawk}'s messages exists,
then @command{gawk} produces usage messages, warnings,
@@ -28687,7 +28693,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{awk}
+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
@@ -28727,7 +28733,7 @@ is going wrong (or, for that matter, to better comprehend a perfectly
functional program that you or someone else wrote).
@node Debugging Terms
-@subsection Additional Debugging Concepts
+@subsection Debugging Concepts
Before diving in to the details, we need to introduce several
important concepts that apply to just about all debuggers.
@@ -28816,8 +28822,8 @@ as our example.
@cindex starting the debugger
@cindex debugger, how to start
-Starting the debugger is almost exactly like running @command{gawk},
-except you have to pass an additional option @option{--debug} or the
+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
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
@@ -28835,6 +28841,7 @@ this syntax is slightly different from what they 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.)
+The @option{-1} is an option to @file{uniq.awk}.
Instead of immediately running the program on @file{inputfile}, as
@command{gawk} would ordinarily do, the debugger merely loads all
@@ -29016,7 +29023,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 yet since we are at line 68 but haven't executed it yet.
+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?
@@ -29209,7 +29216,8 @@ Delete breakpoint(s) set at entry to function @var{function}.
@cindex breakpoint condition
@item @code{condition} @var{n} @code{"@var{expression}"}
Add a condition to existing breakpoint or watchpoint @var{n}. The
-condition is an @command{awk} expression that the debugger evaluates
+condition is an @command{awk} expression @emph{enclosed in double quotes}
+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
@@ -29397,7 +29405,7 @@ see the output shown under @code{dump} in @ref{Miscellaneous Debugger Commands}.
@item @code{until} [[@var{filename}@code{:}]@var{n} | @var{function}]
@itemx @code{u} [[@var{filename}@code{:}]@var{n} | @var{function}]
Without any argument, continue execution until a line past the current
-line in current stack frame is reached. With an argument,
+line in the current stack frame is reached. With an argument,
continue execution until the specified location is reached, or the current
stack frame returns.
@end table
@@ -29461,7 +29469,7 @@ gawk> @kbd{print $3}
@noindent
This prints the third field in the input record (if the specified field does not
exist, it prints @samp{Null field}). A variable can be an array element, with
-the subscripts being constant values. To print the contents of an array,
+the subscripts being constant string values. To print the contents of an array,
prefix the name of the array with the @samp{@@} symbol:
@example
@@ -29527,7 +29535,7 @@ watch list.
@end table
@node Execution Stack
-@subsection Dealing with the Stack
+@subsection Working with the Stack
Whenever you run a program which contains any function calls,
@command{gawk} maintains a stack of all of the function calls leading up
@@ -29538,16 +29546,22 @@ functions which called the one you are in. The commands for doing this are:
@table @asis
@cindex debugger commands, @code{bt} (@code{backtrace})
@cindex debugger commands, @code{backtrace}
+@cindex debugger commands, @code{where} (@code{backtrace})
@cindex @code{backtrace} debugger command
@cindex @code{bt} debugger command (alias for @code{backtrace})
+@cindex @code{where} debugger command
+@cindex @code{where} debugger command (alias for @code{backtrace})
@cindex call stack, display in debugger
@cindex traceback, display in debugger
@item @code{backtrace} [@var{count}]
@itemx @code{bt} [@var{count}]
+@itemx @code{where} [@var{count}]
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
+GDB users who may be used to that command.
@cindex debugger commands, @code{down}
@cindex @code{down} debugger command
@@ -29597,7 +29611,7 @@ The value for @var{what} should be one of the following:
@table @code
@item args
@cindex show function arguments, in debugger
-Arguments of the selected frame.
+List arguments of the selected frame.
@item break
@cindex show breakpoints
@@ -29609,7 +29623,7 @@ List all items in the automatic display list.
@item frame
@cindex describe call stack frame, in debugger
-Description of the selected stack frame.
+Give a description of the selected stack frame.
@item functions
@cindex list function definitions, in debugger
@@ -29618,11 +29632,11 @@ line numbers.
@item locals
@cindex show local variables, in debugger
-Local variables of the selected frame.
+List local variables of the selected frame.
@item source
@cindex show name of current source file, in debugger
-The name of the current source file. Each time the program stops, the
+Print the name of the current source file. Each time the program stops, the
current source file is the file containing the current instruction.
When the debugger first starts, the current source file is the first file
included via the @option{-f} option. The
@@ -29739,6 +29753,7 @@ commands in a program. This can be very enlightening, as the following
partial dump of Davide Brini's obfuscated code
(@pxref{Signature Program}) demonstrates:
+@c FIXME: This will need updating if num-handler branch is ever merged in.
@smallexample
gawk> @kbd{dump}
@print{} # BEGIN
@@ -29812,7 +29827,7 @@ are as follows:
@c nested table
@table @asis
-@item @code{-}
+@item @code{-} (Minus)
Print lines before the lines last printed.
@item @code{+}
@@ -29900,7 +29915,7 @@ and
@end table
@node Limitations
-@section Limitations and Future Plans
+@section Limitations
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
@@ -29948,8 +29963,10 @@ executing, short programs.
The @command{gawk} debugger only accepts source supplied with the @option{-f} option.
@end itemize
+@ignore
Look forward to a future release when these and other missing features may
be added, and of course feel free to try to add them yourself!
+@end ignore
@node Debugging Summary
@section Summary
@@ -29992,9 +30009,8 @@ and editing.
@cindex floating-point, numbers@comma{} arbitrary precision
This @value{CHAPTER} introduces some basic concepts relating to
-how computers do arithmetic and briefly lists the features in
-@command{gawk} for performing arbitrary precision floating point
-computations. It then proceeds to describe floating-point arithmetic,
+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
a feature available only in @command{gawk}. It continues on to present
@@ -30089,8 +30105,10 @@ 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 the following table.
+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}
@multitable @columnfractions .34 .33 .33
@headitem Numeric representation @tab Miniumum value @tab Maximum value
@item 32-bit signed integer @tab @minus{}2,147,483,648 @tab 2,147,483,647
@@ -30100,6 +30118,7 @@ signed. The possible ranges of values are shown in the following table.
@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
@@ -30127,14 +30146,12 @@ 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, which I 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, or get @code{NaN}
-back as the result. The IEEE 754 standard recommends that systems return
-@code{NaN}. Some examples:
+``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,
+or get @code{NaN} back as the result. The IEEE 754 standard recommends
+that systems return @code{NaN}. Some examples:
@table @code
@item sqrt(-1)
@@ -30208,9 +30225,9 @@ to allow greater precisions and larger exponent ranges.
field values for the basic IEEE 754 binary formats:
@float Table,table-ieee-formats
-@caption{Basic IEEE Format Context Values}
+@caption{Basic IEEE Format Values}
@multitable @columnfractions .20 .20 .20 .20 .20
-@headitem Name @tab Total bits @tab Precision @tab emin @tab emax
+@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 Double @tab 64 @tab 53 @tab @minus{}1022 @tab +1023
@item Quadruple @tab 128 @tab 113 @tab @minus{}16382 @tab +16383
@@ -30225,16 +30242,16 @@ one extra bit of significand.
@node MPFR features
@section Arbitrary Precison 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, @command{gawk} uses the @uref{http://www.mpfr.org, GNU
-MPFR} and @uref{http://gmplib.org, GNU MP} (GMP) libraries for arbitrary
+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}
-@print{} GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2)
+@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.
@dots{}
@end example
@@ -30258,7 +30275,8 @@ Two built-in 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{Auto-set}, for more information.
+@xref{Setting precision}, and @ref{Setting the rounding mode},
+for more information.
@node FP Math Caution
@section Floating Point Arithmetic: Caveat Emptor!
@@ -30372,6 +30390,10 @@ else
# not ok
@end example
+@noindent
+(We assume that you have a simple absolute value function named
+@code{abs()} defined elsewhere in your program.)
+
@node Errors accumulate
@subsubsection Errors Accumulate
@@ -30458,7 +30480,7 @@ 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
-computations with a particular precision and effective rounding rule,
+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.
@@ -30557,7 +30579,7 @@ Be wary of floating-point constants! When reading a floating-point
constant from program source code, @command{gawk} uses the default
precision (that of a C @code{double}), unless overridden by an assignment
to the special variable @code{PREC} on the command line, to store it
-internally as a MPFR number. Changing the precision using @code{PREC}
+internally as an MPFR number. Changing the precision using @code{PREC}
in the program text does @emph{not} change the precision of a constant.
If you need to represent a floating-point constant at a higher precision
@@ -30695,15 +30717,15 @@ the following computes
5<superscript>4<superscript>3<superscript>2</superscript></superscript></superscript>, @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 @{}
> @kbd{x = 5^4^3^2}
-> @kbd{print "# of digits =", length(x)}
+> @kbd{print "number of digits =", length(x)}
> @kbd{print substr(x, 1, 20), "...", substr(x, length(x) - 19, 20)}
> @kbd{@}'}
-@print{} # of digits = 183231
+@print{} number of digits = 183231
@print{} 62060698786608744707 ... 92256259918212890625
@end example
@@ -30887,7 +30909,7 @@ 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. The default for @command{awk} is to use double-precision
+values. Standard @command{awk} uses double precision
floating-point values.
@item
@@ -31006,7 +31028,7 @@ 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 sample extension. In addition, it documents
+them, and presents a small example extension. In addition, it documents
the sample extensions included in the @command{gawk} distribution,
and describes the @code{gawkextlib} project.
@ifclear FOR_PRINT
@@ -31022,10 +31044,14 @@ goals and design.
@node Plugin License
@section Extension Licensing
-Every dynamic extension should define the global symbol
-@code{plugin_is_GPL_compatible} to assert that it has been licensed under
-a GPL-compatible license. If this symbol does not exist, @command{gawk}
-emits a fatal error and exits when it tries to load your extension.
+Every dynamic extension must be distributed under a license that is
+compatible with the GNU GPL (@pxref{Copying}).
+
+In order for the extension to tell @command{gawk} that it is
+properly licensed, the extension must define the global symbol
+@code{plugin_is_GPL_compatible}. If this symbol does not exist,
+@command{gawk} emits a fatal error and exits when it tries to load
+your extension.
The declared type of the symbol should be @code{int}. It does not need
to be in any allocated section, though. The code merely asserts that
@@ -31040,7 +31066,7 @@ int plugin_is_GPL_compatible;
Communication between
@command{gawk} and an extension is two-way. First, when an extension
-is loaded, it is passed a pointer to a @code{struct} whose fields are
+is loaded, @command{gawk} passes it a pointer to a @code{struct} whose fields are
function pointers.
@ifnotdocbook
This is shown in @ref{figure-load-extension}.
@@ -31076,29 +31102,29 @@ This is shown in @inlineraw{docbook, <xref linkend="figure-load-extension"/>}.
The extension can call functions inside @command{gawk} through these
function pointers, at runtime, without needing (link-time) access
to @command{gawk}'s symbols. One of these function pointers is to a
-function for ``registering'' new built-in functions.
+function for ``registering'' new functions.
@ifnotdocbook
-This is shown in @ref{figure-load-new-function}.
+This is shown in @ref{figure-register-new-function}.
@end ifnotdocbook
@ifdocbook
-This is shown in @inlineraw{docbook, <xref linkend="figure-load-new-function"/>}.
+This is shown in @inlineraw{docbook, <xref linkend="figure-register-new-function"/>}.
@end ifdocbook
@ifnotdocbook
-@float Figure,figure-load-new-function
-@caption{Loading The New Function}
+@float Figure,figure-register-new-function
+@caption{Registering A New Function}
@ifinfo
-@center @image{api-figure2, , , Loading The New Function, txt}
+@center @image{api-figure2, , , Registering A New Function, txt}
@end ifinfo
@ifnotinfo
-@center @image{api-figure2, , , Loading The New Function}
+@center @image{api-figure2, , , Registering A New Function}
@end ifnotinfo
@end float
@end ifnotdocbook
@docbook
-<figure id="figure-load-new-function" float="0">
-<title>Loading The New Function</title>
+<figure id="figure-register-new-function" float="0">
+<title>Registering A New Function</title>
<mediaobject>
<imageobject role="web"><imagedata fileref="api-figure2.png" format="PNG"/></imageobject>
</mediaobject>
@@ -31148,8 +31174,8 @@ and understandable.
Although all of this sounds somewhat complicated, the result is that
extension code is quite straightforward to write and to read. You can
-see this in the sample extensions @file{filefuncs.c} (@pxref{Extension
-Example}) and also the @file{testext.c} code for testing the APIs.
+see this in the sample extension @file{filefuncs.c} (@pxref{Extension
+Example}) and also in the @file{testext.c} code for testing the APIs.
Some other bits and pieces:
@@ -31331,7 +31357,7 @@ and also how characters are likely to be input and output from files.
@item
When retrieving a value (such as a parameter or that of a global variable
or array element), the extension requests a specific type (number, string,
-scalars, value cookie, array, or ``undefined''). When the request is
+scalar, value cookie, array, or ``undefined''). When the request is
``undefined,'' the returned value will have the real underlying type.
However, if the request and actual type don't match, the access function
@@ -31490,7 +31516,7 @@ 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.
Given a scalar cookie, @command{gawk} can directly retrieve or
-modify the value, as required, without having to first find it.
+modify the value, as required, without having to find it first.
The @code{awk_value_cookie_t} type and @code{value_cookie} macro are similar.
If you know that you wish to
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index bfe058b1..a88115bd 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -26418,11 +26418,13 @@ using regular pipes.
@ @ @ @ and no-one can talk to host that's close,@*
@ @ @ @ unless the host that isn't close@*
@ @ @ @ is busy, hung, or dead.}
+@author Mike O'Brien (aka Mr.@: Protocol)
@end quotation
@end ifnotdocbook
@docbook
<blockquote>
+<attribution>Mike O'Brien (aka Mr.&nbsp;Protocol)</attribution>
<literallayout class="normal"><literal>EMISTERED</literal>:
&nbsp;&nbsp;&nbsp;&nbsp;<emphasis>A host is a host from coast to coast,</emphasis>
&nbsp;&nbsp;&nbsp;&nbsp;<emphasis>and no-one can talk to host that's close,</emphasis>
@@ -26597,9 +26599,9 @@ in the morning to work.)
@cindex @code{BEGIN} pattern, and profiling
@cindex @code{END} pattern, and profiling
@example
- # gawk profile, created Thu Feb 27 05:16:21 2014
+ # gawk profile, created Mon Sep 29 05:16:21 2014
- # BEGIN block(s)
+ # BEGIN rule(s)
BEGIN @{
1 print "First BEGIN rule"
@@ -26626,7 +26628,7 @@ in the morning to work.)
@}
@}
- # END block(s)
+ # END rule(s)
END @{
1 print "First END rule"
@@ -26754,7 +26756,7 @@ come out as:
@end example
@noindent
-which is correct, but possibly surprising.
+which is correct, but possibly unexpected.
@cindex profiling @command{awk} programs, dynamically
@cindex @command{gawk} program, dynamic profiling
@@ -26786,7 +26788,7 @@ $ @kbd{kill -USR1 13992}
@noindent
As usual, the profiled version of the program is written to
-@file{awkprof.out}, or to a different file if one specified with
+@file{awkprof.out}, or to a different file if one was specified with
the @option{--profile} option.
Along with the regular profile, as shown earlier, the profile file
@@ -26846,6 +26848,7 @@ The @option{--non-decimal-data} option causes @command{gawk} to treat
octal- and hexadecimal-looking input data as octal and hexadecimal.
This option should be used with caution or not at all; use of @code{strtonum()}
is preferable.
+Note that this option may disappear in a future version of @command{gawk}.
@item
You can take over complete control of sorting in @samp{for (@var{indx} in @var{array})}
@@ -26865,9 +26868,9 @@ or @code{printf}. Use @code{close()} to close off the coprocess completely, or
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
+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}
-supports both IPv4 an IPv6.
+supports both IPv4 and IPv6.
@item
You can generate statement count profiles of your program. This can help you
@@ -27105,7 +27108,7 @@ In June 2001 Bruno Haible wrote:
This information is accessed via the
POSIX character classes in regular expressions,
such as @code{/[[:alnum:]]/}
-(@pxref{Regexp Operators}).
+(@pxref{Bracket Expressions}).
@cindex monetary information, localization
@cindex currency symbols, localization
@@ -27188,7 +27191,7 @@ default arguments.
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"}.
@@ -27276,9 +27279,11 @@ This example would be better done with @code{dcngettext()}:
@example
if (groggy)
- message = dcngettext("%d customer disturbing me\n", "%d customers disturbing me\n", "adminprog")
+ message = dcngettext("%d customer disturbing me\n",
+ "%d customers disturbing me\n", "adminprog")
else
- message = dcngettext("enjoying %d customer\n", "enjoying %d customers\n", "adminprog")
+ message = dcngettext("enjoying %d customer\n",
+ "enjoying %d customers\n", "adminprog")
printf(message, ncustomers)
@end example
@@ -27350,7 +27355,7 @@ First, use the @option{--gen-pot} command-line option to create
the initial @file{.pot} file:
@example
-$ @kbd{gawk --gen-pot -f guide.awk > guide.pot}
+gawk --gen-pot -f guide.awk > guide.pot
@end example
@cindex @code{xgettext} utility
@@ -27414,11 +27419,11 @@ example, @samp{string} is the first argument and @samp{length(string)} is the se
@example
$ @kbd{gawk 'BEGIN @{}
-> @kbd{string = "Dont Panic"}
+> @kbd{string = "Don\47t Panic"}
> @kbd{printf "%2$d characters live in \"%1$s\"\n",}
> @kbd{string, length(string)}
> @kbd{@}'}
-@print{} 10 characters live in "Dont Panic"
+@print{} 11 characters live in "Don't Panic"
@end example
If present, positional specifiers come first in the format specification,
@@ -27630,7 +27635,8 @@ msgstr "Like, the scoop is"
@cindex GNU/Linux
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.
+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.
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:
@@ -27651,8 +27657,8 @@ $ @kbd{mkdir en_US.UTF-8 en_US.UTF-8/LC_MESSAGES}
The @command{msgfmt} utility does the conversion from human-readable
@file{.po} file to machine-readable @file{.mo} file.
By default, @command{msgfmt} creates a file named @file{messages}.
-This file must be renamed and placed in the proper directory so that
-@command{gawk} can find it:
+This file must be renamed and placed in the proper directory (using
+the @option{-o} option) so that @command{gawk} can find it:
@example
$ @kbd{msgfmt guide-mellow.po -o en_US.UTF-8/LC_MESSAGES/guide.mo}
@@ -27695,8 +27701,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.1.tar.gz,
-@value{PVERSION} 0.19.1}.
+@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.2.tar.gz,
+@value{PVERSION} 0.19.2}.
If a translation of @command{gawk}'s messages exists,
then @command{gawk} produces usage messages, warnings,
@@ -27784,7 +27790,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{awk}
+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
@@ -27824,7 +27830,7 @@ is going wrong (or, for that matter, to better comprehend a perfectly
functional program that you or someone else wrote).
@node Debugging Terms
-@subsection Additional Debugging Concepts
+@subsection Debugging Concepts
Before diving in to the details, we need to introduce several
important concepts that apply to just about all debuggers.
@@ -27913,8 +27919,8 @@ as our example.
@cindex starting the debugger
@cindex debugger, how to start
-Starting the debugger is almost exactly like running @command{gawk},
-except you have to pass an additional option @option{--debug} or the
+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
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
@@ -27932,6 +27938,7 @@ this syntax is slightly different from what they 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.)
+The @option{-1} is an option to @file{uniq.awk}.
Instead of immediately running the program on @file{inputfile}, as
@command{gawk} would ordinarily do, the debugger merely loads all
@@ -28113,7 +28120,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 yet since we are at line 68 but haven't executed it yet.
+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?
@@ -28306,7 +28313,8 @@ Delete breakpoint(s) set at entry to function @var{function}.
@cindex breakpoint condition
@item @code{condition} @var{n} @code{"@var{expression}"}
Add a condition to existing breakpoint or watchpoint @var{n}. The
-condition is an @command{awk} expression that the debugger evaluates
+condition is an @command{awk} expression @emph{enclosed in double quotes}
+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
@@ -28494,7 +28502,7 @@ see the output shown under @code{dump} in @ref{Miscellaneous Debugger Commands}.
@item @code{until} [[@var{filename}@code{:}]@var{n} | @var{function}]
@itemx @code{u} [[@var{filename}@code{:}]@var{n} | @var{function}]
Without any argument, continue execution until a line past the current
-line in current stack frame is reached. With an argument,
+line in the current stack frame is reached. With an argument,
continue execution until the specified location is reached, or the current
stack frame returns.
@end table
@@ -28558,7 +28566,7 @@ gawk> @kbd{print $3}
@noindent
This prints the third field in the input record (if the specified field does not
exist, it prints @samp{Null field}). A variable can be an array element, with
-the subscripts being constant values. To print the contents of an array,
+the subscripts being constant string values. To print the contents of an array,
prefix the name of the array with the @samp{@@} symbol:
@example
@@ -28624,7 +28632,7 @@ watch list.
@end table
@node Execution Stack
-@subsection Dealing with the Stack
+@subsection Working with the Stack
Whenever you run a program which contains any function calls,
@command{gawk} maintains a stack of all of the function calls leading up
@@ -28635,16 +28643,22 @@ functions which called the one you are in. The commands for doing this are:
@table @asis
@cindex debugger commands, @code{bt} (@code{backtrace})
@cindex debugger commands, @code{backtrace}
+@cindex debugger commands, @code{where} (@code{backtrace})
@cindex @code{backtrace} debugger command
@cindex @code{bt} debugger command (alias for @code{backtrace})
+@cindex @code{where} debugger command
+@cindex @code{where} debugger command (alias for @code{backtrace})
@cindex call stack, display in debugger
@cindex traceback, display in debugger
@item @code{backtrace} [@var{count}]
@itemx @code{bt} [@var{count}]
+@itemx @code{where} [@var{count}]
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
+GDB users who may be used to that command.
@cindex debugger commands, @code{down}
@cindex @code{down} debugger command
@@ -28694,7 +28708,7 @@ The value for @var{what} should be one of the following:
@table @code
@item args
@cindex show function arguments, in debugger
-Arguments of the selected frame.
+List arguments of the selected frame.
@item break
@cindex show breakpoints
@@ -28706,7 +28720,7 @@ List all items in the automatic display list.
@item frame
@cindex describe call stack frame, in debugger
-Description of the selected stack frame.
+Give a description of the selected stack frame.
@item functions
@cindex list function definitions, in debugger
@@ -28715,11 +28729,11 @@ line numbers.
@item locals
@cindex show local variables, in debugger
-Local variables of the selected frame.
+List local variables of the selected frame.
@item source
@cindex show name of current source file, in debugger
-The name of the current source file. Each time the program stops, the
+Print the name of the current source file. Each time the program stops, the
current source file is the file containing the current instruction.
When the debugger first starts, the current source file is the first file
included via the @option{-f} option. The
@@ -28836,6 +28850,7 @@ commands in a program. This can be very enlightening, as the following
partial dump of Davide Brini's obfuscated code
(@pxref{Signature Program}) demonstrates:
+@c FIXME: This will need updating if num-handler branch is ever merged in.
@smallexample
gawk> @kbd{dump}
@print{} # BEGIN
@@ -28909,7 +28924,7 @@ are as follows:
@c nested table
@table @asis
-@item @code{-}
+@item @code{-} (Minus)
Print lines before the lines last printed.
@item @code{+}
@@ -28997,7 +29012,7 @@ and
@end table
@node Limitations
-@section Limitations and Future Plans
+@section Limitations
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
@@ -29045,8 +29060,10 @@ executing, short programs.
The @command{gawk} debugger only accepts source supplied with the @option{-f} option.
@end itemize
+@ignore
Look forward to a future release when these and other missing features may
be added, and of course feel free to try to add them yourself!
+@end ignore
@node Debugging Summary
@section Summary
@@ -29089,9 +29106,8 @@ and editing.
@cindex floating-point, numbers@comma{} arbitrary precision
This @value{CHAPTER} introduces some basic concepts relating to
-how computers do arithmetic and briefly lists the features in
-@command{gawk} for performing arbitrary precision floating point
-computations. It then proceeds to describe floating-point arithmetic,
+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
a feature available only in @command{gawk}. It continues on to present
@@ -29186,8 +29202,10 @@ 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 the following table.
+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}
@multitable @columnfractions .34 .33 .33
@headitem Numeric representation @tab Miniumum value @tab Maximum value
@item 32-bit signed integer @tab @minus{}2,147,483,648 @tab 2,147,483,647
@@ -29197,6 +29215,7 @@ signed. The possible ranges of values are shown in the following table.
@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
@@ -29224,14 +29243,12 @@ 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, which I 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, or get @code{NaN}
-back as the result. The IEEE 754 standard recommends that systems return
-@code{NaN}. Some examples:
+``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,
+or get @code{NaN} back as the result. The IEEE 754 standard recommends
+that systems return @code{NaN}. Some examples:
@table @code
@item sqrt(-1)
@@ -29305,9 +29322,9 @@ to allow greater precisions and larger exponent ranges.
field values for the basic IEEE 754 binary formats:
@float Table,table-ieee-formats
-@caption{Basic IEEE Format Context Values}
+@caption{Basic IEEE Format Values}
@multitable @columnfractions .20 .20 .20 .20 .20
-@headitem Name @tab Total bits @tab Precision @tab emin @tab emax
+@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 Double @tab 64 @tab 53 @tab @minus{}1022 @tab +1023
@item Quadruple @tab 128 @tab 113 @tab @minus{}16382 @tab +16383
@@ -29322,16 +29339,16 @@ one extra bit of significand.
@node MPFR features
@section Arbitrary Precison 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, @command{gawk} uses the @uref{http://www.mpfr.org, GNU
-MPFR} and @uref{http://gmplib.org, GNU MP} (GMP) libraries for arbitrary
+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}
-@print{} GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2)
+@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.
@dots{}
@end example
@@ -29355,7 +29372,8 @@ Two built-in 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{Auto-set}, for more information.
+@xref{Setting precision}, and @ref{Setting the rounding mode},
+for more information.
@node FP Math Caution
@section Floating Point Arithmetic: Caveat Emptor!
@@ -29469,6 +29487,10 @@ else
# not ok
@end example
+@noindent
+(We assume that you have a simple absolute value function named
+@code{abs()} defined elsewhere in your program.)
+
@node Errors accumulate
@subsubsection Errors Accumulate
@@ -29555,7 +29577,7 @@ 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
-computations with a particular precision and effective rounding rule,
+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.
@@ -29654,7 +29676,7 @@ Be wary of floating-point constants! When reading a floating-point
constant from program source code, @command{gawk} uses the default
precision (that of a C @code{double}), unless overridden by an assignment
to the special variable @code{PREC} on the command line, to store it
-internally as a MPFR number. Changing the precision using @code{PREC}
+internally as an MPFR number. Changing the precision using @code{PREC}
in the program text does @emph{not} change the precision of a constant.
If you need to represent a floating-point constant at a higher precision
@@ -29792,15 +29814,15 @@ the following computes
5<superscript>4<superscript>3<superscript>2</superscript></superscript></superscript>, @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 @{}
> @kbd{x = 5^4^3^2}
-> @kbd{print "# of digits =", length(x)}
+> @kbd{print "number of digits =", length(x)}
> @kbd{print substr(x, 1, 20), "...", substr(x, length(x) - 19, 20)}
> @kbd{@}'}
-@print{} # of digits = 183231
+@print{} number of digits = 183231
@print{} 62060698786608744707 ... 92256259918212890625
@end example
@@ -29984,7 +30006,7 @@ 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. The default for @command{awk} is to use double-precision
+values. Standard @command{awk} uses double precision
floating-point values.
@item
@@ -30103,7 +30125,7 @@ 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 sample extension. In addition, it documents
+them, and presents a small example extension. In addition, it documents
the sample extensions included in the @command{gawk} distribution,
and describes the @code{gawkextlib} project.
@ifclear FOR_PRINT
@@ -30119,10 +30141,14 @@ goals and design.
@node Plugin License
@section Extension Licensing
-Every dynamic extension should define the global symbol
-@code{plugin_is_GPL_compatible} to assert that it has been licensed under
-a GPL-compatible license. If this symbol does not exist, @command{gawk}
-emits a fatal error and exits when it tries to load your extension.
+Every dynamic extension must be distributed under a license that is
+compatible with the GNU GPL (@pxref{Copying}).
+
+In order for the extension to tell @command{gawk} that it is
+properly licensed, the extension must define the global symbol
+@code{plugin_is_GPL_compatible}. If this symbol does not exist,
+@command{gawk} emits a fatal error and exits when it tries to load
+your extension.
The declared type of the symbol should be @code{int}. It does not need
to be in any allocated section, though. The code merely asserts that
@@ -30137,7 +30163,7 @@ int plugin_is_GPL_compatible;
Communication between
@command{gawk} and an extension is two-way. First, when an extension
-is loaded, it is passed a pointer to a @code{struct} whose fields are
+is loaded, @command{gawk} passes it a pointer to a @code{struct} whose fields are
function pointers.
@ifnotdocbook
This is shown in @ref{figure-load-extension}.
@@ -30173,29 +30199,29 @@ This is shown in @inlineraw{docbook, <xref linkend="figure-load-extension"/>}.
The extension can call functions inside @command{gawk} through these
function pointers, at runtime, without needing (link-time) access
to @command{gawk}'s symbols. One of these function pointers is to a
-function for ``registering'' new built-in functions.
+function for ``registering'' new functions.
@ifnotdocbook
-This is shown in @ref{figure-load-new-function}.
+This is shown in @ref{figure-register-new-function}.
@end ifnotdocbook
@ifdocbook
-This is shown in @inlineraw{docbook, <xref linkend="figure-load-new-function"/>}.
+This is shown in @inlineraw{docbook, <xref linkend="figure-register-new-function"/>}.
@end ifdocbook
@ifnotdocbook
-@float Figure,figure-load-new-function
-@caption{Loading The New Function}
+@float Figure,figure-register-new-function
+@caption{Registering A New Function}
@ifinfo
-@center @image{api-figure2, , , Loading The New Function, txt}
+@center @image{api-figure2, , , Registering A New Function, txt}
@end ifinfo
@ifnotinfo
-@center @image{api-figure2, , , Loading The New Function}
+@center @image{api-figure2, , , Registering A New Function}
@end ifnotinfo
@end float
@end ifnotdocbook
@docbook
-<figure id="figure-load-new-function" float="0">
-<title>Loading The New Function</title>
+<figure id="figure-register-new-function" float="0">
+<title>Registering A New Function</title>
<mediaobject>
<imageobject role="web"><imagedata fileref="api-figure2.png" format="PNG"/></imageobject>
</mediaobject>
@@ -30245,8 +30271,8 @@ and understandable.
Although all of this sounds somewhat complicated, the result is that
extension code is quite straightforward to write and to read. You can
-see this in the sample extensions @file{filefuncs.c} (@pxref{Extension
-Example}) and also the @file{testext.c} code for testing the APIs.
+see this in the sample extension @file{filefuncs.c} (@pxref{Extension
+Example}) and also in the @file{testext.c} code for testing the APIs.
Some other bits and pieces:
@@ -30428,7 +30454,7 @@ and also how characters are likely to be input and output from files.
@item
When retrieving a value (such as a parameter or that of a global variable
or array element), the extension requests a specific type (number, string,
-scalars, value cookie, array, or ``undefined''). When the request is
+scalar, value cookie, array, or ``undefined''). When the request is
``undefined,'' the returned value will have the real underlying type.
However, if the request and actual type don't match, the access function
@@ -30587,7 +30613,7 @@ 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.
Given a scalar cookie, @command{gawk} can directly retrieve or
-modify the value, as required, without having to first find it.
+modify the value, as required, without having to find it first.
The @code{awk_value_cookie_t} type and @code{value_cookie} macro are similar.
If you know that you wish to