diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-09-05 11:21:38 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-09-05 11:21:38 +0300 |
commit | 0f5cb955662136ad4a93e35db5721dd986dfd55b (patch) | |
tree | 7ec575fe74a0fc599bafb01fad6811fc496f7256 | |
parent | c30a04c8d3a2eef06338934f577fe3416f40d529 (diff) | |
download | egawk-0f5cb955662136ad4a93e35db5721dd986dfd55b.tar.gz egawk-0f5cb955662136ad4a93e35db5721dd986dfd55b.tar.bz2 egawk-0f5cb955662136ad4a93e35db5721dd986dfd55b.zip |
Add builtin functions to FUNCTAB and PROCINFO["identifiers"] and doc.
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | awk.h | 2 | ||||
-rw-r--r-- | awkgram.c | 21 | ||||
-rw-r--r-- | awkgram.y | 21 | ||||
-rw-r--r-- | doc/ChangeLog | 9 | ||||
-rw-r--r-- | doc/gawk.1 | 7 | ||||
-rw-r--r-- | doc/gawk.info | 776 | ||||
-rw-r--r-- | doc/gawk.texi | 7 | ||||
-rw-r--r-- | doc/gawktexi.in | 7 | ||||
-rw-r--r-- | eval.c | 1 | ||||
-rw-r--r-- | interpret.h | 7 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | symbol.c | 15 | ||||
-rw-r--r-- | test/ChangeLog | 1 | ||||
-rw-r--r-- | test/id.ok | 80 |
15 files changed, 548 insertions, 424 deletions
@@ -1,3 +1,19 @@ +2014-09-05 Arnold D. Robbins <arnold@skeeve.com> + + Add builtin functions to FUNCTAB for consistency. + + * awk.h (Node_builtin_func): New node type. + (install_builtins): Declare new function. + * awkgram.y [DEBUG_USE]: New flag value for debug functions; they + don't go into FUNCTAB. + (install_builtins): New function. + * eval.c (nodetypes): Add Node_builtin_func. + * interpret.h (r_interpret): Rework indirect calls of built-ins + since they're now in the symbol table. + * main.c (main): Call `install_builtins'. + * symbol.c (install): Adjust for Node_builtin_func. + (load_symbols): Ditto. + 2014-09-04 Arnold D. Robbins <arnold@skeeve.com> * profile.c (pprint): Case Op_K_for: Improve printing of @@ -297,6 +297,7 @@ typedef enum nodevals { Node_func, /* lnode is param. list, rnode is body */ Node_ext_func, /* extension function, code_ptr is builtin code */ Node_old_ext_func, /* extension function, code_ptr is builtin code */ + Node_builtin_func, /* built-in function, main use is for FUNCTAB */ Node_array_ref, /* array passed by ref as parameter */ Node_array_tree, /* Hashed array tree (HAT) */ @@ -1379,6 +1380,7 @@ extern void valinfo(NODE *n, Func_print print_func, FILE *fp); extern void negate_num(NODE *n); typedef NODE *(*builtin_func_t)(int); /* function that implements a built-in */ extern builtin_func_t lookup_builtin(const char *name); +extern void install_builtins(void); /* builtin.c */ extern double double_to_int(double d); extern NODE *do_exp(int nargs); @@ -4144,6 +4144,7 @@ struct token { # define GAWKX 0x0400 /* gawk extension */ # define BREAK 0x0800 /* break allowed inside */ # define CONTINUE 0x1000 /* continue allowed inside */ +# define DEBUG_USE 0x2000 /* for use by developers */ NODE *(*ptr)(int); /* function that implements this keyword */ NODE *(*ptr2)(int); /* alternate arbitrary-precision function */ @@ -4182,7 +4183,7 @@ static const struct token tokentab[] = { {"END", Op_rule, LEX_END, 0, 0, 0}, {"ENDFILE", Op_rule, LEX_ENDFILE, GAWKX, 0, 0}, #ifdef ARRAYDEBUG -{"adump", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_adump, 0}, +{"adump", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|DEBUG_USE, do_adump, 0}, #endif {"and", Op_builtin, LEX_BUILTIN, GAWKX, do_and, MPF(and)}, {"asort", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asort, 0}, @@ -4241,7 +4242,7 @@ static const struct token tokentab[] = { {"sqrt", Op_builtin, LEX_BUILTIN, A(1), do_sqrt, MPF(sqrt)}, {"srand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0)|A(1), do_srand, MPF(srand)}, #if defined(GAWKDEBUG) || defined(ARRAYDEBUG) /* || ... */ -{"stopme", Op_builtin, LEX_BUILTIN, GAWKX|A(0), stopme, 0}, +{"stopme", Op_builtin, LEX_BUILTIN, GAWKX|A(0)|DEBUG_USE, stopme, 0}, #endif {"strftime", Op_builtin, LEX_BUILTIN, GAWKX|A(0)|A(1)|A(2)|A(3), do_strftime, 0}, {"strtonum", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_strtonum, MPF(strtonum)}, @@ -8060,3 +8061,19 @@ lookup_builtin(const char *name) return tokentab[mid].ptr; } + +/* install_builtins --- add built-in functions to FUNCTAB */ + +void +install_builtins(void) +{ + int i, j; + + j = sizeof(tokentab) / sizeof(tokentab[0]); + for (i = 0; i < j; i++) { + if ( tokentab[i].class == LEX_BUILTIN + && (tokentab[i].flags & DEBUG_USE) == 0) { + (void) install_symbol(tokentab[i].operator, Node_builtin_func); + } + } +} @@ -1805,6 +1805,7 @@ struct token { # define GAWKX 0x0400 /* gawk extension */ # define BREAK 0x0800 /* break allowed inside */ # define CONTINUE 0x1000 /* continue allowed inside */ +# define DEBUG_USE 0x2000 /* for use by developers */ NODE *(*ptr)(int); /* function that implements this keyword */ NODE *(*ptr2)(int); /* alternate arbitrary-precision function */ @@ -1843,7 +1844,7 @@ static const struct token tokentab[] = { {"END", Op_rule, LEX_END, 0, 0, 0}, {"ENDFILE", Op_rule, LEX_ENDFILE, GAWKX, 0, 0}, #ifdef ARRAYDEBUG -{"adump", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_adump, 0}, +{"adump", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|DEBUG_USE, do_adump, 0}, #endif {"and", Op_builtin, LEX_BUILTIN, GAWKX, do_and, MPF(and)}, {"asort", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asort, 0}, @@ -1902,7 +1903,7 @@ static const struct token tokentab[] = { {"sqrt", Op_builtin, LEX_BUILTIN, A(1), do_sqrt, MPF(sqrt)}, {"srand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0)|A(1), do_srand, MPF(srand)}, #if defined(GAWKDEBUG) || defined(ARRAYDEBUG) /* || ... */ -{"stopme", Op_builtin, LEX_BUILTIN, GAWKX|A(0), stopme, 0}, +{"stopme", Op_builtin, LEX_BUILTIN, GAWKX|A(0)|DEBUG_USE, stopme, 0}, #endif {"strftime", Op_builtin, LEX_BUILTIN, GAWKX|A(0)|A(1)|A(2)|A(3), do_strftime, 0}, {"strtonum", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_strtonum, MPF(strtonum)}, @@ -5721,3 +5722,19 @@ lookup_builtin(const char *name) return tokentab[mid].ptr; } + +/* install_builtins --- add built-in functions to FUNCTAB */ + +void +install_builtins(void) +{ + int i, j; + + j = sizeof(tokentab) / sizeof(tokentab[0]); + for (i = 0; i < j; i++) { + if ( tokentab[i].class == LEX_BUILTIN + && (tokentab[i].flags & DEBUG_USE) == 0) { + (void) install_symbol(tokentab[i].operator, Node_builtin_func); + } + } +} diff --git a/doc/ChangeLog b/doc/ChangeLog index 457ac8ed..661237db 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2014-09-05 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in: Document builtin functions in FUNCTAB and in + PROCINFO["identifiers"]. + * gawk.1: Ditto. + 2014-09-04 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: Document that indirect calls now work on built-in @@ -11,8 +17,7 @@ 2014-09-02 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: Corrections to walkthrough in debugger chapter. - Thanks to David "bamber" Ward <dlward134@gmail.com> for - the problem report. + Thanks to David Ward <dlward134@gmail.com> for the problem report. 2014-09-01 Arnold D. Robbins <arnold@skeeve.com> @@ -1126,9 +1126,14 @@ For each identifier, the value of the element is one of the following: \fB"array"\fR The identifier is an array. .TP +\fB"builtin"\fR +The identifier is a built-in function. +.TP \fB"extension"\fR The identifier is an extension function loaded via -.BR @load . +.B @load +or +.BR \-l . .TP \fB"scalar"\fR The identifier is a scalar. diff --git a/doc/gawk.info b/doc/gawk.info index f008ecfa..0d7505a5 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -10269,7 +10269,8 @@ Options::), they are not special. `FUNCTAB #' An array whose indices and corresponding values are the names of - all the user-defined or extension functions in the program. + all the built-in, user-defined and extension functions in the + program. NOTE: Attempting to use the `delete' statement with the `FUNCTAB' array causes a fatal error. Any attempt to assign @@ -10305,9 +10306,12 @@ Options::), they are not special. `"array"' The identifier is an array. + `"builtin"' + The identifier is a built-in function. + `"extension"' The identifier is an extension function loaded via - `@load'. + `@load' or `-l'. `"scalar"' The identifier is a scalar. @@ -31836,7 +31840,7 @@ Index (line 46) * dark corner, FILENAME variable <1>: Auto-set. (line 90) * dark corner, FILENAME variable: Getline Notes. (line 19) -* dark corner, FNR/NR variables: Auto-set. (line 301) +* dark corner, FNR/NR variables: Auto-set. (line 305) * dark corner, format-control characters: Control Letters. (line 18) * dark corner, FS as null string: Single Character Fields. (line 20) @@ -32050,7 +32054,7 @@ Index (line 260) * differences in awk and gawk, print/printf statements: Format Modifiers. (line 13) -* differences in awk and gawk, PROCINFO array: Auto-set. (line 128) +* differences in awk and gawk, PROCINFO array: Auto-set. (line 129) * differences in awk and gawk, read timeouts: Read Timeout. (line 6) * differences in awk and gawk, record separators: awk split records. (line 124) @@ -32060,7 +32064,7 @@ Index (line 26) * differences in awk and gawk, RS/RT variables: gawk split records. (line 58) -* differences in awk and gawk, RT variable: Auto-set. (line 257) +* differences in awk and gawk, RT variable: Auto-set. (line 261) * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. @@ -32068,7 +32072,7 @@ Index * differences in awk and gawk, strings: Scalar Constants. (line 20) * differences in awk and gawk, strings, storing: gawk split records. (line 77) -* differences in awk and gawk, SYMTAB variable: Auto-set. (line 261) +* differences in awk and gawk, SYMTAB variable: Auto-set. (line 265) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. (line 152) * differences in awk and gawk, trunc-mod operation: Arithmetic Ops. @@ -32107,8 +32111,8 @@ Index * dynamically loaded extensions: Dynamic Extensions. (line 6) * e debugger command (alias for enable): Breakpoint Control. (line 73) * EBCDIC: Ordinal Functions. (line 45) -* effective group ID of gawk user: Auto-set. (line 133) -* effective user ID of gawk user: Auto-set. (line 137) +* effective group ID of gawk user: Auto-set. (line 134) +* effective user ID of gawk user: Auto-set. (line 138) * egrep utility <1>: Egrep Program. (line 6) * egrep utility: Bracket Expressions. (line 26) * egrep.awk program: Egrep Program. (line 54) @@ -32223,7 +32227,7 @@ Index (line 6) * extension API version: Extension Versioning. (line 6) -* extension API, version number: Auto-set. (line 224) +* extension API, version number: Auto-set. (line 228) * extension example: Extension Example. (line 6) * extension registration: Registration Functions. (line 6) @@ -32375,7 +32379,7 @@ Index (line 12) * FNR variable <1>: Auto-set. (line 99) * FNR variable: Records. (line 6) -* FNR variable, changing: Auto-set. (line 301) +* FNR variable, changing: Auto-set. (line 305) * for statement: For Statement. (line 6) * for statement, looping over arrays: Scanning an Array. (line 20) * fork() extension function: Extension Sample Fork. @@ -32476,7 +32480,7 @@ Index * G-d: Acknowledgments. (line 92) * Garfinkle, Scott: Contributors. (line 34) * gawk program, dynamic profiling: Profiling. (line 179) -* gawk version: Auto-set. (line 199) +* gawk version: Auto-set. (line 203) * gawk, ARGIND variable in: Other Arguments. (line 12) * gawk, awk and <1>: This Manual. (line 14) * gawk, awk and: Preface. (line 21) @@ -32545,7 +32549,7 @@ Index * gawk, OS/2 version of: PC Using. (line 16) * gawk, PROCINFO array in <1>: Two-way I/O. (line 99) * gawk, PROCINFO array in <2>: Time Functions. (line 47) -* gawk, PROCINFO array in: Auto-set. (line 128) +* gawk, PROCINFO array in: Auto-set. (line 129) * gawk, regexp constants and: Using Constant Regexps. (line 28) * gawk, regular expressions, case sensitivity: Case-sensitivity. @@ -32553,14 +32557,14 @@ Index * gawk, regular expressions, operators: GNU Regexp Operators. (line 6) * gawk, regular expressions, precedence: Regexp Operators. (line 161) -* gawk, RT variable in <1>: Auto-set. (line 257) +* gawk, RT variable in <1>: Auto-set. (line 261) * gawk, RT variable in <2>: Multiple Line. (line 129) * gawk, RT variable in: awk split records. (line 124) * gawk, See Also awk: Preface. (line 34) * gawk, source code, obtaining: Getting. (line 6) * gawk, splitting fields and: Constant Size. (line 88) * gawk, string-translation functions: I18N Functions. (line 6) -* gawk, SYMTAB array in: Auto-set. (line 261) +* gawk, SYMTAB array in: Auto-set. (line 265) * gawk, TEXTDOMAIN variable in: User-modified. (line 152) * gawk, timestamps: Time Functions. (line 6) * gawk, uses for: Preface. (line 34) @@ -32646,7 +32650,7 @@ Index * Grigera, Juan: Contributors. (line 57) * group database, reading: Group Functions. (line 6) * group file: Group Functions. (line 6) -* group ID of gawk user: Auto-set. (line 172) +* group ID of gawk user: Auto-set. (line 176) * groups, information about: Group Functions. (line 6) * gsub <1>: String Functions. (line 139) * gsub: Using Constant Regexps. @@ -32940,7 +32944,7 @@ Index * mawk utility <3>: Concatenation. (line 36) * mawk utility <4>: Getline/Pipe. (line 62) * mawk utility: Escape Sequences. (line 130) -* maximum precision supported by MPFR library: Auto-set. (line 213) +* maximum precision supported by MPFR library: Auto-set. (line 217) * McIlroy, Doug: Glossary. (line 149) * McPhee, Patrick: Contributors. (line 100) * message object files: Explaining gettext. (line 42) @@ -32953,7 +32957,7 @@ Index * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) * metacharacters, escape sequences for: Escape Sequences. (line 136) -* minimum precision supported by MPFR library: Auto-set. (line 216) +* minimum precision supported by MPFR library: Auto-set. (line 220) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 104) @@ -33013,9 +33017,9 @@ Index * non-existent array elements: Reference to Elements. (line 23) * not Boolean-logic operator: Boolean Ops. (line 6) -* NR variable <1>: Auto-set. (line 123) +* NR variable <1>: Auto-set. (line 124) * NR variable: Records. (line 6) -* NR variable, changing: Auto-set. (line 301) +* NR variable, changing: Auto-set. (line 305) * null strings <1>: Basic Data Typing. (line 26) * null strings <2>: Truth Values. (line 6) * null strings <3>: Regexp Field Splitting. @@ -33129,7 +33133,7 @@ Index * p debugger command (alias for print): Viewing And Changing Data. (line 36) * Papadopoulos, Panos: Contributors. (line 128) -* parent process ID of gawk process: Auto-set. (line 181) +* parent process ID of gawk process: Auto-set. (line 185) * parentheses (), in a profile: Profiling. (line 146) * parentheses (), regexp operator: Regexp Operators. (line 81) * password file: Passwd Functions. (line 16) @@ -33292,24 +33296,24 @@ Index * printing, unduplicated lines of text: Uniq Program. (line 6) * printing, user information: Id Program. (line 6) * private variables: Library Names. (line 11) -* process group idIDof gawk process: Auto-set. (line 175) -* process ID of gawk process: Auto-set. (line 178) +* process group idIDof gawk process: Auto-set. (line 179) +* process ID of gawk process: Auto-set. (line 182) * processes, two-way communications with: Two-way I/O. (line 6) * processing data: Basic High Level. (line 6) * PROCINFO array <1>: Passwd Functions. (line 6) * PROCINFO array <2>: Time Functions. (line 47) -* PROCINFO array: Auto-set. (line 128) +* PROCINFO array: Auto-set. (line 129) * PROCINFO array, and communications via ptys: Two-way I/O. (line 99) * PROCINFO array, and group membership: Group Functions. (line 6) * PROCINFO array, and user and group ID numbers: Id Program. (line 15) * PROCINFO array, testing the field splitting: Passwd Functions. (line 161) -* PROCINFO array, uses: Auto-set. (line 234) +* PROCINFO array, uses: Auto-set. (line 238) * PROCINFO, values of sorted_in: Controlling Scanning. (line 26) * profiling awk programs: Profiling. (line 6) * profiling awk programs, dynamically: Profiling. (line 179) -* program identifiers: Auto-set. (line 146) +* program identifiers: Auto-set. (line 147) * program, definition of: Getting Started. (line 21) * programming conventions, --non-decimal-data option: Nondecimal Data. (line 36) @@ -33468,7 +33472,7 @@ Index * right shift: Bitwise Functions. (line 52) * right shift, bitwise: Bitwise Functions. (line 32) * Ritchie, Dennis: Basic Data Typing. (line 54) -* RLENGTH variable: Auto-set. (line 244) +* RLENGTH variable: Auto-set. (line 248) * RLENGTH variable, match() function and: String Functions. (line 224) * Robbins, Arnold <1>: Future Extensions. (line 6) * Robbins, Arnold <2>: Bugs. (line 32) @@ -33494,9 +33498,9 @@ Index * RS variable: awk split records. (line 12) * RS variable, multiline records and: Multiple Line. (line 17) * rshift: Bitwise Functions. (line 52) -* RSTART variable: Auto-set. (line 250) +* RSTART variable: Auto-set. (line 254) * RSTART variable, match() function and: String Functions. (line 224) -* RT variable <1>: Auto-set. (line 257) +* RT variable <1>: Auto-set. (line 261) * RT variable <2>: Multiple Line. (line 129) * RT variable: awk split records. (line 124) * Rubin, Paul <1>: Contributors. (line 15) @@ -33516,7 +33520,7 @@ Index * scanning arrays: Scanning an Array. (line 6) * scanning multidimensional arrays: Multiscanning. (line 11) * Schorr, Andrew <1>: Contributors. (line 133) -* Schorr, Andrew <2>: Auto-set. (line 284) +* Schorr, Andrew <2>: Auto-set. (line 288) * Schorr, Andrew: Acknowledgments. (line 60) * Schreiber, Bert: Acknowledgments. (line 38) * Schreiber, Rita: Acknowledgments. (line 38) @@ -33600,7 +33604,7 @@ Index (line 116) * sidebar, Changing FS Does Not Affect the Fields: Field Splitting Summary. (line 38) -* sidebar, Changing NR and FNR: Auto-set. (line 299) +* sidebar, Changing NR and FNR: Auto-set. (line 303) * sidebar, Controlling Output Buffering with system(): I/O Functions. (line 138) * sidebar, Escape Sequences for Metacharacters: Escape Sequences. @@ -33763,9 +33767,9 @@ Index * substr: String Functions. (line 479) * substring: String Functions. (line 479) * Sumner, Andrew: Other Versions. (line 64) -* supplementary groups of gawk process: Auto-set. (line 229) +* supplementary groups of gawk process: Auto-set. (line 233) * switch statement: Switch Statement. (line 6) -* SYMTAB array: Auto-set. (line 261) +* SYMTAB array: Auto-set. (line 265) * syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops. (line 148) * system: I/O Functions. (line 75) @@ -33943,10 +33947,10 @@ Index * variables, uninitialized, as array subscripts: Uninitialized Subscripts. (line 6) * variables, user-defined: Variables. (line 6) -* version of gawk: Auto-set. (line 199) -* version of gawk extension API: Auto-set. (line 224) -* version of GNU MP library: Auto-set. (line 210) -* version of GNU MPFR library: Auto-set. (line 206) +* version of gawk: Auto-set. (line 203) +* version of gawk extension API: Auto-set. (line 228) +* version of GNU MP library: Auto-set. (line 214) +* version of GNU MPFR library: Auto-set. (line 210) * vertical bar (|): Regexp Operators. (line 70) * vertical bar (|), | operator (I/O) <1>: Precedence. (line 65) * vertical bar (|), | operator (I/O): Getline/Pipe. (line 9) @@ -34231,355 +34235,355 @@ Node: Built-in Variables426497 Node: User-modified427624 Ref: User-modified-Footnote-1435313 Node: Auto-set435375 -Ref: Auto-set-Footnote-1447957 -Ref: Auto-set-Footnote-2448162 -Node: ARGC and ARGV448218 -Node: Pattern Action Summary452122 -Node: Arrays454345 -Node: Array Basics455894 -Node: Array Intro456720 -Ref: figure-array-elements458693 -Ref: Array Intro-Footnote-1461217 -Node: Reference to Elements461345 -Node: Assigning Elements463795 -Node: Array Example464286 -Node: Scanning an Array466018 -Node: Controlling Scanning469019 -Ref: Controlling Scanning-Footnote-1474192 -Node: Delete474508 -Ref: Delete-Footnote-1477259 -Node: Numeric Array Subscripts477316 -Node: Uninitialized Subscripts479499 -Node: Multidimensional481126 -Node: Multiscanning484239 -Node: Arrays of Arrays485828 -Node: Arrays Summary490491 -Node: Functions492596 -Node: Built-in493469 -Node: Calling Built-in494547 -Node: Numeric Functions496535 -Ref: Numeric Functions-Footnote-1500569 -Ref: Numeric Functions-Footnote-2500926 -Ref: Numeric Functions-Footnote-3500974 -Node: String Functions501243 -Ref: String Functions-Footnote-1524240 -Ref: String Functions-Footnote-2524369 -Ref: String Functions-Footnote-3524617 -Node: Gory Details524704 -Ref: table-sub-escapes526477 -Ref: table-sub-proposed527997 -Ref: table-posix-sub529361 -Ref: table-gensub-escapes530901 -Ref: Gory Details-Footnote-1532077 -Node: I/O Functions532228 -Ref: I/O Functions-Footnote-1539338 -Node: Time Functions539485 -Ref: Time Functions-Footnote-1549949 -Ref: Time Functions-Footnote-2550017 -Ref: Time Functions-Footnote-3550175 -Ref: Time Functions-Footnote-4550286 -Ref: Time Functions-Footnote-5550398 -Ref: Time Functions-Footnote-6550625 -Node: Bitwise Functions550891 -Ref: table-bitwise-ops551453 -Ref: Bitwise Functions-Footnote-1555698 -Node: Type Functions555882 -Node: I18N Functions557024 -Node: User-defined558669 -Node: Definition Syntax559473 -Ref: Definition Syntax-Footnote-1564786 -Node: Function Example564855 -Ref: Function Example-Footnote-1567495 -Node: Function Caveats567517 -Node: Calling A Function568035 -Node: Variable Scope568990 -Node: Pass By Value/Reference571978 -Node: Return Statement575488 -Node: Dynamic Typing578472 -Node: Indirect Calls579401 -Ref: Indirect Calls-Footnote-1589117 -Node: Functions Summary589245 -Node: Library Functions591895 -Ref: Library Functions-Footnote-1595513 -Ref: Library Functions-Footnote-2595656 -Node: Library Names595827 -Ref: Library Names-Footnote-1599300 -Ref: Library Names-Footnote-2599520 -Node: General Functions599606 -Node: Strtonum Function600634 -Node: Assert Function603508 -Node: Round Function606834 -Node: Cliff Random Function608375 -Node: Ordinal Functions609391 -Ref: Ordinal Functions-Footnote-1612456 -Ref: Ordinal Functions-Footnote-2612708 -Node: Join Function612919 -Ref: Join Function-Footnote-1614690 -Node: Getlocaltime Function614890 -Node: Readfile Function618626 -Node: Data File Management620465 -Node: Filetrans Function621097 -Node: Rewind Function625166 -Node: File Checking626724 -Ref: File Checking-Footnote-1627856 -Node: Empty Files628057 -Node: Ignoring Assigns630036 -Node: Getopt Function631590 -Ref: Getopt Function-Footnote-1642854 -Node: Passwd Functions643057 -Ref: Passwd Functions-Footnote-1652036 -Node: Group Functions652124 -Ref: Group Functions-Footnote-1660055 -Node: Walking Arrays660268 -Node: Library Functions Summary661871 -Node: Library Exercises663259 -Node: Sample Programs664539 -Node: Running Examples665309 -Node: Clones666037 -Node: Cut Program667261 -Node: Egrep Program677119 -Ref: Egrep Program-Footnote-1684706 -Node: Id Program684816 -Node: Split Program688470 -Ref: Split Program-Footnote-1692008 -Node: Tee Program692136 -Node: Uniq Program694923 -Node: Wc Program702346 -Ref: Wc Program-Footnote-1706611 -Node: Miscellaneous Programs706703 -Node: Dupword Program707916 -Node: Alarm Program709947 -Node: Translate Program714751 -Ref: Translate Program-Footnote-1719142 -Ref: Translate Program-Footnote-2719412 -Node: Labels Program719551 -Ref: Labels Program-Footnote-1722912 -Node: Word Sorting722996 -Node: History Sorting727039 -Node: Extract Program728875 -Node: Simple Sed736411 -Node: Igawk Program739473 -Ref: Igawk Program-Footnote-1753777 -Ref: Igawk Program-Footnote-2753978 -Node: Anagram Program754116 -Node: Signature Program757184 -Node: Programs Summary758431 -Node: Programs Exercises759646 -Ref: Programs Exercises-Footnote-1764033 -Node: Advanced Features764124 -Node: Nondecimal Data766072 -Node: Array Sorting767649 -Node: Controlling Array Traversal768346 -Node: Array Sorting Functions776626 -Ref: Array Sorting Functions-Footnote-1780533 -Node: Two-way I/O780727 -Ref: Two-way I/O-Footnote-1785671 -Ref: Two-way I/O-Footnote-2785850 -Node: TCP/IP Networking785932 -Node: Profiling788777 -Node: Advanced Features Summary796319 -Node: Internationalization798183 -Node: I18N and L10N799663 -Node: Explaining gettext800349 -Ref: Explaining gettext-Footnote-1805375 -Ref: Explaining gettext-Footnote-2805559 -Node: Programmer i18n805724 -Ref: Programmer i18n-Footnote-1810518 -Node: Translator i18n810567 -Node: String Extraction811361 -Ref: String Extraction-Footnote-1812494 -Node: Printf Ordering812580 -Ref: Printf Ordering-Footnote-1815362 -Node: I18N Portability815426 -Ref: I18N Portability-Footnote-1817875 -Node: I18N Example817938 -Ref: I18N Example-Footnote-1820644 -Node: Gawk I18N820716 -Node: I18N Summary821354 -Node: Debugger822693 -Node: Debugging823715 -Node: Debugging Concepts824156 -Node: Debugging Terms826012 -Node: Awk Debugging828609 -Node: Sample Debugging Session829501 -Node: Debugger Invocation830021 -Node: Finding The Bug831357 -Node: List of Debugger Commands837836 -Node: Breakpoint Control839168 -Node: Debugger Execution Control842832 -Node: Viewing And Changing Data846192 -Node: Execution Stack849550 -Node: Debugger Info851063 -Node: Miscellaneous Debugger Commands855057 -Node: Readline Support860241 -Node: Limitations861133 -Node: Debugging Summary863406 -Node: Arbitrary Precision Arithmetic864574 -Node: Computer Arithmetic866061 -Ref: Computer Arithmetic-Footnote-1870448 -Node: Math Definitions870505 -Ref: table-ieee-formats873794 -Ref: Math Definitions-Footnote-1874334 -Node: MPFR features874437 -Node: FP Math Caution876054 -Ref: FP Math Caution-Footnote-1877104 -Node: Inexactness of computations877473 -Node: Inexact representation878421 -Node: Comparing FP Values879776 -Node: Errors accumulate880740 -Node: Getting Accuracy882173 -Node: Try To Round884832 -Node: Setting precision885731 -Ref: table-predefined-precision-strings886413 -Node: Setting the rounding mode888206 -Ref: table-gawk-rounding-modes888570 -Ref: Setting the rounding mode-Footnote-1892024 -Node: Arbitrary Precision Integers892203 -Ref: Arbitrary Precision Integers-Footnote-1895184 -Node: POSIX Floating Point Problems895333 -Ref: POSIX Floating Point Problems-Footnote-1899209 -Node: Floating point summary899247 -Node: Dynamic Extensions901451 -Node: Extension Intro903003 -Node: Plugin License904268 -Node: Extension Mechanism Outline904953 -Ref: figure-load-extension905377 -Ref: figure-load-new-function906862 -Ref: figure-call-new-function907864 -Node: Extension API Description909848 -Node: Extension API Functions Introduction911298 -Node: General Data Types916165 -Ref: General Data Types-Footnote-1921858 -Node: Requesting Values922157 -Ref: table-value-types-returned922894 -Node: Memory Allocation Functions923852 -Ref: Memory Allocation Functions-Footnote-1926599 -Node: Constructor Functions926695 -Node: Registration Functions928453 -Node: Extension Functions929138 -Node: Exit Callback Functions931440 -Node: Extension Version String932688 -Node: Input Parsers933338 -Node: Output Wrappers943152 -Node: Two-way processors947668 -Node: Printing Messages949872 -Ref: Printing Messages-Footnote-1950949 -Node: Updating `ERRNO'951101 -Node: Accessing Parameters951840 -Node: Symbol Table Access953070 -Node: Symbol table by name953584 -Node: Symbol table by cookie955560 -Ref: Symbol table by cookie-Footnote-1959693 -Node: Cached values959756 -Ref: Cached values-Footnote-1963260 -Node: Array Manipulation963351 -Ref: Array Manipulation-Footnote-1964449 -Node: Array Data Types964488 -Ref: Array Data Types-Footnote-1967191 -Node: Array Functions967283 -Node: Flattening Arrays971157 -Node: Creating Arrays978009 -Node: Extension API Variables982740 -Node: Extension Versioning983376 -Node: Extension API Informational Variables985277 -Node: Extension API Boilerplate986363 -Node: Finding Extensions990167 -Node: Extension Example990727 -Node: Internal File Description991457 -Node: Internal File Ops995548 -Ref: Internal File Ops-Footnote-11006980 -Node: Using Internal File Ops1007120 -Ref: Using Internal File Ops-Footnote-11009467 -Node: Extension Samples1009735 -Node: Extension Sample File Functions1011259 -Node: Extension Sample Fnmatch1018827 -Node: Extension Sample Fork1020309 -Node: Extension Sample Inplace1021522 -Node: Extension Sample Ord1023197 -Node: Extension Sample Readdir1024033 -Ref: table-readdir-file-types1024889 -Node: Extension Sample Revout1025688 -Node: Extension Sample Rev2way1026279 -Node: Extension Sample Read write array1027020 -Node: Extension Sample Readfile1028899 -Node: Extension Sample API Tests1029999 -Node: Extension Sample Time1030524 -Node: gawkextlib1031839 -Node: Extension summary1034652 -Node: Extension Exercises1038345 -Node: Language History1039067 -Node: V7/SVR3.11040710 -Node: SVR41043030 -Node: POSIX1044472 -Node: BTL1045858 -Node: POSIX/GNU1046592 -Node: Feature History1052308 -Node: Common Extensions1065399 -Node: Ranges and Locales1066711 -Ref: Ranges and Locales-Footnote-11071328 -Ref: Ranges and Locales-Footnote-21071355 -Ref: Ranges and Locales-Footnote-31071589 -Node: Contributors1071810 -Node: History summary1077235 -Node: Installation1078604 -Node: Gawk Distribution1079555 -Node: Getting1080039 -Node: Extracting1080863 -Node: Distribution contents1082505 -Node: Unix Installation1088222 -Node: Quick Installation1088839 -Node: Additional Configuration Options1091281 -Node: Configuration Philosophy1093019 -Node: Non-Unix Installation1095370 -Node: PC Installation1095828 -Node: PC Binary Installation1097139 -Node: PC Compiling1098987 -Ref: PC Compiling-Footnote-11101986 -Node: PC Testing1102091 -Node: PC Using1103267 -Node: Cygwin1107419 -Node: MSYS1108228 -Node: VMS Installation1108742 -Node: VMS Compilation1109538 -Ref: VMS Compilation-Footnote-11110760 -Node: VMS Dynamic Extensions1110818 -Node: VMS Installation Details1112191 -Node: VMS Running1114443 -Node: VMS GNV1117277 -Node: VMS Old Gawk1118000 -Node: Bugs1118470 -Node: Other Versions1122474 -Node: Installation summary1128701 -Node: Notes1129757 -Node: Compatibility Mode1130622 -Node: Additions1131404 -Node: Accessing The Source1132329 -Node: Adding Code1133765 -Node: New Ports1139943 -Node: Derived Files1144424 -Ref: Derived Files-Footnote-11149505 -Ref: Derived Files-Footnote-21149539 -Ref: Derived Files-Footnote-31150135 -Node: Future Extensions1150249 -Node: Implementation Limitations1150855 -Node: Extension Design1152103 -Node: Old Extension Problems1153257 -Ref: Old Extension Problems-Footnote-11154774 -Node: Extension New Mechanism Goals1154831 -Ref: Extension New Mechanism Goals-Footnote-11158191 -Node: Extension Other Design Decisions1158380 -Node: Extension Future Growth1160486 -Node: Old Extension Mechanism1161322 -Node: Notes summary1163084 -Node: Basic Concepts1164270 -Node: Basic High Level1164951 -Ref: figure-general-flow1165223 -Ref: figure-process-flow1165822 -Ref: Basic High Level-Footnote-11169051 -Node: Basic Data Typing1169236 -Node: Glossary1172564 -Node: Copying1197716 -Node: GNU Free Documentation License1235272 -Node: Index1260408 +Ref: Auto-set-Footnote-1448057 +Ref: Auto-set-Footnote-2448262 +Node: ARGC and ARGV448318 +Node: Pattern Action Summary452222 +Node: Arrays454445 +Node: Array Basics455994 +Node: Array Intro456820 +Ref: figure-array-elements458793 +Ref: Array Intro-Footnote-1461317 +Node: Reference to Elements461445 +Node: Assigning Elements463895 +Node: Array Example464386 +Node: Scanning an Array466118 +Node: Controlling Scanning469119 +Ref: Controlling Scanning-Footnote-1474292 +Node: Delete474608 +Ref: Delete-Footnote-1477359 +Node: Numeric Array Subscripts477416 +Node: Uninitialized Subscripts479599 +Node: Multidimensional481226 +Node: Multiscanning484339 +Node: Arrays of Arrays485928 +Node: Arrays Summary490591 +Node: Functions492696 +Node: Built-in493569 +Node: Calling Built-in494647 +Node: Numeric Functions496635 +Ref: Numeric Functions-Footnote-1500669 +Ref: Numeric Functions-Footnote-2501026 +Ref: Numeric Functions-Footnote-3501074 +Node: String Functions501343 +Ref: String Functions-Footnote-1524340 +Ref: String Functions-Footnote-2524469 +Ref: String Functions-Footnote-3524717 +Node: Gory Details524804 +Ref: table-sub-escapes526577 +Ref: table-sub-proposed528097 +Ref: table-posix-sub529461 +Ref: table-gensub-escapes531001 +Ref: Gory Details-Footnote-1532177 +Node: I/O Functions532328 +Ref: I/O Functions-Footnote-1539438 +Node: Time Functions539585 +Ref: Time Functions-Footnote-1550049 +Ref: Time Functions-Footnote-2550117 +Ref: Time Functions-Footnote-3550275 +Ref: Time Functions-Footnote-4550386 +Ref: Time Functions-Footnote-5550498 +Ref: Time Functions-Footnote-6550725 +Node: Bitwise Functions550991 +Ref: table-bitwise-ops551553 +Ref: Bitwise Functions-Footnote-1555798 +Node: Type Functions555982 +Node: I18N Functions557124 +Node: User-defined558769 +Node: Definition Syntax559573 +Ref: Definition Syntax-Footnote-1564886 +Node: Function Example564955 +Ref: Function Example-Footnote-1567595 +Node: Function Caveats567617 +Node: Calling A Function568135 +Node: Variable Scope569090 +Node: Pass By Value/Reference572078 +Node: Return Statement575588 +Node: Dynamic Typing578572 +Node: Indirect Calls579501 +Ref: Indirect Calls-Footnote-1589217 +Node: Functions Summary589345 +Node: Library Functions591995 +Ref: Library Functions-Footnote-1595613 +Ref: Library Functions-Footnote-2595756 +Node: Library Names595927 +Ref: Library Names-Footnote-1599400 +Ref: Library Names-Footnote-2599620 +Node: General Functions599706 +Node: Strtonum Function600734 +Node: Assert Function603608 +Node: Round Function606934 +Node: Cliff Random Function608475 +Node: Ordinal Functions609491 +Ref: Ordinal Functions-Footnote-1612556 +Ref: Ordinal Functions-Footnote-2612808 +Node: Join Function613019 +Ref: Join Function-Footnote-1614790 +Node: Getlocaltime Function614990 +Node: Readfile Function618726 +Node: Data File Management620565 +Node: Filetrans Function621197 +Node: Rewind Function625266 +Node: File Checking626824 +Ref: File Checking-Footnote-1627956 +Node: Empty Files628157 +Node: Ignoring Assigns630136 +Node: Getopt Function631690 +Ref: Getopt Function-Footnote-1642954 +Node: Passwd Functions643157 +Ref: Passwd Functions-Footnote-1652136 +Node: Group Functions652224 +Ref: Group Functions-Footnote-1660155 +Node: Walking Arrays660368 +Node: Library Functions Summary661971 +Node: Library Exercises663359 +Node: Sample Programs664639 +Node: Running Examples665409 +Node: Clones666137 +Node: Cut Program667361 +Node: Egrep Program677219 +Ref: Egrep Program-Footnote-1684806 +Node: Id Program684916 +Node: Split Program688570 +Ref: Split Program-Footnote-1692108 +Node: Tee Program692236 +Node: Uniq Program695023 +Node: Wc Program702446 +Ref: Wc Program-Footnote-1706711 +Node: Miscellaneous Programs706803 +Node: Dupword Program708016 +Node: Alarm Program710047 +Node: Translate Program714851 +Ref: Translate Program-Footnote-1719242 +Ref: Translate Program-Footnote-2719512 +Node: Labels Program719651 +Ref: Labels Program-Footnote-1723012 +Node: Word Sorting723096 +Node: History Sorting727139 +Node: Extract Program728975 +Node: Simple Sed736511 +Node: Igawk Program739573 +Ref: Igawk Program-Footnote-1753877 +Ref: Igawk Program-Footnote-2754078 +Node: Anagram Program754216 +Node: Signature Program757284 +Node: Programs Summary758531 +Node: Programs Exercises759746 +Ref: Programs Exercises-Footnote-1764133 +Node: Advanced Features764224 +Node: Nondecimal Data766172 +Node: Array Sorting767749 +Node: Controlling Array Traversal768446 +Node: Array Sorting Functions776726 +Ref: Array Sorting Functions-Footnote-1780633 +Node: Two-way I/O780827 +Ref: Two-way I/O-Footnote-1785771 +Ref: Two-way I/O-Footnote-2785950 +Node: TCP/IP Networking786032 +Node: Profiling788877 +Node: Advanced Features Summary796419 +Node: Internationalization798283 +Node: I18N and L10N799763 +Node: Explaining gettext800449 +Ref: Explaining gettext-Footnote-1805475 +Ref: Explaining gettext-Footnote-2805659 +Node: Programmer i18n805824 +Ref: Programmer i18n-Footnote-1810618 +Node: Translator i18n810667 +Node: String Extraction811461 +Ref: String Extraction-Footnote-1812594 +Node: Printf Ordering812680 +Ref: Printf Ordering-Footnote-1815462 +Node: I18N Portability815526 +Ref: I18N Portability-Footnote-1817975 +Node: I18N Example818038 +Ref: I18N Example-Footnote-1820744 +Node: Gawk I18N820816 +Node: I18N Summary821454 +Node: Debugger822793 +Node: Debugging823815 +Node: Debugging Concepts824256 +Node: Debugging Terms826112 +Node: Awk Debugging828709 +Node: Sample Debugging Session829601 +Node: Debugger Invocation830121 +Node: Finding The Bug831457 +Node: List of Debugger Commands837936 +Node: Breakpoint Control839268 +Node: Debugger Execution Control842932 +Node: Viewing And Changing Data846292 +Node: Execution Stack849650 +Node: Debugger Info851163 +Node: Miscellaneous Debugger Commands855157 +Node: Readline Support860341 +Node: Limitations861233 +Node: Debugging Summary863506 +Node: Arbitrary Precision Arithmetic864674 +Node: Computer Arithmetic866161 +Ref: Computer Arithmetic-Footnote-1870548 +Node: Math Definitions870605 +Ref: table-ieee-formats873894 +Ref: Math Definitions-Footnote-1874434 +Node: MPFR features874537 +Node: FP Math Caution876154 +Ref: FP Math Caution-Footnote-1877204 +Node: Inexactness of computations877573 +Node: Inexact representation878521 +Node: Comparing FP Values879876 +Node: Errors accumulate880840 +Node: Getting Accuracy882273 +Node: Try To Round884932 +Node: Setting precision885831 +Ref: table-predefined-precision-strings886513 +Node: Setting the rounding mode888306 +Ref: table-gawk-rounding-modes888670 +Ref: Setting the rounding mode-Footnote-1892124 +Node: Arbitrary Precision Integers892303 +Ref: Arbitrary Precision Integers-Footnote-1895284 +Node: POSIX Floating Point Problems895433 +Ref: POSIX Floating Point Problems-Footnote-1899309 +Node: Floating point summary899347 +Node: Dynamic Extensions901551 +Node: Extension Intro903103 +Node: Plugin License904368 +Node: Extension Mechanism Outline905053 +Ref: figure-load-extension905477 +Ref: figure-load-new-function906962 +Ref: figure-call-new-function907964 +Node: Extension API Description909948 +Node: Extension API Functions Introduction911398 +Node: General Data Types916265 +Ref: General Data Types-Footnote-1921958 +Node: Requesting Values922257 +Ref: table-value-types-returned922994 +Node: Memory Allocation Functions923952 +Ref: Memory Allocation Functions-Footnote-1926699 +Node: Constructor Functions926795 +Node: Registration Functions928553 +Node: Extension Functions929238 +Node: Exit Callback Functions931540 +Node: Extension Version String932788 +Node: Input Parsers933438 +Node: Output Wrappers943252 +Node: Two-way processors947768 +Node: Printing Messages949972 +Ref: Printing Messages-Footnote-1951049 +Node: Updating `ERRNO'951201 +Node: Accessing Parameters951940 +Node: Symbol Table Access953170 +Node: Symbol table by name953684 +Node: Symbol table by cookie955660 +Ref: Symbol table by cookie-Footnote-1959793 +Node: Cached values959856 +Ref: Cached values-Footnote-1963360 +Node: Array Manipulation963451 +Ref: Array Manipulation-Footnote-1964549 +Node: Array Data Types964588 +Ref: Array Data Types-Footnote-1967291 +Node: Array Functions967383 +Node: Flattening Arrays971257 +Node: Creating Arrays978109 +Node: Extension API Variables982840 +Node: Extension Versioning983476 +Node: Extension API Informational Variables985377 +Node: Extension API Boilerplate986463 +Node: Finding Extensions990267 +Node: Extension Example990827 +Node: Internal File Description991557 +Node: Internal File Ops995648 +Ref: Internal File Ops-Footnote-11007080 +Node: Using Internal File Ops1007220 +Ref: Using Internal File Ops-Footnote-11009567 +Node: Extension Samples1009835 +Node: Extension Sample File Functions1011359 +Node: Extension Sample Fnmatch1018927 +Node: Extension Sample Fork1020409 +Node: Extension Sample Inplace1021622 +Node: Extension Sample Ord1023297 +Node: Extension Sample Readdir1024133 +Ref: table-readdir-file-types1024989 +Node: Extension Sample Revout1025788 +Node: Extension Sample Rev2way1026379 +Node: Extension Sample Read write array1027120 +Node: Extension Sample Readfile1028999 +Node: Extension Sample API Tests1030099 +Node: Extension Sample Time1030624 +Node: gawkextlib1031939 +Node: Extension summary1034752 +Node: Extension Exercises1038445 +Node: Language History1039167 +Node: V7/SVR3.11040810 +Node: SVR41043130 +Node: POSIX1044572 +Node: BTL1045958 +Node: POSIX/GNU1046692 +Node: Feature History1052408 +Node: Common Extensions1065499 +Node: Ranges and Locales1066811 +Ref: Ranges and Locales-Footnote-11071428 +Ref: Ranges and Locales-Footnote-21071455 +Ref: Ranges and Locales-Footnote-31071689 +Node: Contributors1071910 +Node: History summary1077335 +Node: Installation1078704 +Node: Gawk Distribution1079655 +Node: Getting1080139 +Node: Extracting1080963 +Node: Distribution contents1082605 +Node: Unix Installation1088322 +Node: Quick Installation1088939 +Node: Additional Configuration Options1091381 +Node: Configuration Philosophy1093119 +Node: Non-Unix Installation1095470 +Node: PC Installation1095928 +Node: PC Binary Installation1097239 +Node: PC Compiling1099087 +Ref: PC Compiling-Footnote-11102086 +Node: PC Testing1102191 +Node: PC Using1103367 +Node: Cygwin1107519 +Node: MSYS1108328 +Node: VMS Installation1108842 +Node: VMS Compilation1109638 +Ref: VMS Compilation-Footnote-11110860 +Node: VMS Dynamic Extensions1110918 +Node: VMS Installation Details1112291 +Node: VMS Running1114543 +Node: VMS GNV1117377 +Node: VMS Old Gawk1118100 +Node: Bugs1118570 +Node: Other Versions1122574 +Node: Installation summary1128801 +Node: Notes1129857 +Node: Compatibility Mode1130722 +Node: Additions1131504 +Node: Accessing The Source1132429 +Node: Adding Code1133865 +Node: New Ports1140043 +Node: Derived Files1144524 +Ref: Derived Files-Footnote-11149605 +Ref: Derived Files-Footnote-21149639 +Ref: Derived Files-Footnote-31150235 +Node: Future Extensions1150349 +Node: Implementation Limitations1150955 +Node: Extension Design1152203 +Node: Old Extension Problems1153357 +Ref: Old Extension Problems-Footnote-11154874 +Node: Extension New Mechanism Goals1154931 +Ref: Extension New Mechanism Goals-Footnote-11158291 +Node: Extension Other Design Decisions1158480 +Node: Extension Future Growth1160586 +Node: Old Extension Mechanism1161422 +Node: Notes summary1163184 +Node: Basic Concepts1164370 +Node: Basic High Level1165051 +Ref: figure-general-flow1165323 +Ref: figure-process-flow1165922 +Ref: Basic High Level-Footnote-11169151 +Node: Basic Data Typing1169336 +Node: Glossary1172664 +Node: Copying1197816 +Node: GNU Free Documentation License1235372 +Node: Index1260508 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 6e917e44..1ecfbb84 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -14724,7 +14724,7 @@ current record. @xref{Changing Fields}. @cindex differences in @command{awk} and @command{gawk}, @code{FUNCTAB} variable @item @code{FUNCTAB #} An array whose indices and corresponding values are the names of all -the user-defined or extension functions in the program. +the built-in, user-defined and extension functions in the program. @quotation NOTE Attempting to use the @code{delete} statement with the @code{FUNCTAB} @@ -14772,9 +14772,12 @@ text of the AWK program. For each identifier, the value of the element is one o @item "array" The identifier is an array. +@item "builtin" +The identifier is a built-in function. + @item "extension" The identifier is an extension function loaded via -@code{@@load}. +@code{@@load} or @option{-l}. @item "scalar" The identifier is a scalar. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index a6ece064..31faa324 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -14058,7 +14058,7 @@ current record. @xref{Changing Fields}. @cindex differences in @command{awk} and @command{gawk}, @code{FUNCTAB} variable @item @code{FUNCTAB #} An array whose indices and corresponding values are the names of all -the user-defined or extension functions in the program. +the built-in, user-defined and extension functions in the program. @quotation NOTE Attempting to use the @code{delete} statement with the @code{FUNCTAB} @@ -14106,9 +14106,12 @@ text of the AWK program. For each identifier, the value of the element is one o @item "array" The identifier is an array. +@item "builtin" +The identifier is a built-in function. + @item "extension" The identifier is an extension function loaded via -@code{@@load}. +@code{@@load} or @option{-l}. @item "scalar" The identifier is a scalar. @@ -241,6 +241,7 @@ static const char *const nodetypes[] = { "Node_func", "Node_ext_func", "Node_old_ext_func", + "Node_builtin_func", "Node_array_ref", "Node_array_tree", "Node_array_leaf", diff --git a/interpret.h b/interpret.h index fee8136e..28804330 100644 --- a/interpret.h +++ b/interpret.h @@ -1039,12 +1039,13 @@ match_re: } if (f == NULL) { + fatal(_("`%s' is not a function, so it cannot be called indirectly"), + t1->stptr); + } else if (f->type == Node_builtin_func) { int arg_count = (pc + 1)->expr_count; builtin_func_t the_func = lookup_builtin(t1->stptr); - if (the_func == NULL) - fatal(_("`%s' is not a user-defined function, so it cannot be called indirectly"), - t1->stptr); + assert(the_func != NULL); /* call it */ r = the_func(arg_count); @@ -705,6 +705,8 @@ out: if (do_intl) exit(EXIT_SUCCESS); + install_builtins(); + if (do_lint) shadow_funcs(); @@ -307,7 +307,9 @@ install(char *name, NODE *parm, NODETYPE type) if (type == Node_param_list) { table = param_table; - } else if (type == Node_func || type == Node_ext_func) { + } else if ( type == Node_func + || type == Node_ext_func + || type == Node_builtin_func) { table = func_table; } else if (installing_specials) { table = global_table; @@ -320,7 +322,7 @@ install(char *name, NODE *parm, NODETYPE type) r = make_symbol(name, type); if (type == Node_func) func_count++; - if (type != Node_ext_func && table != global_table) + if (type != Node_ext_func && type != Node_builtin_func && table != global_table) var_count++; /* total, includes Node_func */ } @@ -393,7 +395,7 @@ get_symbols(SYMBOL_TYPE what, bool sort) for (i = count = 0; i < max; i += 2) { r = list[i+1]; - if (r->type == Node_ext_func) + if (r->type == Node_ext_func || r->type == Node_builtin_func) continue; assert(r->type == Node_func); table[count++] = r; @@ -539,7 +541,7 @@ load_symbols() NODE *sym_array; NODE **aptr; long i, j, max; - NODE *user, *extension, *untyped, *scalar, *array; + NODE *user, *extension, *untyped, *scalar, *array, *built_in; NODE **list; NODE *tables[4]; @@ -570,6 +572,7 @@ load_symbols() scalar = make_string("scalar", 6); untyped = make_string("untyped", 7); array = make_string("array", 5); + built_in = make_string("builtin", 7); for (i = 0; tables[i] != NULL; i++) { list = assoc_list(tables[i], "@unsorted", ASORTI); @@ -580,6 +583,7 @@ load_symbols() r = list[j+1]; if ( r->type == Node_ext_func || r->type == Node_func + || r->type == Node_builtin_func || r->type == Node_var || r->type == Node_var_array || r->type == Node_var_new) { @@ -594,6 +598,9 @@ load_symbols() case Node_func: *aptr = dupnode(user); break; + case Node_builtin_func: + *aptr = dupnode(built_in); + break; case Node_var: *aptr = dupnode(scalar); break; diff --git a/test/ChangeLog b/test/ChangeLog index ae1232c6..fce42e04 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -7,6 +7,7 @@ Sort of related: * indirectcall2.awk, indirectcall2.ok: New files. + * id.ok: Updated. 2014-09-04 Arnold D. Robbins <arnold@skeeve.com> @@ -1,32 +1,72 @@ -FUNCTAB -> array -ARGV -> array -SYMTAB -> array -ORS -> scalar -ROUNDMODE -> scalar -i -> untyped OFS -> scalar +rand -> builtin +ARGC -> scalar +dcgettext -> builtin +gsub -> builtin +PREC -> scalar +match -> builtin +ARGIND -> scalar +int -> builtin ERRNO -> scalar +ARGV -> array +log -> builtin +sprintf -> builtin +ROUNDMODE -> scalar +strftime -> builtin +systime -> builtin +and -> builtin +srand -> builtin FNR -> scalar +asort -> builtin +atan2 -> builtin +cos -> builtin +TEXTDOMAIN -> scalar +ORS -> scalar +split -> builtin +RSTART -> scalar +compl -> builtin +bindtextdomain -> builtin +exp -> builtin +or -> builtin +fflush -> builtin +gensub -> builtin LINT -> scalar +dcngettext -> builtin +index -> builtin IGNORECASE -> scalar -NR -> scalar -function1 -> user -ARGIND -> scalar -NF -> scalar -TEXTDOMAIN -> scalar +system -> builtin CONVFMT -> scalar +sqrt -> builtin +rshift -> builtin +tolower -> builtin +FS -> scalar +BINMODE -> scalar +sin -> builtin +asorti -> builtin FIELDWIDTHS -> scalar -ARGC -> scalar +function1 -> user +FILENAME -> scalar +close -> builtin +mktime -> builtin +FUNCTAB -> array +NF -> scalar +isarray -> builtin an_array -> untyped -PROCINFO -> array -PREC -> scalar +patsplit -> builtin +NR -> scalar SUBSEP -> scalar -FPAT -> scalar -RS -> scalar -FS -> scalar +extension -> builtin +i -> untyped +sub -> builtin OFMT -> scalar RLENGTH -> scalar +substr -> builtin +FPAT -> scalar +RS -> scalar +xor -> builtin RT -> scalar -BINMODE -> scalar -FILENAME -> scalar -RSTART -> scalar +PROCINFO -> array +lshift -> builtin +SYMTAB -> array +strtonum -> builtin +toupper -> builtin |