diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/gawk.1 | 2 | ||||
-rw-r--r-- | doc/gawk.info | 815 | ||||
-rw-r--r-- | doc/gawk.texi | 23 |
4 files changed, 415 insertions, 430 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 57572590..756b8413 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2012-05-24 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * gawk.texi, gawk.1: Replace references to dlload with dl_load. + But much more work needs to be done on the docs. + 2012-05-19 Andrew J. Schorr <aschorr@telemetry-investments.com> * gawk.texi, gawk.1: Document new -i option, and describe new default @@ -347,7 +347,7 @@ This searches for the library using the environment variable. If the initial search fails, another attempt will be made after appending the default shared library suffix for the platform. The library initialization routine is expected to be named -.BR dlload() . +.BR dl_load() . .TP .PD 0 .BR "\-L " [ \fIvalue\fR ] diff --git a/doc/gawk.info b/doc/gawk.info index 0eb5dad7..7109ee6d 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -2315,7 +2315,7 @@ The following list describes options mandated by the POSIX standard: `AWKLIBPATH' environment variable. The correct library suffix for your platform will be supplied by default, so it need not be specified in the library name. The library initialization routine - should be named `dlload()'. An alternative is to use the `@load' + should be named `dl_load()'. An alternative is to use the `@load' keyword inside the program to load a shared library. `-L [value]' @@ -22970,7 +22970,7 @@ command line option `-l': $ gawk -l libname -f myprog This will work only if the initialization routine is named -`dlload()'. +`dl_load()'. If you use `extension()', the library will be loaded at run time. This means that the functions are available only to the rest of your @@ -22990,7 +22990,7 @@ the name of your library is `mylib.so', you can simply type $ gawk -l mylib -f myprog and `gawk' will do everything necessary to load in your library, and -then call your `dlload()' routine. +then call your `dl_load()' routine. You can always specify the library using an absolute pathname, in which case `gawk' will not use `AWKLIBPATH' to search for it. @@ -23264,17 +23264,8 @@ calls are shown here, since they all follow the same pattern: Finally, it's necessary to provide the "glue" that loads the new function(s) into `gawk'. By convention, each library has a routine -named `dlload()' that does the job: - - /* dlload --- load new builtins in this library */ - - NODE * - dlload(NODE *tree, void *dl) - { - make_builtin("chdir", do_chdir, 1); - make_builtin("stat", do_stat, 2); - return make_number((AWKNUM) 0); - } +named `dl_load()' that does the job. The simplest way is to use the +`dl_load_func' macro in `gawkapi.h'. And that's it! As an exercise, consider adding functions to implement system calls such as `chown()', `chmod()', and `umask()'. @@ -23309,7 +23300,7 @@ shared library: # file testff.awk BEGIN { - extension("./filefuncs.so", "dlload") + extension("./filefuncs.so", "dl_load") chdir(".") # no-op @@ -28561,402 +28552,402 @@ Node: When96625 Node: Invoking Gawk98772 Node: Command Line100233 Node: Options101016 -Ref: Options-Footnote-1116413 -Node: Other Arguments116438 -Node: Naming Standard Input119096 -Node: Environment Variables120190 -Node: AWKPATH Variable120748 -Ref: AWKPATH Variable-Footnote-1123506 -Node: AWKLIBPATH Variable123766 -Node: Other Environment Variables124363 -Node: Exit Status126858 -Node: Include Files127533 -Node: Loading Shared Libraries131102 -Node: Obsolete132327 -Node: Undocumented133024 -Node: Regexp133267 -Node: Regexp Usage134656 -Node: Escape Sequences136682 -Node: Regexp Operators142445 -Ref: Regexp Operators-Footnote-1149825 -Ref: Regexp Operators-Footnote-2149972 -Node: Bracket Expressions150070 -Ref: table-char-classes151960 -Node: GNU Regexp Operators154486 -Node: Case-sensitivity158209 -Ref: Case-sensitivity-Footnote-1161177 -Ref: Case-sensitivity-Footnote-2161412 -Node: Leftmost Longest161520 -Node: Computed Regexps162721 -Node: Reading Files166131 -Node: Records168135 -Ref: Records-Footnote-1176809 -Node: Fields176846 -Ref: Fields-Footnote-1179879 -Node: Nonconstant Fields179965 -Node: Changing Fields182167 -Node: Field Separators188148 -Node: Default Field Splitting190777 -Node: Regexp Field Splitting191894 -Node: Single Character Fields195236 -Node: Command Line Field Separator196295 -Node: Field Splitting Summary199736 -Ref: Field Splitting Summary-Footnote-1202928 -Node: Constant Size203029 -Node: Splitting By Content207613 -Ref: Splitting By Content-Footnote-1211339 -Node: Multiple Line211379 -Ref: Multiple Line-Footnote-1217226 -Node: Getline217405 -Node: Plain Getline219621 -Node: Getline/Variable221710 -Node: Getline/File222851 -Node: Getline/Variable/File224173 -Ref: Getline/Variable/File-Footnote-1225772 -Node: Getline/Pipe225859 -Node: Getline/Variable/Pipe228419 -Node: Getline/Coprocess229526 -Node: Getline/Variable/Coprocess230769 -Node: Getline Notes231483 -Node: Getline Summary233425 -Ref: table-getline-variants233768 -Node: Read Timeout234627 -Ref: Read Timeout-Footnote-1238372 -Node: Command line directories238429 -Node: Printing239059 -Node: Print240690 -Node: Print Examples242027 -Node: Output Separators244811 -Node: OFMT246571 -Node: Printf247929 -Node: Basic Printf248835 -Node: Control Letters250374 -Node: Format Modifiers254186 -Node: Printf Examples260195 -Node: Redirection262910 -Node: Special Files269894 -Node: Special FD270427 -Ref: Special FD-Footnote-1274052 -Node: Special Network274126 -Node: Special Caveats274976 -Node: Close Files And Pipes275772 -Ref: Close Files And Pipes-Footnote-1282795 -Ref: Close Files And Pipes-Footnote-2282943 -Node: Expressions283093 -Node: Values284225 -Node: Constants284901 -Node: Scalar Constants285581 -Ref: Scalar Constants-Footnote-1286440 -Node: Nondecimal-numbers286622 -Node: Regexp Constants289681 -Node: Using Constant Regexps290156 -Node: Variables293211 -Node: Using Variables293866 -Node: Assignment Options295590 -Node: Conversion297462 -Ref: table-locale-affects302838 -Ref: Conversion-Footnote-1303465 -Node: All Operators303574 -Node: Arithmetic Ops304204 -Node: Concatenation306709 -Ref: Concatenation-Footnote-1309502 -Node: Assignment Ops309622 -Ref: table-assign-ops314610 -Node: Increment Ops316021 -Node: Truth Values and Conditions319491 -Node: Truth Values320574 -Node: Typing and Comparison321623 -Node: Variable Typing322412 -Ref: Variable Typing-Footnote-1326309 -Node: Comparison Operators326431 -Ref: table-relational-ops326841 -Node: POSIX String Comparison330393 -Ref: POSIX String Comparison-Footnote-1331349 -Node: Boolean Ops331487 -Ref: Boolean Ops-Footnote-1335565 -Node: Conditional Exp335656 -Node: Function Calls337388 -Node: Precedence340982 -Node: Locales344651 -Node: Patterns and Actions345740 -Node: Pattern Overview346794 -Node: Regexp Patterns348463 -Node: Expression Patterns349006 -Node: Ranges352691 -Node: BEGIN/END355657 -Node: Using BEGIN/END356419 -Ref: Using BEGIN/END-Footnote-1359150 -Node: I/O And BEGIN/END359256 -Node: BEGINFILE/ENDFILE361538 -Node: Empty364431 -Node: Using Shell Variables364747 -Node: Action Overview367032 -Node: Statements369389 -Node: If Statement371243 -Node: While Statement372742 -Node: Do Statement374786 -Node: For Statement375942 -Node: Switch Statement379094 -Node: Break Statement381191 -Node: Continue Statement383181 -Node: Next Statement384974 -Node: Nextfile Statement387364 -Node: Exit Statement389909 -Node: Built-in Variables392325 -Node: User-modified393420 -Ref: User-modified-Footnote-1401775 -Node: Auto-set401837 -Ref: Auto-set-Footnote-1411745 -Node: ARGC and ARGV411950 -Node: Arrays415801 -Node: Array Basics417306 -Node: Array Intro418132 -Node: Reference to Elements422450 -Node: Assigning Elements424720 -Node: Array Example425211 -Node: Scanning an Array426943 -Node: Controlling Scanning429257 -Ref: Controlling Scanning-Footnote-1434190 -Node: Delete434506 -Ref: Delete-Footnote-1436941 -Node: Numeric Array Subscripts436998 -Node: Uninitialized Subscripts439181 -Node: Multi-dimensional440809 -Node: Multi-scanning443903 -Node: Arrays of Arrays445494 -Node: Functions450139 -Node: Built-in450961 -Node: Calling Built-in452039 -Node: Numeric Functions454027 -Ref: Numeric Functions-Footnote-1457859 -Ref: Numeric Functions-Footnote-2458216 -Ref: Numeric Functions-Footnote-3458264 -Node: String Functions458533 -Ref: String Functions-Footnote-1482030 -Ref: String Functions-Footnote-2482159 -Ref: String Functions-Footnote-3482407 -Node: Gory Details482494 -Ref: table-sub-escapes484173 -Ref: table-sub-posix-92485530 -Ref: table-sub-proposed486876 -Ref: table-posix-sub488229 -Ref: table-gensub-escapes489778 -Ref: Gory Details-Footnote-1490988 -Ref: Gory Details-Footnote-2491039 -Node: I/O Functions491190 -Ref: I/O Functions-Footnote-1497845 -Node: Time Functions497992 -Ref: Time Functions-Footnote-1508884 -Ref: Time Functions-Footnote-2508952 -Ref: Time Functions-Footnote-3509110 -Ref: Time Functions-Footnote-4509221 -Ref: Time Functions-Footnote-5509333 -Ref: Time Functions-Footnote-6509560 -Node: Bitwise Functions509826 -Ref: table-bitwise-ops510384 -Ref: Bitwise Functions-Footnote-1514547 -Node: Type Functions514731 -Node: I18N Functions515201 -Node: User-defined516828 -Node: Definition Syntax517632 -Ref: Definition Syntax-Footnote-1522542 -Node: Function Example522611 -Node: Function Caveats525205 -Node: Calling A Function525626 -Node: Variable Scope526741 -Node: Pass By Value/Reference528716 -Node: Return Statement532156 -Node: Dynamic Typing535137 -Node: Indirect Calls535872 -Node: Internationalization545557 -Node: I18N and L10N546996 -Node: Explaining gettext547682 -Ref: Explaining gettext-Footnote-1552748 -Ref: Explaining gettext-Footnote-2552932 -Node: Programmer i18n553097 -Node: Translator i18n557297 -Node: String Extraction558090 -Ref: String Extraction-Footnote-1559051 -Node: Printf Ordering559137 -Ref: Printf Ordering-Footnote-1561921 -Node: I18N Portability561985 -Ref: I18N Portability-Footnote-1564434 -Node: I18N Example564497 -Ref: I18N Example-Footnote-1567132 -Node: Gawk I18N567204 -Node: Arbitrary Precision Arithmetic567821 -Ref: Arbitrary Precision Arithmetic-Footnote-1570696 -Node: Floating-point Programming570844 -Node: Floating-point Representation576114 -Node: Floating-point Context577218 -Ref: table-ieee-formats578053 -Node: Rounding Mode579425 -Ref: table-rounding-modes580052 -Ref: Rounding Mode-Footnote-1583177 -Node: Arbitrary Precision Floats583358 -Ref: Arbitrary Precision Floats-Footnote-1585399 -Node: Setting Precision585710 -Node: Setting Rounding Mode588468 -Node: Floating-point Constants589385 -Node: Changing Precision590804 -Ref: Changing Precision-Footnote-1592204 -Node: Exact Arithmetic592377 -Node: Integer Programming595390 -Node: Arbitrary Precision Integers597170 -Ref: Arbitrary Precision Integers-Footnote-1600194 -Node: MPFR and GMP Libraries600340 -Node: Advanced Features600725 -Node: Nondecimal Data602248 -Node: Array Sorting603831 -Node: Controlling Array Traversal604528 -Node: Array Sorting Functions612765 -Ref: Array Sorting Functions-Footnote-1616439 -Ref: Array Sorting Functions-Footnote-2616532 -Node: Two-way I/O616726 -Ref: Two-way I/O-Footnote-1622158 -Node: TCP/IP Networking622228 -Node: Profiling625072 -Node: Library Functions632526 -Ref: Library Functions-Footnote-1635533 -Node: Library Names635704 -Ref: Library Names-Footnote-1639175 -Ref: Library Names-Footnote-2639395 -Node: General Functions639481 -Node: Strtonum Function640434 -Node: Assert Function643364 -Node: Round Function646690 -Node: Cliff Random Function648233 -Node: Ordinal Functions649249 -Ref: Ordinal Functions-Footnote-1652319 -Ref: Ordinal Functions-Footnote-2652571 -Node: Join Function652780 -Ref: Join Function-Footnote-1654551 -Node: Gettimeofday Function654751 -Node: Data File Management658466 -Node: Filetrans Function659098 -Node: Rewind Function663237 -Node: File Checking664624 -Node: Empty Files665718 -Node: Ignoring Assigns667948 -Node: Getopt Function669501 -Ref: Getopt Function-Footnote-1680805 -Node: Passwd Functions681008 -Ref: Passwd Functions-Footnote-1689983 -Node: Group Functions690071 -Node: Walking Arrays698155 -Node: Sample Programs699724 -Node: Running Examples700389 -Node: Clones701117 -Node: Cut Program702341 -Node: Egrep Program712186 -Ref: Egrep Program-Footnote-1719959 -Node: Id Program720069 -Node: Split Program723685 -Ref: Split Program-Footnote-1727204 -Node: Tee Program727332 -Node: Uniq Program730135 -Node: Wc Program737564 -Ref: Wc Program-Footnote-1741830 -Ref: Wc Program-Footnote-2742030 -Node: Miscellaneous Programs742122 -Node: Dupword Program743310 -Node: Alarm Program745341 -Node: Translate Program750090 -Ref: Translate Program-Footnote-1754477 -Ref: Translate Program-Footnote-2754705 -Node: Labels Program754839 -Ref: Labels Program-Footnote-1758210 -Node: Word Sorting758294 -Node: History Sorting762178 -Node: Extract Program764017 -Ref: Extract Program-Footnote-1771500 -Node: Simple Sed771628 -Node: Igawk Program774690 -Ref: Igawk Program-Footnote-1789847 -Ref: Igawk Program-Footnote-2790048 -Node: Anagram Program790186 -Node: Signature Program793254 -Node: Debugger794354 -Node: Debugging795306 -Node: Debugging Concepts795739 -Node: Debugging Terms797595 -Node: Awk Debugging800192 -Node: Sample Debugging Session801084 -Node: Debugger Invocation801604 -Node: Finding The Bug802933 -Node: List of Debugger Commands809421 -Node: Breakpoint Control810755 -Node: Debugger Execution Control814419 -Node: Viewing And Changing Data817779 -Node: Execution Stack821135 -Node: Debugger Info822602 -Node: Miscellaneous Debugger Commands826583 -Node: Readline Support832028 -Node: Limitations832859 -Node: Language History835111 -Node: V7/SVR3.1836623 -Node: SVR4838944 -Node: POSIX840386 -Node: BTL841394 -Node: POSIX/GNU842128 -Node: Common Extensions847419 -Node: Ranges and Locales848526 -Ref: Ranges and Locales-Footnote-1853130 -Node: Contributors853351 -Node: Installation857612 -Node: Gawk Distribution858506 -Node: Getting858990 -Node: Extracting859816 -Node: Distribution contents861508 -Node: Unix Installation866730 -Node: Quick Installation867347 -Node: Additional Configuration Options869309 -Node: Configuration Philosophy870786 -Node: Non-Unix Installation873128 -Node: PC Installation873586 -Node: PC Binary Installation874885 -Node: PC Compiling876733 -Node: PC Testing879677 -Node: PC Using880853 -Node: Cygwin885038 -Node: MSYS886038 -Node: VMS Installation886552 -Node: VMS Compilation887155 -Ref: VMS Compilation-Footnote-1888162 -Node: VMS Installation Details888220 -Node: VMS Running889855 -Node: VMS Old Gawk891462 -Node: Bugs891936 -Node: Other Versions895788 -Node: Notes901103 -Node: Compatibility Mode901795 -Node: Additions902578 -Node: Accessing The Source903390 -Node: Adding Code904815 -Node: New Ports910782 -Node: Dynamic Extensions914895 -Node: Internals916335 -Node: Plugin License925157 -Node: Loading Extensions925795 -Node: Sample Library927634 -Node: Internal File Description928324 -Node: Internal File Ops932039 -Ref: Internal File Ops-Footnote-1936781 -Node: Using Internal File Ops936921 -Node: Future Extensions939298 -Node: Basic Concepts941802 -Node: Basic High Level942559 -Ref: Basic High Level-Footnote-1946594 -Node: Basic Data Typing946779 -Node: Floating Point Issues951304 -Node: String Conversion Precision952387 -Ref: String Conversion Precision-Footnote-1954087 -Node: Unexpected Results954196 -Node: POSIX Floating Point Problems956022 -Ref: POSIX Floating Point Problems-Footnote-1959727 -Node: Glossary959765 -Node: Copying984741 -Node: GNU Free Documentation License1022298 -Node: Index1047435 +Ref: Options-Footnote-1116414 +Node: Other Arguments116439 +Node: Naming Standard Input119097 +Node: Environment Variables120191 +Node: AWKPATH Variable120749 +Ref: AWKPATH Variable-Footnote-1123507 +Node: AWKLIBPATH Variable123767 +Node: Other Environment Variables124364 +Node: Exit Status126859 +Node: Include Files127534 +Node: Loading Shared Libraries131103 +Node: Obsolete132328 +Node: Undocumented133025 +Node: Regexp133268 +Node: Regexp Usage134657 +Node: Escape Sequences136683 +Node: Regexp Operators142446 +Ref: Regexp Operators-Footnote-1149826 +Ref: Regexp Operators-Footnote-2149973 +Node: Bracket Expressions150071 +Ref: table-char-classes151961 +Node: GNU Regexp Operators154487 +Node: Case-sensitivity158210 +Ref: Case-sensitivity-Footnote-1161178 +Ref: Case-sensitivity-Footnote-2161413 +Node: Leftmost Longest161521 +Node: Computed Regexps162722 +Node: Reading Files166132 +Node: Records168136 +Ref: Records-Footnote-1176810 +Node: Fields176847 +Ref: Fields-Footnote-1179880 +Node: Nonconstant Fields179966 +Node: Changing Fields182168 +Node: Field Separators188149 +Node: Default Field Splitting190778 +Node: Regexp Field Splitting191895 +Node: Single Character Fields195237 +Node: Command Line Field Separator196296 +Node: Field Splitting Summary199737 +Ref: Field Splitting Summary-Footnote-1202929 +Node: Constant Size203030 +Node: Splitting By Content207614 +Ref: Splitting By Content-Footnote-1211340 +Node: Multiple Line211380 +Ref: Multiple Line-Footnote-1217227 +Node: Getline217406 +Node: Plain Getline219622 +Node: Getline/Variable221711 +Node: Getline/File222852 +Node: Getline/Variable/File224174 +Ref: Getline/Variable/File-Footnote-1225773 +Node: Getline/Pipe225860 +Node: Getline/Variable/Pipe228420 +Node: Getline/Coprocess229527 +Node: Getline/Variable/Coprocess230770 +Node: Getline Notes231484 +Node: Getline Summary233426 +Ref: table-getline-variants233769 +Node: Read Timeout234628 +Ref: Read Timeout-Footnote-1238373 +Node: Command line directories238430 +Node: Printing239060 +Node: Print240691 +Node: Print Examples242028 +Node: Output Separators244812 +Node: OFMT246572 +Node: Printf247930 +Node: Basic Printf248836 +Node: Control Letters250375 +Node: Format Modifiers254187 +Node: Printf Examples260196 +Node: Redirection262911 +Node: Special Files269895 +Node: Special FD270428 +Ref: Special FD-Footnote-1274053 +Node: Special Network274127 +Node: Special Caveats274977 +Node: Close Files And Pipes275773 +Ref: Close Files And Pipes-Footnote-1282796 +Ref: Close Files And Pipes-Footnote-2282944 +Node: Expressions283094 +Node: Values284226 +Node: Constants284902 +Node: Scalar Constants285582 +Ref: Scalar Constants-Footnote-1286441 +Node: Nondecimal-numbers286623 +Node: Regexp Constants289682 +Node: Using Constant Regexps290157 +Node: Variables293212 +Node: Using Variables293867 +Node: Assignment Options295591 +Node: Conversion297463 +Ref: table-locale-affects302839 +Ref: Conversion-Footnote-1303466 +Node: All Operators303575 +Node: Arithmetic Ops304205 +Node: Concatenation306710 +Ref: Concatenation-Footnote-1309503 +Node: Assignment Ops309623 +Ref: table-assign-ops314611 +Node: Increment Ops316022 +Node: Truth Values and Conditions319492 +Node: Truth Values320575 +Node: Typing and Comparison321624 +Node: Variable Typing322413 +Ref: Variable Typing-Footnote-1326310 +Node: Comparison Operators326432 +Ref: table-relational-ops326842 +Node: POSIX String Comparison330394 +Ref: POSIX String Comparison-Footnote-1331350 +Node: Boolean Ops331488 +Ref: Boolean Ops-Footnote-1335566 +Node: Conditional Exp335657 +Node: Function Calls337389 +Node: Precedence340983 +Node: Locales344652 +Node: Patterns and Actions345741 +Node: Pattern Overview346795 +Node: Regexp Patterns348464 +Node: Expression Patterns349007 +Node: Ranges352692 +Node: BEGIN/END355658 +Node: Using BEGIN/END356420 +Ref: Using BEGIN/END-Footnote-1359151 +Node: I/O And BEGIN/END359257 +Node: BEGINFILE/ENDFILE361539 +Node: Empty364432 +Node: Using Shell Variables364748 +Node: Action Overview367033 +Node: Statements369390 +Node: If Statement371244 +Node: While Statement372743 +Node: Do Statement374787 +Node: For Statement375943 +Node: Switch Statement379095 +Node: Break Statement381192 +Node: Continue Statement383182 +Node: Next Statement384975 +Node: Nextfile Statement387365 +Node: Exit Statement389910 +Node: Built-in Variables392326 +Node: User-modified393421 +Ref: User-modified-Footnote-1401776 +Node: Auto-set401838 +Ref: Auto-set-Footnote-1411746 +Node: ARGC and ARGV411951 +Node: Arrays415802 +Node: Array Basics417307 +Node: Array Intro418133 +Node: Reference to Elements422451 +Node: Assigning Elements424721 +Node: Array Example425212 +Node: Scanning an Array426944 +Node: Controlling Scanning429258 +Ref: Controlling Scanning-Footnote-1434191 +Node: Delete434507 +Ref: Delete-Footnote-1436942 +Node: Numeric Array Subscripts436999 +Node: Uninitialized Subscripts439182 +Node: Multi-dimensional440810 +Node: Multi-scanning443904 +Node: Arrays of Arrays445495 +Node: Functions450140 +Node: Built-in450962 +Node: Calling Built-in452040 +Node: Numeric Functions454028 +Ref: Numeric Functions-Footnote-1457860 +Ref: Numeric Functions-Footnote-2458217 +Ref: Numeric Functions-Footnote-3458265 +Node: String Functions458534 +Ref: String Functions-Footnote-1482031 +Ref: String Functions-Footnote-2482160 +Ref: String Functions-Footnote-3482408 +Node: Gory Details482495 +Ref: table-sub-escapes484174 +Ref: table-sub-posix-92485531 +Ref: table-sub-proposed486877 +Ref: table-posix-sub488230 +Ref: table-gensub-escapes489779 +Ref: Gory Details-Footnote-1490989 +Ref: Gory Details-Footnote-2491040 +Node: I/O Functions491191 +Ref: I/O Functions-Footnote-1497846 +Node: Time Functions497993 +Ref: Time Functions-Footnote-1508885 +Ref: Time Functions-Footnote-2508953 +Ref: Time Functions-Footnote-3509111 +Ref: Time Functions-Footnote-4509222 +Ref: Time Functions-Footnote-5509334 +Ref: Time Functions-Footnote-6509561 +Node: Bitwise Functions509827 +Ref: table-bitwise-ops510385 +Ref: Bitwise Functions-Footnote-1514548 +Node: Type Functions514732 +Node: I18N Functions515202 +Node: User-defined516829 +Node: Definition Syntax517633 +Ref: Definition Syntax-Footnote-1522543 +Node: Function Example522612 +Node: Function Caveats525206 +Node: Calling A Function525627 +Node: Variable Scope526742 +Node: Pass By Value/Reference528717 +Node: Return Statement532157 +Node: Dynamic Typing535138 +Node: Indirect Calls535873 +Node: Internationalization545558 +Node: I18N and L10N546997 +Node: Explaining gettext547683 +Ref: Explaining gettext-Footnote-1552749 +Ref: Explaining gettext-Footnote-2552933 +Node: Programmer i18n553098 +Node: Translator i18n557298 +Node: String Extraction558091 +Ref: String Extraction-Footnote-1559052 +Node: Printf Ordering559138 +Ref: Printf Ordering-Footnote-1561922 +Node: I18N Portability561986 +Ref: I18N Portability-Footnote-1564435 +Node: I18N Example564498 +Ref: I18N Example-Footnote-1567133 +Node: Gawk I18N567205 +Node: Arbitrary Precision Arithmetic567822 +Ref: Arbitrary Precision Arithmetic-Footnote-1570697 +Node: Floating-point Programming570845 +Node: Floating-point Representation576115 +Node: Floating-point Context577219 +Ref: table-ieee-formats578054 +Node: Rounding Mode579426 +Ref: table-rounding-modes580053 +Ref: Rounding Mode-Footnote-1583178 +Node: Arbitrary Precision Floats583359 +Ref: Arbitrary Precision Floats-Footnote-1585400 +Node: Setting Precision585711 +Node: Setting Rounding Mode588469 +Node: Floating-point Constants589386 +Node: Changing Precision590805 +Ref: Changing Precision-Footnote-1592205 +Node: Exact Arithmetic592378 +Node: Integer Programming595391 +Node: Arbitrary Precision Integers597171 +Ref: Arbitrary Precision Integers-Footnote-1600195 +Node: MPFR and GMP Libraries600341 +Node: Advanced Features600726 +Node: Nondecimal Data602249 +Node: Array Sorting603832 +Node: Controlling Array Traversal604529 +Node: Array Sorting Functions612766 +Ref: Array Sorting Functions-Footnote-1616440 +Ref: Array Sorting Functions-Footnote-2616533 +Node: Two-way I/O616727 +Ref: Two-way I/O-Footnote-1622159 +Node: TCP/IP Networking622229 +Node: Profiling625073 +Node: Library Functions632527 +Ref: Library Functions-Footnote-1635534 +Node: Library Names635705 +Ref: Library Names-Footnote-1639176 +Ref: Library Names-Footnote-2639396 +Node: General Functions639482 +Node: Strtonum Function640435 +Node: Assert Function643365 +Node: Round Function646691 +Node: Cliff Random Function648234 +Node: Ordinal Functions649250 +Ref: Ordinal Functions-Footnote-1652320 +Ref: Ordinal Functions-Footnote-2652572 +Node: Join Function652781 +Ref: Join Function-Footnote-1654552 +Node: Gettimeofday Function654752 +Node: Data File Management658467 +Node: Filetrans Function659099 +Node: Rewind Function663238 +Node: File Checking664625 +Node: Empty Files665719 +Node: Ignoring Assigns667949 +Node: Getopt Function669502 +Ref: Getopt Function-Footnote-1680806 +Node: Passwd Functions681009 +Ref: Passwd Functions-Footnote-1689984 +Node: Group Functions690072 +Node: Walking Arrays698156 +Node: Sample Programs699725 +Node: Running Examples700390 +Node: Clones701118 +Node: Cut Program702342 +Node: Egrep Program712187 +Ref: Egrep Program-Footnote-1719960 +Node: Id Program720070 +Node: Split Program723686 +Ref: Split Program-Footnote-1727205 +Node: Tee Program727333 +Node: Uniq Program730136 +Node: Wc Program737565 +Ref: Wc Program-Footnote-1741831 +Ref: Wc Program-Footnote-2742031 +Node: Miscellaneous Programs742123 +Node: Dupword Program743311 +Node: Alarm Program745342 +Node: Translate Program750091 +Ref: Translate Program-Footnote-1754478 +Ref: Translate Program-Footnote-2754706 +Node: Labels Program754840 +Ref: Labels Program-Footnote-1758211 +Node: Word Sorting758295 +Node: History Sorting762179 +Node: Extract Program764018 +Ref: Extract Program-Footnote-1771501 +Node: Simple Sed771629 +Node: Igawk Program774691 +Ref: Igawk Program-Footnote-1789848 +Ref: Igawk Program-Footnote-2790049 +Node: Anagram Program790187 +Node: Signature Program793255 +Node: Debugger794355 +Node: Debugging795307 +Node: Debugging Concepts795740 +Node: Debugging Terms797596 +Node: Awk Debugging800193 +Node: Sample Debugging Session801085 +Node: Debugger Invocation801605 +Node: Finding The Bug802934 +Node: List of Debugger Commands809422 +Node: Breakpoint Control810756 +Node: Debugger Execution Control814420 +Node: Viewing And Changing Data817780 +Node: Execution Stack821136 +Node: Debugger Info822603 +Node: Miscellaneous Debugger Commands826584 +Node: Readline Support832029 +Node: Limitations832860 +Node: Language History835112 +Node: V7/SVR3.1836624 +Node: SVR4838945 +Node: POSIX840387 +Node: BTL841395 +Node: POSIX/GNU842129 +Node: Common Extensions847420 +Node: Ranges and Locales848527 +Ref: Ranges and Locales-Footnote-1853131 +Node: Contributors853352 +Node: Installation857613 +Node: Gawk Distribution858507 +Node: Getting858991 +Node: Extracting859817 +Node: Distribution contents861509 +Node: Unix Installation866731 +Node: Quick Installation867348 +Node: Additional Configuration Options869310 +Node: Configuration Philosophy870787 +Node: Non-Unix Installation873129 +Node: PC Installation873587 +Node: PC Binary Installation874886 +Node: PC Compiling876734 +Node: PC Testing879678 +Node: PC Using880854 +Node: Cygwin885039 +Node: MSYS886039 +Node: VMS Installation886553 +Node: VMS Compilation887156 +Ref: VMS Compilation-Footnote-1888163 +Node: VMS Installation Details888221 +Node: VMS Running889856 +Node: VMS Old Gawk891463 +Node: Bugs891937 +Node: Other Versions895789 +Node: Notes901104 +Node: Compatibility Mode901796 +Node: Additions902579 +Node: Accessing The Source903391 +Node: Adding Code904816 +Node: New Ports910783 +Node: Dynamic Extensions914896 +Node: Internals916336 +Node: Plugin License925158 +Node: Loading Extensions925796 +Node: Sample Library927637 +Node: Internal File Description928327 +Node: Internal File Ops932042 +Ref: Internal File Ops-Footnote-1936607 +Node: Using Internal File Ops936747 +Node: Future Extensions939125 +Node: Basic Concepts941629 +Node: Basic High Level942386 +Ref: Basic High Level-Footnote-1946421 +Node: Basic Data Typing946606 +Node: Floating Point Issues951131 +Node: String Conversion Precision952214 +Ref: String Conversion Precision-Footnote-1953914 +Node: Unexpected Results954023 +Node: POSIX Floating Point Problems955849 +Ref: POSIX Floating Point Problems-Footnote-1959554 +Node: Glossary959592 +Node: Copying984568 +Node: GNU Free Documentation License1022125 +Node: Index1047262 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 7e35e769..8c6f3711 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -3235,7 +3235,7 @@ that @command{gawk} accepts and then exit. Load a shared library @var{lib}. This searches for the library using the @env{AWKLIBPATH} environment variable. The correct library suffix for your platform will be supplied by default, so it need not be specified in the library name. -The library initialization routine should be named @code{dlload()}. +The library initialization routine should be named @code{dl_load()}. An alternative is to use the @samp{@@load} keyword inside the program to load a shared library. @@ -30552,7 +30552,7 @@ command line option @option{-l}: $ @kbd{gawk -l libname -f myprog} @end example -This will work only if the initialization routine is named @code{dlload()}. +This will work only if the initialization routine is named @code{dl_load()}. If you use @code{extension()}, the library will be loaded at run time. This means that the functions are available only to the rest of @@ -30576,7 +30576,7 @@ $ @kbd{gawk -l mylib -f myprog} @end example and @command{gawk} will do everything necessary to load in your library, -and then call your @code{dlload()} routine. +and then call your @code{dl_load()} routine. You can always specify the library using an absolute pathname, in which case @command{gawk} will not use @env{AWKLIBPATH} to search for it. @@ -30905,19 +30905,8 @@ When done, return the @code{lstat()} return value: @cindex programming conventions, @command{gawk} internals Finally, it's necessary to provide the ``glue'' that loads the new function(s) into @command{gawk}. By convention, each library has -a routine named @code{dlload()} that does the job: - -@example -/* dlload --- load new builtins in this library */ - -NODE * -dlload(NODE *tree, void *dl) -@{ - make_builtin("chdir", do_chdir, 1); - make_builtin("stat", do_stat, 2); - return make_number((AWKNUM) 0); -@} -@end example +a routine named @code{dl_load()} that does the job. The simplest way +is to use the @code{dl_load_func} macro in @code{gawkapi.h}. And that's it! As an exercise, consider adding functions to implement system calls such as @code{chown()}, @code{chmod()}, @@ -30952,7 +30941,7 @@ within the shared library: @example # file testff.awk BEGIN @{ - extension("./filefuncs.so", "dlload") + extension("./filefuncs.so", "dl_load") chdir(".") # no-op |