diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rwxr-xr-x | configure | 41 | ||||
-rw-r--r-- | doc/ChangeLog | 11 | ||||
-rw-r--r-- | doc/gawk.info | 521 | ||||
-rw-r--r-- | doc/gawk.texi | 14 | ||||
-rw-r--r-- | doc/gawktexi.in | 14 | ||||
-rw-r--r-- | m4/ChangeLog | 4 | ||||
-rw-r--r-- | m4/readline.m4 | 2 | ||||
-rw-r--r-- | regcomp.c | 64 | ||||
-rw-r--r-- | regex_internal.c | 6 | ||||
-rw-r--r-- | regex_internal.h | 12 | ||||
-rw-r--r-- | regexec.c | 6 |
12 files changed, 395 insertions, 313 deletions
@@ -1,3 +1,16 @@ +2015-06-14 Arnold D. Robbins <arnold@skeeve.com> + + * regcomp.c, regex_internal.h, regexec.c: Sync with GLIBC. + + Unrelated: + + * 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-31 Arnold D. Robbins <arnold@skeeve.com> * field.c (posix_def_parse_field): Removed. It's no longer @@ -10798,7 +10798,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/doc/ChangeLog b/doc/ChangeLog index 4f0ab9b9..1a0a265f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,14 @@ +2015-06-13 Arnold D. Robbins <arnold@skeeve.com> + + * 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 <arnold@skeeve.com> + + * gawktexi.in: Add another pithy quote from Chet Ramey. Currently + commented out. + 2015-05-31 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: Revised description of default field parsing diff --git a/doc/gawk.info b/doc/gawk.info index 102bc769..bd325521 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -16442,23 +16442,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 @@ -35181,257 +35164,257 @@ Ref: Group Functions-Footnote-1676704 Node: Walking Arrays676911 Node: Library Functions Summary679921 Node: Library Exercises681327 -Node: Sample Programs682606 -Node: Running Examples683376 -Node: Clones684104 -Node: Cut Program685328 -Node: Egrep Program695049 -Ref: Egrep Program-Footnote-1702561 -Node: Id Program702671 -Node: Split Program706351 -Ref: Split Program-Footnote-1709810 -Node: Tee Program709939 -Node: Uniq Program712729 -Node: Wc Program720155 -Ref: Wc Program-Footnote-1724410 -Node: Miscellaneous Programs724504 -Node: Dupword Program725717 -Node: Alarm Program727747 -Node: Translate Program732602 -Ref: Translate Program-Footnote-1737167 -Node: Labels Program737437 -Ref: Labels Program-Footnote-1740788 -Node: Word Sorting740872 -Node: History Sorting744944 -Node: Extract Program746779 -Node: Simple Sed754310 -Node: Igawk Program757384 -Ref: Igawk Program-Footnote-1771715 -Ref: Igawk Program-Footnote-2771917 -Ref: Igawk Program-Footnote-3772039 -Node: Anagram Program772154 -Node: Signature Program775216 -Node: Programs Summary776463 -Node: Programs Exercises777678 -Ref: Programs Exercises-Footnote-1781807 -Node: Advanced Features781898 -Node: Nondecimal Data783888 -Node: Array Sorting785479 -Node: Controlling Array Traversal786179 -Ref: Controlling Array Traversal-Footnote-1794548 -Node: Array Sorting Functions794666 -Ref: Array Sorting Functions-Footnote-1798553 -Node: Two-way I/O798749 -Ref: Two-way I/O-Footnote-1803700 -Ref: Two-way I/O-Footnote-2803887 -Node: TCP/IP Networking803969 -Node: Profiling806876 -Node: Advanced Features Summary815147 -Node: Internationalization817083 -Node: I18N and L10N818563 -Node: Explaining gettext819250 -Ref: Explaining gettext-Footnote-1824273 -Ref: Explaining gettext-Footnote-2824458 -Node: Programmer i18n824623 -Ref: Programmer i18n-Footnote-1829479 -Node: Translator i18n829528 -Node: String Extraction830322 -Ref: String Extraction-Footnote-1831455 -Node: Printf Ordering831541 -Ref: Printf Ordering-Footnote-1834327 -Node: I18N Portability834391 -Ref: I18N Portability-Footnote-1836847 -Node: I18N Example836910 -Ref: I18N Example-Footnote-1839716 -Node: Gawk I18N839789 -Node: I18N Summary840434 -Node: Debugger841775 -Node: Debugging842797 -Node: Debugging Concepts843238 -Node: Debugging Terms845047 -Node: Awk Debugging847622 -Node: Sample Debugging Session848528 -Node: Debugger Invocation849062 -Node: Finding The Bug850448 -Node: List of Debugger Commands856926 -Node: Breakpoint Control858259 -Node: Debugger Execution Control861953 -Node: Viewing And Changing Data865315 -Node: Execution Stack868689 -Node: Debugger Info870326 -Node: Miscellaneous Debugger Commands874397 -Node: Readline Support879406 -Node: Limitations880302 -Node: Debugging Summary882411 -Node: Arbitrary Precision Arithmetic883584 -Node: Computer Arithmetic885000 -Ref: table-numeric-ranges888591 -Ref: Computer Arithmetic-Footnote-1889313 -Node: Math Definitions889370 -Ref: table-ieee-formats892684 -Ref: Math Definitions-Footnote-1893287 -Node: MPFR features893392 -Node: FP Math Caution895065 -Ref: FP Math Caution-Footnote-1896137 -Node: Inexactness of computations896506 -Node: Inexact representation897466 -Node: Comparing FP Values898826 -Node: Errors accumulate899908 -Node: Getting Accuracy901341 -Node: Try To Round904051 -Node: Setting precision904950 -Ref: table-predefined-precision-strings905647 -Node: Setting the rounding mode907477 -Ref: table-gawk-rounding-modes907851 -Ref: Setting the rounding mode-Footnote-1911259 -Node: Arbitrary Precision Integers911438 -Ref: Arbitrary Precision Integers-Footnote-1916355 -Node: POSIX Floating Point Problems916504 -Ref: POSIX Floating Point Problems-Footnote-1920386 -Node: Floating point summary920424 -Node: Dynamic Extensions922614 -Node: Extension Intro924167 -Node: Plugin License925433 -Node: Extension Mechanism Outline926230 -Ref: figure-load-extension926669 -Ref: figure-register-new-function928234 -Ref: figure-call-new-function929326 -Node: Extension API Description931389 -Node: Extension API Functions Introduction932923 -Node: General Data Types937782 -Ref: General Data Types-Footnote-1943737 -Node: Memory Allocation Functions944036 -Ref: Memory Allocation Functions-Footnote-1946881 -Node: Constructor Functions946980 -Node: Registration Functions948725 -Node: Extension Functions949410 -Node: Exit Callback Functions951709 -Node: Extension Version String952959 -Node: Input Parsers953622 -Node: Output Wrappers963507 -Node: Two-way processors968019 -Node: Printing Messages970283 -Ref: Printing Messages-Footnote-1971359 -Node: Updating 'ERRNO'971512 -Node: Requesting Values972253 -Ref: table-value-types-returned972992 -Node: Accessing Parameters973875 -Node: Symbol Table Access975111 -Node: Symbol table by name975623 -Node: Symbol table by cookie977644 -Ref: Symbol table by cookie-Footnote-1981793 -Node: Cached values981857 -Ref: Cached values-Footnote-1985358 -Node: Array Manipulation985449 -Ref: Array Manipulation-Footnote-1986540 -Node: Array Data Types986577 -Ref: Array Data Types-Footnote-1989235 -Node: Array Functions989327 -Node: Flattening Arrays993186 -Node: Creating Arrays1000094 -Node: Redirection API1004866 -Node: Extension API Variables1007697 -Node: Extension Versioning1008330 -Node: Extension API Informational Variables1010221 -Node: Extension API Boilerplate1011285 -Node: Finding Extensions1015099 -Node: Extension Example1015659 -Node: Internal File Description1016457 -Node: Internal File Ops1020537 -Ref: Internal File Ops-Footnote-11032299 -Node: Using Internal File Ops1032439 -Ref: Using Internal File Ops-Footnote-11034822 -Node: Extension Samples1035097 -Node: Extension Sample File Functions1036626 -Node: Extension Sample Fnmatch1044275 -Node: Extension Sample Fork1045762 -Node: Extension Sample Inplace1046980 -Node: Extension Sample Ord1049066 -Node: Extension Sample Readdir1049902 -Ref: table-readdir-file-types1050791 -Node: Extension Sample Revout1051596 -Node: Extension Sample Rev2way1052185 -Node: Extension Sample Read write array1052925 -Node: Extension Sample Readfile1054867 -Node: Extension Sample Time1055962 -Node: Extension Sample API Tests1057310 -Node: gawkextlib1057802 -Node: Extension summary1060249 -Node: Extension Exercises1063941 -Node: Language History1065438 -Node: V7/SVR3.11067094 -Node: SVR41069247 -Node: POSIX1070681 -Node: BTL1072061 -Node: POSIX/GNU1072791 -Node: Feature History1078630 -Node: Common Extensions1092949 -Node: Ranges and Locales1094232 -Ref: Ranges and Locales-Footnote-11098848 -Ref: Ranges and Locales-Footnote-21098875 -Ref: Ranges and Locales-Footnote-31099110 -Node: Contributors1099331 -Node: History summary1104900 -Node: Installation1106280 -Node: Gawk Distribution1107225 -Node: Getting1107709 -Node: Extracting1108532 -Node: Distribution contents1110170 -Node: Unix Installation1116266 -Node: Quick Installation1116948 -Node: Shell Startup Files1119362 -Node: Additional Configuration Options1120440 -Node: Configuration Philosophy1122245 -Node: Non-Unix Installation1124615 -Node: PC Installation1125073 -Node: PC Binary Installation1126393 -Node: PC Compiling1128245 -Ref: PC Compiling-Footnote-11131269 -Node: PC Testing1131378 -Node: PC Using1132558 -Node: Cygwin1136672 -Node: MSYS1137442 -Node: VMS Installation1137943 -Node: VMS Compilation1138734 -Ref: VMS Compilation-Footnote-11139964 -Node: VMS Dynamic Extensions1140022 -Node: VMS Installation Details1141707 -Node: VMS Running1143960 -Node: VMS GNV1146801 -Node: VMS Old Gawk1147536 -Node: Bugs1148007 -Node: Other Versions1152121 -Node: Installation summary1158595 -Node: Notes1159653 -Node: Compatibility Mode1160518 -Node: Additions1161300 -Node: Accessing The Source1162225 -Node: Adding Code1163661 -Node: New Ports1169816 -Node: Derived Files1174304 -Ref: Derived Files-Footnote-11179789 -Ref: Derived Files-Footnote-21179824 -Ref: Derived Files-Footnote-31180422 -Node: Future Extensions1180536 -Node: Implementation Limitations1181194 -Node: Extension Design1182377 -Node: Old Extension Problems1183531 -Ref: Old Extension Problems-Footnote-11185049 -Node: Extension New Mechanism Goals1185106 -Ref: Extension New Mechanism Goals-Footnote-11188470 -Node: Extension Other Design Decisions1188659 -Node: Extension Future Growth1190772 -Node: Old Extension Mechanism1191608 -Node: Notes summary1193371 -Node: Basic Concepts1194553 -Node: Basic High Level1195234 -Ref: figure-general-flow1195516 -Ref: figure-process-flow1196201 -Ref: Basic High Level-Footnote-11199502 -Node: Basic Data Typing1199687 -Node: Glossary1203015 -Node: Copying1234961 -Node: GNU Free Documentation License1272500 -Node: Index1297618 +Node: Sample Programs681792 +Node: Running Examples682562 +Node: Clones683290 +Node: Cut Program684514 +Node: Egrep Program694235 +Ref: Egrep Program-Footnote-1701747 +Node: Id Program701857 +Node: Split Program705537 +Ref: Split Program-Footnote-1708996 +Node: Tee Program709125 +Node: Uniq Program711915 +Node: Wc Program719341 +Ref: Wc Program-Footnote-1723596 +Node: Miscellaneous Programs723690 +Node: Dupword Program724903 +Node: Alarm Program726933 +Node: Translate Program731788 +Ref: Translate Program-Footnote-1736353 +Node: Labels Program736623 +Ref: Labels Program-Footnote-1739974 +Node: Word Sorting740058 +Node: History Sorting744130 +Node: Extract Program745965 +Node: Simple Sed753496 +Node: Igawk Program756570 +Ref: Igawk Program-Footnote-1770901 +Ref: Igawk Program-Footnote-2771103 +Ref: Igawk Program-Footnote-3771225 +Node: Anagram Program771340 +Node: Signature Program774402 +Node: Programs Summary775649 +Node: Programs Exercises776864 +Ref: Programs Exercises-Footnote-1780993 +Node: Advanced Features781084 +Node: Nondecimal Data783074 +Node: Array Sorting784665 +Node: Controlling Array Traversal785365 +Ref: Controlling Array Traversal-Footnote-1793734 +Node: Array Sorting Functions793852 +Ref: Array Sorting Functions-Footnote-1797739 +Node: Two-way I/O797935 +Ref: Two-way I/O-Footnote-1802886 +Ref: Two-way I/O-Footnote-2803073 +Node: TCP/IP Networking803155 +Node: Profiling806062 +Node: Advanced Features Summary814333 +Node: Internationalization816269 +Node: I18N and L10N817749 +Node: Explaining gettext818436 +Ref: Explaining gettext-Footnote-1823459 +Ref: Explaining gettext-Footnote-2823644 +Node: Programmer i18n823809 +Ref: Programmer i18n-Footnote-1828665 +Node: Translator i18n828714 +Node: String Extraction829508 +Ref: String Extraction-Footnote-1830641 +Node: Printf Ordering830727 +Ref: Printf Ordering-Footnote-1833513 +Node: I18N Portability833577 +Ref: I18N Portability-Footnote-1836033 +Node: I18N Example836096 +Ref: I18N Example-Footnote-1838902 +Node: Gawk I18N838975 +Node: I18N Summary839620 +Node: Debugger840961 +Node: Debugging841983 +Node: Debugging Concepts842424 +Node: Debugging Terms844233 +Node: Awk Debugging846808 +Node: Sample Debugging Session847714 +Node: Debugger Invocation848248 +Node: Finding The Bug849634 +Node: List of Debugger Commands856112 +Node: Breakpoint Control857445 +Node: Debugger Execution Control861139 +Node: Viewing And Changing Data864501 +Node: Execution Stack867875 +Node: Debugger Info869512 +Node: Miscellaneous Debugger Commands873583 +Node: Readline Support878592 +Node: Limitations879488 +Node: Debugging Summary881597 +Node: Arbitrary Precision Arithmetic882770 +Node: Computer Arithmetic884186 +Ref: table-numeric-ranges887777 +Ref: Computer Arithmetic-Footnote-1888499 +Node: Math Definitions888556 +Ref: table-ieee-formats891870 +Ref: Math Definitions-Footnote-1892473 +Node: MPFR features892578 +Node: FP Math Caution894251 +Ref: FP Math Caution-Footnote-1895323 +Node: Inexactness of computations895692 +Node: Inexact representation896652 +Node: Comparing FP Values898012 +Node: Errors accumulate899094 +Node: Getting Accuracy900527 +Node: Try To Round903237 +Node: Setting precision904136 +Ref: table-predefined-precision-strings904833 +Node: Setting the rounding mode906663 +Ref: table-gawk-rounding-modes907037 +Ref: Setting the rounding mode-Footnote-1910445 +Node: Arbitrary Precision Integers910624 +Ref: Arbitrary Precision Integers-Footnote-1915541 +Node: POSIX Floating Point Problems915690 +Ref: POSIX Floating Point Problems-Footnote-1919572 +Node: Floating point summary919610 +Node: Dynamic Extensions921800 +Node: Extension Intro923353 +Node: Plugin License924619 +Node: Extension Mechanism Outline925416 +Ref: figure-load-extension925855 +Ref: figure-register-new-function927420 +Ref: figure-call-new-function928512 +Node: Extension API Description930575 +Node: Extension API Functions Introduction932109 +Node: General Data Types936968 +Ref: General Data Types-Footnote-1942923 +Node: Memory Allocation Functions943222 +Ref: Memory Allocation Functions-Footnote-1946067 +Node: Constructor Functions946166 +Node: Registration Functions947911 +Node: Extension Functions948596 +Node: Exit Callback Functions950895 +Node: Extension Version String952145 +Node: Input Parsers952808 +Node: Output Wrappers962693 +Node: Two-way processors967205 +Node: Printing Messages969469 +Ref: Printing Messages-Footnote-1970545 +Node: Updating 'ERRNO'970698 +Node: Requesting Values971439 +Ref: table-value-types-returned972178 +Node: Accessing Parameters973061 +Node: Symbol Table Access974297 +Node: Symbol table by name974809 +Node: Symbol table by cookie976830 +Ref: Symbol table by cookie-Footnote-1980979 +Node: Cached values981043 +Ref: Cached values-Footnote-1984544 +Node: Array Manipulation984635 +Ref: Array Manipulation-Footnote-1985726 +Node: Array Data Types985763 +Ref: Array Data Types-Footnote-1988421 +Node: Array Functions988513 +Node: Flattening Arrays992372 +Node: Creating Arrays999280 +Node: Redirection API1004052 +Node: Extension API Variables1006883 +Node: Extension Versioning1007516 +Node: Extension API Informational Variables1009407 +Node: Extension API Boilerplate1010471 +Node: Finding Extensions1014285 +Node: Extension Example1014845 +Node: Internal File Description1015643 +Node: Internal File Ops1019723 +Ref: Internal File Ops-Footnote-11031485 +Node: Using Internal File Ops1031625 +Ref: Using Internal File Ops-Footnote-11034008 +Node: Extension Samples1034283 +Node: Extension Sample File Functions1035812 +Node: Extension Sample Fnmatch1043461 +Node: Extension Sample Fork1044948 +Node: Extension Sample Inplace1046166 +Node: Extension Sample Ord1048252 +Node: Extension Sample Readdir1049088 +Ref: table-readdir-file-types1049977 +Node: Extension Sample Revout1050782 +Node: Extension Sample Rev2way1051371 +Node: Extension Sample Read write array1052111 +Node: Extension Sample Readfile1054053 +Node: Extension Sample Time1055148 +Node: Extension Sample API Tests1056496 +Node: gawkextlib1056988 +Node: Extension summary1059435 +Node: Extension Exercises1063127 +Node: Language History1064624 +Node: V7/SVR3.11066280 +Node: SVR41068433 +Node: POSIX1069867 +Node: BTL1071247 +Node: POSIX/GNU1071977 +Node: Feature History1077816 +Node: Common Extensions1092135 +Node: Ranges and Locales1093418 +Ref: Ranges and Locales-Footnote-11098034 +Ref: Ranges and Locales-Footnote-21098061 +Ref: Ranges and Locales-Footnote-31098296 +Node: Contributors1098517 +Node: History summary1104086 +Node: Installation1105466 +Node: Gawk Distribution1106411 +Node: Getting1106895 +Node: Extracting1107718 +Node: Distribution contents1109356 +Node: Unix Installation1115452 +Node: Quick Installation1116134 +Node: Shell Startup Files1118548 +Node: Additional Configuration Options1119626 +Node: Configuration Philosophy1121431 +Node: Non-Unix Installation1123801 +Node: PC Installation1124259 +Node: PC Binary Installation1125579 +Node: PC Compiling1127431 +Ref: PC Compiling-Footnote-11130455 +Node: PC Testing1130564 +Node: PC Using1131744 +Node: Cygwin1135858 +Node: MSYS1136628 +Node: VMS Installation1137129 +Node: VMS Compilation1137920 +Ref: VMS Compilation-Footnote-11139150 +Node: VMS Dynamic Extensions1139208 +Node: VMS Installation Details1140893 +Node: VMS Running1143146 +Node: VMS GNV1145987 +Node: VMS Old Gawk1146722 +Node: Bugs1147193 +Node: Other Versions1151307 +Node: Installation summary1157781 +Node: Notes1158839 +Node: Compatibility Mode1159704 +Node: Additions1160486 +Node: Accessing The Source1161411 +Node: Adding Code1162847 +Node: New Ports1169002 +Node: Derived Files1173490 +Ref: Derived Files-Footnote-11178975 +Ref: Derived Files-Footnote-21179010 +Ref: Derived Files-Footnote-31179608 +Node: Future Extensions1179722 +Node: Implementation Limitations1180380 +Node: Extension Design1181563 +Node: Old Extension Problems1182717 +Ref: Old Extension Problems-Footnote-11184235 +Node: Extension New Mechanism Goals1184292 +Ref: Extension New Mechanism Goals-Footnote-11187656 +Node: Extension Other Design Decisions1187845 +Node: Extension Future Growth1189958 +Node: Old Extension Mechanism1190794 +Node: Notes summary1192557 +Node: Basic Concepts1193739 +Node: Basic High Level1194420 +Ref: figure-general-flow1194702 +Ref: figure-process-flow1195387 +Ref: Basic High Level-Footnote-11198688 +Node: Basic Data Typing1198873 +Node: Glossary1202201 +Node: Copying1234147 +Node: GNU Free Documentation License1271686 +Node: Index1296804 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index c2c1f469..d61a47de 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -23311,6 +23311,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 @@ -23328,6 +23330,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 @@ -38640,6 +38643,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 <chet.ramey@case.edu> + +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 639f13ef..47482816 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -22402,6 +22402,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 @@ -22419,6 +22421,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 @@ -37731,6 +37734,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 <chet.ramey@case.edu> + +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/m4/ChangeLog b/m4/ChangeLog index 82e0dabe..f271d0ef 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,7 @@ +2015-06-15 Yuta SATOH <nigoro@gentoo.gr.jp> + + * readline.m4: Add check for libtermcap on Gentoo/FreeBSD. + 2015-05-19 Arnold D. Robbins <arnold@skeeve.com> * 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, @@ -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. */ @@ -1558,7 +1558,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) { @@ -1567,7 +1567,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)) @@ -1710,7 +1710,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; @@ -1777,11 +1777,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) { @@ -2143,7 +2143,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 <reg_exp>: CAT / \ @@ -2185,7 +2185,7 @@ parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax, / \ <branch1> <branch2> - 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, @@ -2681,7 +2681,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 @@ -2855,13 +2855,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; @@ -2887,7 +2887,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) @@ -2947,15 +2947,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) { @@ -3028,14 +3028,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) { @@ -3474,7 +3474,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 @@ -3568,7 +3568,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.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/regex_internal.h b/regex_internal.h index 327bd7e0..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 @@ -803,6 +800,10 @@ re_string_wchar_at (const re_string_t *pstr, int idx) } # ifndef NOT_IN_libc +# ifdef _LIBC +# include <locale/weight.h> +# endif + static int internal_function __attribute__ ((pure, unused)) re_string_elem_size_at (const re_string_t *pstr, int idx) @@ -810,7 +811,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 <locale/weight.h> uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); if (nrules != 0) @@ -17,6 +17,10 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_STDINT_H +#include <stdint.h> +#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; @@ -1055,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) { |