diff options
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/gawk.info | 172 | ||||
-rw-r--r-- | doc/gawk.texi | 22 | ||||
-rw-r--r-- | doc/gawktexi.in | 22 |
4 files changed, 138 insertions, 83 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 56b2d7f2..f0c7523b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in: Minor fixes from Antonio Colombo and new exercise + in chapter 16. + 2015-03-17 Andrew J. Schorr <aschorr@telemetry-investments.com> * gawktexi.in: Modify inplace.awk to call inplace_end in BEGINFILE diff --git a/doc/gawk.info b/doc/gawk.info index 95788ec2..f0318e20 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -26404,12 +26404,26 @@ File: gawk.info, Node: Extension Exercises, Prev: Extension summary, Up: Dyna `chmod()', and `umask()' to the file operations extension presented in *note Internal File Ops::. - 2. (Hard.) How would you provide namespaces in `gawk', so that the + 2. Write an input parser that prints a prompt if the input is a from + a "terminal" device. You can use the `isatty()' function to tell + if the input file is a terminal. (Hint: this function is usually + expensive to call; try to call it just once.) The content of the + prompt should come from a variable settable by `awk'-level code. + You can write the prompt to stanard error. However, for best + results, open a new file descriptor (or file pointer) on + `/dev/tty' and print the prompt there, in case standard error has + been redirected. + + Why is standard error a better choice than standard output for + writing the prompt? Which reading mechanism should you replace, + the one to get a record, or the one to read raw bytes? + + 3. (Hard.) How would you provide namespaces in `gawk', so that the names of functions in different extensions don't conflict with each other? If you come up with a really good scheme, contact the `gawk' maintainer to tell him about it. - 3. Write a wrapper script that provides an interface similar to `sed + 4. Write a wrapper script that provides an interface similar to `sed -i' for the "inplace" extension presented in *note Extension Sample Inplace::. @@ -33784,7 +33798,7 @@ Index * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) * metacharacters, escape sequences for: Escape Sequences. (line 139) -* minimum precision supported by MPFR library: Auto-set. (line 247) +* minimum precision required by MPFR library: Auto-set. (line 247) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 104) @@ -34124,7 +34138,7 @@ Index * printing, unduplicated lines of text: Uniq Program. (line 6) * printing, user information: Id Program. (line 6) * private variables: Library Names. (line 11) -* process group idIDof gawk process: Auto-set. (line 206) +* process group ID of gawk process: Auto-set. (line 206) * process ID of gawk process: Auto-set. (line 209) * processes, two-way communications with: Two-way I/O. (line 6) * processing data: Basic High Level. (line 6) @@ -35348,80 +35362,80 @@ Node: Extension Sample API Tests1056166 Node: gawkextlib1056657 Node: Extension summary1059335 Node: Extension Exercises1063024 -Node: Language History1063746 -Node: V7/SVR3.11065402 -Node: SVR41067555 -Node: POSIX1068989 -Node: BTL1070370 -Node: POSIX/GNU1071101 -Node: Feature History1076937 -Node: Common Extensions1090731 -Node: Ranges and Locales1092103 -Ref: Ranges and Locales-Footnote-11096722 -Ref: Ranges and Locales-Footnote-21096749 -Ref: Ranges and Locales-Footnote-31096984 -Node: Contributors1097205 -Node: History summary1102745 -Node: Installation1104124 -Node: Gawk Distribution1105070 -Node: Getting1105554 -Node: Extracting1106377 -Node: Distribution contents1108014 -Node: Unix Installation1114116 -Node: Quick Installation1114799 -Node: Shell Startup Files1117210 -Node: Additional Configuration Options1118289 -Node: Configuration Philosophy1120093 -Node: Non-Unix Installation1122462 -Node: PC Installation1122920 -Node: PC Binary Installation1124240 -Node: PC Compiling1126088 -Ref: PC Compiling-Footnote-11129109 -Node: PC Testing1129218 -Node: PC Using1130394 -Node: Cygwin1134509 -Node: MSYS1135279 -Node: VMS Installation1135780 -Node: VMS Compilation1136572 -Ref: VMS Compilation-Footnote-11137801 -Node: VMS Dynamic Extensions1137859 -Node: VMS Installation Details1139543 -Node: VMS Running1141794 -Node: VMS GNV1144634 -Node: VMS Old Gawk1145369 -Node: Bugs1145839 -Node: Other Versions1149728 -Node: Installation summary1156162 -Node: Notes1157221 -Node: Compatibility Mode1158086 -Node: Additions1158868 -Node: Accessing The Source1159793 -Node: Adding Code1161228 -Node: New Ports1167385 -Node: Derived Files1171867 -Ref: Derived Files-Footnote-11177342 -Ref: Derived Files-Footnote-21177376 -Ref: Derived Files-Footnote-31177972 -Node: Future Extensions1178086 -Node: Implementation Limitations1178692 -Node: Extension Design1179940 -Node: Old Extension Problems1181094 -Ref: Old Extension Problems-Footnote-11182611 -Node: Extension New Mechanism Goals1182668 -Ref: Extension New Mechanism Goals-Footnote-11186028 -Node: Extension Other Design Decisions1186217 -Node: Extension Future Growth1188325 -Node: Old Extension Mechanism1189161 -Node: Notes summary1190923 -Node: Basic Concepts1192109 -Node: Basic High Level1192790 -Ref: figure-general-flow1193062 -Ref: figure-process-flow1193661 -Ref: Basic High Level-Footnote-11196890 -Node: Basic Data Typing1197075 -Node: Glossary1200403 -Node: Copying1232332 -Node: GNU Free Documentation License1269888 -Node: Index1295024 +Node: Language History1064520 +Node: V7/SVR3.11066176 +Node: SVR41068329 +Node: POSIX1069763 +Node: BTL1071144 +Node: POSIX/GNU1071875 +Node: Feature History1077711 +Node: Common Extensions1091505 +Node: Ranges and Locales1092877 +Ref: Ranges and Locales-Footnote-11097496 +Ref: Ranges and Locales-Footnote-21097523 +Ref: Ranges and Locales-Footnote-31097758 +Node: Contributors1097979 +Node: History summary1103519 +Node: Installation1104898 +Node: Gawk Distribution1105844 +Node: Getting1106328 +Node: Extracting1107151 +Node: Distribution contents1108788 +Node: Unix Installation1114890 +Node: Quick Installation1115573 +Node: Shell Startup Files1117984 +Node: Additional Configuration Options1119063 +Node: Configuration Philosophy1120867 +Node: Non-Unix Installation1123236 +Node: PC Installation1123694 +Node: PC Binary Installation1125014 +Node: PC Compiling1126862 +Ref: PC Compiling-Footnote-11129883 +Node: PC Testing1129992 +Node: PC Using1131168 +Node: Cygwin1135283 +Node: MSYS1136053 +Node: VMS Installation1136554 +Node: VMS Compilation1137346 +Ref: VMS Compilation-Footnote-11138575 +Node: VMS Dynamic Extensions1138633 +Node: VMS Installation Details1140317 +Node: VMS Running1142568 +Node: VMS GNV1145408 +Node: VMS Old Gawk1146143 +Node: Bugs1146613 +Node: Other Versions1150502 +Node: Installation summary1156936 +Node: Notes1157995 +Node: Compatibility Mode1158860 +Node: Additions1159642 +Node: Accessing The Source1160567 +Node: Adding Code1162002 +Node: New Ports1168159 +Node: Derived Files1172641 +Ref: Derived Files-Footnote-11178116 +Ref: Derived Files-Footnote-21178150 +Ref: Derived Files-Footnote-31178746 +Node: Future Extensions1178860 +Node: Implementation Limitations1179466 +Node: Extension Design1180714 +Node: Old Extension Problems1181868 +Ref: Old Extension Problems-Footnote-11183385 +Node: Extension New Mechanism Goals1183442 +Ref: Extension New Mechanism Goals-Footnote-11186802 +Node: Extension Other Design Decisions1186991 +Node: Extension Future Growth1189099 +Node: Old Extension Mechanism1189935 +Node: Notes summary1191697 +Node: Basic Concepts1192883 +Node: Basic High Level1193564 +Ref: figure-general-flow1193836 +Ref: figure-process-flow1194435 +Ref: Basic High Level-Footnote-11197664 +Node: Basic Data Typing1197849 +Node: Glossary1201177 +Node: Copying1233106 +Node: GNU Free Documentation License1270662 +Node: Index1295798 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 68d35876..ff730b21 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -15093,7 +15093,7 @@ while the program runs. The value of the @code{getgid()} system call. @item PROCINFO["pgrpid"] -@cindex process group idIDof @command{gawk} process +@cindex process group ID of @command{gawk} process The process group ID of the current process. @item PROCINFO["pid"] @@ -15145,7 +15145,7 @@ The version of the GNU MP library. The maximum precision supported by MPFR. @item PROCINFO["prec_min"] -@cindex minimum precision supported by MPFR library +@cindex minimum precision required by MPFR library The minimum precision required by MPFR. @end table @@ -35465,6 +35465,24 @@ Add functions to implement system calls such as @code{chown()}, @code{chmod()}, and @code{umask()} to the file operations extension presented in @ref{Internal File Ops}. +@c Idea from comp.lang.awk, February 2015 +@item +Write an input parser that prints a prompt if the input is +a from a ``terminal'' device. You can use the @code{isatty()} +function to tell if the input file is a terminal. (Hint: this function +is usually expensive to call; try to call it just once.) +The content of the prompt should come from a variable settable +by @command{awk}-level code. +You can write the prompt to stanard error. However, +for best results, open a new file descriptor (or file pointer) +on @file{/dev/tty} and print the prompt there, in case standard +error has been redirected. + +Why is standard error a better +choice than standard output for writing the prompt? +Which reading mechanism should you replace, the one to get +a record, or the one to read raw bytes? + @item (Hard.) How would you provide namespaces in @command{gawk}, so that the diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 6991f8a8..eda9fc9d 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -14421,7 +14421,7 @@ while the program runs. The value of the @code{getgid()} system call. @item PROCINFO["pgrpid"] -@cindex process group idIDof @command{gawk} process +@cindex process group ID of @command{gawk} process The process group ID of the current process. @item PROCINFO["pid"] @@ -14473,7 +14473,7 @@ The version of the GNU MP library. The maximum precision supported by MPFR. @item PROCINFO["prec_min"] -@cindex minimum precision supported by MPFR library +@cindex minimum precision required by MPFR library The minimum precision required by MPFR. @end table @@ -34556,6 +34556,24 @@ Add functions to implement system calls such as @code{chown()}, @code{chmod()}, and @code{umask()} to the file operations extension presented in @ref{Internal File Ops}. +@c Idea from comp.lang.awk, February 2015 +@item +Write an input parser that prints a prompt if the input is +a from a ``terminal'' device. You can use the @code{isatty()} +function to tell if the input file is a terminal. (Hint: this function +is usually expensive to call; try to call it just once.) +The content of the prompt should come from a variable settable +by @command{awk}-level code. +You can write the prompt to stanard error. However, +for best results, open a new file descriptor (or file pointer) +on @file{/dev/tty} and print the prompt there, in case standard +error has been redirected. + +Why is standard error a better +choice than standard output for writing the prompt? +Which reading mechanism should you replace, the one to get +a record, or the one to read raw bytes? + @item (Hard.) How would you provide namespaces in @command{gawk}, so that the |