From 9ca2921ea5b045037d0b80a2df75d448a43fd42e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 12 Jun 2015 14:34:24 +0300 Subject: Add another Chet Ramey pithy saying to the doc. --- doc/ChangeLog | 5 +++++ doc/gawk.texi | 11 +++++++++++ doc/gawktexi.in | 11 +++++++++++ 3 files changed, 27 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 1c9420d9..f07d88e1 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-12 Arnold D. Robbins + + * gawktexi.in: Add another pithy quote from Chet Ramey. Currently + commented out. + 2015-05-30 Arnold D. Robbins * gawktexi.in (Bitwise Functions): Update results of testbits.awk. diff --git a/doc/gawk.texi b/doc/gawk.texi index 57a2f893..0fff7688 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -38148,6 +38148,17 @@ CC: chet.ramey@case.edu .... I gave up on usenet a couple of years ago and haven't really looked back. It's like sports talk radio -- you feel smarter for not having read it. + +And another one: + +Date: Thu, 11 Jun 2015 09:00:56 -0400 +From: Chet Ramey + +My memory was imperfect. Back in June 2009, I wrote: + +"That's the nice thing about open source, right? You can take your ball +and run to another section of the playground. Then, if you like mixing +metaphors, you can throw rocks from there." @end ignore @quotation NOTE diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 03857f1e..b712b9ee 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -37239,6 +37239,17 @@ CC: chet.ramey@case.edu .... I gave up on usenet a couple of years ago and haven't really looked back. It's like sports talk radio -- you feel smarter for not having read it. + +And another one: + +Date: Thu, 11 Jun 2015 09:00:56 -0400 +From: Chet Ramey + +My memory was imperfect. Back in June 2009, I wrote: + +"That's the nice thing about open source, right? You can take your ball +and run to another section of the playground. Then, if you like mixing +metaphors, you can throw rocks from there." @end ignore @quotation NOTE -- cgit v1.2.3 From 98904e6eee37f5f5373a9597ed134adc34a77519 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 13 Jun 2015 22:54:44 +0300 Subject: Remove an unneeded exercise from the doc. --- doc/ChangeLog | 6 + doc/gawk.info | 517 +++++++++++++++++++++++++++----------------------------- doc/gawk.texi | 3 + doc/gawktexi.in | 3 + 4 files changed, 262 insertions(+), 267 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f07d88e1..d1a1de69 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-06-13 Arnold D. Robbins + + * gawktexi.in: Comment out exercise 10.3, since the answer + is included in the text. Thanks to Antonio Colombo + for pointing this out. + 2015-06-12 Arnold D. Robbins * gawktexi.in: Add another pithy quote from Chet Ramey. Currently diff --git a/doc/gawk.info b/doc/gawk.info index 8d328901..5eda5ad9 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -16308,23 +16308,6 @@ File: gawk.info, Node: Library Exercises, Prev: Library Functions Summary, Up 2. As a related challenge, revise that code to handle the case where an intervening value in 'ARGV' is a variable assignment. - 3. *note 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 'walk_array()' function by adding an additional - parameter named 'process'. - - Then, inside the loop, instead of printing the array element's - index and value, use the indirect function call syntax (*note - Indirect Calls::) on 'process', passing it the index and the value. - - When calling 'walk_array()', you would pass the name of a - user-defined function that expects to receive an index and a value, - and then processes the element. - - Test your new version by printing the array; you should end up with - output identical to that of the original version. -  File: gawk.info, Node: Sample Programs, Next: Advanced Features, Prev: Library Functions, Up: Top @@ -34819,255 +34802,255 @@ Ref: Group Functions-Footnote-1670391 Node: Walking Arrays670598 Node: Library Functions Summary673608 Node: Library Exercises675014 -Node: Sample Programs676293 -Node: Running Examples677063 -Node: Clones677791 -Node: Cut Program679015 -Node: Egrep Program688736 -Ref: Egrep Program-Footnote-1696248 -Node: Id Program696358 -Node: Split Program700038 -Ref: Split Program-Footnote-1703497 -Node: Tee Program703626 -Node: Uniq Program706416 -Node: Wc Program713842 -Ref: Wc Program-Footnote-1718097 -Node: Miscellaneous Programs718191 -Node: Dupword Program719404 -Node: Alarm Program721434 -Node: Translate Program726289 -Ref: Translate Program-Footnote-1730854 -Node: Labels Program731124 -Ref: Labels Program-Footnote-1734475 -Node: Word Sorting734559 -Node: History Sorting738631 -Node: Extract Program740466 -Node: Simple Sed747997 -Node: Igawk Program751071 -Ref: Igawk Program-Footnote-1765402 -Ref: Igawk Program-Footnote-2765604 -Ref: Igawk Program-Footnote-3765726 -Node: Anagram Program765841 -Node: Signature Program768903 -Node: Programs Summary770150 -Node: Programs Exercises771365 -Ref: Programs Exercises-Footnote-1775494 -Node: Advanced Features775585 -Node: Nondecimal Data777575 -Node: Array Sorting779166 -Node: Controlling Array Traversal779866 -Ref: Controlling Array Traversal-Footnote-1788235 -Node: Array Sorting Functions788353 -Ref: Array Sorting Functions-Footnote-1792240 -Node: Two-way I/O792436 -Ref: Two-way I/O-Footnote-1797387 -Ref: Two-way I/O-Footnote-2797574 -Node: TCP/IP Networking797656 -Node: Profiling800563 -Node: Advanced Features Summary808102 -Node: Internationalization810038 -Node: I18N and L10N811518 -Node: Explaining gettext812205 -Ref: Explaining gettext-Footnote-1817228 -Ref: Explaining gettext-Footnote-2817413 -Node: Programmer i18n817578 -Ref: Programmer i18n-Footnote-1822434 -Node: Translator i18n822483 -Node: String Extraction823277 -Ref: String Extraction-Footnote-1824410 -Node: Printf Ordering824496 -Ref: Printf Ordering-Footnote-1827282 -Node: I18N Portability827346 -Ref: I18N Portability-Footnote-1829802 -Node: I18N Example829865 -Ref: I18N Example-Footnote-1832671 -Node: Gawk I18N832744 -Node: I18N Summary833389 -Node: Debugger834730 -Node: Debugging835752 -Node: Debugging Concepts836193 -Node: Debugging Terms838002 -Node: Awk Debugging840577 -Node: Sample Debugging Session841483 -Node: Debugger Invocation842017 -Node: Finding The Bug843403 -Node: List of Debugger Commands849881 -Node: Breakpoint Control851214 -Node: Debugger Execution Control854908 -Node: Viewing And Changing Data858270 -Node: Execution Stack861644 -Node: Debugger Info863281 -Node: Miscellaneous Debugger Commands867352 -Node: Readline Support872361 -Node: Limitations873257 -Node: Debugging Summary875366 -Node: Arbitrary Precision Arithmetic876539 -Node: Computer Arithmetic877955 -Ref: table-numeric-ranges881546 -Ref: Computer Arithmetic-Footnote-1882268 -Node: Math Definitions882325 -Ref: table-ieee-formats885639 -Ref: Math Definitions-Footnote-1886242 -Node: MPFR features886347 -Node: FP Math Caution888020 -Ref: FP Math Caution-Footnote-1889092 -Node: Inexactness of computations889461 -Node: Inexact representation890421 -Node: Comparing FP Values891781 -Node: Errors accumulate892863 -Node: Getting Accuracy894296 -Node: Try To Round897006 -Node: Setting precision897905 -Ref: table-predefined-precision-strings898602 -Node: Setting the rounding mode900432 -Ref: table-gawk-rounding-modes900806 -Ref: Setting the rounding mode-Footnote-1904214 -Node: Arbitrary Precision Integers904393 -Ref: Arbitrary Precision Integers-Footnote-1907377 -Node: POSIX Floating Point Problems907526 -Ref: POSIX Floating Point Problems-Footnote-1911408 -Node: Floating point summary911446 -Node: Dynamic Extensions913636 -Node: Extension Intro915189 -Node: Plugin License916455 -Node: Extension Mechanism Outline917252 -Ref: figure-load-extension917691 -Ref: figure-register-new-function919256 -Ref: figure-call-new-function920348 -Node: Extension API Description922411 -Node: Extension API Functions Introduction923861 -Node: General Data Types928673 -Ref: General Data Types-Footnote-1934628 -Node: Memory Allocation Functions934927 -Ref: Memory Allocation Functions-Footnote-1937772 -Node: Constructor Functions937871 -Node: Registration Functions939616 -Node: Extension Functions940301 -Node: Exit Callback Functions942600 -Node: Extension Version String943850 -Node: Input Parsers944513 -Node: Output Wrappers954398 -Node: Two-way processors958910 -Node: Printing Messages961174 -Ref: Printing Messages-Footnote-1962250 -Node: Updating 'ERRNO'962403 -Node: Requesting Values963144 -Ref: table-value-types-returned963883 -Node: Accessing Parameters964766 -Node: Symbol Table Access966002 -Node: Symbol table by name966514 -Node: Symbol table by cookie968535 -Ref: Symbol table by cookie-Footnote-1972684 -Node: Cached values972748 -Ref: Cached values-Footnote-1976249 -Node: Array Manipulation976340 -Ref: Array Manipulation-Footnote-1977439 -Node: Array Data Types977476 -Ref: Array Data Types-Footnote-1980134 -Node: Array Functions980226 -Node: Flattening Arrays984085 -Node: Creating Arrays990993 -Node: Extension API Variables995765 -Node: Extension Versioning996401 -Node: Extension API Informational Variables998292 -Node: Extension API Boilerplate999356 -Node: Finding Extensions1003170 -Node: Extension Example1003730 -Node: Internal File Description1004528 -Node: Internal File Ops1008608 -Ref: Internal File Ops-Footnote-11020370 -Node: Using Internal File Ops1020510 -Ref: Using Internal File Ops-Footnote-11022893 -Node: Extension Samples1023168 -Node: Extension Sample File Functions1024697 -Node: Extension Sample Fnmatch1032346 -Node: Extension Sample Fork1033833 -Node: Extension Sample Inplace1035051 -Node: Extension Sample Ord1037137 -Node: Extension Sample Readdir1037973 -Ref: table-readdir-file-types1038862 -Node: Extension Sample Revout1039667 -Node: Extension Sample Rev2way1040256 -Node: Extension Sample Read write array1040996 -Node: Extension Sample Readfile1042938 -Node: Extension Sample Time1044033 -Node: Extension Sample API Tests1045381 -Node: gawkextlib1045873 -Node: Extension summary1048297 -Node: Extension Exercises1051989 -Node: Language History1053486 -Node: V7/SVR3.11055142 -Node: SVR41057295 -Node: POSIX1058729 -Node: BTL1060109 -Node: POSIX/GNU1060839 -Node: Feature History1066360 -Node: Common Extensions1079690 -Node: Ranges and Locales1080973 -Ref: Ranges and Locales-Footnote-11085589 -Ref: Ranges and Locales-Footnote-21085616 -Ref: Ranges and Locales-Footnote-31085851 -Node: Contributors1086072 -Node: History summary1091641 -Node: Installation1093021 -Node: Gawk Distribution1093966 -Node: Getting1094450 -Node: Extracting1095273 -Node: Distribution contents1096911 -Node: Unix Installation1102664 -Node: Quick Installation1103280 -Node: Additional Configuration Options1105707 -Node: Configuration Philosophy1107511 -Node: Non-Unix Installation1109881 -Node: PC Installation1110339 -Node: PC Binary Installation1111659 -Node: PC Compiling1113511 -Ref: PC Compiling-Footnote-11116535 -Node: PC Testing1116644 -Node: PC Using1117824 -Node: Cygwin1121938 -Node: MSYS1122708 -Node: VMS Installation1123209 -Node: VMS Compilation1124000 -Ref: VMS Compilation-Footnote-11125230 -Node: VMS Dynamic Extensions1125288 -Node: VMS Installation Details1126973 -Node: VMS Running1129226 -Node: VMS GNV1132067 -Node: VMS Old Gawk1132802 -Node: Bugs1133273 -Node: Other Versions1137387 -Node: Installation summary1143861 -Node: Notes1144919 -Node: Compatibility Mode1145784 -Node: Additions1146566 -Node: Accessing The Source1147491 -Node: Adding Code1148927 -Node: New Ports1155082 -Node: Derived Files1159570 -Ref: Derived Files-Footnote-11165055 -Ref: Derived Files-Footnote-21165090 -Ref: Derived Files-Footnote-31165688 -Node: Future Extensions1165802 -Node: Implementation Limitations1166460 -Node: Extension Design1167643 -Node: Old Extension Problems1168797 -Ref: Old Extension Problems-Footnote-11170315 -Node: Extension New Mechanism Goals1170372 -Ref: Extension New Mechanism Goals-Footnote-11173736 -Node: Extension Other Design Decisions1173925 -Node: Extension Future Growth1176038 -Node: Old Extension Mechanism1176874 -Node: Notes summary1178637 -Node: Basic Concepts1179819 -Node: Basic High Level1180500 -Ref: figure-general-flow1180782 -Ref: figure-process-flow1181467 -Ref: Basic High Level-Footnote-11184768 -Node: Basic Data Typing1184953 -Node: Glossary1188281 -Node: Copying1220227 -Node: GNU Free Documentation License1257766 -Node: Index1282884 +Node: Sample Programs675479 +Node: Running Examples676249 +Node: Clones676977 +Node: Cut Program678201 +Node: Egrep Program687922 +Ref: Egrep Program-Footnote-1695434 +Node: Id Program695544 +Node: Split Program699224 +Ref: Split Program-Footnote-1702683 +Node: Tee Program702812 +Node: Uniq Program705602 +Node: Wc Program713028 +Ref: Wc Program-Footnote-1717283 +Node: Miscellaneous Programs717377 +Node: Dupword Program718590 +Node: Alarm Program720620 +Node: Translate Program725475 +Ref: Translate Program-Footnote-1730040 +Node: Labels Program730310 +Ref: Labels Program-Footnote-1733661 +Node: Word Sorting733745 +Node: History Sorting737817 +Node: Extract Program739652 +Node: Simple Sed747183 +Node: Igawk Program750257 +Ref: Igawk Program-Footnote-1764588 +Ref: Igawk Program-Footnote-2764790 +Ref: Igawk Program-Footnote-3764912 +Node: Anagram Program765027 +Node: Signature Program768089 +Node: Programs Summary769336 +Node: Programs Exercises770551 +Ref: Programs Exercises-Footnote-1774680 +Node: Advanced Features774771 +Node: Nondecimal Data776761 +Node: Array Sorting778352 +Node: Controlling Array Traversal779052 +Ref: Controlling Array Traversal-Footnote-1787421 +Node: Array Sorting Functions787539 +Ref: Array Sorting Functions-Footnote-1791426 +Node: Two-way I/O791622 +Ref: Two-way I/O-Footnote-1796573 +Ref: Two-way I/O-Footnote-2796760 +Node: TCP/IP Networking796842 +Node: Profiling799749 +Node: Advanced Features Summary807288 +Node: Internationalization809224 +Node: I18N and L10N810704 +Node: Explaining gettext811391 +Ref: Explaining gettext-Footnote-1816414 +Ref: Explaining gettext-Footnote-2816599 +Node: Programmer i18n816764 +Ref: Programmer i18n-Footnote-1821620 +Node: Translator i18n821669 +Node: String Extraction822463 +Ref: String Extraction-Footnote-1823596 +Node: Printf Ordering823682 +Ref: Printf Ordering-Footnote-1826468 +Node: I18N Portability826532 +Ref: I18N Portability-Footnote-1828988 +Node: I18N Example829051 +Ref: I18N Example-Footnote-1831857 +Node: Gawk I18N831930 +Node: I18N Summary832575 +Node: Debugger833916 +Node: Debugging834938 +Node: Debugging Concepts835379 +Node: Debugging Terms837188 +Node: Awk Debugging839763 +Node: Sample Debugging Session840669 +Node: Debugger Invocation841203 +Node: Finding The Bug842589 +Node: List of Debugger Commands849067 +Node: Breakpoint Control850400 +Node: Debugger Execution Control854094 +Node: Viewing And Changing Data857456 +Node: Execution Stack860830 +Node: Debugger Info862467 +Node: Miscellaneous Debugger Commands866538 +Node: Readline Support871547 +Node: Limitations872443 +Node: Debugging Summary874552 +Node: Arbitrary Precision Arithmetic875725 +Node: Computer Arithmetic877141 +Ref: table-numeric-ranges880732 +Ref: Computer Arithmetic-Footnote-1881454 +Node: Math Definitions881511 +Ref: table-ieee-formats884825 +Ref: Math Definitions-Footnote-1885428 +Node: MPFR features885533 +Node: FP Math Caution887206 +Ref: FP Math Caution-Footnote-1888278 +Node: Inexactness of computations888647 +Node: Inexact representation889607 +Node: Comparing FP Values890967 +Node: Errors accumulate892049 +Node: Getting Accuracy893482 +Node: Try To Round896192 +Node: Setting precision897091 +Ref: table-predefined-precision-strings897788 +Node: Setting the rounding mode899618 +Ref: table-gawk-rounding-modes899992 +Ref: Setting the rounding mode-Footnote-1903400 +Node: Arbitrary Precision Integers903579 +Ref: Arbitrary Precision Integers-Footnote-1906563 +Node: POSIX Floating Point Problems906712 +Ref: POSIX Floating Point Problems-Footnote-1910594 +Node: Floating point summary910632 +Node: Dynamic Extensions912822 +Node: Extension Intro914375 +Node: Plugin License915641 +Node: Extension Mechanism Outline916438 +Ref: figure-load-extension916877 +Ref: figure-register-new-function918442 +Ref: figure-call-new-function919534 +Node: Extension API Description921597 +Node: Extension API Functions Introduction923047 +Node: General Data Types927859 +Ref: General Data Types-Footnote-1933814 +Node: Memory Allocation Functions934113 +Ref: Memory Allocation Functions-Footnote-1936958 +Node: Constructor Functions937057 +Node: Registration Functions938802 +Node: Extension Functions939487 +Node: Exit Callback Functions941786 +Node: Extension Version String943036 +Node: Input Parsers943699 +Node: Output Wrappers953584 +Node: Two-way processors958096 +Node: Printing Messages960360 +Ref: Printing Messages-Footnote-1961436 +Node: Updating 'ERRNO'961589 +Node: Requesting Values962330 +Ref: table-value-types-returned963069 +Node: Accessing Parameters963952 +Node: Symbol Table Access965188 +Node: Symbol table by name965700 +Node: Symbol table by cookie967721 +Ref: Symbol table by cookie-Footnote-1971870 +Node: Cached values971934 +Ref: Cached values-Footnote-1975435 +Node: Array Manipulation975526 +Ref: Array Manipulation-Footnote-1976625 +Node: Array Data Types976662 +Ref: Array Data Types-Footnote-1979320 +Node: Array Functions979412 +Node: Flattening Arrays983271 +Node: Creating Arrays990179 +Node: Extension API Variables994951 +Node: Extension Versioning995587 +Node: Extension API Informational Variables997478 +Node: Extension API Boilerplate998542 +Node: Finding Extensions1002356 +Node: Extension Example1002916 +Node: Internal File Description1003714 +Node: Internal File Ops1007794 +Ref: Internal File Ops-Footnote-11019556 +Node: Using Internal File Ops1019696 +Ref: Using Internal File Ops-Footnote-11022079 +Node: Extension Samples1022354 +Node: Extension Sample File Functions1023883 +Node: Extension Sample Fnmatch1031532 +Node: Extension Sample Fork1033019 +Node: Extension Sample Inplace1034237 +Node: Extension Sample Ord1036323 +Node: Extension Sample Readdir1037159 +Ref: table-readdir-file-types1038048 +Node: Extension Sample Revout1038853 +Node: Extension Sample Rev2way1039442 +Node: Extension Sample Read write array1040182 +Node: Extension Sample Readfile1042124 +Node: Extension Sample Time1043219 +Node: Extension Sample API Tests1044567 +Node: gawkextlib1045059 +Node: Extension summary1047483 +Node: Extension Exercises1051175 +Node: Language History1052672 +Node: V7/SVR3.11054328 +Node: SVR41056481 +Node: POSIX1057915 +Node: BTL1059295 +Node: POSIX/GNU1060025 +Node: Feature History1065546 +Node: Common Extensions1078876 +Node: Ranges and Locales1080159 +Ref: Ranges and Locales-Footnote-11084775 +Ref: Ranges and Locales-Footnote-21084802 +Ref: Ranges and Locales-Footnote-31085037 +Node: Contributors1085258 +Node: History summary1090827 +Node: Installation1092207 +Node: Gawk Distribution1093152 +Node: Getting1093636 +Node: Extracting1094459 +Node: Distribution contents1096097 +Node: Unix Installation1101850 +Node: Quick Installation1102466 +Node: Additional Configuration Options1104893 +Node: Configuration Philosophy1106697 +Node: Non-Unix Installation1109067 +Node: PC Installation1109525 +Node: PC Binary Installation1110845 +Node: PC Compiling1112697 +Ref: PC Compiling-Footnote-11115721 +Node: PC Testing1115830 +Node: PC Using1117010 +Node: Cygwin1121124 +Node: MSYS1121894 +Node: VMS Installation1122395 +Node: VMS Compilation1123186 +Ref: VMS Compilation-Footnote-11124416 +Node: VMS Dynamic Extensions1124474 +Node: VMS Installation Details1126159 +Node: VMS Running1128412 +Node: VMS GNV1131253 +Node: VMS Old Gawk1131988 +Node: Bugs1132459 +Node: Other Versions1136573 +Node: Installation summary1143047 +Node: Notes1144105 +Node: Compatibility Mode1144970 +Node: Additions1145752 +Node: Accessing The Source1146677 +Node: Adding Code1148113 +Node: New Ports1154268 +Node: Derived Files1158756 +Ref: Derived Files-Footnote-11164241 +Ref: Derived Files-Footnote-21164276 +Ref: Derived Files-Footnote-31164874 +Node: Future Extensions1164988 +Node: Implementation Limitations1165646 +Node: Extension Design1166829 +Node: Old Extension Problems1167983 +Ref: Old Extension Problems-Footnote-11169501 +Node: Extension New Mechanism Goals1169558 +Ref: Extension New Mechanism Goals-Footnote-11172922 +Node: Extension Other Design Decisions1173111 +Node: Extension Future Growth1175224 +Node: Old Extension Mechanism1176060 +Node: Notes summary1177823 +Node: Basic Concepts1179005 +Node: Basic High Level1179686 +Ref: figure-general-flow1179968 +Ref: figure-process-flow1180653 +Ref: Basic High Level-Footnote-11183954 +Node: Basic Data Typing1184139 +Node: Glossary1187467 +Node: Copying1219413 +Node: GNU Free Documentation License1256952 +Node: Index1282070  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 0fff7688..8c70f6c5 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -23134,6 +23134,8 @@ END @{ As a related challenge, revise that code to handle the case where 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 array to print it out. However, walking an array and processing @@ -23151,6 +23153,7 @@ and then processes the element. Test your new version by printing the array; you should end up with output identical to that of the original version. +@end ignore @end enumerate @c EXCLUDE END diff --git a/doc/gawktexi.in b/doc/gawktexi.in index b712b9ee..e4b422c7 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -22225,6 +22225,8 @@ END @{ As a related challenge, revise that code to handle the case where 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 array to print it out. However, walking an array and processing @@ -22242,6 +22244,7 @@ and then processes the element. Test your new version by printing the array; you should end up with output identical to that of the original version. +@end ignore @end enumerate @c EXCLUDE END -- cgit v1.2.3 From 367417c47be947ed7d0af7b430af5ff1626bf7c1 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 14 Jun 2015 19:06:21 +0300 Subject: Sync regex routines wit GLIBC. --- ChangeLog | 4 ++++ regcomp.c | 64 ++++++++++++++++++++++++++++---------------------------- regex_internal.h | 5 ++++- regexec.c | 4 ++++ 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index da14af06..0fadaf16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-06-14 Arnold D. Robbins + + * regcomp.c, regex_internal.h, regexec.c: Sync with GLIBC. + 2015-05-26 Paul Eggert * floatcomp.c (count_trailing_zeros): New function. diff --git a/regcomp.c b/regcomp.c index f813a1ef..fd3ab84a 100644 --- a/regcomp.c +++ b/regcomp.c @@ -235,7 +235,7 @@ btowc (int c) compiles PATTERN (of length LENGTH) and puts the result in BUFP. Returns 0 if the pattern was valid, otherwise an error string. - Assumes the `allocated' (and perhaps `buffer') and `translate' fields + Assumes the 'allocated' (and perhaps 'buffer') and 'translate' fields are set in BUFP on entry. */ const char * @@ -264,7 +264,7 @@ re_compile_pattern (pattern, length, bufp) weak_alias (__re_compile_pattern, re_compile_pattern) #endif -/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can +/* Set by 're_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own syntax, so it can be changed between regex compilations. */ /* This has no initializer because initialized variables in Emacs @@ -315,8 +315,8 @@ weak_alias (__re_compile_fastmap, re_compile_fastmap) #endif static inline void -__attribute ((always_inline)) -re_set_fastmap (char *fastmap, int icase, int ch) +__attribute__ ((always_inline)) +re_set_fastmap (char *fastmap, bool icase, int ch) { fastmap[ch] = 1; if (icase) @@ -462,15 +462,15 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, PREG is a regex_t *. We do not expect any fields to be initialized, since POSIX says we shouldn't. Thus, we set - `buffer' to the compiled pattern; - `used' to the length of the compiled pattern; - `syntax' to RE_SYNTAX_POSIX_EXTENDED if the + 'buffer' to the compiled pattern; + 'used' to the length of the compiled pattern; + 'syntax' to RE_SYNTAX_POSIX_EXTENDED if the REG_EXTENDED bit in CFLAGS is set; otherwise, to RE_SYNTAX_POSIX_BASIC; - `newline_anchor' to REG_NEWLINE being set in CFLAGS; - `fastmap' to an allocated space for the fastmap; - `fastmap_accurate' to zero; - `re_nsub' to the number of subexpressions in PATTERN. + 'newline_anchor' to REG_NEWLINE being set in CFLAGS; + 'fastmap' to an allocated space for the fastmap; + 'fastmap_accurate' to zero; + 're_nsub' to the number of subexpressions in PATTERN. PATTERN is the address of the pattern string. @@ -730,7 +730,7 @@ re_comp (s) + __re_error_msgid_idx[(int) REG_ESPACE]); } - /* Since `re_exec' always passes NULL for the `regs' argument, we + /* Since 're_exec' always passes NULL for the 'regs' argument, we don't need to initialize the pattern buffer fields which affect it. */ /* Match anchors at newlines. */ @@ -1570,7 +1570,7 @@ duplicate_node_closure (re_dfa_t *dfa, int top_org_node, int top_clone_node, destination. */ org_dest = dfa->edests[org_node].elems[0]; re_node_set_empty (dfa->edests + clone_node); - /* If the node is root_node itself, it means the epsilon clsoure + /* If the node is root_node itself, it means the epsilon closure has a loop. Then tie it to the destination of the root_node. */ if (org_node == root_node && clone_node != org_node) { @@ -1579,7 +1579,7 @@ duplicate_node_closure (re_dfa_t *dfa, int top_org_node, int top_clone_node, return REG_ESPACE; break; } - /* In case of the node has another constraint, add it. */ + /* In case the node has another constraint, append it. */ constraint |= dfa->nodes[org_node].constraint; clone_dest = duplicate_node (dfa, org_dest, constraint); if (BE (clone_dest == -1, 0)) @@ -1722,7 +1722,7 @@ calc_eclosure (re_dfa_t *dfa) /* If we have already calculated, skip it. */ if (dfa->eclosures[node_idx].nelem != 0) continue; - /* Calculate epsilon closure of `node_idx'. */ + /* Calculate epsilon closure of 'node_idx'. */ err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, 1); if (BE (err != REG_NOERROR, 0)) return err; @@ -1789,11 +1789,11 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, int node, int root) } else eclosure_elem = dfa->eclosures[edest]; - /* Merge the epsilon closure of `edest'. */ + /* Merge the epsilon closure of 'edest'. */ err = re_node_set_merge (&eclosure, &eclosure_elem); if (BE (err != REG_NOERROR, 0)) return err; - /* If the epsilon closure of `edest' is incomplete, + /* If the epsilon closure of 'edest' is incomplete, the epsilon closure of this node is also incomplete. */ if (dfa->eclosures[edest].nelem == 0) { @@ -2155,7 +2155,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax) /* Entry point of the parser. Parse the regular expression REGEXP and return the structure tree. - If an error is occured, ERR is set by error code, and return NULL. + If an error occurs, ERR is set by error code, and return NULL. This function build the following tree, from regular expression : CAT / \ @@ -2197,7 +2197,7 @@ parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax, / \ - ALT means alternative, which represents the operator `|'. */ + ALT means alternative, which represents the operator '|'. */ static bin_tree_t * parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, @@ -2693,7 +2693,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, Build the range expression which starts from START_ELEM, and ends at END_ELEM. The result are written to MBCSET and SBCSET. RANGE_ALLOC is the allocated size of mbcset->range_starts, and - mbcset->range_ends, is a pointer argument sinse we may + mbcset->range_ends, is a pointer argument since we may update it. */ static reg_errcode_t @@ -2867,13 +2867,13 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, const int32_t *symb_table; const unsigned char *extra; - /* Local function for parse_bracket_exp used in _LIBC environement. - Seek the collating symbol entry correspondings to NAME. + /* Local function for parse_bracket_exp used in _LIBC environment. + Seek the collating symbol entry corresponding to NAME. Return the index of the symbol in the SYMB_TABLE, or -1 if not found. */ auto inline int32_t - __attribute ((always_inline)) + __attribute__ ((always_inline)) seek_collating_symbol_entry (const unsigned char *name, size_t name_len) { int32_t elem; @@ -2899,7 +2899,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, Return the value if succeeded, UINT_MAX otherwise. */ auto inline unsigned int - __attribute ((always_inline)) + __attribute__ ((always_inline)) lookup_collation_sequence_value (bracket_elem_t *br_elem) { if (br_elem->type == SB_CHAR) @@ -2959,15 +2959,15 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, return UINT_MAX; } - /* Local function for parse_bracket_exp used in _LIBC environement. + /* Local function for parse_bracket_exp used in _LIBC environment. Build the range expression which starts from START_ELEM, and ends at END_ELEM. The result are written to MBCSET and SBCSET. RANGE_ALLOC is the allocated size of mbcset->range_starts, and - mbcset->range_ends, is a pointer argument sinse we may + mbcset->range_ends, is a pointer argument since we may update it. */ auto inline reg_errcode_t - __attribute ((always_inline)) + __attribute__ ((always_inline)) build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc, bracket_elem_t *start_elem, bracket_elem_t *end_elem) { @@ -3040,14 +3040,14 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, return REG_NOERROR; } - /* Local function for parse_bracket_exp used in _LIBC environement. + /* Local function for parse_bracket_exp used in _LIBC environment. Build the collating element which is represented by NAME. The result are written to MBCSET and SBCSET. COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a - pointer argument sinse we may update it. */ + pointer argument since we may update it. */ auto inline reg_errcode_t - __attribute ((always_inline)) + __attribute__ ((always_inline)) build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset, int *coll_sym_alloc, const unsigned char *name) { @@ -3486,7 +3486,7 @@ parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp, Build the equivalence class which is represented by NAME. The result are written to MBCSET and SBCSET. EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes, - is a pointer argument sinse we may update it. */ + is a pointer argument since we may update it. */ static reg_errcode_t #ifdef RE_ENABLE_I18N @@ -3580,7 +3580,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) Build the character class which is represented by NAME. The result are written to MBCSET and SBCSET. CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes, - is a pointer argument sinse we may update it. */ + is a pointer argument since we may update it. */ static reg_errcode_t #ifdef RE_ENABLE_I18N diff --git a/regex_internal.h b/regex_internal.h index 327bd7e0..e0dd3517 100644 --- a/regex_internal.h +++ b/regex_internal.h @@ -803,6 +803,10 @@ re_string_wchar_at (const re_string_t *pstr, int idx) } # ifndef NOT_IN_libc +# ifdef _LIBC +# include +# endif + static int internal_function __attribute__ ((pure, unused)) re_string_elem_size_at (const re_string_t *pstr, int idx) @@ -810,7 +814,6 @@ re_string_elem_size_at (const re_string_t *pstr, int idx) # ifdef _LIBC const unsigned char *p, *extra; const int32_t *table, *indirect; -# include uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); if (nrules != 0) diff --git a/regexec.c b/regexec.c index 46a4d0ae..31bb9e66 100644 --- a/regexec.c +++ b/regexec.c @@ -17,6 +17,10 @@ License along with the GNU C Library; if not, see . */ +#ifdef HAVE_STDINT_H +#include +#endif /* HAVE_STDINT_H */ + static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, int n) internal_function; static void match_ctx_clean (re_match_context_t *mctx) internal_function; -- cgit v1.2.3 From c281360e41563f20b36645896e01ae9bafd52b52 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 14 Jun 2015 19:08:26 +0300 Subject: Replace __attribute with __attribute__ in regex routines. --- ChangeLog | 4 ++++ regex_internal.c | 6 +++--- regexec.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0fadaf16..0c5e3a6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ * regcomp.c, regex_internal.h, regexec.c: Sync with GLIBC. + Unrelated: + + * regex_internal.c, regexec.c: __attribute --> __attribute__. + 2015-05-26 Paul Eggert * floatcomp.c (count_trailing_zeros): New function. diff --git a/regex_internal.c b/regex_internal.c index 5a5b9363..fcfa4ada 100644 --- a/regex_internal.c +++ b/regex_internal.c @@ -838,7 +838,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) } static unsigned char -internal_function __attribute ((pure)) +internal_function __attribute__ ((pure)) re_string_peek_byte_case (const re_string_t *pstr, int idx) { int ch, off; @@ -1370,7 +1370,7 @@ re_node_set_insert_last (re_node_set *set, int elem) return 1 if SET1 and SET2 are equivalent, return 0 otherwise. */ static int -internal_function __attribute ((pure)) +internal_function __attribute__ ((pure)) re_node_set_compare (const re_node_set *set1, const re_node_set *set2) { int i; @@ -1385,7 +1385,7 @@ re_node_set_compare (const re_node_set *set1, const re_node_set *set2) /* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise. */ static int -internal_function __attribute ((pure)) +internal_function __attribute__ ((pure)) re_node_set_contains (const re_node_set *set, int elem) { unsigned int idx, right, mid; diff --git a/regexec.c b/regexec.c index 31bb9e66..cff69bfc 100644 --- a/regexec.c +++ b/regexec.c @@ -1059,7 +1059,7 @@ prune_impossible_nodes (mctx) since initial states may have constraints like "\<", "^", etc.. */ static inline re_dfastate_t * -__attribute ((always_inline)) internal_function +__attribute__ ((always_inline)) internal_function acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx, int idx) { -- cgit v1.2.3 From 2685230246500f96fd4d594f9b470688c562c7b9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 14 Jun 2015 19:54:23 +0300 Subject: More "attribute" cleanup. --- ChangeLog | 5 +++++ regex_internal.h | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c5e3a6c..4c9949fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,11 @@ * regex_internal.c, regexec.c: __attribute --> __attribute__. + Related: + + * regex_internal.h: Clean up defines for non-GCC for attribute; + essentially sync it with GLIBC. + 2015-05-26 Paul Eggert * floatcomp.c (count_trailing_zeros): New function. diff --git a/regex_internal.h b/regex_internal.h index e0dd3517..4d0028ff 100644 --- a/regex_internal.h +++ b/regex_internal.h @@ -148,11 +148,8 @@ is_blank (int c) # define attribute_hidden #endif /* not _LIBC */ -#ifdef __GNUC__ -# define __attribute(arg) __attribute__ (arg) -#else -# define __attribute(arg) -# define __attribute__(arg) /* GAWK: They left this out. Duh. */ +#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1) +# define __attribute__(arg) #endif #ifdef GAWK -- cgit v1.2.3 From ac0ef52fe407b89c7968b927c7b2b513cc13963a Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 15 Jun 2015 22:39:32 +0300 Subject: Configuration/Build fix for Gentoo/FreeBSD. --- configure | 41 ++++++++++++++++++++++++++++++++++++++++- m4/ChangeLog | 4 ++++ m4/readline.m4 | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/configure b/configure index fe7f7709..0aee8f33 100755 --- a/configure +++ b/configure @@ -10825,7 +10825,46 @@ $as_echo "$_found_readline" >&6; } if test $_found_readline = yes ; then case $host_os in - *bsd* ) _combo="$_combo -ltermcap" + *bsd* ) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 +$as_echo_n "checking for tgetent in -ltermcap... " >&6; } +if ${ac_cv_lib_termcap_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltermcap $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_termcap_tgetent=yes +else + ac_cv_lib_termcap_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5 +$as_echo "$ac_cv_lib_termcap_tgetent" >&6; } +if test "x$ac_cv_lib_termcap_tgetent" = xyes; then : + _combo="$_combo -ltermcap" +fi + ;; esac diff --git a/m4/ChangeLog b/m4/ChangeLog index 62d2a6ee..9130a978 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,7 @@ +2015-06-15 Yuta SATOH + + * readline.m4: Add check for libtermcap on Gentoo/FreeBSD. + 2015-05-19 Arnold D. Robbins * 4.1.3: Release tar ball made. diff --git a/m4/readline.m4 b/m4/readline.m4 index 740b9c7b..5c0bb1ea 100644 --- a/m4/readline.m4 +++ b/m4/readline.m4 @@ -92,7 +92,7 @@ dnl action if not found: if test $_found_readline = yes ; then case $host_os in - *bsd* ) _combo="$_combo -ltermcap" + *bsd* ) AC_CHECK_LIB(termcap, tgetent, _combo="$_combo -ltermcap") ;; esac AC_DEFINE(HAVE_LIBREADLINE,1, -- cgit v1.2.3