diff options
-rw-r--r-- | doc/ChangeLog | 4 | ||||
-rw-r--r-- | doc/gawk.info | 1104 | ||||
-rw-r--r-- | doc/gawk.texi | 22 | ||||
-rw-r--r-- | doc/gawktexi.in | 22 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 10 | ||||
-rw-r--r-- | test/Makefile.in | 10 | ||||
-rw-r--r-- | test/profile0.awk | 1 | ||||
-rw-r--r-- | test/profile0.in | 2 | ||||
-rw-r--r-- | test/profile0.ok | 6 |
10 files changed, 616 insertions, 570 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 171de6b7..47ecf74c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-10 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in: Minor fixes, O'Reilly fixes. + 2015-02-09 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: Restore a lost sentence. O'Reilly fixes. diff --git a/doc/gawk.info b/doc/gawk.info index d1cb9215..876e1bc3 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -1375,6 +1375,12 @@ also must acknowledge my gratitude to G-d, for the many opportunities He has sent my way, as well as for the gifts He has given me with which to take advantage of those opportunities. + +Arnold Robbins +Nof Ayalon +Israel +February 2015 + File: gawk.info, Node: Getting Started, Next: Invoking Gawk, Prev: Preface, Up: Top @@ -23129,8 +23135,8 @@ indicates what is in the `union'. Representing numbers is easy--the API uses a C `double'. Strings require more work. Because `gawk' allows embedded NUL bytes in string -values, a string must be represented as a pair containing a -data-pointer and length. This is the `awk_string_t' type. +values, a string must be represented as a pair containing a data +pointer and length. This is the `awk_string_t' type. Identifiers (i.e., the names of global variables) can be associated with either scalar values or with arrays. In addition, `gawk' provides @@ -23142,12 +23148,12 @@ Manipulation::. of the `union' as if they were fields in a `struct'; this is a common coding practice in C. Such code is easier to write and to read, but it remains _your_ responsibility to make sure that the `val_type' member -correctly reflects the type of the value in the `awk_value_t'. +correctly reflects the type of the value in the `awk_value_t' struct. Conceptually, the first three members of the `union' (number, string, and array) are all that is needed for working with `awk' values. However, because the API provides routines for accessing and changing -the value of global scalar variables only by using the variable's name, +the value of a global scalar variable only by using the variable's name, there is a performance penalty: `gawk' must find the variable each time it is accessed and changed. This turns out to be a real issue, not just a theoretical one. @@ -23156,17 +23162,19 @@ just a theoretical one. reading and/or changing the value of one or more scalar variables, you can obtain a "scalar cookie"(1) object for that variable, and then use the cookie for getting the variable's value or for changing the -variable's value. This is the `awk_scalar_t' type and `scalar_cookie' -macro. Given a scalar cookie, `gawk' can directly retrieve or modify -the value, as required, without having to find it first. +variable's value. The `awk_scalar_t' type holds a scalar cookie, and +the `scalar_cookie' macro provides access to the value of that type in +the `awk_value_t' struct. Given a scalar cookie, `gawk' can directly +retrieve or modify the value, as required, without having to find it +first. The `awk_value_cookie_t' type and `value_cookie' macro are similar. If you know that you wish to use the same numeric or string _value_ for one or more variables, you can create the value once, retaining a "value cookie" for it, and then pass in that value cookie whenever you -wish to set the value of a variable. This saves both storage space -within the running `gawk' process as well as the time needed to create -the value. +wish to set the value of a variable. This both storage space within +the running `gawk' process and reduces the time needed to create the +value. ---------- Footnotes ---------- @@ -34671,543 +34679,543 @@ Ref: Manual History-Footnote-167073 Ref: Manual History-Footnote-267114 Node: How To Contribute67188 Node: Acknowledgments68317 -Node: Getting Started73134 -Node: Running gawk75573 -Node: One-shot76763 -Node: Read Terminal78027 -Node: Long80058 -Node: Executable Scripts81571 -Ref: Executable Scripts-Footnote-184360 -Node: Comments84463 -Node: Quoting86945 -Node: DOS Quoting92463 -Node: Sample Data Files93138 -Node: Very Simple95733 -Node: Two Rules100632 -Node: More Complex102518 -Node: Statements/Lines105380 -Ref: Statements/Lines-Footnote-1109835 -Node: Other Features110100 -Node: When111036 -Ref: When-Footnote-1112790 -Node: Intro Summary112855 -Node: Invoking Gawk113739 -Node: Command Line115253 -Node: Options116051 -Ref: Options-Footnote-1131846 -Ref: Options-Footnote-2132075 -Node: Other Arguments132100 -Node: Naming Standard Input135048 -Node: Environment Variables136141 -Node: AWKPATH Variable136699 -Ref: AWKPATH Variable-Footnote-1140106 -Ref: AWKPATH Variable-Footnote-2140151 -Node: AWKLIBPATH Variable140411 -Node: Other Environment Variables141667 -Node: Exit Status145185 -Node: Include Files145861 -Node: Loading Shared Libraries149450 -Node: Obsolete150877 -Node: Undocumented151569 -Node: Invoking Summary151836 -Node: Regexp153499 -Node: Regexp Usage154953 -Node: Escape Sequences156990 -Node: Regexp Operators163219 -Ref: Regexp Operators-Footnote-1170629 -Ref: Regexp Operators-Footnote-2170776 -Node: Bracket Expressions170874 -Ref: table-char-classes172889 -Node: Leftmost Longest175831 -Node: Computed Regexps177133 -Node: GNU Regexp Operators180562 -Node: Case-sensitivity184234 -Ref: Case-sensitivity-Footnote-1187119 -Ref: Case-sensitivity-Footnote-2187354 -Node: Regexp Summary187462 -Node: Reading Files188929 -Node: Records191022 -Node: awk split records191755 -Node: gawk split records196684 -Ref: gawk split records-Footnote-1201223 -Node: Fields201260 -Ref: Fields-Footnote-1204038 -Node: Nonconstant Fields204124 -Ref: Nonconstant Fields-Footnote-1206362 -Node: Changing Fields206565 -Node: Field Separators212496 -Node: Default Field Splitting215200 -Node: Regexp Field Splitting216317 -Node: Single Character Fields219667 -Node: Command Line Field Separator220726 -Node: Full Line Fields223943 -Ref: Full Line Fields-Footnote-1225464 -Ref: Full Line Fields-Footnote-2225510 -Node: Field Splitting Summary225611 -Node: Constant Size227685 -Node: Splitting By Content232268 -Ref: Splitting By Content-Footnote-1236233 -Node: Multiple Line236396 -Ref: Multiple Line-Footnote-1242277 -Node: Getline242456 -Node: Plain Getline244663 -Node: Getline/Variable247303 -Node: Getline/File248452 -Node: Getline/Variable/File249837 -Ref: Getline/Variable/File-Footnote-1251440 -Node: Getline/Pipe251527 -Node: Getline/Variable/Pipe254205 -Node: Getline/Coprocess255336 -Node: Getline/Variable/Coprocess256600 -Node: Getline Notes257339 -Node: Getline Summary260133 -Ref: table-getline-variants260545 -Node: Read Timeout261374 -Ref: Read Timeout-Footnote-1265211 -Node: Command-line directories265269 -Node: Input Summary266174 -Node: Input Exercises269559 -Node: Printing270287 -Node: Print272064 -Node: Print Examples273521 -Node: Output Separators276300 -Node: OFMT278318 -Node: Printf279673 -Node: Basic Printf280458 -Node: Control Letters282030 -Node: Format Modifiers286015 -Node: Printf Examples292025 -Node: Redirection294511 -Node: Special FD301349 -Ref: Special FD-Footnote-1304515 -Node: Special Files304589 -Node: Other Inherited Files305206 -Node: Special Network306206 -Node: Special Caveats307068 -Node: Close Files And Pipes308017 -Ref: Close Files And Pipes-Footnote-1315208 -Ref: Close Files And Pipes-Footnote-2315356 -Node: Output Summary315506 -Node: Output Exercises316504 -Node: Expressions317184 -Node: Values318373 -Node: Constants319050 -Node: Scalar Constants319741 -Ref: Scalar Constants-Footnote-1320603 -Node: Nondecimal-numbers320853 -Node: Regexp Constants323863 -Node: Using Constant Regexps324389 -Node: Variables327552 -Node: Using Variables328209 -Node: Assignment Options330120 -Node: Conversion331995 -Node: Strings And Numbers332519 -Ref: Strings And Numbers-Footnote-1335584 -Node: Locale influences conversions335693 -Ref: table-locale-affects338439 -Node: All Operators339031 -Node: Arithmetic Ops339660 -Node: Concatenation342165 -Ref: Concatenation-Footnote-1344984 -Node: Assignment Ops345091 -Ref: table-assign-ops350070 -Node: Increment Ops351380 -Node: Truth Values and Conditions354811 -Node: Truth Values355894 -Node: Typing and Comparison356943 -Node: Variable Typing357759 -Node: Comparison Operators361426 -Ref: table-relational-ops361836 -Node: POSIX String Comparison365331 -Ref: POSIX String Comparison-Footnote-1366403 -Node: Boolean Ops366542 -Ref: Boolean Ops-Footnote-1371020 -Node: Conditional Exp371111 -Node: Function Calls372849 -Node: Precedence376729 -Node: Locales380389 -Node: Expressions Summary382021 -Node: Patterns and Actions384592 -Node: Pattern Overview385712 -Node: Regexp Patterns387391 -Node: Expression Patterns387934 -Node: Ranges391714 -Node: BEGIN/END394821 -Node: Using BEGIN/END395582 -Ref: Using BEGIN/END-Footnote-1398318 -Node: I/O And BEGIN/END398424 -Node: BEGINFILE/ENDFILE400739 -Node: Empty403636 -Node: Using Shell Variables403953 -Node: Action Overview406226 -Node: Statements408552 -Node: If Statement410400 -Node: While Statement411895 -Node: Do Statement413923 -Node: For Statement415071 -Node: Switch Statement418229 -Node: Break Statement420611 -Node: Continue Statement422652 -Node: Next Statement424479 -Node: Nextfile Statement426860 -Node: Exit Statement429488 -Node: Built-in Variables431899 -Node: User-modified433032 -Ref: User-modified-Footnote-1440735 -Node: Auto-set440797 -Ref: Auto-set-Footnote-1454506 -Ref: Auto-set-Footnote-2454711 -Node: ARGC and ARGV454767 -Node: Pattern Action Summary458985 -Node: Arrays461418 -Node: Array Basics462747 -Node: Array Intro463591 -Ref: figure-array-elements465525 -Ref: Array Intro-Footnote-1468145 -Node: Reference to Elements468273 -Node: Assigning Elements470735 -Node: Array Example471226 -Node: Scanning an Array472985 -Node: Controlling Scanning476005 -Ref: Controlling Scanning-Footnote-1481399 -Node: Numeric Array Subscripts481715 -Node: Uninitialized Subscripts483900 -Node: Delete485517 -Ref: Delete-Footnote-1488266 -Node: Multidimensional488323 -Node: Multiscanning491420 -Node: Arrays of Arrays493009 -Node: Arrays Summary497763 -Node: Functions499854 -Node: Built-in500893 -Node: Calling Built-in501971 -Node: Numeric Functions503966 -Ref: Numeric Functions-Footnote-1508784 -Ref: Numeric Functions-Footnote-2509141 -Ref: Numeric Functions-Footnote-3509189 -Node: String Functions509461 -Ref: String Functions-Footnote-1532962 -Ref: String Functions-Footnote-2533091 -Ref: String Functions-Footnote-3533339 -Node: Gory Details533426 -Ref: table-sub-escapes535207 -Ref: table-sub-proposed536722 -Ref: table-posix-sub538084 -Ref: table-gensub-escapes539621 -Ref: Gory Details-Footnote-1540454 -Node: I/O Functions540605 -Ref: I/O Functions-Footnote-1547841 -Node: Time Functions547988 -Ref: Time Functions-Footnote-1558497 -Ref: Time Functions-Footnote-2558565 -Ref: Time Functions-Footnote-3558723 -Ref: Time Functions-Footnote-4558834 -Ref: Time Functions-Footnote-5558946 -Ref: Time Functions-Footnote-6559173 -Node: Bitwise Functions559439 -Ref: table-bitwise-ops560001 -Ref: Bitwise Functions-Footnote-1564329 -Node: Type Functions564501 -Node: I18N Functions565653 -Node: User-defined567300 -Node: Definition Syntax568105 -Ref: Definition Syntax-Footnote-1573764 -Node: Function Example573835 -Ref: Function Example-Footnote-1576756 -Node: Function Caveats576778 -Node: Calling A Function577296 -Node: Variable Scope578254 -Node: Pass By Value/Reference581247 -Node: Return Statement584744 -Node: Dynamic Typing587723 -Node: Indirect Calls588652 -Ref: Indirect Calls-Footnote-1599958 -Node: Functions Summary600086 -Node: Library Functions602788 -Ref: Library Functions-Footnote-1606396 -Ref: Library Functions-Footnote-2606539 -Node: Library Names606710 -Ref: Library Names-Footnote-1610168 -Ref: Library Names-Footnote-2610391 -Node: General Functions610477 -Node: Strtonum Function611580 -Node: Assert Function614602 -Node: Round Function617926 -Node: Cliff Random Function619467 -Node: Ordinal Functions620483 -Ref: Ordinal Functions-Footnote-1623546 -Ref: Ordinal Functions-Footnote-2623798 -Node: Join Function624009 -Ref: Join Function-Footnote-1625779 -Node: Getlocaltime Function625979 -Node: Readfile Function629723 -Node: Shell Quoting631695 -Node: Data File Management633096 -Node: Filetrans Function633728 -Node: Rewind Function637824 -Node: File Checking639210 -Ref: File Checking-Footnote-1640543 -Node: Empty Files640744 -Node: Ignoring Assigns642723 -Node: Getopt Function644273 -Ref: Getopt Function-Footnote-1655737 -Node: Passwd Functions655937 -Ref: Passwd Functions-Footnote-1664777 -Node: Group Functions664865 -Ref: Group Functions-Footnote-1672762 -Node: Walking Arrays672967 -Node: Library Functions Summary674567 -Node: Library Exercises675971 -Node: Sample Programs677251 -Node: Running Examples678021 -Node: Clones678749 -Node: Cut Program679973 -Node: Egrep Program689693 -Ref: Egrep Program-Footnote-1697196 -Node: Id Program697306 -Node: Split Program700982 -Ref: Split Program-Footnote-1704436 -Node: Tee Program704564 -Node: Uniq Program707353 -Node: Wc Program714772 -Ref: Wc Program-Footnote-1719022 -Node: Miscellaneous Programs719116 -Node: Dupword Program720329 -Node: Alarm Program722360 -Node: Translate Program727165 -Ref: Translate Program-Footnote-1731728 -Node: Labels Program731998 -Ref: Labels Program-Footnote-1735349 -Node: Word Sorting735433 -Node: History Sorting739503 -Node: Extract Program741338 -Node: Simple Sed748862 -Node: Igawk Program751932 -Ref: Igawk Program-Footnote-1766258 -Ref: Igawk Program-Footnote-2766459 -Ref: Igawk Program-Footnote-3766581 -Node: Anagram Program766696 -Node: Signature Program769757 -Node: Programs Summary771004 -Node: Programs Exercises772225 -Ref: Programs Exercises-Footnote-1776356 -Node: Advanced Features776447 -Node: Nondecimal Data778429 -Node: Array Sorting780019 -Node: Controlling Array Traversal780719 -Ref: Controlling Array Traversal-Footnote-1789085 -Node: Array Sorting Functions789203 -Ref: Array Sorting Functions-Footnote-1793089 -Node: Two-way I/O793285 -Ref: Two-way I/O-Footnote-1798230 -Ref: Two-way I/O-Footnote-2798416 -Node: TCP/IP Networking798498 -Node: Profiling801370 -Node: Advanced Features Summary809641 -Node: Internationalization811574 -Node: I18N and L10N813054 -Node: Explaining gettext813740 -Ref: Explaining gettext-Footnote-1818765 -Ref: Explaining gettext-Footnote-2818949 -Node: Programmer i18n819114 -Ref: Programmer i18n-Footnote-1823990 -Node: Translator i18n824039 -Node: String Extraction824833 -Ref: String Extraction-Footnote-1825964 -Node: Printf Ordering826050 -Ref: Printf Ordering-Footnote-1828836 -Node: I18N Portability828900 -Ref: I18N Portability-Footnote-1831356 -Node: I18N Example831419 -Ref: I18N Example-Footnote-1834222 -Node: Gawk I18N834294 -Node: I18N Summary834938 -Node: Debugger836278 -Node: Debugging837300 -Node: Debugging Concepts837741 -Node: Debugging Terms839551 -Node: Awk Debugging842123 -Node: Sample Debugging Session843029 -Node: Debugger Invocation843563 -Node: Finding The Bug844948 -Node: List of Debugger Commands851427 -Node: Breakpoint Control852759 -Node: Debugger Execution Control856436 -Node: Viewing And Changing Data859795 -Node: Execution Stack863171 -Node: Debugger Info864806 -Node: Miscellaneous Debugger Commands868851 -Node: Readline Support873852 -Node: Limitations874746 -Node: Debugging Summary876861 -Node: Arbitrary Precision Arithmetic878035 -Node: Computer Arithmetic879451 -Ref: table-numeric-ranges883050 -Ref: Computer Arithmetic-Footnote-1883574 -Node: Math Definitions883631 -Ref: table-ieee-formats886926 -Ref: Math Definitions-Footnote-1887530 -Node: MPFR features887635 -Node: FP Math Caution889306 -Ref: FP Math Caution-Footnote-1890356 -Node: Inexactness of computations890725 -Node: Inexact representation891684 -Node: Comparing FP Values893042 -Node: Errors accumulate894124 -Node: Getting Accuracy895556 -Node: Try To Round898260 -Node: Setting precision899159 -Ref: table-predefined-precision-strings899843 -Node: Setting the rounding mode901672 -Ref: table-gawk-rounding-modes902036 -Ref: Setting the rounding mode-Footnote-1905488 -Node: Arbitrary Precision Integers905667 -Ref: Arbitrary Precision Integers-Footnote-1910565 -Node: POSIX Floating Point Problems910714 -Ref: POSIX Floating Point Problems-Footnote-1914593 -Node: Floating point summary914631 -Node: Dynamic Extensions916827 -Node: Extension Intro918379 -Node: Plugin License919644 -Node: Extension Mechanism Outline920441 -Ref: figure-load-extension920869 -Ref: figure-register-new-function922349 -Ref: figure-call-new-function923353 -Node: Extension API Description925340 -Node: Extension API Functions Introduction926790 -Node: General Data Types931611 -Ref: General Data Types-Footnote-1937418 -Node: Memory Allocation Functions937717 -Ref: Memory Allocation Functions-Footnote-1940556 -Node: Constructor Functions940652 -Node: Registration Functions942386 -Node: Extension Functions943071 -Node: Exit Callback Functions945368 -Node: Extension Version String946616 -Node: Input Parsers947281 -Node: Output Wrappers957160 -Node: Two-way processors961675 -Node: Printing Messages963879 -Ref: Printing Messages-Footnote-1964955 -Node: Updating `ERRNO'965107 -Node: Requesting Values965847 -Ref: table-value-types-returned966575 -Node: Accessing Parameters967532 -Node: Symbol Table Access968763 -Node: Symbol table by name969277 -Node: Symbol table by cookie971258 -Ref: Symbol table by cookie-Footnote-1975402 -Node: Cached values975465 -Ref: Cached values-Footnote-1978964 -Node: Array Manipulation979055 -Ref: Array Manipulation-Footnote-1980153 -Node: Array Data Types980190 -Ref: Array Data Types-Footnote-1982845 -Node: Array Functions982937 -Node: Flattening Arrays986791 -Node: Creating Arrays993683 -Node: Extension API Variables998454 -Node: Extension Versioning999090 -Node: Extension API Informational Variables1000991 -Node: Extension API Boilerplate1002056 -Node: Finding Extensions1005865 -Node: Extension Example1006425 -Node: Internal File Description1007197 -Node: Internal File Ops1011264 -Ref: Internal File Ops-Footnote-11022934 -Node: Using Internal File Ops1023074 -Ref: Using Internal File Ops-Footnote-11025457 -Node: Extension Samples1025730 -Node: Extension Sample File Functions1027256 -Node: Extension Sample Fnmatch1034894 -Node: Extension Sample Fork1036385 -Node: Extension Sample Inplace1037600 -Node: Extension Sample Ord1039275 -Node: Extension Sample Readdir1040111 -Ref: table-readdir-file-types1040987 -Node: Extension Sample Revout1041798 -Node: Extension Sample Rev2way1042388 -Node: Extension Sample Read write array1043128 -Node: Extension Sample Readfile1045068 -Node: Extension Sample Time1046163 -Node: Extension Sample API Tests1047512 -Node: gawkextlib1048003 -Node: Extension summary1050661 -Node: Extension Exercises1054350 -Node: Language History1055072 -Node: V7/SVR3.11056728 -Node: SVR41058909 -Node: POSIX1060354 -Node: BTL1061743 -Node: POSIX/GNU1062477 -Node: Feature History1068266 -Node: Common Extensions1081992 -Node: Ranges and Locales1083316 -Ref: Ranges and Locales-Footnote-11087934 -Ref: Ranges and Locales-Footnote-21087961 -Ref: Ranges and Locales-Footnote-31088195 -Node: Contributors1088416 -Node: History summary1093957 -Node: Installation1095327 -Node: Gawk Distribution1096273 -Node: Getting1096757 -Node: Extracting1097580 -Node: Distribution contents1099215 -Node: Unix Installation1105280 -Node: Quick Installation1105963 -Node: Shell Startup Files1108374 -Node: Additional Configuration Options1109453 -Node: Configuration Philosophy1111192 -Node: Non-Unix Installation1113561 -Node: PC Installation1114019 -Node: PC Binary Installation1115338 -Node: PC Compiling1117186 -Ref: PC Compiling-Footnote-11120207 -Node: PC Testing1120316 -Node: PC Using1121492 -Node: Cygwin1125607 -Node: MSYS1126430 -Node: VMS Installation1126930 -Node: VMS Compilation1127722 -Ref: VMS Compilation-Footnote-11128944 -Node: VMS Dynamic Extensions1129002 -Node: VMS Installation Details1130686 -Node: VMS Running1132938 -Node: VMS GNV1135774 -Node: VMS Old Gawk1136508 -Node: Bugs1136978 -Node: Other Versions1140861 -Node: Installation summary1147285 -Node: Notes1148341 -Node: Compatibility Mode1149206 -Node: Additions1149988 -Node: Accessing The Source1150913 -Node: Adding Code1152348 -Node: New Ports1158505 -Node: Derived Files1162987 -Ref: Derived Files-Footnote-11168462 -Ref: Derived Files-Footnote-21168496 -Ref: Derived Files-Footnote-31169092 -Node: Future Extensions1169206 -Node: Implementation Limitations1169812 -Node: Extension Design1171060 -Node: Old Extension Problems1172214 -Ref: Old Extension Problems-Footnote-11173731 -Node: Extension New Mechanism Goals1173788 -Ref: Extension New Mechanism Goals-Footnote-11177148 -Node: Extension Other Design Decisions1177337 -Node: Extension Future Growth1179445 -Node: Old Extension Mechanism1180281 -Node: Notes summary1182043 -Node: Basic Concepts1183229 -Node: Basic High Level1183910 -Ref: figure-general-flow1184182 -Ref: figure-process-flow1184781 -Ref: Basic High Level-Footnote-11188010 -Node: Basic Data Typing1188195 -Node: Glossary1191523 -Node: Copying1223452 -Node: GNU Free Documentation License1261008 -Node: Index1286144 +Node: Getting Started73183 +Node: Running gawk75622 +Node: One-shot76812 +Node: Read Terminal78076 +Node: Long80107 +Node: Executable Scripts81620 +Ref: Executable Scripts-Footnote-184409 +Node: Comments84512 +Node: Quoting86994 +Node: DOS Quoting92512 +Node: Sample Data Files93187 +Node: Very Simple95782 +Node: Two Rules100681 +Node: More Complex102567 +Node: Statements/Lines105429 +Ref: Statements/Lines-Footnote-1109884 +Node: Other Features110149 +Node: When111085 +Ref: When-Footnote-1112839 +Node: Intro Summary112904 +Node: Invoking Gawk113788 +Node: Command Line115302 +Node: Options116100 +Ref: Options-Footnote-1131895 +Ref: Options-Footnote-2132124 +Node: Other Arguments132149 +Node: Naming Standard Input135097 +Node: Environment Variables136190 +Node: AWKPATH Variable136748 +Ref: AWKPATH Variable-Footnote-1140155 +Ref: AWKPATH Variable-Footnote-2140200 +Node: AWKLIBPATH Variable140460 +Node: Other Environment Variables141716 +Node: Exit Status145234 +Node: Include Files145910 +Node: Loading Shared Libraries149499 +Node: Obsolete150926 +Node: Undocumented151618 +Node: Invoking Summary151885 +Node: Regexp153548 +Node: Regexp Usage155002 +Node: Escape Sequences157039 +Node: Regexp Operators163268 +Ref: Regexp Operators-Footnote-1170678 +Ref: Regexp Operators-Footnote-2170825 +Node: Bracket Expressions170923 +Ref: table-char-classes172938 +Node: Leftmost Longest175880 +Node: Computed Regexps177182 +Node: GNU Regexp Operators180611 +Node: Case-sensitivity184283 +Ref: Case-sensitivity-Footnote-1187168 +Ref: Case-sensitivity-Footnote-2187403 +Node: Regexp Summary187511 +Node: Reading Files188978 +Node: Records191071 +Node: awk split records191804 +Node: gawk split records196733 +Ref: gawk split records-Footnote-1201272 +Node: Fields201309 +Ref: Fields-Footnote-1204087 +Node: Nonconstant Fields204173 +Ref: Nonconstant Fields-Footnote-1206411 +Node: Changing Fields206614 +Node: Field Separators212545 +Node: Default Field Splitting215249 +Node: Regexp Field Splitting216366 +Node: Single Character Fields219716 +Node: Command Line Field Separator220775 +Node: Full Line Fields223992 +Ref: Full Line Fields-Footnote-1225513 +Ref: Full Line Fields-Footnote-2225559 +Node: Field Splitting Summary225660 +Node: Constant Size227734 +Node: Splitting By Content232317 +Ref: Splitting By Content-Footnote-1236282 +Node: Multiple Line236445 +Ref: Multiple Line-Footnote-1242326 +Node: Getline242505 +Node: Plain Getline244712 +Node: Getline/Variable247352 +Node: Getline/File248501 +Node: Getline/Variable/File249886 +Ref: Getline/Variable/File-Footnote-1251489 +Node: Getline/Pipe251576 +Node: Getline/Variable/Pipe254254 +Node: Getline/Coprocess255385 +Node: Getline/Variable/Coprocess256649 +Node: Getline Notes257388 +Node: Getline Summary260182 +Ref: table-getline-variants260594 +Node: Read Timeout261423 +Ref: Read Timeout-Footnote-1265260 +Node: Command-line directories265318 +Node: Input Summary266223 +Node: Input Exercises269608 +Node: Printing270336 +Node: Print272113 +Node: Print Examples273570 +Node: Output Separators276349 +Node: OFMT278367 +Node: Printf279722 +Node: Basic Printf280507 +Node: Control Letters282079 +Node: Format Modifiers286064 +Node: Printf Examples292074 +Node: Redirection294560 +Node: Special FD301398 +Ref: Special FD-Footnote-1304564 +Node: Special Files304638 +Node: Other Inherited Files305255 +Node: Special Network306255 +Node: Special Caveats307117 +Node: Close Files And Pipes308066 +Ref: Close Files And Pipes-Footnote-1315257 +Ref: Close Files And Pipes-Footnote-2315405 +Node: Output Summary315555 +Node: Output Exercises316553 +Node: Expressions317233 +Node: Values318422 +Node: Constants319099 +Node: Scalar Constants319790 +Ref: Scalar Constants-Footnote-1320652 +Node: Nondecimal-numbers320902 +Node: Regexp Constants323912 +Node: Using Constant Regexps324438 +Node: Variables327601 +Node: Using Variables328258 +Node: Assignment Options330169 +Node: Conversion332044 +Node: Strings And Numbers332568 +Ref: Strings And Numbers-Footnote-1335633 +Node: Locale influences conversions335742 +Ref: table-locale-affects338488 +Node: All Operators339080 +Node: Arithmetic Ops339709 +Node: Concatenation342214 +Ref: Concatenation-Footnote-1345033 +Node: Assignment Ops345140 +Ref: table-assign-ops350119 +Node: Increment Ops351429 +Node: Truth Values and Conditions354860 +Node: Truth Values355943 +Node: Typing and Comparison356992 +Node: Variable Typing357808 +Node: Comparison Operators361475 +Ref: table-relational-ops361885 +Node: POSIX String Comparison365380 +Ref: POSIX String Comparison-Footnote-1366452 +Node: Boolean Ops366591 +Ref: Boolean Ops-Footnote-1371069 +Node: Conditional Exp371160 +Node: Function Calls372898 +Node: Precedence376778 +Node: Locales380438 +Node: Expressions Summary382070 +Node: Patterns and Actions384641 +Node: Pattern Overview385761 +Node: Regexp Patterns387440 +Node: Expression Patterns387983 +Node: Ranges391763 +Node: BEGIN/END394870 +Node: Using BEGIN/END395631 +Ref: Using BEGIN/END-Footnote-1398367 +Node: I/O And BEGIN/END398473 +Node: BEGINFILE/ENDFILE400788 +Node: Empty403685 +Node: Using Shell Variables404002 +Node: Action Overview406275 +Node: Statements408601 +Node: If Statement410449 +Node: While Statement411944 +Node: Do Statement413972 +Node: For Statement415120 +Node: Switch Statement418278 +Node: Break Statement420660 +Node: Continue Statement422701 +Node: Next Statement424528 +Node: Nextfile Statement426909 +Node: Exit Statement429537 +Node: Built-in Variables431948 +Node: User-modified433081 +Ref: User-modified-Footnote-1440784 +Node: Auto-set440846 +Ref: Auto-set-Footnote-1454555 +Ref: Auto-set-Footnote-2454760 +Node: ARGC and ARGV454816 +Node: Pattern Action Summary459034 +Node: Arrays461467 +Node: Array Basics462796 +Node: Array Intro463640 +Ref: figure-array-elements465574 +Ref: Array Intro-Footnote-1468194 +Node: Reference to Elements468322 +Node: Assigning Elements470784 +Node: Array Example471275 +Node: Scanning an Array473034 +Node: Controlling Scanning476054 +Ref: Controlling Scanning-Footnote-1481448 +Node: Numeric Array Subscripts481764 +Node: Uninitialized Subscripts483949 +Node: Delete485566 +Ref: Delete-Footnote-1488315 +Node: Multidimensional488372 +Node: Multiscanning491469 +Node: Arrays of Arrays493058 +Node: Arrays Summary497812 +Node: Functions499903 +Node: Built-in500942 +Node: Calling Built-in502020 +Node: Numeric Functions504015 +Ref: Numeric Functions-Footnote-1508833 +Ref: Numeric Functions-Footnote-2509190 +Ref: Numeric Functions-Footnote-3509238 +Node: String Functions509510 +Ref: String Functions-Footnote-1533011 +Ref: String Functions-Footnote-2533140 +Ref: String Functions-Footnote-3533388 +Node: Gory Details533475 +Ref: table-sub-escapes535256 +Ref: table-sub-proposed536771 +Ref: table-posix-sub538133 +Ref: table-gensub-escapes539670 +Ref: Gory Details-Footnote-1540503 +Node: I/O Functions540654 +Ref: I/O Functions-Footnote-1547890 +Node: Time Functions548037 +Ref: Time Functions-Footnote-1558546 +Ref: Time Functions-Footnote-2558614 +Ref: Time Functions-Footnote-3558772 +Ref: Time Functions-Footnote-4558883 +Ref: Time Functions-Footnote-5558995 +Ref: Time Functions-Footnote-6559222 +Node: Bitwise Functions559488 +Ref: table-bitwise-ops560050 +Ref: Bitwise Functions-Footnote-1564378 +Node: Type Functions564550 +Node: I18N Functions565702 +Node: User-defined567349 +Node: Definition Syntax568154 +Ref: Definition Syntax-Footnote-1573813 +Node: Function Example573884 +Ref: Function Example-Footnote-1576805 +Node: Function Caveats576827 +Node: Calling A Function577345 +Node: Variable Scope578303 +Node: Pass By Value/Reference581296 +Node: Return Statement584793 +Node: Dynamic Typing587772 +Node: Indirect Calls588701 +Ref: Indirect Calls-Footnote-1600007 +Node: Functions Summary600135 +Node: Library Functions602837 +Ref: Library Functions-Footnote-1606445 +Ref: Library Functions-Footnote-2606588 +Node: Library Names606759 +Ref: Library Names-Footnote-1610217 +Ref: Library Names-Footnote-2610440 +Node: General Functions610526 +Node: Strtonum Function611629 +Node: Assert Function614651 +Node: Round Function617975 +Node: Cliff Random Function619516 +Node: Ordinal Functions620532 +Ref: Ordinal Functions-Footnote-1623595 +Ref: Ordinal Functions-Footnote-2623847 +Node: Join Function624058 +Ref: Join Function-Footnote-1625828 +Node: Getlocaltime Function626028 +Node: Readfile Function629772 +Node: Shell Quoting631744 +Node: Data File Management633145 +Node: Filetrans Function633777 +Node: Rewind Function637873 +Node: File Checking639259 +Ref: File Checking-Footnote-1640592 +Node: Empty Files640793 +Node: Ignoring Assigns642772 +Node: Getopt Function644322 +Ref: Getopt Function-Footnote-1655786 +Node: Passwd Functions655986 +Ref: Passwd Functions-Footnote-1664826 +Node: Group Functions664914 +Ref: Group Functions-Footnote-1672811 +Node: Walking Arrays673016 +Node: Library Functions Summary674616 +Node: Library Exercises676020 +Node: Sample Programs677300 +Node: Running Examples678070 +Node: Clones678798 +Node: Cut Program680022 +Node: Egrep Program689742 +Ref: Egrep Program-Footnote-1697245 +Node: Id Program697355 +Node: Split Program701031 +Ref: Split Program-Footnote-1704485 +Node: Tee Program704613 +Node: Uniq Program707402 +Node: Wc Program714821 +Ref: Wc Program-Footnote-1719071 +Node: Miscellaneous Programs719165 +Node: Dupword Program720378 +Node: Alarm Program722409 +Node: Translate Program727214 +Ref: Translate Program-Footnote-1731777 +Node: Labels Program732047 +Ref: Labels Program-Footnote-1735398 +Node: Word Sorting735482 +Node: History Sorting739552 +Node: Extract Program741387 +Node: Simple Sed748911 +Node: Igawk Program751981 +Ref: Igawk Program-Footnote-1766307 +Ref: Igawk Program-Footnote-2766508 +Ref: Igawk Program-Footnote-3766630 +Node: Anagram Program766745 +Node: Signature Program769806 +Node: Programs Summary771053 +Node: Programs Exercises772274 +Ref: Programs Exercises-Footnote-1776405 +Node: Advanced Features776496 +Node: Nondecimal Data778478 +Node: Array Sorting780068 +Node: Controlling Array Traversal780768 +Ref: Controlling Array Traversal-Footnote-1789134 +Node: Array Sorting Functions789252 +Ref: Array Sorting Functions-Footnote-1793138 +Node: Two-way I/O793334 +Ref: Two-way I/O-Footnote-1798279 +Ref: Two-way I/O-Footnote-2798465 +Node: TCP/IP Networking798547 +Node: Profiling801419 +Node: Advanced Features Summary809690 +Node: Internationalization811623 +Node: I18N and L10N813103 +Node: Explaining gettext813789 +Ref: Explaining gettext-Footnote-1818814 +Ref: Explaining gettext-Footnote-2818998 +Node: Programmer i18n819163 +Ref: Programmer i18n-Footnote-1824039 +Node: Translator i18n824088 +Node: String Extraction824882 +Ref: String Extraction-Footnote-1826013 +Node: Printf Ordering826099 +Ref: Printf Ordering-Footnote-1828885 +Node: I18N Portability828949 +Ref: I18N Portability-Footnote-1831405 +Node: I18N Example831468 +Ref: I18N Example-Footnote-1834271 +Node: Gawk I18N834343 +Node: I18N Summary834987 +Node: Debugger836327 +Node: Debugging837349 +Node: Debugging Concepts837790 +Node: Debugging Terms839600 +Node: Awk Debugging842172 +Node: Sample Debugging Session843078 +Node: Debugger Invocation843612 +Node: Finding The Bug844997 +Node: List of Debugger Commands851476 +Node: Breakpoint Control852808 +Node: Debugger Execution Control856485 +Node: Viewing And Changing Data859844 +Node: Execution Stack863220 +Node: Debugger Info864855 +Node: Miscellaneous Debugger Commands868900 +Node: Readline Support873901 +Node: Limitations874795 +Node: Debugging Summary876910 +Node: Arbitrary Precision Arithmetic878084 +Node: Computer Arithmetic879500 +Ref: table-numeric-ranges883099 +Ref: Computer Arithmetic-Footnote-1883623 +Node: Math Definitions883680 +Ref: table-ieee-formats886975 +Ref: Math Definitions-Footnote-1887579 +Node: MPFR features887684 +Node: FP Math Caution889355 +Ref: FP Math Caution-Footnote-1890405 +Node: Inexactness of computations890774 +Node: Inexact representation891733 +Node: Comparing FP Values893091 +Node: Errors accumulate894173 +Node: Getting Accuracy895605 +Node: Try To Round898309 +Node: Setting precision899208 +Ref: table-predefined-precision-strings899892 +Node: Setting the rounding mode901721 +Ref: table-gawk-rounding-modes902085 +Ref: Setting the rounding mode-Footnote-1905537 +Node: Arbitrary Precision Integers905716 +Ref: Arbitrary Precision Integers-Footnote-1910614 +Node: POSIX Floating Point Problems910763 +Ref: POSIX Floating Point Problems-Footnote-1914642 +Node: Floating point summary914680 +Node: Dynamic Extensions916876 +Node: Extension Intro918428 +Node: Plugin License919693 +Node: Extension Mechanism Outline920490 +Ref: figure-load-extension920918 +Ref: figure-register-new-function922398 +Ref: figure-call-new-function923402 +Node: Extension API Description925389 +Node: Extension API Functions Introduction926839 +Node: General Data Types931660 +Ref: General Data Types-Footnote-1937559 +Node: Memory Allocation Functions937858 +Ref: Memory Allocation Functions-Footnote-1940697 +Node: Constructor Functions940793 +Node: Registration Functions942527 +Node: Extension Functions943212 +Node: Exit Callback Functions945509 +Node: Extension Version String946757 +Node: Input Parsers947422 +Node: Output Wrappers957301 +Node: Two-way processors961816 +Node: Printing Messages964020 +Ref: Printing Messages-Footnote-1965096 +Node: Updating `ERRNO'965248 +Node: Requesting Values965988 +Ref: table-value-types-returned966716 +Node: Accessing Parameters967673 +Node: Symbol Table Access968904 +Node: Symbol table by name969418 +Node: Symbol table by cookie971399 +Ref: Symbol table by cookie-Footnote-1975543 +Node: Cached values975606 +Ref: Cached values-Footnote-1979105 +Node: Array Manipulation979196 +Ref: Array Manipulation-Footnote-1980294 +Node: Array Data Types980331 +Ref: Array Data Types-Footnote-1982986 +Node: Array Functions983078 +Node: Flattening Arrays986932 +Node: Creating Arrays993824 +Node: Extension API Variables998595 +Node: Extension Versioning999231 +Node: Extension API Informational Variables1001132 +Node: Extension API Boilerplate1002197 +Node: Finding Extensions1006006 +Node: Extension Example1006566 +Node: Internal File Description1007338 +Node: Internal File Ops1011405 +Ref: Internal File Ops-Footnote-11023075 +Node: Using Internal File Ops1023215 +Ref: Using Internal File Ops-Footnote-11025598 +Node: Extension Samples1025871 +Node: Extension Sample File Functions1027397 +Node: Extension Sample Fnmatch1035035 +Node: Extension Sample Fork1036526 +Node: Extension Sample Inplace1037741 +Node: Extension Sample Ord1039416 +Node: Extension Sample Readdir1040252 +Ref: table-readdir-file-types1041128 +Node: Extension Sample Revout1041939 +Node: Extension Sample Rev2way1042529 +Node: Extension Sample Read write array1043269 +Node: Extension Sample Readfile1045209 +Node: Extension Sample Time1046304 +Node: Extension Sample API Tests1047653 +Node: gawkextlib1048144 +Node: Extension summary1050802 +Node: Extension Exercises1054491 +Node: Language History1055213 +Node: V7/SVR3.11056869 +Node: SVR41059050 +Node: POSIX1060495 +Node: BTL1061884 +Node: POSIX/GNU1062618 +Node: Feature History1068407 +Node: Common Extensions1082133 +Node: Ranges and Locales1083457 +Ref: Ranges and Locales-Footnote-11088075 +Ref: Ranges and Locales-Footnote-21088102 +Ref: Ranges and Locales-Footnote-31088336 +Node: Contributors1088557 +Node: History summary1094098 +Node: Installation1095468 +Node: Gawk Distribution1096414 +Node: Getting1096898 +Node: Extracting1097721 +Node: Distribution contents1099356 +Node: Unix Installation1105421 +Node: Quick Installation1106104 +Node: Shell Startup Files1108515 +Node: Additional Configuration Options1109594 +Node: Configuration Philosophy1111333 +Node: Non-Unix Installation1113702 +Node: PC Installation1114160 +Node: PC Binary Installation1115479 +Node: PC Compiling1117327 +Ref: PC Compiling-Footnote-11120348 +Node: PC Testing1120457 +Node: PC Using1121633 +Node: Cygwin1125748 +Node: MSYS1126571 +Node: VMS Installation1127071 +Node: VMS Compilation1127863 +Ref: VMS Compilation-Footnote-11129085 +Node: VMS Dynamic Extensions1129143 +Node: VMS Installation Details1130827 +Node: VMS Running1133079 +Node: VMS GNV1135915 +Node: VMS Old Gawk1136649 +Node: Bugs1137119 +Node: Other Versions1141002 +Node: Installation summary1147426 +Node: Notes1148482 +Node: Compatibility Mode1149347 +Node: Additions1150129 +Node: Accessing The Source1151054 +Node: Adding Code1152489 +Node: New Ports1158646 +Node: Derived Files1163128 +Ref: Derived Files-Footnote-11168603 +Ref: Derived Files-Footnote-21168637 +Ref: Derived Files-Footnote-31169233 +Node: Future Extensions1169347 +Node: Implementation Limitations1169953 +Node: Extension Design1171201 +Node: Old Extension Problems1172355 +Ref: Old Extension Problems-Footnote-11173872 +Node: Extension New Mechanism Goals1173929 +Ref: Extension New Mechanism Goals-Footnote-11177289 +Node: Extension Other Design Decisions1177478 +Node: Extension Future Growth1179586 +Node: Old Extension Mechanism1180422 +Node: Notes summary1182184 +Node: Basic Concepts1183370 +Node: Basic High Level1184051 +Ref: figure-general-flow1184323 +Ref: figure-process-flow1184922 +Ref: Basic High Level-Footnote-11188151 +Node: Basic Data Typing1188336 +Node: Glossary1191664 +Node: Copying1223593 +Node: GNU Free Documentation License1261149 +Node: Index1286285 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index e1464166..28da28f2 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -1301,7 +1301,7 @@ October 2014 <affiliation><jobtitle>Nof Ayalon</jobtitle></affiliation> <affiliation><jobtitle>Israel</jobtitle></affiliation> </author> - <date>December 2014</date> + <date>February 2015</date> </prefaceinfo> @end docbook @@ -2285,14 +2285,14 @@ which they raised and educated me. Finally, I also must acknowledge my gratitude to G-d, for the many opportunities He has sent my way, as well as for the gifts He has given me with which to take advantage of those opportunities. -@iftex +@ifnotdocbook @sp 2 @noindent Arnold Robbins @* Nof Ayalon @* Israel @* -December 2014 -@end iftex +February 2015 +@end ifnotdocbook @ifnotinfo @part @value{PART1}The @command{awk} Language @@ -31749,7 +31749,7 @@ indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings require more work. Because @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a -data-pointer and length. This is the @code{awk_string_t} type. +data pointer and length. This is the @code{awk_string_t} type. Identifiers (i.e., the names of global variables) can be associated with either scalar values or with arrays. In addition, @command{gawk} @@ -31762,12 +31762,12 @@ of the @code{union} as if they were fields in a @code{struct}; this is a common coding practice in C. Such code is easier to write and to read, but it remains @emph{your} responsibility to make sure that the @code{val_type} member correctly reflects the type of the value in -the @code{awk_value_t}. +the @code{awk_value_t} struct. Conceptually, the first three members of the @code{union} (number, string, and array) are all that is needed for working with @command{awk} values. However, because the API provides routines for accessing and changing -the value of global scalar variables only by using the variable's name, +the value of a global scalar variable only by using the variable's name, there is a performance penalty: @command{gawk} must find the variable each time it is accessed and changed. This turns out to be a real issue, not just a theoretical one. @@ -31785,7 +31785,9 @@ See also the entry for ``Cookie'' in the @ref{Glossary}. object for that variable, and then use the cookie for getting the variable's value or for changing the variable's value. -This is the @code{awk_scalar_t} type and @code{scalar_cookie} macro. +The @code{awk_scalar_t} type holds a scalar cookie, and the +@code{scalar_cookie} macro provides access to the value of that type +in the @code{awk_value_t} struct. Given a scalar cookie, @command{gawk} can directly retrieve or modify the value, as required, without having to find it first. @@ -31794,8 +31796,8 @@ If you know that you wish to use the same numeric or string @emph{value} for one or more variables, you can create the value once, retaining a @dfn{value cookie} for it, and then pass in that value cookie whenever you wish to set the value of a -variable. This saves both storage space within the running @command{gawk} -process as well as the time needed to create the value. +variable. This both storage space within the running @command{gawk} +process and reduces the time needed to create the value. @node Memory Allocation Functions @subsection Memory Allocation Functions and Convenience Macros diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 04aa9e78..f567f498 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -1296,7 +1296,7 @@ October 2014 <affiliation><jobtitle>Nof Ayalon</jobtitle></affiliation> <affiliation><jobtitle>Israel</jobtitle></affiliation> </author> - <date>December 2014</date> + <date>February 2015</date> </prefaceinfo> @end docbook @@ -2252,14 +2252,14 @@ which they raised and educated me. Finally, I also must acknowledge my gratitude to G-d, for the many opportunities He has sent my way, as well as for the gifts He has given me with which to take advantage of those opportunities. -@iftex +@ifnotdocbook @sp 2 @noindent Arnold Robbins @* Nof Ayalon @* Israel @* -December 2014 -@end iftex +February 2015 +@end ifnotdocbook @ifnotinfo @part @value{PART1}The @command{awk} Language @@ -30840,7 +30840,7 @@ indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings require more work. Because @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a -data-pointer and length. This is the @code{awk_string_t} type. +data pointer and length. This is the @code{awk_string_t} type. Identifiers (i.e., the names of global variables) can be associated with either scalar values or with arrays. In addition, @command{gawk} @@ -30853,12 +30853,12 @@ of the @code{union} as if they were fields in a @code{struct}; this is a common coding practice in C. Such code is easier to write and to read, but it remains @emph{your} responsibility to make sure that the @code{val_type} member correctly reflects the type of the value in -the @code{awk_value_t}. +the @code{awk_value_t} struct. Conceptually, the first three members of the @code{union} (number, string, and array) are all that is needed for working with @command{awk} values. However, because the API provides routines for accessing and changing -the value of global scalar variables only by using the variable's name, +the value of a global scalar variable only by using the variable's name, there is a performance penalty: @command{gawk} must find the variable each time it is accessed and changed. This turns out to be a real issue, not just a theoretical one. @@ -30876,7 +30876,9 @@ See also the entry for ``Cookie'' in the @ref{Glossary}. object for that variable, and then use the cookie for getting the variable's value or for changing the variable's value. -This is the @code{awk_scalar_t} type and @code{scalar_cookie} macro. +The @code{awk_scalar_t} type holds a scalar cookie, and the +@code{scalar_cookie} macro provides access to the value of that type +in the @code{awk_value_t} struct. Given a scalar cookie, @command{gawk} can directly retrieve or modify the value, as required, without having to find it first. @@ -30885,8 +30887,8 @@ If you know that you wish to use the same numeric or string @emph{value} for one or more variables, you can create the value once, retaining a @dfn{value cookie} for it, and then pass in that value cookie whenever you wish to set the value of a -variable. This saves both storage space within the running @command{gawk} -process as well as the time needed to create the value. +variable. This both storage space within the running @command{gawk} +process and reduces the time needed to create the value. @node Memory Allocation Functions @subsection Memory Allocation Functions and Convenience Macros diff --git a/test/ChangeLog b/test/ChangeLog index e9d5620a..ecbfaf0d 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-02-10 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (profile0): New test. + * profile0.awk, profile0.in, profile0.ok: New files. + 2015-02-01 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (paramasfunc1, paramasfunc2): Now need --posix. diff --git a/test/Makefile.am b/test/Makefile.am index c4c0b8b3..4f78ddb4 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -710,6 +710,8 @@ EXTRA_DIST = \ prmreuse.ok \ procinfs.awk \ procinfs.ok \ + profile0.awk \ + profile0.ok \ profile2.ok \ profile3.awk \ profile3.ok \ @@ -1043,7 +1045,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ @@ -1694,6 +1696,12 @@ dumpvars:: @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + profile1: @echo $@ @$(AWK) -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 diff --git a/test/Makefile.in b/test/Makefile.in index 212cb779..30c77b97 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -967,6 +967,8 @@ EXTRA_DIST = \ prmreuse.ok \ procinfs.awk \ procinfs.ok \ + profile0.awk \ + profile0.ok \ profile2.ok \ profile3.awk \ profile3.ok \ @@ -1299,7 +1301,7 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ @@ -2132,6 +2134,12 @@ dumpvars:: @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + profile1: @echo $@ @$(AWK) -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 diff --git a/test/profile0.awk b/test/profile0.awk new file mode 100644 index 00000000..a42e94df --- /dev/null +++ b/test/profile0.awk @@ -0,0 +1 @@ +NR == 1 diff --git a/test/profile0.in b/test/profile0.in new file mode 100644 index 00000000..7bba8c8e --- /dev/null +++ b/test/profile0.in @@ -0,0 +1,2 @@ +line 1 +line 2 diff --git a/test/profile0.ok b/test/profile0.ok new file mode 100644 index 00000000..2e3c5728 --- /dev/null +++ b/test/profile0.ok @@ -0,0 +1,6 @@ + # Rule(s) + + 2 NR == 1 { # 1 + 1 print $0 + } + |