diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-02-14 23:05:22 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-02-14 23:05:22 +0200 |
commit | d259a3a82a64490a7e307c8f6c6f2f9fdffb4538 (patch) | |
tree | 263ec97c9adbb8a9029c540878e92864612446c5 | |
parent | d18edce5957afdc3a286cf4ce1ca141a3cdc7be5 (diff) | |
parent | 7224d3f6b8db04439e8fdf8025b99db321a3f5ea (diff) | |
download | egawk-d259a3a82a64490a7e307c8f6c6f2f9fdffb4538.tar.gz egawk-d259a3a82a64490a7e307c8f6c6f2f9fdffb4538.tar.bz2 egawk-d259a3a82a64490a7e307c8f6c6f2f9fdffb4538.zip |
Merge branch 'gawk-4.1-stable'
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | doc/ChangeLog | 8 | ||||
-rw-r--r-- | doc/gawk.info | 1353 | ||||
-rw-r--r-- | doc/gawk.texi | 329 | ||||
-rw-r--r-- | doc/gawktexi.in | 321 | ||||
-rw-r--r-- | doc/texinfo.tex | 1090 |
8 files changed, 1750 insertions, 1364 deletions
@@ -1,3 +1,7 @@ +2016-02-14 Arnold D. Robbins <arnold@skeeve.com> + + * README, NEWS: Updated to reflect use of Texinfo 6.1. + 2016-02-05 Arnold D. Robbins <arnold@skeeve.com> Make optimization (constant folding and tail call recursion) @@ -77,7 +77,8 @@ Changes from 4.1.x to 4.2.0 Changes from 4.1.3 to 4.1.x --------------------------- -1. Updated to GNU autoconf 2.69, automake 1.15, gettext 0.19.5.1. +1. Updated to GNU autoconf 2.69, automake 1.15, gettext 0.19.5.1, + texinfo 6.1. 2. z/OS support updated. @@ -7,7 +7,7 @@ README: -This is GNU Awk 4.1.2. It is upwardly compatible with Brian Kernighan's +This is GNU Awk 4.1.3. It is upwardly compatible with Brian Kernighan's version of Unix awk. It is almost completely compliant with the 2008 POSIX 1003.1 standard for awk. (See the note below about POSIX.) @@ -21,8 +21,10 @@ Changes in this version are summarized in the NEWS file. Read the file POSIX.STD for a discussion of issues where the standard says one thing but gawk does something different. -To format the documentation with TeX, use at least version 2014-03-18.17 +To format the documentation with TeX, use at least version 2016-02-05.07 of texinfo.tex. There is a usable copy of texinfo.tex in the doc directory. +You should also use at least version 6.1 of texindex and of makeinfo +from the texinfo-6.1 distribution. INSTALLATION: diff --git a/doc/ChangeLog b/doc/ChangeLog index 221bf40b..035486f6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,11 @@ +2016-02-14 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in: Revise for use with Texinfo 6.1. + Remove ` @c' at the end of inline docbook constructs. + Remove special @DB*REF macros, not needed anymore. + Use @sup for superscripts where possible. + * texinfo.tex: Updated. + 2016-02-05 Arnold D. Robbins <arnold@skeeve.com> * gawk.texi: Document that optimization in now the default, diff --git a/doc/gawk.info b/doc/gawk.info index 16c76d2e..2eb590d0 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -1,4 +1,4 @@ -This is gawk.info, produced by makeinfo version 6.0dev from gawk.texi. +This is gawk.info, produced by makeinfo version 6.1 from gawk.texi. Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2015 Free Software Foundation, Inc. @@ -944,8 +944,8 @@ the 'gawk' distribution). His code finally became part of the main 'awk'-level debugger. This version became available as 'gawk' version 4.0 in 2011. - *Note Contributors::, for a full list of those who have made -important contributions to 'gawk'. + *Note Contributors:: for a full list of those who have made important +contributions to 'gawk'. File: gawk.info, Node: Names, Next: This Manual, Prev: History, Up: Preface @@ -1159,7 +1159,7 @@ by first pressing and holding the 'CONTROL' key, next pressing the 'd' key, and finally releasing both keys. For the sake of brevity, throughout this Info file, we refer to Brian -Kernighan's version of 'awk' as "BWK 'awk'." (*Note Other Versions::, +Kernighan's version of 'awk' as "BWK 'awk'." (*Note Other Versions:: for information on his and other versions.) Dark Corners @@ -1238,7 +1238,7 @@ the major new additions are *note Arbitrary Precision Arithmetic::, and *note Dynamic Extensions::. This Info file will undoubtedly continue to evolve. If you find an -error in the Info file, please report it! *Note Bugs::, for information +error in the Info file, please report it! *Note Bugs:: for information on submitting problem reports electronically. ---------- Footnotes ---------- @@ -1345,7 +1345,7 @@ has been and continues to be a pleasure working with this team of fine people. Notable code and documentation contributions were made by a number of -people. *Note Contributors::, for the full list. +people. *Note Contributors:: for the full list. Thanks to Michael Brennan for the Forewords. @@ -1765,7 +1765,7 @@ the quoting rules: quotes. The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is _impossible_ to embed a single quote inside single-quoted text. Refer back to *note - Comments::, for an example of what happens if you try. + Comments:: for an example of what happens if you try. * Double quotes protect most things between the opening and closing quotes. The shell does at least variable and command substitution @@ -2064,7 +2064,7 @@ then several actions execute in the order in which they appear in the 'awk' program. If no patterns match, then no actions run. After processing all the rules that match the line (and perhaps there -are none), 'awk' reads the next line. (However, *note Next Statement::, +are none), 'awk' reads the next line. (However, *note Next Statement:: and also *note Nextfile Statement::.) This continues until the program reaches the end of the file. For example, the following 'awk' program contains two rules: @@ -2284,7 +2284,7 @@ determining the type of a variable, and array sorting. As we develop our presentation of the 'awk' language, we will introduce most of the variables and many of the functions. They are -described systematically in *note Built-in Variables::, and in *note +described systematically in *note Built-in Variables:: and in *note Built-in::. @@ -2666,9 +2666,9 @@ The following list describes options mandated by the POSIX standard: '--posix' Operate in strict POSIX mode. This disables all 'gawk' extensions (just like '--traditional') and disables all extensions not allowed - by POSIX. *Note Common Extensions::, for a summary of the - extensions in 'gawk' that are disabled by this option. Also, the - following additional restrictions apply: + by POSIX. *Note Common Extensions:: for a summary of the extensions + in 'gawk' that are disabled by this option. Also, the following + additional restrictions apply: * Newlines are not allowed after '?' or ':' (*note Conditional Exp::). @@ -3486,7 +3486,7 @@ with a backslash have special meaning in regexps. *Note GNU Regexp Operators::. In a regexp, a backslash before any character that is not in the -previous list and not listed in *note GNU Regexp Operators::, means that +previous list and not listed in *note GNU Regexp Operators:: means that the next character should be taken literally, even if it would normally be a regexp operator. For example, '/a\+b/' matches the three characters 'a+b'. @@ -3548,7 +3548,7 @@ You can combine regular expressions with special characters, called "regular expression operators" or "metacharacters", to increase the power and versatility of regular expressions. - The escape sequences described in *note Escape Sequences::, are valid + The escape sequences described in *note Escape Sequences:: are valid inside a regexp. They are introduced by a '\' and are recognized and converted into corresponding real characters as the very first step in processing regexps. @@ -3728,7 +3728,7 @@ those listed between the opening and closing square brackets. characters separated by a hyphen. It matches any single character that sorts between the two characters, based upon the system's native character set. For example, '[0-9]' is equivalent to '[0123456789]'. -(See *note Ranges and Locales::, for an explanation of how the POSIX +(See *note Ranges and Locales:: for an explanation of how the POSIX standard and 'gawk' have changed over time. This is mainly of historical interest.) @@ -4390,7 +4390,7 @@ record, even if the last character in the file is not the character in The empty string '""' (a string without any characters) has a special meaning as the value of 'RS'. It means that records are separated by -one or more blank lines and nothing else. *Note Multiple Line::, for +one or more blank lines and nothing else. *Note Multiple Line:: for more details. If you change the value of 'RS' in the middle of an 'awk' run, the @@ -4440,7 +4440,7 @@ trailing whitespace: The square brackets delineate the contents of 'RT', letting you see the leading and trailing whitespace. The final value of 'RT' is a newline. -*Note Simple Sed::, for a more useful example of 'RS' as a regexp and +*Note Simple Sed:: for a more useful example of 'RS' as a regexp and 'RT'. If you set 'RS' to a regular expression that allows optional trailing @@ -4493,9 +4493,9 @@ as a record separator. However, this is a special case: 'mawk' does not allow embedded NUL characters in strings. (This may change in a future version of 'mawk'.) - *Note Readfile Function::, for an interesting way to read whole -files. If you are using 'gawk', see *note Extension Sample Readfile::, -for another option. + *Note Readfile Function:: for an interesting way to read whole files. +If you are using 'gawk', see *note Extension Sample Readfile:: for +another option. ---------- Footnotes ---------- @@ -4694,8 +4694,8 @@ out-of-range field only produces an empty string. For example: print "everything is normal" should print 'everything is normal', because 'NF+1' is certain to be out -of range. (*Note If Statement::, for more information about 'awk''s -'if-else' statements. *Note Typing and Comparison::, for more +of range. (*Note If Statement:: for more information about 'awk''s +'if-else' statements. *Note Typing and Comparison:: for more information about the '!=' operator.) It is important to note that making an assignment to an existing @@ -5233,7 +5233,7 @@ value is '"FS"' if regular field splitting is being used, or This information is useful when writing a function that needs to temporarily change 'FS' or 'FIELDWIDTHS', read some records, and then -restore the original settings (*note Passwd Functions::, for an example +restore the original settings (*note Passwd Functions:: for an example of such a function). @@ -5447,7 +5447,7 @@ A simple program to process this file is as follows: -| ... - *Note Labels Program::, for a more realistic program dealing with + *Note Labels Program:: for a more realistic program dealing with address lists. The following list summarizes how records are split, based on the value of 'RS'. ('==' means "is equal to.") @@ -5511,7 +5511,7 @@ the error that occurred. If 'ERRNO' indicates that the I/O operation may be retried, and 'PROCINFO["INPUT", "RETRY"]' is set, then 'getline' returns -2 instead of -1, and further calls to 'getline' may be attemped. *Note Retrying -Input::, for further information about this feature. +Input:: for further information about this feature. In the following examples, COMMAND stands for a string value that represents a shell command. @@ -5706,7 +5706,7 @@ included twice. *Note Close Files And Pipes::. One deficiency of this program is that it does not process nested '@include' statements (i.e., '@include' statements in included files) -the way a true macro preprocessor would. *Note Igawk Program::, for a +the way a true macro preprocessor would. *Note Igawk Program:: for a program that does handle nested '@include' statements. ---------- Footnotes ---------- @@ -6028,7 +6028,7 @@ per-command or per-connection basis. attempt to read from the underlying device may succeed in a later attempt. This is a limitation, and it also means that you cannot use this to multiplex input from two or more sources. *Note Retrying -Input::, for a way to enable later I/O attempts to succeed. +Input:: for a way to enable later I/O attempts to succeed. Assigning a timeout value prevents read operations from blocking indefinitely. But bear in mind that there are other ways 'gawk' can @@ -6088,7 +6088,7 @@ wildcards with your 'awk' program: 'gawk' reverts to treating a directory on the command line as a fatal error. - *Note Extension Sample Readdir::, for a way to treat directories as + *Note Extension Sample Readdir:: for a way to treat directories as usable data from an 'awk' program. @@ -6193,7 +6193,7 @@ and the 'printf' statement for fancier formatting. The 'print' statement is not limited when computing _which_ values to print. However, with two exceptions, you cannot specify _how_ to print them--how many columns, whether to use exponential notation or not, and -so on. (For the exceptions, *note Output Separators::, and *note +so on. (For the exceptions, *note Output Separators:: and *note OFMT::.) For printing with specifications, you need the 'printf' statement (*note Printf::). @@ -6898,7 +6898,7 @@ work identically for 'printf': The 'close()' function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to - it. *Note Close Files And Pipes::, for more information. + it. *Note Close Files And Pipes:: for more information. This example also illustrates the use of a variable to represent a FILE or COMMAND--it is not necessary to always use a string @@ -6961,7 +6961,7 @@ uppercase characters converted to lowercase (*note String Functions::). The program builds up a list of command lines, using the 'mv' utility to rename the files. It then sends the list to the shell for execution. - *Note Shell Quoting::, for a function that can help in generating + *Note Shell Quoting:: for a function that can help in generating command lines to be fed to the shell. @@ -7550,7 +7550,7 @@ option; *note Nondecimal Data::.) If you have octal or hexadecimal data, you can use the 'strtonum()' function (*note String Functions::) to convert the data into a number. Most of the time, you will want to use octal or hexadecimal constants when working with the built-in -bit-manipulation functions; see *note Bitwise Functions::, for more +bit-manipulation functions; see *note Bitwise Functions:: for more information. Unlike in some early C implementations, '8' and '9' are not valid in @@ -7709,7 +7709,7 @@ parameters (*note String Functions::). A few variables have special built-in meanings, such as 'FS' (the field separator) and 'NF' (the number of fields in the current input -record). *Note Built-in Variables::, for a list of the predefined +record). *Note Built-in Variables:: for a list of the predefined variables. These predefined variables can be used and assigned just like all other variables, but their values are also used or changed automatically by 'awk'. All predefined variables' names are entirely @@ -7742,7 +7742,7 @@ option, as in the following: the variable is set at the very beginning, even before the 'BEGIN' rules execute. The '-v' option and its assignment must precede all the file -name arguments, as well as the program text. (*Note Options::, for more +name arguments, as well as the program text. (*Note Options:: for more information about the '-v' option.) Otherwise, the variable assignment is performed at a time determined by its position among the input file arguments--after the processing of the preceding input file argument. @@ -7848,7 +7848,7 @@ use when printing numbers with 'print'. 'CONVFMT' was introduced in order to separate the semantics of conversion from the semantics of printing. Both 'CONVFMT' and 'OFMT' have the same default value: '"%.6g"'. In the vast majority of cases, old 'awk' programs do not -change their behavior. *Note Print::, for more information on the +change their behavior. *Note Print:: for more information on the 'print' statement. ---------- Footnotes ---------- @@ -8227,7 +8227,7 @@ expression. For example: The indices of 'bar' are practically guaranteed to be different, because 'rand()' returns different values each time it is called. (Arrays and the 'rand()' function haven't been covered yet. *Note Arrays::, and -*note Numeric Functions::, for more information.) This example +*note Numeric Functions:: for more information.) This example illustrates an important fact about assignment operators: the lefthand expression is only evaluated _once_. @@ -8824,9 +8824,9 @@ function 'sqrt()' computes the square root of a number. A fixed set of functions are "built in", which means they are available in every 'awk' program. The 'sqrt()' function is one of -these. *Note Built-in::, for a list of built-in functions and their +these. *Note Built-in:: for a list of built-in functions and their descriptions. In addition, you can define functions for use in your -program. *Note User-defined::, for instructions on how to do this. +program. *Note User-defined:: for instructions on how to do this. Finally, 'gawk' lets you write functions in C or C++ that may be called from your program (*note Dynamic Extensions::). @@ -8858,7 +8858,7 @@ of which to take the square root: Some of the built-in functions have one or more optional arguments. If those arguments are not supplied, the functions use a reasonable -default value. *Note Built-in::, for full details. If arguments are +default value. *Note Built-in:: for full details. If arguments are omitted in calls to user-defined functions, then those arguments are treated as local variables. Such local variables act like the empty string if referenced where a string value is required, and like zero if @@ -9393,7 +9393,7 @@ functions, because each library file can have its own 'BEGIN' and/or which library functions are named on the command line controls the order in which their 'BEGIN' and 'END' rules are executed. Therefore, you have to be careful when writing such rules in library files so that the -order in which they are executed doesn't matter. *Note Options::, for +order in which they are executed doesn't matter. *Note Options:: for more information on using library functions. *Note Library Functions::, for a number of useful library functions. @@ -9448,8 +9448,8 @@ explicitly. 'BEGIN' rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements are not valid in an 'END' rule, because all -the input has been read. (*Note Next Statement::, and *note Nextfile -Statement::,.) +the input has been read. (*Note Next Statement:: and *note Nextfile +Statement::.) File: gawk.info, Node: BEGINFILE/ENDFILE, Next: Empty, Prev: BEGIN/END, Up: Pattern Overview @@ -9875,7 +9875,7 @@ all the indices of an array: for (i in array) DO SOMETHING WITH array[i] -*Note Scanning an Array::, for more information on this version of the +*Note Scanning an Array:: for more information on this version of the 'for' loop. @@ -10186,15 +10186,15 @@ execute. In such a case, if you don't want the 'END' rule to do its job, set a variable to a nonzero value before the 'exit' statement and check that -variable in the 'END' rule. *Note Assert Function::, for an example -that does this. +variable in the 'END' rule. *Note Assert Function:: for an example that +does this. If an argument is supplied to 'exit', its value is used as the exit status code for the 'awk' process. If no argument is supplied, 'exit' causes 'awk' to return a "success" status. In the case where an argument is supplied to a first 'exit' statement, and then 'exit' is called a second time from an 'END' rule with no argument, 'awk' uses the -previously supplied exit value. (d.c.) *Note Exit Status::, for more +previously supplied exit value. (d.c.) *Note Exit Status:: for more information. For example, suppose an error condition occurs that is difficult or @@ -10282,13 +10282,13 @@ each variable.) A space-separated list of columns that tells 'gawk' how to split input with fixed columnar boundaries. Assigning a value to 'FIELDWIDTHS' overrides the use of 'FS' and 'FPAT' for field - splitting. *Note Constant Size::, for more information. + splitting. *Note Constant Size:: for more information. 'FPAT #' A regular expression (as a string) that tells 'gawk' to create the fields based on text that matches the regular expression. Assigning a value to 'FPAT' overrides the use of 'FS' and - 'FIELDWIDTHS' for field splitting. *Note Splitting By Content::, + 'FIELDWIDTHS' for field splitting. *Note Splitting By Content:: for more information. 'FS' @@ -10441,8 +10441,8 @@ they are not special: The value of 'ARGV[0]' can vary from system to system. Also, you should note that the program text is _not_ included in 'ARGV', nor - are any of 'awk''s command-line options. *Note ARGC and ARGV::, - for information about how 'awk' uses these variables. (d.c.) + are any of 'awk''s command-line options. *Note ARGC and ARGV:: for + information about how 'awk' uses these variables. (d.c.) 'ARGIND #' The index in 'ARGV' of the current file being processed. Every @@ -10485,7 +10485,7 @@ they are not special: Some operating systems may not have environment variables. On such systems, the 'ENVIRON' array is empty (except for 'ENVIRON["AWKPATH"]' and 'ENVIRON["AWKLIBPATH"]'; *note AWKPATH - Variable::, and *note AWKLIBPATH Variable::). + Variable:: and *note AWKLIBPATH Variable::). 'ERRNO #' If a system error occurs during a redirection for 'getline', during @@ -10660,20 +10660,20 @@ they are not special: 'PROCINFO["NONFATAL"]' If this element exists, then I/O errors for all output - redirections become nonfatal. *Note Nonfatal::,. + redirections become nonfatal. *Note Nonfatal::. 'PROCINFO["OUTPUT_NAME", "NONFATAL"]' Make output errors for OUTPUT_NAME be nonfatal. *Note - Nonfatal::,. + Nonfatal::. 'PROCINFO["COMMAND", "pty"]' For two-way communication to COMMAND, use a pseudo-tty instead - of setting up a two-way pipe. *Note Two-way I/O::, for more + of setting up a two-way pipe. *Note Two-way I/O:: for more information. 'PROCINFO["INPUT_NAME", "READ_TIMEOUT"]' Set a timeout for reading from input redirection INPUT_NAME. - *Note Read Timeout::, for more information. + *Note Read Timeout:: for more information. 'PROCINFO["sorted_in"]' If this element exists in 'PROCINFO', its value controls the @@ -10778,7 +10778,7 @@ File: gawk.info, Node: ARGC and ARGV, Prev: Auto-set, Up: Built-in Variables 7.5.3 Using 'ARGC' and 'ARGV' ----------------------------- -*note Auto-set::, presented the following program describing the +*note Auto-set:: presented the following program describing the information contained in 'ARGC' and 'ARGV': $ awk 'BEGIN { @@ -10833,9 +10833,8 @@ string. Another option is to use the 'delete' statement to remove elements from 'ARGV' (*note Delete::). All of these actions are typically done in the 'BEGIN' rule, before -actual processing of the input begins. *Note Split Program::, and *note -Tee Program::, for examples of each way of removing elements from -'ARGV'. +actual processing of the input begins. *Note Split Program:: and *note +Tee Program:: for examples of each way of removing elements from 'ARGV'. To actually get options into an 'awk' program, end the 'awk' options with '--' and then supply the 'awk' program's options, in the following @@ -10872,14 +10871,14 @@ be: gawk -f myprog.awk -q -v file1 file2 ... Because '-q' is not a valid 'gawk' option, it and the following '-v' are -passed on to the 'awk' program. (*Note Getopt Function::, for an 'awk' +passed on to the 'awk' program. (*Note Getopt Function:: for an 'awk' library function that parses command-line options.) When designing your program, you should choose options that don't conflict with 'gawk''s, because it will process any options that it accepts before passing the rest of the command line on to your program. -Using '#!' with the '-E' option may help (*note Executable Scripts::, -and *note Options::,). +Using '#!' with the '-E' option may help (*note Executable Scripts:: and +*note Options::). File: gawk.info, Node: Pattern Action Summary, Prev: Built-in Variables, Up: Patterns and Actions @@ -11258,7 +11257,7 @@ least once) in the input, by storing a one into the array 'used' with the word as the index. The second rule scans the elements of 'used' to find all the distinct words that appear in the input. It prints each word that is more than 10 characters long and also prints the number of -such words. *Note String Functions::, for more information on the +such words. *Note String Functions:: for more information on the built-in function 'length()'. # Record a 1 for each word that is used at least once @@ -11278,7 +11277,7 @@ built-in function 'length()'. print num_long_words, "words longer than 10 characters" } -*Note Word Sorting::, for a more detailed example of this type. +*Note Word Sorting:: for a more detailed example of this type. The order in which elements of the array are accessed by this statement is determined by the internal arrangement of the array @@ -11883,7 +11882,7 @@ following code prints the elements of our main array 'a': } } -*Note Walking Arrays::, for a user-defined function that "walks" an +*Note Walking Arrays:: for a user-defined function that "walks" an arbitrarily dimensioned array of arrays. Recall that a reference to an uninitialized array element yields a @@ -12224,7 +12223,7 @@ Options::): HOW, as it requires understanding features that we have not discussed yet. Thus, the discussion here is a deliberate simplification. (We do provide all the details later on; see - *note Array Sorting Functions::, for the full story.) + *note Array Sorting Functions:: for the full story.) Both functions return the number of elements in the array SOURCE. For 'asort()', 'gawk' sorts the values of SOURCE and replaces the @@ -12392,7 +12391,7 @@ Options::): The REGEXP argument may be either a regexp constant ('/'...'/') or a string constant ('"'...'"'). In the latter case, the string is - treated as a regexp to be matched. *Note Computed Regexps::, for a + treated as a regexp to be matched. *Note Computed Regexps:: for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -12539,9 +12538,9 @@ Options::): Modern implementations of 'awk', including 'gawk', allow the third argument to be a regexp constant ('/'...'/') as well as a string. (d.c.) The POSIX standard allows this as well. *Note Computed - Regexps::, for a discussion of the difference between using a - string constant or a regexp constant, and the implications for - writing your program correctly. + Regexps:: for a discussion of the difference between using a string + constant or a regexp constant, and the implications for writing + your program correctly. Before splitting the string, 'split()' deletes any previously existing elements in the arrays ARRAY and SEPS. @@ -12591,7 +12590,7 @@ Options::): The REGEXP argument may be either a regexp constant ('/'...'/') or a string constant ('"'...'"'). In the latter case, the string is - treated as a regexp to be matched. *Note Computed Regexps::, for a + treated as a regexp to be matched. *Note Computed Regexps:: for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -12723,7 +12722,7 @@ Although this makes a certain amount of sense, it can be surprising. ---------- Footnotes ---------- (1) Unless you use the '--non-decimal-data' option, which isn't -recommended. *Note Nondecimal Data::, for more information. +recommended. *Note Nondecimal Data:: for more information. (2) Note that this means that the record will first be regenerated using the value of 'OFS' if any fields have been changed, and that the @@ -12892,7 +12891,7 @@ parameters are enclosed in square brackets ([ ]): Close the file FILENAME for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess - or pipe is closed. *Note Close Files And Pipes::, for more + or pipe is closed. *Note Close Files And Pipes:: for more information. When closing a coprocess, it is occasionally useful to first close @@ -14598,7 +14597,7 @@ File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Functi 10 A Library of 'awk' Functions ******************************* -*note User-defined::, describes how to write your own 'awk' functions. +*note User-defined:: describes how to write your own 'awk' functions. Writing functions is important, because it allows you to encapsulate algorithms and program tasks in a single place. It simplifies programming, making program development more manageable and making @@ -14625,7 +14624,7 @@ of the sample programs presented later in this Info file use these functions. The functions are presented here in a progression from simple to complex. - *note Extract Program::, presents a program that you can use to + *note Extract Program:: presents a program that you can use to extract the source code for these example library functions and programs from the Texinfo source for this Info file. (This has already been done as part of the 'gawk' distribution.) @@ -14742,7 +14741,7 @@ program, leading to bugs that are very difficult to track down: single associative array to hold the values needed by the library function(s), or "package." This significantly decreases the number of actual global names in use. For example, the functions described in -*note Passwd Functions::, might have used array elements +*note Passwd Functions:: might have used array elements 'PW_data["inited"]', 'PW_data["total"]', 'PW_data["count"]', and 'PW_data["awklib"]', instead of '_pw_inited', '_pw_awklib', '_pw_total', and '_pw_count'. @@ -15183,8 +15182,8 @@ File: gawk.info, Node: Getlocaltime Function, Next: Readfile Function, Prev: ------------------------------- The 'systime()' and 'strftime()' functions described in *note Time -Functions::, provide the minimum functionality necessary for dealing -with the time of day in human-readable form. Although 'strftime()' is +Functions:: provide the minimum functionality necessary for dealing with +the time of day in human-readable form. Although 'strftime()' is extensive, the control formats are not necessarily easy to remember or intuitively obvious when reading a program. @@ -15254,8 +15253,8 @@ current time formatted in the same way as the 'date' utility: The string indices are easier to use and read than the various formats required by 'strftime()'. The 'alarm' program presented in -*note Alarm Program::, uses this function. A more general design for -the 'getlocaltime()' function would have allowed the user to supply an +*note Alarm Program:: uses this function. A more general design for the +'getlocaltime()' function would have allowed the user to supply an optional timestamp value to use instead of the current time. @@ -15305,7 +15304,7 @@ reads the entire contents of the named file in one shot: never match if the file has contents. 'gawk' reads data from the file into 'tmp', attempting to match 'RS'. The match fails after each read, but fails quickly, such that 'gawk' fills 'tmp' with the entire contents -of the file. (*Note Records::, for information on 'RT' and 'RS'.) +of the file. (*Note Records:: for information on 'RT' and 'RS'.) In the case that 'file' is empty, the return value is the null string. Thus, calling code may use something like: @@ -15317,8 +15316,8 @@ string. Thus, calling code may use something like: This tests the result to see if it is empty or not. An equivalent test would be 'contents == ""'. - *Note Extension Sample Readfile::, for an extension function that -also reads an entire file into memory. + *Note Extension Sample Readfile:: for an extension function that also +reads an entire file into memory. File: gawk.info, Node: Shell Quoting, Prev: Readfile Function, Up: General Functions @@ -15469,7 +15468,7 @@ solves the problem: END { endfile(_filename_) } - *note Wc Program::, shows how this library function can be used and + *note Wc Program:: shows how this library function can be used and how it simplifies writing the main program. So Why Does 'gawk' Have 'BEGINFILE' and 'ENDFILE'? @@ -15943,7 +15942,7 @@ that it does not try to interpret the '-a', etc., as its own options. Using '#!' with the '-E' option may help avoid conflicts between your program's options and 'gawk''s options, as '-E' causes 'gawk' to abandon -processing of further options (*note Executable Scripts::, and *note +processing of further options (*note Executable Scripts:: and *note Options::). Several of the sample programs presented in *note Sample Programs::, @@ -15968,7 +15967,7 @@ are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This minor node presents a suite of functions for retrieving information from the user database. -*Note Group Functions::, for a similar suite that retrieves information +*Note Group Functions:: for a similar suite that retrieves information from the group database. The POSIX standard does not define the file where user information is @@ -16188,7 +16187,7 @@ once. If you are worried about squeezing every last cycle out of your this is not necessary, as most 'awk' programs are I/O-bound, and such a change would clutter up the code. - The 'id' program in *note Id Program::, uses these functions. + The 'id' program in *note Id Program:: uses these functions. ---------- Footnotes ---------- @@ -16201,7 +16200,7 @@ File: gawk.info, Node: Group Functions, Next: Walking Arrays, Prev: Passwd Fu 10.6 Reading the Group Database =============================== -Much of the discussion presented in *note Passwd Functions::, applies to +Much of the discussion presented in *note Passwd Functions:: applies to the group database as well. Although there has traditionally been a well-known file ('/etc/group') in a well-known format, the POSIX standard only provides a set of C library routines ('<grp.h>' and @@ -16423,7 +16422,7 @@ body of '_gr_init()' into a 'BEGIN' rule). associative arrays. The functions that the user calls are themselves very simple, relying on 'awk''s associative arrays to do work. - The 'id' program in *note Id Program::, uses these functions. + The 'id' program in *note Id Program:: uses these functions. ---------- Footnotes ---------- @@ -16437,10 +16436,10 @@ File: gawk.info, Node: Walking Arrays, Next: Library Functions Summary, Prev: 10.7 Traversing Arrays of Arrays ================================ -*note Arrays of Arrays::, described how 'gawk' provides arrays of -arrays. In particular, any element of an array may be either a scalar -or another array. The 'isarray()' function (*note Type Functions::) -lets you distinguish an array from a scalar. The following function, +*note Arrays of Arrays:: described how 'gawk' provides arrays of arrays. +In particular, any element of an array may be either a scalar or another +array. The 'isarray()' function (*note Type Functions::) lets you +distinguish an array from a scalar. The following function, 'walk_array()', recursively traverses an array, printing the element indices and values. You call it with the array and a string representing the name of the array: @@ -19178,7 +19177,7 @@ File: gawk.info, Node: Programs Summary, Next: Programs Exercises, Prev: Misc the separator can considerably simplify such tasks. * The examples here demonstrate the usefulness of the library - functions from *note Library Functions::, for a number of real (if + functions from *note Library Functions:: for a number of real (if small) programs. * Besides reinventing POSIX wheels, other programs solved a selection @@ -19407,7 +19406,7 @@ implementation of arrays inside 'awk'. in a particular order that you, the programmer, choose. 'gawk' lets you do this. - *note Controlling Scanning::, describes how you can assign special, + *note Controlling Scanning:: describes how you can assign special, predefined values to 'PROCINFO["sorted_in"]' in order to control the order in which 'gawk' traverses an array during a 'for' loop. @@ -19426,7 +19425,7 @@ arguments: Here, 'i1' and 'i2' are the indices, and 'v1' and 'v2' are the corresponding values of the two elements being compared. Either 'v1' or 'v2', or both, can be arrays if the array being traversed contains -subarrays as values. (*Note Arrays of Arrays::, for more information +subarrays as values. (*Note Arrays of Arrays:: for more information about subarrays.) The three possible return values are interpreted as follows: @@ -20572,7 +20571,7 @@ File: gawk.info, Node: Programmer i18n, Next: Translator i18n, Prev: Explaini ... } - *Note I18N Example::, for an example program showing the steps to + *Note I18N Example:: for an example program showing the steps to create and use translations from 'awk'. ---------- Footnotes ---------- @@ -20620,7 +20619,7 @@ included in the output are any constant strings that appear as the first argument to 'dcgettext()' or as the first and second argument to 'dcngettext()'.(1) You should distribute the generated '.pot' file with your 'awk' program; translators will eventually use it to provide you -translations that you can also then distribute. *Note I18N Example::, +translations that you can also then distribute. *Note I18N Example:: for the full list of steps to go through to create and test translations for 'guide'. @@ -22305,7 +22304,7 @@ results to any desired precision level supported by MPFR. Two predefined 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 -Setting precision::, and *note Setting the rounding mode::, for more +Setting precision:: and *note Setting the rounding mode:: for more information. @@ -23165,7 +23164,7 @@ Example::) and also in the 'testext.c' code for testing the APIs. extension can check if the 'gawk' it is loaded with supports the facilities it was compiled with. (Version mismatches "shouldn't" happen, but we all know how _that_ goes.) *Note Extension - Versioning::, for details. + Versioning:: for details. File: gawk.info, Node: Extension API Description, Next: Finding Extensions, Prev: Extension Mechanism Outline, Up: Dynamic Extensions @@ -24187,7 +24186,7 @@ your extension function. They are: Convert a parameter that was undefined into an array; this provides call by reference for arrays. Return false if 'count' is too big, or if the argument's type is not undefined. *Note Array - Manipulation::, for more information on creating arrays. + Manipulation:: for more information on creating arrays. File: gawk.info, Node: Symbol Table Access, Next: Array Manipulation, Prev: Accessing Parameters, Up: Extension API Description @@ -24604,7 +24603,7 @@ The following functions relate to individual array elements: 'awk_array_t create_array(void);' Create a new array to which elements may be added. *Note Creating - Arrays::, for a discussion of how to create a new array and add + Arrays:: for a discussion of how to create a new array and add elements to it. 'awk_bool_t clear_array(awk_array_t a_cookie);' @@ -24936,7 +24935,7 @@ array: -| new_array["hello"] = world -| new_array["answer"] = 42 -(*Note Finding Extensions::, for more information on the 'AWKLIBPATH' +(*Note Finding Extensions:: for more information on the 'AWKLIBPATH' environment variable.) @@ -25220,7 +25219,7 @@ Compiled extensions have to be installed in a directory where 'gawk' can find them. If 'gawk' is configured and built in the default fashion, the directory in which to find extensions is '/usr/local/lib/gawk'. You can also specify a search path with a list of directories to search for -compiled extensions. *Note AWKLIBPATH Variable::, for more information. +compiled extensions. *Note AWKLIBPATH Variable:: for more information. File: gawk.info, Node: Extension Example, Next: Extension Samples, Prev: Finding Extensions, Up: Dynamic Extensions @@ -25808,7 +25807,7 @@ directory and run the program: (1) In practice, you would probably want to use the GNU Autotools (Automake, Autoconf, Libtool, and 'gettext') to configure and build your libraries. Instructions for doing so are beyond the scope of this Info -file. *Note gawkextlib::, for Internet links to the tools. +file. *Note gawkextlib:: for Internet links to the tools. File: gawk.info, Node: Extension Samples, Next: gawkextlib, Prev: Extension Example, Up: Dynamic Extensions @@ -26782,7 +26781,7 @@ many years were finally added to POSIX. They are: * The ability to delete all of an array at once with 'delete ARRAY' (*note Delete::) - *Note Common Extensions::, for a list of common extensions not + *Note Common Extensions:: for a list of common extensions not permitted by the POSIX standard. The 2008 POSIX standard can be found online at @@ -26809,8 +26808,8 @@ in his version of 'awk': * The 'fflush()' built-in function for flushing buffered output (*note I/O Functions::) - *Note Common Extensions::, for a full list of the extensions -available in his 'awk'. + *Note Common Extensions:: for a full list of the extensions available +in his 'awk'. File: gawk.info, Node: POSIX/GNU, Next: Feature History, Prev: BTL, Up: Language History @@ -27717,7 +27716,7 @@ Appendix B Installing 'gawk' This appendix provides instructions for installing 'gawk' on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are contributed. -*Note Bugs::, for the email addresses of the people who maintain the +*Note Bugs:: for the email addresses of the people who maintain the respective ports. * Menu: @@ -27978,11 +27977,11 @@ Various '.c', '.y', and '.h' files 'pc/*' Files needed for building 'gawk' under MS-Windows and OS/2 (*note - PC Installation::, for details). + PC Installation:: for details). 'vms/*' Files needed for building 'gawk' under Vax/VMS and OpenVMS (*note - VMS Installation::, for details). + VMS Installation:: for details). 'test/*' A test suite for 'gawk'. You can use 'make check' from the @@ -28181,7 +28180,7 @@ any constants that 'configure' defined and should not have. The Autoconf will not work on your system in some other fashion. If you do have a problem, the 'configure.ac' file is the input for Autoconf. You may be able to change this file and generate a new version of -'configure' that works on your system (*note Bugs::, for information on +'configure' that works on your system (*note Bugs:: for information on how to report problems in configuring 'gawk'). The same mechanism may be used to send in updates to 'configure.ac' and/or 'custom.h'. @@ -28552,8 +28551,8 @@ Compaq C V6.4, and under Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS 8.3. The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha and IA64 VMS 8.4 used HP C 7.3.(1) - *Note VMS GNV::, for information on building 'gawk' as a PCSI kit -that is compatible with the GNV product. + *Note VMS GNV:: for information on building 'gawk' as a PCSI kit that +is compatible with the GNV product. ---------- Footnotes ---------- @@ -28936,7 +28935,7 @@ Unix 'awk' This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely. - *Note Common Extensions::, for a list of extensions in this 'awk' + *Note Common Extensions:: for a list of extensions in this 'awk' that are not in POSIX 'awk'. As a side note, Dan Bornstein has created a Git repository tracking @@ -28960,7 +28959,7 @@ Unix 'awk' Once you have it, 'gunzip' may be used to decompress this file. Installation is similar to 'gawk''s (*note Unix Installation::). - *Note Common Extensions::, for a list of extensions in 'mawk' that + *Note Common Extensions:: for a list of extensions in 'mawk' that are not in POSIX 'awk'. 'awka' @@ -29153,7 +29152,7 @@ C.2.1 Accessing The 'gawk' Git Repository ----------------------------------------- As 'gawk' is Free Software, the source code is always available. *note -Gawk Distribution::, describes how to get and build the formal, released +Gawk Distribution:: describes how to get and build the formal, released versions of 'gawk'. However, if you want to modify 'gawk' and contribute back your @@ -33106,7 +33105,7 @@ Index * describe call stack frame, in debugger: Debugger Info. (line 27) * differences between gawk and awk: String Functions. (line 200) * differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV. - (line 90) + (line 89) * differences in awk and gawk, ARGIND variable: Auto-set. (line 44) * differences in awk and gawk, array elements, deleting: Delete. (line 39) @@ -35160,564 +35159,564 @@ Index Tag Table: -Node: Top1203 -Node: Foreword342509 -Node: Foreword446951 -Node: Preface48483 -Ref: Preface-Footnote-151355 -Ref: Preface-Footnote-251462 -Ref: Preface-Footnote-351696 -Node: History51838 -Node: Names54191 -Ref: Names-Footnote-155285 -Node: This Manual55432 -Ref: This Manual-Footnote-161914 -Node: Conventions62014 -Node: Manual History64369 -Ref: Manual History-Footnote-167365 -Ref: Manual History-Footnote-267406 -Node: How To Contribute67480 -Node: Acknowledgments68609 -Node: Getting Started73496 -Node: Running gawk75935 -Node: One-shot77125 -Node: Read Terminal78388 -Node: Long80420 -Node: Executable Scripts81933 -Ref: Executable Scripts-Footnote-184728 -Node: Comments84831 -Node: Quoting87315 -Node: DOS Quoting92833 -Node: Sample Data Files93508 -Node: Very Simple96103 -Node: Two Rules101005 -Node: More Complex102891 -Node: Statements/Lines105754 -Ref: Statements/Lines-Footnote-1110213 -Node: Other Features110478 -Node: When111415 -Ref: When-Footnote-1113169 -Node: Intro Summary113234 -Node: Invoking Gawk114118 -Node: Command Line115632 -Node: Options116430 -Ref: Options-Footnote-1132529 -Ref: Options-Footnote-2132759 -Node: Other Arguments132784 -Node: Naming Standard Input135731 -Node: Environment Variables136824 -Node: AWKPATH Variable137382 -Ref: AWKPATH Variable-Footnote-1140793 -Ref: AWKPATH Variable-Footnote-2140838 -Node: AWKLIBPATH Variable141099 -Node: Other Environment Variables142356 -Node: Exit Status145994 -Node: Include Files146671 -Node: Loading Shared Libraries150266 -Node: Obsolete151694 -Node: Undocumented152386 -Node: Invoking Summary152683 -Node: Regexp154343 -Node: Regexp Usage155862 -Node: Escape Sequences157899 -Node: Regexp Operators164132 -Ref: Regexp Operators-Footnote-1171549 -Ref: Regexp Operators-Footnote-2171696 -Node: Bracket Expressions171794 -Ref: table-char-classes173817 -Node: Leftmost Longest176954 -Node: Computed Regexps178257 -Node: GNU Regexp Operators181684 -Node: Case-sensitivity185363 -Ref: Case-sensitivity-Footnote-1188259 -Ref: Case-sensitivity-Footnote-2188494 -Node: Strong Regexp Constants188602 -Node: Regexp Summary191544 -Node: Reading Files193150 -Node: Records195313 -Node: awk split records196046 -Node: gawk split records200978 -Ref: gawk split records-Footnote-1205522 -Node: Fields205559 -Node: Nonconstant Fields208300 -Ref: Nonconstant Fields-Footnote-1210536 -Node: Changing Fields210740 -Node: Field Separators216670 -Node: Default Field Splitting219368 -Node: Regexp Field Splitting220486 -Node: Single Character Fields223839 -Node: Command Line Field Separator224899 -Node: Full Line Fields228117 -Ref: Full Line Fields-Footnote-1229639 -Ref: Full Line Fields-Footnote-2229685 -Node: Field Splitting Summary229786 -Node: Constant Size231860 -Node: Splitting By Content236439 -Ref: Splitting By Content-Footnote-1240410 -Node: Multiple Line240573 -Ref: Multiple Line-Footnote-1246456 -Node: Getline246635 -Node: Plain Getline249102 -Node: Getline/Variable251741 -Node: Getline/File252890 -Node: Getline/Variable/File254276 -Ref: Getline/Variable/File-Footnote-1255880 -Node: Getline/Pipe255968 -Node: Getline/Variable/Pipe258673 -Node: Getline/Coprocess259806 -Node: Getline/Variable/Coprocess261071 -Node: Getline Notes261811 -Node: Getline Summary264606 -Ref: table-getline-variants265028 -Node: Read Timeout265776 -Ref: Read Timeout-Footnote-1269683 -Node: Retrying Input269741 -Node: Command-line directories270940 -Node: Input Summary271847 -Node: Input Exercises275019 -Node: Printing275747 -Node: Print277582 -Node: Print Examples279039 -Node: Output Separators281819 -Node: OFMT283836 -Node: Printf285192 -Node: Basic Printf285977 -Node: Control Letters287551 -Node: Format Modifiers291539 -Node: Printf Examples297554 -Node: Redirection300040 -Node: Special FD306883 -Ref: Special FD-Footnote-1310051 -Node: Special Files310125 -Node: Other Inherited Files310742 -Node: Special Network311743 -Node: Special Caveats312603 -Node: Close Files And Pipes313552 -Ref: Close Files And Pipes-Footnote-1320739 -Ref: Close Files And Pipes-Footnote-2320887 -Node: Nonfatal321038 -Node: Output Summary323363 -Node: Output Exercises324585 -Node: Expressions325264 -Node: Values326452 -Node: Constants327130 -Node: Scalar Constants327821 -Ref: Scalar Constants-Footnote-1328685 -Node: Nondecimal-numbers328935 -Node: Regexp Constants331949 -Node: Using Constant Regexps332475 -Node: Variables335638 -Node: Using Variables336295 -Node: Assignment Options338206 -Node: Conversion340080 -Node: Strings And Numbers340604 -Ref: Strings And Numbers-Footnote-1343668 -Node: Locale influences conversions343777 -Ref: table-locale-affects346535 -Node: All Operators347153 -Node: Arithmetic Ops347782 -Node: Concatenation350288 -Ref: Concatenation-Footnote-1353135 -Node: Assignment Ops353242 -Ref: table-assign-ops358234 -Node: Increment Ops359547 -Node: Truth Values and Conditions363007 -Node: Truth Values364081 -Node: Typing and Comparison365129 -Node: Variable Typing365949 -Node: Comparison Operators369573 -Ref: table-relational-ops369992 -Node: POSIX String Comparison373487 -Ref: POSIX String Comparison-Footnote-1374561 -Node: Boolean Ops374700 -Ref: Boolean Ops-Footnote-1379182 -Node: Conditional Exp379274 -Node: Function Calls381010 -Node: Precedence384890 -Node: Locales388549 -Node: Expressions Summary390181 -Node: Patterns and Actions392754 -Node: Pattern Overview393874 -Node: Regexp Patterns395551 -Node: Expression Patterns396093 -Node: Ranges399874 -Node: BEGIN/END402982 -Node: Using BEGIN/END403743 -Ref: Using BEGIN/END-Footnote-1406480 -Node: I/O And BEGIN/END406586 -Node: BEGINFILE/ENDFILE408902 -Node: Empty411809 -Node: Using Shell Variables412126 -Node: Action Overview414400 -Node: Statements416725 -Node: If Statement418573 -Node: While Statement420068 -Node: Do Statement422096 -Node: For Statement423244 -Node: Switch Statement426403 -Node: Break Statement428789 -Node: Continue Statement430881 -Node: Next Statement432708 -Node: Nextfile Statement435091 -Node: Exit Statement437743 -Node: Built-in Variables440148 -Node: User-modified441281 -Node: Auto-set448869 -Ref: Auto-set-Footnote-1463262 -Ref: Auto-set-Footnote-2463468 -Node: ARGC and ARGV463524 -Node: Pattern Action Summary467743 -Node: Arrays470173 -Node: Array Basics471502 -Node: Array Intro472346 -Ref: figure-array-elements474321 -Ref: Array Intro-Footnote-1477025 -Node: Reference to Elements477153 -Node: Assigning Elements479617 -Node: Array Example480108 -Node: Scanning an Array481867 -Node: Controlling Scanning484891 -Ref: Controlling Scanning-Footnote-1490290 -Node: Numeric Array Subscripts490606 -Node: Uninitialized Subscripts492790 -Node: Delete494409 -Ref: Delete-Footnote-1497161 -Node: Multidimensional497218 -Node: Multiscanning500313 -Node: Arrays of Arrays501904 -Node: Arrays Summary506672 -Node: Functions508765 -Node: Built-in509803 -Node: Calling Built-in510881 -Node: Numeric Functions512877 -Ref: Numeric Functions-Footnote-1517710 -Ref: Numeric Functions-Footnote-2518067 -Ref: Numeric Functions-Footnote-3518115 -Node: String Functions518387 -Ref: String Functions-Footnote-1541895 -Ref: String Functions-Footnote-2542024 -Ref: String Functions-Footnote-3542272 -Node: Gory Details542359 -Ref: table-sub-escapes544150 -Ref: table-sub-proposed545669 -Ref: table-posix-sub547032 -Ref: table-gensub-escapes548573 -Ref: Gory Details-Footnote-1549396 -Node: I/O Functions549547 -Ref: I/O Functions-Footnote-1556768 -Node: Time Functions556916 -Ref: Time Functions-Footnote-1567421 -Ref: Time Functions-Footnote-2567489 -Ref: Time Functions-Footnote-3567647 -Ref: Time Functions-Footnote-4567758 -Ref: Time Functions-Footnote-5567870 -Ref: Time Functions-Footnote-6568097 -Node: Bitwise Functions568363 -Ref: table-bitwise-ops568957 -Ref: Bitwise Functions-Footnote-1573295 -Node: Type Functions573468 -Node: I18N Functions576129 -Node: User-defined577780 -Node: Definition Syntax578585 -Ref: Definition Syntax-Footnote-1584272 -Node: Function Example584343 -Ref: Function Example-Footnote-1587265 -Node: Function Caveats587287 -Node: Calling A Function587805 -Node: Variable Scope588763 -Node: Pass By Value/Reference591757 -Node: Return Statement595256 -Node: Dynamic Typing598235 -Node: Indirect Calls599165 -Ref: Indirect Calls-Footnote-1609416 -Node: Functions Summary609544 -Node: Library Functions612249 -Ref: Library Functions-Footnote-1615858 -Ref: Library Functions-Footnote-2616001 -Node: Library Names616172 -Ref: Library Names-Footnote-1619633 -Ref: Library Names-Footnote-2619856 -Node: General Functions619942 -Node: Strtonum Function621045 -Node: Assert Function624067 -Node: Round Function627393 -Node: Cliff Random Function628934 -Node: Ordinal Functions629950 -Ref: Ordinal Functions-Footnote-1633013 -Ref: Ordinal Functions-Footnote-2633265 -Node: Join Function633475 -Ref: Join Function-Footnote-1635245 -Node: Getlocaltime Function635445 -Node: Readfile Function639189 -Node: Shell Quoting641163 -Node: Data File Management642564 -Node: Filetrans Function643196 -Node: Rewind Function647293 -Node: File Checking648679 -Ref: File Checking-Footnote-1650013 -Node: Empty Files650214 -Node: Ignoring Assigns652193 -Node: Getopt Function653743 -Ref: Getopt Function-Footnote-1665213 -Node: Passwd Functions665413 -Ref: Passwd Functions-Footnote-1674254 -Node: Group Functions674342 -Ref: Group Functions-Footnote-1682241 -Node: Walking Arrays682448 -Node: Library Functions Summary685458 -Node: Library Exercises686864 -Node: Sample Programs687329 -Node: Running Examples688099 -Node: Clones688827 -Node: Cut Program690051 -Node: Egrep Program699772 -Ref: Egrep Program-Footnote-1707284 -Node: Id Program707394 -Node: Split Program711074 -Ref: Split Program-Footnote-1714533 -Node: Tee Program714662 -Node: Uniq Program717452 -Node: Wc Program724878 -Ref: Wc Program-Footnote-1729133 -Node: Miscellaneous Programs729227 -Node: Dupword Program730440 -Node: Alarm Program732470 -Node: Translate Program737325 -Ref: Translate Program-Footnote-1741890 -Node: Labels Program742160 -Ref: Labels Program-Footnote-1745511 -Node: Word Sorting745595 -Node: History Sorting749667 -Node: Extract Program751502 -Node: Simple Sed759031 -Node: Igawk Program762105 -Ref: Igawk Program-Footnote-1776436 -Ref: Igawk Program-Footnote-2776638 -Ref: Igawk Program-Footnote-3776760 -Node: Anagram Program776875 -Node: Signature Program779937 -Node: Programs Summary781184 -Node: Programs Exercises782399 -Ref: Programs Exercises-Footnote-1786528 -Node: Advanced Features786619 -Node: Nondecimal Data788609 -Node: Array Sorting790200 -Node: Controlling Array Traversal790900 -Ref: Controlling Array Traversal-Footnote-1799269 -Node: Array Sorting Functions799387 -Ref: Array Sorting Functions-Footnote-1804478 -Node: Two-way I/O804674 -Ref: Two-way I/O-Footnote-1810494 -Ref: Two-way I/O-Footnote-2810681 -Node: TCP/IP Networking810763 -Node: Profiling813881 -Node: Advanced Features Summary822335 -Node: Internationalization824179 -Node: I18N and L10N825659 -Node: Explaining gettext826346 -Ref: Explaining gettext-Footnote-1831369 -Ref: Explaining gettext-Footnote-2831554 -Node: Programmer i18n831719 -Ref: Programmer i18n-Footnote-1836575 -Node: Translator i18n836624 -Node: String Extraction837418 -Ref: String Extraction-Footnote-1838551 -Node: Printf Ordering838637 -Ref: Printf Ordering-Footnote-1841423 -Node: I18N Portability841487 -Ref: I18N Portability-Footnote-1843943 -Node: I18N Example844006 -Ref: I18N Example-Footnote-1846812 -Node: Gawk I18N846885 -Node: I18N Summary847530 -Node: Debugger848871 -Node: Debugging849893 -Node: Debugging Concepts850334 -Node: Debugging Terms852143 -Node: Awk Debugging854718 -Node: Sample Debugging Session855624 -Node: Debugger Invocation856158 -Node: Finding The Bug857544 -Node: List of Debugger Commands864022 -Node: Breakpoint Control865355 -Node: Debugger Execution Control869049 -Node: Viewing And Changing Data872411 -Node: Execution Stack875785 -Node: Debugger Info877422 -Node: Miscellaneous Debugger Commands881493 -Node: Readline Support886581 -Node: Limitations887477 -Ref: Limitations-Footnote-1891708 -Node: Debugging Summary891759 -Node: Arbitrary Precision Arithmetic893038 -Node: Computer Arithmetic894454 -Ref: table-numeric-ranges898045 -Ref: Computer Arithmetic-Footnote-1898767 -Node: Math Definitions898824 -Ref: table-ieee-formats902138 -Ref: Math Definitions-Footnote-1902741 -Node: MPFR features902846 -Node: FP Math Caution904565 -Ref: FP Math Caution-Footnote-1905637 -Node: Inexactness of computations906006 -Node: Inexact representation906966 -Node: Comparing FP Values908326 -Node: Errors accumulate909408 -Node: Getting Accuracy910841 -Node: Try To Round913551 -Node: Setting precision914450 -Ref: table-predefined-precision-strings915147 -Node: Setting the rounding mode916977 -Ref: table-gawk-rounding-modes917351 -Ref: Setting the rounding mode-Footnote-1920759 -Node: Arbitrary Precision Integers920938 -Ref: Arbitrary Precision Integers-Footnote-1925855 -Node: POSIX Floating Point Problems926004 -Ref: POSIX Floating Point Problems-Footnote-1929886 -Node: Floating point summary929924 -Node: Dynamic Extensions932114 -Node: Extension Intro933667 -Node: Plugin License934933 -Node: Extension Mechanism Outline935730 -Ref: figure-load-extension936169 -Ref: figure-register-new-function937734 -Ref: figure-call-new-function938826 -Node: Extension API Description940889 -Node: Extension API Functions Introduction942421 -Node: General Data Types947280 -Ref: General Data Types-Footnote-1953235 -Node: Memory Allocation Functions953534 -Ref: Memory Allocation Functions-Footnote-1956379 -Node: Constructor Functions956478 -Node: Registration Functions958223 -Node: Extension Functions958908 -Node: Exit Callback Functions961207 -Node: Extension Version String962457 -Node: Input Parsers963120 -Node: Output Wrappers973005 -Node: Two-way processors977517 -Node: Printing Messages979781 -Ref: Printing Messages-Footnote-1980855 -Node: Updating ERRNO981008 -Node: Requesting Values981747 -Ref: table-value-types-returned982484 -Node: Accessing Parameters983367 -Node: Symbol Table Access984603 -Node: Symbol table by name985115 -Node: Symbol table by cookie987136 -Ref: Symbol table by cookie-Footnote-1991285 -Node: Cached values991349 -Ref: Cached values-Footnote-1994850 -Node: Array Manipulation994941 -Ref: Array Manipulation-Footnote-1996032 -Node: Array Data Types996069 -Ref: Array Data Types-Footnote-1998727 -Node: Array Functions998819 -Node: Flattening Arrays1002678 -Node: Creating Arrays1009586 -Node: Redirection API1014358 -Node: Extension API Variables1017189 -Node: Extension Versioning1017822 -Node: Extension API Informational Variables1019713 -Node: Extension API Boilerplate1020777 -Node: Finding Extensions1024591 -Node: Extension Example1025151 -Node: Internal File Description1025949 -Node: Internal File Ops1030029 -Ref: Internal File Ops-Footnote-11041791 -Node: Using Internal File Ops1041931 -Ref: Using Internal File Ops-Footnote-11044314 -Node: Extension Samples1044589 -Node: Extension Sample File Functions1046118 -Node: Extension Sample Fnmatch1053767 -Node: Extension Sample Fork1055254 -Node: Extension Sample Inplace1056472 -Node: Extension Sample Ord1059682 -Node: Extension Sample Readdir1060518 -Ref: table-readdir-file-types1061407 -Node: Extension Sample Revout1062212 -Node: Extension Sample Rev2way1062801 -Node: Extension Sample Read write array1063541 -Node: Extension Sample Readfile1065483 -Node: Extension Sample Time1066578 -Node: Extension Sample API Tests1067926 -Node: gawkextlib1068418 -Node: Extension summary1070865 -Node: Extension Exercises1074557 -Node: Language History1076054 -Node: V7/SVR3.11077710 -Node: SVR41079862 -Node: POSIX1081296 -Node: BTL1082676 -Node: POSIX/GNU1083406 -Node: Feature History1089268 -Node: Common Extensions1103638 -Node: Ranges and Locales1104921 -Ref: Ranges and Locales-Footnote-11109537 -Ref: Ranges and Locales-Footnote-21109564 -Ref: Ranges and Locales-Footnote-31109799 -Node: Contributors1110020 -Node: History summary1115589 -Node: Installation1116969 -Node: Gawk Distribution1117914 -Node: Getting1118398 -Node: Extracting1119359 -Node: Distribution contents1120997 -Node: Unix Installation1127093 -Node: Quick Installation1127775 -Node: Shell Startup Files1130189 -Node: Additional Configuration Options1131267 -Node: Configuration Philosophy1133072 -Node: Non-Unix Installation1135442 -Node: PC Installation1135900 -Node: PC Binary Installation1137220 -Node: PC Compiling1139072 -Ref: PC Compiling-Footnote-11142096 -Node: PC Testing1142205 -Node: PC Using1143385 -Node: Cygwin1147499 -Node: MSYS1148269 -Node: VMS Installation1148770 -Node: VMS Compilation1149561 -Ref: VMS Compilation-Footnote-11150791 -Node: VMS Dynamic Extensions1150849 -Node: VMS Installation Details1152534 -Node: VMS Running1154787 -Node: VMS GNV1159066 -Node: VMS Old Gawk1159801 -Node: Bugs1160272 -Node: Other Versions1164469 -Node: Installation summary1171055 -Node: Notes1172113 -Node: Compatibility Mode1172978 -Node: Additions1173760 -Node: Accessing The Source1174685 -Node: Adding Code1176121 -Node: New Ports1182340 -Node: Derived Files1186828 -Ref: Derived Files-Footnote-11192313 -Ref: Derived Files-Footnote-21192348 -Ref: Derived Files-Footnote-31192946 -Node: Future Extensions1193060 -Node: Implementation Limitations1193718 -Node: Extension Design1194901 -Node: Old Extension Problems1196055 -Ref: Old Extension Problems-Footnote-11197573 -Node: Extension New Mechanism Goals1197630 -Ref: Extension New Mechanism Goals-Footnote-11200994 -Node: Extension Other Design Decisions1201183 -Node: Extension Future Growth1203296 -Node: Old Extension Mechanism1204132 -Node: Notes summary1205895 -Node: Basic Concepts1207077 -Node: Basic High Level1207758 -Ref: figure-general-flow1208040 -Ref: figure-process-flow1208725 -Ref: Basic High Level-Footnote-11212026 -Node: Basic Data Typing1212211 -Node: Glossary1215539 -Node: Copying1247485 -Node: GNU Free Documentation License1285024 -Node: Index1310142 +Node: Top1200 +Node: Foreword342506 +Node: Foreword446948 +Node: Preface48480 +Ref: Preface-Footnote-151352 +Ref: Preface-Footnote-251459 +Ref: Preface-Footnote-351693 +Node: History51835 +Node: Names54187 +Ref: Names-Footnote-155281 +Node: This Manual55428 +Ref: This Manual-Footnote-161910 +Node: Conventions62010 +Node: Manual History64364 +Ref: Manual History-Footnote-167359 +Ref: Manual History-Footnote-267400 +Node: How To Contribute67474 +Node: Acknowledgments68603 +Node: Getting Started73489 +Node: Running gawk75928 +Node: One-shot77118 +Node: Read Terminal78381 +Node: Long80413 +Node: Executable Scripts81926 +Ref: Executable Scripts-Footnote-184721 +Node: Comments84824 +Node: Quoting87308 +Node: DOS Quoting92825 +Node: Sample Data Files93500 +Node: Very Simple96095 +Node: Two Rules100997 +Node: More Complex102882 +Node: Statements/Lines105745 +Ref: Statements/Lines-Footnote-1110204 +Node: Other Features110469 +Node: When111405 +Ref: When-Footnote-1113159 +Node: Intro Summary113224 +Node: Invoking Gawk114108 +Node: Command Line115622 +Node: Options116420 +Ref: Options-Footnote-1132518 +Ref: Options-Footnote-2132748 +Node: Other Arguments132773 +Node: Naming Standard Input135720 +Node: Environment Variables136813 +Node: AWKPATH Variable137371 +Ref: AWKPATH Variable-Footnote-1140782 +Ref: AWKPATH Variable-Footnote-2140827 +Node: AWKLIBPATH Variable141088 +Node: Other Environment Variables142345 +Node: Exit Status145983 +Node: Include Files146660 +Node: Loading Shared Libraries150255 +Node: Obsolete151683 +Node: Undocumented152375 +Node: Invoking Summary152672 +Node: Regexp154332 +Node: Regexp Usage155851 +Node: Escape Sequences157888 +Node: Regexp Operators164120 +Ref: Regexp Operators-Footnote-1171536 +Ref: Regexp Operators-Footnote-2171683 +Node: Bracket Expressions171781 +Ref: table-char-classes173803 +Node: Leftmost Longest176940 +Node: Computed Regexps178243 +Node: GNU Regexp Operators181670 +Node: Case-sensitivity185349 +Ref: Case-sensitivity-Footnote-1188245 +Ref: Case-sensitivity-Footnote-2188480 +Node: Strong Regexp Constants188588 +Node: Regexp Summary191530 +Node: Reading Files193136 +Node: Records195299 +Node: awk split records196032 +Node: gawk split records200963 +Ref: gawk split records-Footnote-1205503 +Node: Fields205540 +Node: Nonconstant Fields208281 +Ref: Nonconstant Fields-Footnote-1210517 +Node: Changing Fields210721 +Node: Field Separators216649 +Node: Default Field Splitting219347 +Node: Regexp Field Splitting220465 +Node: Single Character Fields223818 +Node: Command Line Field Separator224878 +Node: Full Line Fields228096 +Ref: Full Line Fields-Footnote-1229618 +Ref: Full Line Fields-Footnote-2229664 +Node: Field Splitting Summary229765 +Node: Constant Size231839 +Node: Splitting By Content236417 +Ref: Splitting By Content-Footnote-1240388 +Node: Multiple Line240551 +Ref: Multiple Line-Footnote-1246433 +Node: Getline246612 +Node: Plain Getline249078 +Node: Getline/Variable251717 +Node: Getline/File252866 +Node: Getline/Variable/File254252 +Ref: Getline/Variable/File-Footnote-1255855 +Node: Getline/Pipe255943 +Node: Getline/Variable/Pipe258648 +Node: Getline/Coprocess259781 +Node: Getline/Variable/Coprocess261046 +Node: Getline Notes261786 +Node: Getline Summary264581 +Ref: table-getline-variants265003 +Node: Read Timeout265751 +Ref: Read Timeout-Footnote-1269657 +Node: Retrying Input269715 +Node: Command-line directories270914 +Node: Input Summary271820 +Node: Input Exercises274992 +Node: Printing275720 +Node: Print277554 +Node: Print Examples279011 +Node: Output Separators281791 +Node: OFMT283808 +Node: Printf285164 +Node: Basic Printf285949 +Node: Control Letters287523 +Node: Format Modifiers291511 +Node: Printf Examples297526 +Node: Redirection300012 +Node: Special FD306853 +Ref: Special FD-Footnote-1310021 +Node: Special Files310095 +Node: Other Inherited Files310712 +Node: Special Network311713 +Node: Special Caveats312573 +Node: Close Files And Pipes313522 +Ref: Close Files And Pipes-Footnote-1320709 +Ref: Close Files And Pipes-Footnote-2320857 +Node: Nonfatal321008 +Node: Output Summary323333 +Node: Output Exercises324555 +Node: Expressions325234 +Node: Values326422 +Node: Constants327100 +Node: Scalar Constants327791 +Ref: Scalar Constants-Footnote-1328655 +Node: Nondecimal-numbers328905 +Node: Regexp Constants331918 +Node: Using Constant Regexps332444 +Node: Variables335607 +Node: Using Variables336264 +Node: Assignment Options338174 +Node: Conversion340047 +Node: Strings And Numbers340571 +Ref: Strings And Numbers-Footnote-1343634 +Node: Locale influences conversions343743 +Ref: table-locale-affects346501 +Node: All Operators347119 +Node: Arithmetic Ops347748 +Node: Concatenation350254 +Ref: Concatenation-Footnote-1353101 +Node: Assignment Ops353208 +Ref: table-assign-ops358199 +Node: Increment Ops359512 +Node: Truth Values and Conditions362972 +Node: Truth Values364046 +Node: Typing and Comparison365094 +Node: Variable Typing365914 +Node: Comparison Operators369538 +Ref: table-relational-ops369957 +Node: POSIX String Comparison373452 +Ref: POSIX String Comparison-Footnote-1374526 +Node: Boolean Ops374665 +Ref: Boolean Ops-Footnote-1379147 +Node: Conditional Exp379239 +Node: Function Calls380975 +Node: Precedence384852 +Node: Locales388511 +Node: Expressions Summary390143 +Node: Patterns and Actions392716 +Node: Pattern Overview393836 +Node: Regexp Patterns395513 +Node: Expression Patterns396055 +Node: Ranges399836 +Node: BEGIN/END402944 +Node: Using BEGIN/END403705 +Ref: Using BEGIN/END-Footnote-1406441 +Node: I/O And BEGIN/END406547 +Node: BEGINFILE/ENDFILE408861 +Node: Empty411768 +Node: Using Shell Variables412085 +Node: Action Overview414359 +Node: Statements416684 +Node: If Statement418532 +Node: While Statement420027 +Node: Do Statement422055 +Node: For Statement423203 +Node: Switch Statement426361 +Node: Break Statement428747 +Node: Continue Statement430839 +Node: Next Statement432666 +Node: Nextfile Statement435049 +Node: Exit Statement437701 +Node: Built-in Variables440104 +Node: User-modified441237 +Node: Auto-set448823 +Ref: Auto-set-Footnote-1463210 +Ref: Auto-set-Footnote-2463416 +Node: ARGC and ARGV463472 +Node: Pattern Action Summary467685 +Node: Arrays470115 +Node: Array Basics471444 +Node: Array Intro472288 +Ref: figure-array-elements474263 +Ref: Array Intro-Footnote-1476967 +Node: Reference to Elements477095 +Node: Assigning Elements479559 +Node: Array Example480050 +Node: Scanning an Array481809 +Node: Controlling Scanning484831 +Ref: Controlling Scanning-Footnote-1490230 +Node: Numeric Array Subscripts490546 +Node: Uninitialized Subscripts492730 +Node: Delete494349 +Ref: Delete-Footnote-1497101 +Node: Multidimensional497158 +Node: Multiscanning500253 +Node: Arrays of Arrays501844 +Node: Arrays Summary506611 +Node: Functions508704 +Node: Built-in509742 +Node: Calling Built-in510820 +Node: Numeric Functions512816 +Ref: Numeric Functions-Footnote-1517649 +Ref: Numeric Functions-Footnote-2518006 +Ref: Numeric Functions-Footnote-3518054 +Node: String Functions518326 +Ref: String Functions-Footnote-1541830 +Ref: String Functions-Footnote-2541958 +Ref: String Functions-Footnote-3542206 +Node: Gory Details542293 +Ref: table-sub-escapes544084 +Ref: table-sub-proposed545603 +Ref: table-posix-sub546966 +Ref: table-gensub-escapes548507 +Ref: Gory Details-Footnote-1549330 +Node: I/O Functions549481 +Ref: I/O Functions-Footnote-1556701 +Node: Time Functions556849 +Ref: Time Functions-Footnote-1567354 +Ref: Time Functions-Footnote-2567422 +Ref: Time Functions-Footnote-3567580 +Ref: Time Functions-Footnote-4567691 +Ref: Time Functions-Footnote-5567803 +Ref: Time Functions-Footnote-6568030 +Node: Bitwise Functions568296 +Ref: table-bitwise-ops568890 +Ref: Bitwise Functions-Footnote-1573228 +Node: Type Functions573401 +Node: I18N Functions576062 +Node: User-defined577713 +Node: Definition Syntax578518 +Ref: Definition Syntax-Footnote-1584205 +Node: Function Example584276 +Ref: Function Example-Footnote-1587198 +Node: Function Caveats587220 +Node: Calling A Function587738 +Node: Variable Scope588696 +Node: Pass By Value/Reference591690 +Node: Return Statement595189 +Node: Dynamic Typing598168 +Node: Indirect Calls599098 +Ref: Indirect Calls-Footnote-1609349 +Node: Functions Summary609477 +Node: Library Functions612182 +Ref: Library Functions-Footnote-1615789 +Ref: Library Functions-Footnote-2615932 +Node: Library Names616103 +Ref: Library Names-Footnote-1619563 +Ref: Library Names-Footnote-2619786 +Node: General Functions619872 +Node: Strtonum Function620975 +Node: Assert Function623997 +Node: Round Function627323 +Node: Cliff Random Function628864 +Node: Ordinal Functions629880 +Ref: Ordinal Functions-Footnote-1632943 +Ref: Ordinal Functions-Footnote-2633195 +Node: Join Function633405 +Ref: Join Function-Footnote-1635175 +Node: Getlocaltime Function635375 +Node: Readfile Function639117 +Node: Shell Quoting641089 +Node: Data File Management642490 +Node: Filetrans Function643122 +Node: Rewind Function647218 +Node: File Checking648604 +Ref: File Checking-Footnote-1649938 +Node: Empty Files650139 +Node: Ignoring Assigns652118 +Node: Getopt Function653668 +Ref: Getopt Function-Footnote-1665137 +Node: Passwd Functions665337 +Ref: Passwd Functions-Footnote-1674176 +Node: Group Functions674264 +Ref: Group Functions-Footnote-1682161 +Node: Walking Arrays682368 +Node: Library Functions Summary685376 +Node: Library Exercises686782 +Node: Sample Programs687247 +Node: Running Examples688017 +Node: Clones688745 +Node: Cut Program689969 +Node: Egrep Program699690 +Ref: Egrep Program-Footnote-1707202 +Node: Id Program707312 +Node: Split Program710992 +Ref: Split Program-Footnote-1714451 +Node: Tee Program714580 +Node: Uniq Program717370 +Node: Wc Program724796 +Ref: Wc Program-Footnote-1729051 +Node: Miscellaneous Programs729145 +Node: Dupword Program730358 +Node: Alarm Program732388 +Node: Translate Program737243 +Ref: Translate Program-Footnote-1741808 +Node: Labels Program742078 +Ref: Labels Program-Footnote-1745429 +Node: Word Sorting745513 +Node: History Sorting749585 +Node: Extract Program751420 +Node: Simple Sed758949 +Node: Igawk Program762023 +Ref: Igawk Program-Footnote-1776354 +Ref: Igawk Program-Footnote-2776556 +Ref: Igawk Program-Footnote-3776678 +Node: Anagram Program776793 +Node: Signature Program779855 +Node: Programs Summary781102 +Node: Programs Exercises782316 +Ref: Programs Exercises-Footnote-1786445 +Node: Advanced Features786536 +Node: Nondecimal Data788526 +Node: Array Sorting790117 +Node: Controlling Array Traversal790817 +Ref: Controlling Array Traversal-Footnote-1799184 +Node: Array Sorting Functions799302 +Ref: Array Sorting Functions-Footnote-1804393 +Node: Two-way I/O804589 +Ref: Two-way I/O-Footnote-1810409 +Ref: Two-way I/O-Footnote-2810596 +Node: TCP/IP Networking810678 +Node: Profiling813796 +Node: Advanced Features Summary822250 +Node: Internationalization824094 +Node: I18N and L10N825574 +Node: Explaining gettext826261 +Ref: Explaining gettext-Footnote-1831284 +Ref: Explaining gettext-Footnote-2831469 +Node: Programmer i18n831634 +Ref: Programmer i18n-Footnote-1836489 +Node: Translator i18n836538 +Node: String Extraction837332 +Ref: String Extraction-Footnote-1838464 +Node: Printf Ordering838550 +Ref: Printf Ordering-Footnote-1841336 +Node: I18N Portability841400 +Ref: I18N Portability-Footnote-1843856 +Node: I18N Example843919 +Ref: I18N Example-Footnote-1846725 +Node: Gawk I18N846798 +Node: I18N Summary847443 +Node: Debugger848784 +Node: Debugging849806 +Node: Debugging Concepts850247 +Node: Debugging Terms852056 +Node: Awk Debugging854631 +Node: Sample Debugging Session855537 +Node: Debugger Invocation856071 +Node: Finding The Bug857457 +Node: List of Debugger Commands863935 +Node: Breakpoint Control865268 +Node: Debugger Execution Control868962 +Node: Viewing And Changing Data872324 +Node: Execution Stack875698 +Node: Debugger Info877335 +Node: Miscellaneous Debugger Commands881406 +Node: Readline Support886494 +Node: Limitations887390 +Ref: Limitations-Footnote-1891621 +Node: Debugging Summary891672 +Node: Arbitrary Precision Arithmetic892951 +Node: Computer Arithmetic894367 +Ref: table-numeric-ranges897958 +Ref: Computer Arithmetic-Footnote-1898680 +Node: Math Definitions898737 +Ref: table-ieee-formats902051 +Ref: Math Definitions-Footnote-1902654 +Node: MPFR features902759 +Node: FP Math Caution904476 +Ref: FP Math Caution-Footnote-1905548 +Node: Inexactness of computations905917 +Node: Inexact representation906877 +Node: Comparing FP Values908237 +Node: Errors accumulate909319 +Node: Getting Accuracy910752 +Node: Try To Round913462 +Node: Setting precision914361 +Ref: table-predefined-precision-strings915058 +Node: Setting the rounding mode916888 +Ref: table-gawk-rounding-modes917262 +Ref: Setting the rounding mode-Footnote-1920670 +Node: Arbitrary Precision Integers920849 +Ref: Arbitrary Precision Integers-Footnote-1925766 +Node: POSIX Floating Point Problems925915 +Ref: POSIX Floating Point Problems-Footnote-1929797 +Node: Floating point summary929835 +Node: Dynamic Extensions932025 +Node: Extension Intro933578 +Node: Plugin License934844 +Node: Extension Mechanism Outline935641 +Ref: figure-load-extension936080 +Ref: figure-register-new-function937645 +Ref: figure-call-new-function938737 +Node: Extension API Description940799 +Node: Extension API Functions Introduction942331 +Node: General Data Types947190 +Ref: General Data Types-Footnote-1953145 +Node: Memory Allocation Functions953444 +Ref: Memory Allocation Functions-Footnote-1956289 +Node: Constructor Functions956388 +Node: Registration Functions958133 +Node: Extension Functions958818 +Node: Exit Callback Functions961117 +Node: Extension Version String962367 +Node: Input Parsers963030 +Node: Output Wrappers972915 +Node: Two-way processors977427 +Node: Printing Messages979691 +Ref: Printing Messages-Footnote-1980765 +Node: Updating ERRNO980918 +Node: Requesting Values981657 +Ref: table-value-types-returned982394 +Node: Accessing Parameters983277 +Node: Symbol Table Access984512 +Node: Symbol table by name985024 +Node: Symbol table by cookie987045 +Ref: Symbol table by cookie-Footnote-1991194 +Node: Cached values991258 +Ref: Cached values-Footnote-1994759 +Node: Array Manipulation994850 +Ref: Array Manipulation-Footnote-1995941 +Node: Array Data Types995978 +Ref: Array Data Types-Footnote-1998636 +Node: Array Functions998728 +Node: Flattening Arrays1002586 +Node: Creating Arrays1009494 +Node: Redirection API1014265 +Node: Extension API Variables1017096 +Node: Extension Versioning1017729 +Node: Extension API Informational Variables1019620 +Node: Extension API Boilerplate1020684 +Node: Finding Extensions1024498 +Node: Extension Example1025057 +Node: Internal File Description1025855 +Node: Internal File Ops1029935 +Ref: Internal File Ops-Footnote-11041697 +Node: Using Internal File Ops1041837 +Ref: Using Internal File Ops-Footnote-11044220 +Node: Extension Samples1044494 +Node: Extension Sample File Functions1046023 +Node: Extension Sample Fnmatch1053672 +Node: Extension Sample Fork1055159 +Node: Extension Sample Inplace1056377 +Node: Extension Sample Ord1059587 +Node: Extension Sample Readdir1060423 +Ref: table-readdir-file-types1061312 +Node: Extension Sample Revout1062117 +Node: Extension Sample Rev2way1062706 +Node: Extension Sample Read write array1063446 +Node: Extension Sample Readfile1065388 +Node: Extension Sample Time1066483 +Node: Extension Sample API Tests1067831 +Node: gawkextlib1068323 +Node: Extension summary1070770 +Node: Extension Exercises1074462 +Node: Language History1075959 +Node: V7/SVR3.11077615 +Node: SVR41079767 +Node: POSIX1081201 +Node: BTL1082580 +Node: POSIX/GNU1083309 +Node: Feature History1089171 +Node: Common Extensions1103541 +Node: Ranges and Locales1104824 +Ref: Ranges and Locales-Footnote-11109440 +Ref: Ranges and Locales-Footnote-21109467 +Ref: Ranges and Locales-Footnote-31109702 +Node: Contributors1109923 +Node: History summary1115492 +Node: Installation1116872 +Node: Gawk Distribution1117816 +Node: Getting1118300 +Node: Extracting1119261 +Node: Distribution contents1120899 +Node: Unix Installation1126993 +Node: Quick Installation1127675 +Node: Shell Startup Files1130089 +Node: Additional Configuration Options1131167 +Node: Configuration Philosophy1132972 +Node: Non-Unix Installation1135341 +Node: PC Installation1135799 +Node: PC Binary Installation1137119 +Node: PC Compiling1138971 +Ref: PC Compiling-Footnote-11141995 +Node: PC Testing1142104 +Node: PC Using1143284 +Node: Cygwin1147398 +Node: MSYS1148168 +Node: VMS Installation1148669 +Node: VMS Compilation1149460 +Ref: VMS Compilation-Footnote-11150689 +Node: VMS Dynamic Extensions1150747 +Node: VMS Installation Details1152432 +Node: VMS Running1154685 +Node: VMS GNV1158964 +Node: VMS Old Gawk1159699 +Node: Bugs1160170 +Node: Other Versions1164367 +Node: Installation summary1170951 +Node: Notes1172009 +Node: Compatibility Mode1172874 +Node: Additions1173656 +Node: Accessing The Source1174581 +Node: Adding Code1176016 +Node: New Ports1182235 +Node: Derived Files1186723 +Ref: Derived Files-Footnote-11192208 +Ref: Derived Files-Footnote-21192243 +Ref: Derived Files-Footnote-31192841 +Node: Future Extensions1192955 +Node: Implementation Limitations1193613 +Node: Extension Design1194796 +Node: Old Extension Problems1195950 +Ref: Old Extension Problems-Footnote-11197468 +Node: Extension New Mechanism Goals1197525 +Ref: Extension New Mechanism Goals-Footnote-11200889 +Node: Extension Other Design Decisions1201078 +Node: Extension Future Growth1203191 +Node: Old Extension Mechanism1204027 +Node: Notes summary1205790 +Node: Basic Concepts1206972 +Node: Basic High Level1207653 +Ref: figure-general-flow1207935 +Ref: figure-process-flow1208620 +Ref: Basic High Level-Footnote-11211921 +Node: Basic Data Typing1212106 +Node: Glossary1215434 +Node: Copying1247380 +Node: GNU Free Documentation License1284919 +Node: Index1310037 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index fe5c5698..5ffc5335 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -171,31 +171,6 @@ @end macro @end ifdocbook -@c hack for docbook, where comma shouldn't always follow an @ref{} -@ifdocbook -@macro DBREF{text} -@ref{\text\} -@end macro -@macro DBXREF{text} -@xref{\text\} -@end macro -@macro DBPXREF{text} -@pxref{\text\} -@end macro -@end ifdocbook - -@ifnotdocbook -@macro DBREF{text} -@ref{\text\}, -@end macro -@macro DBXREF{text} -@xref{\text\}, -@end macro -@macro DBPXREF{text} -@pxref{\text\}, -@end macro -@end ifnotdocbook - @ifclear FOR_PRINT @set FN file name @set FFN File name @@ -1199,7 +1174,7 @@ $\sim\! Cn^2$ @end ifnotdocbook @end ifnottex @docbook -<emphasis>∼ Cn<superscript>2</superscript></emphasis> @c +<emphasis>∼ Cn<superscript>2</superscript></emphasis> @end docbook performance, while theory predicted @@ -1212,7 +1187,7 @@ $\sim\! Cn\log n$ @end ifnotdocbook @end ifnottex @docbook -<emphasis>∼ Cn log n</emphasis> @c +<emphasis>∼ Cn log n</emphasis> @end docbook behavior. A few minutes poring over the @file{awkprof.out} profile pinpointed the problem to @@ -1510,7 +1485,7 @@ John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as @command{gawk} @value{PVERSION} 4.0 in 2011. -@DBXREF{Contributors} +@xref{Contributors} for a full list of those who have made important contributions to @command{gawk}. @node Names @@ -1894,7 +1869,7 @@ pressing the @kbd{d} key, and finally releasing both keys. For the sake of brevity, throughout this @value{DOCUMENT}, we refer to Brian Kernighan's version of @command{awk} as ``BWK @command{awk}.'' -(@DBXREF{Other Versions} for information on his and other versions.) +(@xref{Other Versions} for information on his and other versions.) @ifset FOR_PRINT @quotation NOTE @@ -2053,7 +2028,7 @@ and the major new additions are @ref{Arbitrary Precision Arithmetic}, and @ref{Dynamic Extensions}. This @value{DOCUMENT} will undoubtedly continue to evolve. If you -find an error in the @value{DOCUMENT}, please report it! @DBXREF{Bugs} +find an error in the @value{DOCUMENT}, please report it! @xref{Bugs} for information on submitting problem reports electronically. @ifset FOR_PRINT @@ -2249,7 +2224,7 @@ portable program it is today. It has been and continues to be a pleasure working with this team of fine people. Notable code and documentation contributions were made by -a number of people. @DBXREF{Contributors} for the full list. +a number of people. @xref{Contributors} for the full list. @ifset FOR_PRINT @cindex Oram, Andy @@ -2891,7 +2866,7 @@ The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is @emph{impossible} to embed a single quote inside single-quoted text. Refer back to -@DBREF{Comments} +@ref{Comments} for an example of what happens if you try. @item @@ -3319,9 +3294,9 @@ no actions run. After processing all the rules that match the line (and perhaps there are none), @command{awk} reads the next line. (However, -@DBPXREF{Next Statement} +@pxref{Next Statement} @ifdocbook -and @DBREF{Nextfile Statement}.) +and @ref{Nextfile Statement}.) @end ifdocbook @ifnotdocbook and also @pxref{Nextfile Statement}.) @@ -3592,7 +3567,7 @@ and array sorting. As we develop our presentation of the @command{awk} language, we will introduce most of the variables and many of the functions. They are described -systematically in @DBREF{Built-in Variables} and in +systematically in @ref{Built-in Variables} and in @ref{Built-in}. @node When @@ -4133,7 +4108,7 @@ in the left margin, and function call counts for each function. Operate in strict POSIX mode. This disables all @command{gawk} extensions (just like @option{--traditional}) and disables all extensions not allowed by POSIX. -@DBXREF{Common Extensions} for a summary of the extensions +@xref{Common Extensions} for a summary of the extensions in @command{gawk} that are disabled by this option. Also, the following additional @@ -5269,7 +5244,7 @@ with a backslash have special meaning in regexps. In a regexp, a backslash before any character that is not in the previous list and not listed in -@DBREF{GNU Regexp Operators} +@ref{GNU Regexp Operators} means that the next character should be taken literally, even if it would normally be a regexp operator. For example, @code{/a\+b/} matches the three characters @samp{a+b}. @@ -5451,7 +5426,7 @@ The escape sequences described @ifnotinfo earlier @end ifnotinfo -in @DBREF{Escape Sequences} +in @ref{Escape Sequences} are valid inside a regexp. They are introduced by a @samp{\} and are recognized and converted into corresponding real characters as the very first step in processing regexps. @@ -5686,7 +5661,7 @@ Within a bracket expression, a @dfn{range expression} consists of two characters separated by a hyphen. It matches any single character that sorts between the two characters, based upon the system's native character set. For example, @samp{[0-9]} is equivalent to @samp{[0123456789]}. -(See @DBREF{Ranges and Locales} for an explanation of how the POSIX +(See @ref{Ranges and Locales} for an explanation of how the POSIX standard and @command{gawk} have changed over time. This is mainly of historical interest.) @@ -6636,7 +6611,7 @@ The empty string @code{""} (a string without any characters) has a special meaning as the value of @code{RS}. It means that records are separated by one or more blank lines and nothing else. -@DBXREF{Multiple Line} for more details. +@xref{Multiple Line} for more details. If you change the value of @code{RS} in the middle of an @command{awk} run, the new value is used to delimit subsequent records, but the record @@ -6700,7 +6675,7 @@ $ @kbd{echo record 1 AAAA record 2 BBBB record 3 |} The square brackets delineate the contents of @code{RT}, letting you see the leading and trailing whitespace. The final value of @code{RT} is a newline. -@DBXREF{Simple Sed} for a more useful example +@xref{Simple Sed} for a more useful example of @code{RS} as a regexp and @code{RT}. If you set @code{RS} to a regular expression that allows optional @@ -6772,8 +6747,8 @@ character as a record separator. However, this is a special case: @cindex records, treating files as @cindex treating files, as single records -@DBXREF{Readfile Function} for an interesting way to read -whole files. If you are using @command{gawk}, see @DBREF{Extension Sample +@xref{Readfile Function} for an interesting way to read +whole files. If you are using @command{gawk}, see @ref{Extension Sample Readfile} for another option. @docbook @@ -6823,8 +6798,8 @@ character as a record separator. However, this is a special case: @cindex records, treating files as @cindex treating files, as single records -@DBXREF{Readfile Function} for an interesting way to read -whole files. If you are using @command{gawk}, see @DBREF{Extension Sample +@xref{Readfile Function} for an interesting way to read +whole files. If you are using @command{gawk}, see @ref{Extension Sample Readfile} for another option. @end cartouche @end ifnotdocbook @@ -7070,9 +7045,9 @@ else @noindent should print @samp{everything is normal}, because @code{NF+1} is certain -to be out of range. (@DBXREF{If Statement} +to be out of range. (@xref{If Statement} for more information about @command{awk}'s @code{if-else} statements. -@DBXREF{Typing and Comparison} +@xref{Typing and Comparison} for more information about the @samp{!=} operator.) It is important to note that making an assignment to an existing field @@ -7896,7 +7871,7 @@ else This information is useful when writing a function that needs to temporarily change @code{FS} or @code{FIELDWIDTHS}, read some records, and then restore the original settings -(@DBPXREF{Passwd Functions} +(@pxref{Passwd Functions} for an example of such a function). @node Splitting By Content @@ -8163,7 +8138,7 @@ $ @kbd{awk -f addrs.awk addresses} @dots{} @end example -@DBXREF{Labels Program} for a more realistic program dealing with +@xref{Labels Program} for a more realistic program dealing with address lists. The following list summarizes how records are split, based on the value of @ifinfo @@ -8252,7 +8227,7 @@ If @code{ERRNO} indicates that the I/O operation may be retried, and @code{PROCINFO["@var{input}", "RETRY"]} is set, then @code{getline} returns @minus{}2 instead of @minus{}1, and further calls to @code{getline} -may be attemped. @DBXREF{Retrying Input} for further information about +may be attemped. @xref{Retrying Input} for further information about this feature. In the following examples, @var{command} stands for a string value that @@ -8493,7 +8468,7 @@ One deficiency of this program is that it does not process nested @code{@@include} statements (i.e., @code{@@include} statements in included files) the way a true macro preprocessor would. -@DBXREF{Igawk Program} for a program +@xref{Igawk Program} for a program that does handle nested @code{@@include} statements. @node Getline/Pipe @@ -8909,7 +8884,7 @@ on a per-command or per-connection basis. the attempt to read from the underlying device may succeed in a later attempt. This is a limitation, and it also means that you cannot use this to multiplex input from -two or more sources. @DBXREF{Retrying Input} for a way to enable +two or more sources. @xref{Retrying Input} for a way to enable later I/O attempts to succeed. Assigning a timeout value prevents read operations from @@ -8973,7 +8948,7 @@ If either of the @option{--posix} or @option{--traditional} options is given, then @command{gawk} reverts to treating a directory on the command line as a fatal error. -@DBXREF{Extension Sample Readdir} for a way to treat directories +@xref{Extension Sample Readdir} for a way to treat directories as usable data from an @command{awk} program. @node Input Summary @@ -9086,7 +9061,7 @@ The @code{print} statement is not limited when computing @emph{which} values to print. However, with two exceptions, you cannot specify @emph{how} to print them---how many columns, whether to use exponential notation or not, and so on. -(For the exceptions, @DBPXREF{Output Separators} and +(For the exceptions, @pxref{Output Separators} and @ref{OFMT}.) For printing with specifications, you need the @code{printf} statement (@pxref{Printf}). @@ -9984,7 +9959,7 @@ close(report) The @code{close()} function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to it. -@DBXREF{Close Files And Pipes} +@xref{Close Files And Pipes} for more information. This example also illustrates the use of a variable to represent @@ -10015,9 +9990,9 @@ for a brief discussion. for a more complete discussion. @end ifnotdocbook @ifdocbook -@DBXREF{Getline/Coprocess} +@xref{Getline/Coprocess} for a brief discussion and -@DBREF{Two-way I/O} +@ref{Two-way I/O} for a more complete discussion. @end ifdocbook @end table @@ -10096,7 +10071,7 @@ The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. -@DBXREF{Shell Quoting} for a function that can help in generating +@xref{Shell Quoting} for a function that can help in generating command lines to be fed to the shell. @docbook @@ -10131,7 +10106,7 @@ The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. -@DBXREF{Shell Quoting} for a function that can help in generating +@xref{Shell Quoting} for a function that can help in generating command lines to be fed to the shell. @end cartouche @end ifnotdocbook @@ -10913,7 +10888,7 @@ you can use the @code{strtonum()} function to convert the data into a number. Most of the time, you will want to use octal or hexadecimal constants when working with the built-in bit-manipulation functions; -see @DBREF{Bitwise Functions} +see @ref{Bitwise Functions} for more information. Unlike in some early C implementations, @samp{8} and @samp{9} are not @@ -11146,7 +11121,7 @@ array parameters (@pxref{String Functions}). @cindex variables, initializing A few variables have special built-in meanings, such as @code{FS} (the field separator) and @code{NF} (the number of fields in the current input -record). @DBXREF{Built-in Variables} for a list of the predefined variables. +record). @xref{Built-in Variables} for a list of the predefined variables. These predefined variables can be used and assigned just like all other variables, but their values are also used or changed automatically by @command{awk}. All predefined variables' names are entirely uppercase. @@ -11187,7 +11162,7 @@ as in the following: the variable is set at the very beginning, even before the @code{BEGIN} rules execute. The @option{-v} option and its assignment must precede all the @value{FN} arguments, as well as the program text. -(@DBXREF{Options} for more information about +(@xref{Options} for more information about the @option{-v} option.) Otherwise, the variable assignment is performed at a time determined by its position among the input file arguments---after the processing of the @@ -11326,7 +11301,7 @@ specifies the output format to use when printing numbers with @code{print}. conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. -@DBXREF{Print} for more information on the @code{print} statement. +@xref{Print} for more information on the @code{print} statement. @docbook </sidebar> @@ -11349,7 +11324,7 @@ specifies the output format to use when printing numbers with @code{print}. conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. -@DBXREF{Print} for more information on the @code{print} statement. +@xref{Print} for more information on the @code{print} statement. @end cartouche @end ifnotdocbook @@ -11851,10 +11826,10 @@ The indices of @code{bar} are practically guaranteed to be different, because @xref{Arrays}, and @ifnotdocbook -@DBPXREF{Numeric Functions} +@pxref{Numeric Functions} @end ifnotdocbook @ifdocbook -@DBREF{Numeric Functions} +@ref{Numeric Functions} @end ifdocbook for more information.) This example illustrates an important fact about assignment @@ -12030,7 +12005,6 @@ has the value four, but it changes the value of @code{foo} to five. In other words, the operator returns the old value of the variable, but with the side effect of incrementing it. -@c FIXME: Use @sup here for superscript The post-increment @samp{foo++} is nearly the same as writing @samp{(foo += 1) - 1}. It is not perfectly equivalent because all numbers in @command{awk} are floating point---in floating point, @samp{foo + 1 - 1} does @@ -12039,14 +12013,14 @@ long as you stick to numbers that are fairly small (less than @iftex @math{10^{12}}). @end iftex -@ifnottex -@ifnotdocbook +@ifinfo 10e12). -@end ifnotdocbook +@end ifinfo +@ifnottex +@ifnotinfo +10@sup{12}). +@end ifnotinfo @end ifnottex -@docbook -10<superscript>12</superscript>). @c -@end docbook @cindex @code{$} (dollar sign), incrementing fields and arrays @cindex dollar sign (@code{$}), incrementing fields and arrays @@ -12884,10 +12858,10 @@ example, the function @code{sqrt()} computes the square root of a number. @cindex functions, built-in A fixed set of functions are @dfn{built in}, which means they are available in every @command{awk} program. The @code{sqrt()} function is one -of these. @DBXREF{Built-in} for a list of built-in +of these. @xref{Built-in} for a list of built-in functions and their descriptions. In addition, you can define functions for use in your program. -@DBXREF{User-defined} +@xref{User-defined} for instructions on how to do this. Finally, @command{gawk} lets you write functions in C or C++ that may be called from your program (@pxref{Dynamic Extensions}). @@ -12930,7 +12904,7 @@ Some of the built-in functions have one or more optional arguments. If those arguments are not supplied, the functions use a reasonable default value. -@DBXREF{Built-in} for full details. If arguments +@xref{Built-in} for full details. If arguments are omitted in calls to user-defined functions, then those arguments are treated as local variables. Such local variables act like the empty string if referenced where a string value is required, @@ -13645,7 +13619,7 @@ The order in which library functions are named on the command line controls the order in which their @code{BEGIN} and @code{END} rules are executed. Therefore, you have to be careful when writing such rules in library files so that the order in which they are executed doesn't matter. -@DBXREF{Options} for more information on +@xref{Options} for more information on using library functions. @xref{Library Functions}, for a number of useful library functions. @@ -13709,12 +13683,12 @@ Finally, the @code{next} and @code{nextfile} statements are not allowed in a @code{BEGIN} rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements are not valid in an @code{END} rule, because all the input has been read. -(@DBXREF{Next Statement} and +(@xref{Next Statement} and @ifnotdocbook -@DBPXREF{Nextfile Statement}.) +@pxref{Nextfile Statement}.) @end ifnotdocbook @ifdocbook -@DBREF{Nextfile Statement}.) +@ref{Nextfile Statement}.) @end ifdocbook @node BEGINFILE/ENDFILE @@ -14286,7 +14260,7 @@ for (i in array) @end example @noindent -@DBXREF{Scanning an Array} +@xref{Scanning an Array} for more information on this version of the @code{for} loop. @node Switch Statement @@ -14671,7 +14645,7 @@ In such a case, if you don't want the @code{END} rule to do its job, set a variable to a nonzero value before the @code{exit} statement and check that variable in the @code{END} rule. -@DBXREF{Assert Function} +@xref{Assert Function} for an example that does this. @cindex dark corner, @code{exit} statement @@ -14682,7 +14656,7 @@ In the case where an argument is supplied to a first @code{exit} statement, and then @code{exit} is called a second time from an @code{END} rule with no argument, @command{awk} uses the previously supplied exit value. @value{DARKCORNER} -@DBXREF{Exit Status} for more information. +@xref{Exit Status} for more information. @cindex programming conventions, @code{exit} statement For example, suppose an error condition occurs that is difficult or @@ -14792,7 +14766,7 @@ A space-separated list of columns that tells @command{gawk} how to split input with fixed columnar boundaries. Assigning a value to @code{FIELDWIDTHS} overrides the use of @code{FS} and @code{FPAT} for field splitting. -@DBXREF{Constant Size} for more information. +@xref{Constant Size} for more information. @cindex @command{gawk}, @code{FPAT} variable in @cindex @code{FPAT} variable @@ -14804,7 +14778,7 @@ A regular expression (as a string) that tells @command{gawk} to create the fields based on text that matches the regular expression. Assigning a value to @code{FPAT} overrides the use of @code{FS} and @code{FIELDWIDTHS} for field splitting. -@DBXREF{Splitting By Content} for more information. +@xref{Splitting By Content} for more information. @cindex @code{FS} variable @cindex separators, field @@ -15019,7 +14993,7 @@ method of accessing command-line arguments. The value of @code{ARGV[0]} can vary from system to system. Also, you should note that the program text is @emph{not} included in @code{ARGV}, nor are any of @command{awk}'s command-line options. -@DBXREF{ARGC and ARGV} for information +@xref{ARGC and ARGV} for information about how @command{awk} uses these variables. @value{DARKCORNER} @@ -15071,9 +15045,9 @@ Some operating systems may not have environment variables. On such systems, the @code{ENVIRON} array is empty (except for @w{@code{ENVIRON["AWKPATH"]}} and @w{@code{ENVIRON["AWKLIBPATH"]}}; -@DBPXREF{AWKPATH Variable} and +@pxref{AWKPATH Variable} and @ifdocbook -@DBREF{AWKLIBPATH Variable}). +@ref{AWKLIBPATH Variable}). @end ifdocbook @ifnotdocbook @pxref{AWKLIBPATH Variable}). @@ -15301,20 +15275,20 @@ The following elements allow you to change @command{gawk}'s behavior: @table @code @item PROCINFO["NONFATAL"] If this element exists, then I/O errors for all output redirections become nonfatal. -@DBXREF{Nonfatal}. +@xref{Nonfatal}. @item PROCINFO["@var{output_name}", "NONFATAL"] Make output errors for @var{output_name} be nonfatal. -@DBXREF{Nonfatal}. +@xref{Nonfatal}. @item PROCINFO["@var{command}", "pty"] For two-way communication to @var{command}, use a pseudo-tty instead of setting up a two-way pipe. -@DBXREF{Two-way I/O} for more information. +@xref{Two-way I/O} for more information. @item PROCINFO["@var{input_name}", "READ_TIMEOUT"] Set a timeout for reading from input redirection @var{input_name}. -@DBXREF{Read Timeout} for more information. +@xref{Read Timeout} for more information. @item PROCINFO["sorted_in"] If this element exists in @code{PROCINFO}, its value controls the @@ -15490,7 +15464,7 @@ changed. @cindex arguments, command-line @cindex command line, arguments -@DBREF{Auto-set} +@ref{Auto-set} presented the following program describing the information contained in @code{ARGC} and @code{ARGV}: @@ -15560,12 +15534,12 @@ use the @code{delete} statement to remove elements from All of these actions are typically done in the @code{BEGIN} rule, before actual processing of the input begins. -@DBXREF{Split Program} and +@xref{Split Program} and @ifnotdocbook -@DBPXREF{Tee Program} +@pxref{Tee Program} @end ifnotdocbook @ifdocbook -@DBREF{Tee Program} +@ref{Tee Program} @end ifdocbook for examples of each way of removing elements from @code{ARGV}. @@ -15615,20 +15589,20 @@ gawk -f myprog.awk -q -v file1 file2 @dots{} @noindent Because @option{-q} is not a valid @command{gawk} option, it and the following @option{-v} are passed on to the @command{awk} program. -(@DBXREF{Getopt Function} for an @command{awk} library function that +(@xref{Getopt Function} for an @command{awk} library function that parses command-line options.) When designing your program, you should choose options that don't conflict with @command{gawk}'s, because it will process any options that it accepts before passing the rest of the command line on to your program. Using @samp{#!} with the @option{-E} option may help -(@DBPXREF{Executable Scripts} +(@pxref{Executable Scripts} and @ifnotdocbook -@DBPXREF{Options}). +@pxref{Options}). @end ifnotdocbook @ifdocbook -@DBREF{Options}). +@ref{Options}). @end ifdocbook @node Pattern Action Summary @@ -16235,7 +16209,7 @@ the word as the index. The second rule scans the elements of @code{used} to find all the distinct words that appear in the input. It prints each word that is more than 10 characters long and also prints the number of such words. -@DBXREF{String Functions} +@xref{String Functions} for more information on the built-in function @code{length()}. @example @@ -16258,7 +16232,7 @@ END @{ @end example @noindent -@DBXREF{Word Sorting} +@xref{Word Sorting} for a more detailed example of this type. @cindex arrays, elements, order of access by @code{in} operator @@ -17006,7 +16980,7 @@ for (i in a) @{ @end example @noindent -@DBXREF{Walking Arrays} for a user-defined function that ``walks'' an +@xref{Walking Arrays} for a user-defined function that ``walks'' an arbitrarily dimensioned array of arrays. Recall that a reference to an uninitialized array element yields a value @@ -17411,7 +17385,7 @@ together. The following description ignores the third argument, @var{how}, as it requires understanding features that we have not discussed yet. Thus, the discussion here is a deliberate simplification. (We do provide all -the details later on; see @DBREF{Array Sorting Functions} for the full story.) +the details later on; see @ref{Array Sorting Functions} for the full story.) @end quotation Both functions return the number of elements in the array @var{source}. @@ -17586,7 +17560,7 @@ contrast, @code{length(15 * 35)} works out to three. In this example, @end ifnotdocbook @end ifnottex @docbook -15 ⋅ 35 = 525, @c +15 ⋅ 35 = 525, @end docbook and 525 is then converted to the string @code{"525"}, which has three characters. @@ -17658,7 +17632,7 @@ at which that substring begins (one, if it starts at the beginning of The @var{regexp} argument may be either a regexp constant (@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@DBXREF{Computed Regexps} for a +@xref{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -17855,7 +17829,7 @@ Modern implementations of @command{awk}, including @command{gawk}, allow the third argument to be a regexp constant (@w{@code{/}@dots{}@code{/}}) as well as a string. @value{DARKCORNER} The POSIX standard allows this as well. -@DBXREF{Computed Regexps} for a +@xref{Computed Regexps} for a discussion of the difference between using a string constant or a regexp constant, and the implications for writing your program correctly. @@ -17906,7 +17880,7 @@ Using the @code{strtonum()} function is @emph{not} the same as adding zero to a string value; the automatic coercion of strings to numbers works only for decimal data, not for octal or hexadecimal.@footnote{Unless you use the @option{--non-decimal-data} option, which isn't recommended. -@DBXREF{Nondecimal Data} for more information.} +@xref{Nondecimal Data} for more information.} Note also that @code{strtonum()} uses the current locale's decimal point for recognizing numbers (@pxref{Locales}). @@ -17924,7 +17898,7 @@ Return the number of substitutions made (zero or one). The @var{regexp} argument may be either a regexp constant (@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@DBXREF{Computed Regexps} for a +@xref{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -18461,7 +18435,7 @@ Optional parameters are enclosed in square brackets ([ ]): Close the file @var{filename} for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess or pipe is closed. -@DBXREF{Close Files And Pipes} +@xref{Close Files And Pipes} for more information. When closing a coprocess, it is occasionally useful to first close @@ -18837,19 +18811,18 @@ All known POSIX-compliant systems support timestamps from 0 through @iftex @math{2^{31} - 1}, @end iftex -@ifnottex -@ifnotdocbook +@ifinfo 2^31 - 1, -@end ifnotdocbook +@end ifinfo +@ifnottex +@ifnotinfo +2@sup{31} @minus{} 1, +@end ifnotinfo @end ifnottex -@docbook -2<superscript>31</superscript> − 1, @c -@end docbook which is sufficient to represent times through 2038-01-19 03:14:07 UTC. Many systems support a wider range of timestamps, including negative timestamps that represent times before the epoch. -@c FIXME: Use @sup here for superscript @cindex @command{date} utility, GNU @cindex time, retrieving @@ -20812,7 +20785,7 @@ It contains the following chapters: @cindex functions, library @cindex functions, user-defined, library of -@DBREF{User-defined} describes how to write +@ref{User-defined} describes how to write your own @command{awk} functions. Writing functions is important, because it allows you to encapsulate algorithms and program tasks in a single place. It simplifies programming, making program development more @@ -20845,7 +20818,7 @@ use these functions. The functions are presented here in a progression from simple to complex. @cindex Texinfo -@DBREF{Extract Program} +@ref{Extract Program} presents a program that you can use to extract the source code for these example library functions and programs from the Texinfo source for this @value{DOCUMENT}. @@ -20997,7 +20970,7 @@ A different convention, common in the Tcl community, is to use a single associative array to hold the values needed by the library function(s), or ``package.'' This significantly decreases the number of actual global names in use. For example, the functions described in -@DBREF{Passwd Functions} +@ref{Passwd Functions} might have used array elements @code{@w{PW_data["inited"]}}, @code{@w{PW_data["total"]}}, @code{@w{PW_data["count"]}}, and @code{@w{PW_data["awklib"]}}, instead of @code{@w{_pw_inited}}, @code{@w{_pw_awklib}}, @code{@w{_pw_total}}, @@ -21556,7 +21529,7 @@ more difficult than they really need to be.} @cindex timestamps, formatted @cindex time, managing The @code{systime()} and @code{strftime()} functions described in -@DBREF{Time Functions} +@ref{Time Functions} provide the minimum functionality necessary for dealing with the time of day in human-readable form. Although @code{strftime()} is extensive, the control formats are not necessarily easy to remember or intuitively obvious when @@ -21642,7 +21615,7 @@ function getlocaltime(time, ret, now, i) The string indices are easier to use and read than the various formats required by @code{strftime()}. The @code{alarm} program presented in -@DBREF{Alarm Program} +@ref{Alarm Program} uses this function. A more general design for the @code{getlocaltime()} function would have allowed the user to supply an optional timestamp value to use instead @@ -21709,7 +21682,7 @@ will never match if the file has contents. @command{gawk} reads data from the file into @code{tmp}, attempting to match @code{RS}. The match fails after each read, but fails quickly, such that @command{gawk} fills @code{tmp} with the entire contents of the file. -(@DBXREF{Records} for information on @code{RT} and @code{RS}.) +(@xref{Records} for information on @code{RT} and @code{RS}.) In the case that @code{file} is empty, the return value is the null string. Thus, calling code may use something like: @@ -21723,7 +21696,7 @@ if (length(contents) == 0) This tests the result to see if it is empty or not. An equivalent test would be @samp{contents == ""}. -@DBXREF{Extension Sample Readfile} for an extension function that +@xref{Extension Sample Readfile} for an extension function that also reads an entire file into memory. @node Shell Quoting @@ -21922,7 +21895,7 @@ END @{ endfile(_filename_) @} @c endfile @end example -@DBREF{Wc Program} +@ref{Wc Program} shows how this library function can be used and how it simplifies writing the main program. @@ -22550,7 +22523,7 @@ Using @samp{#!} with the @option{-E} option may help avoid conflicts between your program's options and @command{gawk}'s options, as @option{-E} causes @command{gawk} to abandon processing of further options -(@DBPXREF{Executable Scripts} and +(@pxref{Executable Scripts} and @ifnotdocbook @pxref{Options}). @end ifnotdocbook @@ -22578,7 +22551,7 @@ However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This @value{SECTION} presents a suite of functions for retrieving information from the -user database. @DBXREF{Group Functions} +user database. @xref{Group Functions} for a similar suite that retrieves information from the group database. @cindex @code{getpwent()} function (C library) @@ -22912,7 +22885,7 @@ once. If you are worried about squeezing every last cycle out of your this is not necessary, as most @command{awk} programs are I/O-bound, and such a change would clutter up the code. -The @command{id} program in @DBREF{Id Program} +The @command{id} program in @ref{Id Program} uses these functions. @node Group Functions @@ -22930,7 +22903,7 @@ uses these functions. @cindex group file @cindex files, group Much of the discussion presented in -@DBREF{Passwd Functions} +@ref{Passwd Functions} applies to the group database as well. Although there has traditionally been a well-known file (@file{/etc/group}) in a well-known format, the POSIX standard only provides a set of C library routines @@ -23267,13 +23240,13 @@ Most of the work is in scanning the database and building the various associative arrays. The functions that the user calls are themselves very simple, relying on @command{awk}'s associative arrays to do work. -The @command{id} program in @DBREF{Id Program} +The @command{id} program in @ref{Id Program} uses these functions. @node Walking Arrays @section Traversing Arrays of Arrays -@DBREF{Arrays of Arrays} described how @command{gawk} +@ref{Arrays of Arrays} described how @command{gawk} provides arrays of arrays. In particular, any element of an array may be either a scalar or another array. The @code{isarray()} function (@pxref{Type Functions}) @@ -23486,7 +23459,7 @@ an intervening value in @code{ARGV} is a variable assignment. @ignore @c June 13 2015: Antonio points out that this is answered in the text. Ooops. @item -@DBREF{Walking Arrays} presented a function that walked a multidimensional +@ref{Walking Arrays} presented a function that walked a multidimensional array to print it out. However, walking an array and processing each element is a general-purpose operation. Generalize the @code{walk_array()} function by adding an additional parameter named @@ -25510,7 +25483,7 @@ of lines on the page @end ifnotdocbook @end ifnottex @docbook -(20 ⋅ 5 = 100). @c +(20 ⋅ 5 = 100). @end docbook Most of the work is done in the @code{printpage()} function. @@ -26889,7 +26862,7 @@ the separator can considerably simplify such tasks. @item The examples here demonstrate the usefulness of the library -functions from @DBREF{Library Functions} +functions from @ref{Library Functions} for a number of real (if small) programs. @item @@ -27220,7 +27193,7 @@ Often, though, it is desirable to be able to loop over the elements in a particular order that you, the programmer, choose. @command{gawk} lets you do this. -@DBREF{Controlling Scanning} describes how you can assign special, +@ref{Controlling Scanning} describes how you can assign special, predefined values to @code{PROCINFO["sorted_in"]} in order to control the order in which @command{gawk} traverses an array during a @code{for} loop. @@ -27245,7 +27218,7 @@ Here, @code{i1} and @code{i2} are the indices, and @code{v1} and @code{v2} are the corresponding values of the two elements being compared. Either @code{v1} or @code{v2}, or both, can be arrays if the array being traversed contains subarrays as values. -(@DBXREF{Arrays of Arrays} for more information about subarrays.) +(@xref{Arrays of Arrays} for more information about subarrays.) The three possible return values are interpreted as follows: @table @code @@ -28762,7 +28735,7 @@ BEGIN @{ @end enumerate -@DBXREF{I18N Example} +@xref{I18N Example} for an example program showing the steps to create and use translations from @command{awk}. @@ -28823,7 +28796,7 @@ second argument to @code{dcngettext()}.@footnote{The You should distribute the generated @file{.pot} file with your @command{awk} program; translators will eventually use it to provide you translations that you can also then distribute. -@DBXREF{I18N Example} +@xref{I18N Example} for the full list of steps to go through to create and test translations for @command{guide}. @@ -30734,31 +30707,16 @@ signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. @item Single-precision floating point (approximate) @tab @math{1.175494^{-38}} @tab @math{3.402823^{38}} @item Double-precision floating point (approximate) @tab @math{2.225074^{-308}} @tab @math{1.797693^{308}} @end iftex -@ifnottex -@ifnotdocbook +@ifinfo @item Single-precision floating point (approximate) @tab 1.175494e-38 @tab 3.402823e38 @item Double-precision floating point (approximate) @tab 2.225074e-308 @tab 1.797693e308 -@end ifnotdocbook +@end ifinfo +@ifnottex +@ifnotinfo +@item Single-precision floating point (approximate) @tab 1.175494@sup{-38} @tab 3.402823@sup{38} +@item Double-precision floating point (approximate) @tab 2.225074@sup{-308} @tab 1.797693@sup{308} +@end ifnotinfo @end ifnottex -@ifdocbook -@item Single-precision floating point (approximate) @tab -@c FIXME: Use @sup here for superscript -@docbook -1.175494<superscript>-38</superscript> -@end docbook -@tab -@docbook -3.402823<superscript>38</superscript> -@end docbook -@item Double-precision floating point (approximate) @tab -@docbook -2.225074<superscript>-308</superscript> -@end docbook -@tab -@docbook -1.797693<superscript>308</superscript> -@end docbook -@end ifdocbook @end multitable @end float @@ -30826,7 +30784,7 @@ formula: @end ifnotdocbook @end ifnottex @docbook -<emphasis>prec</emphasis> = 3.322 ⋅ <emphasis>dps</emphasis> @c +<emphasis>prec</emphasis> = 3.322 ⋅ <emphasis>dps</emphasis> @end docbook @end display @@ -30918,7 +30876,7 @@ Two predefined variables, @code{PREC} and @code{ROUNDMODE}, provide control over the working precision and the rounding mode. The precision and the rounding mode are set globally for every operation to follow. -@DBXREF{Setting precision} and @DBREF{Setting the rounding mode} +@xref{Setting precision} and @ref{Setting the rounding mode} for more information. @node FP Math Caution @@ -31352,17 +31310,16 @@ the following computes @iftex @math{5^{4^{3^{2}}}}, @end iftex -@ifnottex -@ifnotdocbook +@ifinfo 5^4^3^2, -@end ifnotdocbook +@end ifinfo +@ifnottex +@ifnotinfo +5@sup{4@sup{3@sup{2}}}, +@end ifnotinfo @end ifnottex -@docbook -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: -@c FIXME: Use @sup here for superscript @example $ @kbd{gawk -M 'BEGIN @{} @@ -31390,7 +31347,7 @@ would be 3.322 x 183231, @docbook <emphasis>prec</emphasis> = 3.322 ⋅ <emphasis>dps</emphasis>) would be -<emphasis>prec</emphasis> = 3.322 ⋅ 183231, @c +<emphasis>prec</emphasis> = 3.322 ⋅ 183231, @end docbook or 608693. @@ -31936,7 +31893,7 @@ The API also provides major and minor version numbers, so that an extension can check if the @command{gawk} it is loaded with supports the facilities it was compiled with. (Version mismatches ``shouldn't'' happen, but we all know how @emph{that} goes.) -@DBXREF{Extension Versioning} for details. +@xref{Extension Versioning} for details. @end itemize @node Extension API Description @@ -33162,7 +33119,7 @@ indicates the type of value expected. @item awk_bool_t set_argument(size_t count, awk_array_t array); Convert a parameter that was undefined into an array; this provides call by reference for arrays. Return false if @code{count} is too big, -or if the argument's type is not undefined. @DBXREF{Array Manipulation} +or if the argument's type is not undefined. @xref{Array Manipulation} for more information on creating arrays. @end table @@ -33580,7 +33537,7 @@ The following functions relate to arrays as a whole: @table @code @item awk_array_t create_array(void); Create a new array to which elements may be added. -@DBXREF{Creating Arrays} for a discussion of how to +@xref{Creating Arrays} for a discussion of how to create a new array and add elements to it. @item awk_bool_t clear_array(awk_array_t a_cookie); @@ -34009,7 +33966,7 @@ $ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk} @end example @noindent -(@DBXREF{Finding Extensions} for more information on the +(@xref{Finding Extensions} for more information on the @env{AWKLIBPATH} environment variable.) @node Redirection API @@ -34313,7 +34270,7 @@ Compiled extensions have to be installed in a directory where built in the default fashion, the directory in which to find extensions is @file{/usr/local/lib/gawk}. You can also specify a search path with a list of directories to search for compiled extensions. -@DBXREF{AWKLIBPATH Variable} for more information. +@xref{AWKLIBPATH Variable} for more information. @node Extension Example @section Example: Some File Functions @@ -34892,7 +34849,7 @@ of the @file{gawkapi.h} header file, the following steps@footnote{In practice, you would probably want to use the GNU Autotools (Automake, Autoconf, Libtool, and @command{gettext}) to configure and build your libraries. Instructions for doing so are beyond -the scope of this @value{DOCUMENT}. @DBXREF{gawkextlib} for Internet links to +the scope of this @value{DOCUMENT}. @xref{gawkextlib} for Internet links to the tools.} create a GNU/Linux shared library: @example @@ -36149,7 +36106,7 @@ The ability to delete all of an array at once with @samp{delete @var{array}} @end itemize -@DBXREF{Common Extensions} for a list of common extensions +@xref{Common Extensions} for a list of common extensions not permitted by the POSIX standard. The 2008 POSIX standard can be found online at @@ -36194,7 +36151,7 @@ or array elements through it @end ignore @end itemize -@DBXREF{Common Extensions} for a full list of the extensions +@xref{Common Extensions} for a full list of the extensions available in his @command{awk}. @node POSIX/GNU @@ -37645,7 +37602,7 @@ This appendix provides instructions for installing @command{gawk} on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are contributed. -@DBXREF{Bugs} +@xref{Bugs} for the email addresses of the people who maintain the respective ports. @@ -37937,11 +37894,11 @@ Files needed for building @command{gawk} under MS-Windows @ifclear FOR_PRINT and OS/2 @end ifclear -(@DBPXREF{PC Installation} for details). +(@pxref{PC Installation} for details). @item vms/* Files needed for building @command{gawk} under Vax/VMS and OpenVMS -(@DBPXREF{VMS Installation} for details). +(@pxref{VMS Installation} for details). @item test/* A test suite for @@ -38181,7 +38138,7 @@ Autoconf will not work on your system in some other fashion. If you do have a problem, the @file{configure.ac} file is the input for Autoconf. You may be able to change this file and generate a new version of @command{configure} that works on your system -(@DBPXREF{Bugs} +(@pxref{Bugs} for information on how to report problems in configuring @command{gawk}). The same mechanism may be used to send in updates to @file{configure.ac} and/or @file{custom.h}. @@ -38656,7 +38613,7 @@ The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha and IA64 VMS 8.4 used HP C 7.3.@footnote{The IA64 architecture is also known as ``Itanium.''} -@DBXREF{VMS GNV} for information on building +@xref{VMS GNV} for information on building @command{gawk} as a PCSI kit that is compatible with the GNV product. @node VMS Dynamic Extensions @@ -39176,7 +39133,7 @@ directory named @file{awk}. This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely. -@DBXREF{Common Extensions} +@xref{Common Extensions} for a list of extensions in this @command{awk} that are not in POSIX @command{awk}. As a side note, Dan Bornstein has created a Git repository tracking @@ -39212,7 +39169,7 @@ Once you have it, is similar to @command{gawk}'s (@pxref{Unix Installation}). -@DBXREF{Common Extensions} +@xref{Common Extensions} for a list of extensions in @command{mawk} that are not in POSIX @command{awk}. @cindex Sumner, Andrew @@ -39440,7 +39397,7 @@ as well as any considerations you should bear in mind. @appendixsubsec Accessing The @command{gawk} Git Repository As @command{gawk} is Free Software, the source code is always available. -@DBREF{Gawk Distribution} describes how to get and build the formal, +@ref{Gawk Distribution} describes how to get and build the formal, released versions of @command{gawk}. @cindex @command{git} utility diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 8218dd63..14257c81 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -166,31 +166,6 @@ @end macro @end ifdocbook -@c hack for docbook, where comma shouldn't always follow an @ref{} -@ifdocbook -@macro DBREF{text} -@ref{\text\} -@end macro -@macro DBXREF{text} -@xref{\text\} -@end macro -@macro DBPXREF{text} -@pxref{\text\} -@end macro -@end ifdocbook - -@ifnotdocbook -@macro DBREF{text} -@ref{\text\}, -@end macro -@macro DBXREF{text} -@xref{\text\}, -@end macro -@macro DBPXREF{text} -@pxref{\text\}, -@end macro -@end ifnotdocbook - @ifclear FOR_PRINT @set FN file name @set FFN File name @@ -1194,7 +1169,7 @@ $\sim\! Cn^2$ @end ifnotdocbook @end ifnottex @docbook -<emphasis>∼ Cn<superscript>2</superscript></emphasis> @c +<emphasis>∼ Cn<superscript>2</superscript></emphasis> @end docbook performance, while theory predicted @@ -1207,7 +1182,7 @@ $\sim\! Cn\log n$ @end ifnotdocbook @end ifnottex @docbook -<emphasis>∼ Cn log n</emphasis> @c +<emphasis>∼ Cn log n</emphasis> @end docbook behavior. A few minutes poring over the @file{awkprof.out} profile pinpointed the problem to @@ -1477,7 +1452,7 @@ John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as @command{gawk} @value{PVERSION} 4.0 in 2011. -@DBXREF{Contributors} +@xref{Contributors} for a full list of those who have made important contributions to @command{gawk}. @node Names @@ -1861,7 +1836,7 @@ pressing the @kbd{d} key, and finally releasing both keys. For the sake of brevity, throughout this @value{DOCUMENT}, we refer to Brian Kernighan's version of @command{awk} as ``BWK @command{awk}.'' -(@DBXREF{Other Versions} for information on his and other versions.) +(@xref{Other Versions} for information on his and other versions.) @ifset FOR_PRINT @quotation NOTE @@ -2020,7 +1995,7 @@ and the major new additions are @ref{Arbitrary Precision Arithmetic}, and @ref{Dynamic Extensions}. This @value{DOCUMENT} will undoubtedly continue to evolve. If you -find an error in the @value{DOCUMENT}, please report it! @DBXREF{Bugs} +find an error in the @value{DOCUMENT}, please report it! @xref{Bugs} for information on submitting problem reports electronically. @ifset FOR_PRINT @@ -2216,7 +2191,7 @@ portable program it is today. It has been and continues to be a pleasure working with this team of fine people. Notable code and documentation contributions were made by -a number of people. @DBXREF{Contributors} for the full list. +a number of people. @xref{Contributors} for the full list. @ifset FOR_PRINT @cindex Oram, Andy @@ -2802,7 +2777,7 @@ The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is @emph{impossible} to embed a single quote inside single-quoted text. Refer back to -@DBREF{Comments} +@ref{Comments} for an example of what happens if you try. @item @@ -3230,9 +3205,9 @@ no actions run. After processing all the rules that match the line (and perhaps there are none), @command{awk} reads the next line. (However, -@DBPXREF{Next Statement} +@pxref{Next Statement} @ifdocbook -and @DBREF{Nextfile Statement}.) +and @ref{Nextfile Statement}.) @end ifdocbook @ifnotdocbook and also @pxref{Nextfile Statement}.) @@ -3503,7 +3478,7 @@ and array sorting. As we develop our presentation of the @command{awk} language, we will introduce most of the variables and many of the functions. They are described -systematically in @DBREF{Built-in Variables} and in +systematically in @ref{Built-in Variables} and in @ref{Built-in}. @node When @@ -4044,7 +4019,7 @@ in the left margin, and function call counts for each function. Operate in strict POSIX mode. This disables all @command{gawk} extensions (just like @option{--traditional}) and disables all extensions not allowed by POSIX. -@DBXREF{Common Extensions} for a summary of the extensions +@xref{Common Extensions} for a summary of the extensions in @command{gawk} that are disabled by this option. Also, the following additional @@ -5180,7 +5155,7 @@ with a backslash have special meaning in regexps. In a regexp, a backslash before any character that is not in the previous list and not listed in -@DBREF{GNU Regexp Operators} +@ref{GNU Regexp Operators} means that the next character should be taken literally, even if it would normally be a regexp operator. For example, @code{/a\+b/} matches the three characters @samp{a+b}. @@ -5279,7 +5254,7 @@ The escape sequences described @ifnotinfo earlier @end ifnotinfo -in @DBREF{Escape Sequences} +in @ref{Escape Sequences} are valid inside a regexp. They are introduced by a @samp{\} and are recognized and converted into corresponding real characters as the very first step in processing regexps. @@ -5514,7 +5489,7 @@ Within a bracket expression, a @dfn{range expression} consists of two characters separated by a hyphen. It matches any single character that sorts between the two characters, based upon the system's native character set. For example, @samp{[0-9]} is equivalent to @samp{[0123456789]}. -(See @DBREF{Ranges and Locales} for an explanation of how the POSIX +(See @ref{Ranges and Locales} for an explanation of how the POSIX standard and @command{gawk} have changed over time. This is mainly of historical interest.) @@ -6420,7 +6395,7 @@ The empty string @code{""} (a string without any characters) has a special meaning as the value of @code{RS}. It means that records are separated by one or more blank lines and nothing else. -@DBXREF{Multiple Line} for more details. +@xref{Multiple Line} for more details. If you change the value of @code{RS} in the middle of an @command{awk} run, the new value is used to delimit subsequent records, but the record @@ -6484,7 +6459,7 @@ $ @kbd{echo record 1 AAAA record 2 BBBB record 3 |} The square brackets delineate the contents of @code{RT}, letting you see the leading and trailing whitespace. The final value of @code{RT} is a newline. -@DBXREF{Simple Sed} for a more useful example +@xref{Simple Sed} for a more useful example of @code{RS} as a regexp and @code{RT}. If you set @code{RS} to a regular expression that allows optional @@ -6551,8 +6526,8 @@ character as a record separator. However, this is a special case: @cindex records, treating files as @cindex treating files, as single records -@DBXREF{Readfile Function} for an interesting way to read -whole files. If you are using @command{gawk}, see @DBREF{Extension Sample +@xref{Readfile Function} for an interesting way to read +whole files. If you are using @command{gawk}, see @ref{Extension Sample Readfile} for another option. @end sidebar @@ -6797,9 +6772,9 @@ else @noindent should print @samp{everything is normal}, because @code{NF+1} is certain -to be out of range. (@DBXREF{If Statement} +to be out of range. (@xref{If Statement} for more information about @command{awk}'s @code{if-else} statements. -@DBXREF{Typing and Comparison} +@xref{Typing and Comparison} for more information about the @samp{!=} operator.) It is important to note that making an assignment to an existing field @@ -7496,7 +7471,7 @@ else This information is useful when writing a function that needs to temporarily change @code{FS} or @code{FIELDWIDTHS}, read some records, and then restore the original settings -(@DBPXREF{Passwd Functions} +(@pxref{Passwd Functions} for an example of such a function). @node Splitting By Content @@ -7763,7 +7738,7 @@ $ @kbd{awk -f addrs.awk addresses} @dots{} @end example -@DBXREF{Labels Program} for a more realistic program dealing with +@xref{Labels Program} for a more realistic program dealing with address lists. The following list summarizes how records are split, based on the value of @ifinfo @@ -7852,7 +7827,7 @@ If @code{ERRNO} indicates that the I/O operation may be retried, and @code{PROCINFO["@var{input}", "RETRY"]} is set, then @code{getline} returns @minus{}2 instead of @minus{}1, and further calls to @code{getline} -may be attemped. @DBXREF{Retrying Input} for further information about +may be attemped. @xref{Retrying Input} for further information about this feature. In the following examples, @var{command} stands for a string value that @@ -8093,7 +8068,7 @@ One deficiency of this program is that it does not process nested @code{@@include} statements (i.e., @code{@@include} statements in included files) the way a true macro preprocessor would. -@DBXREF{Igawk Program} for a program +@xref{Igawk Program} for a program that does handle nested @code{@@include} statements. @node Getline/Pipe @@ -8509,7 +8484,7 @@ on a per-command or per-connection basis. the attempt to read from the underlying device may succeed in a later attempt. This is a limitation, and it also means that you cannot use this to multiplex input from -two or more sources. @DBXREF{Retrying Input} for a way to enable +two or more sources. @xref{Retrying Input} for a way to enable later I/O attempts to succeed. Assigning a timeout value prevents read operations from @@ -8573,7 +8548,7 @@ If either of the @option{--posix} or @option{--traditional} options is given, then @command{gawk} reverts to treating a directory on the command line as a fatal error. -@DBXREF{Extension Sample Readdir} for a way to treat directories +@xref{Extension Sample Readdir} for a way to treat directories as usable data from an @command{awk} program. @node Input Summary @@ -8686,7 +8661,7 @@ The @code{print} statement is not limited when computing @emph{which} values to print. However, with two exceptions, you cannot specify @emph{how} to print them---how many columns, whether to use exponential notation or not, and so on. -(For the exceptions, @DBPXREF{Output Separators} and +(For the exceptions, @pxref{Output Separators} and @ref{OFMT}.) For printing with specifications, you need the @code{printf} statement (@pxref{Printf}). @@ -9584,7 +9559,7 @@ close(report) The @code{close()} function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to it. -@DBXREF{Close Files And Pipes} +@xref{Close Files And Pipes} for more information. This example also illustrates the use of a variable to represent @@ -9615,9 +9590,9 @@ for a brief discussion. for a more complete discussion. @end ifnotdocbook @ifdocbook -@DBXREF{Getline/Coprocess} +@xref{Getline/Coprocess} for a brief discussion and -@DBREF{Two-way I/O} +@ref{Two-way I/O} for a more complete discussion. @end ifdocbook @end table @@ -9691,7 +9666,7 @@ The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. -@DBXREF{Shell Quoting} for a function that can help in generating +@xref{Shell Quoting} for a function that can help in generating command lines to be fed to the shell. @end sidebar @@ -10409,7 +10384,7 @@ you can use the @code{strtonum()} function to convert the data into a number. Most of the time, you will want to use octal or hexadecimal constants when working with the built-in bit-manipulation functions; -see @DBREF{Bitwise Functions} +see @ref{Bitwise Functions} for more information. Unlike in some early C implementations, @samp{8} and @samp{9} are not @@ -10613,7 +10588,7 @@ array parameters (@pxref{String Functions}). @cindex variables, initializing A few variables have special built-in meanings, such as @code{FS} (the field separator) and @code{NF} (the number of fields in the current input -record). @DBXREF{Built-in Variables} for a list of the predefined variables. +record). @xref{Built-in Variables} for a list of the predefined variables. These predefined variables can be used and assigned just like all other variables, but their values are also used or changed automatically by @command{awk}. All predefined variables' names are entirely uppercase. @@ -10654,7 +10629,7 @@ as in the following: the variable is set at the very beginning, even before the @code{BEGIN} rules execute. The @option{-v} option and its assignment must precede all the @value{FN} arguments, as well as the program text. -(@DBXREF{Options} for more information about +(@xref{Options} for more information about the @option{-v} option.) Otherwise, the variable assignment is performed at a time determined by its position among the input file arguments---after the processing of the @@ -10788,7 +10763,7 @@ specifies the output format to use when printing numbers with @code{print}. conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. -@DBXREF{Print} for more information on the @code{print} statement. +@xref{Print} for more information on the @code{print} statement. @end sidebar @node Locale influences conversions @@ -11289,10 +11264,10 @@ The indices of @code{bar} are practically guaranteed to be different, because @xref{Arrays}, and @ifnotdocbook -@DBPXREF{Numeric Functions} +@pxref{Numeric Functions} @end ifnotdocbook @ifdocbook -@DBREF{Numeric Functions} +@ref{Numeric Functions} @end ifdocbook for more information.) This example illustrates an important fact about assignment @@ -11416,7 +11391,6 @@ has the value four, but it changes the value of @code{foo} to five. In other words, the operator returns the old value of the variable, but with the side effect of incrementing it. -@c FIXME: Use @sup here for superscript The post-increment @samp{foo++} is nearly the same as writing @samp{(foo += 1) - 1}. It is not perfectly equivalent because all numbers in @command{awk} are floating point---in floating point, @samp{foo + 1 - 1} does @@ -11425,14 +11399,14 @@ long as you stick to numbers that are fairly small (less than @iftex @math{10^{12}}). @end iftex -@ifnottex -@ifnotdocbook +@ifinfo 10e12). -@end ifnotdocbook +@end ifinfo +@ifnottex +@ifnotinfo +10@sup{12}). +@end ifnotinfo @end ifnottex -@docbook -10<superscript>12</superscript>). @c -@end docbook @cindex @code{$} (dollar sign), incrementing fields and arrays @cindex dollar sign (@code{$}), incrementing fields and arrays @@ -12212,10 +12186,10 @@ example, the function @code{sqrt()} computes the square root of a number. @cindex functions, built-in A fixed set of functions are @dfn{built in}, which means they are available in every @command{awk} program. The @code{sqrt()} function is one -of these. @DBXREF{Built-in} for a list of built-in +of these. @xref{Built-in} for a list of built-in functions and their descriptions. In addition, you can define functions for use in your program. -@DBXREF{User-defined} +@xref{User-defined} for instructions on how to do this. Finally, @command{gawk} lets you write functions in C or C++ that may be called from your program (@pxref{Dynamic Extensions}). @@ -12258,7 +12232,7 @@ Some of the built-in functions have one or more optional arguments. If those arguments are not supplied, the functions use a reasonable default value. -@DBXREF{Built-in} for full details. If arguments +@xref{Built-in} for full details. If arguments are omitted in calls to user-defined functions, then those arguments are treated as local variables. Such local variables act like the empty string if referenced where a string value is required, @@ -12973,7 +12947,7 @@ The order in which library functions are named on the command line controls the order in which their @code{BEGIN} and @code{END} rules are executed. Therefore, you have to be careful when writing such rules in library files so that the order in which they are executed doesn't matter. -@DBXREF{Options} for more information on +@xref{Options} for more information on using library functions. @xref{Library Functions}, for a number of useful library functions. @@ -13037,12 +13011,12 @@ Finally, the @code{next} and @code{nextfile} statements are not allowed in a @code{BEGIN} rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements are not valid in an @code{END} rule, because all the input has been read. -(@DBXREF{Next Statement} and +(@xref{Next Statement} and @ifnotdocbook -@DBPXREF{Nextfile Statement}.) +@pxref{Nextfile Statement}.) @end ifnotdocbook @ifdocbook -@DBREF{Nextfile Statement}.) +@ref{Nextfile Statement}.) @end ifdocbook @node BEGINFILE/ENDFILE @@ -13614,7 +13588,7 @@ for (i in array) @end example @noindent -@DBXREF{Scanning an Array} +@xref{Scanning an Array} for more information on this version of the @code{for} loop. @node Switch Statement @@ -13999,7 +13973,7 @@ In such a case, if you don't want the @code{END} rule to do its job, set a variable to a nonzero value before the @code{exit} statement and check that variable in the @code{END} rule. -@DBXREF{Assert Function} +@xref{Assert Function} for an example that does this. @cindex dark corner, @code{exit} statement @@ -14010,7 +13984,7 @@ In the case where an argument is supplied to a first @code{exit} statement, and then @code{exit} is called a second time from an @code{END} rule with no argument, @command{awk} uses the previously supplied exit value. @value{DARKCORNER} -@DBXREF{Exit Status} for more information. +@xref{Exit Status} for more information. @cindex programming conventions, @code{exit} statement For example, suppose an error condition occurs that is difficult or @@ -14120,7 +14094,7 @@ A space-separated list of columns that tells @command{gawk} how to split input with fixed columnar boundaries. Assigning a value to @code{FIELDWIDTHS} overrides the use of @code{FS} and @code{FPAT} for field splitting. -@DBXREF{Constant Size} for more information. +@xref{Constant Size} for more information. @cindex @command{gawk}, @code{FPAT} variable in @cindex @code{FPAT} variable @@ -14132,7 +14106,7 @@ A regular expression (as a string) that tells @command{gawk} to create the fields based on text that matches the regular expression. Assigning a value to @code{FPAT} overrides the use of @code{FS} and @code{FIELDWIDTHS} for field splitting. -@DBXREF{Splitting By Content} for more information. +@xref{Splitting By Content} for more information. @cindex @code{FS} variable @cindex separators, field @@ -14347,7 +14321,7 @@ method of accessing command-line arguments. The value of @code{ARGV[0]} can vary from system to system. Also, you should note that the program text is @emph{not} included in @code{ARGV}, nor are any of @command{awk}'s command-line options. -@DBXREF{ARGC and ARGV} for information +@xref{ARGC and ARGV} for information about how @command{awk} uses these variables. @value{DARKCORNER} @@ -14399,9 +14373,9 @@ Some operating systems may not have environment variables. On such systems, the @code{ENVIRON} array is empty (except for @w{@code{ENVIRON["AWKPATH"]}} and @w{@code{ENVIRON["AWKLIBPATH"]}}; -@DBPXREF{AWKPATH Variable} and +@pxref{AWKPATH Variable} and @ifdocbook -@DBREF{AWKLIBPATH Variable}). +@ref{AWKLIBPATH Variable}). @end ifdocbook @ifnotdocbook @pxref{AWKLIBPATH Variable}). @@ -14629,20 +14603,20 @@ The following elements allow you to change @command{gawk}'s behavior: @table @code @item PROCINFO["NONFATAL"] If this element exists, then I/O errors for all output redirections become nonfatal. -@DBXREF{Nonfatal}. +@xref{Nonfatal}. @item PROCINFO["@var{output_name}", "NONFATAL"] Make output errors for @var{output_name} be nonfatal. -@DBXREF{Nonfatal}. +@xref{Nonfatal}. @item PROCINFO["@var{command}", "pty"] For two-way communication to @var{command}, use a pseudo-tty instead of setting up a two-way pipe. -@DBXREF{Two-way I/O} for more information. +@xref{Two-way I/O} for more information. @item PROCINFO["@var{input_name}", "READ_TIMEOUT"] Set a timeout for reading from input redirection @var{input_name}. -@DBXREF{Read Timeout} for more information. +@xref{Read Timeout} for more information. @item PROCINFO["sorted_in"] If this element exists in @code{PROCINFO}, its value controls the @@ -14772,7 +14746,7 @@ changed. @cindex arguments, command-line @cindex command line, arguments -@DBREF{Auto-set} +@ref{Auto-set} presented the following program describing the information contained in @code{ARGC} and @code{ARGV}: @@ -14842,12 +14816,12 @@ use the @code{delete} statement to remove elements from All of these actions are typically done in the @code{BEGIN} rule, before actual processing of the input begins. -@DBXREF{Split Program} and +@xref{Split Program} and @ifnotdocbook -@DBPXREF{Tee Program} +@pxref{Tee Program} @end ifnotdocbook @ifdocbook -@DBREF{Tee Program} +@ref{Tee Program} @end ifdocbook for examples of each way of removing elements from @code{ARGV}. @@ -14897,20 +14871,20 @@ gawk -f myprog.awk -q -v file1 file2 @dots{} @noindent Because @option{-q} is not a valid @command{gawk} option, it and the following @option{-v} are passed on to the @command{awk} program. -(@DBXREF{Getopt Function} for an @command{awk} library function that +(@xref{Getopt Function} for an @command{awk} library function that parses command-line options.) When designing your program, you should choose options that don't conflict with @command{gawk}'s, because it will process any options that it accepts before passing the rest of the command line on to your program. Using @samp{#!} with the @option{-E} option may help -(@DBPXREF{Executable Scripts} +(@pxref{Executable Scripts} and @ifnotdocbook -@DBPXREF{Options}). +@pxref{Options}). @end ifnotdocbook @ifdocbook -@DBREF{Options}). +@ref{Options}). @end ifdocbook @node Pattern Action Summary @@ -15517,7 +15491,7 @@ the word as the index. The second rule scans the elements of @code{used} to find all the distinct words that appear in the input. It prints each word that is more than 10 characters long and also prints the number of such words. -@DBXREF{String Functions} +@xref{String Functions} for more information on the built-in function @code{length()}. @example @@ -15540,7 +15514,7 @@ END @{ @end example @noindent -@DBXREF{Word Sorting} +@xref{Word Sorting} for a more detailed example of this type. @cindex arrays, elements, order of access by @code{in} operator @@ -16288,7 +16262,7 @@ for (i in a) @{ @end example @noindent -@DBXREF{Walking Arrays} for a user-defined function that ``walks'' an +@xref{Walking Arrays} for a user-defined function that ``walks'' an arbitrarily dimensioned array of arrays. Recall that a reference to an uninitialized array element yields a value @@ -16693,7 +16667,7 @@ together. The following description ignores the third argument, @var{how}, as it requires understanding features that we have not discussed yet. Thus, the discussion here is a deliberate simplification. (We do provide all -the details later on; see @DBREF{Array Sorting Functions} for the full story.) +the details later on; see @ref{Array Sorting Functions} for the full story.) @end quotation Both functions return the number of elements in the array @var{source}. @@ -16868,7 +16842,7 @@ contrast, @code{length(15 * 35)} works out to three. In this example, @end ifnotdocbook @end ifnottex @docbook -15 ⋅ 35 = 525, @c +15 ⋅ 35 = 525, @end docbook and 525 is then converted to the string @code{"525"}, which has three characters. @@ -16940,7 +16914,7 @@ at which that substring begins (one, if it starts at the beginning of The @var{regexp} argument may be either a regexp constant (@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@DBXREF{Computed Regexps} for a +@xref{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -17137,7 +17111,7 @@ Modern implementations of @command{awk}, including @command{gawk}, allow the third argument to be a regexp constant (@w{@code{/}@dots{}@code{/}}) as well as a string. @value{DARKCORNER} The POSIX standard allows this as well. -@DBXREF{Computed Regexps} for a +@xref{Computed Regexps} for a discussion of the difference between using a string constant or a regexp constant, and the implications for writing your program correctly. @@ -17188,7 +17162,7 @@ Using the @code{strtonum()} function is @emph{not} the same as adding zero to a string value; the automatic coercion of strings to numbers works only for decimal data, not for octal or hexadecimal.@footnote{Unless you use the @option{--non-decimal-data} option, which isn't recommended. -@DBXREF{Nondecimal Data} for more information.} +@xref{Nondecimal Data} for more information.} Note also that @code{strtonum()} uses the current locale's decimal point for recognizing numbers (@pxref{Locales}). @@ -17206,7 +17180,7 @@ Return the number of substitutions made (zero or one). The @var{regexp} argument may be either a regexp constant (@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@DBXREF{Computed Regexps} for a +@xref{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -17710,7 +17684,7 @@ Optional parameters are enclosed in square brackets ([ ]): Close the file @var{filename} for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess or pipe is closed. -@DBXREF{Close Files And Pipes} +@xref{Close Files And Pipes} for more information. When closing a coprocess, it is occasionally useful to first close @@ -17958,19 +17932,18 @@ All known POSIX-compliant systems support timestamps from 0 through @iftex @math{2^{31} - 1}, @end iftex -@ifnottex -@ifnotdocbook +@ifinfo 2^31 - 1, -@end ifnotdocbook +@end ifinfo +@ifnottex +@ifnotinfo +2@sup{31} @minus{} 1, +@end ifnotinfo @end ifnottex -@docbook -2<superscript>31</superscript> − 1, @c -@end docbook which is sufficient to represent times through 2038-01-19 03:14:07 UTC. Many systems support a wider range of timestamps, including negative timestamps that represent times before the epoch. -@c FIXME: Use @sup here for superscript @cindex @command{date} utility, GNU @cindex time, retrieving @@ -19933,7 +19906,7 @@ It contains the following chapters: @cindex functions, library @cindex functions, user-defined, library of -@DBREF{User-defined} describes how to write +@ref{User-defined} describes how to write your own @command{awk} functions. Writing functions is important, because it allows you to encapsulate algorithms and program tasks in a single place. It simplifies programming, making program development more @@ -19966,7 +19939,7 @@ use these functions. The functions are presented here in a progression from simple to complex. @cindex Texinfo -@DBREF{Extract Program} +@ref{Extract Program} presents a program that you can use to extract the source code for these example library functions and programs from the Texinfo source for this @value{DOCUMENT}. @@ -20118,7 +20091,7 @@ A different convention, common in the Tcl community, is to use a single associative array to hold the values needed by the library function(s), or ``package.'' This significantly decreases the number of actual global names in use. For example, the functions described in -@DBREF{Passwd Functions} +@ref{Passwd Functions} might have used array elements @code{@w{PW_data["inited"]}}, @code{@w{PW_data["total"]}}, @code{@w{PW_data["count"]}}, and @code{@w{PW_data["awklib"]}}, instead of @code{@w{_pw_inited}}, @code{@w{_pw_awklib}}, @code{@w{_pw_total}}, @@ -20677,7 +20650,7 @@ more difficult than they really need to be.} @cindex timestamps, formatted @cindex time, managing The @code{systime()} and @code{strftime()} functions described in -@DBREF{Time Functions} +@ref{Time Functions} provide the minimum functionality necessary for dealing with the time of day in human-readable form. Although @code{strftime()} is extensive, the control formats are not necessarily easy to remember or intuitively obvious when @@ -20763,7 +20736,7 @@ function getlocaltime(time, ret, now, i) The string indices are easier to use and read than the various formats required by @code{strftime()}. The @code{alarm} program presented in -@DBREF{Alarm Program} +@ref{Alarm Program} uses this function. A more general design for the @code{getlocaltime()} function would have allowed the user to supply an optional timestamp value to use instead @@ -20830,7 +20803,7 @@ will never match if the file has contents. @command{gawk} reads data from the file into @code{tmp}, attempting to match @code{RS}. The match fails after each read, but fails quickly, such that @command{gawk} fills @code{tmp} with the entire contents of the file. -(@DBXREF{Records} for information on @code{RT} and @code{RS}.) +(@xref{Records} for information on @code{RT} and @code{RS}.) In the case that @code{file} is empty, the return value is the null string. Thus, calling code may use something like: @@ -20844,7 +20817,7 @@ if (length(contents) == 0) This tests the result to see if it is empty or not. An equivalent test would be @samp{contents == ""}. -@DBXREF{Extension Sample Readfile} for an extension function that +@xref{Extension Sample Readfile} for an extension function that also reads an entire file into memory. @node Shell Quoting @@ -21043,7 +21016,7 @@ END @{ endfile(_filename_) @} @c endfile @end example -@DBREF{Wc Program} +@ref{Wc Program} shows how this library function can be used and how it simplifies writing the main program. @@ -21641,7 +21614,7 @@ Using @samp{#!} with the @option{-E} option may help avoid conflicts between your program's options and @command{gawk}'s options, as @option{-E} causes @command{gawk} to abandon processing of further options -(@DBPXREF{Executable Scripts} and +(@pxref{Executable Scripts} and @ifnotdocbook @pxref{Options}). @end ifnotdocbook @@ -21669,7 +21642,7 @@ However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This @value{SECTION} presents a suite of functions for retrieving information from the -user database. @DBXREF{Group Functions} +user database. @xref{Group Functions} for a similar suite that retrieves information from the group database. @cindex @code{getpwent()} function (C library) @@ -22003,7 +21976,7 @@ once. If you are worried about squeezing every last cycle out of your this is not necessary, as most @command{awk} programs are I/O-bound, and such a change would clutter up the code. -The @command{id} program in @DBREF{Id Program} +The @command{id} program in @ref{Id Program} uses these functions. @node Group Functions @@ -22021,7 +21994,7 @@ uses these functions. @cindex group file @cindex files, group Much of the discussion presented in -@DBREF{Passwd Functions} +@ref{Passwd Functions} applies to the group database as well. Although there has traditionally been a well-known file (@file{/etc/group}) in a well-known format, the POSIX standard only provides a set of C library routines @@ -22358,13 +22331,13 @@ Most of the work is in scanning the database and building the various associative arrays. The functions that the user calls are themselves very simple, relying on @command{awk}'s associative arrays to do work. -The @command{id} program in @DBREF{Id Program} +The @command{id} program in @ref{Id Program} uses these functions. @node Walking Arrays @section Traversing Arrays of Arrays -@DBREF{Arrays of Arrays} described how @command{gawk} +@ref{Arrays of Arrays} described how @command{gawk} provides arrays of arrays. In particular, any element of an array may be either a scalar or another array. The @code{isarray()} function (@pxref{Type Functions}) @@ -22577,7 +22550,7 @@ an intervening value in @code{ARGV} is a variable assignment. @ignore @c June 13 2015: Antonio points out that this is answered in the text. Ooops. @item -@DBREF{Walking Arrays} presented a function that walked a multidimensional +@ref{Walking Arrays} presented a function that walked a multidimensional array to print it out. However, walking an array and processing each element is a general-purpose operation. Generalize the @code{walk_array()} function by adding an additional parameter named @@ -24601,7 +24574,7 @@ of lines on the page @end ifnotdocbook @end ifnottex @docbook -(20 ⋅ 5 = 100). @c +(20 ⋅ 5 = 100). @end docbook Most of the work is done in the @code{printpage()} function. @@ -25980,7 +25953,7 @@ the separator can considerably simplify such tasks. @item The examples here demonstrate the usefulness of the library -functions from @DBREF{Library Functions} +functions from @ref{Library Functions} for a number of real (if small) programs. @item @@ -26311,7 +26284,7 @@ Often, though, it is desirable to be able to loop over the elements in a particular order that you, the programmer, choose. @command{gawk} lets you do this. -@DBREF{Controlling Scanning} describes how you can assign special, +@ref{Controlling Scanning} describes how you can assign special, predefined values to @code{PROCINFO["sorted_in"]} in order to control the order in which @command{gawk} traverses an array during a @code{for} loop. @@ -26336,7 +26309,7 @@ Here, @code{i1} and @code{i2} are the indices, and @code{v1} and @code{v2} are the corresponding values of the two elements being compared. Either @code{v1} or @code{v2}, or both, can be arrays if the array being traversed contains subarrays as values. -(@DBXREF{Arrays of Arrays} for more information about subarrays.) +(@xref{Arrays of Arrays} for more information about subarrays.) The three possible return values are interpreted as follows: @table @code @@ -27853,7 +27826,7 @@ BEGIN @{ @end enumerate -@DBXREF{I18N Example} +@xref{I18N Example} for an example program showing the steps to create and use translations from @command{awk}. @@ -27914,7 +27887,7 @@ second argument to @code{dcngettext()}.@footnote{The You should distribute the generated @file{.pot} file with your @command{awk} program; translators will eventually use it to provide you translations that you can also then distribute. -@DBXREF{I18N Example} +@xref{I18N Example} for the full list of steps to go through to create and test translations for @command{guide}. @@ -29825,31 +29798,16 @@ signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. @item Single-precision floating point (approximate) @tab @math{1.175494^{-38}} @tab @math{3.402823^{38}} @item Double-precision floating point (approximate) @tab @math{2.225074^{-308}} @tab @math{1.797693^{308}} @end iftex -@ifnottex -@ifnotdocbook +@ifinfo @item Single-precision floating point (approximate) @tab 1.175494e-38 @tab 3.402823e38 @item Double-precision floating point (approximate) @tab 2.225074e-308 @tab 1.797693e308 -@end ifnotdocbook +@end ifinfo +@ifnottex +@ifnotinfo +@item Single-precision floating point (approximate) @tab 1.175494@sup{-38} @tab 3.402823@sup{38} +@item Double-precision floating point (approximate) @tab 2.225074@sup{-308} @tab 1.797693@sup{308} +@end ifnotinfo @end ifnottex -@ifdocbook -@item Single-precision floating point (approximate) @tab -@c FIXME: Use @sup here for superscript -@docbook -1.175494<superscript>-38</superscript> -@end docbook -@tab -@docbook -3.402823<superscript>38</superscript> -@end docbook -@item Double-precision floating point (approximate) @tab -@docbook -2.225074<superscript>-308</superscript> -@end docbook -@tab -@docbook -1.797693<superscript>308</superscript> -@end docbook -@end ifdocbook @end multitable @end float @@ -29917,7 +29875,7 @@ formula: @end ifnotdocbook @end ifnottex @docbook -<emphasis>prec</emphasis> = 3.322 ⋅ <emphasis>dps</emphasis> @c +<emphasis>prec</emphasis> = 3.322 ⋅ <emphasis>dps</emphasis> @end docbook @end display @@ -30009,7 +29967,7 @@ Two predefined variables, @code{PREC} and @code{ROUNDMODE}, provide control over the working precision and the rounding mode. The precision and the rounding mode are set globally for every operation to follow. -@DBXREF{Setting precision} and @DBREF{Setting the rounding mode} +@xref{Setting precision} and @ref{Setting the rounding mode} for more information. @node FP Math Caution @@ -30443,17 +30401,16 @@ the following computes @iftex @math{5^{4^{3^{2}}}}, @end iftex -@ifnottex -@ifnotdocbook +@ifinfo 5^4^3^2, -@end ifnotdocbook +@end ifinfo +@ifnottex +@ifnotinfo +5@sup{4@sup{3@sup{2}}}, +@end ifnotinfo @end ifnottex -@docbook -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: -@c FIXME: Use @sup here for superscript @example $ @kbd{gawk -M 'BEGIN @{} @@ -30481,7 +30438,7 @@ would be 3.322 x 183231, @docbook <emphasis>prec</emphasis> = 3.322 ⋅ <emphasis>dps</emphasis>) would be -<emphasis>prec</emphasis> = 3.322 ⋅ 183231, @c +<emphasis>prec</emphasis> = 3.322 ⋅ 183231, @end docbook or 608693. @@ -31027,7 +30984,7 @@ The API also provides major and minor version numbers, so that an extension can check if the @command{gawk} it is loaded with supports the facilities it was compiled with. (Version mismatches ``shouldn't'' happen, but we all know how @emph{that} goes.) -@DBXREF{Extension Versioning} for details. +@xref{Extension Versioning} for details. @end itemize @node Extension API Description @@ -32253,7 +32210,7 @@ indicates the type of value expected. @item awk_bool_t set_argument(size_t count, awk_array_t array); Convert a parameter that was undefined into an array; this provides call by reference for arrays. Return false if @code{count} is too big, -or if the argument's type is not undefined. @DBXREF{Array Manipulation} +or if the argument's type is not undefined. @xref{Array Manipulation} for more information on creating arrays. @end table @@ -32671,7 +32628,7 @@ The following functions relate to arrays as a whole: @table @code @item awk_array_t create_array(void); Create a new array to which elements may be added. -@DBXREF{Creating Arrays} for a discussion of how to +@xref{Creating Arrays} for a discussion of how to create a new array and add elements to it. @item awk_bool_t clear_array(awk_array_t a_cookie); @@ -33100,7 +33057,7 @@ $ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk} @end example @noindent -(@DBXREF{Finding Extensions} for more information on the +(@xref{Finding Extensions} for more information on the @env{AWKLIBPATH} environment variable.) @node Redirection API @@ -33404,7 +33361,7 @@ Compiled extensions have to be installed in a directory where built in the default fashion, the directory in which to find extensions is @file{/usr/local/lib/gawk}. You can also specify a search path with a list of directories to search for compiled extensions. -@DBXREF{AWKLIBPATH Variable} for more information. +@xref{AWKLIBPATH Variable} for more information. @node Extension Example @section Example: Some File Functions @@ -33983,7 +33940,7 @@ of the @file{gawkapi.h} header file, the following steps@footnote{In practice, you would probably want to use the GNU Autotools (Automake, Autoconf, Libtool, and @command{gettext}) to configure and build your libraries. Instructions for doing so are beyond -the scope of this @value{DOCUMENT}. @DBXREF{gawkextlib} for Internet links to +the scope of this @value{DOCUMENT}. @xref{gawkextlib} for Internet links to the tools.} create a GNU/Linux shared library: @example @@ -35240,7 +35197,7 @@ The ability to delete all of an array at once with @samp{delete @var{array}} @end itemize -@DBXREF{Common Extensions} for a list of common extensions +@xref{Common Extensions} for a list of common extensions not permitted by the POSIX standard. The 2008 POSIX standard can be found online at @@ -35285,7 +35242,7 @@ or array elements through it @end ignore @end itemize -@DBXREF{Common Extensions} for a full list of the extensions +@xref{Common Extensions} for a full list of the extensions available in his @command{awk}. @node POSIX/GNU @@ -36736,7 +36693,7 @@ This appendix provides instructions for installing @command{gawk} on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are contributed. -@DBXREF{Bugs} +@xref{Bugs} for the email addresses of the people who maintain the respective ports. @@ -37028,11 +36985,11 @@ Files needed for building @command{gawk} under MS-Windows @ifclear FOR_PRINT and OS/2 @end ifclear -(@DBPXREF{PC Installation} for details). +(@pxref{PC Installation} for details). @item vms/* Files needed for building @command{gawk} under Vax/VMS and OpenVMS -(@DBPXREF{VMS Installation} for details). +(@pxref{VMS Installation} for details). @item test/* A test suite for @@ -37272,7 +37229,7 @@ Autoconf will not work on your system in some other fashion. If you do have a problem, the @file{configure.ac} file is the input for Autoconf. You may be able to change this file and generate a new version of @command{configure} that works on your system -(@DBPXREF{Bugs} +(@pxref{Bugs} for information on how to report problems in configuring @command{gawk}). The same mechanism may be used to send in updates to @file{configure.ac} and/or @file{custom.h}. @@ -37747,7 +37704,7 @@ The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha and IA64 VMS 8.4 used HP C 7.3.@footnote{The IA64 architecture is also known as ``Itanium.''} -@DBXREF{VMS GNV} for information on building +@xref{VMS GNV} for information on building @command{gawk} as a PCSI kit that is compatible with the GNV product. @node VMS Dynamic Extensions @@ -38267,7 +38224,7 @@ directory named @file{awk}. This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely. -@DBXREF{Common Extensions} +@xref{Common Extensions} for a list of extensions in this @command{awk} that are not in POSIX @command{awk}. As a side note, Dan Bornstein has created a Git repository tracking @@ -38303,7 +38260,7 @@ Once you have it, is similar to @command{gawk}'s (@pxref{Unix Installation}). -@DBXREF{Common Extensions} +@xref{Common Extensions} for a list of extensions in @command{mawk} that are not in POSIX @command{awk}. @cindex Sumner, Andrew @@ -38531,7 +38488,7 @@ as well as any considerations you should bear in mind. @appendixsubsec Accessing The @command{gawk} Git Repository As @command{gawk} is Free Software, the source code is always available. -@DBREF{Gawk Distribution} describes how to get and build the formal, +@ref{Gawk Distribution} describes how to get and build the formal, released versions of @command{gawk}. @cindex @command{git} utility diff --git a/doc/texinfo.tex b/doc/texinfo.tex index 6a81594b..ddda670e 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -3,11 +3,11 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2015-10-06.21} +\def\texinfoversion{2016-02-05.07} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 +% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 % Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or @@ -158,22 +158,10 @@ \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -% Since the category of space is not known, we have to be careful. -\chardef\spacecat = 10 -\def\spaceisspace{\catcode`\ =\spacecat} +% Give the space character the catcode for a space. +\def\spaceisspace{\catcode`\ =10\relax} -% sometimes characters are active, so we need control sequences. -\chardef\ampChar = `\& -\chardef\colonChar = `\: -\chardef\commaChar = `\, \chardef\dashChar = `\- -\chardef\dotChar = `\. -\chardef\exclamChar= `\! -\chardef\hashChar = `\# -\chardef\lquoteChar= `\` -\chardef\questChar = `\? -\chardef\rquoteChar= `\' -\chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ @@ -271,11 +259,18 @@ % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top -% of a page, or that at the bottom of a page. The solution is -% described on page 260 of The TeXbook. It involves outputting two -% marks for the sectioning macros, one before the section break, and -% one after. I won't pretend I can describe this better than DEK... -% +% of a page, or that at the bottom of a page. + +% \domark is called twice inside \chapmacro, to add one +% mark before the section break, and one after. +% In the second call \prevchapterdefs is the same as \lastchapterdefs, +% and \prevsectiondefs is the same as \lastsectiondefs. +% Then if the page is not broken at the mark, some of the previous +% section appears on the page, and we can get the name of this section +% from \firstmark for @everyheadingmarks top. +% @everyheadingmarks bottom uses \botmark. +% +% See page 260 of The TeXbook. \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% @@ -283,13 +278,14 @@ \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% - \the\toks0 \the\toks2 % 0: top marks (\last...) - \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...) + \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top + \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom \noexpand\else \the\toks8 % 2: color marks }% } -% \gettopheadingmarks, \getbottomheadingmarks - extract needed part of mark. +% \gettopheadingmarks, \getbottomheadingmarks, +% \getcolormarks - extract needed part of mark. % % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us @@ -345,28 +341,21 @@ % values in \headline and \footline. % % This is used to check if we are on the first page of a chapter. - \ifcase0\topmark\fi - \ifx\thischapter\empty - % See comment for \gettopheadingmarks - \ifcase0\firstmark\fi - \let\curchaptername\thischaptername - \ifcase1\firstmark\fi - \let\prevchaptername\thischaptername - \else - \let\curchaptername\thischaptername - \ifcase1\topmark\fi - \let\prevchaptername\thischaptername - \fi + \ifcase1\topmark\fi + \let\prevchaptername\thischaptername + \ifcase0\firstmark\fi + \let\curchaptername\thischaptername % \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi % \ifx\curchaptername\prevchaptername + \let\thischapterheading\thischapter \else - % If on the first page of a chapter, clear @thischapter so it - % doesn't appear in the headline, because the chapter is already - % shown in the chapter heading. - \def\thischapter{}% + % \thischapterheading is the same as \thischapter except it is blank + % for the first page of a chapter. This is to prevent the chapter name + % being shown twice. + \def\thischapterheading{}% \fi % \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% @@ -530,14 +519,13 @@ % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef - define a command taking an argument on the line +% % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} -% -% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my -% favourite TeX trick. --kasal, 16nov03 - \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } @@ -1107,6 +1095,7 @@ where each line of input produces a line of output.} \newtoks\toksC \newtoks\toksD \newbox\boxA +\newbox\boxB \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest @@ -1164,8 +1153,8 @@ output) for that.)} \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % - % k sets the color for filling (usual text, etc.); - % K sets the color for stroking (thin rules, e.g., normal _'s). + % rg sets the color for filling (usual text, etc.); + % RG sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, @@ -1416,7 +1405,6 @@ output) for that.)} \normalturnoffactive \def\@{@}% \let\/=\empty - \let\xprocessmacroarg=\eatspaces % in case we are in a macro expansion \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? @@ -1461,6 +1449,56 @@ output) for that.)} \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput +% +% @image support for XeTeX +% +\newif\ifxeteximgpdf +\ifx\XeTeXrevision\thisisundefined +\else + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\doxeteximage#1#2#3{% + \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % XeTeX (and the PDF format) support .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\xeteximgext=\empty + \xeteximgpdffalse + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errmessage{Could not find image file #1 for XeTeX}% + \else \gdef\xeteximgext{JPG}% + \fi + \else \gdef\xeteximgext{jpeg}% + \fi + \else \gdef\xeteximgext{jpg}% + \fi + \else \gdef\xeteximgext{png}% + \fi + \else \gdef\xeteximgext{PDF} \global\xeteximgpdftrue% + \fi + \else \gdef\xeteximgext{pdf} \global\xeteximgpdftrue% + \fi + \closein 1 + \endgroup + % + \ifxeteximgpdf + \XeTeXpdffile "#1".\xeteximgext "" + \else + \XeTeXpicfile "#1".\xeteximgext "" + \fi + \ifdim \wd0 >0pt width \xeteximagewidth \fi + \ifdim \wd2 >0pt height \xeteximageheight \fi \relax + } +\fi \message{fonts,} @@ -2452,8 +2490,8 @@ end % \catcode`@=11 \def\plainfrenchspacing{% - \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m - \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m + \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% @@ -2641,9 +2679,9 @@ end % Allow line breaks around only a few characters (only). \def\urefcatcodes{% - \catcode\ampChar=\active \catcode\dotChar=\active - \catcode\hashChar=\active \catcode\questChar=\active - \catcode\slashChar=\active + \catcode`\&=\active \catcode`\.=\active + \catcode`\#=\active \catcode`\?=\active + \catcode`\/=\active } { \urefcatcodes @@ -2852,23 +2890,24 @@ end \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% - \tex - \mathunderscore - \let\\ = \mathbackslash - \mathactive - % make the texinfo accent commands work in math mode - \let\"=\ddot - \let\'=\acute - \let\==\bar - \let\^=\hat - \let\`=\grave - \let\u=\breve - \let\v=\check - \let\~=\tilde - \let\dotaccent=\dot - % have to provide another name for sup operator - \let\mathopsup=\sup - $\finishmath + \ifmmode\else % only go into math if not in math mode already + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + % have to provide another name for sup operator + \let\mathopsup=\sup + $\expandafter\finishmath\fi } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. @@ -3517,7 +3556,7 @@ end \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager @@ -3528,8 +3567,8 @@ end \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} @@ -3540,7 +3579,7 @@ end \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } @@ -3548,8 +3587,8 @@ end \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chappager } @@ -4606,6 +4645,8 @@ end } % \commondummiesnofonts: common to \commondummies and \indexnofonts. +% Define \definedumyletter, \definedummyaccent and \definedummyword before +% using. % \def\commondummiesnofonts{% % Control letters and accents. @@ -4674,17 +4715,6 @@ end \definedummyword\verb \definedummyword\w \definedummyword\xref - % - % Consider: - % @macro mkind{arg1,arg2} - % @cindex \arg2\ - % @end macro - % @mkind{foo, bar} - % The space after the comma will end up in the temporary definition - % that we make for arg2 (see \parsemargdef ff.). We want all this to be - % expanded for the sake of the index, so we end up just seeing "bar". - \let\xeatspaces = \eatspaces - \let\xprocessmacroarg\eatspaces } % For testing: output @{ and @} in index sort strings as \{ and \}. @@ -4701,11 +4731,27 @@ end { \catcode`\<=13 \catcode`\-=13 +\catcode`\`=13 \gdef\indexnonalnumdisappear{% - \backslashdisappear - \def-{}% - \def<{}% - \def\@{}% + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else + % @set txiindexlquoteignore makes us ignore left quotes in the sort term. + % (Introduced for FSFS 2nd ed.) + \let`=\empty + \fi + % + \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else + \backslashdisappear + \fi + % + \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else + \def-{}% + \fi + \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else + \def<{}% + \fi + \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else + \def\@{}% + \fi } \gdef\indexnonalnumreappear{% @@ -4729,7 +4775,6 @@ end \def\definedummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. \let\definedummyword\definedummyaccent - % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command @@ -4742,13 +4787,10 @@ end \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % - % Unfortunately, texindex < 6.0 is not prepared to handle braces in the - % content at all, so these won't be sorted in ASCII order. - \def\lbracechar{{\indexlbrace}}% - \def\rbracechar{{\indexrbrace}}% - \let\{=\lbracechar - \let\}=\rbracechar - % + \uccode`\1=`\{ \uppercase{\def\{{1}}% + \uccode`\1=`\} \uppercase{\def\}{1}}% + \let\lbracechar\{% + \let\rbracechar\}% % % Non-English letters. \def\AA{AA}% @@ -4806,9 +4848,6 @@ end \def\result{=>}% \def\textdegree{o}% % - \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax - \else \indexlquoteignore \fi - % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up @@ -4822,10 +4861,6 @@ end \macrolist } -% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us -% ignore left quotes in the sort term. -{\catcode`\`=\active - \gdef\indexlquoteignore{\let`=\empty}} \let\SETmarginindex=\relax % put index entries in margin (undocumented)? @@ -4915,12 +4950,18 @@ end \indexdummies % Must do this here, since \bf, etc expand at this stage \useindexbackslash % \indexbackslash isn't defined now so it will be output % as is; and it will print as backslash. + % The braces around \indexbrace are recognized by texindex. + % % Get the string to sort by, by processing the index entry with all % font commands turned off. {\indexnofonts + \def\lbracechar{{\indexlbrace}}% + \def\rbracechar{{\indexrbrace}}% + \let\{=\lbracechar + \let\}=\rbracechar + \indexnonalnumdisappear \xdef\indexsortkey{}% \let\sortas=\indexwritesortas - \indexnonalnumdisappear \edef\temp{\the\toks0}% \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas \ifx\indexsortkey\empty @@ -5205,61 +5246,38 @@ end % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% - \def\entrybreak{\hfil\break}% + \def\entrybreak{\hfil\break}% An undocumented command % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus0.5pt % - % Badness calculation for paragraph affected by - - % How much \indexdotfill is stretched, or how much \parfillskip is shrunk - % Number of lines (\linepenalty) - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % Word spacing - no stretch - \spaceskip=\fontdimen2\font minus \fontdimen4\font - % - \linepenalty=1000 % Discourage line breaks. - \hyphenpenalty=5000 % Discourage hyphenation. - % - % Ragged right margin, but not for the last line with the leaders in it. - % When an index entry spans lines, this stretch competes with the stretch - % in \indexdotfill to determine how the line will be split. - \rightskip=\entryrightmargin - \advance\rightskip by 0pt plus .6\hsize - % - % \parfillskip is at the end of the line with the page number - \parfillskip=0pt - % Cancel the \rightskip stretch - \advance \parfillskip by 0pt plus -.6\hsize - % Determine how far we can stretch into the margin. - % This allows, e.g., "Appendix H GNU Free Documentation License" to fit - % on one line. - \advance \parfillskip by 0pt minus .6\entryrightmargin - % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% - % Save the text of the entry in a \vtop. - \global\setbox\entryindexbox=\vtop\bgroup + % Save the text of the entry + \global\setbox\boxA=\hbox\bgroup \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. + % Not absorbing as a macro argument reduces the chance of problems + % with catcodes occurring. } -\def\finishentry#1{% +{\catcode`\@=11 +\gdef\finishentry#1{% + \egroup % end box A + \dimen@ = \wd\boxA % Length of text of entry + \global\setbox\boxA=\hbox\bgroup\unhbox\boxA % #1 is the page number. % - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \setbox\boxA = \hbox{#1}% - \ifdim\wd\boxA = 0pt + % Get the width of the page numbers, and only use + % leaders if they are present. + \global\setbox\boxB = \hbox{#1}% + \ifdim\wd\boxB = 0pt \null\nobreak\hfill\ % \else % @@ -5267,38 +5285,106 @@ end % \ifpdf \pdfgettoks#1.% - \hskip\skip\thinshrinkable\the\toksA + \bgroup\let\domark\relax + \hskip\skip\thinshrinkable\the\toksA + \egroup + % The redefinion of \domark stops marks being added in \pdflink to + % preserve coloured links across page boundaries. Otherwise the marks + % would get in the way of \lastbox in \insertindexentrybox. \else \hskip\skip\thinshrinkable #1% \fi \fi - % Parameters for formatting this paragraph, reset for each paragraph. - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - \hangafter = 1 - \hangindent = 1em - \par - \egroup % The \vtop + \egroup % end \boxA + \ifdim\wd\boxB = 0pt + \global\setbox\entryindexbox=\vbox{\unhbox\boxA}% + \else + \global\setbox\entryindexbox=\vbox\bgroup + \prevdepth=\entrylinedepth + \noindent + % We want the text of the entries to be aligned to the left, and the + % page numbers to be aligned to the right. + % + \advance\leftskip by 0pt plus 1fil + \advance\leftskip by 0pt plus -1fill + \rightskip = 0pt plus -1fil + \advance\rightskip by 0pt plus 1fill + % Cause last line, which could consist of page numbers on their own + % if the list of page numbers is long, to be aligned to the right. + \parfillskip=0pt plus -1fill + % + \hangindent=1em + % + \advance\rightskip by \entryrightmargin + % Determine how far we can stretch into the margin. + % This allows, e.g., "Appendix H GNU Free Documentation License" to + % fit on one line in @letterpaper format. + \ifdim\entryrightmargin>2.1em + \dimen@i=2.1em + \else + \dimen@i=0em + \fi + \advance \parfillskip by 0pt minus 1\dimen@i + % + \dimen@ii = \hsize + \advance\dimen@ii by -1\leftskip + \advance\dimen@ii by -1\entryrightmargin + \advance\dimen@ii by 1\dimen@i + \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line + \ifdim\dimen@ > 0.8\dimen@ii % due to long index text + \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly + \dimen@ii = \hsize + \advance \dimen@ii by -1em + \ifnum\dimen@>\dimen@ii + % If the entry is too long, use the whole line + \dimen@ = \dimen@ii + \fi + \advance\leftskip by 0pt plus 1fill % ragged right + \advance \dimen@ by 1\rightskip + \parshape = 2 0pt \dimen@ 1em \dimen@ii + % Ideally we'd add a finite glue at the end of the first line only, but + % TeX doesn't seem to provide a way to do such a thing. + \fi\fi + \unhbox\boxA + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % Word spacing - no stretch + \spaceskip=\fontdimen2\font minus \fontdimen4\font + % + \linepenalty=1000 % Discourage line breaks. + \hyphenpenalty=5000 % Discourage hyphenation. + % + \par % format the paragraph + \egroup % The \vbox + \fi \endgroup % delay text of entry until after penalty \bgroup\aftergroup\insertindexentrybox \entryorphanpenalty -} +}} \newskip\thinshrinkable \skip\thinshrinkable=.15em minus .15em \newbox\entryindexbox \def\insertindexentrybox{% -\lineskip=.8ex plus .6ex % This comes into effect when the \vtop has a large - % depth due to the paragraph in it having several - % lines. -\box\entryindexbox} + \copy\entryindexbox + % The following gets the depth of the last box. This is for even + % line spacing when entries span several lines. + \setbox\dummybox\vbox{% + \unvbox\entryindexbox + \nointerlineskip + \lastbox + \global\entrylinedepth=\prevdepth + }% + % Note that we couldn't simply \unvbox\entryindexbox followed by + % \nointerlineskip\lastbox to remove the last box and then reinstate it, + % because this resets how far the box has been \moveleft'ed to 0. \unvbox + % doesn't affect \prevdepth either. +} +\newdimen\entrylinedepth % Default is no penalty \let\entryorphanpenalty\egroup @@ -5323,10 +5409,11 @@ end } % Like plain.tex's \dotfill, except uses up at least 1 em. -% Using a finite stretch encourages several words to appear on a second line -% if the entry is broken. +% The filll stretch here overpowers both the fil and fill stretch to push +% the page number to the right. \def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus .4\hsize} + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} + \def\primary #1{\line{#1\hfil}} @@ -5348,15 +5435,39 @@ end % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. -\catcode`\@=11 +\catcode`\@=11 % private names \newbox\partialpage \newdimen\doublecolumnhsize +\newdimen\doublecolumntopgap +\doublecolumntopgap = 0pt -\newtoks\savedtopmark % Used in \begindoublecolumns +% Use inside an output routine to save \topmark and \firstmark +\def\savemarks{% + \global\savedtopmark=\expandafter{\topmark }% + \global\savedfirstmark=\expandafter{\firstmark }% +} +\newtoks\savedtopmark \newtoks\savedfirstmark +% Set \topmark and \firstmark for next time \output runs. +% Can't be run from withinside \output (because any material +% added while an output routine is active, including +% penalties, is saved for after it finishes). The page so far +% should be empty, otherwise what's on it will be thrown away. +\def\restoremarks{% + \mark{\the\savedtopmark}% + \bgroup\output = {% + \setbox\dummybox=\box\PAGE + }abc\eject\egroup + % "abc" because output routine doesn't fire for a completely empty page. + \mark{\the\savedfirstmark}% +} + \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % If not much space left on page, start a new page. + \ifdim\pagetotal>0.8\vsize\vfill\eject\fi + % % Grab any single-column material above us. \output = {% % @@ -5376,22 +5487,15 @@ end \unvbox\PAGE \kern-\topskip \kern\baselineskip }% - % Save \topmark and \firstmark - \global\savedtopmark=\expandafter{\topmark}% - \global\savedfirstmark=\expandafter{\firstmark}% + \savemarks }% \eject % run that output routine to set \partialpage + \restoremarks % % We recover the two marks that the last output routine saved in order % to propagate the information in marks added around a chapter heading, % which could be otherwise be lost by the time the final page is output. % - \mark{\the\savedtopmark}% Only mark in page passed to following \output. - \output = {% - \setbox0=\box\PAGE % clear box 255 - }abc\eject - % - \mark{\the\savedfirstmark}% % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% @@ -5419,13 +5523,19 @@ end % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) + \global\doublecolumntopgap = \topskip + \global\advance\doublecolumntopgap by -1\baselineskip + \advance\vsize by -1\doublecolumntopgap \vsize = 2\vsize + \topskip=0pt + \global\entrylinedepth=0pt\relax } % The double-column output routine for all double-column pages except % the last, which is done by \balancecolumns. % \def\doublecolumnout{% + % \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the @@ -5448,10 +5558,13 @@ end % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize - \hbox to\pagewidth{\box0\hfil\box2}% + \vbox{% + \vskip\doublecolumntopgap + \hbox to\pagewidth{\box0\hfil\box2}}% } -% -% All done with double columns. + + +% Finished with with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the @@ -5482,21 +5595,21 @@ end \penalty0 % \output = {% - % Split the last of the double-column material. Leave it on the - % current page, no automatic page break. + % Split the last of the double-column material. + \savemarks \balancecolumns % - % If we end up splitting too much material for the current page, - % though, there will be another page break right after this \output - % invocation ends. Having called \balancecolumns once, we do not + % Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal - % definition right away. (We hope \balancecolumns will never be - % called on to balance too much material, but if it is, this makes - % the output somewhat more palatable.) + % definition right away. \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns + \restoremarks + % Leave the double-column material on the current page, no automatic + % page break. + \box\balancedcolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column @@ -5504,6 +5617,8 @@ end % \endgroup where \vsize got restored). \pagegoal = \vsize } +\newbox\balancedcolumns +\setbox\balancedcolumns=\vbox{shouldnt see this}% % % Only called for the last of the double column material. \doublecolumnout % does the others. @@ -5547,7 +5662,7 @@ end \fi \fi % - \pagesofar + \global\setbox\balancedcolumns=\vbox{\pagesofar}% } \catcode`\@ = \other @@ -5989,7 +6104,13 @@ end \def\Yomitfromtockeyword{Yomitfromtoc} % \def\chapmacro#1#2#3{% - \checkenv{}% chapters, etc., should not start inside an environment. + \expandafter\ifx\thisenv\titlepage\else + \checkenv{}% chapters, etc., should not start inside an environment. + \fi + % FIXME: \chapmacro is currently called from inside \titlepage when + % \setcontentsaftertitlepage to print the "Table of Contents" heading, but + % this should probably be done by \sectionheading with an option to print + % in chapter size. % % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs @@ -7564,9 +7685,7 @@ end % Argument is macro body with arguments substituted \def\scanmacro#1{% \newlinechar`\^^M - \let\xeatspaces\eatspaces - % Reduce doubled backslashes to one - \def\xprocessmacroarg{\passargtomacro\eatspaces}% + \def\xprocessmacroarg{\eatspaces}% % % Process the macro body under the current catcode regime. \scantokens{#1\texinfoc}\aftermacro% @@ -7582,6 +7701,7 @@ end % to allow macros to open or close groups themselves. } +% Used for copying and captions \def\scanexp#1{% \bgroup % Undo catcode changes of \startcontents and \printindex @@ -7686,6 +7806,7 @@ end % an argument to another Texinfo command. \def\macroargctxt{% \scanctxt + \catcode`\ =\active \catcode`\^^M=\other \catcode`\\=\active } @@ -8080,16 +8201,23 @@ end \egroup\noexpand\scanmacro{\macrobody}}% \else \ifnum\paramno<10\relax % at most 9 + % See non-recursive section below for comments \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\csname\the\macname @@\endcsname}% + \bgroup + \noexpand\expandafter + \noexpand\macroargctxt + \noexpand\expandafter + \expandafter\noexpand\csname\the\macname @@\endcsname}% \expandafter\xdef\csname\the\macname @@\endcsname##1{% - \expandafter\noexpand\csname\the\macname @@@\endcsname ##1,}% + \noexpand\passargtomacro + \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter - \csname\the\macname @@@\endcsname - \paramlist{\egroup\noexpand\scanmacro{\macrobody}}% + \csname\the\macname @@@@\endcsname\paramlist{% + \egroup\noexpand\scanmacro{\macrobody}}% \else % 10 or more \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% @@ -8119,19 +8247,27 @@ end }% \else % at most 9 \ifnum\paramno<10\relax + % @MACNAME sets the context for reading the macro argument + % @MACNAME@@ gets the argument, processes backslashes and appends a + % comma. + % @MACNAME@@@ removes braces surrounding the argument list. + % @MACNAME@@@@ scans the macro body with arguments substituted. \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \expandafter\noexpand\csname\the\macname @@\endcsname}% + \bgroup + \noexpand\expandafter % This \expandafter skip any spaces after the + \noexpand\macroargctxt % macro before we change the catcode of space. + \noexpand\expandafter + \expandafter\noexpand\csname\the\macname @@\endcsname}% \expandafter\xdef\csname\the\macname @@\endcsname##1{% - \expandafter\noexpand\csname\the\macname @@@\endcsname ##1,}% + \noexpand\passargtomacro + \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter - \csname\the\macname @@@\endcsname - \paramlist{% - \egroup - \noexpand\scanmacro{\macrobody}% - }% + \csname\the\macname @@@@\endcsname\paramlist{% + \egroup\noexpand\scanmacro{\macrobody}}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% @@ -8147,71 +8283,96 @@ end \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} -{\catcode`\@=0 \catcode`\\=13 -@catcode`@_=11 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape +@catcode`@_=11 % private names +@catcode`@!=11 % used as argument separator +% \passargtomacro#1#2 - % Call #1 with a list of tokens #2, with any doubled backslashes in #2 % compressed to one. +% +% This implementation works by expansion, and not execution (so we cannot use +% \def or similar). This reduces the risk of this failing in contexts where +% complete expansion is done with no execution (for example, in writing out to +% an auxiliary file for an index entry). +% +% State is kept in the input stream: the argument passed to +% @look_ahead, @gobble_and_check_finish and @add_segment is +% +% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) +% +% where: +% THE_MACRO - name of the macro we want to call +% ARG_RESULT - argument list we build to pass to that macro +% PENDING_BS - either a backslash or nothing +% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next + @gdef@passargtomacro#1#2{% - @def@the_macro{#1}% - @def@pending_backslash{}% - @def@finish{@finish}% - @def@arg_result{}% - @let@next_token=@relax - @add_segment#2\@finish\% -} - -% Input stream is just after a backslash. If the next token is not a -% backslash, process the rest of the argument; otherwise, remove the next -% token. -@gdef@look_ahead{% - @futurelet@next_token@look_aheadzzz} -@gdef@look_aheadzzz{% - @ifx@next_token\% - @let@next=@gobble_and_check_finish - @else - @let@next=@add_segment - @fi@next + @add_segment #1!{}@relax#2\@_finish\% } +@gdef@_finish{@_finishx} @global@let@_finishx@relax -% Double backslash found. Add a single backslash here. -@gdef@gobble_and_check_finish#1{% - @add_the_backslash - @def@pending_backslash{}% - @futurelet@next_token@add_segment +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 used to look ahead +% +% If the next token is not a backslash, process the rest of the argument; +% otherwise, remove the next token. +@gdef@look_ahead#1!#2#3#4{% + @ifx#4\% + @expandafter@gobble_and_check_finish + @else + @expandafter@add_segment + @fi#1!{#2}#4#4% } -% append a backslash to \arg_result -@gdef@add_the_backslash{% - @expandafter@gdef@expandafter@arg_result@expandafter{@arg_result\}% +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 should be a backslash, which is gobbled. +% #5 looks ahead +% +% Double backslash found. Add a single backslash, and look ahead. +@gdef@gobble_and_check_finish#1!#2#3#4#5{% + @add_segment#1\!{}#5#5% } +@gdef@is_fi{@fi} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 is input stream until next backslash +% % Input stream is either at the start of the argument, or just after a % backslash sequence, either a lone backslash, or a doubled backslash. -% \next_token contains the first token in the input stream: if it is \finish, -% finish; otherwise, append to \arg_result the segment of the argument up until -% the next backslash. \pending_backslash contains a backslash to represent +% NEXT_TOKEN contains the first token in the input stream: if it is \finish, +% finish; otherwise, append to ARG_RESULT the segment of the argument up until +% the next backslash. PENDING_BACKSLASH contains a backslash to represent % a backslash just before the start of the input stream that has not been -% added to \arg_result. -@gdef@add_segment#1\{% -@ifx@next_token@finish - @let@next=@call_the_macro% +% added to ARG_RESULT. +@gdef@add_segment#1!#2#3#4\{% +@ifx#3@_finish + @call_the_macro#1!% @else - @let@next=@look_ahead - % - % append to @arg_result - % token list registers might be better - @expandafter@expandafter@expandafter@gdef - @expandafter@expandafter@expandafter@arg_result - @expandafter@expandafter@expandafter{% - @expandafter@arg_result - @pending_backslash#1}% - @def@pending_backslash{\}% -@fi@next} + % append the pending backslash to the result, followed by the next segment + @expandafter@is_fi@look_ahead#1#2#4!{\}@fi + % this @fi is discarded by @look_ahead. + % we can't get rid of it with \expandafter because we don't know how + % long #4 is. +} -@gdef@call_the_macro{@expandafter@the_macro@expandafter{@arg_result}} +% #1 - THE_MACRO +% #2 - ARG_RESULT +% #3 discards the res of the conditional in @add_segment, and @is_fi ends the +% conditional. +@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} } +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \braceorline MAC is used for a one-argument macro MAC. It checks % whether the next non-whitespace character is a {. It sets the context @@ -8426,10 +8587,6 @@ end }% \setcolor{\linkcolor}% \fi - % - % Float references are printed completely differently: "Figure 1.2" - % instead of "[somenode], p.3". We distinguish them by the - % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. @@ -8438,6 +8595,10 @@ end \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". \iffloat distinguishes them by + % \Xthisreftitle being set to a magic string. \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". @@ -8496,12 +8657,15 @@ end % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% - \ifx,\tokenafterxref - \else\ifx.\tokenafterxref - \else\ifx;\tokenafterxref - \else\ifx)\tokenafterxref - \else,% add a , if xref not followed by punctuation - \fi\fi\fi\fi + % Add a , if xref followed by a space + \if\space\noexpand\tokenafterxref ,% + \else\ifx\ \tokenafterxref ,% @TAB + \else\ifx\*\tokenafterxref ,% @* + \else\ifx\ \tokenafterxref ,% @SPACE + \else\ifx\ + \tokenafterxref ,% @NL + \else\ifx\tie\tokenafterxref ,% @tie + \fi\fi\fi\fi\fi\fi \fi\fi \fi \endlink @@ -8946,6 +9110,7 @@ end \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names + \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro % If the image is by itself, center it. \ifvmode \imagevmodetrue @@ -8975,12 +9140,21 @@ end % % Output the image. \ifpdf + % For pdfTeX and LuaTeX <= 0.80 \dopdfimage{#1}{#2}{#3}% \else - % \epsfbox itself resets \epsf?size at each figure. - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi - \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - \epsfbox{#1.eps}% + \ifx\XeTeXrevision\thisisundefined + % For epsf.tex + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \else + % For XeTeX + \doxeteximage{#1}{#2}{#3}% + \fi \fi % \ifimagevmode @@ -9327,6 +9501,45 @@ directory should work if nowhere else does.} \global\righthyphenmin = #3\relax } +% Get input by bytes instead of by UTF-8 codepoints for XeTeX and LuaTeX, +% otherwise the encoding support is completely broken. +\ifx\XeTeXrevision\thisisundefined +\else +\XeTeXdefaultencoding "bytes" % For subsequent files to be read +\XeTeXinputencoding "bytes" % Effective in texinfo.tex only +% Unfortunately, there seems to be no corresponding XeTeX command for +% output encoding. This is a problem for auxiliary index and TOC files. +% The only solution would be perhaps to write out @U{...} sequences in +% place of UTF-8 characters. +\fi + +\ifx\luatexversion\thisisundefined +\else +\directlua{ +local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub +local function convert_char (char) + return utf8_char(byte(char)) +end + +local function convert_line (line) + return gsub(line, ".", convert_char) +end + +callback.register("process_input_buffer", convert_line) + +local function convert_line_out (line) + local line_out = "" + for c in string.utfvalues(line) do + line_out = line_out .. string.char(c) + end + return line_out +end + +callback.register("process_output_buffer", convert_line_out) +} +\fi + + % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % @@ -9349,7 +9562,16 @@ directory should work if nowhere else does.} % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % -\parseargdef\documentencoding{% +\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} +\def\documentencodingzzz#1{% + % Get input by bytes instead of by UTF-8 codepoints for XeTeX, + % otherwise the encoding support is completely broken. + % This settings is for the document root file. + \ifx\XeTeXrevision\thisisundefined + \else + \XeTeXinputencoding "bytes" + \fi + % % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % @@ -9726,7 +9948,7 @@ directory should work if nowhere else does.} \gdef\UTFviiiTmp{#2}% % \expandafter\ifx\csname uni:#1\endcsname \relax \else - \errmessage{Internal error, already defined: #1}% + \message{Internal error, already defined: #1}% \fi % % define an additional control sequence for this code point. @@ -9799,7 +10021,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} - + % \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B1}{\ensuremath\pm} \DeclareUnicodeCharacter{00B2}{$^2$} @@ -9816,7 +10038,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00BD}{$1\over2$} \DeclareUnicodeCharacter{00BE}{$3\over4$} \DeclareUnicodeCharacter{00BF}{\questiondown} - + % \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} @@ -9833,7 +10055,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} - + % \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} @@ -9850,7 +10072,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} - + % \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} @@ -9867,7 +10089,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} - + % \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} @@ -9884,7 +10106,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} - + % \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} @@ -9901,7 +10123,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{010F}{d'} - + % \DeclareUnicodeCharacter{0110}{\DH} \DeclareUnicodeCharacter{0111}{\dh} \DeclareUnicodeCharacter{0112}{\=E} @@ -9918,7 +10140,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} - + % \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0122}{\cedilla{G}} @@ -9935,7 +10157,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{012E}{\ogonek{I}} \DeclareUnicodeCharacter{012F}{\ogonek{i}} - + % \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} @@ -9952,7 +10174,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{013D}{L'}% should kern \DeclareUnicodeCharacter{013E}{l'}% should kern \DeclareUnicodeCharacter{013F}{L\U{00B7}} - + % \DeclareUnicodeCharacter{0140}{l\U{00B7}} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} @@ -9969,7 +10191,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} - + % \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} @@ -9986,7 +10208,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} - + % \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{T}} @@ -10003,7 +10225,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} - + % \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0172}{\ogonek{U}} @@ -10020,7 +10242,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}} - + % \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} @@ -10033,20 +10255,20 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} - + % \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} - + % \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} - + % \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} @@ -10059,23 +10281,100 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} - + % \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} - + % \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} - + % \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} - + % \DeclareUnicodeCharacter{02DB}{\ogonek{ }} - + % + % Greek letters upper case + \DeclareUnicodeCharacter{0391}{{\it A}} + \DeclareUnicodeCharacter{0392}{{\it B}} + \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}} + \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}} + \DeclareUnicodeCharacter{0395}{{\it E}} + \DeclareUnicodeCharacter{0396}{{\it Z}} + \DeclareUnicodeCharacter{0397}{{\it H}} + \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}} + \DeclareUnicodeCharacter{0399}{{\it I}} + \DeclareUnicodeCharacter{039A}{{\it K}} + \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}} + \DeclareUnicodeCharacter{039C}{{\it M}} + \DeclareUnicodeCharacter{039D}{{\it N}} + \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}} + \DeclareUnicodeCharacter{039F}{{\it O}} + \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}} + \DeclareUnicodeCharacter{03A1}{{\it P}} + %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma + \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}} + \DeclareUnicodeCharacter{03A4}{{\it T}} + \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}} + \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}} + \DeclareUnicodeCharacter{03A7}{{\it X}} + \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}} + \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}} + % + % Vowels with accents + \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}} + \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}} + \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}} + \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}} + \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}} + \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}} + % + % Standalone accent + \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}} + % + % Greek letters lower case + \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha} + \DeclareUnicodeCharacter{03B2}{\ensuremath\beta} + \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma} + \DeclareUnicodeCharacter{03B4}{\ensuremath\delta} + \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon} + \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta} + \DeclareUnicodeCharacter{03B7}{\ensuremath\eta} + \DeclareUnicodeCharacter{03B8}{\ensuremath\theta} + \DeclareUnicodeCharacter{03B9}{\ensuremath\iota} + \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa} + \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda} + \DeclareUnicodeCharacter{03BC}{\ensuremath\mu} + \DeclareUnicodeCharacter{03BD}{\ensuremath\nu} + \DeclareUnicodeCharacter{03BE}{\ensuremath\xi} + \DeclareUnicodeCharacter{03BF}{{\it o}} % omicron + \DeclareUnicodeCharacter{03C0}{\ensuremath\pi} + \DeclareUnicodeCharacter{03C1}{\ensuremath\rho} + \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma} + \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma} + \DeclareUnicodeCharacter{03C4}{\ensuremath\tau} + \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon} + \DeclareUnicodeCharacter{03C6}{\ensuremath\phi} + \DeclareUnicodeCharacter{03C7}{\ensuremath\chi} + \DeclareUnicodeCharacter{03C8}{\ensuremath\psi} + \DeclareUnicodeCharacter{03C9}{\ensuremath\omega} + % + % More Greek vowels with accents + \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}} + \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}} + \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}} + \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}} + \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}} + % + % Variant Greek letters + \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta} + \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi} + \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho} + % \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} @@ -10088,10 +10387,10 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} - + % \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} - + % \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} @@ -10100,7 +10399,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} - + % \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} @@ -10113,7 +10412,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} - + % \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} @@ -10124,7 +10423,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} - + % \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} @@ -10135,7 +10434,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} - + % \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} @@ -10146,12 +10445,12 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} - + % \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} - + % \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} @@ -10168,7 +10467,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} - + % \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} @@ -10179,30 +10478,31 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} - + % \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} - + % \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} - + % \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} - + % \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} - + % \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} - + % \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} - + % + % Punctuation \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} @@ -10214,18 +10514,166 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{2020}{\ensuremath\dagger} \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger} \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{202F}{\thinspace} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} + % \DeclareUnicodeCharacter{20AC}{\euro} - + % \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} - + % + % Mathematical symbols + \DeclareUnicodeCharacter{2200}{\ensuremath\forall} + \DeclareUnicodeCharacter{2203}{\ensuremath\exists} + \DeclareUnicodeCharacter{2208}{\ensuremath\in} \DeclareUnicodeCharacter{2212}{\minus} - \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2217}{\ast} + \DeclareUnicodeCharacter{221E}{\ensuremath\infty} \DeclareUnicodeCharacter{2225}{\ensuremath\parallel} + \DeclareUnicodeCharacter{2227}{\ensuremath\wedge} + \DeclareUnicodeCharacter{2229}{\ensuremath\cap} \DeclareUnicodeCharacter{2261}{\equiv} + \DeclareUnicodeCharacter{2264}{\ensuremath\leq} + \DeclareUnicodeCharacter{2265}{\ensuremath\geq} + \DeclareUnicodeCharacter{2282}{\ensuremath\subset} + \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq} + % + \DeclareUnicodeCharacter{2016}{\ensuremath\Vert} + \DeclareUnicodeCharacter{2032}{\ensuremath\prime} + \DeclareUnicodeCharacter{210F}{\ensuremath\hbar} + \DeclareUnicodeCharacter{2111}{\ensuremath\Im} + \DeclareUnicodeCharacter{2113}{\ensuremath\ell} + \DeclareUnicodeCharacter{2118}{\ensuremath\wp} + \DeclareUnicodeCharacter{211C}{\ensuremath\Re} + \DeclareUnicodeCharacter{2127}{\ensuremath\mho} + \DeclareUnicodeCharacter{2135}{\ensuremath\aleph} + \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow} + \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow} + \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow} + \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow} + \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow} + \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow} + \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow} + \DeclareUnicodeCharacter{2198}{\ensuremath\searrow} + \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow} + \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto} + \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow} + \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow} + \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup} + \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown} + \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright} + \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup} + \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown} + \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons} + \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow} + \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow} + \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow} + \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow} + \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow} + \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto} + \DeclareUnicodeCharacter{2201}{\ensuremath\complement} + \DeclareUnicodeCharacter{2202}{\ensuremath\partial} + \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset} + \DeclareUnicodeCharacter{2207}{\ensuremath\nabla} + \DeclareUnicodeCharacter{2209}{\ensuremath\notin} + \DeclareUnicodeCharacter{220B}{\ensuremath\owns} + \DeclareUnicodeCharacter{220F}{\ensuremath\prod} + \DeclareUnicodeCharacter{2210}{\ensuremath\coprod} + \DeclareUnicodeCharacter{2211}{\ensuremath\sum} + \DeclareUnicodeCharacter{2213}{\ensuremath\mp} + \DeclareUnicodeCharacter{2218}{\ensuremath\circ} + \DeclareUnicodeCharacter{221A}{\ensuremath\surd} + \DeclareUnicodeCharacter{221D}{\ensuremath\propto} + \DeclareUnicodeCharacter{2220}{\ensuremath\angle} + \DeclareUnicodeCharacter{2223}{\ensuremath\mid} + \DeclareUnicodeCharacter{2228}{\ensuremath\vee} + \DeclareUnicodeCharacter{222A}{\ensuremath\cup} + \DeclareUnicodeCharacter{222B}{\ensuremath\smallint} + \DeclareUnicodeCharacter{222E}{\ensuremath\oint} + \DeclareUnicodeCharacter{223C}{\ensuremath\sim} + \DeclareUnicodeCharacter{2240}{\ensuremath\wr} + \DeclareUnicodeCharacter{2243}{\ensuremath\simeq} + \DeclareUnicodeCharacter{2245}{\ensuremath\cong} + \DeclareUnicodeCharacter{2248}{\ensuremath\approx} + \DeclareUnicodeCharacter{224D}{\ensuremath\asymp} + \DeclareUnicodeCharacter{2250}{\ensuremath\doteq} + \DeclareUnicodeCharacter{2260}{\ensuremath\neq} + \DeclareUnicodeCharacter{226A}{\ensuremath\ll} + \DeclareUnicodeCharacter{226B}{\ensuremath\gg} + \DeclareUnicodeCharacter{227A}{\ensuremath\prec} + \DeclareUnicodeCharacter{227B}{\ensuremath\succ} + \DeclareUnicodeCharacter{2283}{\ensuremath\supset} + \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq} + \DeclareUnicodeCharacter{228E}{\ensuremath\uplus} + \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset} + \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset} + \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq} + \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq} + \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap} + \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup} + \DeclareUnicodeCharacter{2295}{\ensuremath\oplus} + \DeclareUnicodeCharacter{2296}{\ensuremath\ominus} + \DeclareUnicodeCharacter{2297}{\ensuremath\otimes} + \DeclareUnicodeCharacter{2298}{\ensuremath\oslash} + \DeclareUnicodeCharacter{2299}{\ensuremath\odot} + \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash} + \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv} + \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop} + \DeclareUnicodeCharacter{22A5}{\ensuremath\bot} + \DeclareUnicodeCharacter{22A8}{\ensuremath\models} + \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd} + \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd} + \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge} + \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee} + \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap} + \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup} + \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond} + \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot} + \DeclareUnicodeCharacter{22C6}{\ensuremath\star} + \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie} + \DeclareUnicodeCharacter{2308}{\ensuremath\lceil} + \DeclareUnicodeCharacter{2309}{\ensuremath\rceil} + \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor} + \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor} + \DeclareUnicodeCharacter{2322}{\ensuremath\frown} + \DeclareUnicodeCharacter{2323}{\ensuremath\smile} + % + \DeclareUnicodeCharacter{25A1}{\ensuremath\Box} + \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle} + \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright} + \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown} + \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft} + \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond} + \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit} + \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit} + \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit} + \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit} + \DeclareUnicodeCharacter{266D}{\ensuremath\flat} + \DeclareUnicodeCharacter{266E}{\ensuremath\natural} + \DeclareUnicodeCharacter{266F}{\ensuremath\sharp} + \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc} + \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle} + \DeclareUnicodeCharacter{27C2}{\ensuremath\perp} + \DeclareUnicodeCharacter{27E8}{\ensuremath\langle} + \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow} + \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow} + \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow} + \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto} + \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus} + \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot} + \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus} + \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes} + \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus} + \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup} + \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join} + \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg} + \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq} + \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq} + % + \global\mathchardef\checkmark="1370 % actually the square root sign + \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark} }% end of \utfeightchardefs % US-ASCII character definitions. @@ -10543,11 +10991,12 @@ directory should work if nowhere else does.} % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} -% Turn off all special characters except @ -% (and those which the user can use as if they were ordinary). +% Set catcodes for Texinfo file + +% Active characters for printing the wanted glyph. % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. - +% \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote @@ -10557,12 +11006,10 @@ directory should work if nowhere else does.} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} -\let\realunder=_ -% Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } +\let\realunder=_ -\catcode`\|=\active -\def|{{\tt\char124}} +\catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless @@ -10677,9 +11124,20 @@ directory should work if nowhere else does.} {@catcode`@^=7 @catcode`@^^M=13% @gdef@eatinput input texinfo#1^^M{@fixbackslash}} +% Emergency active definition of newline, in case an active newline token +% appears by mistake. +{@catcode`@^=7 @catcode13=13% +@gdef@enableemergencynewline{% + @gdef^^M{% + @par% + %<warning: active newline>@par% +}}} + + @gdef@fixbackslash{% @ifx\@eatinput @let\ = @ttbackslash @fi @catcode13=5 % regular end of line + @enableemergencynewline @let@c=@texinfoc % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. |