diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 203 |
1 files changed, 96 insertions, 107 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index 8d9422f2..a8b6450b 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -21773,16 +21773,9 @@ when writing extensions. The next minor node shows how they are used: is current. It may end up calling an internal `gawk' function. It also guarantees that the wide string is zero-terminated. -`size_t get_curfunc_arg_count(void)' - This function returns the actual number of parameters passed to - the current function. Inside the code of an extension this can be - used to determine the maximum index which is safe to use with - `get_actual_argument'. If this value is greater than `nargs', the - function was called incorrectly from the `awk' program. - `nargs' - Inside an extension function, this is the maximum number of - expected parameters, as set by the `make_builtin()' function. + Inside an extension function, this is the actual number of + parameters passed to the current function. `n->stptr' `n->stlen' @@ -21810,12 +21803,10 @@ when writing extensions. The next minor node shows how they are used: Clears the associative array pointed to by `n'. Make sure that `n->type == Node_var_array' first. -`NODE **assoc_lookup(NODE *symbol, NODE *subs, int reference)' +`NODE **assoc_lookup(NODE *symbol, NODE *subs)' Finds, and installs if necessary, array elements. `symbol' is the array, `subs' is the subscript. This is usually a value created - with `make_string()' (see below). `reference' should be `TRUE' if - it is an error to use the value before it is created. Typically, - `FALSE' is the correct value to use from extension functions. + with `make_string()' (see below). `NODE *make_string(char *s, size_t len)' Take a C string and turn it into a pointer to a `NODE' that can be @@ -22117,7 +22108,7 @@ other POSIX-compliant systems:(1) NODE *newdir; int ret = -1; - if (do_lint && get_curfunc_arg_count() != 1) + if (do_lint && nargs != 1) lintwarn("chdir: called with incorrect number of arguments"); newdir = get_scalar_argument(0, FALSE); @@ -22174,7 +22165,7 @@ declarations and argument checking: char *pmode; /* printable mode */ char *type = "unknown"; - if (do_lint && get_curfunc_arg_count() > 2) + if (do_lint && nargs > 2) lintwarn("stat: called with too many arguments"); Then comes the actual work. First, the function gets the arguments. @@ -22201,15 +22192,15 @@ link. If there's an error, it sets `ERRNO' and returns: calls are shown here, since they all follow the same pattern: /* fill in the array */ - aptr = assoc_lookup(array, tmp = make_string("name", 4), FALSE); + aptr = assoc_lookup(array, tmp = make_string("name", 4)); *aptr = dupnode(file); unref(tmp); - aptr = assoc_lookup(array, tmp = make_string("mode", 4), FALSE); + aptr = assoc_lookup(array, tmp = make_string("mode", 4)); *aptr = make_number((AWKNUM) sbuf.st_mode); unref(tmp); - aptr = assoc_lookup(array, tmp = make_string("pmode", 5), FALSE); + aptr = assoc_lookup(array, tmp = make_string("pmode", 5)); pmode = format_mode(sbuf.st_mode); *aptr = make_string(pmode, strlen(pmode)); unref(tmp); @@ -24970,18 +24961,18 @@ Index * arguments, command-line, invoking awk: Command Line. (line 6) * arguments, in function calls: Function Calls. (line 16) * arguments, processing: Getopt Function. (line 6) -* arguments, retrieving: Internals. (line 120) +* arguments, retrieving: Internals. (line 111) * arithmetic operators: Arithmetic Ops. (line 6) * arrays: Arrays. (line 6) * arrays, as parameters to functions: Pass By Value/Reference. (line 47) * arrays, associative: Array Intro. (line 50) -* arrays, associative, clearing: Internals. (line 75) +* arrays, associative, clearing: Internals. (line 68) * arrays, associative, library functions and: Library Names. (line 57) * arrays, deleting entire contents: Delete. (line 39) * arrays, elements, assigning: Assigning Elements. (line 6) * arrays, elements, deleting: Delete. (line 6) -* arrays, elements, installing: Internals. (line 79) +* arrays, elements, installing: Internals. (line 72) * arrays, elements, order of: Scanning an Array. (line 48) * arrays, elements, referencing: Reference to Elements. (line 6) @@ -25020,8 +25011,8 @@ Index * assignment operators, evaluation order: Assignment Ops. (line 111) * assignment operators, lvalues/rvalues: Assignment Ops. (line 32) * assignments as filenames: Ignoring Assigns. (line 6) -* assoc_clear() internal function: Internals. (line 75) -* assoc_lookup() internal function: Internals. (line 79) +* assoc_clear() internal function: Internals. (line 68) +* assoc_lookup() internal function: Internals. (line 72) * associative arrays: Array Intro. (line 50) * asterisk (*), * operator, as multiplication operator: Precedence. (line 55) @@ -25292,7 +25283,7 @@ Index * close() function, two-way pipes and: Two-way I/O. (line 77) * Close, Diane <1>: Contributors. (line 21) * Close, Diane: Manual History. (line 41) -* close_func() input method: Internals. (line 160) +* close_func() input method: Internals. (line 151) * collating elements: Bracket Expressions. (line 69) * collating symbols: Bracket Expressions. (line 76) * Colombo, Antonio: Acknowledgments. (line 60) @@ -25665,7 +25656,7 @@ Index * DuBois, John: Acknowledgments. (line 60) * dump debugger command: Miscellaneous Dgawk Commands. (line 9) -* dupnode() internal function: Internals. (line 96) +* dupnode() internal function: Internals. (line 87) * dupword.awk program: Dupword Program. (line 31) * e debugger command (alias for enable): Breakpoint Control. (line 72) * EBCDIC: Ordinal Functions. (line 45) @@ -25706,7 +25697,7 @@ Index * endgrent() user-defined function: Group Functions. (line 218) * endpwent() function (C library): Passwd Functions. (line 210) * endpwent() user-defined function: Passwd Functions. (line 213) -* ENVIRON array <1>: Internals. (line 149) +* ENVIRON array <1>: Internals. (line 140) * ENVIRON array: Auto-set. (line 60) * environment variables: Auto-set. (line 60) * epoch, definition of: Glossary. (line 239) @@ -25715,7 +25706,7 @@ Index * equals sign (=), == operator: Comparison Operators. (line 11) * EREs (Extended Regular Expressions): Bracket Expressions. (line 24) -* ERRNO variable <1>: Internals. (line 139) +* ERRNO variable <1>: Internals. (line 130) * ERRNO variable <2>: TCP/IP Networking. (line 54) * ERRNO variable <3>: Auto-set. (line 72) * ERRNO variable <4>: BEGINFILE/ENDFILE. (line 26) @@ -25764,7 +25755,7 @@ Index (line 9) * expressions, selecting: Conditional Exp. (line 6) * Extended Regular Expressions (EREs): Bracket Expressions. (line 24) -* eXtensible Markup Language (XML): Internals. (line 160) +* eXtensible Markup Language (XML): Internals. (line 151) * extension() function (gawk): Using Internal File Ops. (line 15) * extensions, Brian Kernighan's awk <1>: Other Versions. (line 13) @@ -25986,7 +25977,7 @@ Index * functions, names of <1>: Definition Syntax. (line 20) * functions, names of: Arrays. (line 18) * functions, recursive: Definition Syntax. (line 73) -* functions, return values, setting: Internals. (line 139) +* functions, return values, setting: Internals. (line 130) * functions, string-translation: I18N Functions. (line 6) * functions, undefined: Pass By Value/Reference. (line 71) @@ -26100,12 +26091,11 @@ Index * gensub() function (gawk): Using Constant Regexps. (line 43) * gensub() function (gawk), escape processing: Gory Details. (line 6) -* get_actual_argument() internal function: Internals. (line 125) -* get_argument() internal function: Internals. (line 120) -* get_array_argument() internal macro: Internals. (line 136) -* get_curfunc_arg_count() internal function: Internals. (line 42) -* get_record() input method: Internals. (line 160) -* get_scalar_argument() internal macro: Internals. (line 133) +* get_actual_argument() internal function: Internals. (line 116) +* get_argument() internal function: Internals. (line 111) +* get_array_argument() internal macro: Internals. (line 127) +* get_record() input method: Internals. (line 151) +* get_scalar_argument() internal macro: Internals. (line 124) * getaddrinfo() function (C library): TCP/IP Networking. (line 38) * getgrent() function (C library): Group Functions. (line 6) * getgrent() user-defined function: Group Functions. (line 6) @@ -26258,37 +26248,36 @@ Index * integers: Basic Data Typing. (line 21) * integers, unsigned: Basic Data Typing. (line 30) * interacting with other programs: I/O Functions. (line 63) -* internal constant, INVALID_HANDLE: Internals. (line 160) -* internal function, assoc_clear(): Internals. (line 75) -* internal function, assoc_lookup(): Internals. (line 79) -* internal function, dupnode(): Internals. (line 96) +* internal constant, INVALID_HANDLE: Internals. (line 151) +* internal function, assoc_clear(): Internals. (line 68) +* internal function, assoc_lookup(): Internals. (line 72) +* internal function, dupnode(): Internals. (line 87) * internal function, force_number(): Internals. (line 27) * internal function, force_string(): Internals. (line 32) * internal function, force_wstring(): Internals. (line 37) -* internal function, get_actual_argument(): Internals. (line 125) -* internal function, get_argument(): Internals. (line 120) -* internal function, get_curfunc_arg_count(): Internals. (line 42) -* internal function, iop_alloc(): Internals. (line 160) -* internal function, make_builtin(): Internals. (line 106) -* internal function, make_number(): Internals. (line 91) -* internal function, make_string(): Internals. (line 86) -* internal function, register_deferred_variable(): Internals. (line 149) -* internal function, register_open_hook(): Internals. (line 160) -* internal function, unref(): Internals. (line 101) -* internal function, update_ERRNO(): Internals. (line 139) -* internal function, update_ERRNO_saved(): Internals. (line 144) -* internal macro, get_array_argument(): Internals. (line 136) -* internal macro, get_scalar_argument(): Internals. (line 133) -* internal structure, IOBUF: Internals. (line 160) +* internal function, get_actual_argument(): Internals. (line 116) +* internal function, get_argument(): Internals. (line 111) +* internal function, iop_alloc(): Internals. (line 151) +* internal function, make_builtin(): Internals. (line 97) +* internal function, make_number(): Internals. (line 82) +* internal function, make_string(): Internals. (line 77) +* internal function, register_deferred_variable(): Internals. (line 140) +* internal function, register_open_hook(): Internals. (line 151) +* internal function, unref(): Internals. (line 92) +* internal function, update_ERRNO(): Internals. (line 130) +* internal function, update_ERRNO_saved(): Internals. (line 135) +* internal macro, get_array_argument(): Internals. (line 127) +* internal macro, get_scalar_argument(): Internals. (line 124) +* internal structure, IOBUF: Internals. (line 151) * internal type, AWKNUM: Internals. (line 19) * internal type, NODE: Internals. (line 23) -* internal variable, nargs: Internals. (line 49) -* internal variable, stlen: Internals. (line 53) -* internal variable, stptr: Internals. (line 53) -* internal variable, type: Internals. (line 66) -* internal variable, vname: Internals. (line 71) -* internal variable, wstlen: Internals. (line 61) -* internal variable, wstptr: Internals. (line 61) +* internal variable, nargs: Internals. (line 42) +* internal variable, stlen: Internals. (line 46) +* internal variable, stptr: Internals. (line 46) +* internal variable, type: Internals. (line 59) +* internal variable, vname: Internals. (line 64) +* internal variable, wstlen: Internals. (line 54) +* internal variable, wstptr: Internals. (line 54) * internationalization <1>: I18N and L10N. (line 6) * internationalization: I18N Functions. (line 6) * internationalization, localization <1>: Internationalization. @@ -26308,10 +26297,10 @@ Index * interpreted programs <1>: Glossary. (line 361) * interpreted programs: Basic High Level. (line 14) * interval expressions: Regexp Operators. (line 116) -* INVALID_HANDLE internal constant: Internals. (line 160) +* INVALID_HANDLE internal constant: Internals. (line 151) * inventory-shipped file: Sample Data Files. (line 32) -* IOBUF internal structure: Internals. (line 160) -* iop_alloc() internal function: Internals. (line 160) +* IOBUF internal structure: Internals. (line 151) +* iop_alloc() internal function: Internals. (line 151) * isarray() function (gawk): Type Functions. (line 11) * ISO: Glossary. (line 372) * ISO 8859-1: Glossary. (line 141) @@ -26438,9 +26427,9 @@ Index * lvalues/rvalues: Assignment Ops. (line 32) * mailing labels, printing: Labels Program. (line 6) * mailing list, GNITS: Acknowledgments. (line 52) -* make_builtin() internal function: Internals. (line 106) -* make_number() internal function: Internals. (line 91) -* make_string() internal function: Internals. (line 86) +* make_builtin() internal function: Internals. (line 97) +* make_number() internal function: Internals. (line 82) +* make_string() internal function: Internals. (line 77) * mark parity: Ordinal Functions. (line 45) * marked string extraction (internationalization): String Extraction. (line 6) @@ -26455,7 +26444,7 @@ Index * matching, null strings: Gory Details. (line 164) * mawk program: Other Versions. (line 35) * McPhee, Patrick: Contributors. (line 100) -* memory, releasing: Internals. (line 101) +* memory, releasing: Internals. (line 92) * message object files: Explaining gettext. (line 41) * message object files, converting from portable object files: I18N Example. (line 62) @@ -26477,7 +26466,7 @@ Index * namespace issues <1>: Library Names. (line 6) * namespace issues: Arrays. (line 18) * namespace issues, functions: Definition Syntax. (line 20) -* nargs internal variable: Internals. (line 49) +* nargs internal variable: Internals. (line 42) * nawk utility: Names. (line 17) * negative zero: Unexpected Results. (line 28) * NetBSD: Glossary. (line 611) @@ -26519,7 +26508,7 @@ Index (line 49) * noassign.awk program: Ignoring Assigns. (line 15) * NODE internal type: Internals. (line 23) -* nodes, duplicating: Internals. (line 96) +* nodes, duplicating: Internals. (line 87) * not Boolean-logic operator: Boolean Ops. (line 6) * NR variable <1>: Auto-set. (line 118) * NR variable: Records. (line 6) @@ -26540,7 +26529,7 @@ Index * number sign (#), #! (executable scripts), portability issues with: Executable Scripts. (line 6) * number sign (#), commenting: Comments. (line 6) -* numbers: Internals. (line 91) +* numbers: Internals. (line 82) * numbers, as array subscripts: Numeric Array Subscripts. (line 6) * numbers, as values of characters: Ordinal Functions. (line 6) @@ -26643,7 +26632,7 @@ Index (line 36) * P1003.1 POSIX standard: Glossary. (line 454) * P1003.2 POSIX standard: Glossary. (line 454) -* parameters, number of: Internals. (line 49) +* parameters, number of: Internals. (line 42) * parentheses (): Regexp Operators. (line 79) * parentheses (), pgawk program: Profiling. (line 141) * password file: Passwd Functions. (line 16) @@ -26807,7 +26796,7 @@ Index * private variables: Library Names. (line 11) * processes, two-way communications with: Two-way I/O. (line 23) * processing data: Basic High Level. (line 6) -* PROCINFO array <1>: Internals. (line 149) +* PROCINFO array <1>: Internals. (line 140) * PROCINFO array <2>: Id Program. (line 15) * PROCINFO array <3>: Group Functions. (line 6) * PROCINFO array <4>: Passwd Functions. (line 6) @@ -26903,8 +26892,8 @@ Index * regexp constants, slashes vs. quotes: Computed Regexps. (line 28) * regexp constants, vs. string constants: Computed Regexps. (line 38) * regexp, See regular expressions: Regexp. (line 6) -* register_deferred_variable() internal function: Internals. (line 149) -* register_open_hook() internal function: Internals. (line 160) +* register_deferred_variable() internal function: Internals. (line 140) +* register_open_hook() internal function: Internals. (line 151) * regular expressions: Regexp. (line 6) * regular expressions as field separators: Field Separators. (line 50) * regular expressions, anchors in: Regexp Operators. (line 22) @@ -27130,8 +27119,8 @@ Index (line 68) * stepi debugger command: Dgawk Execution Control. (line 76) -* stlen internal variable: Internals. (line 53) -* stptr internal variable: Internals. (line 53) +* stlen internal variable: Internals. (line 46) +* stptr internal variable: Internals. (line 46) * stream editors <1>: Simple Sed. (line 6) * stream editors: Field Splitting Summary. (line 47) @@ -27142,7 +27131,7 @@ Index (line 6) * string operators: Concatenation. (line 9) * string-matching operators: Regexp Usage. (line 19) -* strings: Internals. (line 86) +* strings: Internals. (line 77) * strings, converting <1>: Bitwise Functions. (line 107) * strings, converting: Conversion. (line 6) * strings, converting, numbers to: User-modified. (line 28) @@ -27272,7 +27261,7 @@ Index * trunc-mod operation: Arithmetic Ops. (line 66) * truth values: Truth Values. (line 6) * type conversion: Conversion. (line 21) -* type internal variable: Internals. (line 66) +* type internal variable: Internals. (line 59) * u debugger command (alias for until): Dgawk Execution Control. (line 83) * undefined functions: Pass By Value/Reference. @@ -27298,15 +27287,15 @@ Index (line 72) * Unix, awk scripts and: Executable Scripts. (line 6) * UNIXROOT variable, on OS/2 systems: PC Using. (line 17) -* unref() internal function: Internals. (line 101) +* unref() internal function: Internals. (line 92) * unsigned integers: Basic Data Typing. (line 30) * until debugger command: Dgawk Execution Control. (line 83) * unwatch debugger command: Viewing And Changing Data. (line 84) * up debugger command: Dgawk Stack. (line 33) -* update_ERRNO() internal function: Internals. (line 139) -* update_ERRNO_saved() internal function: Internals. (line 144) +* update_ERRNO() internal function: Internals. (line 130) +* update_ERRNO_saved() internal function: Internals. (line 135) * user database, reading: Passwd Functions. (line 6) * user-defined, functions: User-defined. (line 6) * user-defined, functions, counts: Profiling. (line 132) @@ -27357,7 +27346,7 @@ Index * vertical bar (|), || operator <1>: Precedence. (line 89) * vertical bar (|), || operator: Boolean Ops. (line 57) * Vinschen, Corinna: Acknowledgments. (line 60) -* vname internal variable: Internals. (line 71) +* vname internal variable: Internals. (line 64) * w debugger command (alias for watch): Viewing And Changing Data. (line 67) * w utility: Constant Size. (line 22) @@ -27391,11 +27380,11 @@ Index * words, counting: Wc Program. (line 6) * words, duplicate, searching for: Dupword Program. (line 6) * words, usage counts, generating: Word Sorting. (line 6) -* wstlen internal variable: Internals. (line 61) -* wstptr internal variable: Internals. (line 61) +* wstlen internal variable: Internals. (line 54) +* wstptr internal variable: Internals. (line 54) * xgawk: Other Versions. (line 119) * xgettext utility: String Extraction. (line 13) -* XML (eXtensible Markup Language): Internals. (line 160) +* XML (eXtensible Markup Language): Internals. (line 151) * XOR bitwise operation: Bitwise Functions. (line 6) * xor() function (gawk): Bitwise Functions. (line 54) * Yawitz, Efraim: Contributors. (line 106) @@ -27823,26 +27812,26 @@ Node: Adding Code860119 Node: New Ports866086 Node: Dynamic Extensions870199 Node: Internals871575 -Node: Plugin License880678 -Node: Sample Library881312 -Node: Internal File Description881998 -Node: Internal File Ops885713 -Ref: Internal File Ops-Footnote-1890494 -Node: Using Internal File Ops890634 -Node: Future Extensions893011 -Node: Basic Concepts895515 -Node: Basic High Level896272 -Ref: Basic High Level-Footnote-1900307 -Node: Basic Data Typing900492 -Node: Floating Point Issues905017 -Node: String Conversion Precision906100 -Ref: String Conversion Precision-Footnote-1907800 -Node: Unexpected Results907909 -Node: POSIX Floating Point Problems909735 -Ref: POSIX Floating Point Problems-Footnote-1913440 -Node: Glossary913478 -Node: Copying938454 -Node: GNU Free Documentation License976011 -Node: Index1001148 +Node: Plugin License880094 +Node: Sample Library880728 +Node: Internal File Description881414 +Node: Internal File Ops885129 +Ref: Internal File Ops-Footnote-1889853 +Node: Using Internal File Ops889993 +Node: Future Extensions892370 +Node: Basic Concepts894874 +Node: Basic High Level895631 +Ref: Basic High Level-Footnote-1899666 +Node: Basic Data Typing899851 +Node: Floating Point Issues904376 +Node: String Conversion Precision905459 +Ref: String Conversion Precision-Footnote-1907159 +Node: Unexpected Results907268 +Node: POSIX Floating Point Problems909094 +Ref: POSIX Floating Point Problems-Footnote-1912799 +Node: Glossary912837 +Node: Copying937813 +Node: GNU Free Documentation License975370 +Node: Index1000507 End Tag Table |