summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-03-24 22:10:07 +0200
committerArnold D. Robbins <arnold@skeeve.com>2015-03-24 22:10:07 +0200
commit56e848ab0b55cc98f206ab7e187ba8269f2e8e4c (patch)
tree9c6677c0003d29b1c78395a05109e3b0c73a7d8f
parent480aca31c7772dafeb1b97cd7a768bca2f49d3c7 (diff)
parent981e106b111672aac520fbb397ee82c64f3c4f2a (diff)
downloadgawk-56e848ab0b55cc98f206ab7e187ba8269f2e8e4c.tar.gz
Merge branch 'gawk-4.1-stable'
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.info172
-rw-r--r--doc/gawk.texi22
-rw-r--r--doc/gawktexi.in22
4 files changed, 138 insertions, 83 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 92e95a0b..c5ec8e50 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 3e12596d..b2b5bb44 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -26289,12 +26289,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::.
@@ -33667,7 +33681,7 @@ Index
* messages from extensions: Printing Messages. (line 6)
* metacharacters in regular expressions: Regexp Operators. (line 6)
* metacharacters, escape sequences for: Escape Sequences. (line 139)
-* minimum precision supported by MPFR library: Auto-set. (line 238)
+* minimum precision required by MPFR library: Auto-set. (line 238)
* mktime: Time Functions. (line 25)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 104)
@@ -34007,7 +34021,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 197)
+* process group ID of gawk process: Auto-set. (line 197)
* process ID of gawk process: Auto-set. (line 200)
* processes, two-way communications with: Two-way I/O. (line 6)
* processing data: Basic High Level. (line 6)
@@ -35228,80 +35242,80 @@ Node: Extension Sample API Tests1050986
Node: gawkextlib1051477
Node: Extension summary1054155
Node: Extension Exercises1057844
-Node: Language History1058566
-Node: V7/SVR3.11060222
-Node: SVR41062375
-Node: POSIX1063809
-Node: BTL1065190
-Node: POSIX/GNU1065921
-Node: Feature History1071757
-Node: Common Extensions1085551
-Node: Ranges and Locales1086923
-Ref: Ranges and Locales-Footnote-11091542
-Ref: Ranges and Locales-Footnote-21091569
-Ref: Ranges and Locales-Footnote-31091804
-Node: Contributors1092025
-Node: History summary1097565
-Node: Installation1098944
-Node: Gawk Distribution1099890
-Node: Getting1100374
-Node: Extracting1101197
-Node: Distribution contents1102834
-Node: Unix Installation1108936
-Node: Quick Installation1109619
-Node: Shell Startup Files1112030
-Node: Additional Configuration Options1113109
-Node: Configuration Philosophy1114913
-Node: Non-Unix Installation1117282
-Node: PC Installation1117740
-Node: PC Binary Installation1119060
-Node: PC Compiling1120908
-Ref: PC Compiling-Footnote-11123929
-Node: PC Testing1124038
-Node: PC Using1125214
-Node: Cygwin1129329
-Node: MSYS1130099
-Node: VMS Installation1130600
-Node: VMS Compilation1131392
-Ref: VMS Compilation-Footnote-11132621
-Node: VMS Dynamic Extensions1132679
-Node: VMS Installation Details1134363
-Node: VMS Running1136614
-Node: VMS GNV1139454
-Node: VMS Old Gawk1140189
-Node: Bugs1140659
-Node: Other Versions1144548
-Node: Installation summary1150982
-Node: Notes1152041
-Node: Compatibility Mode1152906
-Node: Additions1153688
-Node: Accessing The Source1154613
-Node: Adding Code1156048
-Node: New Ports1162205
-Node: Derived Files1166687
-Ref: Derived Files-Footnote-11172162
-Ref: Derived Files-Footnote-21172196
-Ref: Derived Files-Footnote-31172792
-Node: Future Extensions1172906
-Node: Implementation Limitations1173512
-Node: Extension Design1174760
-Node: Old Extension Problems1175914
-Ref: Old Extension Problems-Footnote-11177431
-Node: Extension New Mechanism Goals1177488
-Ref: Extension New Mechanism Goals-Footnote-11180848
-Node: Extension Other Design Decisions1181037
-Node: Extension Future Growth1183145
-Node: Old Extension Mechanism1183981
-Node: Notes summary1185743
-Node: Basic Concepts1186929
-Node: Basic High Level1187610
-Ref: figure-general-flow1187882
-Ref: figure-process-flow1188481
-Ref: Basic High Level-Footnote-11191710
-Node: Basic Data Typing1191895
-Node: Glossary1195223
-Node: Copying1227152
-Node: GNU Free Documentation License1264708
-Node: Index1289844
+Node: Language History1059340
+Node: V7/SVR3.11060996
+Node: SVR41063149
+Node: POSIX1064583
+Node: BTL1065964
+Node: POSIX/GNU1066695
+Node: Feature History1072531
+Node: Common Extensions1086325
+Node: Ranges and Locales1087697
+Ref: Ranges and Locales-Footnote-11092316
+Ref: Ranges and Locales-Footnote-21092343
+Ref: Ranges and Locales-Footnote-31092578
+Node: Contributors1092799
+Node: History summary1098339
+Node: Installation1099718
+Node: Gawk Distribution1100664
+Node: Getting1101148
+Node: Extracting1101971
+Node: Distribution contents1103608
+Node: Unix Installation1109710
+Node: Quick Installation1110393
+Node: Shell Startup Files1112804
+Node: Additional Configuration Options1113883
+Node: Configuration Philosophy1115687
+Node: Non-Unix Installation1118056
+Node: PC Installation1118514
+Node: PC Binary Installation1119834
+Node: PC Compiling1121682
+Ref: PC Compiling-Footnote-11124703
+Node: PC Testing1124812
+Node: PC Using1125988
+Node: Cygwin1130103
+Node: MSYS1130873
+Node: VMS Installation1131374
+Node: VMS Compilation1132166
+Ref: VMS Compilation-Footnote-11133395
+Node: VMS Dynamic Extensions1133453
+Node: VMS Installation Details1135137
+Node: VMS Running1137388
+Node: VMS GNV1140228
+Node: VMS Old Gawk1140963
+Node: Bugs1141433
+Node: Other Versions1145322
+Node: Installation summary1151756
+Node: Notes1152815
+Node: Compatibility Mode1153680
+Node: Additions1154462
+Node: Accessing The Source1155387
+Node: Adding Code1156822
+Node: New Ports1162979
+Node: Derived Files1167461
+Ref: Derived Files-Footnote-11172936
+Ref: Derived Files-Footnote-21172970
+Ref: Derived Files-Footnote-31173566
+Node: Future Extensions1173680
+Node: Implementation Limitations1174286
+Node: Extension Design1175534
+Node: Old Extension Problems1176688
+Ref: Old Extension Problems-Footnote-11178205
+Node: Extension New Mechanism Goals1178262
+Ref: Extension New Mechanism Goals-Footnote-11181622
+Node: Extension Other Design Decisions1181811
+Node: Extension Future Growth1183919
+Node: Old Extension Mechanism1184755
+Node: Notes summary1186517
+Node: Basic Concepts1187703
+Node: Basic High Level1188384
+Ref: figure-general-flow1188656
+Ref: figure-process-flow1189255
+Ref: Basic High Level-Footnote-11192484
+Node: Basic Data Typing1192669
+Node: Glossary1195997
+Node: Copying1227926
+Node: GNU Free Documentation License1265482
+Node: Index1290618

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 8005fe3f..4850da0b 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -15046,7 +15046,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"]
@@ -15098,7 +15098,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
@@ -35352,6 +35352,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 88e854a5..697d9107 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -14374,7 +14374,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"]
@@ -14426,7 +14426,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
@@ -34443,6 +34443,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